[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\"es2015\"],\n  \"plugins\": [\"transform-async-to-generator\"]\n}\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: # Replace with a single Patreon username\nopen_collective: spy-debugger\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\ncustom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".gitignore",
    "content": "# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directory\n# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git\nnode_modules\n\n#Dev\ndev\n"
  },
  {
    "path": ".travis.yml",
    "content": "before_install:\n- npm install babel-cli babel-preset-es2015 mocha\nlanguage: node_js\nnode_js:\n  - \"6\"\n  - \"8\"\n  - \"10\"\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 wuchangming\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "关于spy-debugger\n==========\n一站式页面调试、抓包工具。远程调试任何手机浏览器页面，任何手机移动端webview（如：微信，HybridApp等）。支持HTTP/HTTPS，无需USB连接设备。  \n\n[![npm](https://img.shields.io/npm/v/spy-debugger.svg)](https://www.npmjs.com/package/spy-debugger)\n[![npm](https://img.shields.io/npm/dt/spy-debugger.svg)](https://www.npmjs.com/package/spy-debugger)\n[![Build Status](https://travis-ci.org/wuchangming/spy-debugger.svg?branch=master)](https://travis-ci.org/wuchangming/spy-debugger)  \n\nLanguage: [English](README_EN.md)\n\n特性\n------------\n>  \n1、页面调试＋抓包  \n2、[操作简单](#三分钟上手)，无需USB连接设备   \n3、**支持HTTPS**。  \n4、`spy-debugger`内部集成了[`weinre`](http://people.apache.org/~pmuellr/weinre/docs/latest/)、[`node-mitmproxy`](https://github.com/wuchangming/node-mitmproxy)、[`AnyProxy`](https://github.com/alibaba/anyproxy)。  \n5、自动忽略原生App发起的https请求，只拦截webview发起的https请求。对使用了SSL pinning技术的原生App不造成任何影响。【PS：由于 `iOS 15` 调整代理协议，`iOS 15` 已无法检测请求是否浏览器发起】  \n6、可以配合其它代理工具一起使用(默认使用AnyProxy) [(设置外部代理)](#设置外部代理默认使用anyproxy)  \n\n\n使用案例\n------------\n#### 页面编辑模式\n>  \n启动命令：`spy-debugger -w true`  \n<img src=\"demo/img/spy-debugger-w.gif\" width=\"300px\" />\n\n#### weiner页面调试界面\n>  \n<img src=\"demo/img/demo.png\" width=\"600px\" />\n\n#### anyproxy抓包界面\n>  \n<img src=\"demo/img/AnyProxy.png\" width=\"600px\" />\n\n\n\n\n安装\n------------\nWindows 下\n```\n    npm install spy-debugger -g\n```\n\nMac 下\n```\n    sudo npm install spy-debugger -g\n```\n\n## 三分钟上手\n>  \n第一步：手机和PC保持在同一网络下（比如同时连到一个Wi-Fi下）\n>  \n第二步：命令行输入`spy-debugger`，按命令行提示用浏览器打开相应地址。\n>  \n第三步：设置手机的HTTP代理，代理IP地址设置为PC的IP地址，端口为`spy-debugger`的启动端口(默认端口：9888)。\n- Android设置代理步骤：`设置 - WLAN - 长按选中网络 - 修改网络 - 高级 - 代理设置 - 手动`  \n- iOS设置代理步骤：`设置 - 无线局域网 - 选中网络 - HTTP代理手动`  \n>  \n第四步：手机安装证书。**注：手机必须先设置完代理后再通过(非微信)手机浏览器访问`http://s.xxx`[`(地址二维码)`](demo/img/QRCodeForCert.png)安装证书**（手机首次调试需要安装证书，已安装了证书的手机无需重复安装)。[iOS新安装的证书需要手动打开证书信任](https://github.com/wuchangming/spy-debugger/issues/42)\n>  \n第五步：用手机浏览器访问你要调试的页面即可。\n\n自定义选项\n------------\n#### 端口\n>  \n(默认端口：9888)\n```\nspy-debugger -p 8888\n```\n\n#### 设置外部代理（默认使用AnyProxy）\n>  \n```\nspy-debugger -e http://127.0.0.1:8888\n```\nspy-debugger内置AnyProxy提供抓包功能，但是也可通过设置外部代理和其它抓包代理工具一起使用，如：Charles、Fiddler。\n\n#### 设置页面内容为可编辑模式\n>  \n该功能使页面内容修改更加直观方便。\n(默认： false)\n```\nspy-debugger -w true\n```\n内部实现原理：在需要调试的页面内注入代码：`document.body.contentEditable=true`。暂不支持使用了iscroll框架的页面。\n\n#### 是否允许weinre监控iframe加载的页面\n>  \n(默认： false)\n```\nspy-debugger -i true\n```\n\n#### 是否只拦截浏览器发起的https请求 【PS：由于 `iOS 15` 调整代理协议，已无法检测请求是否浏览器发起】\n>  \n(默认： false)\n```\nspy-debugger -b true\n```\n有些浏览器发出的connect请求没有正确的携带userAgent，这个判断有时候会出错，如**UC浏览器**。这个时候需要设置为false。大多数情况建议启用默认配置：true，由于目前大量App应用自身（非WebView）发出的请求会使用到SSL pinning技术，自定义的证书将不能通过app的证书校验。\n\n#### 是否允许HTTP缓存\n>  \n(默认： false)\n```\nspy-debugger -c true\n```\n\n更多\n------------\n- 修复`weinre`在`node.js` V7版本会崩溃的bug\n\n- 对`weinre`在页面`document ready`事件前，无法打印console.log日志进行了增强修复。\n\n- 增强`weinre`打印未捕获异常(Uncaught Exceptions)功能。\n\n- `spy-debugger`原理是集成了`weinre`，简化了`weinre`需要给每个调试的页面添加js代码。`spy-debugger`原理是拦截所有html页面请求注入`weinre`所需要的js代码。让页面调试更加方便。\n"
  },
  {
    "path": "README_EN.md",
    "content": "About spy-debugger\n==========\nSpy-debugger is one-stop pages inspection and debugger proxy. Spy-debugger can inspect and debugger all the mobile end browers and webview HTML page within the request of HTTP and HTTPS, such as Wechat, Facebook, HybridApp and so on.  \n\n[![npm](https://img.shields.io/npm/v/spy-debugger.svg)](https://www.npmjs.com/package/spy-debugger)\n[![npm](https://img.shields.io/npm/dt/spy-debugger.svg)](https://www.npmjs.com/package/spy-debugger)\n[![Build Status](https://travis-ci.org/wuchangming/spy-debugger.svg?branch=master)](https://travis-ci.org/wuchangming/spy-debugger)  \n\n语言: [中文](./README.md)\n\nFunctions\n------------\n1、HTML page inspection ＋ debugger  \n2、[Easy to use](#only-3-mins-to-set-up)  \n3、**Support HTTPS**  \n4、`spy-debugger` integrated [`weinre`](http://people.apache.org/~pmuellr/weinre/docs/latest/)、[`node-mitmproxy`](https://github.com/wuchangming/node-mitmproxy)、[`AnyProxy`](https://github.com/alibaba/anyproxy)  \n5、`spy-debugger` automately overlooks the HTTPS requests from native App, and it only intercepts the HTTPS requests from webview. It will not cause any impacts to the native App that used SSL pinning.  \n6、`spy-debugger` can be better to use other debugger proxies such as Charles. the default debugger proxy in `spy-debugger` is AnyProxy.[(Set up the exterior proxy)](#set-up-the-exterior-proxy-default-proxy-anyproxy)  \n\n\nDemo\n------------\n#### Page inspection\n<img src=\"demo/img/demo.png\" width=\"650px\" />\n\n#### Debugger\n<img src=\"demo/img/AnyProxy.png\" width=\"650px\" />\n\nInstall\n------------\nWindows\n```\n    npm install spy-debugger -g\n```\n\nMac\n```\n    sudo npm install spy-debugger -g\n```\n\n## Only 3 mins to set up\n\nStep 1: The mobile and PC must be under the same network (both of devices connect same Wi-Fi)\n\nStep 2: Input `spy-debugger` in the command line and input the address on the brower according the command line's tip.\n\nStep 3: Set up proxy on the mobile device. The proxy IP address must be same to the PC device. the port must be `spy-debugger`'s start port(default port: 9888).\n\nStep 4: Install certification to your mobile phone. **note: moblie device must be set up well the proxy first and browe `http://spydebugger.com/cert` by the default brower on the phone.[`(QR code)`](demo/img/QRCodeForCert.png)Install certification**（Only the first time need to install it.)\n\nStep 5: Use any installed browers on the mobile device to open the web page that you want to debugger or inspect.\n\nManual Options\n------------\n#### Port\n(Default Port: 9888)\n```\nspy-debugger -p 8888\n```\n\n#### Set up the exterior proxy (default proxy AnyProxy)\n```\nspy-debugger -e http://127.0.0.1:8888\n```\nspy-debugger supply AnyProxy as default proxy, but you can only set up the exterior proxy to instead of the default proxy such as Charles, Fiddler.\n\n#### whether weinre watch iframe load page\n(default: false)\n```\nspy-debugger -i true\n```\n\n#### whether intercept the HTTPS requests from the brower.【not working in iOS 15】\n(default: false)\n```\nspy-debugger -b true\n```\nThere are some browers that send the connect request with incorrected userAgent. Sometimes this would cause error. such as **UC brower**. In this case, `spy-debugger -b false` can fix this error. In most cases we suggest using the default value `true`. Now there are many native Apps send request with SSL pinning. Manual certification will not pass native app certification.\n\n\n#### whether allow HTTP cache\n(default: false)\n```\nspy-debugger -c true\n```\n\nMore\n------------\n`spy-debugger` integrated `weinre`，simplified that `weinre` needs to add javascript code to each page. `spy-debugger` intercepted the javascript code that need inject to `weinre` when the HTML page send the requests. it can make inspection and debugger easier to use.\n"
  },
  {
    "path": "buildin_modules/weinre/.npmignore",
    "content": ".DS_Store\n.git*\nMakefile\ntest/"
  },
  {
    "path": "buildin_modules/weinre/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n==============================================================\nThis product also include the following software:\n==============================================================\n\n------------------------------------------\nWebKit Web Inspector\nhttp://webkit.org\n------------------------------------------\n\nCopyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc.  All rights reserved.\nCopyright (C) 2007, 2008 Matt Lilek (pe...@gmail.com).\nCopyright (C) 2008, 2009 Anthony Ricaud <ri...@webkit.org>\nCopyright (C) 2008 Nokia Inc.  All rights reserved.\nCopyright (C) 2009 IBM Corp. All rights reserved.\nCopyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.\nCopyright (C) 2009, 2010 Joseph Pecoraro\nCopyright (C) 2009 280 North Inc. All Rights Reserved.\nCopyright (C) 2010 Nikita Vasilyev. All rights reserved.\n\nNote that although WebKit in general contains both BSD and LGPL\nlicensed code, the WebKit Web Inspector code is all BSD licensed\nwith no LGPL code.  \n\nThe wording of the license comments in the source files is not consistent,\nbut corresponds to traditional BSD licenses. The license in some files also \ninclude one of the following conditions:\n\n* Neither the name of Google Inc. nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\n* Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n  its contributors may be used to endorse or promote products derived\n  from this software without specific prior written permission.\n\n* Neither the name of IBM Corp. nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\n------------------------------------------\nUglifyJS\nhttps://github.com/mishoo/UglifyJS\n------------------------------------------\n\nNote that UglifyJS is shipped with WebKit Web Inspector.\n\n                         Author: Mihai Bazon\n                       <mihai.bazon@gmail.com>\n                     http://mihai.bazon.net/blog\n\nDistributed under the BSD license:\n\nCopyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\nBased on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n    * Redistributions of source code must retain the above\n      copyright notice, this list of conditions and the following\n      disclaimer.\n\n    * Redistributions in binary form must reproduce the above\n      copyright notice, this list of conditions and the following\n      disclaimer in the documentation and/or other materials\n      provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\nTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\nTHE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n\n------------------------------------------\ncoffee-script 1.2.0 via npmjs.org\nhttps://github.com/jashkenas/coffee-script\n------------------------------------------\n\nCopyright (c) 2011 Jeremy Ashkenas\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n------------------------------------------\nexpress 2.5.7 via npmjs.org\nhttps://github.com/visionmedia/express\n------------------------------------------\n\n(The MIT License)\n\nCopyright (c) 2009-2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n------------------------------------------\nconnect 1.8.5 via npmjs.org\nhttps://github.com/senchalabs/connect\n------------------------------------------\n\n(The MIT License)\n\nCopyright (c) 2010 Sencha Inc.\nCopyright (c) 2011 LearnBoost\nCopyright (c) 2011 TJ Holowaychuk\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n------------------------------------------\nformidable 1.0.9 via npmjs.org\nhttps://github.com/felixge/node-formidable\n------------------------------------------\n\nAccording to the Readme.md file in the Formidable library:\n\n   \"Formidable is licensed under the MIT license.\"\n\n------------------------------------------\nmime 1.2.5 via npmjs.org\nhttps://github.com/bentomas/node-mime\n------------------------------------------\n\nCopyright (c) 2010 Benjamin Thomas, Robert Kieffer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n------------------------------------------\nmkdirp 0.0.7 via npmjs.org\nhttps://github.com/substack/node-mkdirp\n------------------------------------------\n\nCopyright 2010 James Halliday (mail@substack.net)\n\nThis project is free software released under the MIT/X11 license:\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n------------------------------------------\nqs 0.4.2 via npmjs.org\nhttps://github.com/visionmedia/node-querystring\n------------------------------------------\n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n------------------------------------------\nnopt 1.0.10 via npmjs.org\nhttps://github.com/isaacs/nopt\n------------------------------------------\n\nCopyright 2009, 2010, 2011 Isaac Z. Schlueter.\nAll rights reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n------------------------------------------\nabbrev 1.0.3 via npmjs.org\nhttps://github.com/isaacs/abbrev-js\n------------------------------------------\n\nCopyright 2009, 2010, 2011 Isaac Z. Schlueter.\nAll rights reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n------------------------------------------\nunderscore 1.3.1 via npmjs.org\nhttps://github.com/documentcloud/underscore\n------------------------------------------\n\nCopyright (c) 2009-2012 Jeremy Ashkenas, DocumentCloud\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "buildin_modules/weinre/NOTICE",
    "content": "Apache Cordova weinre\nCopyright 2012 The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n"
  },
  {
    "path": "buildin_modules/weinre/README.md",
    "content": "<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\nweinre is WEb INspector REmote.\nPronounced like the word \"winery\".\nOr maybe like the word \"weiner\".\nWho knows, really.\n\nweinre is a debugger for web pages,\nlike FireBug (for FireFox) and Web Inspector (for WebKit-based browsers),\nexcept it's designed to work remotely, and in particular,\nto allow you debug web pages on a mobile device such as a phone.\n\nFor more information on weinre:\n[http://people.apache.org/~pmuellr/weinre/](http://people.apache.org/~pmuellr/weinre/)\n\nrunning\n-------\n\nFor more information about running weinre, you can start the server\nand browse the documentation online.\n\nStart the server with the following command\n\n    node weinre\n\nThis will start the server, and display a message with the URL to the\nserver.  Browse to that URL in your web browser, and then click on\n'documentation' link, which will display weinre's online documentation.\nFrom there click on the 'Running' page to get more information about\nrunning weinre.\n\nsource\n------\n\nFollow the link for more information at the top of this file\nfor instructions on obtaining source.\n\nIf you're reading this file as part of the source distribution of weinre,\nyou will need to run a 'build' before being able to run weinre.  See the\n`README.md` file in the root directory of the weinre source distribution\nfor more information.\n\n"
  },
  {
    "path": "buildin_modules/weinre/build-info.txt",
    "content": "weinre build 2.0.0-pre-IXE4AG4O by wuchangming\ngit: 746a5817d014acdda673115e2ee458ec6c9b7673 fix(console): fixed chrome bug, add ArrowUp, ArrowDown, ArrowRight\n"
  },
  {
    "path": "buildin_modules/weinre/interfaces/WeinreClientCommands.idl",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// messages from the client to the server\n\nmodule weinre {\n    interface WeinreClientCommands {\n\n        void registerClient(out string clientId);\n\n        void getTargets(out Object[] targets);\n        void getClients(out Object[] clients);\n\n        void connectTarget(in string clientId, in string targetId);\n        void disconnectTarget(in string clientId);\n\n        void getExtensions(out string[] extensions)\n\n        void logDebug(   in string message );\n        void logInfo(    in string message );\n        void logWarning( in string message );\n        void logError(   in string message );\n    };\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/interfaces/WeinreClientEvents.idl",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// messages from the server to the client\n\nmodule weinre {\n    interface WeinreClientEvents {\n\n        void clientRegistered(Object client);\n        void targetRegistered(Object target);\n\n        void clientUnregistered(string clientId);\n        void targetUnregistered(string targetId);\n\n        void connectionCreated(string clientId, string targetId);\n        void connectionDestroyed(string clientId, string targetId);\n\n        void sendCallback(string callbackId, Object result);\n\n        void serverProperties(Object properties);\n    };\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/interfaces/WeinreExtraClientCommands.idl",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// extra messages from the client to the target\n\nmodule weinre {\n    interface WeinreExtraClientCommands {\n\n        void getDatabases(out Object[] databaseRecords);\n\n    };\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/interfaces/WeinreExtraTargetEvents.idl",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// extra messages from the target to the client\n\nmodule weinre {\n    interface WeinreExtraTargetEvents {\n\n        void databaseOpened(in Object databaseRecord);\n\n    };\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/interfaces/WeinreTargetCommands.idl",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// messages from the target to the server\n\nmodule weinre {\n    interface WeinreTargetCommands {\n\n        void registerTarget(int url, out string targetId);\n\n        void sendClientCallback(string callbackId, Object args);\n\n        void logDebug(   in string message );\n        void logInfo(    in string message );\n        void logWarning( in string message );\n        void logError(   in string message );\n    };\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/interfaces/WeinreTargetEvents.idl",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// messages from the server to the target\n\nmodule weinre {\n    interface WeinreTargetEvents {\n\n        void connectionCreated(string clientId, string targetId);\n        void connectionDestroyed(string clientId, string targetId);\n\n        void sendCallback(string callbackId, Object result);\n\n    };\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/lib/Channel.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar AnonymousId, Channel, MessageQueue, channelManager, genJSON, messageHandler, parseJSON, utils, _,\n  __slice = [].slice;\n\n_ = require('underscore');\n\nutils = require('./utils');\n\nchannelManager = require('./channelManager');\n\nmessageHandler = require('./messageHandler');\n\nMessageQueue = require('./MessageQueue');\n\nAnonymousId = 'anonymous';\n\nmodule.exports = utils.registerClass(Channel = (function() {\n  function Channel(pathPrefix, id, remoteAddress, isClient) {\n    var prefix;\n    this.pathPrefix = pathPrefix;\n    this.id = id;\n    this.remoteAddress = remoteAddress;\n    this.isClient = isClient;\n    prefix = this.isClient ? 'c-' : 't-';\n    this.name = \"\" + prefix + (utils.getNextSequenceNumber());\n    this.messageQueue = new MessageQueue;\n    this.isClosed = false;\n    this.connections = [];\n    this.isTarget = !this.isClient;\n    this.readTimeout = utils.options.readTimeout * 1000;\n    if (!this.id) {\n      this.id = AnonymousId;\n    }\n    this.description = {\n      channel: this.name,\n      id: this.id,\n      hostName: this.remoteAddress,\n      remoteAddress: this.remoteAddress\n    };\n    this.updateLastRead();\n    channelManager.created(this);\n  }\n\n  Channel.prototype.close = function() {\n    if (this.isClosed) {\n      return;\n    }\n    channelManager.destroyed(this);\n    this.isClosed = true;\n    return this.messageQueue.shutdown();\n  };\n\n  Channel.prototype.sendCallback = function() {\n    var args, callbackId, intfName;\n    intfName = arguments[0], callbackId = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];\n    if (!callbackId) {\n      return;\n    }\n    args.unshift(callbackId);\n    return this.sendMessage.apply(this, [intfName, 'sendCallback'].concat(__slice.call(args)));\n  };\n\n  Channel.prototype.sendMessage = function() {\n    var args, intfName, message, method;\n    intfName = arguments[0], method = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];\n    message = genJSON({\n      \"interface\": intfName,\n      method: method,\n      args: args\n    });\n    return this.messageQueue.push(message);\n  };\n\n  Channel.prototype.handleMessages = function(messages) {\n    var message, _i, _len, _results;\n    _results = [];\n    for (_i = 0, _len = messages.length; _i < _len; _i++) {\n      message = messages[_i];\n      message = parseJSON(message);\n      if (!message) {\n        continue;\n      }\n      _results.push(messageHandler.handleMessage(this, message));\n    }\n    return _results;\n  };\n\n  Channel.prototype.getMessages = function(callback) {\n    this.updateLastRead();\n    if (this.isClosed) {\n      return callback.call(null, null);\n    }\n    return this.messageQueue.pullAll(this.readTimeout, callback);\n  };\n\n  Channel.prototype.updateLastRead = function() {\n    return this.lastRead = (new Date).valueOf();\n  };\n\n  Channel.prototype.toString = function() {\n    var connections;\n    connections = _.map(this.connections, function(val) {\n      return val.name;\n    }).join(',');\n    return \"Channel(\" + this.name + \", closed:\" + this.isClosed + \", connections:[\" + connections + \"])\";\n  };\n\n  return Channel;\n\n})());\n\nparseJSON = function(message) {\n  var e;\n  try {\n    return JSON.parse(message);\n  } catch (_error) {\n    e = _error;\n    return null;\n  }\n};\n\ngenJSON = function(message) {\n  var e;\n  try {\n    return JSON.stringify(message);\n  } catch (_error) {\n    e = _error;\n    return null;\n  }\n};\n"
  },
  {
    "path": "buildin_modules/weinre/lib/HttpChannelHandler.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar Channel, HttpChannelHandler, channelManager, handleCreate, handleError, handleGet, handleOptions, handlePost, setCORSHeaders, setCacheHeaders, utils, _;\n\n_ = require('underscore');\n\nutils = require('./utils');\n\nChannel = require('./Channel');\n\nchannelManager = require('./channelManager');\n\nmodule.exports = utils.registerClass(HttpChannelHandler = (function() {\n  function HttpChannelHandler(pathPrefix) {\n    this.pathPrefix = pathPrefix;\n    if (this.pathPrefix === '/ws/client') {\n      this.isClient = true;\n    } else if (this.pathPrefix === '/ws/target') {\n      this.isClient = false;\n    } else {\n      utils.pitch(\"invalid pathPrefix: \" + this.pathPrefix);\n    }\n    this.isTarget = !this.isClient;\n  }\n\n  HttpChannelHandler.prototype.handle = function(request, response, uri) {\n    var channelName, parts;\n    setCORSHeaders(request, response);\n    setCacheHeaders(request, response);\n    if (uri[0] !== '/') {\n      return handleError(request, response, 404);\n    }\n    if (uri === '/') {\n      if (request.method === 'OPTIONS') {\n        return handleOptions(request, response);\n      }\n      if (request.method === 'POST') {\n        return handleCreate(this.pathPrefix, this.isClient, request, response);\n      }\n      return handleError(request, response, 405);\n    }\n    parts = uri.split('/');\n    if (parts.length > 2) {\n      return handleError(request, response, 404);\n    }\n    channelName = parts[1];\n    if (request.method === 'OPTIONS') {\n      return handleOptions(request, response);\n    }\n    if (request.method === 'GET') {\n      return handleGet(request, response, channelName);\n    }\n    if (request.method === 'POST') {\n      return handlePost(request, response, channelName);\n    }\n    return handleError(request, response, 405);\n  };\n\n  return HttpChannelHandler;\n\n})());\n\nhandleCreate = function(pathPrefix, isClient, request, response) {\n  var channel, id, remoteAddress, _ref, _ref1;\n  id = (_ref = request.body) != null ? _ref.id : void 0;\n  remoteAddress = ((_ref1 = request.connection) != null ? _ref1.remoteAddress : void 0) || \"\";\n  channel = new Channel(pathPrefix, id, remoteAddress, isClient);\n  response.contentType('application/json');\n  return response.send(JSON.stringify({\n    channel: channel.name,\n    id: channel.id\n  }));\n};\n\nhandleGet = function(request, response, channelName) {\n  var channel, remoteAddress, _ref;\n  remoteAddress = ((_ref = request.connection) != null ? _ref.remoteAddress : void 0) || \"\";\n  channel = channelManager.getChannel(channelName, remoteAddress);\n  if (!channel) {\n    return handleError(request, response, 404);\n  }\n  return channel.getMessages((function(_this) {\n    return function(messages) {\n      if (channel.isClosed) {\n        return handleError(request, response, 404);\n      }\n      if (!messages) {\n        return handleError(request, response, 404);\n      }\n      response.contentType('application/json');\n      return response.send(JSON.stringify(messages));\n    };\n  })(this));\n};\n\nhandlePost = function(request, response, channelName) {\n  var channel, remoteAddress, _ref;\n  remoteAddress = ((_ref = request.connection) != null ? _ref.remoteAddress : void 0) || \"\";\n  channel = channelManager.getChannel(channelName, remoteAddress);\n  if (!channel) {\n    return handleError(request, response, 404);\n  }\n  channel.handleMessages(request.body);\n  return response.send('');\n};\n\nhandleOptions = function(request, response) {\n  return response.send('');\n};\n\nhandleError = function(request, response, status) {\n  return response.send(status);\n};\n\nsetCORSHeaders = function(request, response) {\n  var origin;\n  origin = request.header('Origin');\n  if (!origin) {\n    return;\n  }\n  response.header('Access-Control-Allow-Origin', origin);\n  response.header('Access-Control-Max-Age', '600');\n  return response.header('Access-Control-Allow-Methods', 'GET, POST');\n};\n\nsetCacheHeaders = function(request, response) {\n  response.header('Pragma', 'no-cache');\n  response.header('Expires', '0');\n  response.header('Cache-Control', 'no-cache');\n  return response.header('Cache-Control', 'no-store');\n};\n"
  },
  {
    "path": "buildin_modules/weinre/lib/MessageQueue.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar MessageQueue, utils, _;\n\n_ = require('underscore');\n\nutils = require('./utils');\n\nmodule.exports = utils.registerClass(MessageQueue = (function() {\n  function MessageQueue() {\n    this.messages = [];\n    this.closed = false;\n    this.callback = null;\n    this.timer = null;\n    _.bindAll(this, '_timerExpired', '_updated');\n  }\n\n  MessageQueue.prototype.shutdown = function() {\n    if (this.closed) {\n      return;\n    }\n    this.closed = true;\n    if (this.timer) {\n      clearTimeout(this.timer);\n    }\n    if (this.callback) {\n      this.callback.call(null, this.messages);\n    }\n    this.callback = null;\n    this.messages = null;\n    return this.timer = null;\n  };\n\n  MessageQueue.prototype.push = function(message) {\n    if (this.closed) {\n      return;\n    }\n    this.messages.push(message);\n    return process.nextTick(this._updated);\n  };\n\n  MessageQueue.prototype.pullAll = function(timeout, callback) {\n    if (this.closed) {\n      return callback.call(null, null);\n    }\n    if (this.callback) {\n      return callback.call(null, []);\n    }\n    if (this.messages.length) {\n      callback.call(null, this.messages);\n      this.messages = [];\n      return;\n    }\n    this.callback = callback;\n    return this.timer = setTimeout(this._timerExpired, timeout);\n  };\n\n  MessageQueue.prototype._timerExpired = function() {\n    return this._updated();\n  };\n\n  MessageQueue.prototype._updated = function() {\n    var callback, messages;\n    if (this.closed) {\n      return;\n    }\n    if (!this.callback) {\n      return;\n    }\n    callback = this.callback;\n    messages = this.messages;\n    if (this.timer) {\n      clearTimeout(this.timer);\n    }\n    this.callback = null;\n    this.messages = [];\n    this.timer = null;\n    return callback.call(null, messages);\n  };\n\n  return MessageQueue;\n\n})());\n"
  },
  {
    "path": "buildin_modules/weinre/lib/channelManager.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar ChannelManager, WeinreClientEvents, WeinreTargetEvents, channelManager, serviceManager, utils, _;\n\n_ = require('underscore');\n\nutils = require('./utils');\n\nserviceManager = require('./serviceManager');\n\nWeinreClientEvents = null;\n\nWeinreTargetEvents = null;\n\nchannelManager = null;\n\nutils.registerClass(ChannelManager = (function() {\n  function ChannelManager() {\n    this.channels = {};\n  }\n\n  ChannelManager.prototype.initialize = function() {\n    WeinreClientEvents = serviceManager.get('WeinreClientEvents');\n    WeinreTargetEvents = serviceManager.get('WeinreTargetEvents');\n    if (!WeinreClientEvents) {\n      utils.exit('WeinreClientEvents service not registered');\n    }\n    if (!WeinreTargetEvents) {\n      return utils.exit('WeinreTargetEvents service not registered');\n    }\n  };\n\n  ChannelManager.prototype.created = function(channel) {\n    return this.channels[channel.name] = channel;\n  };\n\n  ChannelManager.prototype.destroyed = function(channel) {\n    var clients, connection, _i, _j, _len, _len1, _ref, _ref1;\n    if (channel.isClient) {\n      _ref = channel.connections;\n      for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n        connection = _ref[_i];\n        this.disconnectChannels(channel, connection);\n      }\n    } else {\n      _ref1 = channel.connections;\n      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {\n        connection = _ref1[_j];\n        this.disconnectChannels(connection, channel);\n      }\n    }\n    clients = this.getClientChannels(channel.id);\n    if (channel.isClient) {\n      WeinreClientEvents.clientUnregistered(clients, channel.name);\n    } else {\n      WeinreClientEvents.targetUnregistered(clients, channel.name);\n    }\n    return delete this.channels[channel.name];\n  };\n\n  ChannelManager.prototype.getChannel = function(name, remoteAddress) {\n    var channel;\n    if (!_.has(this.channels, name)) {\n      return null;\n    }\n    channel = this.channels[name];\n    if (!channel) {\n      return null;\n    }\n    return channel;\n  };\n\n  ChannelManager.prototype.connectChannels = function(client, target) {\n    var clients;\n    if (client.isClosed || target.isClosed) {\n      return;\n    }\n    if (client.connections.length) {\n      this.disconnectChannels(client, client.connections[0]);\n    }\n    client.connections.push(target);\n    target.connections.push(client);\n    clients = this.getClientChannels(client.id);\n    WeinreClientEvents.connectionCreated(clients, client.name, target.name);\n    return WeinreTargetEvents.connectionCreated(target, client.name, target.name);\n  };\n\n  ChannelManager.prototype.disconnectChannels = function(client, target) {\n    var clients;\n    clients = this.getClientChannels(client.id);\n    WeinreClientEvents.connectionDestroyed(clients, client.name, target.name);\n    WeinreTargetEvents.connectionDestroyed(target, client.name, target.name);\n    client.connections = _.without(client.connections, target);\n    return target.connections = _.without(target.connections, client);\n  };\n\n  ChannelManager.prototype.getChannels = function(id) {\n    if (id != null) {\n      return _.filter(this.channels, function(item) {\n        return item.id === id;\n      });\n    } else {\n      return _.values(this.channels);\n    }\n  };\n\n  ChannelManager.prototype.getClientChannels = function(id) {\n    return _.filter(this.channels, function(item) {\n      return item.isClient && item.id === id;\n    });\n  };\n\n  ChannelManager.prototype.getTargetChannels = function(id) {\n    return _.filter(this.channels, function(item) {\n      return item.isTarget && item.id === id;\n    });\n  };\n\n  return ChannelManager;\n\n})());\n\nmodule.exports = new ChannelManager;\n"
  },
  {
    "path": "buildin_modules/weinre/lib/cli.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar fs, getDotWeinreServerProperties, getTildeReplacement, nopt, optionDefaults, path, printHelp, printNoptError, replaceTilde, utils, weinre, _;\n\nfs = require('fs');\n\npath = require('path');\n\n_ = require('underscore');\n\nnopt = require('nopt');\n\nutils = require('./utils');\n\nweinre = require('./weinre');\n\noptionDefaults = {\n  httpPort: 8080,\n  boundHost: 'localhost',\n  verbose: false,\n  debug: false,\n  readTimeout: 5\n};\n\nexports.run = function() {\n  var args, knownOpts, opts, parsedOpts, shortHands;\n  knownOpts = {\n    httpPort: Number,\n    boundHost: String,\n    verbose: Boolean,\n    debug: Boolean,\n    readTimeout: Number,\n    deathTimeout: Number,\n    help: Boolean\n  };\n  shortHands = {\n    '?': ['--help'],\n    'h': ['--help']\n  };\n  nopt.invalidHandler = printNoptError;\n  parsedOpts = nopt(knownOpts, shortHands, process.argv, 2);\n  if (parsedOpts.help) {\n    printHelp();\n  }\n  args = parsedOpts.argv.remain;\n  if (args.length !== 0) {\n    printHelp();\n  }\n  delete parsedOpts.argv;\n  opts = _.extend({}, optionDefaults, getDotWeinreServerProperties(), parsedOpts);\n  if (opts.deathTimeout == null) {\n    opts.deathTimeout = 3 * opts.readTimeout;\n  }\n  utils.setOptions(opts);\n  return weinre.run(opts);\n};\n\nprintNoptError = function(key, val, types) {\n  return utils.exit(\"error with option '\" + key + \"', value '\" + val + \"'\");\n};\n\nprintHelp = function() {\n  var version;\n  version = weinre.getVersion();\n  console.error(\"usage:   \" + utils.Program + \" [options]\\nversion: \" + version + \"\\n\\noptions:\\n    --httpPort     port to run the http server on        default: \" + optionDefaults.httpPort + \"\\n    --boundHost    ip address to bind the server to      default: \" + optionDefaults.boundHost + \"\\n    --verbose      print more diagnostics                default: \" + optionDefaults.verbose + \"\\n    --debug        print even more diagnostics           default: \" + optionDefaults.debug + \"\\n    --readTimeout  seconds to wait for a client message  default: \" + optionDefaults.readTimeout + \"\\n    --deathTimeout seconds to wait to kill client        default: 3*readTimeout\\n\\n--boundHost can be an ip address, hostname, or -all-, where -all-\\nmeans binding to all ip address on the current machine'\\n\\nfor more info see: http://people.apache.org/~pmuellr/weinre/\");\n  return process.exit();\n};\n\ngetDotWeinreServerProperties = function() {\n  var contents, fileName, key, line, lines, match, properties, val, _i, _len;\n  properties = {};\n  fileName = replaceTilde('~/.weinre/server.properties');\n  if (!utils.fileExistsSync(fileName)) {\n    return properties;\n  }\n  contents = fs.readFileSync(fileName, 'utf8');\n  lines = contents.split('\\n');\n  for (_i = 0, _len = lines.length; _i < _len; _i++) {\n    line = lines[_i];\n    line = line.replace(/#.*/, '');\n    match = line.match(/\\s*(\\w+)\\s*:\\s*(.+)\\s*/);\n    if (!match) {\n      continue;\n    }\n    key = utils.trim(match[1]);\n    val = utils.trim(match[2]);\n    properties[key] = val;\n  }\n  return properties;\n};\n\nreplaceTilde = function(fileName) {\n  return fileName.replace('~', getTildeReplacement());\n};\n\ngetTildeReplacement = function() {\n  return process.env[\"HOME\"] || process.env[\"USERPROFILE\"] || '.';\n};\n"
  },
  {
    "path": "buildin_modules/weinre/lib/dumpingHandler.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar dumpResponse, dumpingHandler, enhance, utils, _;\n\n_ = require('underscore');\n\nutils = require('./utils');\n\ndumpingHandler = function(request, response, uri) {\n  var element, originalSend, _i, _len, _ref, _results;\n  originalSend = response.send;\n  response.send = function(body) {\n    return dumpResponse(originalSend, body, request, response, uri);\n  };\n  if (request.method !== 'POST') {\n    return;\n  }\n  utils.logVerbose('--------------------------------------------------');\n  utils.logVerbose(\"\" + request.method + \" \" + uri + \" [request]\");\n  if (_.isArray(request.body)) {\n    _ref = request.body;\n    _results = [];\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      element = _ref[_i];\n      _results.push(utils.logVerbose(\"   \" + (enhance(JSON.parse(element)))));\n    }\n    return _results;\n  } else {\n    return utils.logVerbose(\"   \" + (enhance(request.body)));\n  }\n};\n\ndumpResponse = function(originalSend, body, request, response, uri) {\n  var e, element, _i, _len, _ref, _results;\n  originalSend.call(response, body);\n  if ((_ref = request.method) !== 'GET' && _ref !== 'POST') {\n    return;\n  }\n  try {\n    body = JSON.parse(body);\n  } catch (_error) {\n    e = _error;\n    return;\n  }\n  if (_.isArray(body) && (body.length === 0)) {\n    return;\n  }\n  utils.logVerbose('--------------------------------------------------');\n  utils.logVerbose(\"\" + request.method + \" \" + uri + \" \" + response.statusCode + \" [response]\");\n  if (_.isArray(body)) {\n    _results = [];\n    for (_i = 0, _len = body.length; _i < _len; _i++) {\n      element = body[_i];\n      _results.push(utils.logVerbose(\"   \" + (enhance(JSON.parse(element)))));\n    }\n    return _results;\n  } else {\n    return utils.logVerbose(\"   \" + (enhance(body)));\n  }\n};\n\nenhance = function(object) {\n  var args, signature;\n  if (!object[\"interface\"] || !object.method || !object.args) {\n    return JSON.stringify(object);\n  }\n  signature = \"\" + object[\"interface\"] + \".\" + object.method;\n  args = JSON.stringify(object.args);\n  if (args.length > 500) {\n    args = \"\" + (args.substr(0, 50)) + \"...\";\n  }\n  return \"\" + signature + \"(\" + args + \")\";\n};\n\nmodule.exports = dumpingHandler;\n"
  },
  {
    "path": "buildin_modules/weinre/lib/extensionManager.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar ExtensionManager, utils;\n\nutils = require('./utils');\n\nutils.registerClass(ExtensionManager = (function() {\n  function ExtensionManager() {\n    this.extensions = [];\n  }\n\n  return ExtensionManager;\n\n})());\n\nmodule.exports = new ExtensionManager;\n"
  },
  {
    "path": "buildin_modules/weinre/lib/jsonBodyParser.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar jsonBodyParser, parseBodyAsJSON;\n\njsonBodyParser = function() {\n  return function(request, response, next) {\n    return parseBodyAsJSON(request, response, next);\n  };\n};\n\nparseBodyAsJSON = function(request, response, next) {\n  var buffer;\n  if (request.body) {\n    return next();\n  }\n  request.body = {};\n  if (request.method !== 'POST') {\n    return next();\n  }\n  request.setEncoding('utf8');\n  buffer = '';\n  request.on('data', function(chunk) {\n    return buffer += chunk;\n  });\n  return request.on('end', function() {\n    var e;\n    if ('' === buffer) {\n      return next();\n    }\n    try {\n      request.body = JSON.parse(buffer);\n      return next();\n    } catch (_error) {\n      e = _error;\n      return next(e);\n    }\n  });\n};\n\nmodule.exports = jsonBodyParser;\n"
  },
  {
    "path": "buildin_modules/weinre/lib/messageHandler.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar MessageHandler, channelManager, serviceManager, utils,\n  __slice = [].slice;\n\nutils = require('./utils');\n\nchannelManager = require('./channelManager');\n\nserviceManager = require('./serviceManager');\n\nutils.registerClass(MessageHandler = (function() {\n  function MessageHandler() {}\n\n  MessageHandler.prototype.handleMessage = function(channel, message) {\n    return this._serviceMethodInvoker(channel, message[\"interface\"], message.method, message.args);\n  };\n\n  MessageHandler.prototype._serviceMethodInvoker = function(channel, intfName, method, args) {\n    var e, methodSignature, service;\n    methodSignature = \"\" + intfName + \".\" + method + \"()\";\n    service = serviceManager.get(intfName);\n    if (!service) {\n      return this._redirectToConnections(channel, intfName, method, args);\n    }\n    args = args.slice();\n    args.unshift(channel);\n    try {\n      return service[method].apply(service, args);\n    } catch (_error) {\n      e = _error;\n      utils.log(\"error running service method \" + methodSignature + \": \" + e);\n      return utils.log(\"stack:\\n\" + e.stack);\n    }\n  };\n\n  MessageHandler.prototype._redirectToConnections = function(channel, intfName, method, args) {\n    var connection, _i, _len, _ref, _results;\n    _ref = channel.connections;\n    _results = [];\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      connection = _ref[_i];\n      _results.push(connection.sendMessage.apply(connection, [intfName, method].concat(__slice.call(args))));\n    }\n    return _results;\n  };\n\n  return MessageHandler;\n\n})());\n\nmodule.exports = new MessageHandler;\n"
  },
  {
    "path": "buildin_modules/weinre/lib/service/WeinreClientCommands.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar WeinreClientCommands, WeinreClientEvents, channelManager, extensionManager, serviceManager, utils, weinre, _,\n  __hasProp = {}.hasOwnProperty;\n\n_ = require('underscore');\n\nweinre = require('../weinre');\n\nutils = require('../utils');\n\nchannelManager = require('../channelManager');\n\nserviceManager = require('../serviceManager');\n\nextensionManager = require('../extensionManager');\n\nWeinreClientEvents = serviceManager.get('WeinreClientEvents');\n\nmodule.exports = utils.registerClass(WeinreClientCommands = (function() {\n  function WeinreClientCommands() {}\n\n  WeinreClientCommands.prototype.registerClient = function(channel, callbackId) {\n    var clients, key, options, val, _ref;\n    if (callbackId) {\n      WeinreClientEvents.sendCallback(channel, callbackId, channel.description);\n    }\n    options = _.extend({}, utils.options);\n    for (key in options) {\n      if (!__hasProp.call(options, key)) continue;\n      val = options[key];\n      if ((_ref = typeof val) === 'number' || _ref === 'boolean') {\n        options[key] = \"\" + val;\n      }\n    }\n    options.version = weinre.getVersion();\n    WeinreClientEvents.serverProperties(channel, options);\n    clients = channelManager.getClientChannels(channel.id);\n    return WeinreClientEvents.clientRegistered(clients, channel.description);\n  };\n\n  WeinreClientCommands.prototype.getTargets = function(channel, callbackId) {\n    var channels, result;\n    channels = channelManager.getTargetChannels(channel.id);\n    result = _.pluck(channels, 'description');\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId, [result]);\n    }\n  };\n\n  WeinreClientCommands.prototype.getClients = function(channel, callbackId) {\n    var channels, result;\n    channels = channelManager.getClientChannels(channel.id);\n    result = _.pluck(channels, 'description');\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId, [result]);\n    }\n  };\n\n  WeinreClientCommands.prototype.getExtensions = function(channel, callbackId) {\n    var extension, result;\n    result = (function() {\n      var _i, _len, _ref, _results;\n      _ref = extensionManager.extensions;\n      _results = [];\n      for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n        extension = _ref[_i];\n        _results.push({\n          startPage: \"extensions/\" + extension + \"/extension.html\"\n        });\n      }\n      return _results;\n    })();\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId, [result]);\n    }\n  };\n\n  WeinreClientCommands.prototype.connectTarget = function(channel, clientName, targetName, callbackId) {\n    var client, target;\n    client = channelManager.getChannel(clientName);\n    if (!client) {\n      return;\n    }\n    target = channelManager.getChannel(targetName);\n    if (!target) {\n      return;\n    }\n    channelManager.connectChannels(client, target);\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId);\n    }\n  };\n\n  WeinreClientCommands.prototype.disconnectTarget = function(channel, clientName, callbackId) {\n    var client, target;\n    client = connectionManager.getClient(clientName);\n    if (!client) {\n      return;\n    }\n    target = client.getConnectedTarget();\n    if (!target) {\n      return;\n    }\n    connectionManager.disconnect(client, target);\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId);\n    }\n  };\n\n  WeinreClientCommands.prototype.logDebug = function(channel, message, callbackId) {\n    utils.logVerbose(\"client \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId);\n    }\n  };\n\n  WeinreClientCommands.prototype.logInfo = function(channel, message, callbackId) {\n    utils.log(\"client \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId);\n    }\n  };\n\n  WeinreClientCommands.prototype.logWarning = function(channel, message, callbackId) {\n    utils.log(\"client \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId);\n    }\n  };\n\n  WeinreClientCommands.prototype.logError = function(channel, message, callbackId) {\n    utils.log(\"client \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreClientEvents.sendCallback(channel, callbackId);\n    }\n  };\n\n  return WeinreClientCommands;\n\n})());\n"
  },
  {
    "path": "buildin_modules/weinre/lib/service/WeinreTargetCommands.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar WeinreClientEvents, WeinreTargetCommands, WeinreTargetEvents, channelManager, getCallbackChannel, serviceManager, utils;\n\nutils = require('../utils');\n\nchannelManager = require('../channelManager');\n\nserviceManager = require('../serviceManager');\n\nWeinreClientEvents = serviceManager.get('WeinreClientEvents');\n\nWeinreTargetEvents = serviceManager.get('WeinreTargetEvents');\n\nmodule.exports = utils.registerClass(WeinreTargetCommands = (function() {\n  function WeinreTargetCommands() {}\n\n  WeinreTargetCommands.prototype.registerTarget = function(channel, url, callbackId) {\n    var clients;\n    channel.description.url = url;\n    clients = channelManager.getClientChannels(channel.id);\n    WeinreClientEvents.targetRegistered(clients, channel.description);\n    if (callbackId) {\n      return WeinreTargetEvents.sendCallback(channel, callbackId, channel.description);\n    }\n  };\n\n  WeinreTargetCommands.prototype.sendClientCallback = function(channel, clientCallbackId, args, callbackId) {\n    var callbackChannel;\n    callbackChannel = getCallbackChannel(clientCallbackId);\n    if (!callbackChannel) {\n      return main.warn(\"\" + this.constructor.name + \".sendClientCallback() sent with invalid callbackId: \" + clientCallbackId);\n    }\n    callbackChannel = channelManager.getChannel(callbackChannel);\n    if (!callbackChannel) {\n      return main.warn(\"\" + this.constructor.name + \".sendClientCallback() unable to find channel : \" + clientCallbackId);\n    }\n    WeinreClientEvents.sendCallback(callbackChannel, clientCallbackId, args);\n    if (callbackId) {\n      return WeinreTargetEvents.sendCallback(channel, callbackId, description);\n    }\n  };\n\n  WeinreTargetCommands.prototype.logDebug = function(channel, message, callbackId) {\n    utils.logVerbose(\"target \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreTargetEvents.sendCallback(channel, callbackId, description);\n    }\n  };\n\n  WeinreTargetCommands.prototype.logInfo = function(channel, message, callbackId) {\n    utils.log(\"target \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreTargetEvents.sendCallback(channel, callbackId, description);\n    }\n  };\n\n  WeinreTargetCommands.prototype.logWarning = function(channel, message, callbackId) {\n    utils.log(\"target \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreTargetEvents.sendCallback(channel, callbackId, description);\n    }\n  };\n\n  WeinreTargetCommands.prototype.logError = function(channel, message, callbackId) {\n    utils.log(\"target \" + channel.name + \": \" + message);\n    if (callbackId) {\n      return WeinreTargetEvents.sendCallback(channel, callbackId, description);\n    }\n  };\n\n  return WeinreTargetCommands;\n\n})());\n\ngetCallbackChannel = function(callbackId) {\n  callbackId = callbackId.toString();\n  return callbackId.split('::')[0];\n};\n"
  },
  {
    "path": "buildin_modules/weinre/lib/serviceManager.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar ServiceManager, Services, fs, getMethodProxy, getServiceInterface, path, utils, _,\n  __slice = [].slice;\n\npath = require('path');\n\nfs = require('fs');\n\n_ = require('underscore');\n\nutils = require('./utils');\n\nServices = {};\n\nutils.registerClass(ServiceManager = (function() {\n  function ServiceManager() {\n    this.services = {};\n  }\n\n  ServiceManager.prototype.get = function(name) {\n    if (_.has(this.services, name)) {\n      return this.services[name];\n    }\n    return null;\n  };\n\n  ServiceManager.prototype.registerLocalClass = function(name) {\n    var e, serviceClass;\n    serviceClass = null;\n    try {\n      serviceClass = require(\"./service/\" + name);\n    } catch (_error) {\n      e = _error;\n      utils.log(\"local service class not found: \" + name);\n      throw e;\n    }\n    return this.services[name] = new serviceClass;\n  };\n\n  ServiceManager.prototype.registerProxyClass = function(name) {\n    var intf, method, service, _i, _len, _ref;\n    intf = getServiceInterface(name);\n    if (!intf) {\n      utils.exit(\"proxy service class not found: \" + name);\n    }\n    if (intf.name !== name) {\n      utils.exit(\"proxy interface '\" + intf.name + \"' loaded when '\" + name + \"' requested\");\n    }\n    service = {};\n    _ref = intf.methods;\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      method = _ref[_i];\n      service[method.name] = getMethodProxy(name, method.name);\n    }\n    return this.services[name] = service;\n  };\n\n  return ServiceManager;\n\n})());\n\ngetMethodProxy = function(intfName, methodName) {\n  return function() {\n    var args, channel, channels, _i, _len, _results;\n    channels = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n    if (!_.isArray(channels)) {\n      channels = [channels];\n    }\n    _results = [];\n    for (_i = 0, _len = channels.length; _i < _len; _i++) {\n      channel = channels[_i];\n      _results.push(channel.sendMessage.apply(channel, [intfName, methodName].concat(__slice.call(args))));\n    }\n    return _results;\n  };\n};\n\ngetServiceInterface = function(name) {\n  var contents, fileName, jsonName, serviceInterface;\n  jsonName = \"\" + name + \".json\";\n  fileName = path.join(utils.options.staticWebDir, 'interfaces', jsonName);\n  if (!utils.fileExistsSync(fileName)) {\n    return null;\n  }\n  contents = fs.readFileSync(fileName, 'utf8');\n  serviceInterface = JSON.parse(contents);\n  return serviceInterface.interfaces[0];\n};\n\nmodule.exports = new ServiceManager;\n"
  },
  {
    "path": "buildin_modules/weinre/lib/utils.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar Program, SequenceNumber, SequenceNumberMax, fs, log, path, utils,\n  __hasProp = {}.hasOwnProperty;\n\nfs = require('fs');\n\npath = require('path');\n\nutils = exports;\n\nutils.Program = Program = path.basename(process.argv[1]);\n\nSequenceNumberMax = 100 * 1024 * 1024;\n\nSequenceNumber = 0;\n\nutils.getNextSequenceNumber = function(g) {\n  SequenceNumber++;\n  if (SequenceNumber > SequenceNumberMax) {\n    SequenceNumber = 0;\n  }\n  return SequenceNumber;\n};\n\nutils.trim = function(string) {\n  return string.replace(/(^\\s+)|(\\s+$)/g, '');\n};\n\nutils.log = log = function(message) {\n  var date, time;\n  date = new Date();\n  time = date.toISOString();\n  return console.log(\"\" + time + \" \" + Program + \": \" + message);\n};\n\nutils.logVerbose = function(message) {\n  var _ref;\n  if (!(utils != null ? (_ref = utils.options) != null ? _ref.verbose : void 0 : void 0)) {\n    return;\n  }\n  return log(message);\n};\n\nutils.logDebug = function(message) {\n  var _ref;\n  if (!(utils != null ? (_ref = utils.options) != null ? _ref.debug : void 0 : void 0)) {\n    return;\n  }\n  return log(message);\n};\n\nutils.exit = function(message) {\n  log(message);\n  return process.exit(1);\n};\n\nutils.pitch = function(message) {\n  log(message);\n  throw message;\n};\n\nutils.setOptions = function(options) {\n  return utils.options = options;\n};\n\nutils.ensureInteger = function(value, message) {\n  var newValue;\n  newValue = parseInt(value);\n  if (isNaN(newValue)) {\n    utils.exit(\"\" + message + \": '\" + value + \"'\");\n  }\n  return newValue;\n};\n\nutils.ensureString = function(value, message) {\n  if (typeof value !== 'string') {\n    utils.exit(\"\" + message + \": '\" + value + \"'\");\n  }\n  return value;\n};\n\nutils.ensureBoolean = function(value, message) {\n  var newValue, uValue;\n  uValue = value.toString().toUpperCase();\n  newValue = null;\n  switch (uValue) {\n    case 'TRUE':\n      newValue = true;\n      break;\n    case 'FALSE':\n      newValue = false;\n  }\n  if (typeof newValue !== 'boolean') {\n    utils.exit(\"\" + message + \": '\" + value + \"'\");\n  }\n  return newValue;\n};\n\nutils.setNamesForClass = function(aClass) {\n  var key, val, _ref, _results;\n  for (key in aClass) {\n    if (!__hasProp.call(aClass, key)) continue;\n    val = aClass[key];\n    if (typeof val === \"function\") {\n      val.signature = \"\" + aClass.name + \"::\" + key;\n      val.displayName = val.signature;\n      val.name = val.signature;\n    }\n  }\n  _ref = aClass.prototype;\n  _results = [];\n  for (key in _ref) {\n    if (!__hasProp.call(_ref, key)) continue;\n    val = _ref[key];\n    if (typeof val === \"function\") {\n      val.signature = \"\" + aClass.name + \".\" + key;\n      val.displayName = val.signature;\n      _results.push(val.name = val.signature);\n    } else {\n      _results.push(void 0);\n    }\n  }\n  return _results;\n};\n\nutils.registerClass = function(aClass) {\n  utils.setNamesForClass(aClass);\n  return aClass;\n};\n\nutils.alignLeft = function(string, length) {\n  while (string.length < length) {\n    string = \"\" + string + \" \";\n  }\n  return string;\n};\n\nutils.alignRight = function(string, length) {\n  while (string.length < length) {\n    string = \" \" + string;\n  }\n  return string;\n};\n\nutils.fileExistsSync = function(name) {\n  if (fs.existsSync) {\n    return fs.existsSync(name);\n  }\n  return path.existsSync(name);\n};\n\nError.prepareStackTrace = function(error, structuredStackTrace) {\n  var callSite, file, func, funcName, line, longestFile, longestLine, result, _i, _j, _len, _len1;\n  result = [];\n  result.push(\"---------------------------------------------------------\");\n  result.push(\"error: \" + error);\n  result.push(\"---------------------------------------------------------\");\n  result.push(\"stack: \");\n  longestFile = 0;\n  longestLine = 0;\n  for (_i = 0, _len = structuredStackTrace.length; _i < _len; _i++) {\n    callSite = structuredStackTrace[_i];\n    file = callSite.getFileName();\n    line = callSite.getLineNumber();\n    file = path.basename(file);\n    line = \"\" + line;\n    if (file.length > longestFile) {\n      longestFile = file.length;\n    }\n    if (line.length > longestLine) {\n      longestLine = line.length;\n    }\n  }\n  for (_j = 0, _len1 = structuredStackTrace.length; _j < _len1; _j++) {\n    callSite = structuredStackTrace[_j];\n    func = callSite.getFunction();\n    file = callSite.getFileName();\n    line = callSite.getLineNumber();\n    file = path.basename(file);\n    line = \"\" + line;\n    file = utils.alignRight(file, longestFile);\n    line = utils.alignLeft(line, longestLine);\n    if (func) {\n      funcName = func.displayName || func.name || callSite.getFunctionName();\n    }\n    callSite.getMethodName();\n    '???';\n    if (funcName === \"Module._compile\") {\n      result.pop();\n      result.pop();\n      break;\n    }\n    result.push(\"   \" + file + \":\" + line + \" - \" + funcName + \"()\");\n  }\n  return result.join(\"\\n\");\n};\n"
  },
  {
    "path": "buildin_modules/weinre/lib/weinre.js",
    "content": "// Generated by CoffeeScript 1.8.0\nvar HttpChannelHandler, Version, channelManager, checkForDeath, checkHost, deathTimeout, dns, dumpingHandler, express, fs, getStaticWebDir, getVersion, jsonBodyParser, net, path, processOptions, run2, serviceManager, startDeathWatcher, startServer, utils, _;\n\nfs = require('fs');\n\nnet = require('net');\n\ndns = require('dns');\n\npath = require('path');\n\n_ = require('underscore');\n\nexpress = require('express');\n\nutils = require('./utils');\n\njsonBodyParser = require('./jsonBodyParser');\n\nHttpChannelHandler = require('./HttpChannelHandler');\n\ndumpingHandler = require('./dumpingHandler');\n\nchannelManager = require('./channelManager');\n\nserviceManager = require('./serviceManager');\n\nexports.run = function(options) {\n  return processOptions(options, run2);\n};\n\nrun2 = function() {\n  var options;\n  options = utils.options;\n  serviceManager.registerProxyClass('WeinreClientEvents');\n  serviceManager.registerProxyClass('WeinreTargetEvents');\n  serviceManager.registerLocalClass('WeinreClientCommands');\n  serviceManager.registerLocalClass('WeinreTargetCommands');\n  startDeathWatcher(options.deathTimeout);\n  return startServer();\n};\n\nprocessOptions = function(options, cb) {\n  var name, nameLen, names, reducer, _i, _len;\n  options.httpPort = utils.ensureInteger(options.httpPort, 'the value of the option httpPort is not a number');\n  options.boundHost = utils.ensureString(options.boundHost, 'the value of the option boundHost is not a string');\n  options.verbose = utils.ensureBoolean(options.verbose, 'the value of the option verbose is not a boolean');\n  options.debug = utils.ensureBoolean(options.debug, 'the value of the option debug is not a boolean');\n  options.readTimeout = utils.ensureInteger(options.readTimeout, 'the value of the option readTimeout is not a number');\n  options.deathTimeout = utils.ensureInteger(options.deathTimeout, 'the value of the option deathTimeout is not a number');\n  if (options.debug) {\n    options.verbose = true;\n  }\n  options.staticWebDir = getStaticWebDir();\n  utils.logVerbose(\"pid:                 \" + process.pid);\n  utils.logVerbose(\"version:             \" + (getVersion()));\n  utils.logVerbose(\"node versions:\");\n  names = _.keys(process.versions);\n  reducer = function(memo, name) {\n    return Math.max(memo, name.length);\n  };\n  nameLen = _.reduce(names, reducer, 0);\n  for (_i = 0, _len = names.length; _i < _len; _i++) {\n    name = names[_i];\n    utils.logVerbose(\"   \" + (utils.alignLeft(name, nameLen)) + \": \" + process.versions[name]);\n  }\n  utils.logVerbose(\"options:\");\n  utils.logVerbose(\"   httpPort:     \" + options.httpPort);\n  utils.logVerbose(\"   boundHost:    \" + options.boundHost);\n  utils.logVerbose(\"   verbose:      \" + options.verbose);\n  utils.logVerbose(\"   debug:        \" + options.debug);\n  utils.logVerbose(\"   readTimeout:  \" + options.readTimeout);\n  utils.logVerbose(\"   deathTimeout: \" + options.deathTimeout);\n  utils.setOptions(options);\n  return checkHost(options.boundHost, function(err) {\n    if (err) {\n      utils.exit(\"unable to resolve boundHost address: \" + options.boundHost);\n    }\n    return cb();\n  });\n};\n\ncheckHost = function(hostName, cb) {\n  if (hostName === '-all-') {\n    return cb();\n  }\n  if (hostName === 'localhost') {\n    return cb();\n  }\n  if (net.isIP(hostName)) {\n    return cb();\n  }\n  return dns.lookup(hostName, cb);\n};\n\ndeathTimeout = null;\n\nstartDeathWatcher = function(timeout) {\n  deathTimeout = utils.options.deathTimeout * 1000;\n  return setInterval(checkForDeath, 1000);\n};\n\ncheckForDeath = function() {\n  var channel, now, _i, _len, _ref, _results;\n  now = (new Date).valueOf();\n  _ref = channelManager.getChannels();\n  _results = [];\n  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n    channel = _ref[_i];\n    if (now - channel.lastRead > deathTimeout) {\n      _results.push(channel.close());\n    } else {\n      _results.push(void 0);\n    }\n  }\n  return _results;\n};\n\nstartServer = function() {\n  var app, clientHandler, favIcon, options, staticCacheOptions, targetHandler;\n  options = utils.options;\n  clientHandler = new HttpChannelHandler('/ws/client');\n  targetHandler = new HttpChannelHandler('/ws/target');\n  channelManager.initialize();\n  favIcon = \"\" + options.staticWebDir + \"/images/weinre-icon-32x32.png\";\n  staticCacheOptions = {\n    maxObjects: 500,\n    maxLength: 32 * 1024 * 1024\n  };\n  app = express();\n  app.on('error', function(error) {\n    return utils.exit(\"error running server: \" + error);\n  });\n  app.use(express.favicon(favIcon));\n  app.use(jsonBodyParser());\n  app.all(/^\\/ws\\/client(.*)/, function(request, response, next) {\n    var uri;\n    uri = request.params[0];\n    if (uri === '') {\n      uri = '/';\n    }\n    if (options.debug) {\n      dumpingHandler(request, response, uri);\n    }\n    return clientHandler.handle(request, response, uri);\n  });\n  app.all(/^\\/ws\\/target(.*)/, function(request, response, next) {\n    var uri;\n    uri = request.params[0];\n    if (uri === '') {\n      uri = '/';\n    }\n    if (options.debug) {\n      dumpingHandler(request, response, uri);\n    }\n    return targetHandler.handle(request, response, uri);\n  });\n  app.use(express.errorHandler({\n    dumpExceptions: true\n  }));\n  // app.use(express.staticCache(staticCacheOptions));\n  app.use(express[\"static\"](options.staticWebDir));\n  if (options.boundHost === '-all-') {\n    return app.listen(options.httpPort);\n  } else {\n    return app.listen(options.httpPort, options.boundHost);\n  }\n};\n\ngetStaticWebDir = function() {\n  var webDir;\n  webDir = path.normalize(path.join(__dirname, '../web'));\n  if (utils.fileExistsSync(webDir)) {\n    return webDir;\n  }\n  return utils.exit('unable to find static files to serve in #{webDir}; did you do a build?');\n};\n\nVersion = null;\n\ngetVersion = exports.getVersion = function() {\n  var json, packageJsonName, values;\n  if (Version) {\n    return Version;\n  }\n  packageJsonName = path.join(path.dirname(fs.realpathSync(__filename)), '../package.json');\n  json = fs.readFileSync(packageJsonName, 'utf8');\n  values = JSON.parse(json);\n  Version = values.version;\n  return Version;\n};\n"
  },
  {
    "path": "buildin_modules/weinre/package.json",
    "content": "{\n  \"name\":              \"weinre\",\n  \"description\":       \"WEb INspector REmote\",\n  \"author\":            \"apache.org\",\n  \"version\":           \"2.0.0-pre-IXE4AG4O\",\n  \"tags\":              [ \"debug\"],\n  \"licenses\":\n    [\n      {\n        \"type\":        \"Apache 2.0\",\n         \"url\":        \"http://www.apache.org/licenses/LICENSE-2.0\"\n      }\n    ],\n  \"engines\":\n    {\n      \"node\":          \">=0.6.0\"\n    },\n  \"directories\":\n    {\n      \"lib\" :          \"./lib\"\n    },\n  \"dependencies\":\n    {\n      \"express\":       \"2.5.x\",\n      \"nopt\":          \"3.0.x\",\n      \"underscore\":    \"1.7.x\"\n    },\n  \"devDependencies\":\n    {\n      \"coffee-script\": \"1.8.x\"\n    },\n  \"main\" :             \"./lib/weinre\",\n  \"bin\":\n    {\n      \"weinre\":        \"./weinre\"\n    },\n  \"homepage\":          \"http://people.apache.org/~pmuellr/weinre/\",\n  \"bugs\":              \"https://issues.apache.org/jira/secure/IssueNavigator!executeAdvanced.jspa?jqlQuery=project%3DCB+and+component%3Dweinre&runQuery=true&clear=true\",\n  \"repository\":\n    {\n      \"type\":          \"git\",\n      \"url\":           \"https://git-wip-us.apache.org/repos/asf/cordova-weinre.git\"\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ApplicationCacheItemsView.js",
    "content": "/*\n * Copyright (C) 2010 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS\n * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n * THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ApplicationCacheItemsView = function(treeElement, appcacheDomain)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"storage-view\");\n    this.element.addStyleClass(\"table\");\n\n    // FIXME: Delete Button semantics are not yet defined.\n    // FIXME: Needs better tooltip. (Localized)\n    this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Delete\"), \"delete-storage-status-bar-item\");\n    this.deleteButton.visible = false;\n    this.deleteButton.addEventListener(\"click\", this._deleteButtonClicked.bind(this), false);\n\n    // FIXME: Refresh Button semantics are not yet defined.\n    // FIXME: Needs better tooltip. (Localized)\n    this.refreshButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Refresh\"), \"refresh-storage-status-bar-item\");\n    this.refreshButton.addEventListener(\"click\", this._refreshButtonClicked.bind(this), false);\n\n    if (Preferences.onlineDetectionEnabled) {\n        this.connectivityIcon = document.createElement(\"img\");\n        this.connectivityIcon.className = \"storage-application-cache-connectivity-icon\";\n        this.connectivityIcon.src = \"\";\n        this.connectivityMessage = document.createElement(\"span\");\n        this.connectivityMessage.className = \"storage-application-cache-connectivity\";\n        this.connectivityMessage.textContent = \"\";\n    }\n\n    this.divider = document.createElement(\"span\");\n    this.divider.className = \"status-bar-item status-bar-divider\";\n\n    this.statusIcon = document.createElement(\"img\");\n    this.statusIcon.className = \"storage-application-cache-status-icon\";\n    this.statusIcon.src = \"\";\n    this.statusMessage = document.createElement(\"span\");\n    this.statusMessage.className = \"storage-application-cache-status\";\n    this.statusMessage.textContent = \"\";\n\n    this._treeElement = treeElement;\n    this._appcacheDomain = appcacheDomain;\n\n    this._emptyMsgElement = document.createElement(\"div\");\n    this._emptyMsgElement.className = \"storage-empty-view\";\n    this._emptyMsgElement.textContent = WebInspector.UIString(\"No Application Cache information available.\");\n    this.element.appendChild(this._emptyMsgElement);\n\n    this.updateStatus(applicationCache.UNCACHED);\n}\n\nWebInspector.ApplicationCacheItemsView.prototype = {\n    get statusBarItems()\n    {\n        if (Preferences.onlineDetectionEnabled) {\n            return [\n                this.refreshButton.element, this.deleteButton.element,\n                this.connectivityIcon, this.connectivityMessage, this.divider,\n                this.statusIcon, this.statusMessage\n            ];\n        } else {\n            return [\n                this.refreshButton.element, this.deleteButton.element, this.divider,\n                this.statusIcon, this.statusMessage\n            ];\n        }\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this.updateNetworkState(navigator.onLine);\n        this._update();\n    },\n\n    hide: function()\n    {\n        WebInspector.View.prototype.hide.call(this);\n        this.deleteButton.visible = false;\n    },\n\n    updateStatus: function(status)\n    {\n        var statusInformation = {};\n        statusInformation[applicationCache.UNCACHED]    = { src: \"Images/warningOrangeDot.png\", text: \"UNCACHED\"    };\n        statusInformation[applicationCache.IDLE]        = { src: \"Images/warningOrangeDot.png\", text: \"IDLE\"        };\n        statusInformation[applicationCache.CHECKING]    = { src: \"Images/successGreenDot.png\",  text: \"CHECKING\"    };\n        statusInformation[applicationCache.DOWNLOADING] = { src: \"Images/successGreenDot.png\",  text: \"DOWNLOADING\" };\n        statusInformation[applicationCache.UPDATEREADY] = { src: \"Images/successGreenDot.png\",  text: \"UPDATEREADY\" };\n        statusInformation[applicationCache.OBSOLETE]    = { src: \"Images/errorRedDot.png\",      text: \"OBSOLETE\"    };\n\n        var info = statusInformation[status];\n        if (!info) {\n            console.error(\"Unknown Application Cache Status was Not Handled: %d\", status);\n            return;\n        }\n\n        this.statusIcon.src = info.src;\n        this.statusMessage.textContent = info.text;\n    },\n\n    updateNetworkState: function(isNowOnline)\n    {\n        if (Preferences.onlineDetectionEnabled) {\n            if (isNowOnline) {\n                this.connectivityIcon.src = \"Images/successGreenDot.png\";\n                this.connectivityMessage.textContent = WebInspector.UIString(\"Online\");\n            } else {\n                this.connectivityIcon.src = \"Images/errorRedDot.png\";\n                this.connectivityMessage.textContent = WebInspector.UIString(\"Offline\");\n            }\n        }\n    },\n\n    _update: function()\n    {\n        WebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync(this._updateCallback.bind(this));\n    },\n\n    _updateCallback: function(applicationCaches)\n    {\n        // FIXME: applicationCaches is just one cache.\n        // FIXME: are these variables needed anywhere else?\n        this._manifest = applicationCaches.manifest;\n        this._creationTime = applicationCaches.creationTime;\n        this._updateTime = applicationCaches.updateTime;\n        this._size = applicationCaches.size;\n        this._resources = applicationCaches.resources;\n        var lastPathComponent = applicationCaches.lastPathComponent;\n\n        if (!this._manifest) {\n            this._emptyMsgElement.removeStyleClass(\"hidden\");\n            this.deleteButton.visible = false;\n            if (this._dataGrid)\n                this._dataGrid.element.addStyleClass(\"hidden\");\n            return;\n        }\n\n        if (!this._dataGrid)\n            this._createDataGrid();\n\n        this._populateDataGrid();\n        this._dataGrid.autoSizeColumns(20, 80);\n        this._dataGrid.element.removeStyleClass(\"hidden\");\n        this._emptyMsgElement.addStyleClass(\"hidden\");\n        this.deleteButton.visible = true;\n\n        var totalSizeString = Number.bytesToString(this._size);\n        this._treeElement.subtitle = WebInspector.UIString(\"%s (%s)\", lastPathComponent, totalSizeString);\n\n        // FIXME: For Chrome, put creationTime and updateTime somewhere.\n        // NOTE: localizedString has not yet been added.\n        // WebInspector.UIString(\"(%s) Created: %s Updated: %s\", this._size, this._creationTime, this._updateTime);\n    },\n\n    _createDataGrid: function()\n    {\n        var columns = { 0: {}, 1: {}, 2: {} };\n        columns[0].title = WebInspector.UIString(\"Resource\");\n        columns[0].sort = \"ascending\";\n        columns[0].sortable = true;\n        columns[1].title = WebInspector.UIString(\"Type\");\n        columns[1].sortable = true;\n        columns[2].title = WebInspector.UIString(\"Size\");\n        columns[2].aligned = \"right\";\n        columns[2].sortable = true;\n        this._dataGrid = new WebInspector.DataGrid(columns);\n        this.element.appendChild(this._dataGrid.element);\n        this._dataGrid.addEventListener(\"sorting changed\", this._populateDataGrid, this);\n        this._dataGrid.updateWidths();\n    },\n\n    _populateDataGrid: function()\n    {\n        var selectedResource = this._dataGrid.selectedNode ? this._dataGrid.selectedNode.resource : null;\n        var sortDirection = this._dataGrid.sortOrder === \"ascending\" ? 1 : -1;\n\n        function numberCompare(field, resource1, resource2)\n        {\n            return sortDirection * (resource1[field] - resource2[field]);\n        }\n        function localeCompare(field, resource1, resource2)\n        {\n             return sortDirection * (resource1[field] + \"\").localeCompare(resource2[field] + \"\")\n        }\n\n        var comparator;\n        switch (parseInt(this._dataGrid.sortColumnIdentifier)) {\n            case 0: comparator = localeCompare.bind(this, \"name\"); break;\n            case 1: comparator = localeCompare.bind(this, \"type\"); break;\n            case 2: comparator = numberCompare.bind(this, \"size\"); break;\n            default: localeCompare.bind(this, \"resource\"); // FIXME: comparator = ?\n        }\n\n        this._resources.sort(comparator);\n        this._dataGrid.removeChildren();\n\n        var nodeToSelect;\n        for (var i = 0; i < this._resources.length; ++i) {\n            var data = {};\n            var resource = this._resources[i];\n            data[0] = resource.name;\n            data[1] = resource.type;\n            data[2] = Number.bytesToString(resource.size);\n            var node = new WebInspector.DataGridNode(data);\n            node.resource = resource;\n            node.selectable = true;\n            this._dataGrid.appendChild(node);\n            if (resource === selectedResource) {\n                nodeToSelect = node;\n                nodeToSelect.selected = true;\n            }\n        }\n\n        if (!nodeToSelect)\n            this._dataGrid.children[0].selected = true;\n    },\n\n    resize: function()\n    {\n        if (this._dataGrid)\n            this._dataGrid.updateWidths();\n    },\n\n    _deleteButtonClicked: function(event)\n    {\n        if (!this._dataGrid || !this._dataGrid.selectedNode)\n            return;\n\n        // FIXME: Delete Button semantics are not yet defined. (Delete a single, or all?)\n        this._deleteCallback(this._dataGrid.selectedNode);\n    },\n\n    _deleteCallback: function(node)\n    {\n        // FIXME: Should we delete a single (selected) resource or all resources?\n        // InspectorBackend.deleteCachedResource(...)\n        // this._update();\n    },\n\n    _refreshButtonClicked: function(event)\n    {\n        // FIXME: Is this a refresh button or a re-fetch manifest button?\n        // this._update();\n    }\n}\n\nWebInspector.ApplicationCacheItemsView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/AuditCategories.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.AuditCategories.PagePerformance = function() {\n    WebInspector.AuditCategory.call(this, WebInspector.AuditCategories.PagePerformance.AuditCategoryName);\n}\n\nWebInspector.AuditCategories.PagePerformance.AuditCategoryName = \"Web Page Performance\";\n\nWebInspector.AuditCategories.PagePerformance.prototype = {\n    initialize: function()\n    {\n        this.addRule(new WebInspector.AuditRules.UnusedCssRule(), WebInspector.AuditRule.Severity.Warning);\n        this.addRule(new WebInspector.AuditRules.CssInHeadRule(), WebInspector.AuditRule.Severity.Severe);\n        this.addRule(new WebInspector.AuditRules.StylesScriptsOrderRule(), WebInspector.AuditRule.Severity.Severe);\n    }\n}\n\nWebInspector.AuditCategories.PagePerformance.prototype.__proto__ = WebInspector.AuditCategory.prototype;\n\nWebInspector.AuditCategories.NetworkUtilization = function() {\n    WebInspector.AuditCategory.call(this, WebInspector.AuditCategories.NetworkUtilization.AuditCategoryName);\n}\n\nWebInspector.AuditCategories.NetworkUtilization.AuditCategoryName = \"Network Utilization\";\n\nWebInspector.AuditCategories.NetworkUtilization.prototype = {\n    initialize: function()\n    {\n        this.addRule(new WebInspector.AuditRules.GzipRule(), WebInspector.AuditRule.Severity.Severe);\n        this.addRule(new WebInspector.AuditRules.ImageDimensionsRule(), WebInspector.AuditRule.Severity.Warning);\n        this.addRule(new WebInspector.AuditRules.CookieSizeRule(400), WebInspector.AuditRule.Severity.Warning);\n        this.addRule(new WebInspector.AuditRules.StaticCookielessRule(5), WebInspector.AuditRule.Severity.Warning);\n        this.addRule(new WebInspector.AuditRules.CombineJsResourcesRule(2), WebInspector.AuditRule.Severity.Severe);\n        this.addRule(new WebInspector.AuditRules.CombineCssResourcesRule(2), WebInspector.AuditRule.Severity.Severe);\n        this.addRule(new WebInspector.AuditRules.MinimizeDnsLookupsRule(4), WebInspector.AuditRule.Severity.Warning);\n        this.addRule(new WebInspector.AuditRules.ParallelizeDownloadRule(4, 10, 0.5), WebInspector.AuditRule.Severity.Warning);\n        this.addRule(new WebInspector.AuditRules.BrowserCacheControlRule(), WebInspector.AuditRule.Severity.Severe);\n        this.addRule(new WebInspector.AuditRules.ProxyCacheControlRule(), WebInspector.AuditRule.Severity.Warning);\n    }\n}\n\nWebInspector.AuditCategories.NetworkUtilization.prototype.__proto__ = WebInspector.AuditCategory.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/AuditFormatters.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.applyFormatters = function(value)\n{\n    var formatter;\n    var type = typeof value;\n    var args;\n\n    switch (type) {\n        case \"string\":\n        case \"boolean\":\n        case \"number\":\n            formatter = WebInspector.AuditFormatters.text;\n            args = [ value.toString() ];\n            break;\n\n        case \"object\":\n            if (value instanceof Array) {\n                formatter = WebInspector.AuditFormatters.concat;\n                args = value;\n            } else if (value.type && value.arguments) {\n                formatter = WebInspector.AuditFormatters[value.type];\n                args = value.arguments;\n            }\n    }\n    if (!formatter)\n        throw \"Invalid value or formatter: \" + type + JSON.stringify(value);\n\n    return formatter.apply(null, args);\n}\n\nWebInspector.AuditFormatters = {\n    text: function(text)\n    {\n        return document.createTextNode(text);\n    },\n\n    snippet: function(snippetText)\n    {\n        var div = document.createElement(\"div\");\n        div.innerText = snippetText;\n        div.className = \"source-code\";\n        return div;\n    },\n\n    concat: function()\n    {\n        var parent = document.createElement(\"span\");\n        for (var arg = 0; arg < arguments.length; ++arg)\n            parent.appendChild(WebInspector.applyFormatters(arguments[arg]));\n        return parent;\n    },\n\n    url: function(url, displayText, allowExternalNavigation)\n    {\n        var a = document.createElement(\"a\");\n        a.href = url;\n        a.title = url;\n        a.textContent = displayText || url;\n        if (allowExternalNavigation)\n            a.target = \"_blank\";\n        return a;\n    }\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/AuditLauncherView.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.AuditLauncherView = function(runnerCallback)\n{\n    WebInspector.View.call(this);\n    this._runnerCallback = runnerCallback;\n    this._categoryIdPrefix = \"audit-category-item-\";\n    this._auditRunning = false;\n\n    this.element.addStyleClass(\"audit-launcher-view\");\n\n    this._contentElement = document.createElement(\"div\");\n    this._contentElement.className = \"audit-launcher-view-content\";\n    this.element.appendChild(this._contentElement);\n    this._boundCategoryClickListener = this._categoryClicked.bind(this);\n\n    this._resetResourceCount();\n\n    this._sortedCategories = [];\n\n    this._headerElement = document.createElement(\"h1\");\n    this._headerElement.className = \"no-audits\";\n    this._headerElement.textContent = WebInspector.UIString(\"No audits to run\");\n    this._contentElement.appendChild(this._headerElement);\n\n    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this);\n    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceFinished, this);\n}\n\nWebInspector.AuditLauncherView.prototype = {\n    _resetResourceCount: function()\n    {\n        this._loadedResources = 0;\n        this._totalResources = 0;\n    },\n\n    _onResourceStarted: function(event)\n    {\n        var resource = event.data;\n        // Ignore long-living WebSockets for the sake of progress indicator, as we won't be waiting them anyway.\n        if (resource.type === WebInspector.Resource.Type.WebSocket)\n            return;\n        ++this._totalResources;\n        this._updateResourceProgress();\n    },\n\n    _onResourceFinished: function(event)\n    {\n        var resource = event.data;\n        // See resorceStarted for details.\n        if (resource.type === WebInspector.Resource.Type.WebSocket)\n            return;\n        ++this._loadedResources;\n        this._updateResourceProgress();\n    },\n\n    addCategory: function(category)\n    {\n        if (!this._sortedCategories.length)\n            this._createLauncherUI();\n\n        var categoryElement = this._createCategoryElement(category.displayName, category.id);\n        category._checkboxElement = categoryElement.firstChild;\n        if (this._selectAllCheckboxElement.checked) {\n            category._checkboxElement.checked = true;\n            ++this._currentCategoriesCount;\n        }\n\n        function compareCategories(a, b)\n        {\n            var aTitle = a.displayName || \"\";\n            var bTitle = b.displayName || \"\";\n            return aTitle.localeCompare(bTitle);\n        }\n        var insertBefore = insertionIndexForObjectInListSortedByFunction(category, this._sortedCategories, compareCategories);\n        this._categoriesElement.insertBefore(categoryElement, this._categoriesElement.children[insertBefore] || null);\n        this._sortedCategories.splice(insertBefore, 0, category);\n        this._updateButton();\n    },\n\n    _setAuditRunning: function(auditRunning)\n    {\n        if (this._auditRunning === auditRunning)\n            return;\n        this._auditRunning = auditRunning;\n        this._updateButton();\n        this._updateResourceProgress();\n    },\n\n    _launchButtonClicked: function(event)\n    {\n        var catIds = [];\n        var childNodes = this._categoriesElement.childNodes;\n        for (var category = 0; category < this._sortedCategories.length; ++category) {\n            if (this._sortedCategories[category]._checkboxElement.checked)\n                catIds.push(this._sortedCategories[category].id);\n        }\n\n        this._setAuditRunning(true);\n        this._runnerCallback(catIds, this._auditPresentStateElement.checked, this._setAuditRunning.bind(this, false));\n    },\n\n    _selectAllClicked: function(checkCategories)\n    {\n        var childNodes = this._categoriesElement.childNodes;\n        for (var i = 0, length = childNodes.length; i < length; ++i)\n            childNodes[i].firstChild.checked = checkCategories;\n        this._currentCategoriesCount = checkCategories ? this._sortedCategories.length : 0;\n        this._updateButton();\n    },\n\n    _categoryClicked: function(event)\n    {\n        this._currentCategoriesCount += event.target.checked ? 1 : -1;\n        this._selectAllCheckboxElement.checked = this._currentCategoriesCount === this._sortedCategories.length;\n        this._updateButton();\n    },\n\n    _createCategoryElement: function(title, id)\n    {\n        var labelElement = document.createElement(\"label\");\n        labelElement.id = this._categoryIdPrefix + id;\n\n        var element = document.createElement(\"input\");\n        element.type = \"checkbox\";\n        if (id !== \"\")\n            element.addEventListener(\"click\", this._boundCategoryClickListener, false);\n        labelElement.appendChild(element);\n        labelElement.appendChild(document.createTextNode(title));\n\n        return labelElement;\n    },\n\n    _createLauncherUI: function()\n    {\n        this._headerElement = document.createElement(\"h1\");\n        this._headerElement.textContent = WebInspector.UIString(\"Select audits to run\");\n\n        for (var child = 0; child < this._contentElement.children.length; ++child)\n            this._contentElement.removeChild(this._contentElement.children[child]);\n\n        this._contentElement.appendChild(this._headerElement);\n\n        function handleSelectAllClick(event)\n        {\n            this._selectAllClicked(event.target.checked);\n        }\n        var categoryElement = this._createCategoryElement(WebInspector.UIString(\"Select All\"), \"\");\n        categoryElement.id = \"audit-launcher-selectall\";\n        this._selectAllCheckboxElement = categoryElement.firstChild;\n        this._selectAllCheckboxElement.checked = true;\n        this._selectAllCheckboxElement.addEventListener(\"click\", handleSelectAllClick.bind(this), false);\n        this._contentElement.appendChild(categoryElement);\n\n        this._categoriesElement = document.createElement(\"div\");\n        this._categoriesElement.className = \"audit-categories-container\";\n        this._contentElement.appendChild(this._categoriesElement);\n\n        this._currentCategoriesCount = 0;\n\n        var flexibleSpaceElement = document.createElement(\"div\");\n        flexibleSpaceElement.className = \"flexible-space\";\n        this._contentElement.appendChild(flexibleSpaceElement);\n\n        this._buttonContainerElement = document.createElement(\"div\");\n        this._buttonContainerElement.className = \"button-container\";\n\n        var labelElement = document.createElement(\"label\");\n        this._auditPresentStateElement = document.createElement(\"input\");\n        this._auditPresentStateElement.name = \"audit-mode\";\n        this._auditPresentStateElement.type = \"radio\";\n        this._auditPresentStateElement.checked = true;\n        this._auditPresentStateLabelElement = document.createTextNode(WebInspector.UIString(\"Audit Present State\"));\n        labelElement.appendChild(this._auditPresentStateElement);\n        labelElement.appendChild(this._auditPresentStateLabelElement);\n        this._buttonContainerElement.appendChild(labelElement);\n\n        labelElement = document.createElement(\"label\");\n        this.auditReloadedStateElement = document.createElement(\"input\");\n        this.auditReloadedStateElement.name = \"audit-mode\";\n        this.auditReloadedStateElement.type = \"radio\";\n        labelElement.appendChild(this.auditReloadedStateElement);\n        labelElement.appendChild(document.createTextNode(\"Reload Page and Audit on Load\"));\n        this._buttonContainerElement.appendChild(labelElement);\n\n        this._launchButton = document.createElement(\"button\");\n        this._launchButton.type = \"button\";\n        this._launchButton.textContent = WebInspector.UIString(\"Run\");\n        this._launchButton.addEventListener(\"click\", this._launchButtonClicked.bind(this), false);\n        this._buttonContainerElement.appendChild(this._launchButton);\n\n        this._resourceProgressContainer = document.createElement(\"span\");\n        this._resourceProgressContainer.className = \"resource-progress\";\n        var resourceProgressImage = document.createElement(\"img\");\n        this._resourceProgressContainer.appendChild(resourceProgressImage);\n        this._resourceProgressTextElement = document.createElement(\"span\");\n        this._resourceProgressContainer.appendChild(this._resourceProgressTextElement);\n        this._buttonContainerElement.appendChild(this._resourceProgressContainer);\n\n        this._contentElement.appendChild(this._buttonContainerElement);\n\n        this._selectAllClicked(this._selectAllCheckboxElement.checked);\n        this._updateButton();\n        this._updateResourceProgress();\n    },\n\n    _updateResourceProgress: function()\n    {\n        if (!this._resourceProgressContainer)\n            return;\n\n        if (!this._auditRunning) {\n            this._resetResourceCount();\n            this._resourceProgressContainer.addStyleClass(\"hidden\");\n        } else\n            this._resourceProgressContainer.removeStyleClass(\"hidden\");\n        this._resourceProgressTextElement.textContent = WebInspector.UIString(\"Loading (%d of %d)\", this._loadedResources, this._totalResources);\n    },\n\n    _updateButton: function()\n    {\n        this._launchButton.disabled = !this._currentCategoriesCount || this._auditRunning;\n    }\n}\n\nWebInspector.AuditLauncherView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/AuditResultView.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.AuditResultView = function(categoryResults)\n{\n    WebInspector.View.call(this);\n    this.element.className = \"audit-result-view\";\n\n    function categorySorter(a, b) {\n        return (a.title || \"\").localeCompare(b.title || \"\");\n    }\n    categoryResults.sort(categorySorter);\n    for (var i = 0; i < categoryResults.length; ++i)\n        this.element.appendChild(new WebInspector.AuditCategoryResultPane(categoryResults[i]).element);\n}\n\nWebInspector.AuditResultView.prototype.__proto__ = WebInspector.View.prototype;\n\n\nWebInspector.AuditCategoryResultPane = function(categoryResult)\n{\n    WebInspector.SidebarPane.call(this, categoryResult.title);\n    var treeOutlineElement = document.createElement(\"ol\");\n    this.bodyElement.addStyleClass(\"audit-result-tree\");\n    this.bodyElement.appendChild(treeOutlineElement);\n\n    this._treeOutline = new TreeOutline(treeOutlineElement);\n    this._treeOutline.expandTreeElementsWhenArrowing = true;\n\n    function ruleSorter(a, b)\n    {\n        var result = WebInspector.AuditRule.SeverityOrder[a.severity || 0] - WebInspector.AuditRule.SeverityOrder[b.severity || 0];\n        if (!result)\n            result = (a.value || \"\").localeCompare(b.value || \"\");\n        return result;\n    }\n\n    categoryResult.ruleResults.sort(ruleSorter);\n\n    for (var i = 0; i < categoryResult.ruleResults.length; ++i) {\n        var ruleResult = categoryResult.ruleResults[i];\n        var treeElement = this._appendResult(this._treeOutline, ruleResult);\n        treeElement.listItemElement.addStyleClass(\"audit-result\");\n\n        if (ruleResult.severity) {\n            var severityElement = document.createElement(\"img\");\n            severityElement.className = \"severity-\" + ruleResult.severity;\n            treeElement.listItemElement.appendChild(severityElement);\n        }\n    }\n    this.expand();\n}\n\nWebInspector.AuditCategoryResultPane.prototype = {\n    _appendResult: function(parentTreeElement, result)\n    {\n        var title = \"\";\n        \n        if (typeof result.value === \"string\") {\n            title = result.value;\n            if (result.violationCount)\n                title = String.sprintf(\"%s (%d)\", title, result.violationCount);\n        }\n\n        var treeElement = new TreeElement(null, null, !!result.children);\n        treeElement.titleHTML = title;\n        parentTreeElement.appendChild(treeElement);\n\n        if (result.className)\n            treeElement.listItemElement.addStyleClass(result.className);\n        if (typeof result.value !== \"string\")\n            treeElement.listItemElement.appendChild(WebInspector.applyFormatters(result.value));\n\n        if (result.children) {\n            for (var i = 0; i < result.children.length; ++i)\n                this._appendResult(treeElement, result.children[i]);\n        }\n        if (result.expanded) {\n            treeElement.listItemElement.removeStyleClass(\"parent\");\n            treeElement.listItemElement.addStyleClass(\"parent-expanded\");\n            treeElement.expand();\n        }\n        return treeElement;\n    }\n}\n\nWebInspector.AuditCategoryResultPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/AuditRules.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.AuditRules.IPAddressRegexp = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\n\nWebInspector.AuditRules.CacheableResponseCodes =\n{\n    200: true,\n    203: true,\n    206: true,\n    300: true,\n    301: true,\n    410: true,\n\n    304: true // Underlying resource is cacheable\n}\n\nWebInspector.AuditRules.getDomainToResourcesMap = function(resources, types, needFullResources)\n{\n    var domainToResourcesMap = {};\n    for (var i = 0, size = resources.length; i < size; ++i) {\n        var resource = resources[i];\n        if (types && types.indexOf(resource.type) === -1)\n            continue;\n        var parsedURL = resource.url.asParsedURL();\n        if (!parsedURL)\n            continue;\n        var domain = parsedURL.host;\n        var domainResources = domainToResourcesMap[domain];\n        if (domainResources === undefined) {\n          domainResources = [];\n          domainToResourcesMap[domain] = domainResources;\n        }\n        domainResources.push(needFullResources ? resource : resource.url);\n    }\n    return domainToResourcesMap;\n}\n\nWebInspector.AuditRules.evaluateInTargetWindow = function(func, args, callback)\n{\n    InspectorBackend.evaluateOnSelf(func.toString(), args, callback);\n}\n\n\nWebInspector.AuditRules.GzipRule = function()\n{\n    WebInspector.AuditRule.call(this, \"network-gzip\", \"Enable gzip compression\");\n}\n\nWebInspector.AuditRules.GzipRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        var totalSavings = 0;\n        var compressedSize = 0;\n        var candidateSize = 0;\n        var summary = result.addChild(\"\", true);\n        for (var i = 0, length = resources.length; i < length; ++i) {\n            var resource = resources[i];\n            if (this._shouldCompress(resource)) {\n                var size = resource.resourceSize;\n                candidateSize += size;\n                if (this._isCompressed(resource)) {\n                    compressedSize += size;\n                    continue;\n                }\n                var savings = 2 * size / 3;\n                totalSavings += savings;\n                summary.addChild(String.sprintf(\"%s could save ~%s\", WebInspector.AuditRuleResult.linkifyDisplayName(resource.url), Number.bytesToString(savings)));\n                result.violationCount++;\n            }\n        }\n        if (!totalSavings)\n            return callback(null);\n        summary.value = String.sprintf(\"Compressing the following resources with gzip could reduce their transfer size by about two thirds (~%s):\", Number.bytesToString(totalSavings));\n        callback(result);\n    },\n\n    _isCompressed: function(resource)\n    {\n        var encoding = resource.responseHeaders[\"Content-Encoding\"];\n        return encoding === \"gzip\" || encoding === \"deflate\";\n    },\n\n    _shouldCompress: function(resource)\n    {\n        return WebInspector.Resource.Type.isTextType(resource.type) && resource.domain && resource.resourceSize !== undefined && resource.resourceSize > 150;\n    }\n}\n\nWebInspector.AuditRules.GzipRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.CombineExternalResourcesRule = function(id, name, type, resourceTypeName, allowedPerDomain)\n{\n    WebInspector.AuditRule.call(this, id, name);\n    this._type = type;\n    this._resourceTypeName = resourceTypeName;\n    this._allowedPerDomain = allowedPerDomain;\n}\n\nWebInspector.AuditRules.CombineExternalResourcesRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type]);\n        var penalizedResourceCount = 0;\n        // TODO: refactor according to the chosen i18n approach\n        var summary = result.addChild(\"\", true);\n        for (var domain in domainToResourcesMap) {\n            var domainResources = domainToResourcesMap[domain];\n            var extraResourceCount = domainResources.length - this._allowedPerDomain;\n            if (extraResourceCount <= 0)\n                continue;\n            penalizedResourceCount += extraResourceCount - 1;\n            summary.addChild(String.sprintf(\"%d %s resources served from %s.\", domainResources.length, this._resourceTypeName, WebInspector.AuditRuleResult.resourceDomain(domain)));\n            result.violationCount += domainResources.length;\n        }\n        if (!penalizedResourceCount)\n            return callback(null);\n\n        summary.value = \"There are multiple resources served from same domain. Consider combining them into as few files as possible.\";\n        callback(result);\n    }\n}\n\nWebInspector.AuditRules.CombineExternalResourcesRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.CombineJsResourcesRule = function(allowedPerDomain) {\n    WebInspector.AuditRules.CombineExternalResourcesRule.call(this, \"page-externaljs\", \"Combine external JavaScript\", WebInspector.Resource.Type.Script, \"JavaScript\", allowedPerDomain);\n}\n\nWebInspector.AuditRules.CombineJsResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;\n\n\nWebInspector.AuditRules.CombineCssResourcesRule = function(allowedPerDomain) {\n    WebInspector.AuditRules.CombineExternalResourcesRule.call(this, \"page-externalcss\", \"Combine external CSS\", WebInspector.Resource.Type.Stylesheet, \"CSS\", allowedPerDomain);\n}\n\nWebInspector.AuditRules.CombineCssResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;\n\n\nWebInspector.AuditRules.MinimizeDnsLookupsRule = function(hostCountThreshold) {\n    WebInspector.AuditRule.call(this, \"network-minimizelookups\", \"Minimize DNS lookups\");\n    this._hostCountThreshold = hostCountThreshold;\n}\n\nWebInspector.AuditRules.MinimizeDnsLookupsRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        var summary = result.addChild(\"\");\n        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined);\n        for (var domain in domainToResourcesMap) {\n            if (domainToResourcesMap[domain].length > 1)\n                continue;\n            var parsedURL = domain.asParsedURL();\n            if (!parsedURL)\n                continue;\n            if (!parsedURL.host.search(WebInspector.AuditRules.IPAddressRegexp))\n                continue; // an IP address\n            summary.addSnippet(match[2]);\n            result.violationCount++;\n        }\n        if (!summary.children || summary.children.length <= this._hostCountThreshold)\n            return callback(null);\n\n        summary.value = \"The following domains only serve one resource each. If possible, avoid the extra DNS lookups by serving these resources from existing domains.\";\n        callback(result);\n    }\n}\n\nWebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.ParallelizeDownloadRule = function(optimalHostnameCount, minRequestThreshold, minBalanceThreshold)\n{\n    WebInspector.AuditRule.call(this, \"network-parallelizehosts\", \"Parallelize downloads across hostnames\");\n    this._optimalHostnameCount = optimalHostnameCount;\n    this._minRequestThreshold = minRequestThreshold;\n    this._minBalanceThreshold = minBalanceThreshold;\n}\n\n\nWebInspector.AuditRules.ParallelizeDownloadRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        function hostSorter(a, b)\n        {\n            var aCount = domainToResourcesMap[a].length;\n            var bCount = domainToResourcesMap[b].length;\n            return (aCount < bCount) ? 1 : (aCount == bCount) ? 0 : -1;\n        }\n\n        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(\n            resources,\n            [WebInspector.Resource.Type.Stylesheet, WebInspector.Resource.Type.Image],\n            true);\n\n        var hosts = [];\n        for (var url in domainToResourcesMap)\n            hosts.push(url);\n\n        if (!hosts.length)\n            return callback(null); // no hosts (local file or something)\n\n        hosts.sort(hostSorter);\n\n        var optimalHostnameCount = this._optimalHostnameCount;\n        if (hosts.length > optimalHostnameCount)\n            hosts.splice(optimalHostnameCount);\n\n        var busiestHostResourceCount = domainToResourcesMap[hosts[0]].length;\n        var resourceCountAboveThreshold = busiestHostResourceCount - this._minRequestThreshold;\n        if (resourceCountAboveThreshold <= 0)\n            return callback(null);\n\n        var avgResourcesPerHost = 0;\n        for (var i = 0, size = hosts.length; i < size; ++i)\n            avgResourcesPerHost += domainToResourcesMap[hosts[i]].length;\n\n        // Assume optimal parallelization.\n        avgResourcesPerHost /= optimalHostnameCount;\n        avgResourcesPerHost = Math.max(avgResourcesPerHost, 1);\n\n        var pctAboveAvg = (resourceCountAboveThreshold / avgResourcesPerHost) - 1.0;\n        var minBalanceThreshold = this._minBalanceThreshold;\n        if (pctAboveAvg < minBalanceThreshold)\n            return callback(null);\n\n        var resourcesOnBusiestHost = domainToResourcesMap[hosts[0]];\n        var entry = result.addChild(String.sprintf(\"This page makes %d parallelizable requests to %s. Increase download parallelization by distributing the following requests across multiple hostnames.\", busiestHostResourceCount, hosts[0]), true);\n        for (var i = 0; i < resourcesOnBusiestHost.length; ++i)\n            entry.addURL(resourcesOnBusiestHost[i].url);\n\n        result.violationCount = resourcesOnBusiestHost.length;\n        callback(result);\n    }\n}\n\nWebInspector.AuditRules.ParallelizeDownloadRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\n// The reported CSS rule size is incorrect (parsed != original in WebKit),\n// so use percentages instead, which gives a better approximation.\nWebInspector.AuditRules.UnusedCssRule = function()\n{\n    WebInspector.AuditRule.call(this, \"page-unusedcss\", \"Remove unused CSS rules\");\n}\n\nWebInspector.AuditRules.UnusedCssRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        var self = this;\n\n        function evalCallback(styleSheets) {\n            if (!styleSheets.length)\n                return callback(null);\n\n            var pseudoSelectorRegexp = /:hover|:link|:active|:visited|:focus|:before|:after/;\n            var selectors = [];\n            var testedSelectors = {};\n            for (var i = 0; i < styleSheets.length; ++i) {\n                var styleSheet = styleSheets[i];\n                for (var curRule = 0; curRule < styleSheet.rules.length; ++curRule) {\n                    var selectorText = styleSheet.rules[curRule].selectorText;\n                    if (selectorText.match(pseudoSelectorRegexp) || testedSelectors[selectorText])\n                        continue;\n                    selectors.push(selectorText);\n                    testedSelectors[selectorText] = 1;\n                }\n            }\n\n            function selectorsCallback(callback, styleSheets, testedSelectors, foundSelectors)\n            {\n                var inlineBlockOrdinal = 0;\n                var totalStylesheetSize = 0;\n                var totalUnusedStylesheetSize = 0;\n                var summary;\n\n                for (var i = 0; i < styleSheets.length; ++i) {\n                    var styleSheet = styleSheets[i];\n                    var stylesheetSize = 0;\n                    var unusedStylesheetSize = 0;\n                    var unusedRules = [];\n                    for (var curRule = 0; curRule < styleSheet.rules.length; ++curRule) {\n                        var rule = styleSheet.rules[curRule];\n                        // Exact computation whenever source ranges are available.\n                        var textLength = (rule.selectorRange && rule.style.properties.endOffset) ? rule.style.properties.endOffset - rule.selectorRange.start + 1 : 0;\n                        if (!textLength && rule.style.cssText)\n                            textLength = rule.style.cssText.length + rule.selectorText.length;\n                        stylesheetSize += textLength;\n                        if (!testedSelectors[rule.selectorText] || foundSelectors[rule.selectorText])\n                            continue;\n                        unusedStylesheetSize += textLength;\n                        unusedRules.push(rule.selectorText);\n                    }\n                    totalStylesheetSize += stylesheetSize;\n                    totalUnusedStylesheetSize += unusedStylesheetSize;\n\n                    if (!unusedRules.length)\n                        continue;\n\n                    var resource = WebInspector.resourceForURL(styleSheet.sourceURL);\n                    var isInlineBlock = resource && resource.type == WebInspector.Resource.Type.Document;\n                    var url = !isInlineBlock ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : String.sprintf(\"Inline block #%d\", ++inlineBlockOrdinal);\n                    var pctUnused = Math.round(100 * unusedStylesheetSize / stylesheetSize);\n                    if (!summary)\n                        summary = result.addChild(\"\", true);\n                    var entry = summary.addChild(String.sprintf(\"%s: %s (%d%%) is not used by the current page.\", url, Number.bytesToString(unusedStylesheetSize), pctUnused));\n\n                    for (var j = 0; j < unusedRules.length; ++j)\n                        entry.addSnippet(unusedRules[j]);\n\n                    result.violationCount += unusedRules.length;\n                }\n\n                if (!totalUnusedStylesheetSize)\n                    return callback(null);\n\n                var totalUnusedPercent = Math.round(100 * totalUnusedStylesheetSize / totalStylesheetSize);\n                summary.value = String.sprintf(\"%s (%d%%) of CSS is not used by the current page.\", Number.bytesToString(totalUnusedStylesheetSize), totalUnusedPercent);\n\n                callback(result);\n            }\n\n            function routine(selectorArray)\n            {\n                var result = {};\n                for (var i = 0; i < selectorArray.length; ++i) {\n                    try {\n                        if (document.querySelector(selectorArray[i]))\n                            result[selectorArray[i]] = true;\n                    } catch(e) {\n                        // Ignore and mark as unused.\n                    }\n                }\n                return result;\n            }\n\n            WebInspector.AuditRules.evaluateInTargetWindow(routine, [selectors], selectorsCallback.bind(null, callback, styleSheets, testedSelectors));\n        }\n\n        function styleSheetCallback(styleSheets, continuation, styleSheet)\n        {\n            if (styleSheet)\n                styleSheets.push(styleSheet);\n            if (continuation)\n                continuation(styleSheets);\n        }\n\n        function allStylesCallback(styleSheetIds)\n        {\n            if (!styleSheetIds || !styleSheetIds.length)\n                return evalCallback([]);\n            var styleSheets = [];\n            for (var i = 0; i < styleSheetIds.length; ++i)\n                WebInspector.CSSStyleSheet.createForId(styleSheetIds[i], styleSheetCallback.bind(null, styleSheets, i == styleSheetIds.length - 1 ? evalCallback : null));\n        }\n\n        InspectorBackend.getAllStyles(allStylesCallback);\n    }\n}\n\nWebInspector.AuditRules.UnusedCssRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.CacheControlRule = function(id, name)\n{\n    WebInspector.AuditRule.call(this, id, name);\n}\n\nWebInspector.AuditRules.CacheControlRule.MillisPerMonth = 1000 * 60 * 60 * 24 * 30;\n\nWebInspector.AuditRules.CacheControlRule.prototype = {\n\n    doRun: function(resources, result, callback)\n    {\n        var cacheableAndNonCacheableResources = this._cacheableAndNonCacheableResources(resources);\n        if (cacheableAndNonCacheableResources[0].length)\n            this.runChecks(cacheableAndNonCacheableResources[0], result);\n        this.handleNonCacheableResources(cacheableAndNonCacheableResources[1], result);\n\n        callback(result);\n    },\n\n    handleNonCacheableResources: function()\n    {\n    },\n\n    _cacheableAndNonCacheableResources: function(resources)\n    {\n        var processedResources = [[], []];\n        for (var i = 0; i < resources.length; ++i) {\n            var resource = resources[i];\n            if (!this.isCacheableResource(resource))\n                continue;\n            if (this._isExplicitlyNonCacheable(resource))\n                processedResources[1].push(resource);\n            else\n                processedResources[0].push(resource);\n        }\n        return processedResources;\n    },\n\n    execCheck: function(messageText, resourceCheckFunction, resources, result)\n    {\n        var resourceCount = resources.length;\n        var urls = [];\n        for (var i = 0; i < resourceCount; ++i) {\n            if (resourceCheckFunction.call(this, resources[i]))\n                urls.push(resources[i].url);\n        }\n        if (urls.length) {\n            var entry = result.addChild(messageText, true);\n            entry.addURLs(urls);\n            result.violationCount += urls.length;\n        }\n    },\n\n    freshnessLifetimeGreaterThan: function(resource, timeMs)\n    {\n        var dateHeader = this.responseHeader(resource, \"Date\");\n        if (!dateHeader)\n            return false;\n\n        var dateHeaderMs = Date.parse(dateHeader);\n        if (isNaN(dateHeaderMs))\n            return false;\n\n        var freshnessLifetimeMs;\n        var maxAgeMatch = this.responseHeaderMatch(resource, \"Cache-Control\", \"max-age=(\\\\d+)\");\n\n        if (maxAgeMatch)\n            freshnessLifetimeMs = (maxAgeMatch[1]) ? 1000 * maxAgeMatch[1] : 0;\n        else {\n            var expiresHeader = this.responseHeader(resource, \"Expires\");\n            if (expiresHeader) {\n                var expDate = Date.parse(expiresHeader);\n                if (!isNaN(expDate))\n                    freshnessLifetimeMs = expDate - dateHeaderMs;\n            }\n        }\n\n        return (isNaN(freshnessLifetimeMs)) ? false : freshnessLifetimeMs > timeMs;\n    },\n\n    responseHeader: function(resource, header)\n    {\n        return resource.responseHeaders[header];\n    },\n\n    hasResponseHeader: function(resource, header)\n    {\n        return resource.responseHeaders[header] !== undefined;\n    },\n\n    isCompressible: function(resource)\n    {\n        return WebInspector.Resource.Type.isTextType(resource.type);\n    },\n\n    isPubliclyCacheable: function(resource)\n    {\n        if (this._isExplicitlyNonCacheable(resource))\n            return false;\n\n        if (this.responseHeaderMatch(resource, \"Cache-Control\", \"public\"))\n            return true;\n\n        return resource.url.indexOf(\"?\") == -1 && !this.responseHeaderMatch(resource, \"Cache-Control\", \"private\");\n    },\n\n    responseHeaderMatch: function(resource, header, regexp)\n    {\n        return resource.responseHeaders[header]\n            ? resource.responseHeaders[header].match(new RegExp(regexp, \"im\"))\n            : undefined;\n    },\n\n    hasExplicitExpiration: function(resource)\n    {\n        return this.hasResponseHeader(resource, \"Date\") &&\n            (this.hasResponseHeader(resource, \"Expires\") || this.responseHeaderMatch(resource, \"Cache-Control\", \"max-age\"));\n    },\n\n    _isExplicitlyNonCacheable: function(resource)\n    {\n        var hasExplicitExp = this.hasExplicitExpiration(resource);\n        return this.responseHeaderMatch(resource, \"Cache-Control\", \"(no-cache|no-store|must-revalidate)\") ||\n            this.responseHeaderMatch(resource, \"Pragma\", \"no-cache\") ||\n            (hasExplicitExp && !this.freshnessLifetimeGreaterThan(resource, 0)) ||\n            (!hasExplicitExp && resource.url && resource.url.indexOf(\"?\") >= 0) ||\n            (!hasExplicitExp && !this.isCacheableResource(resource));\n    },\n\n    isCacheableResource: function(resource)\n    {\n        return resource.statusCode !== undefined && WebInspector.AuditRules.CacheableResponseCodes[resource.statusCode];\n    }\n}\n\nWebInspector.AuditRules.CacheControlRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.BrowserCacheControlRule = function()\n{\n    WebInspector.AuditRules.CacheControlRule.call(this, \"http-browsercache\", \"Leverage browser caching\");\n}\n\nWebInspector.AuditRules.BrowserCacheControlRule.prototype = {\n    handleNonCacheableResources: function(resources, result)\n    {\n        if (resources.length) {\n            var entry = result.addChild(\"The following resources are explicitly non-cacheable. Consider making them cacheable if possible:\", true);\n            result.violationCount += resources.length;\n            for (var i = 0; i < resources.length; ++i)\n                entry.addURL(resources[i].url);\n        }\n    },\n\n    runChecks: function(resources, result, callback)\n    {\n        this.execCheck(\"The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers:\",\n            this._missingExpirationCheck, resources, result);\n        this.execCheck(\"The following resources specify a \\\"Vary\\\" header that disables caching in most versions of Internet Explorer:\",\n            this._varyCheck, resources, result);\n        this.execCheck(\"The following cacheable resources have a short freshness lifetime:\",\n            this._oneMonthExpirationCheck, resources, result);\n\n        // Unable to implement the favicon check due to the WebKit limitations.\n        this.execCheck(\"To further improve cache hit rate, specify an expiration one year in the future for the following cacheable resources:\",\n            this._oneYearExpirationCheck, resources, result);\n    },\n\n    _missingExpirationCheck: function(resource)\n    {\n        return this.isCacheableResource(resource) && !this.hasResponseHeader(resource, \"Set-Cookie\") && !this.hasExplicitExpiration(resource);\n    },\n\n    _varyCheck: function(resource)\n    {\n        var varyHeader = this.responseHeader(resource, \"Vary\");\n        if (varyHeader) {\n            varyHeader = varyHeader.replace(/User-Agent/gi, \"\");\n            varyHeader = varyHeader.replace(/Accept-Encoding/gi, \"\");\n            varyHeader = varyHeader.replace(/[, ]*/g, \"\");\n        }\n        return varyHeader && varyHeader.length && this.isCacheableResource(resource) && this.freshnessLifetimeGreaterThan(resource, 0);\n    },\n\n    _oneMonthExpirationCheck: function(resource)\n    {\n        return this.isCacheableResource(resource) &&\n            !this.hasResponseHeader(resource, \"Set-Cookie\") &&\n            !this.freshnessLifetimeGreaterThan(resource, WebInspector.AuditRules.CacheControlRule.MillisPerMonth) &&\n            this.freshnessLifetimeGreaterThan(resource, 0);\n    },\n\n    _oneYearExpirationCheck: function(resource)\n    {\n        return this.isCacheableResource(resource) &&\n            !this.hasResponseHeader(resource, \"Set-Cookie\") &&\n            !this.freshnessLifetimeGreaterThan(resource, 11 * WebInspector.AuditRules.CacheControlRule.MillisPerMonth) &&\n            this.freshnessLifetimeGreaterThan(resource, WebInspector.AuditRules.CacheControlRule.MillisPerMonth);\n    }\n}\n\nWebInspector.AuditRules.BrowserCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;\n\n\nWebInspector.AuditRules.ProxyCacheControlRule = function() {\n    WebInspector.AuditRules.CacheControlRule.call(this, \"http-proxycache\", \"Leverage proxy caching\");\n}\n\nWebInspector.AuditRules.ProxyCacheControlRule.prototype = {\n    runChecks: function(resources, result, callback)\n    {\n        this.execCheck(\"Resources with a \\\"?\\\" in the URL are not cached by most proxy caching servers:\",\n            this._questionMarkCheck, resources, result);\n        this.execCheck(\"Consider adding a \\\"Cache-Control: public\\\" header to the following resources:\",\n            this._publicCachingCheck, resources, result);\n        this.execCheck(\"The following publicly cacheable resources contain a Set-Cookie header. This security vulnerability can cause cookies to be shared by multiple users.\",\n            this._setCookieCacheableCheck, resources, result);\n    },\n\n    _questionMarkCheck: function(resource)\n    {\n        return resource.url.indexOf(\"?\") >= 0 && !this.hasResponseHeader(resource, \"Set-Cookie\") && this.isPubliclyCacheable(resource);\n    },\n\n    _publicCachingCheck: function(resource)\n    {\n        return this.isCacheableResource(resource) &&\n            !this.isCompressible(resource) &&\n            !this.responseHeaderMatch(resource, \"Cache-Control\", \"public\") &&\n            !this.hasResponseHeader(resource, \"Set-Cookie\");\n    },\n\n    _setCookieCacheableCheck: function(resource)\n    {\n        return this.hasResponseHeader(resource, \"Set-Cookie\") && this.isPubliclyCacheable(resource);\n    }\n}\n\nWebInspector.AuditRules.ProxyCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;\n\n\nWebInspector.AuditRules.ImageDimensionsRule = function()\n{\n    WebInspector.AuditRule.call(this, \"page-imagedims\", \"Specify image dimensions\");\n}\n\nWebInspector.AuditRules.ImageDimensionsRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        function doneCallback(context)\n        {\n            var map = context.urlToNoDimensionCount;\n            for (var url in map) {\n                var entry = entry || result.addChild(\"A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height:\", true);\n                var value = WebInspector.AuditRuleResult.linkifyDisplayName(url);\n                if (map[url] > 1)\n                    value += String.sprintf(\" (%d uses)\", map[url]);\n                entry.addChild(value);\n                result.violationCount++;\n            }\n            callback(entry ? result : null);\n        }\n\n        function imageStylesReady(imageId, context, styles)\n        {\n            --context.imagesLeft;\n\n            var node = WebInspector.domAgent.nodeForId(imageId);\n            var src = node.getAttribute(\"src\");\n            if (!src.asParsedURL()) {\n                for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) {\n                    if (frameOwnerCandidate.documentURL) {\n                        var completeSrc = WebInspector.completeURL(frameOwnerCandidate.documentURL, src);\n                        break;\n                    }\n                }\n            }\n            if (completeSrc)\n                src = completeSrc;\n\n            var computedStyle = styles.computedStyle;\n            if (computedStyle.getPropertyValue(\"position\") === \"absolute\") {\n                if (!context.imagesLeft)\n                    doneCallback(context);\n                return;\n            }\n\n            var widthFound = \"width\" in styles.styleAttributes;\n            var heightFound = \"height\" in styles.styleAttributes;\n\n            for (var i = styles.matchedCSSRules.length - 1; i >= 0 && !(widthFound && heightFound); --i) {\n                var style = styles.matchedCSSRules[i].style;\n                if (style.getPropertyValue(\"width\") !== \"\")\n                    widthFound = true;\n                if (style.getPropertyValue(\"height\") !== \"\")\n                    heightFound = true;\n            }\n            \n            if (!widthFound || !heightFound) {\n                if (src in context.urlToNoDimensionCount)\n                    ++context.urlToNoDimensionCount[src];\n                else\n                    context.urlToNoDimensionCount[src] = 1;\n            }\n\n            if (!context.imagesLeft)\n                doneCallback(context);\n        }\n\n        function receivedImages(imageIds)\n        {\n            if (!imageIds || !imageIds.length)\n                return callback(null);\n            var context = {imagesLeft: imageIds.length, urlToNoDimensionCount: {}};\n            for (var i = imageIds.length - 1; i >= 0; --i)\n                WebInspector.cssModel.getStylesAsync(imageIds[i], imageStylesReady.bind(this, imageIds[i], context));\n        }\n\n        function pushImageNodes()\n        {\n            var nodeIds = [];\n            var nodes = document.getElementsByTagName(\"img\");\n            for (var i = 0; i < nodes.length; ++i) {\n                if (!nodes[i].src)\n                    continue;\n                var nodeId = this.getNodeId(nodes[i]);\n                nodeIds.push(nodeId);\n            }\n            return nodeIds;\n        }\n\n        WebInspector.AuditRules.evaluateInTargetWindow(pushImageNodes, [], receivedImages);\n    }\n}\n\nWebInspector.AuditRules.ImageDimensionsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.CssInHeadRule = function()\n{\n    WebInspector.AuditRule.call(this, \"page-cssinhead\", \"Put CSS in the document head\");\n}\n\nWebInspector.AuditRules.CssInHeadRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        function evalCallback(evalResult)\n        {\n            if (!evalResult)\n                return callback(null);\n\n            var summary = result.addChild(\"\");\n\n            var outputMessages = [];\n            for (var url in evalResult) {\n                var urlViolations = evalResult[url];\n                if (urlViolations[0]) {\n                    result.addChild(String.sprintf(\"%s style block(s) in the %s body should be moved to the document head.\", urlViolations[0], WebInspector.AuditRuleResult.linkifyDisplayName(url)));\n                    result.violationCount += urlViolations[0];\n                }\n                for (var i = 0; i < urlViolations[1].length; ++i)\n                    result.addChild(String.sprintf(\"Link node %s should be moved to the document head in %s\", WebInspector.AuditRuleResult.linkifyDisplayName(urlViolations[1][i]), WebInspector.AuditRuleResult.linkifyDisplayName(url)));\n                result.violationCount += urlViolations[1].length;\n            }\n            summary.value = String.sprintf(\"CSS in the document body adversely impacts rendering performance.\");\n            callback(result);\n        }\n\n        function routine()\n        {\n            function allViews() {\n                var views = [document.defaultView];\n                var curView = 0;\n                while (curView < views.length) {\n                    var view = views[curView];\n                    var frames = view.frames;\n                    for (var i = 0; i < frames.length; ++i) {\n                        if (frames[i] !== view)\n                            views.push(frames[i]);\n                    }\n                    ++curView;\n                }\n                return views;\n            }\n\n            var views = allViews();\n            var urlToViolationsArray = {};\n            var found = false;\n            for (var i = 0; i < views.length; ++i) {\n                var view = views[i];\n                if (!view.document)\n                    continue;\n\n                var inlineStyles = view.document.querySelectorAll(\"body style\");\n                var inlineStylesheets = view.document.querySelectorAll(\"body link[rel~='stylesheet'][href]\");\n                if (!inlineStyles.length && !inlineStylesheets.length)\n                    continue;\n\n                found = true;\n                var inlineStylesheetHrefs = [];\n                for (var j = 0; j < inlineStylesheets.length; ++j)\n                    inlineStylesheetHrefs.push(inlineStylesheets[j].href);\n                urlToViolationsArray[view.location.href] = [inlineStyles.length, inlineStylesheetHrefs];\n            }\n            return found ? urlToViolationsArray : null;\n        }\n\n        WebInspector.AuditRules.evaluateInTargetWindow(routine, [], evalCallback);\n    }\n}\n\nWebInspector.AuditRules.CssInHeadRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.StylesScriptsOrderRule = function()\n{\n    WebInspector.AuditRule.call(this, \"page-stylescriptorder\", \"Optimize the order of styles and scripts\");\n}\n\nWebInspector.AuditRules.StylesScriptsOrderRule.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        function evalCallback(resultValue)\n        {\n            if (!resultValue)\n                return callback(null);\n\n            var lateCssUrls = resultValue[0];\n            var cssBeforeInlineCount = resultValue[1];\n\n            var entry = result.addChild(\"The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript.\", true);\n            entry.addURLs(lateCssUrls);\n            result.violationCount += lateCssUrls.length;\n\n            if (cssBeforeInlineCount) {\n                result.addChild(String.sprintf(\" %d inline script block%s found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource.\", cssBeforeInlineCount, cssBeforeInlineCount > 1 ? \"s were\" : \" was\"));\n                result.violationCount += cssBeforeInlineCount;\n            }\n            callback(result);\n        }\n\n        function routine()\n        {\n            var lateStyles = document.querySelectorAll(\"head script[src] ~ link[rel~='stylesheet'][href]\");\n            var cssBeforeInlineCount = document.querySelectorAll(\"head link[rel~='stylesheet'][href] ~ script:not([src])\").length;\n            if (!lateStyles.length && !cssBeforeInlineCount)\n                return null;\n\n            var lateStyleUrls = [];\n            for (var i = 0; i < lateStyles.length; ++i)\n                lateStyleUrls.push(lateStyles[i].href);\n            return [ lateStyleUrls, cssBeforeInlineCount ];\n        }\n\n        WebInspector.AuditRules.evaluateInTargetWindow(routine, [], evalCallback.bind(this));\n    }\n}\n\nWebInspector.AuditRules.StylesScriptsOrderRule.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.CookieRuleBase = function(id, name)\n{\n    WebInspector.AuditRule.call(this, id, name);\n}\n\nWebInspector.AuditRules.CookieRuleBase.prototype = {\n    doRun: function(resources, result, callback)\n    {\n        var self = this;\n        function resultCallback(receivedCookies, isAdvanced) {\n            self.processCookies(isAdvanced ? receivedCookies : [], resources, result);\n            callback(result);\n        }\n        WebInspector.Cookies.getCookiesAsync(resultCallback);\n    },\n\n    mapResourceCookies: function(resourcesByDomain, allCookies, callback)\n    {\n        for (var i = 0; i < allCookies.length; ++i) {\n            for (var resourceDomain in resourcesByDomain) {\n                if (WebInspector.Cookies.cookieDomainMatchesResourceDomain(allCookies[i].domain, resourceDomain))\n                    this._callbackForResourceCookiePairs(resourcesByDomain[resourceDomain], allCookies[i], callback);\n            }\n        }\n    },\n\n    _callbackForResourceCookiePairs: function(resources, cookie, callback)\n    {\n        if (!resources)\n            return;\n        for (var i = 0; i < resources.length; ++i) {\n            if (WebInspector.Cookies.cookieMatchesResourceURL(cookie, resources[i].url))\n                callback(resources[i], cookie);\n        }\n    }\n}\n\nWebInspector.AuditRules.CookieRuleBase.prototype.__proto__ = WebInspector.AuditRule.prototype;\n\n\nWebInspector.AuditRules.CookieSizeRule = function(avgBytesThreshold)\n{\n    WebInspector.AuditRules.CookieRuleBase.call(this, \"http-cookiesize\", \"Minimize cookie size\");\n    this._avgBytesThreshold = avgBytesThreshold;\n    this._maxBytesThreshold = 1000;\n}\n\nWebInspector.AuditRules.CookieSizeRule.prototype = {\n    _average: function(cookieArray)\n    {\n        var total = 0;\n        for (var i = 0; i < cookieArray.length; ++i)\n            total += cookieArray[i].size;\n        return cookieArray.length ? Math.round(total / cookieArray.length) : 0;\n    },\n\n    _max: function(cookieArray)\n    {\n        var result = 0;\n        for (var i = 0; i < cookieArray.length; ++i)\n            result = Math.max(cookieArray[i].size, result);\n        return result;\n    },\n\n    processCookies: function(allCookies, resources, result)\n    {\n        function maxSizeSorter(a, b)\n        {\n            return b.maxCookieSize - a.maxCookieSize;\n        }\n\n        function avgSizeSorter(a, b)\n        {\n            return b.avgCookieSize - a.avgCookieSize;\n        }\n\n        var cookiesPerResourceDomain = {};\n\n        function collectorCallback(resource, cookie)\n        {\n            var cookies = cookiesPerResourceDomain[resource.domain];\n            if (!cookies) {\n                cookies = [];\n                cookiesPerResourceDomain[resource.domain] = cookies;\n            }\n            cookies.push(cookie);\n        }\n\n        if (!allCookies.length)\n            return;\n\n        var sortedCookieSizes = [];\n\n        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources,\n                null,\n                true);\n        var matchingResourceData = {};\n        this.mapResourceCookies(domainToResourcesMap, allCookies, collectorCallback.bind(this));\n\n        for (var resourceDomain in cookiesPerResourceDomain) {\n            var cookies = cookiesPerResourceDomain[resourceDomain];\n            sortedCookieSizes.push({\n                domain: resourceDomain,\n                avgCookieSize: this._average(cookies),\n                maxCookieSize: this._max(cookies)\n            });\n        }\n        var avgAllCookiesSize = this._average(allCookies);\n\n        var hugeCookieDomains = [];\n        sortedCookieSizes.sort(maxSizeSorter);\n\n        for (var i = 0, len = sortedCookieSizes.length; i < len; ++i) {\n            var maxCookieSize = sortedCookieSizes[i].maxCookieSize;\n            if (maxCookieSize > this._maxBytesThreshold)\n                hugeCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + \": \" + Number.bytesToString(maxCookieSize));\n        }\n\n        var bigAvgCookieDomains = [];\n        sortedCookieSizes.sort(avgSizeSorter);\n        for (var i = 0, len = sortedCookieSizes.length; i < len; ++i) {\n            var domain = sortedCookieSizes[i].domain;\n            var avgCookieSize = sortedCookieSizes[i].avgCookieSize;\n            if (avgCookieSize > this._avgBytesThreshold && avgCookieSize < this._maxBytesThreshold)\n                bigAvgCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(domain) + \": \" + Number.bytesToString(avgCookieSize));\n        }\n        result.addChild(String.sprintf(\"The average cookie size for all requests on this page is %s\", Number.bytesToString(avgAllCookiesSize)));\n\n        var message;\n        if (hugeCookieDomains.length) {\n            var entry = result.addChild(\"The following domains have a cookie size in excess of 1KB. This is harmful because requests with cookies larger than 1KB typically cannot fit into a single network packet.\", true);\n            entry.addURLs(hugeCookieDomains);\n            result.violationCount += hugeCookieDomains.length;\n        }\n\n        if (bigAvgCookieDomains.length) {\n            var entry = result.addChild(String.sprintf(\"The following domains have an average cookie size in excess of %d bytes. Reducing the size of cookies for these domains can reduce the time it takes to send requests.\", this._avgBytesThreshold), true);\n            entry.addURLs(bigAvgCookieDomains);\n            result.violationCount += bigAvgCookieDomains.length;\n        }\n    }\n}\n\nWebInspector.AuditRules.CookieSizeRule.prototype.__proto__ = WebInspector.AuditRules.CookieRuleBase.prototype;\n\n\nWebInspector.AuditRules.StaticCookielessRule = function(minResources)\n{\n    WebInspector.AuditRules.CookieRuleBase.call(this, \"http-staticcookieless\", \"Serve static content from a cookieless domain\");\n    this._minResources = minResources;\n}\n\nWebInspector.AuditRules.StaticCookielessRule.prototype = {\n    processCookies: function(allCookies, resources, result)\n    {\n        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources,\n                [WebInspector.Resource.Type.Stylesheet,\n                 WebInspector.Resource.Type.Image],\n                true);\n        var totalStaticResources = 0;\n        for (var domain in domainToResourcesMap)\n            totalStaticResources += domainToResourcesMap[domain].length;\n        if (totalStaticResources < this._minResources)\n            return;\n        var matchingResourceData = {};\n        this.mapResourceCookies(domainToResourcesMap, allCookies, this._collectorCallback.bind(this, matchingResourceData));\n\n        var badUrls = [];\n        var cookieBytes = 0;\n        for (var url in matchingResourceData) {\n            badUrls.push(url);\n            cookieBytes += matchingResourceData[url]\n        }\n        if (badUrls.length < this._minResources)\n            return;\n\n        var entry = result.addChild(String.sprintf(\"%s of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:\", Number.bytesToString(cookieBytes)), true);\n        entry.addURLs(badUrls);\n        result.violationCount = badUrls.length;\n    },\n\n    _collectorCallback: function(matchingResourceData, resource, cookie)\n    {\n        matchingResourceData[resource.url] = (matchingResourceData[resource.url] || 0) + cookie.size;\n    }\n}\n\nWebInspector.AuditRules.StaticCookielessRule.prototype.__proto__ = WebInspector.AuditRules.CookieRuleBase.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/AuditsPanel.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.AuditsPanel = function()\n{\n    WebInspector.Panel.call(this, \"audits\");\n\n    this.createSidebar();\n    this.auditsTreeElement = new WebInspector.SidebarSectionTreeElement(\"\", {}, true);\n    this.sidebarTree.appendChild(this.auditsTreeElement);\n    this.auditsTreeElement.listItemElement.addStyleClass(\"hidden\");\n    this.auditsTreeElement.expand();\n\n    this.auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement();\n    this.auditsTreeElement.appendChild(this.auditsItemTreeElement);\n\n    this.auditResultsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString(\"RESULTS\"), {}, true);\n    this.sidebarTree.appendChild(this.auditResultsTreeElement);\n    this.auditResultsTreeElement.expand();\n\n    this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Clear audit results.\"), \"clear-status-bar-item\");\n    this.clearResultsButton.addEventListener(\"click\", this._clearButtonClicked.bind(this), false);\n\n    this.viewsContainerElement = document.createElement(\"div\");\n    this.viewsContainerElement.id = \"audit-views\";\n    this.element.appendChild(this.viewsContainerElement);\n\n    this._constructCategories();\n\n    this._launcherView = new WebInspector.AuditLauncherView(this.initiateAudit.bind(this));\n    for (id in this.categoriesById)\n        this._launcherView.addCategory(this.categoriesById[id]);\n}\n\nWebInspector.AuditsPanel.prototype = {\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Audits\");\n    },\n\n    get statusBarItems()\n    {\n        return [this.clearResultsButton.element];\n    },\n\n    get mainResourceLoadTime()\n    {\n        return this._mainResourceLoadTime;\n    },\n\n    set mainResourceLoadTime(x)\n    {\n        this._mainResourceLoadTime = x;\n        this._didMainResourceLoad();\n    },\n\n    get mainResourceDOMContentTime()\n    {\n        return this._mainResourceDOMContentTime;\n    },\n\n    set mainResourceDOMContentTime(x)\n    {\n        this._mainResourceDOMContentTime = x;\n    },\n\n    get categoriesById()\n    {\n        return this._auditCategoriesById;\n    },\n\n    addCategory: function(category)\n    {\n        this.categoriesById[category.id] = category;\n        this._launcherView.addCategory(category);\n    },\n\n    getCategory: function(id)\n    {\n        return this.categoriesById[id];\n    },\n\n    _constructCategories: function()\n    {\n        this._auditCategoriesById = {};\n        for (var categoryCtorID in WebInspector.AuditCategories) {\n            var auditCategory = new WebInspector.AuditCategories[categoryCtorID]();\n            auditCategory._id = categoryCtorID;\n            this.categoriesById[categoryCtorID] = auditCategory;\n        }\n    },\n\n    _executeAudit: function(categories, resultCallback)\n    {\n        var resources = WebInspector.networkResources;\n\n        var rulesRemaining = 0;\n        for (var i = 0; i < categories.length; ++i)\n            rulesRemaining += categories[i].ruleCount;\n\n        var results = [];\n        var mainResourceURL = WebInspector.mainResource.url;\n\n        function ruleResultReadyCallback(categoryResult, ruleResult)\n        {\n            if (ruleResult && ruleResult.children)\n                categoryResult.addRuleResult(ruleResult);\n\n            --rulesRemaining;\n\n            if (!rulesRemaining && resultCallback)\n                resultCallback(mainResourceURL, results);\n        }\n\n        if (!rulesRemaining) {\n            resultCallback(mainResourceURL, results);\n            return;\n        }\n\n        for (var i = 0; i < categories.length; ++i) {\n            var category = categories[i];\n            var result = new WebInspector.AuditCategoryResult(category);\n            results.push(result);\n            category.run(resources, ruleResultReadyCallback.bind(null, result));\n        }\n    },\n\n    _auditFinishedCallback: function(launcherCallback, mainResourceURL, results)\n    {\n        var children = this.auditResultsTreeElement.children;\n        var ordinal = 1;\n        for (var i = 0; i < children.length; ++i) {\n            if (children[i].mainResourceURL === mainResourceURL)\n                ordinal++;\n        }\n\n        var resultTreeElement = new WebInspector.AuditResultSidebarTreeElement(results, mainResourceURL, ordinal);\n        this.auditResultsTreeElement.appendChild(resultTreeElement);\n        resultTreeElement.reveal();\n        resultTreeElement.select();\n        if (launcherCallback)\n            launcherCallback();\n    },\n\n    initiateAudit: function(categoryIds, runImmediately, launcherCallback)\n    {\n        if (!categoryIds || !categoryIds.length)\n            return;\n\n        var categories = [];\n        for (var i = 0; i < categoryIds.length; ++i)\n            categories.push(this.categoriesById[categoryIds[i]]);\n\n        function initiateAuditCallback(categories, launcherCallback)\n        {\n            this._executeAudit(categories, this._auditFinishedCallback.bind(this, launcherCallback));\n        }\n\n        if (runImmediately)\n            initiateAuditCallback.call(this, categories, launcherCallback);\n        else\n            this._reloadResources(initiateAuditCallback.bind(this, categories, launcherCallback));\n    },\n\n    _reloadResources: function(callback)\n    {\n        this._pageReloadCallback = callback;\n        InspectorBackend.reloadPage(false);\n    },\n\n    _didMainResourceLoad: function()\n    {\n        if (this._pageReloadCallback) {\n            var callback = this._pageReloadCallback;\n            delete this._pageReloadCallback;\n            callback();\n        }\n    },\n\n    showResults: function(categoryResults)\n    {\n        if (!categoryResults._resultView)\n            categoryResults._resultView = new WebInspector.AuditResultView(categoryResults);\n\n        this.visibleView = categoryResults._resultView;\n    },\n\n    showLauncherView: function()\n    {\n        this.visibleView = this._launcherView;\n    },\n\n    get visibleView()\n    {\n        return this._visibleView;\n    },\n\n    set visibleView(x)\n    {\n        if (this._visibleView === x)\n            return;\n\n        if (this._visibleView)\n            this._visibleView.hide();\n\n        this._visibleView = x;\n\n        if (x)\n            x.show(this.viewsContainerElement);\n    },\n\n    attach: function()\n    {\n        WebInspector.Panel.prototype.attach.call(this);\n\n        this.auditsItemTreeElement.select();\n    },\n\n    updateMainViewWidth: function(width)\n    {\n        this.viewsContainerElement.style.left = width + \"px\";\n    },\n\n    _clearButtonClicked: function()\n    {\n        this.auditsItemTreeElement.reveal();\n        this.auditsItemTreeElement.select();\n        this.auditResultsTreeElement.removeChildren();\n    }\n}\n\nWebInspector.AuditsPanel.prototype.__proto__ = WebInspector.Panel.prototype;\n\n\n\nWebInspector.AuditCategory = function(displayName)\n{\n    this._displayName = displayName;\n    this._rules = [];\n}\n\nWebInspector.AuditCategory.prototype = {\n    get id()\n    {\n        // this._id value is injected at construction time.\n        return this._id;\n    },\n\n    get displayName()\n    {\n        return this._displayName;\n    },\n\n    get ruleCount()\n    {\n        this._ensureInitialized();\n        return this._rules.length;\n    },\n\n    addRule: function(rule, severity)\n    {\n        rule.severity = severity;\n        this._rules.push(rule);\n    },\n\n    run: function(resources, callback)\n    {\n        this._ensureInitialized();\n        for (var i = 0; i < this._rules.length; ++i)\n            this._rules[i].run(resources, callback);\n    },\n\n    _ensureInitialized: function()\n    {\n        if (!this._initialized) {\n            if (\"initialize\" in this)\n                this.initialize();\n            this._initialized = true;\n        }\n    }\n}\n\n\nWebInspector.AuditRule = function(id, displayName)\n{\n    this._id = id;\n    this._displayName = displayName;\n}\n\nWebInspector.AuditRule.Severity = {\n    Info: \"info\",\n    Warning: \"warning\",\n    Severe: \"severe\"\n}\n\nWebInspector.AuditRule.SeverityOrder = {\n    \"info\": 3,\n    \"warning\": 2,\n    \"severe\": 1\n}\n\nWebInspector.AuditRule.prototype = {\n    get id()\n    {\n        return this._id;\n    },\n\n    get displayName()\n    {\n        return this._displayName;\n    },\n\n    set severity(severity)\n    {\n        this._severity = severity;\n    },\n\n    run: function(resources, callback)\n    {\n        var result = new WebInspector.AuditRuleResult(this.displayName);\n        result.severity = this._severity;\n        this.doRun(resources, result, callback);\n    },\n\n    doRun: function(resources, result, callback)\n    {\n        throw new Error(\"doRun() not implemented\");\n    }\n}\n\nWebInspector.AuditCategoryResult = function(category)\n{\n    this.title = category.displayName;\n    this.ruleResults = [];\n}\n\nWebInspector.AuditCategoryResult.prototype = {\n    addRuleResult: function(ruleResult)\n    {\n        this.ruleResults.push(ruleResult);\n    }\n}\n\nWebInspector.AuditRuleResult = function(value, expanded, className)\n{\n    this.value = value;\n    this.className = className;\n    this.expanded = expanded;\n    this.violationCount = 0;\n}\n\nWebInspector.AuditRuleResult.linkifyDisplayName = function(url)\n{\n    return WebInspector.linkifyURL(url, WebInspector.displayNameForURL(url));\n}\n\nWebInspector.AuditRuleResult.resourceDomain = function(domain)\n{\n    return domain || WebInspector.UIString(\"[empty domain]\");\n}\n\nWebInspector.AuditRuleResult.prototype = {\n    addChild: function(value, expanded, className)\n    {\n        if (!this.children)\n            this.children = [];\n        var entry = new WebInspector.AuditRuleResult(value, expanded, className);\n        this.children.push(entry);\n        return entry;\n    },\n\n    addURL: function(url)\n    {\n        return this.addChild(WebInspector.AuditRuleResult.linkifyDisplayName(url));\n    },\n\n    addURLs: function(urls)\n    {\n        for (var i = 0; i < urls.length; ++i)\n            this.addURL(urls[i]);\n    },\n\n    addSnippet: function(snippet)\n    {\n        return this.addChild(snippet, false, \"source-code\");\n    }\n}\n\nWebInspector.AuditsSidebarTreeElement = function()\n{\n    this.small = false;\n\n    WebInspector.SidebarTreeElement.call(this, \"audits-sidebar-tree-item\", WebInspector.UIString(\"Audits\"), \"\", null, false);\n}\n\nWebInspector.AuditsSidebarTreeElement.prototype = {\n    onattach: function()\n    {\n        WebInspector.SidebarTreeElement.prototype.onattach.call(this);\n    },\n\n    onselect: function()\n    {\n        WebInspector.panels.audits.showLauncherView();\n    },\n\n    get selectable()\n    {\n        return true;\n    },\n\n    refresh: function()\n    {\n        this.refreshTitles();\n    }\n}\n\nWebInspector.AuditsSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;\n\n\nWebInspector.AuditResultSidebarTreeElement = function(results, mainResourceURL, ordinal)\n{\n    this.results = results;\n    this.mainResourceURL = mainResourceURL;\n\n    WebInspector.SidebarTreeElement.call(this, \"audit-result-sidebar-tree-item\", String.sprintf(\"%s (%d)\", mainResourceURL, ordinal), \"\", {}, false);\n}\n\nWebInspector.AuditResultSidebarTreeElement.prototype = {\n    onselect: function()\n    {\n        WebInspector.panels.audits.showResults(this.results);\n    },\n\n    get selectable()\n    {\n        return true;\n    }\n}\n\nWebInspector.AuditResultSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;\n\n// Contributed audit rules should go into this namespace.\nWebInspector.AuditRules = {};\n\n// Contributed audit categories should go into this namespace.\nWebInspector.AuditCategories = {};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/BottomUpProfileDataGridTree.js",
    "content": "/*\n * Copyright (C) 2009 280 North Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Bottom Up Profiling shows the entire callstack backwards:\n// The root node is a representation of each individual function called, and each child of that node represents\n// a reverse-callstack showing how many of those calls came from it. So, unlike top-down, the statistics in\n// each child still represent the root node. We have to be particularly careful of recursion with this mode\n// because a root node can represent itself AND an ancestor.\n\nWebInspector.BottomUpProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*BottomUpProfileDataGridTree*/ owningTree)\n{\n    WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, this._willHaveChildren(profileNode));\n\n    this._remainingNodeInfos = [];\n}\n\nWebInspector.BottomUpProfileDataGridNode.prototype = {\n    _takePropertiesFromProfileDataGridNode: function(/*ProfileDataGridNode*/ profileDataGridNode)\n    {\n        this._save();\n\n        this.selfTime = profileDataGridNode.selfTime;\n        this.totalTime = profileDataGridNode.totalTime;\n        this.numberOfCalls = profileDataGridNode.numberOfCalls;\n    },\n\n    // When focusing, we keep just the members of the callstack.\n    _keepOnlyChild: function(/*ProfileDataGridNode*/ child)\n    {\n        this._save();\n\n        this.removeChildren();\n        this.appendChild(child);\n    },\n\n    _exclude: function(aCallUID)\n    {\n        if (this._remainingNodeInfos)\n            this._populate();\n\n        this._save();\n\n        var children = this.children;\n        var index = this.children.length;\n\n        while (index--)\n            children[index]._exclude(aCallUID);\n\n        var child = this.childrenByCallUID[aCallUID];\n\n        if (child)\n            this._merge(child, true);\n    },\n\n    _restore: function()\n    {\n        WebInspector.ProfileDataGridNode.prototype._restore();\n\n        if (!this.children.length)\n            this.hasChildren = this._willHaveChildren();\n    },\n\n    _merge: function(/*ProfileDataGridNode*/ child, /*Boolean*/ shouldAbsorb)\n    {\n        this.selfTime -= child.selfTime;\n\n        WebInspector.ProfileDataGridNode.prototype._merge.call(this, child, shouldAbsorb);\n    },\n\n    _sharedPopulate: function()\n    {\n        var remainingNodeInfos = this._remainingNodeInfos;\n        var count = remainingNodeInfos.length;\n\n        for (var index = 0; index < count; ++index) {\n            var nodeInfo = remainingNodeInfos[index];\n            var ancestor = nodeInfo.ancestor;\n            var focusNode = nodeInfo.focusNode;\n            var child = this.findChild(ancestor);\n\n            // If we already have this child, then merge the data together.\n            if (child) {\n                var totalTimeAccountedFor = nodeInfo.totalTimeAccountedFor;\n\n                child.selfTime += focusNode.selfTime;\n                child.numberOfCalls += focusNode.numberOfCalls;\n\n                if (!totalTimeAccountedFor)\n                    child.totalTime += focusNode.totalTime;\n            } else {\n                // If not, add it as a true ancestor.\n                // In heavy mode, we take our visual identity from ancestor node...\n                var child = new WebInspector.BottomUpProfileDataGridNode(this.profileView, ancestor, this.tree);\n\n                if (ancestor !== focusNode) {\n                    // but the actual statistics from the \"root\" node (bottom of the callstack).\n                    child.selfTime = focusNode.selfTime;\n                    child.totalTime = focusNode.totalTime;\n                    child.numberOfCalls = focusNode.numberOfCalls;\n                }\n\n                this.appendChild(child);\n            }\n\n            var parent = ancestor.parent;\n            if (parent && parent.parent) {\n                nodeInfo.ancestor = parent;\n                child._remainingNodeInfos.push(nodeInfo);\n            }\n        }\n\n        delete this._remainingNodeInfos;\n    },\n\n    _willHaveChildren: function(profileNode)\n    {\n        profileNode = profileNode || this.profileNode;\n        // In bottom up mode, our parents are our children since we display an inverted tree.\n        // However, we don't want to show the very top parent since it is redundant.\n        return !!(profileNode.parent && profileNode.parent.parent);\n    }\n}\n\nWebInspector.BottomUpProfileDataGridNode.prototype.__proto__ = WebInspector.ProfileDataGridNode.prototype;\n\nWebInspector.BottomUpProfileDataGridTree = function(/*ProfileView*/ aProfileView, /*ProfileNode*/ aProfileNode)\n{\n    WebInspector.ProfileDataGridTree.call(this, aProfileView, aProfileNode);\n\n    // Iterate each node in pre-order.\n    var profileNodeUIDs = 0;\n    var profileNodeGroups = [[], [aProfileNode]];\n    var visitedProfileNodesForCallUID = {};\n\n    this._remainingNodeInfos = [];\n\n    for (var profileNodeGroupIndex = 0; profileNodeGroupIndex < profileNodeGroups.length; ++profileNodeGroupIndex) {\n        var parentProfileNodes = profileNodeGroups[profileNodeGroupIndex];\n        var profileNodes = profileNodeGroups[++profileNodeGroupIndex];\n        var count = profileNodes.length;\n\n        for (var index = 0; index < count; ++index) {\n            var profileNode = profileNodes[index];\n\n            if (!profileNode.UID)\n                profileNode.UID = ++profileNodeUIDs;\n\n            if (profileNode.head && profileNode !== profileNode.head) {\n                // The total time of this ancestor is accounted for if we're in any form of recursive cycle.\n                var visitedNodes = visitedProfileNodesForCallUID[profileNode.callUID];\n                var totalTimeAccountedFor = false;\n\n                if (!visitedNodes) {\n                    visitedNodes = {}\n                    visitedProfileNodesForCallUID[profileNode.callUID] = visitedNodes;\n                } else {\n                    // The total time for this node has already been accounted for iff one of it's parents has already been visited.\n                    // We can do this check in this style because we are traversing the tree in pre-order.\n                    var parentCount = parentProfileNodes.length;\n                    for (var parentIndex = 0; parentIndex < parentCount; ++parentIndex) {\n                        if (visitedNodes[parentProfileNodes[parentIndex].UID]) {\n                            totalTimeAccountedFor = true;\n                            break;\n                        }\n                    }\n                }\n\n                visitedNodes[profileNode.UID] = true;\n\n                this._remainingNodeInfos.push({ ancestor:profileNode, focusNode:profileNode, totalTimeAccountedFor:totalTimeAccountedFor });\n            }\n\n            var children = profileNode.children;\n            if (children.length) {\n                profileNodeGroups.push(parentProfileNodes.concat([profileNode]))\n                profileNodeGroups.push(children);\n            }\n        }\n    }\n\n    // Populate the top level nodes.\n    WebInspector.BottomUpProfileDataGridNode.prototype._populate.call(this);\n\n    return this;\n}\n\nWebInspector.BottomUpProfileDataGridTree.prototype = {\n    // When focusing, we keep the entire callstack up to this ancestor.\n    focus: function(/*ProfileDataGridNode*/ profileDataGridNode)\n    {\n        if (!profileDataGridNode)\n            return;\n\n        this._save();\n\n        var currentNode = profileDataGridNode;\n        var focusNode = profileDataGridNode;\n\n        while (currentNode.parent && (currentNode instanceof WebInspector.ProfileDataGridNode)) {\n            currentNode._takePropertiesFromProfileDataGridNode(profileDataGridNode);\n\n            focusNode = currentNode;\n            currentNode = currentNode.parent;\n\n            if (currentNode instanceof WebInspector.ProfileDataGridNode)\n                currentNode._keepOnlyChild(focusNode);\n        }\n\n        this.children = [focusNode];\n        this.totalTime = profileDataGridNode.totalTime;\n    },\n\n    exclude: function(/*ProfileDataGridNode*/ profileDataGridNode)\n    {\n        if (!profileDataGridNode)\n            return;\n\n        this._save();\n\n        var excludedCallUID = profileDataGridNode.callUID;\n        var excludedTopLevelChild = this.childrenByCallUID[excludedCallUID];\n\n        // If we have a top level node that is excluded, get rid of it completely (not keeping children),\n        // since bottom up data relies entirely on the root node.\n        if (excludedTopLevelChild)\n            this.children.remove(excludedTopLevelChild);\n\n        var children = this.children;\n        var count = children.length;\n\n        for (var index = 0; index < count; ++index)\n            children[index]._exclude(excludedCallUID);\n\n        if (this.lastComparator)\n            this.sort(this.lastComparator, true);\n    },\n\n    _sharedPopulate: WebInspector.BottomUpProfileDataGridNode.prototype._sharedPopulate\n}\n\nWebInspector.BottomUpProfileDataGridTree.prototype.__proto__ = WebInspector.ProfileDataGridTree.prototype;\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Breakpoint.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Breakpoint = function(id, url, sourceID, lineNumber, columnNumber, condition, enabled)\n{\n    this.id = id;\n    this.url = url;\n    this.sourceID = sourceID;\n    this.lineNumber = lineNumber;\n    this.columnNumber = columnNumber;\n    this.condition = condition;\n    this.enabled = enabled;\n    this.locations = [];\n}\n\nWebInspector.Breakpoint.prototype = {\n    addLocation: function(sourceID, lineNumber, columnNumber)\n    {\n        this.locations.push({ sourceID: sourceID, lineNumber: lineNumber, columnNumber: columnNumber });\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/BreakpointManager.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.BreakpointManager = function()\n{\n    this._stickyBreakpoints = {};\n    var breakpoints = WebInspector.settings.findSettingForAllProjects(\"nativeBreakpoints\");\n    for (var projectId in breakpoints)\n        this._stickyBreakpoints[projectId] = this._validateBreakpoints(breakpoints[projectId]);\n\n    this._breakpoints = {};\n    this._domBreakpointsRestored = false;\n\n    WebInspector.settings.addEventListener(WebInspector.Settings.Events.ProjectChanged, this._projectChanged, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);\n}\n\nWebInspector.BreakpointManager.BreakpointTypes = {\n    DOM: \"DOM\",\n    EventListener: \"EventListener\",\n    XHR: \"XHR\"\n}\n\nWebInspector.BreakpointManager.Events = {\n    DOMBreakpointAdded: \"dom-breakpoint-added\",\n    EventListenerBreakpointAdded: \"event-listener-breakpoint-added\",\n    XHRBreakpointAdded: \"xhr-breakpoint-added\",\n    ProjectChanged: \"project-changed\"\n}\n\nWebInspector.BreakpointManager.prototype = {\n    createDOMBreakpoint: function(nodeId, type)\n    {\n        this._createDOMBreakpoint(nodeId, type, true, false);\n    },\n\n    _createDOMBreakpoint: function(nodeId, type, enabled, restored)\n    {\n        var node = WebInspector.domAgent.nodeForId(nodeId);\n        if (!node)\n            return;\n\n        var breakpointId = this._createDOMBreakpointId(nodeId, type);\n        if (breakpointId in this._breakpoints)\n            return;\n\n        var breakpoint = new WebInspector.DOMBreakpoint(node, type);\n        this._setBreakpoint(breakpointId, breakpoint, enabled, restored);\n        if (enabled && restored)\n            breakpoint._enable();\n\n        breakpoint.view = new WebInspector.DOMBreakpointView(this, breakpointId, enabled, node, type);\n        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.DOMBreakpointAdded, breakpoint.view);\n    },\n\n    createEventListenerBreakpoint: function(eventName)\n    {\n        this._createEventListenerBreakpoint(eventName, true, false);\n    },\n\n    _createEventListenerBreakpoint: function(eventName, enabled, restored)\n    {\n        var breakpointId = this._createEventListenerBreakpointId(eventName);\n        if (breakpointId in this._breakpoints)\n            return;\n\n        var breakpoint = new WebInspector.EventListenerBreakpoint(eventName);\n        this._setBreakpoint(breakpointId, breakpoint, enabled, restored);\n\n        breakpoint.view = new WebInspector.EventListenerBreakpointView(this, breakpointId, enabled, eventName);\n        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.EventListenerBreakpointAdded, breakpoint.view);\n    },\n\n    createXHRBreakpoint: function(url)\n    {\n        this._createXHRBreakpoint(url, true, false);\n    },\n\n    _createXHRBreakpoint: function(url, enabled, restored)\n    {\n        var breakpointId = this._createXHRBreakpointId(url);\n        if (breakpointId in this._breakpoints)\n            return;\n\n        var breakpoint = new WebInspector.XHRBreakpoint(url);\n        this._setBreakpoint(breakpointId, breakpoint, enabled, restored);\n\n        breakpoint.view = new WebInspector.XHRBreakpointView(this, breakpointId, enabled, url);\n        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.XHRBreakpointAdded, breakpoint.view);\n    },\n\n    _setBreakpoint: function(breakpointId, breakpoint, enabled, restored)\n    {\n        this._breakpoints[breakpointId] = breakpoint;\n        breakpoint.enabled = enabled;\n        if (restored)\n            return;\n        if (enabled)\n            breakpoint._enable();\n        this._saveBreakpoints();\n    },\n\n    _setBreakpointEnabled: function(breakpointId, enabled)\n    {\n        var breakpoint = this._breakpoints[breakpointId];\n        if (breakpoint.enabled === enabled)\n            return;\n        if (enabled)\n            breakpoint._enable();\n        else\n            breakpoint._disable();\n        breakpoint.enabled = enabled;\n        this._saveBreakpoints();\n    },\n\n    _removeBreakpoint: function(breakpointId)\n    {\n        var breakpoint = this._breakpoints[breakpointId];\n        if (breakpoint.enabled)\n            breakpoint._disable();\n        delete this._breakpoints[breakpointId];\n        this._saveBreakpoints();\n    },\n\n    breakpointViewForEventData: function(eventData)\n    {\n        var breakpointId;\n        if (eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.DOM)\n            breakpointId = this._createDOMBreakpointId(eventData.nodeId, eventData.type);\n        else if (eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.EventListener)\n            breakpointId = this._createEventListenerBreakpointId(eventData.eventName);\n        else if (eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.XHR)\n            breakpointId = this._createXHRBreakpointId(eventData.breakpointURL);\n        else\n            return;\n\n        var breakpoint = this._breakpoints[breakpointId];\n        if (breakpoint)\n            return breakpoint.view;\n    },\n\n    _debuggerPaused: function(event)\n    {\n        var eventType = event.data.eventType;\n        var eventData = event.data.eventData;\n\n        if (eventType !== WebInspector.DebuggerEventTypes.NativeBreakpoint)\n            return;\n\n        var breakpointView = this.breakpointViewForEventData(eventData);\n        if (!breakpointView)\n            return;\n\n        breakpointView.hit = true;\n        this._lastHitBreakpointView = breakpointView;\n    },\n\n    _debuggerResumed: function(event)\n    {\n        if (!this._lastHitBreakpointView)\n            return;\n        this._lastHitBreakpointView.hit = false;\n        delete this._lastHitBreakpointView;\n    },\n\n    _projectChanged: function(event)\n    {\n        this._breakpoints = {};\n        this._domBreakpointsRestored = false;\n        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.ProjectChanged);\n\n        var breakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];\n        for (var i = 0; i < breakpoints.length; ++i) {\n            var breakpoint = breakpoints[i];\n            if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.EventListener)\n                this._createEventListenerBreakpoint(breakpoint.condition.eventName, breakpoint.enabled, true);\n            else if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.XHR)\n                this._createXHRBreakpoint(breakpoint.condition.url, breakpoint.enabled, true);\n        }\n\n        if (!this._breakpointsPushedToFrontend) {\n            InspectorBackend.setAllBrowserBreakpoints(this._stickyBreakpoints);\n            this._breakpointsPushedToFrontend = true;\n        }\n    },\n\n    restoreDOMBreakpoints: function()\n    {\n        function didPushNodeByPathToFrontend(path, nodeId)\n        {\n            pathToNodeId[path] = nodeId;\n            pendingCalls -= 1;\n            if (pendingCalls)\n                return;\n            for (var i = 0; i < breakpoints.length; ++i) {\n                var breakpoint = breakpoints[i];\n                if (breakpoint.type !== WebInspector.BreakpointManager.BreakpointTypes.DOM)\n                    continue;\n                var nodeId = pathToNodeId[breakpoint.condition.path];\n                if (nodeId)\n                    this._createDOMBreakpoint(nodeId, breakpoint.condition.type, breakpoint.enabled, true);\n            }\n            this._domBreakpointsRestored = true;\n            this._saveBreakpoints();\n        }\n\n        var breakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];\n        var pathToNodeId = {};\n        var pendingCalls = 0;\n        for (var i = 0; i < breakpoints.length; ++i) {\n            if (breakpoints[i].type !== WebInspector.BreakpointManager.BreakpointTypes.DOM)\n                continue;\n            var path = breakpoints[i].condition.path;\n            if (path in pathToNodeId)\n                continue;\n            pathToNodeId[path] = 0;\n            pendingCalls += 1;\n            InspectorBackend.pushNodeByPathToFrontend(path, didPushNodeByPathToFrontend.bind(this, path));\n        }\n        if (!pendingCalls)\n            this._domBreakpointsRestored = true;\n    },\n\n    _saveBreakpoints: function()\n    {\n        var breakpoints = [];\n        for (var breakpointId in this._breakpoints) {\n            var breakpoint = this._breakpoints[breakpointId];\n            var persistentBreakpoint = breakpoint._serializeToJSON();\n            persistentBreakpoint.enabled = breakpoint.enabled;\n            breakpoints.push(persistentBreakpoint);\n        }\n        if (!this._domBreakpointsRestored) {\n            var stickyBreakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];\n            for (var i = 0; i < stickyBreakpoints.length; ++i) {\n                if (stickyBreakpoints[i].type === WebInspector.BreakpointManager.BreakpointTypes.DOM)\n                    breakpoints.push(stickyBreakpoints[i]);\n            }\n        }\n        WebInspector.settings.nativeBreakpoints = breakpoints;\n\n        this._stickyBreakpoints[WebInspector.settings.projectId] = breakpoints;\n        InspectorBackend.setAllBrowserBreakpoints(this._stickyBreakpoints);\n    },\n\n    _validateBreakpoints: function(persistentBreakpoints)\n    {\n        var breakpoints = [];\n        var breakpointsSet = {};\n        for (var i = 0; i < persistentBreakpoints.length; ++i) {\n            var breakpoint = persistentBreakpoints[i];\n            if (!(\"type\" in breakpoint && \"enabled\" in breakpoint && \"condition\" in breakpoint))\n                continue;\n            var id = breakpoint.type + \":\";\n            var condition = breakpoint.condition;\n            if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.DOM) {\n                if (typeof condition.path !== \"string\" || typeof condition.type !== \"number\")\n                    continue;\n                id += condition.path + \":\" + condition.type;\n            } else if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.EventListener) {\n                if (typeof condition.eventName !== \"string\")\n                    continue;\n                id += condition.eventName;\n            } else if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.XHR) {\n                if (typeof condition.url !== \"string\")\n                    continue;\n                id += condition.url;\n            } else\n                continue;\n            if (id in breakpointsSet)\n                continue;\n            breakpointsSet[id] = true;\n            breakpoints.push(breakpoint);\n        }\n        return breakpoints;\n    },\n\n    _createDOMBreakpointId: function(nodeId, type)\n    {\n        return \"dom:\" + nodeId + \":\" + type;\n    },\n\n    _createEventListenerBreakpointId: function(eventName)\n    {\n        return \"eventListner:\" + eventName;\n    },\n\n    _createXHRBreakpointId: function(url)\n    {\n        return \"xhr:\" + url;\n    }\n}\n\nWebInspector.BreakpointManager.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.DOMBreakpoint = function(node, type)\n{\n    this._nodeId = node.id;\n    this._path = node.path();\n    this._type = type;\n}\n\nWebInspector.DOMBreakpoint.prototype = {\n    _enable: function()\n    {\n        InspectorBackend.setDOMBreakpoint(this._nodeId, this._type);\n    },\n\n    _disable: function()\n    {\n        InspectorBackend.removeDOMBreakpoint(this._nodeId, this._type);\n    },\n\n    _serializeToJSON: function()\n    {\n        var type = WebInspector.BreakpointManager.BreakpointTypes.DOM;\n        return { type: type, condition: { path: this._path, type: this._type } };\n    }\n}\n\nWebInspector.EventListenerBreakpoint = function(eventName)\n{\n    this._eventName = eventName;\n}\n\nWebInspector.EventListenerBreakpoint.prototype = {\n    _enable: function()\n    {\n        InspectorBackend.setEventListenerBreakpoint(this._eventName);\n    },\n\n    _disable: function()\n    {\n        InspectorBackend.removeEventListenerBreakpoint(this._eventName);\n    },\n\n    _serializeToJSON: function()\n    {\n        var type = WebInspector.BreakpointManager.BreakpointTypes.EventListener;\n        return { type: type, condition: { eventName: this._eventName } };\n    }\n}\n\nWebInspector.XHRBreakpoint = function(url)\n{\n    this._url = url;\n}\n\nWebInspector.XHRBreakpoint.prototype = {\n    _enable: function()\n    {\n        InspectorBackend.setXHRBreakpoint(this._url);\n    },\n\n    _disable: function()\n    {\n        InspectorBackend.removeXHRBreakpoint(this._url);\n    },\n\n    _serializeToJSON: function()\n    {\n        var type = WebInspector.BreakpointManager.BreakpointTypes.XHR;\n        return { type: type, condition: { url: this._url } };\n    }\n}\n\n\n\nWebInspector.NativeBreakpointView = function(manager, id, enabled)\n{\n    this._manager = manager;\n    this._id = id;\n    this._enabled = enabled;\n    this._hit = false;\n}\n\nWebInspector.NativeBreakpointView.prototype = {\n    get enabled()\n    {\n        return this._enabled;\n    },\n\n    set enabled(enabled)\n    {\n        this._manager._setBreakpointEnabled(this._id, enabled);\n        this._enabled = enabled;\n        this.dispatchEventToListeners(\"enable-changed\");\n    },\n\n    get hit()\n    {\n        return this._hit;\n    },\n\n    set hit(hit)\n    {\n        this._hit = hit;\n        this.dispatchEventToListeners(\"hit-state-changed\");\n    },\n\n    remove: function()\n    {\n        this._manager._removeBreakpoint(this._id);\n        this._onRemove();\n        this.dispatchEventToListeners(\"removed\");\n    },\n\n    _compare: function(x, y)\n    {\n        if (x !== y)\n            return x < y ? -1 : 1;\n        return 0;\n    },\n\n    _onRemove: function()\n    {\n    }\n}\n\nWebInspector.NativeBreakpointView.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.DOMBreakpointView = function(manager, id, enabled, node, type)\n{\n    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);\n    this._node = node;\n    this._nodeId = node.id;\n    this._type = type;\n    node.breakpoints[this._type] = this;\n}\n\nWebInspector.DOMBreakpointView.prototype = {\n    compareTo: function(other)\n    {\n        return this._compare(this._type, other._type);\n    },\n\n    populateLabelElement: function(element)\n    {\n        // FIXME: this should belong to the view, not the manager.\n        var linkifiedNode = WebInspector.panels.elements.linkifyNodeById(this._nodeId);\n        linkifiedNode.addStyleClass(\"monospace\");\n        element.appendChild(linkifiedNode);\n        var description = document.createElement(\"div\");\n        description.className = \"source-text\";\n        description.textContent = WebInspector.domBreakpointTypeLabel(this._type);\n        element.appendChild(description);\n    },\n\n    populateStatusMessageElement: function(element, eventData)\n    {\n        var substitutions = [WebInspector.domBreakpointTypeLabel(this._type), WebInspector.panels.elements.linkifyNodeById(this._nodeId)];\n        var formatters = {\n            s: function(substitution)\n            {\n                return substitution;\n            }\n        };\n        function append(a, b)\n        {\n            if (typeof b === \"string\")\n                b = document.createTextNode(b);\n            element.appendChild(b);\n        }\n        if (this._type === WebInspector.DOMBreakpointTypes.SubtreeModified) {\n            var targetNode = WebInspector.panels.elements.linkifyNodeById(eventData.targetNodeId);\n            if (eventData.insertion) {\n                if (eventData.targetNodeId !== this._nodeId)\n                    WebInspector.formatLocalized(\"Paused on a \\\"%s\\\" breakpoint set on %s, because a new child was added to its descendant %s.\", substitutions.concat(targetNode), formatters, \"\", append);\n                else\n                    WebInspector.formatLocalized(\"Paused on a \\\"%s\\\" breakpoint set on %s, because a new child was added to that node.\", substitutions, formatters, \"\", append);\n            } else\n                WebInspector.formatLocalized(\"Paused on a \\\"%s\\\" breakpoint set on %s, because its descendant %s was removed.\", substitutions.concat(targetNode), formatters, \"\", append);\n        } else\n            WebInspector.formatLocalized(\"Paused on a \\\"%s\\\" breakpoint set on %s.\", substitutions, formatters, \"\", append);\n    },\n\n    _onRemove: function()\n    {\n        delete this._node.breakpoints[this._type];\n    }\n}\n\nWebInspector.DOMBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;\n\nWebInspector.EventListenerBreakpointView = function(manager, id, enabled, eventName)\n{\n    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);\n    this._eventName = eventName;\n}\n\nWebInspector.EventListenerBreakpointView.eventNameForUI = function(eventName)\n{\n    if (!WebInspector.EventListenerBreakpointView._eventNamesForUI) {\n        WebInspector.EventListenerBreakpointView._eventNamesForUI = {\n            \"instrumentation:setTimer\": WebInspector.UIString(\"Set Timer\"),\n            \"instrumentation:clearTimer\": WebInspector.UIString(\"Clear Timer\"),\n            \"instrumentation:timerFired\": WebInspector.UIString(\"Timer Fired\")\n        };\n    }\n    return WebInspector.EventListenerBreakpointView._eventNamesForUI[eventName] || eventName.substring(eventName.indexOf(\":\") + 1);\n}\n\nWebInspector.EventListenerBreakpointView.prototype = {\n    get eventName()\n    {\n        return this._eventName;\n    },\n\n    compareTo: function(other)\n    {\n        return this._compare(this._eventName, other._eventName);\n    },\n\n    populateLabelElement: function(element)\n    {\n        element.appendChild(document.createTextNode(this._uiEventName()));\n    },\n\n    populateStatusMessageElement: function(element, eventData)\n    {\n        var status = WebInspector.UIString(\"Paused on a \\\"%s\\\" Event Listener.\", this._uiEventName());\n        element.appendChild(document.createTextNode(status));\n    },\n\n    _uiEventName: function()\n    {\n        return WebInspector.EventListenerBreakpointView.eventNameForUI(this._eventName);\n    }\n}\n\nWebInspector.EventListenerBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;\n\nWebInspector.XHRBreakpointView = function(manager, id, enabled, url)\n{\n    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);\n    this._url = url;\n}\n\nWebInspector.XHRBreakpointView.prototype = {\n    compareTo: function(other)\n    {\n        return this._compare(this._url, other._url);\n    },\n\n    populateEditElement: function(element)\n    {\n        element.textContent = this._url;\n    },\n\n    populateLabelElement: function(element)\n    {\n        var label;\n        if (!this._url.length)\n            label = WebInspector.UIString(\"Any XHR\");\n        else\n            label = WebInspector.UIString(\"URL contains \\\"%s\\\"\", this._url);\n        element.appendChild(document.createTextNode(label));\n        element.addStyleClass(\"cursor-auto\");\n    },\n\n    populateStatusMessageElement: function(element)\n    {\n        var status = WebInspector.UIString(\"Paused on a XMLHttpRequest.\");\n        element.appendChild(document.createTextNode(status));\n    }\n}\n\nWebInspector.XHRBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;\n\nWebInspector.DOMBreakpointTypes = {\n    SubtreeModified: 0,\n    AttributeModified: 1,\n    NodeRemoved: 2\n};\n\nWebInspector.domBreakpointTypeLabel = function(type)\n{\n    if (!WebInspector._DOMBreakpointTypeLabels) {\n        WebInspector._DOMBreakpointTypeLabels = {};\n        WebInspector._DOMBreakpointTypeLabels[WebInspector.DOMBreakpointTypes.SubtreeModified] = WebInspector.UIString(\"Subtree Modified\");\n        WebInspector._DOMBreakpointTypeLabels[WebInspector.DOMBreakpointTypes.AttributeModified] = WebInspector.UIString(\"Attribute Modified\");\n        WebInspector._DOMBreakpointTypeLabels[WebInspector.DOMBreakpointTypes.NodeRemoved] = WebInspector.UIString(\"Node Removed\");\n    }\n    return WebInspector._DOMBreakpointTypeLabels[type];\n}\n\nWebInspector.domBreakpointTypeContextMenuLabel = function(type)\n{\n    if (!WebInspector._DOMBreakpointTypeContextMenuLabels) {\n        WebInspector._DOMBreakpointTypeContextMenuLabels = {};\n        WebInspector._DOMBreakpointTypeContextMenuLabels[WebInspector.DOMBreakpointTypes.SubtreeModified] = WebInspector.UIString(\"Break on Subtree Modifications\");\n        WebInspector._DOMBreakpointTypeContextMenuLabels[WebInspector.DOMBreakpointTypes.AttributeModified] = WebInspector.UIString(\"Break on Attributes Modifications\");\n        WebInspector._DOMBreakpointTypeContextMenuLabels[WebInspector.DOMBreakpointTypes.NodeRemoved] = WebInspector.UIString(\"Break on Node Removal\");\n    }\n    return WebInspector._DOMBreakpointTypeContextMenuLabels[type];\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/BreakpointsSidebarPane.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.JavaScriptBreakpointsSidebarPane = function(title)\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Breakpoints\"));\n\n    this.listElement = document.createElement(\"ol\");\n    this.listElement.className = \"breakpoint-list\";\n\n    this.emptyElement = document.createElement(\"div\");\n    this.emptyElement.className = \"info\";\n    this.emptyElement.textContent = WebInspector.UIString(\"No Breakpoints\");\n\n    this.bodyElement.appendChild(this.emptyElement);\n\n    this._items = {};\n\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointAdded, this._breakpointAdded, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointRemoved, this._breakpointRemoved, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointResolved, this._breakpointResolved, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);\n    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.ProjectChanged, this._projectChanged, this);\n}\n\nWebInspector.JavaScriptBreakpointsSidebarPane.prototype = {\n    _breakpointAdded: function(event)\n    {\n        var breakpoint = event.data;\n        var breakpointId = breakpoint.id;\n\n        if (breakpoint.url && !WebInspector.debuggerModel.scriptsForURL(breakpoint.url).length)\n            return;\n\n        var element = document.createElement(\"li\");\n\n        var checkbox = document.createElement(\"input\");\n        checkbox.className = \"checkbox-elem\";\n        checkbox.type = \"checkbox\";\n        checkbox.checked = breakpoint.enabled;\n        checkbox.addEventListener(\"click\", this._breakpointItemCheckboxClicked.bind(this, breakpointId), false);\n        element.appendChild(checkbox);\n\n        var label = document.createElement(\"span\");\n        element.appendChild(label);\n\n        element._data = breakpoint;\n        var currentElement = this.listElement.firstChild;\n        while (currentElement) {\n            if (currentElement._data && this._compareBreakpoints(currentElement._data, element._data) > 0)\n                break;\n            currentElement = currentElement.nextSibling;\n        }\n        this._addListElement(element, currentElement);\n\n        element.addEventListener(\"contextmenu\", this._contextMenuEventFired.bind(this, breakpointId), true);\n\n        this._setupBreakpointElement(breakpoint, element);\n\n        var breakpointItem = {};\n        breakpointItem.element = element;\n        breakpointItem.checkbox = checkbox;\n        this._items[breakpointId] = breakpointItem;\n\n        if (!this.expanded)\n            this.expanded = true;\n    },\n\n    _breakpointRemoved: function(event)\n    {\n        var breakpointId = event.data;\n        var breakpointItem = this._items[breakpointId];\n        if (breakpointItem) {\n            delete this._items[breakpointId];\n            this._removeListElement(breakpointItem.element);\n        }\n    },\n\n    _breakpointResolved: function(event)\n    {\n        var breakpoint = event.data;\n        this._breakpointRemoved({ data: breakpoint.id });\n        this._breakpointAdded({ data: breakpoint });\n    },\n\n    _parsedScriptSource: function(event)\n    {\n        var url = event.data.sourceURL;\n        var breakpoints = WebInspector.debuggerModel.breakpoints;\n        for (var id in breakpoints) {\n            if (!(id in this._items))\n                this._breakpointAdded({ data: breakpoints[id] });\n        }\n    },\n\n    _breakpointEnableChanged: function(enabled, event)\n    {\n        var breakpointId = event.data;\n        var breakpointItem = this._items[breakpointId];\n        if (breakpointItem)\n            breakpointItem.checkbox.checked = enabled;\n    },\n\n    _breakpointItemCheckboxClicked: function(breakpointId, event)\n    {\n        var breakpoint = WebInspector.debuggerModel.breakpointForId(breakpointId);\n        WebInspector.debuggerModel.updateBreakpoint(breakpointId, breakpoint.condition, event.target.checked);\n\n        // Breakpoint element may have it's own click handler.\n        event.stopPropagation();\n    },\n\n    _contextMenuEventFired: function(breakpointId, event)\n    {\n        var contextMenu = new WebInspector.ContextMenu();\n        contextMenu.appendItem(WebInspector.UIString(\"Remove Breakpoint\"), this._removeBreakpoint.bind(this, breakpointId));\n        contextMenu.show(event);\n    },\n\n    _debuggerPaused: function(event)\n    {\n        var breakpoint = event.data.breakpoint;\n        if (!breakpoint)\n            return;\n        var breakpointItem = this._items[breakpoint.id];\n        if (!breakpointItem)\n            return;\n        breakpointItem.element.addStyleClass(\"breakpoint-hit\");\n        this._lastHitBreakpointItem = breakpointItem;\n    },\n\n    _debuggerResumed: function()\n    {\n        if (this._lastHitBreakpointItem) {\n            this._lastHitBreakpointItem.element.removeStyleClass(\"breakpoint-hit\");\n            delete this._lastHitBreakpointItem;\n        }\n    },\n\n    _addListElement: function(element, beforeElement)\n    {\n        if (beforeElement)\n            this.listElement.insertBefore(element, beforeElement);\n        else {\n            if (!this.listElement.firstChild) {\n                this.bodyElement.removeChild(this.emptyElement);\n                this.bodyElement.appendChild(this.listElement);\n            }\n            this.listElement.appendChild(element);\n        }\n    },\n\n    _removeListElement: function(element)\n    {\n        this.listElement.removeChild(element);\n        if (!this.listElement.firstChild) {\n            this.bodyElement.removeChild(this.listElement);\n            this.bodyElement.appendChild(this.emptyElement);\n        }\n    },\n\n    _projectChanged: function()\n    {\n        this.listElement.removeChildren();\n        if (this.listElement.parentElement) {\n            this.bodyElement.removeChild(this.listElement);\n            this.bodyElement.appendChild(this.emptyElement);\n        }\n        this._items = {};\n    },\n\n    _compare: function(x, y)\n    {\n        if (x !== y)\n            return x < y ? -1 : 1;\n        return 0;\n    },\n\n    _compareBreakpoints: function(b1, b2)\n    {\n        return this._compare(b1.url, b2.url) || this._compare(b1.lineNumber, b2.lineNumber);\n    },\n\n    _setupBreakpointElement: function(data, element)\n    {\n        var sourceID;\n        var lineNumber = data.lineNumber;\n        if (data.locations.length) {\n            sourceID = data.locations[0].sourceID;\n            lineNumber = data.locations[0].lineNumber;\n        }\n\n        var displayName = data.url ? WebInspector.displayNameForURL(data.url) : WebInspector.UIString(\"(program)\");\n        var labelElement = document.createTextNode(displayName + \":\" + (lineNumber + 1));\n        element.appendChild(labelElement);\n\n        var sourceTextElement = document.createElement(\"div\");\n        sourceTextElement.className = \"source-text monospace\";\n        element.appendChild(sourceTextElement);\n\n        if (sourceID) {\n            function didGetSourceLine(text)\n            {\n                sourceTextElement.textContent = text;\n            }\n            var script = WebInspector.debuggerModel.scriptForSourceID(sourceID);\n            script.sourceLine(lineNumber, didGetSourceLine.bind(this));\n        }\n\n        element.addStyleClass(\"cursor-pointer\");\n        var clickHandler = WebInspector.panels.scripts.showSourceLine.bind(WebInspector.panels.scripts, data.url, lineNumber + 1);\n        element.addEventListener(\"click\", clickHandler, false);\n    },\n\n    _removeBreakpoint: function(breakpointId)\n    {\n        WebInspector.debuggerModel.removeBreakpoint(breakpointId);\n    }\n}\n\nWebInspector.JavaScriptBreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.NativeBreakpointsSidebarPane = function(title)\n{\n    WebInspector.SidebarPane.call(this, title);\n\n    this.listElement = document.createElement(\"ol\");\n    this.listElement.className = \"breakpoint-list\";\n\n    this.emptyElement = document.createElement(\"div\");\n    this.emptyElement.className = \"info\";\n    this.emptyElement.textContent = WebInspector.UIString(\"No Breakpoints\");\n\n    this.bodyElement.appendChild(this.emptyElement);\n\n    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.ProjectChanged, this._projectChanged, this);\n}\n\nWebInspector.NativeBreakpointsSidebarPane.prototype = {\n    addBreakpointItem: function(breakpointItem)\n    {\n        var element = breakpointItem.element;\n        element._breakpointItem = breakpointItem;\n\n        breakpointItem.addEventListener(\"breakpoint-hit\", this.expand, this);\n        breakpointItem.addEventListener(\"removed\", this._removeListElement.bind(this, element), this);\n\n        var currentElement = this.listElement.firstChild;\n        while (currentElement) {\n            if (currentElement._breakpointItem && currentElement._breakpointItem.compareTo(element._breakpointItem) > 0)\n                break;\n            currentElement = currentElement.nextSibling;\n        }\n        this._addListElement(element, currentElement);\n\n        if (breakpointItem.click) {\n            element.addStyleClass(\"cursor-pointer\");\n            element.addEventListener(\"click\", breakpointItem.click.bind(breakpointItem), false);\n        }\n        element.addEventListener(\"contextmenu\", this._contextMenuEventFired.bind(this, breakpointItem), true);\n    },\n\n    _contextMenuEventFired: function(breakpointItem, event)\n    {\n        var contextMenu = new WebInspector.ContextMenu();\n        contextMenu.appendItem(WebInspector.UIString(\"Remove Breakpoint\"), breakpointItem.remove.bind(breakpointItem));\n        contextMenu.show(event);\n    },\n\n    _addListElement: function(element, beforeElement)\n    {\n        if (beforeElement)\n            this.listElement.insertBefore(element, beforeElement);\n        else {\n            if (!this.listElement.firstChild) {\n                this.bodyElement.removeChild(this.emptyElement);\n                this.bodyElement.appendChild(this.listElement);\n            }\n            this.listElement.appendChild(element);\n        }\n    },\n\n    _removeListElement: function(element)\n    {\n        this.listElement.removeChild(element);\n        if (!this.listElement.firstChild) {\n            this.bodyElement.removeChild(this.listElement);\n            this.bodyElement.appendChild(this.emptyElement);\n        }\n    },\n\n    _projectChanged: function()\n    {\n        this.listElement.removeChildren();\n        if (this.listElement.parentElement) {\n            this.bodyElement.removeChild(this.listElement);\n            this.bodyElement.appendChild(this.emptyElement);\n        }\n    }\n}\n\nWebInspector.NativeBreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.XHRBreakpointsSidebarPane = function()\n{\n    WebInspector.NativeBreakpointsSidebarPane.call(this, WebInspector.UIString(\"XHR Breakpoints\"));\n\n    function addButtonClicked(event)\n    {\n        event.stopPropagation();\n        this._startEditingBreakpoint(null);\n    }\n\n    var addButton = document.createElement(\"button\");\n    addButton.className = \"add\";\n    addButton.addEventListener(\"click\", addButtonClicked.bind(this), false);\n    this.titleElement.appendChild(addButton);\n}\n\nWebInspector.XHRBreakpointsSidebarPane.prototype = {\n    addBreakpointItem: function(breakpointItem)\n    {\n        WebInspector.NativeBreakpointsSidebarPane.prototype.addBreakpointItem.call(this, breakpointItem);\n        breakpointItem._labelElement.addEventListener(\"dblclick\", this._startEditingBreakpoint.bind(this, breakpointItem), false);\n    },\n\n    _startEditingBreakpoint: function(breakpointItem)\n    {\n        if (this._editingBreakpoint)\n            return;\n        this._editingBreakpoint = true;\n\n        if (!this.expanded)\n            this.expanded = true;\n\n        var inputElement = document.createElement(\"span\");\n        inputElement.className = \"breakpoint-condition editing\";\n        if (breakpointItem) {\n            breakpointItem.populateEditElement(inputElement);\n            this.listElement.insertBefore(inputElement, breakpointItem.element);\n            breakpointItem.element.addStyleClass(\"hidden\");\n        } else\n            this._addListElement(inputElement, this.listElement.firstChild);\n\n        var commitHandler = this._hideEditBreakpointDialog.bind(this, inputElement, true, breakpointItem);\n        var cancelHandler = this._hideEditBreakpointDialog.bind(this, inputElement, false, breakpointItem);\n        WebInspector.startEditing(inputElement, {\n            commitHandler: commitHandler,\n            cancelHandler: cancelHandler\n        });\n    },\n\n    _hideEditBreakpointDialog: function(inputElement, accept, breakpointItem)\n    {\n        this._removeListElement(inputElement);\n        this._editingBreakpoint = false;\n        if (accept) {\n            if (breakpointItem)\n                breakpointItem.remove();\n            WebInspector.breakpointManager.createXHRBreakpoint(inputElement.textContent.toLowerCase());\n        } else if (breakpointItem)\n            breakpointItem.element.removeStyleClass(\"hidden\");\n    }\n}\n\nWebInspector.XHRBreakpointsSidebarPane.prototype.__proto__ = WebInspector.NativeBreakpointsSidebarPane.prototype;\n\nWebInspector.BreakpointItem = function(breakpoint)\n{\n    this._breakpoint = breakpoint;\n\n    this._element = document.createElement(\"li\");\n\n    var checkboxElement = document.createElement(\"input\");\n    checkboxElement.className = \"checkbox-elem\";\n    checkboxElement.type = \"checkbox\";\n    checkboxElement.checked = this._breakpoint.enabled;\n    checkboxElement.addEventListener(\"click\", this._checkboxClicked.bind(this), false);\n    this._element.appendChild(checkboxElement);\n\n    this._createLabelElement();\n\n    this._breakpoint.addEventListener(\"enable-changed\", this._enableChanged, this);\n    this._breakpoint.addEventListener(\"hit-state-changed\", this._hitStateChanged, this);\n    this._breakpoint.addEventListener(\"label-changed\", this._labelChanged, this);\n    this._breakpoint.addEventListener(\"removed\", this.dispatchEventToListeners.bind(this, \"removed\"));\n    if (breakpoint.click)\n        this.click = breakpoint.click.bind(breakpoint);\n}\n\nWebInspector.BreakpointItem.prototype = {\n    get element()\n    {\n        return this._element;\n    },\n\n    compareTo: function(other)\n    {\n        return this._breakpoint.compareTo(other._breakpoint);\n    },\n\n    populateEditElement: function(element)\n    {\n        this._breakpoint.populateEditElement(element);\n    },\n\n    remove: function()\n    {\n        this._breakpoint.remove();\n    },\n\n    _checkboxClicked: function(event)\n    {\n        this._breakpoint.enabled = !this._breakpoint.enabled;\n\n        // Breakpoint element may have it's own click handler.\n        event.stopPropagation();\n    },\n\n    _enableChanged: function(event)\n    {\n        var checkbox = this._element.firstChild;\n        checkbox.checked = this._breakpoint.enabled;\n    },\n\n    _hitStateChanged: function(event)\n    {\n        if (event.target.hit) {\n            this._element.addStyleClass(\"breakpoint-hit\");\n            this.dispatchEventToListeners(\"breakpoint-hit\");\n        } else\n            this._element.removeStyleClass(\"breakpoint-hit\");\n    },\n\n    _labelChanged: function(event)\n    {\n        this._element.removeChild(this._labelElement);\n        this._createLabelElement();\n    },\n\n    _createLabelElement: function()\n    {\n        this._labelElement = document.createElement(\"span\");\n        this._breakpoint.populateLabelElement(this._labelElement);\n        this._element.appendChild(this._labelElement);\n    }\n}\n\nWebInspector.BreakpointItem.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.EventListenerBreakpointsSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Event Listener Breakpoints\"));\n\n    this.categoriesElement = document.createElement(\"ol\");\n    this.categoriesElement.tabIndex = 0;\n    this.categoriesElement.addStyleClass(\"properties-tree event-listener-breakpoints\");\n    this.categoriesTreeOutline = new TreeOutline(this.categoriesElement);\n    this.bodyElement.appendChild(this.categoriesElement);\n\n    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.ProjectChanged, this._projectChanged, this);\n    WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.EventListenerBreakpointAdded, this._breakpointAdded, this);\n\n    this._breakpointItems = {};\n    this._createCategory(WebInspector.UIString(\"Keyboard\"), \"listener\", [\"keydown\", \"keyup\", \"keypress\", \"textInput\"]);\n    this._createCategory(WebInspector.UIString(\"Mouse\"), \"listener\", [\"click\", \"dblclick\", \"mousedown\", \"mouseup\", \"mouseover\", \"mousemove\", \"mouseout\", \"mousewheel\"]);\n    // FIXME: uncomment following once inspector stops being drop targer in major ports.\n    // Otherwise, inspector page reacts on drop event and tries to load the event data.\n    // this._createCategory(WebInspector.UIString(\"Drag\"), \"listener\", [\"drag\", \"drop\", \"dragstart\", \"dragend\", \"dragenter\", \"dragleave\", \"dragover\"]);\n    this._createCategory(WebInspector.UIString(\"Control\"), \"listener\", [\"resize\", \"scroll\", \"zoom\", \"focus\", \"blur\", \"select\", \"change\", \"submit\", \"reset\"]);\n    this._createCategory(WebInspector.UIString(\"Clipboard\"), \"listener\", [\"copy\", \"cut\", \"paste\", \"beforecopy\", \"beforecut\", \"beforepaste\"]);\n    this._createCategory(WebInspector.UIString(\"Load\"), \"listener\", [\"load\", \"unload\", \"abort\", \"error\"]);\n    this._createCategory(WebInspector.UIString(\"DOM Mutation\"), \"listener\", [\"DOMActivate\", \"DOMFocusIn\", \"DOMFocusOut\", \"DOMAttrModified\", \"DOMCharacterDataModified\", \"DOMNodeInserted\", \"DOMNodeInsertedIntoDocument\", \"DOMNodeRemoved\", \"DOMNodeRemovedFromDocument\", \"DOMSubtreeModified\", \"DOMContentLoaded\"]);\n    this._createCategory(WebInspector.UIString(\"Device\"), \"listener\", [\"deviceorientation\", \"devicemotion\"]);\n    this._createCategory(WebInspector.UIString(\"Timer\"), \"instrumentation\", [\"setTimer\", \"clearTimer\", \"timerFired\"]);\n}\n\nWebInspector.EventListenerBreakpointsSidebarPane.prototype = {\n    _createCategory: function(name, type, eventNames)\n    {\n        var categoryItem = {};\n        categoryItem.element = new TreeElement(name);\n        this.categoriesTreeOutline.appendChild(categoryItem.element);\n        categoryItem.element.listItemElement.addStyleClass(\"event-category\");\n        categoryItem.element.selectable = true;\n\n        categoryItem.checkbox = this._createCheckbox(categoryItem.element);\n        categoryItem.checkbox.addEventListener(\"click\", this._categoryCheckboxClicked.bind(this, categoryItem), true);\n\n        categoryItem.children = {};\n        for (var i = 0; i < eventNames.length; ++i) {\n            var eventName = type + \":\" + eventNames[i];\n\n            var breakpointItem = {};\n            var title = WebInspector.EventListenerBreakpointView.eventNameForUI(eventName);\n            breakpointItem.element = new TreeElement(title);\n            categoryItem.element.appendChild(breakpointItem.element);\n            var hitMarker = document.createElement(\"div\");\n            hitMarker.className = \"breakpoint-hit-marker\";\n            breakpointItem.element.listItemElement.appendChild(hitMarker);\n            breakpointItem.element.listItemElement.addStyleClass(\"source-code\");\n            breakpointItem.element.selectable = true;\n\n            breakpointItem.checkbox = this._createCheckbox(breakpointItem.element);\n            breakpointItem.checkbox.addEventListener(\"click\", this._breakpointCheckboxClicked.bind(this, breakpointItem), true);\n            breakpointItem.parent = categoryItem;\n            breakpointItem.eventName = eventName;\n\n            this._breakpointItems[eventName] = breakpointItem;\n            categoryItem.children[eventName] = breakpointItem;\n        }\n    },\n\n    _createCheckbox: function(treeElement)\n    {\n        var checkbox = document.createElement(\"input\");\n        checkbox.className = \"checkbox-elem\";\n        checkbox.type = \"checkbox\";\n        treeElement.listItemElement.insertBefore(checkbox, treeElement.listItemElement.firstChild);\n        return checkbox;\n    },\n\n    _categoryCheckboxClicked: function(categoryItem)\n    {\n        var checked = categoryItem.checkbox.checked;\n        for (var eventName in categoryItem.children) {\n            var breakpointItem = categoryItem.children[eventName];\n            if (breakpointItem.checkbox.checked !== checked) {\n                breakpointItem.checkbox.checked = checked;\n                this._breakpointCheckboxClicked(breakpointItem);\n            }\n        }\n    },\n\n    _breakpointCheckboxClicked: function(breakpointItem)\n    {\n        if (breakpointItem.checkbox.checked)\n            WebInspector.breakpointManager.createEventListenerBreakpoint(breakpointItem.eventName);\n        else\n            breakpointItem.breakpoint.remove();\n    },\n\n    _breakpointAdded: function(event)\n    {\n        var breakpoint = event.data;\n\n        var breakpointItem = this._breakpointItems[breakpoint.eventName];\n        breakpointItem.breakpoint = breakpoint;\n        breakpoint.addEventListener(\"hit-state-changed\", this._breakpointHitStateChanged.bind(this, breakpointItem));\n        breakpoint.addEventListener(\"removed\", this._breakpointRemoved.bind(this, breakpointItem));\n        breakpointItem.checkbox.checked = true;\n        this._updateCategoryCheckbox(breakpointItem);\n    },\n\n    _breakpointHitStateChanged: function(breakpointItem, event)\n    {\n        if (event.target.hit) {\n            this.expanded = true;\n            var categoryItem = breakpointItem.parent;\n            categoryItem.element.expand();\n            breakpointItem.element.listItemElement.addStyleClass(\"breakpoint-hit\");\n        } else\n            breakpointItem.element.listItemElement.removeStyleClass(\"breakpoint-hit\");\n    },\n\n    _breakpointRemoved: function(breakpointItem)\n    {\n        breakpointItem.breakpoint = null;\n        breakpointItem.checkbox.checked = false;\n        this._updateCategoryCheckbox(breakpointItem);\n    },\n\n    _updateCategoryCheckbox: function(breakpointItem)\n    {\n        var categoryItem = breakpointItem.parent;\n        var hasEnabled = false, hasDisabled = false;\n        for (var eventName in categoryItem.children) {\n            var breakpointItem = categoryItem.children[eventName];\n            if (breakpointItem.checkbox.checked)\n                hasEnabled = true;\n            else\n                hasDisabled = true;\n        }\n        categoryItem.checkbox.checked = hasEnabled;\n        categoryItem.checkbox.indeterminate = hasEnabled && hasDisabled;\n    },\n\n    _projectChanged: function()\n    {\n        for (var eventName in this._breakpointItems) {\n            var breakpointItem = this._breakpointItems[eventName];\n            breakpointItem.breakpoint = null;\n            breakpointItem.checkbox.checked = false;\n            this._updateCategoryCheckbox(breakpointItem);\n        }\n    }\n}\n\nWebInspector.EventListenerBreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/CSSCompletions.js",
    "content": "/*\n * Copyright (C) 2010 Nikita Vasilyev. All rights reserved.\n * Copyright (C) 2010 Joseph Pecoraro. All rights reserved.\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.CSSCompletions = function(values, acceptEmptyPrefix)\n{\n    this._values = values.slice();\n    this._values.sort();\n    this._acceptEmptyPrefix = acceptEmptyPrefix;\n}\n\nWebInspector.CSSCompletions.prototype = {\n    startsWith: function(prefix)\n    {\n        var firstIndex = this._firstIndexOfPrefix(prefix);\n        if (firstIndex === -1)\n            return [];\n\n        var results = [];\n        while (firstIndex < this._values.length && this._values[firstIndex].indexOf(prefix) === 0)\n            results.push(this._values[firstIndex++]);\n        return results;\n    },\n\n    firstStartsWith: function(prefix)\n    {\n        var foundIndex = this._firstIndexOfPrefix(prefix);\n        return (foundIndex === -1 ? \"\" : this._values[foundIndex]);\n    },\n\n    _firstIndexOfPrefix: function(prefix)\n    {\n        if (!this._values.length)\n            return -1;\n        if (!prefix)\n            return this._acceptEmptyPrefix ? 0 : -1;\n\n        var maxIndex = this._values.length - 1;\n        var minIndex = 0;\n        var foundIndex;\n\n        do {\n            var middleIndex = (maxIndex + minIndex) >> 1;\n            if (this._values[middleIndex].indexOf(prefix) === 0) {\n                foundIndex = middleIndex;\n                break;\n            }\n            if (this._values[middleIndex] < prefix)\n                minIndex = middleIndex + 1;\n            else\n                maxIndex = middleIndex - 1;\n        } while (minIndex <= maxIndex);\n\n        if (foundIndex === undefined)\n            return -1;\n\n        while (foundIndex && this._values[foundIndex - 1].indexOf(prefix) === 0)\n            foundIndex--;\n\n        return foundIndex;\n    },\n\n    keySet: function()\n    {\n        return this._values.keySet();\n    },\n\n    next: function(str, prefix)\n    {\n        return this._closest(str, prefix, 1);\n    },\n\n    previous: function(str, prefix)\n    {\n        return this._closest(str, prefix, -1);\n    },\n\n    _closest: function(str, prefix, shift)\n    {\n        if (!str)\n            return \"\";\n\n        var index = this._values.indexOf(str);\n        if (index === -1)\n            return \"\";\n\n        if (!prefix) {\n            index = (index + this._values.length + shift) % this._values.length;\n            return this._values[index];\n        }\n\n        var propertiesWithPrefix = this.startsWith(prefix);\n        var j = propertiesWithPrefix.indexOf(str);\n        j = (j + propertiesWithPrefix.length + shift) % propertiesWithPrefix.length;\n        return propertiesWithPrefix[j];\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/CSSKeywordCompletions.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.CSSKeywordCompletions = {\n    forProperty: function(propertyName)\n    {\n        var acceptedKeywords = [\"initial\"];\n        if (propertyName in this._propertyKeywordMap)\n            acceptedKeywords = acceptedKeywords.concat(this._propertyKeywordMap[propertyName]);\n        if (propertyName in this._colorAwareProperties)\n            acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);\n        if (propertyName in WebInspector.StylesSidebarPane.InheritedProperties)\n            acceptedKeywords.push(\"inherit\");\n        return new WebInspector.CSSCompletions(acceptedKeywords, true);\n    }\n};\n\nWebInspector.CSSKeywordCompletions._colors = [\n    \"aqua\", \"black\", \"blue\", \"fuchsia\", \"gray\", \"green\", \"lime\", \"maroon\", \"navy\", \"olive\", \"orange\", \"purple\", \"red\",\n    \"silver\", \"teal\", \"white\", \"yellow\", \"transparent\", \"currentcolor\", \"grey\", \"aliceblue\", \"antiquewhite\",\n    \"aquamarine\", \"azure\", \"beige\", \"bisque\", \"blanchedalmond\", \"blueviolet\", \"brown\", \"burlywood\", \"cadetblue\",\n    \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\", \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\",\n    \"darkgoldenrod\", \"darkgray\", \"darkgreen\", \"darkgrey\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\", \"darkorange\",\n    \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\", \"darkslateblue\", \"darkslategray\", \"darkslategrey\",\n    \"darkturquoise\", \"darkviolet\", \"deeppink\", \"deepskyblue\", \"dimgray\", \"dimgrey\", \"dodgerblue\", \"firebrick\",\n    \"floralwhite\", \"forestgreen\", \"gainsboro\", \"ghostwhite\", \"gold\", \"goldenrod\", \"greenyellow\", \"honeydew\", \"hotpink\",\n    \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\", \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\",\n    \"lightcoral\", \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightgrey\", \"lightpink\",\n    \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\", \"lightslategrey\", \"lightsteelblue\", \"lightyellow\",\n    \"limegreen\", \"linen\", \"magenta\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\", \"mediumseagreen\",\n    \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\", \"mediumvioletred\", \"midnightblue\", \"mintcream\",\n    \"mistyrose\", \"moccasin\", \"navajowhite\", \"oldlace\", \"olivedrab\", \"orangered\", \"orchid\", \"palegoldenrod\", \"palegreen\",\n    \"paleturquoise\", \"palevioletred\", \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\", \"rosybrown\",\n    \"royalblue\", \"saddlebrown\", \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"skyblue\", \"slateblue\",\n    \"slategray\", \"slategrey\", \"snow\", \"springgreen\", \"steelblue\", \"tan\", \"thistle\", \"tomato\", \"turquoise\", \"violet\",\n    \"wheat\", \"whitesmoke\", \"yellowgreen\"\n],\n\nWebInspector.CSSKeywordCompletions._colorAwareProperties = [\n    \"background\", \"background-color\", \"border\", \"border-color\", \"border-top\", \"border-right\", \"border-bottom\",\n    \"border-left\", \"border-top-color\", \"border-right-color\", \"border-bottom-color\", \"border-left-color\", \"color\",\n    \"outline\", \"outline-color\", \"text-line-through\", \"text-line-through-color\", \"text-overline\", \"text-overline-color\",\n    \"text-shadow\", \"text-underline\", \"text-underline-color\", \"-webkit-text-emphasis\", \"-webkit-text-emphasis-color\"\n].keySet();\n\nWebInspector.CSSKeywordCompletions._propertyKeywordMap = {\n    \"table-layout\": [\n        \"auto\", \"fixed\"\n    ],\n    \"visibility\": [\n        \"hidden\", \"visible\", \"collapse\"\n    ],\n    \"background-repeat\": [\n        \"repeat\", \"repeat-x\", \"repeat-y\", \"no-repeat\", \"space\", \"round\"\n    ],\n    \"text-underline\": [\n        \"none\", \"dotted\", \"dashed\", \"solid\", \"double\", \"dot-dash\", \"dot-dot-dash\", \"wave\"\n    ],\n    \"content\": [\n        \"list-item\", \"close-quote\", \"no-close-quote\", \"no-open-quote\", \"open-quote\"\n    ],\n    \"list-style-image\": [\n        \"none\"\n    ],\n    \"clear\": [\n        \"none\", \"left\", \"right\", \"both\"\n    ],\n    \"text-underline-mode\": [\n        \"continuous\", \"skip-white-space\"\n    ],\n    \"overflow-x\": [\n        \"hidden\", \"auto\", \"visible\", \"overlay\", \"scroll\"\n    ],\n    \"stroke-linejoin\": [\n        \"round\", \"miter\", \"bevel\"\n    ],\n    \"baseline-shift\": [\n        \"baseline\", \"sub\", \"super\"\n    ],\n    \"border-bottom-width\": [\n        \"medium\", \"thick\", \"thin\"\n    ],\n    \"marquee-speed\": [\n        \"normal\", \"slow\", \"fast\"\n    ],\n    \"margin-top-collapse\": [\n        \"collapse\", \"separate\", \"discard\"\n    ],\n    \"max-height\": [\n        \"none\"\n    ],\n    \"box-orient\": [\n        \"horizontal\", \"vertical\", \"inline-axis\", \"block-axis\"\n    ],\n    \"font-stretch\": [\n        \"normal\", \"wider\", \"narrower\", \"ultra-condensed\", \"extra-condensed\", \"condensed\", \"semi-condensed\",\n        \"semi-expanded\", \"expanded\", \"extra-expanded\", \"ultra-expanded\"\n    ],\n    \"-webkit-color-correction\": [\n        \"default\", \"srgb\"\n    ],\n    \"text-underline-style\": [\n        \"none\", \"dotted\", \"dashed\", \"solid\", \"double\", \"dot-dash\", \"dot-dot-dash\", \"wave\"\n    ],\n    \"text-overline-mode\": [\n        \"continuous\", \"skip-white-space\"\n    ],\n    \"-webkit-background-composite\": [\n        \"highlight\", \"clear\", \"copy\", \"source-over\", \"source-in\", \"source-out\", \"source-atop\", \"destination-over\",\n        \"destination-in\", \"destination-out\", \"destination-atop\", \"xor\", \"plus-darker\", \"plus-lighter\"\n    ],\n    \"border-left-width\": [\n        \"medium\", \"thick\", \"thin\"\n    ],\n    \"-webkit-writing-mode\": [\n        \"lr\", \"rl\", \"tb\", \"lr-tb\", \"rl-tb\", \"tb-rl\", \"horizontal-tb\", \"vertical-rl\", \"vertical-lr\", \"horizontal-bt\"\n    ],\n    \"text-line-through-mode\": [\n        \"continuous\", \"skip-white-space\"\n    ],\n    \"border-collapse\": [\n        \"collapse\", \"separate\"\n    ],\n    \"page-break-inside\": [\n        \"auto\", \"avoid\"\n    ],\n    \"border-top-width\": [\n        \"medium\", \"thick\", \"thin\"\n    ],\n    \"outline-color\": [\n        \"invert\"\n    ],\n    \"text-line-through-style\": [\n        \"none\", \"dotted\", \"dashed\", \"solid\", \"double\", \"dot-dash\", \"dot-dot-dash\", \"wave\"\n    ],\n    \"outline-style\": [\n        \"none\", \"hidden\", \"inset\", \"groove\", \"ridge\", \"outset\", \"dotted\", \"dashed\", \"solid\", \"double\"\n    ],\n    \"cursor\": [\n        \"none\", \"copy\", \"auto\", \"crosshair\", \"default\", \"pointer\", \"move\", \"vertical-text\", \"cell\", \"context-menu\",\n        \"alias\", \"progress\", \"no-drop\", \"not-allowed\", \"-webkit-zoom-in\", \"-webkit-zoom-out\", \"e-resize\", \"ne-resize\",\n        \"nw-resize\", \"n-resize\", \"se-resize\", \"sw-resize\", \"s-resize\", \"w-resize\", \"ew-resize\", \"ns-resize\",\n        \"nesw-resize\", \"nwse-resize\", \"col-resize\", \"row-resize\", \"text\", \"wait\", \"help\", \"all-scroll\", \"-webkit-grab\",\n        \"-webkit-grabbing\"\n    ],\n    \"border-width\": [\n        \"medium\", \"thick\", \"thin\"\n    ],\n    \"size\": [\n        \"a3\", \"a4\", \"a5\", \"b4\", \"b5\", \"landscape\", \"ledger\", \"legal\", \"letter\", \"portrait\"\n    ],\n    \"background-size\": [\n        \"contain\", \"cover\"\n    ],\n    \"direction\": [\n        \"ltr\", \"rtl\"\n    ],\n    \"marquee-direction\": [\n        \"left\", \"right\", \"auto\", \"reverse\", \"forwards\", \"backwards\", \"ahead\", \"up\", \"down\"\n    ],\n    \"enable-background\": [\n        \"accumulate\", \"new\"\n    ],\n    \"float\": [\n        \"none\", \"left\", \"right\"\n    ],\n    \"overflow-y\": [\n        \"hidden\", \"auto\", \"visible\", \"overlay\", \"scroll\"\n    ],\n    \"margin-bottom-collapse\": [\n        \"collapse\",  \"separate\", \"discard\"\n    ],\n    \"box-reflect\": [\n        \"left\", \"right\", \"above\", \"below\"\n    ],\n    \"overflow\": [\n        \"hidden\", \"auto\", \"visible\", \"overlay\", \"scroll\"\n    ],\n    \"text-rendering\": [\n        \"auto\", \"optimizespeed\", \"optimizelegibility\", \"geometricprecision\"\n    ],\n    \"text-align\": [\n        \"-webkit-auto\", \"left\", \"right\", \"center\", \"justify\", \"-webkit-left\", \"-webkit-right\", \"-webkit-center\"\n    ],\n    \"list-style-position\": [\n        \"outside\", \"inside\"\n    ],\n    \"margin-bottom\": [\n        \"auto\"\n    ],\n    \"color-interpolation\": [\n        \"linearrgb\"\n    ],\n    \"background-origin\": [\n        \"border-box\", \"content-box\", \"padding-box\"\n    ],\n    \"word-wrap\": [\n        \"normal\", \"break-word\"\n    ],\n    \"font-weight\": [\n        \"normal\", \"bold\", \"bolder\", \"lighter\", \"100\", \"200\", \"300\", \"400\", \"500\", \"600\", \"700\", \"800\", \"900\"\n    ],\n    \"margin-before-collapse\": [\n        \"collapse\", \"separate\", \"discard\"\n    ],\n    \"text-overline-width\": [\n        \"normal\", \"medium\", \"auto\", \"thick\", \"thin\"\n    ],\n    \"text-transform\": [\n        \"none\", \"capitalize\", \"uppercase\", \"lowercase\"\n    ],\n    \"border-right-style\": [\n        \"none\", \"hidden\", \"inset\", \"groove\", \"ridge\", \"outset\", \"dotted\", \"dashed\", \"solid\", \"double\"\n    ],\n    \"border-left-style\": [\n        \"none\", \"hidden\", \"inset\", \"groove\", \"ridge\", \"outset\", \"dotted\", \"dashed\", \"solid\", \"double\"\n    ],\n    \"-webkit-text-emphasis\": [\n        \"circle\", \"filled\", \"open\", \"dot\", \"double-circle\", \"triangle\", \"sesame\"\n    ],\n    \"font-style\": [\n        \"italic\", \"oblique\", \"normal\"\n    ],\n    \"speak\": [\n        \"none\", \"normal\", \"spell-out\", \"digits\", \"literal-punctuation\", \"no-punctuation\"\n    ],\n    \"text-line-through\": [\n        \"none\", \"dotted\", \"dashed\", \"solid\", \"double\", \"dot-dash\", \"dot-dot-dash\", \"wave\", \"continuous\",\n        \"skip-white-space\"\n    ],\n    \"color-rendering\": [\n        \"auto\", \"optimizespeed\", \"optimizequality\"\n    ],\n    \"list-style-type\": [\n        \"none\", \"disc\", \"circle\", \"square\", \"decimal\", \"decimal-leading-zero\", \"arabic-indic\", \"binary\", \"bengali\",\n        \"cambodian\", \"khmer\", \"devanagari\", \"gujarati\", \"gurmukhi\", \"kannada\", \"lower-hexadecimal\", \"lao\", \"malayalam\",\n        \"mongolian\", \"myanmar\", \"octal\", \"oriya\", \"persian\", \"urdu\", \"telugu\", \"tibetan\", \"thai\", \"upper-hexadecimal\",\n        \"lower-roman\", \"upper-roman\", \"lower-greek\", \"lower-alpha\", \"lower-latin\", \"upper-alpha\", \"upper-latin\", \"afar\",\n        \"ethiopic-halehame-aa-et\", \"ethiopic-halehame-aa-er\", \"amharic\", \"ethiopic-halehame-am-et\", \"amharic-abegede\",\n        \"ethiopic-abegede-am-et\", \"cjk-earthly-branch\", \"cjk-heavenly-stem\", \"ethiopic\", \"ethiopic-halehame-gez\",\n        \"ethiopic-abegede\", \"ethiopic-abegede-gez\", \"hangul-consonant\", \"hangul\", \"lower-norwegian\", \"oromo\",\n        \"ethiopic-halehame-om-et\", \"sidama\", \"ethiopic-halehame-sid-et\", \"somali\", \"ethiopic-halehame-so-et\", \"tigre\",\n        \"ethiopic-halehame-tig\", \"tigrinya-er\", \"ethiopic-halehame-ti-er\", \"tigrinya-er-abegede\",\n        \"ethiopic-abegede-ti-er\", \"tigrinya-et\", \"ethiopic-halehame-ti-et\", \"tigrinya-et-abegede\",\n        \"ethiopic-abegede-ti-et\", \"upper-greek\", \"upper-norwegian\", \"asterisks\", \"footnotes\", \"hebrew\", \"armenian\",\n        \"lower-armenian\", \"upper-armenian\", \"georgian\", \"cjk-ideographic\", \"hiragana\", \"katakana\", \"hiragana-iroha\",\n        \"katakana-iroha\"\n    ],\n    \"-webkit-text-combine\": [\n        \"none\", \"horizontal\"\n    ],\n    \"outline\": [\n        \"none\", \"hidden\", \"inset\", \"groove\", \"ridge\", \"outset\", \"dotted\", \"dashed\", \"solid\", \"double\"\n    ],\n    \"font\": [\n        \"caption\", \"icon\", \"menu\", \"message-box\", \"small-caption\", \"-webkit-mini-control\", \"-webkit-small-control\",\n        \"-webkit-control\", \"status-bar\", \"italic\", \"oblique\", \"small-caps\", \"normal\", \"bold\", \"bolder\", \"lighter\",\n        \"100\", \"200\", \"300\", \"400\", \"500\", \"600\", \"700\", \"800\", \"900\", \"xx-small\", \"x-small\", \"small\", \"medium\",\n        \"large\", \"x-large\", \"xx-large\", \"-webkit-xxx-large\", \"smaller\", \"larger\", \"serif\", \"sans-serif\", \"cursive\",\n        \"fantasy\", \"monospace\", \"-webkit-body\"\n    ],\n    \"dominant-baseline\": [\n        \"middle\", \"auto\", \"central\", \"text-before-edge\", \"text-after-edge\", \"ideographic\", \"alphabetic\", \"hanging\",\n        \"mathematical\", \"use-script\", \"no-change\", \"reset-size\"\n    ],\n    \"display\": [\n        \"none\", \"inline\", \"block\", \"list-item\", \"run-in\", \"compact\", \"inline-block\", \"table\", \"inline-table\",\n        \"table-row-group\", \"table-header-group\", \"table-footer-group\", \"table-row\", \"table-column-group\",\n        \"table-column\", \"table-cell\", \"table-caption\", \"-webkit-box\", \"-webkit-inline-box\", \"-wap-marquee\"\n    ],\n    \"-webkit-text-emphasis-position\": [\n        \"over\", \"under\"\n    ],\n    \"image-rendering\": [\n        \"auto\", \"optimizespeed\", \"optimizequality\"\n    ],\n    \"alignment-baseline\": [\n        \"baseline\", \"middle\", \"auto\", \"before-edge\", \"after-edge\", \"central\", \"text-before-edge\", \"text-after-edge\",\n        \"ideographic\", \"alphabetic\", \"hanging\", \"mathematical\"\n    ],\n    \"outline-width\": [\n        \"medium\", \"thick\", \"thin\"\n    ],\n    \"text-line-through-width\": [\n        \"normal\", \"medium\", \"auto\", \"thick\", \"thin\"\n    ],\n    \"box-align\": [\n        \"baseline\", \"center\", \"stretch\", \"start\", \"end\"\n    ],\n    \"border-right-width\": [\n        \"medium\", \"thick\", \"thin\"\n    ],\n    \"border-top-style\": [\n        \"none\", \"hidden\", \"inset\", \"groove\", \"ridge\", \"outset\", \"dotted\", \"dashed\", \"solid\", \"double\"\n    ],\n    \"line-height\": [\n        \"normal\"\n    ],\n    \"text-overflow\": [\n        \"clip\", \"ellipsis\"\n    ],\n    \"box-direction\": [\n        \"normal\", \"reverse\"\n    ],\n    \"margin-after-collapse\": [\n        \"collapse\", \"separate\", \"discard\"\n    ],\n    \"page-break-before\": [\n        \"left\", \"right\", \"auto\", \"always\", \"avoid\"\n    ],\n    \"-webkit-hyphens\": [\n        \"none\", \"auto\", \"manual\"\n    ],\n    \"border-image\": [\n        \"repeat\", \"stretch\"\n    ],\n    \"text-decoration\": [\n        \"blink\", \"line-through\", \"overline\", \"underline\"\n    ],\n    \"position\": [\n        \"absolute\", \"fixed\", \"relative\", \"static\"\n    ],\n    \"font-family\": [\n        \"serif\", \"sans-serif\", \"cursive\", \"fantasy\", \"monospace\", \"-webkit-body\"\n    ],\n    \"text-overflow-mode\": [\n        \"clip\", \"ellipsis\"\n    ],\n    \"border-bottom-style\": [\n        \"none\", \"hidden\", \"inset\", \"groove\", \"ridge\", \"outset\", \"dotted\", \"dashed\", \"solid\", \"double\"\n    ],\n    \"unicode-bidi\": [\n        \"normal\", \"bidi-override\", \"embed\"\n    ],\n    \"clip-rule\": [\n        \"nonzero\", \"evenodd\"\n    ],\n    \"margin-left\": [\n        \"auto\"\n    ],\n    \"margin-top\": [\n        \"auto\"\n    ],\n    \"zoom\": [\n        \"document\", \"reset\"\n    ],\n    \"text-overline-style\": [\n        \"none\", \"dotted\", \"dashed\", \"solid\", \"double\", \"dot-dash\", \"dot-dot-dash\", \"wave\"\n    ],\n    \"max-width\": [\n        \"none\"\n    ],\n    \"empty-cells\": [\n        \"hide\", \"show\"\n    ],\n    \"pointer-events\": [\n        \"none\", \"all\", \"auto\", \"visible\", \"visiblepainted\", \"visiblefill\", \"visiblestroke\", \"painted\", \"fill\", \"stroke\"\n    ],\n    \"letter-spacing\": [\n        \"normal\"\n    ],\n    \"background-clip\": [\n        \"border-box\", \"content-box\", \"padding-box\"\n    ],\n    \"-webkit-font-smoothing\": [\n        \"none\", \"auto\", \"antialiased\", \"subpixel-antialiased\"\n    ],\n    \"border\": [\n        \"none\", \"hidden\", \"inset\", \"groove\", \"ridge\", \"outset\", \"dotted\", \"dashed\", \"solid\", \"double\"\n    ],\n    \"font-size\": [\n        \"xx-small\", \"x-small\", \"small\", \"medium\", \"large\", \"x-large\", \"xx-large\", \"-webkit-xxx-large\", \"smaller\",\n        \"larger\"\n    ],\n    \"font-variant\": [\n        \"small-caps\", \"normal\"\n    ],\n    \"vertical-align\": [\n        \"baseline\", \"middle\", \"sub\", \"super\", \"text-top\", \"text-bottom\", \"top\", \"bottom\", \"-webkit-baseline-middle\"\n    ],\n    \"marquee-style\": [\n        \"none\", \"scroll\", \"slide\", \"alternate\"\n    ],\n    \"white-space\": [\n        \"normal\", \"nowrap\", \"pre\", \"pre-line\", \"pre-wrap\"\n    ],\n    \"text-underline-width\": [\n        \"normal\", \"medium\", \"auto\", \"thick\", \"thin\"\n    ],\n    \"box-lines\": [\n        \"single\", \"multiple\"\n    ],\n    \"page-break-after\": [\n        \"left\", \"right\", \"auto\", \"always\", \"avoid\"\n    ],\n    \"clip-path\": [\n        \"none\"\n    ],\n    \"margin\": [\n        \"auto\"\n    ],\n    \"marquee-repetition\": [\n        \"infinite\"\n    ],\n    \"margin-right\": [\n        \"auto\"\n    ],\n    \"-webkit-text-emphasis-style\": [\n        \"circle\", \"filled\", \"open\", \"dot\", \"double-circle\", \"triangle\", \"sesame\"\n    ]\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/CSSStyleModel.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.CSSStyleModel = function()\n{\n}\n\nWebInspector.CSSStyleModel.parseRuleArrayPayload = function(ruleArray)\n{\n    var result = [];\n    for (var i = 0; i < ruleArray.length; ++i)\n        result.push(WebInspector.CSSRule.parsePayload(ruleArray[i]));\n    return result;\n}\n\nWebInspector.CSSStyleModel.prototype = {\n    getStylesAsync: function(nodeId, userCallback)\n    {\n        function callback(userCallback, payload)\n        {\n            if (!payload) {\n                if (userCallback)\n                    userCallback(null);\n                return;\n            }\n\n            var result = {};\n            if (\"inlineStyle\" in payload)\n                result.inlineStyle = WebInspector.CSSStyleDeclaration.parsePayload(payload.inlineStyle);\n\n            result.computedStyle = WebInspector.CSSStyleDeclaration.parsePayload(payload.computedStyle);\n            result.matchedCSSRules = WebInspector.CSSStyleModel.parseRuleArrayPayload(payload.matchedCSSRules);\n\n            result.styleAttributes = {};\n            for (var name in payload.styleAttributes)\n                result.styleAttributes[name] = WebInspector.CSSStyleDeclaration.parsePayload(payload.styleAttributes[name]);\n\n            result.pseudoElements = [];\n            for (var i = 0; i < payload.pseudoElements.length; ++i) {\n                var entryPayload = payload.pseudoElements[i];\n                result.pseudoElements.push({ pseudoId: entryPayload.pseudoId, rules: WebInspector.CSSStyleModel.parseRuleArrayPayload(entryPayload.rules) });\n            }\n\n            result.inherited = [];\n            for (var i = 0; i < payload.inherited.length; ++i) {\n                var entryPayload = payload.inherited[i];\n                var entry = {};\n                if (\"inlineStyle\" in entryPayload)\n                    entry.inlineStyle = WebInspector.CSSStyleDeclaration.parsePayload(entryPayload.inlineStyle);\n                if (\"matchedCSSRules\" in entryPayload)\n                    entry.matchedCSSRules = WebInspector.CSSStyleModel.parseRuleArrayPayload(entryPayload.matchedCSSRules);\n                result.inherited.push(entry);\n            }\n\n            if (userCallback)\n                userCallback(result);\n        }\n\n        InspectorBackend.getStylesForNode(nodeId, callback.bind(null, userCallback));\n    },\n\n    getComputedStyleAsync: function(nodeId, userCallback)\n    {\n        function callback(userCallback, stylePayload)\n        {\n            if (!stylePayload)\n                userCallback(null);\n            else\n                userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));\n        }\n\n        InspectorBackend.getComputedStyleForNode(nodeId, callback.bind(null, userCallback));\n    },\n\n    getInlineStyleAsync: function(nodeId, userCallback)\n    {\n        function callback(userCallback, stylePayload)\n        {\n            if (!stylePayload)\n                userCallback(null);\n            else\n                userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));\n        }\n\n        InspectorBackend.getInlineStyleForNode(nodeId, callback.bind(null, userCallback));\n    },\n\n    setRuleSelector: function(ruleId, nodeId, newSelector, successCallback, failureCallback)\n    {\n        function checkAffectsCallback(nodeId, successCallback, rulePayload, selectedNodeIds)\n        {\n            var doesAffectSelectedNode = (selectedNodeIds.indexOf(nodeId) >= 0);\n            var rule = WebInspector.CSSRule.parsePayload(rulePayload);\n            successCallback(rule, doesAffectSelectedNode);\n            this._styleSheetChanged(rule.id.styleSheetId, true);\n        }\n\n        function callback(nodeId, successCallback, failureCallback, newSelector, rulePayload)\n        {\n            if (!rulePayload)\n                failureCallback();\n            else\n                InspectorBackend.querySelectorAll(nodeId, newSelector, checkAffectsCallback.bind(this, nodeId, successCallback, rulePayload));\n        }\n\n        InspectorBackend.setRuleSelector(ruleId, newSelector, callback.bind(this, nodeId, successCallback, failureCallback));\n    },\n\n    addRule: function(nodeId, selector, successCallback, failureCallback)\n    {\n        function checkAffectsCallback(nodeId, successCallback, rulePayload, selectedNodeIds)\n        {\n            var doesAffectSelectedNode = (selectedNodeIds.indexOf(nodeId) >= 0);\n            var rule = WebInspector.CSSRule.parsePayload(rulePayload);\n            successCallback(rule, doesAffectSelectedNode);\n            this._styleSheetChanged(rule.id.styleSheetId, true);\n        }\n\n        function callback(successCallback, failureCallback, selector, rulePayload)\n        {\n            if (!rulePayload) {\n                // Invalid syntax for a selector\n                failureCallback();\n            } else\n                InspectorBackend.querySelectorAll(nodeId, selector, checkAffectsCallback.bind(this, nodeId, successCallback, rulePayload));\n        }\n\n        InspectorBackend.addRule(nodeId, selector, callback.bind(this, successCallback, failureCallback, selector));\n    },\n\n    _styleSheetChanged: function(styleSheetId, majorChange)\n    {\n        if (!majorChange || !styleSheetId)\n            return;\n\n        function callback(href, content)\n        {\n            var resource = WebInspector.resourceForURL(href);\n            if (resource && resource.type === WebInspector.Resource.Type.Stylesheet)\n                resource.setContent(content, this._onRevert.bind(this, styleSheetId));\n        }\n        InspectorBackend.getStyleSheetText(styleSheetId, callback.bind(this));\n    },\n\n    _onRevert: function(styleSheetId, contentToRevertTo)\n    {\n        function callback(success)\n        {\n            this._styleSheetChanged(styleSheetId, true);\n            this.dispatchEventToListeners(\"stylesheet changed\");\n        }\n        InspectorBackend.setStyleSheetText(styleSheetId, contentToRevertTo, callback.bind(this));\n    }\n}\n\nWebInspector.CSSStyleModel.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.CSSStyleDeclaration = function(payload)\n{\n    this.id = payload.styleId;\n    this.properties = payload.properties;\n    this._shorthandValues = payload.shorthandValues;\n    this._livePropertyMap = {}; // LIVE properties (source-based or style-based) : { name -> CSSProperty }\n    this._allProperties = []; // ALL properties: [ CSSProperty ]\n    this._longhandProperties = {}; // shorthandName -> [ CSSProperty ]\n    this.__disabledProperties = {}; // DISABLED properties: { index -> CSSProperty }\n    var payloadPropertyCount = payload.cssProperties.length;\n\n    var propertyIndex = 0;\n    for (var i = 0; i < payloadPropertyCount; ++i) {\n        var property = new WebInspector.CSSProperty.parsePayload(this, i, payload.cssProperties[i]);\n        this._allProperties.push(property);\n        if (property.disabled)\n            this.__disabledProperties[i] = property;\n        if (!property.active && !property.styleBased)\n            continue;\n        var name = property.name;\n        this[propertyIndex] = name;\n        this._livePropertyMap[name] = property;\n\n        // Index longhand properties.\n        if (property.shorthand) { // only for parsed\n            var longhands = this._longhandProperties[property.shorthand];\n            if (!longhands) {\n                longhands = [];\n                this._longhandProperties[property.shorthand] = longhands;\n            }\n            longhands.push(property);\n        }\n        ++propertyIndex;\n    }\n    this.length = propertyIndex;\n    if (\"cssText\" in payload)\n        this.cssText = payload.cssText;\n}\n\nWebInspector.CSSStyleDeclaration.parsePayload = function(payload)\n{\n    return new WebInspector.CSSStyleDeclaration(payload);\n}\n\nWebInspector.CSSStyleDeclaration.prototype = {\n    get allProperties()\n    {\n        return this._allProperties;\n    },\n\n    getLiveProperty: function(name)\n    {\n        return this._livePropertyMap[name];\n    },\n\n    getPropertyValue: function(name)\n    {\n        var property = this._livePropertyMap[name];\n        return property ? property.value : \"\";\n    },\n\n    getPropertyPriority: function(name)\n    {\n        var property = this._livePropertyMap[name];\n        return property ? property.priority : \"\";\n    },\n\n    getPropertyShorthand: function(name)\n    {\n        var property = this._livePropertyMap[name];\n        return property ? property.shorthand : \"\";\n    },\n\n    isPropertyImplicit: function(name)\n    {\n        var property = this._livePropertyMap[name];\n        return property ? property.implicit : \"\";\n    },\n\n    styleTextWithShorthands: function()\n    {\n        var cssText = \"\";\n        var foundProperties = {};\n        for (var i = 0; i < this.length; ++i) {\n            var individualProperty = this[i];\n            var shorthandProperty = this.getPropertyShorthand(individualProperty);\n            var propertyName = (shorthandProperty || individualProperty);\n\n            if (propertyName in foundProperties)\n                continue;\n\n            if (shorthandProperty) {\n                var value = this.getShorthandValue(shorthandProperty);\n                var priority = this.getShorthandPriority(shorthandProperty);\n            } else {\n                var value = this.getPropertyValue(individualProperty);\n                var priority = this.getPropertyPriority(individualProperty);\n            }\n\n            foundProperties[propertyName] = true;\n\n            cssText += propertyName + \": \" + value;\n            if (priority)\n                cssText += \" !\" + priority;\n            cssText += \"; \";\n        }\n\n        return cssText;\n    },\n\n    getLonghandProperties: function(name)\n    {\n        return this._longhandProperties[name] || [];\n    },\n\n    getShorthandValue: function(shorthandProperty)\n    {\n        var property = this.getLiveProperty(shorthandProperty);\n        return property ? property.value : this._shorthandValues[shorthandProperty];\n    },\n\n    getShorthandPriority: function(shorthandProperty)\n    {\n        var priority = this.getPropertyPriority(shorthandProperty);\n        if (priority)\n            return priority;\n\n        var longhands = this._longhandProperties[shorthandProperty];\n        return longhands ? this.getPropertyPriority(longhands[0]) : null;\n    },\n\n    propertyAt: function(index)\n    {\n        return (index < this.allProperties.length) ? this.allProperties[index] : null;\n    },\n\n    pastLastSourcePropertyIndex: function()\n    {\n        for (var i = this.allProperties.length - 1; i >= 0; --i) {\n            var property = this.allProperties[i];\n            if (property.active || property.disabled)\n                return i + 1;\n        }\n        return 0;\n    },\n\n    newBlankProperty: function()\n    {\n        return new WebInspector.CSSProperty(this, this.pastLastSourcePropertyIndex(), \"\", \"\", \"\", \"active\", true, false, false, \"\");\n    },\n\n    insertPropertyAt: function(index, name, value, userCallback)\n    {\n        function callback(userCallback, payload)\n        {\n            if (!userCallback)\n                return;\n\n            if (!payload)\n                userCallback(null);\n            else {\n                userCallback(WebInspector.CSSStyleDeclaration.parsePayload(payload));\n                WebInspector.cssModel._styleSheetChanged(this.id.styleSheetId, true);\n            }\n        }\n\n        InspectorBackend.setPropertyText(this.id, index, name + \": \" + value + \";\", false, callback.bind(null, userCallback));\n    },\n\n    appendProperty: function(name, value, userCallback)\n    {\n        this.insertPropertyAt(this.allProperties.length, name, value, userCallback);\n    }\n}\n\nWebInspector.CSSRule = function(payload)\n{\n    this.id = payload.ruleId;\n    this.selectorText = payload.selectorText;\n    this.sourceLine = payload.sourceLine;\n    this.sourceURL = payload.sourceURL;\n    this.origin = payload.origin;\n    this.style = WebInspector.CSSStyleDeclaration.parsePayload(payload.style);\n    this.style.parentRule = this;\n    this.selectorRange = payload.selectorRange;\n}\n\nWebInspector.CSSRule.parsePayload = function(payload)\n{\n    return new WebInspector.CSSRule(payload);\n}\n\nWebInspector.CSSRule.prototype = {\n    get isUserAgent()\n    {\n        return this.origin === \"user-agent\";\n    },\n\n    get isUser()\n    {\n        return this.origin === \"user\";\n    },\n\n    get isViaInspector()\n    {\n        return this.origin === \"inspector\";\n    },\n\n    get isRegular()\n    {\n        return this.origin === \"\";\n    }\n}\n\nWebInspector.CSSProperty = function(ownerStyle, index, name, value, priority, status, parsedOk, implicit, shorthand, text)\n{\n    this.ownerStyle = ownerStyle;\n    this.index = index;\n    this.name = name;\n    this.value = value;\n    this.priority = priority;\n    this.status = status;\n    this.parsedOk = parsedOk;\n    this.implicit = implicit;\n    this.shorthand = shorthand;\n    this.text = text;\n}\n\nWebInspector.CSSProperty.parsePayload = function(ownerStyle, index, payload)\n{\n    var result = new WebInspector.CSSProperty(\n        ownerStyle, index, payload.name, payload.value, payload.priority, payload.status, payload.parsedOk, payload.implicit, payload.shorthandName, payload.text);\n    return result;\n}\n\nWebInspector.CSSProperty.prototype = {\n    get propertyText()\n    {\n        if (this.text !== undefined)\n            return this.text;\n\n        if (this.name === \"\")\n            return \"\";\n        return this.name + \": \" + this.value + (this.priority ? \" !\" + this.priority : \"\") + \";\";\n    },\n\n    get isLive()\n    {\n        return this.active || this.styleBased;\n    },\n\n    get active()\n    {\n        return this.status === \"active\";\n    },\n\n    get styleBased()\n    {\n        return this.status === \"style\";\n    },\n\n    get inactive()\n    {\n        return this.status === \"inactive\";\n    },\n\n    get disabled()\n    {\n        return this.status === \"disabled\";\n    },\n\n    // Replaces \"propertyName: propertyValue [!important];\" in the stylesheet by an arbitrary propertyText.\n    setText: function(propertyText, majorChange, userCallback)\n    {\n        function enabledCallback(style)\n        {\n            if (style)\n                WebInspector.cssModel._styleSheetChanged(style.id.styleSheetId, majorChange);\n            if (userCallback)\n                userCallback(style);\n        }\n\n        function callback(stylePayload)\n        {\n            if (stylePayload) {\n                this.text = propertyText;\n                var style = WebInspector.CSSStyleDeclaration.parsePayload(stylePayload);\n                var newProperty = style.allProperties[this.index];\n\n                if (newProperty && this.disabled && !propertyText.match(/^\\s*$/)) {\n                    newProperty.setDisabled(false, enabledCallback);\n                    return;\n                } else\n                    WebInspector.cssModel._styleSheetChanged(style.id.styleSheetId, majorChange);\n                if (userCallback)\n                    userCallback(style);\n            } else {\n                if (userCallback)\n                    userCallback(null);\n            }\n        }\n\n        if (!this.ownerStyle)\n            throw \"No ownerStyle for property\";\n\n        // An index past all the properties adds a new property to the style.\n        InspectorBackend.setPropertyText(this.ownerStyle.id, this.index, propertyText, this.index < this.ownerStyle.pastLastSourcePropertyIndex(), callback.bind(this));\n    },\n\n    setValue: function(newValue, userCallback)\n    {\n        var text = this.name + \": \" + newValue + (this.priority ? \" !\" + this.priority : \"\") + \";\"\n        this.setText(text, userCallback);\n    },\n\n    setDisabled: function(disabled, userCallback)\n    {\n        if (!this.ownerStyle && userCallback)\n            userCallback(null);\n        if (disabled === this.disabled && userCallback)\n            userCallback(this.ownerStyle);\n\n        function callback(stylePayload)\n        {\n            if (!userCallback)\n                return;\n            if (!stylePayload)\n                userCallback(null);\n            else {\n                var style = WebInspector.CSSStyleDeclaration.parsePayload(stylePayload);\n                userCallback(style);\n                WebInspector.cssModel._styleSheetChanged(this.ownerStyle.id.styleSheetId, false);\n            }\n        }\n\n        InspectorBackend.toggleProperty(this.ownerStyle.id, this.index, disabled, callback.bind(this));\n    }\n}\n\nWebInspector.CSSStyleSheet = function(payload)\n{\n    this.id = payload.styleSheetId;\n    this.sourceURL = payload.sourceURL;\n    this.title = payload.title;\n    this.disabled = payload.disabled;\n    this.rules = [];\n    this.styles = {};\n    for (var i = 0; i < payload.rules.length; ++i) {\n        var rule = WebInspector.CSSRule.parsePayload(payload.rules[i]);\n        this.rules.push(rule);\n        if (rule.style)\n            this.styles[rule.style.id] = rule.style;\n    }\n    if (\"text\" in payload)\n        this._text = payload.text;\n}\n\nWebInspector.CSSStyleSheet.createForId = function(styleSheetId, userCallback)\n{\n    function callback(styleSheetPayload)\n    {\n        if (!styleSheetPayload)\n            userCallback(null);\n        else\n            userCallback(new WebInspector.CSSStyleSheet(styleSheetPayload));\n    }\n    InspectorBackend.getStyleSheet(styleSheetId, callback.bind(this));\n}\n\nWebInspector.CSSStyleSheet.prototype = {\n    getText: function()\n    {\n        return this._text;\n    },\n\n    setText: function(newText, userCallback)\n    {\n        function callback(styleSheetPayload)\n        {\n            if (!styleSheetPayload)\n                userCallback(null);\n            else {\n                userCallback(new WebInspector.CSSStyleSheet(styleSheetPayload));\n                WebInspector.cssModel._styleSheetChanged(this.id, true);\n            }\n        }\n\n        InspectorBackend.setStyleSheetText(this.id, newText, callback.bind(this));\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/CallStackSidebarPane.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.CallStackSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Call Stack\"));\n}\n\nWebInspector.CallStackSidebarPane.prototype = {\n    update: function(details)\n    {\n        this.bodyElement.removeChildren();\n\n        this.placards = [];\n        delete this._selectedCallFrame;\n\n        if (!details) {\n            var infoElement = document.createElement(\"div\");\n            infoElement.className = \"info\";\n            infoElement.textContent = WebInspector.UIString(\"Not Paused\");\n            this.bodyElement.appendChild(infoElement);\n            return;\n        }\n\n        var callFrames = details.callFrames;\n        var title;\n        var subtitle;\n        var script;\n\n        for (var i = 0; i < callFrames.length; ++i) {\n            var callFrame = callFrames[i];\n            switch (callFrame.type) {\n            case \"function\":\n                title = callFrame.functionName || WebInspector.UIString(\"(anonymous function)\");\n                break;\n            case \"program\":\n                title = WebInspector.UIString(\"(program)\");\n                break;\n            }\n\n            script = WebInspector.debuggerModel.scriptForSourceID(callFrame.sourceID);\n            if (script)\n                subtitle = WebInspector.displayNameForURL(script.sourceURL);\n            else\n                subtitle = WebInspector.UIString(\"(internal script)\");\n\n            if (callFrame.line > 0) {\n                if (subtitle)\n                    subtitle += \":\" + callFrame.line;\n                else\n                    subtitle = WebInspector.UIString(\"line %d\", callFrame.line);\n            }\n\n            var placard = new WebInspector.Placard(title, subtitle);\n            placard.callFrame = callFrame;\n\n            placard.element.addEventListener(\"click\", this._placardSelected.bind(this), false);\n\n            this.placards.push(placard);\n            this.bodyElement.appendChild(placard.element);\n        }\n\n        if (details.breakpoint)\n            this._scriptBreakpointHit();\n        else if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint)\n            this._nativeBreakpointHit(details.eventData);\n    },\n\n    get selectedCallFrame()\n    {\n        return this._selectedCallFrame;\n    },\n\n    set selectedCallFrame(x)\n    {\n        this._selectedCallFrame = x;\n\n        for (var i = 0; i < this.placards.length; ++i) {\n            var placard = this.placards[i];\n            placard.selected = (placard.callFrame === this._selectedCallFrame);\n        }\n\n        this.dispatchEventToListeners(\"call frame selected\");\n    },\n\n    handleShortcut: function(event)\n    {\n        var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event);\n        var handler = this._shortcuts[shortcut];\n        if (handler) {\n            handler(event);\n            event.handled = true;\n        }\n    },\n\n    _selectNextCallFrameOnStack: function()\n    {\n        var index = this._selectedCallFrameIndex();\n        if (index == -1)\n            return;\n        this._selectedPlacardByIndex(index + 1);\n    },\n\n    _selectPreviousCallFrameOnStack: function()\n    {\n        var index = this._selectedCallFrameIndex();\n        if (index == -1)\n            return;\n        this._selectedPlacardByIndex(index - 1);\n    },\n\n    _selectedPlacardByIndex: function(index)\n    {\n        if (index < 0 || index >= this.placards.length)\n            return;\n        var placard = this.placards[index];\n        this.selectedCallFrame = placard.callFrame\n    },\n\n    _selectedCallFrameIndex: function()\n    {\n        if (!this._selectedCallFrame)\n            return -1;\n        for (var i = 0; i < this.placards.length; ++i) {\n            var placard = this.placards[i];\n            if (placard.callFrame === this._selectedCallFrame)\n                return i;\n        }\n        return -1;\n    },\n\n    _placardSelected: function(event)\n    {\n        var placardElement = event.target.enclosingNodeOrSelfWithClass(\"placard\");\n        this.selectedCallFrame = placardElement.placard.callFrame;\n    },\n\n    registerShortcuts: function(section)\n    {\n        this._shortcuts = {};\n\n        var nextCallFrame = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Period,\n            WebInspector.KeyboardShortcut.Modifiers.Ctrl);\n        this._shortcuts[nextCallFrame.key] = this._selectNextCallFrameOnStack.bind(this);\n\n        var prevCallFrame = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Comma,\n            WebInspector.KeyboardShortcut.Modifiers.Ctrl);\n        this._shortcuts[prevCallFrame.key] = this._selectPreviousCallFrameOnStack.bind(this);\n\n        section.addRelatedKeys([ nextCallFrame.name, prevCallFrame.name ], WebInspector.UIString(\"Next/previous call frame\"));\n    },\n\n    _scriptBreakpointHit: function()\n    {\n        var statusMessageElement = document.createElement(\"div\");\n        statusMessageElement.className = \"info\";\n        statusMessageElement.appendChild(document.createTextNode(WebInspector.UIString(\"Paused on a JavaScript breakpoint.\")));\n        this.bodyElement.appendChild(statusMessageElement);\n    },\n\n    _nativeBreakpointHit: function(eventData)\n    {\n        var breakpoint = WebInspector.breakpointManager.breakpointViewForEventData(eventData);\n        if (!breakpoint)\n            return;\n\n        var statusMessageElement = document.createElement(\"div\");\n        statusMessageElement.className = \"info\";\n        breakpoint.populateStatusMessageElement(statusMessageElement, eventData);\n        this.bodyElement.appendChild(statusMessageElement);\n    }\n}\n\nWebInspector.CallStackSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Checkbox.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Checkbox = function(label, className, tooltip)\n{\n    this.element = document.createElement('label');\n    this._inputElement = document.createElement('input');\n    this._inputElement.type = \"checkbox\";\n\n    this.element.className = className;\n    this.element.appendChild(this._inputElement);\n    this.element.appendChild(document.createTextNode(label));\n    if (tooltip)\n        this.element.title = tooltip;\n}\n\nWebInspector.Checkbox.prototype = {\n    set checked(checked)\n    {\n        this._inputElement.checked = checked;\n    },\n\n    get checked()\n    {\n        return this._inputElement.checked;\n    },\n\n    addEventListener: function(listener)\n    {\n        function listenerWrapper(event)\n        {\n            if (listener)\n                listener(event);\n            event.stopPropagation();\n            return true;\n        }\n\n        this._inputElement.addEventListener(\"click\", listenerWrapper, false);\n        this.element.addEventListener(\"click\", listenerWrapper, false);\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Color.js",
    "content": "/*\n * Copyright (C) 2009 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Color = function(str)\n{\n    this.value = str;\n    this._parse();\n}\n\nWebInspector.Color.prototype = {\n    get shorthex()\n    {\n        if (\"_short\" in this)\n            return this._short;\n\n        if (!this.simple)\n            return null;\n\n        var hex = this.hex;\n        if (hex.charAt(0) === hex.charAt(1) && hex.charAt(2) === hex.charAt(3) && hex.charAt(4) === hex.charAt(5))\n            this._short = hex.charAt(0) + hex.charAt(2) + hex.charAt(4);\n        else\n            this._short = hex;\n\n        return this._short;\n    },\n\n    get hex()\n    {\n        if (!this.simple)\n            return null;\n\n        return this._hex;\n    },\n\n    set hex(x)\n    {\n        this._hex = x;\n    },\n\n    get rgb()\n    {\n        if (\"_rgb\" in this)\n            return this._rgb;\n\n        if (this.simple)\n            this._rgb = this._hexToRGB(this.hex);\n        else {\n            var rgba = this.rgba;\n            this._rgb = [rgba[0], rgba[1], rgba[2]];\n        }\n\n        return this._rgb;\n    },\n\n    set rgb(x)\n    {\n        this._rgb = x;\n    },\n\n    get hsl()\n    {\n        if (\"_hsl\" in this)\n            return this._hsl;\n\n        this._hsl = this._rgbToHSL(this.rgb);\n        return this._hsl;\n    },\n\n    set hsl(x)\n    {\n        this._hsl = x;\n    },\n\n    get nickname()\n    {\n        if (typeof this._nickname !== \"undefined\") // would be set on parse if there was a nickname\n            return this._nickname;\n        else\n            return null;\n    },\n\n    set nickname(x)\n    {\n        this._nickname = x;\n    },\n\n    get rgba()\n    {\n        return this._rgba;\n    },\n\n    set rgba(x)\n    {\n        this._rgba = x;\n    },\n\n    get hsla()\n    {\n        return this._hsla;\n    },\n\n    set hsla(x)\n    {\n        this._hsla = x;\n    },\n\n    hasShortHex: function()\n    {\n        var shorthex = this.shorthex;\n        return (shorthex && shorthex.length === 3);\n    },\n\n    toString: function(format)\n    {\n        if (!format)\n            format = this.format;\n\n        switch (format) {\n            case \"original\":\n                return this.value;\n            case \"rgb\":\n                return \"rgb(\" + this.rgb.join(\", \") + \")\";\n            case \"rgba\":\n                return \"rgba(\" + this.rgba.join(\", \") + \")\";\n            case \"hsl\":\n                var hsl = this.hsl;\n                return \"hsl(\" + hsl[0] + \", \" + hsl[1] + \"%, \" + hsl[2] + \"%)\";\n            case \"hsla\":\n                var hsla = this.hsla;\n                return \"hsla(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%, \" + hsla[3] + \")\";\n            case \"hex\":\n                return \"#\" + this.hex;\n            case \"shorthex\":\n                return \"#\" + this.shorthex;\n            case \"nickname\":\n                return this.nickname;\n        }\n\n        throw \"invalid color format\";\n    },\n\n    _rgbToHex: function(rgb)\n    {\n        var r = parseInt(rgb[0]).toString(16);\n        var g = parseInt(rgb[1]).toString(16);\n        var b = parseInt(rgb[2]).toString(16);\n        if (r.length === 1)\n            r = \"0\" + r;\n        if (g.length === 1)\n            g = \"0\" + g;\n        if (b.length === 1)\n            b = \"0\" + b;\n\n        return (r + g + b).toUpperCase();\n    },\n\n    _hexToRGB: function(hex)\n    {\n        var r = parseInt(hex.substring(0,2), 16);\n        var g = parseInt(hex.substring(2,4), 16);\n        var b = parseInt(hex.substring(4,6), 16);\n\n        return [r, g, b];\n    },\n\n    _rgbToHSL: function(rgb)\n    {\n        var r = parseInt(rgb[0]) / 255;\n        var g = parseInt(rgb[1]) / 255;\n        var b = parseInt(rgb[2]) / 255;\n        var max = Math.max(r, g, b);\n        var min = Math.min(r, g, b);\n        var diff = max - min;\n        var add = max + min;\n\n        if (min === max)\n            var h = 0;\n        else if (r === max)\n            var h = ((60 * (g - b) / diff) + 360) % 360;\n        else if (g === max)\n            var h = (60 * (b - r) / diff) + 120;\n        else\n            var h = (60 * (r - g) / diff) + 240;\n\n        var l = 0.5 * add;\n\n        if (l === 0)\n            var s = 0;\n        else if (l === 1)\n            var s = 1;\n        else if (l <= 0.5)\n            var s = diff / add;\n        else\n            var s = diff / (2 - add);\n\n        h = Math.round(h);\n        s = Math.round(s*100);\n        l = Math.round(l*100);\n\n        return [h, s, l];\n    },\n\n    _hslToRGB: function(hsl)\n    {\n        var h = parseFloat(hsl[0]) / 360;\n        var s = parseFloat(hsl[1]) / 100;\n        var l = parseFloat(hsl[2]) / 100;\n\n        if (l <= 0.5)\n            var q = l * (1 + s);\n        else\n            var q = l + s - (l * s);\n\n        var p = 2 * l - q;\n\n        var tr = h + (1 / 3);\n        var tg = h;\n        var tb = h - (1 / 3);\n\n        var r = Math.round(hueToRGB(p, q, tr) * 255);\n        var g = Math.round(hueToRGB(p, q, tg) * 255);\n        var b = Math.round(hueToRGB(p, q, tb) * 255);\n        return [r, g, b];\n\n        function hueToRGB(p, q, h) {\n            if (h < 0)\n                h += 1;\n            else if (h > 1)\n                h -= 1;\n\n            if ((h * 6) < 1)\n                return p + (q - p) * h * 6;\n            else if ((h * 2) < 1)\n                return q;\n            else if ((h * 3) < 2)\n                return p + (q - p) * ((2 / 3) - h) * 6;\n            else\n                return p;\n        }\n    },\n\n    _rgbaToHSLA: function(rgba)\n    {\n        var alpha = rgba[3];\n        var hsl = this._rgbToHSL(rgba)\n        hsl.push(alpha);\n        return hsl;\n    },\n\n    _hslaToRGBA: function(hsla)\n    {\n        var alpha = hsla[3];\n        var rgb = this._hslToRGB(hsla);\n        rgb.push(alpha);\n        return rgb;\n    },\n\n    _parse: function()\n    {\n        // Special Values - Advanced but Must Be Parsed First - transparent\n        var value = this.value.toLowerCase().replace(/%|\\s+/g, \"\");\n        if (value in WebInspector.Color.AdvancedNickNames) {\n            this.format = \"nickname\";\n            var set = WebInspector.Color.AdvancedNickNames[value];\n            this.simple = false;\n            this.rgba = set[0];\n            this.hsla = set[1];\n            this.nickname = set[2];\n            this.alpha = set[0][3];\n            return;\n        }\n\n        // Simple - #hex, rgb(), nickname, hsl()\n        var simple = /^(?:#([0-9a-f]{3,6})|rgb\\(([^)]+)\\)|(\\w+)|hsl\\(([^)]+)\\))$/i;\n        var match = this.value.match(simple);\n        if (match) {\n            this.simple = true;\n\n            if (match[1]) { // hex\n                var hex = match[1].toUpperCase();\n                if (hex.length === 3) {\n                    this.format = \"shorthex\";\n                    this.hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2);\n                } else {\n                    this.format = \"hex\";\n                    this.hex = hex;\n                }\n            } else if (match[2]) { // rgb\n                this.format = \"rgb\";\n                var rgb = match[2].split(/\\s*,\\s*/);\n                this.rgb = rgb;\n                this.hex = this._rgbToHex(rgb);\n            } else if (match[3]) { // nickname\n                var nickname = match[3].toLowerCase();\n                if (nickname in WebInspector.Color.Nicknames) {\n                    this.format = \"nickname\";\n                    this.hex = WebInspector.Color.Nicknames[nickname];\n                } else // unknown name\n                    throw \"unknown color name\";\n            } else if (match[4]) { // hsl\n                this.format = \"hsl\";\n                var hsl = match[4].replace(/%/g, \"\").split(/\\s*,\\s*/);\n                this.hsl = hsl;\n                this.rgb = this._hslToRGB(hsl);\n                this.hex = this._rgbToHex(this.rgb);\n            }\n\n            // Fill in the values if this is a known hex color\n            var hex = this.hex;\n            if (hex && hex in WebInspector.Color.HexTable) {\n                var set = WebInspector.Color.HexTable[hex];\n                this.rgb = set[0];\n                this.hsl = set[1];\n                this.nickname = set[2];\n            }\n\n            return;\n        }\n\n        // Advanced - rgba(), hsla()\n        var advanced = /^(?:rgba\\(([^)]+)\\)|hsla\\(([^)]+)\\))$/;\n        match = this.value.match(advanced);\n        if (match) {\n            this.simple = false;\n            if (match[1]) { // rgba\n                this.format = \"rgba\";\n                this.rgba = match[1].split(/\\s*,\\s*/);\n                this.hsla = this._rgbaToHSLA(this.rgba);\n                this.alpha = this.rgba[3];\n            } else if (match[2]) { // hsla\n                this.format = \"hsla\";\n                this.hsla = match[2].replace(/%/g, \"\").split(/\\s*,\\s*/);\n                this.rgba = this._hslaToRGBA(this.hsla);\n                this.alpha = this.hsla[3];\n            }\n\n            return;\n        }\n\n        // Could not parse as a valid color\n        throw \"could not parse color\";\n    }\n}\n\n// Simple Values: [rgb, hsl, nickname]\nWebInspector.Color.HexTable = {\n    \"000000\": [[0, 0, 0], [0, 0, 0], \"black\"],\n    \"000080\": [[0, 0, 128], [240, 100, 25], \"navy\"],\n    \"00008B\": [[0, 0, 139], [240, 100, 27], \"darkBlue\"],\n    \"0000CD\": [[0, 0, 205], [240, 100, 40], \"mediumBlue\"],\n    \"0000FF\": [[0, 0, 255], [240, 100, 50], \"blue\"],\n    \"006400\": [[0, 100, 0], [120, 100, 20], \"darkGreen\"],\n    \"008000\": [[0, 128, 0], [120, 100, 25], \"green\"],\n    \"008080\": [[0, 128, 128], [180, 100, 25], \"teal\"],\n    \"008B8B\": [[0, 139, 139], [180, 100, 27], \"darkCyan\"],\n    \"00BFFF\": [[0, 191, 255], [195, 100, 50], \"deepSkyBlue\"],\n    \"00CED1\": [[0, 206, 209], [181, 100, 41], \"darkTurquoise\"],\n    \"00FA9A\": [[0, 250, 154], [157, 100, 49], \"mediumSpringGreen\"],\n    \"00FF00\": [[0, 255, 0], [120, 100, 50], \"lime\"],\n    \"00FF7F\": [[0, 255, 127], [150, 100, 50], \"springGreen\"],\n    \"00FFFF\": [[0, 255, 255], [180, 100, 50], \"cyan\"],\n    \"191970\": [[25, 25, 112], [240, 64, 27], \"midnightBlue\"],\n    \"1E90FF\": [[30, 144, 255], [210, 100, 56], \"dodgerBlue\"],\n    \"20B2AA\": [[32, 178, 170], [177, 70, 41], \"lightSeaGreen\"],\n    \"228B22\": [[34, 139, 34], [120, 61, 34], \"forestGreen\"],\n    \"2E8B57\": [[46, 139, 87], [146, 50, 36], \"seaGreen\"],\n    \"2F4F4F\": [[47, 79, 79], [180, 25, 25], \"darkSlateGray\"],\n    \"32CD32\": [[50, 205, 50], [120, 61, 50], \"limeGreen\"],\n    \"3CB371\": [[60, 179, 113], [147, 50, 47], \"mediumSeaGreen\"],\n    \"40E0D0\": [[64, 224, 208], [174, 72, 56], \"turquoise\"],\n    \"4169E1\": [[65, 105, 225], [225, 73, 57], \"royalBlue\"],\n    \"4682B4\": [[70, 130, 180], [207, 44, 49], \"steelBlue\"],\n    \"483D8B\": [[72, 61, 139], [248, 39, 39], \"darkSlateBlue\"],\n    \"48D1CC\": [[72, 209, 204], [178, 60, 55], \"mediumTurquoise\"],\n    \"4B0082\": [[75, 0, 130], [275, 100, 25], \"indigo\"],\n    \"556B2F\": [[85, 107, 47], [82, 39, 30], \"darkOliveGreen\"],\n    \"5F9EA0\": [[95, 158, 160], [182, 25, 50], \"cadetBlue\"],\n    \"6495ED\": [[100, 149, 237], [219, 79, 66], \"cornflowerBlue\"],\n    \"66CDAA\": [[102, 205, 170], [160, 51, 60], \"mediumAquaMarine\"],\n    \"696969\": [[105, 105, 105], [0, 0, 41], \"dimGray\"],\n    \"6A5ACD\": [[106, 90, 205], [248, 53, 58], \"slateBlue\"],\n    \"6B8E23\": [[107, 142, 35], [80, 60, 35], \"oliveDrab\"],\n    \"708090\": [[112, 128, 144], [210, 13, 50], \"slateGray\"],\n    \"778899\": [[119, 136, 153], [210, 14, 53], \"lightSlateGray\"],\n    \"7B68EE\": [[123, 104, 238], [249, 80, 67], \"mediumSlateBlue\"],\n    \"7CFC00\": [[124, 252, 0], [90, 100, 49], \"lawnGreen\"],\n    \"7FFF00\": [[127, 255, 0], [90, 100, 50], \"chartreuse\"],\n    \"7FFFD4\": [[127, 255, 212], [160, 100, 75], \"aquamarine\"],\n    \"800000\": [[128, 0, 0], [0, 100, 25], \"maroon\"],\n    \"800080\": [[128, 0, 128], [300, 100, 25], \"purple\"],\n    \"808000\": [[128, 128, 0], [60, 100, 25], \"olive\"],\n    \"808080\": [[128, 128, 128], [0, 0, 50], \"gray\"],\n    \"87CEEB\": [[135, 206, 235], [197, 71, 73], \"skyBlue\"],\n    \"87CEFA\": [[135, 206, 250], [203, 92, 75], \"lightSkyBlue\"],\n    \"8A2BE2\": [[138, 43, 226], [271, 76, 53], \"blueViolet\"],\n    \"8B0000\": [[139, 0, 0], [0, 100, 27], \"darkRed\"],\n    \"8B008B\": [[139, 0, 139], [300, 100, 27], \"darkMagenta\"],\n    \"8B4513\": [[139, 69, 19], [25, 76, 31], \"saddleBrown\"],\n    \"8FBC8F\": [[143, 188, 143], [120, 25, 65], \"darkSeaGreen\"],\n    \"90EE90\": [[144, 238, 144], [120, 73, 75], \"lightGreen\"],\n    \"9370D8\": [[147, 112, 219], [260, 60, 65], \"mediumPurple\"],\n    \"9400D3\": [[148, 0, 211], [282, 100, 41], \"darkViolet\"],\n    \"98FB98\": [[152, 251, 152], [120, 93, 79], \"paleGreen\"],\n    \"9932CC\": [[153, 50, 204], [280, 61, 50], \"darkOrchid\"],\n    \"9ACD32\": [[154, 205, 50], [80, 61, 50], \"yellowGreen\"],\n    \"A0522D\": [[160, 82, 45], [19, 56, 40], \"sienna\"],\n    \"A52A2A\": [[165, 42, 42], [0, 59, 41], \"brown\"],\n    \"A9A9A9\": [[169, 169, 169], [0, 0, 66], \"darkGray\"],\n    \"ADD8E6\": [[173, 216, 230], [195, 53, 79], \"lightBlue\"],\n    \"ADFF2F\": [[173, 255, 47], [84, 100, 59], \"greenYellow\"],\n    \"AFEEEE\": [[175, 238, 238], [180, 65, 81], \"paleTurquoise\"],\n    \"B0C4DE\": [[176, 196, 222], [214, 41, 78], \"lightSteelBlue\"],\n    \"B0E0E6\": [[176, 224, 230], [187, 52, 80], \"powderBlue\"],\n    \"B22222\": [[178, 34, 34], [0, 68, 42], \"fireBrick\"],\n    \"B8860B\": [[184, 134, 11], [43, 89, 38], \"darkGoldenrod\"],\n    \"BA55D3\": [[186, 85, 211], [288, 59, 58], \"mediumOrchid\"],\n    \"BC8F8F\": [[188, 143, 143], [0, 25, 65], \"rosyBrown\"],\n    \"BDB76B\": [[189, 183, 107], [56, 38, 58], \"darkKhaki\"],\n    \"C0C0C0\": [[192, 192, 192], [0, 0, 75], \"silver\"],\n    \"C71585\": [[199, 21, 133], [322, 81, 43], \"mediumVioletRed\"],\n    \"CD5C5C\": [[205, 92, 92], [0, 53, 58], \"indianRed\"],\n    \"CD853F\": [[205, 133, 63], [30, 59, 53], \"peru\"],\n    \"D2691E\": [[210, 105, 30], [25, 75, 47], \"chocolate\"],\n    \"D2B48C\": [[210, 180, 140], [34, 44, 69], \"tan\"],\n    \"D3D3D3\": [[211, 211, 211], [0, 0, 83], \"lightGrey\"],\n    \"D87093\": [[219, 112, 147], [340, 60, 65], \"paleVioletRed\"],\n    \"D8BFD8\": [[216, 191, 216], [300, 24, 80], \"thistle\"],\n    \"DA70D6\": [[218, 112, 214], [302, 59, 65], \"orchid\"],\n    \"DAA520\": [[218, 165, 32], [43, 74, 49], \"goldenrod\"],\n    \"DC143C\": [[237, 164, 61], [35, 83, 58], \"crimson\"],\n    \"DCDCDC\": [[220, 220, 220], [0, 0, 86], \"gainsboro\"],\n    \"DDA0DD\": [[221, 160, 221], [300, 47, 75], \"plum\"],\n    \"DEB887\": [[222, 184, 135], [34, 57, 70], \"burlyWood\"],\n    \"E0FFFF\": [[224, 255, 255], [180, 100, 94], \"lightCyan\"],\n    \"E6E6FA\": [[230, 230, 250], [240, 67, 94], \"lavender\"],\n    \"E9967A\": [[233, 150, 122], [15, 72, 70], \"darkSalmon\"],\n    \"EE82EE\": [[238, 130, 238], [300, 76, 72], \"violet\"],\n    \"EEE8AA\": [[238, 232, 170], [55, 67, 80], \"paleGoldenrod\"],\n    \"F08080\": [[240, 128, 128], [0, 79, 72], \"lightCoral\"],\n    \"F0E68C\": [[240, 230, 140], [54, 77, 75], \"khaki\"],\n    \"F0F8FF\": [[240, 248, 255], [208, 100, 97], \"aliceBlue\"],\n    \"F0FFF0\": [[240, 255, 240], [120, 100, 97], \"honeyDew\"],\n    \"F0FFFF\": [[240, 255, 255], [180, 100, 97], \"azure\"],\n    \"F4A460\": [[244, 164, 96], [28, 87, 67], \"sandyBrown\"],\n    \"F5DEB3\": [[245, 222, 179], [39, 77, 83], \"wheat\"],\n    \"F5F5DC\": [[245, 245, 220], [60, 56, 91], \"beige\"],\n    \"F5F5F5\": [[245, 245, 245], [0, 0, 96], \"whiteSmoke\"],\n    \"F5FFFA\": [[245, 255, 250], [150, 100, 98], \"mintCream\"],\n    \"F8F8FF\": [[248, 248, 255], [240, 100, 99], \"ghostWhite\"],\n    \"FA8072\": [[250, 128, 114], [6, 93, 71], \"salmon\"],\n    \"FAEBD7\": [[250, 235, 215], [34, 78, 91], \"antiqueWhite\"],\n    \"FAF0E6\": [[250, 240, 230], [30, 67, 94], \"linen\"],\n    \"FAFAD2\": [[250, 250, 210], [60, 80, 90], \"lightGoldenrodYellow\"],\n    \"FDF5E6\": [[253, 245, 230], [39, 85, 95], \"oldLace\"],\n    \"FF0000\": [[255, 0, 0], [0, 100, 50], \"red\"],\n    \"FF00FF\": [[255, 0, 255], [300, 100, 50], \"magenta\"],\n    \"FF1493\": [[255, 20, 147], [328, 100, 54], \"deepPink\"],\n    \"FF4500\": [[255, 69, 0], [16, 100, 50], \"orangeRed\"],\n    \"FF6347\": [[255, 99, 71], [9, 100, 64], \"tomato\"],\n    \"FF69B4\": [[255, 105, 180], [330, 100, 71], \"hotPink\"],\n    \"FF7F50\": [[255, 127, 80], [16, 100, 66], \"coral\"],\n    \"FF8C00\": [[255, 140, 0], [33, 100, 50], \"darkOrange\"],\n    \"FFA07A\": [[255, 160, 122], [17, 100, 74], \"lightSalmon\"],\n    \"FFA500\": [[255, 165, 0], [39, 100, 50], \"orange\"],\n    \"FFB6C1\": [[255, 182, 193], [351, 100, 86], \"lightPink\"],\n    \"FFC0CB\": [[255, 192, 203], [350, 100, 88], \"pink\"],\n    \"FFD700\": [[255, 215, 0], [51, 100, 50], \"gold\"],\n    \"FFDAB9\": [[255, 218, 185], [28, 100, 86], \"peachPuff\"],\n    \"FFDEAD\": [[255, 222, 173], [36, 100, 84], \"navajoWhite\"],\n    \"FFE4B5\": [[255, 228, 181], [38, 100, 85], \"moccasin\"],\n    \"FFE4C4\": [[255, 228, 196], [33, 100, 88], \"bisque\"],\n    \"FFE4E1\": [[255, 228, 225], [6, 100, 94], \"mistyRose\"],\n    \"FFEBCD\": [[255, 235, 205], [36, 100, 90], \"blanchedAlmond\"],\n    \"FFEFD5\": [[255, 239, 213], [37, 100, 92], \"papayaWhip\"],\n    \"FFF0F5\": [[255, 240, 245], [340, 100, 97], \"lavenderBlush\"],\n    \"FFF5EE\": [[255, 245, 238], [25, 100, 97], \"seaShell\"],\n    \"FFF8DC\": [[255, 248, 220], [48, 100, 93], \"cornsilk\"],\n    \"FFFACD\": [[255, 250, 205], [54, 100, 90], \"lemonChiffon\"],\n    \"FFFAF0\": [[255, 250, 240], [40, 100, 97], \"floralWhite\"],\n    \"FFFAFA\": [[255, 250, 250], [0, 100, 99], \"snow\"],\n    \"FFFF00\": [[255, 255, 0], [60, 100, 50], \"yellow\"],\n    \"FFFFE0\": [[255, 255, 224], [60, 100, 94], \"lightYellow\"],\n    \"FFFFF0\": [[255, 255, 240], [60, 100, 97], \"ivory\"],\n    \"FFFFFF\": [[255, 255, 255], [0, 100, 100], \"white\"]\n};\n\n// Simple Values\nWebInspector.Color.Nicknames = {\n    \"aliceblue\": \"F0F8FF\",\n    \"antiquewhite\": \"FAEBD7\",\n    \"aqua\": \"00FFFF\",\n    \"aquamarine\": \"7FFFD4\",\n    \"azure\": \"F0FFFF\",\n    \"beige\": \"F5F5DC\",\n    \"bisque\": \"FFE4C4\",\n    \"black\": \"000000\",\n    \"blanchedalmond\": \"FFEBCD\",\n    \"blue\": \"0000FF\",\n    \"blueviolet\": \"8A2BE2\",\n    \"brown\": \"A52A2A\",\n    \"burlywood\": \"DEB887\",\n    \"cadetblue\": \"5F9EA0\",\n    \"chartreuse\": \"7FFF00\",\n    \"chocolate\": \"D2691E\",\n    \"coral\": \"FF7F50\",\n    \"cornflowerblue\": \"6495ED\",\n    \"cornsilk\": \"FFF8DC\",\n    \"crimson\": \"DC143C\",\n    \"cyan\": \"00FFFF\",\n    \"darkblue\": \"00008B\",\n    \"darkcyan\": \"008B8B\",\n    \"darkgoldenrod\": \"B8860B\",\n    \"darkgray\": \"A9A9A9\",\n    \"darkgreen\": \"006400\",\n    \"darkkhaki\": \"BDB76B\",\n    \"darkmagenta\": \"8B008B\",\n    \"darkolivegreen\": \"556B2F\",\n    \"darkorange\": \"FF8C00\",\n    \"darkorchid\": \"9932CC\",\n    \"darkred\": \"8B0000\",\n    \"darksalmon\": \"E9967A\",\n    \"darkseagreen\": \"8FBC8F\",\n    \"darkslateblue\": \"483D8B\",\n    \"darkslategray\": \"2F4F4F\",\n    \"darkturquoise\": \"00CED1\",\n    \"darkviolet\": \"9400D3\",\n    \"deeppink\": \"FF1493\",\n    \"deepskyblue\": \"00BFFF\",\n    \"dimgray\": \"696969\",\n    \"dodgerblue\": \"1E90FF\",\n    \"firebrick\": \"B22222\",\n    \"floralwhite\": \"FFFAF0\",\n    \"forestgreen\": \"228B22\",\n    \"fuchsia\": \"FF00FF\",\n    \"gainsboro\": \"DCDCDC\",\n    \"ghostwhite\": \"F8F8FF\",\n    \"gold\": \"FFD700\",\n    \"goldenrod\": \"DAA520\",\n    \"gray\": \"808080\",\n    \"green\": \"008000\",\n    \"greenyellow\": \"ADFF2F\",\n    \"honeydew\": \"F0FFF0\",\n    \"hotpink\": \"FF69B4\",\n    \"indianred\": \"CD5C5C\",\n    \"indigo\": \"4B0082\",\n    \"ivory\": \"FFFFF0\",\n    \"khaki\": \"F0E68C\",\n    \"lavender\": \"E6E6FA\",\n    \"lavenderblush\": \"FFF0F5\",\n    \"lawngreen\": \"7CFC00\",\n    \"lemonchiffon\": \"FFFACD\",\n    \"lightblue\": \"ADD8E6\",\n    \"lightcoral\": \"F08080\",\n    \"lightcyan\": \"E0FFFF\",\n    \"lightgoldenrodyellow\": \"FAFAD2\",\n    \"lightgreen\": \"90EE90\",\n    \"lightgrey\": \"D3D3D3\",\n    \"lightpink\": \"FFB6C1\",\n    \"lightsalmon\": \"FFA07A\",\n    \"lightseagreen\": \"20B2AA\",\n    \"lightskyblue\": \"87CEFA\",\n    \"lightslategray\": \"778899\",\n    \"lightsteelblue\": \"B0C4DE\",\n    \"lightyellow\": \"FFFFE0\",\n    \"lime\": \"00FF00\",\n    \"limegreen\": \"32CD32\",\n    \"linen\": \"FAF0E6\",\n    \"magenta\": \"FF00FF\",\n    \"maroon\": \"800000\",\n    \"mediumaquamarine\": \"66CDAA\",\n    \"mediumblue\": \"0000CD\",\n    \"mediumorchid\": \"BA55D3\",\n    \"mediumpurple\": \"9370D8\",\n    \"mediumseagreen\": \"3CB371\",\n    \"mediumslateblue\": \"7B68EE\",\n    \"mediumspringgreen\": \"00FA9A\",\n    \"mediumturquoise\": \"48D1CC\",\n    \"mediumvioletred\": \"C71585\",\n    \"midnightblue\": \"191970\",\n    \"mintcream\": \"F5FFFA\",\n    \"mistyrose\": \"FFE4E1\",\n    \"moccasin\": \"FFE4B5\",\n    \"navajowhite\": \"FFDEAD\",\n    \"navy\": \"000080\",\n    \"oldlace\": \"FDF5E6\",\n    \"olive\": \"808000\",\n    \"olivedrab\": \"6B8E23\",\n    \"orange\": \"FFA500\",\n    \"orangered\": \"FF4500\",\n    \"orchid\": \"DA70D6\",\n    \"palegoldenrod\": \"EEE8AA\",\n    \"palegreen\": \"98FB98\",\n    \"paleturquoise\": \"AFEEEE\",\n    \"palevioletred\": \"D87093\",\n    \"papayawhip\": \"FFEFD5\",\n    \"peachpuff\": \"FFDAB9\",\n    \"peru\": \"CD853F\",\n    \"pink\": \"FFC0CB\",\n    \"plum\": \"DDA0DD\",\n    \"powderblue\": \"B0E0E6\",\n    \"purple\": \"800080\",\n    \"red\": \"FF0000\",\n    \"rosybrown\": \"BC8F8F\",\n    \"royalblue\": \"4169E1\",\n    \"saddlebrown\": \"8B4513\",\n    \"salmon\": \"FA8072\",\n    \"sandybrown\": \"F4A460\",\n    \"seagreen\": \"2E8B57\",\n    \"seashell\": \"FFF5EE\",\n    \"sienna\": \"A0522D\",\n    \"silver\": \"C0C0C0\",\n    \"skyblue\": \"87CEEB\",\n    \"slateblue\": \"6A5ACD\",\n    \"slategray\": \"708090\",\n    \"snow\": \"FFFAFA\",\n    \"springgreen\": \"00FF7F\",\n    \"steelblue\": \"4682B4\",\n    \"tan\": \"D2B48C\",\n    \"teal\": \"008080\",\n    \"thistle\": \"D8BFD8\",\n    \"tomato\": \"FF6347\",\n    \"turquoise\": \"40E0D0\",\n    \"violet\": \"EE82EE\",\n    \"wheat\": \"F5DEB3\",\n    \"white\": \"FFFFFF\",\n    \"whitesmoke\": \"F5F5F5\",\n    \"yellow\": \"FFFF00\",\n    \"yellowgreen\": \"9ACD32\"\n};\n\n// Advanced Values [rgba, hsla, nickname]\nWebInspector.Color.AdvancedNickNames = {\n    \"transparent\": [[0, 0, 0, 0], [0, 0, 0, 0], \"transparent\"],\n    \"rgba(0,0,0,0)\": [[0, 0, 0, 0], [0, 0, 0, 0], \"transparent\"],\n    \"hsla(0,0,0,0)\": [[0, 0, 0, 0], [0, 0, 0, 0], \"transparent\"],\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ConsolePanel.js",
    "content": "/*\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ConsolePanel = function()\n{\n    WebInspector.Panel.call(this, \"console\");\n}\n\nWebInspector.ConsolePanel.prototype = {\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Console\");\n    },\n\n    show: function()\n    {\n        WebInspector.Panel.prototype.show.call(this);\n\n        this._previousConsoleState = WebInspector.drawer.state;\n        WebInspector.drawer.enterPanelMode();\n        WebInspector.showConsole();\n        \n        // Move the scope bar to the top of the messages, like the resources filter.\n        var scopeBar = document.getElementById(\"console-filter\");\n        var consoleMessages = document.getElementById(\"console-messages\");\n\n        scopeBar.parentNode.removeChild(scopeBar);\n        document.getElementById(\"console-view\").insertBefore(scopeBar, consoleMessages);\n        \n        // Update styles, and give console-messages a top margin so it doesn't overwrite the scope bar.\n        scopeBar.addStyleClass(\"console-filter-top\");\n        scopeBar.removeStyleClass(\"status-bar-item\");\n\n        consoleMessages.addStyleClass(\"console-filter-top\");\n    },\n\n    hide: function()\n    {\n        WebInspector.Panel.prototype.hide.call(this);\n\n        if (this._previousConsoleState === WebInspector.Drawer.State.Hidden)\n            WebInspector.drawer.immediatelyExitPanelMode();\n        else\n            WebInspector.drawer.exitPanelMode();\n        delete this._previousConsoleState;\n        \n        // Move the scope bar back to the bottom bar, next to Clear Console.\n        var scopeBar = document.getElementById(\"console-filter\");\n\n        scopeBar.parentNode.removeChild(scopeBar);\n        document.getElementById(\"other-drawer-status-bar-items\").appendChild(scopeBar);\n        \n        // Update styles, and remove the top margin on console-messages.\n        scopeBar.removeStyleClass(\"console-filter-top\");\n        scopeBar.addStyleClass(\"status-bar-item\");\n\n        document.getElementById(\"console-messages\").removeStyleClass(\"console-filter-top\");\n    }\n}\n\nWebInspector.ConsolePanel.prototype.__proto__ = WebInspector.Panel.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ConsoleView.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar ExpressionStopCharacters = \" =:[({;,!+-*/&|^<>\";\n\nWebInspector.ConsoleView = function(drawer)\n{\n    WebInspector.View.call(this, document.getElementById(\"console-view\"));\n\n    this.messages = [];\n    this.drawer = drawer;\n\n    this.clearButton = document.getElementById(\"clear-console-status-bar-item\");\n    this.clearButton.title = WebInspector.UIString(\"Clear console log.\");\n    this.clearButton.addEventListener(\"click\", this._clearButtonClicked.bind(this), false);\n\n    this.messagesElement = document.getElementById(\"console-messages\");\n    this.messagesElement.addEventListener(\"selectstart\", this._messagesSelectStart.bind(this), false);\n    this.messagesElement.addEventListener(\"click\", this._messagesClicked.bind(this), true);\n\n    this.promptElement = document.getElementById(\"console-prompt\");\n    this.promptElement.setAttribute(\"contenteditable\", \"true\");\n    this.promptElement.className = \"source-code\";\n    this.promptElement.addEventListener(\"keydown\", this._promptKeyDown.bind(this), true);\n    this.prompt = new WebInspector.TextPrompt(this.promptElement, this.completions.bind(this), ExpressionStopCharacters + \".\");\n    this.prompt.history = WebInspector.settings.consoleHistory;\n\n    this.topGroup = new WebInspector.ConsoleGroup(null);\n    this.messagesElement.insertBefore(this.topGroup.element, this.promptElement);\n    this.currentGroup = this.topGroup;\n\n    this.toggleConsoleButton = document.getElementById(\"console-status-bar-item\");\n    this.toggleConsoleButton.title = WebInspector.UIString(\"Show console.\");\n    this.toggleConsoleButton.addEventListener(\"click\", this._toggleConsoleButtonClicked.bind(this), false);\n\n    // Will hold the list of filter elements\n    this.filterBarElement = document.getElementById(\"console-filter\");\n\n    function createDividerElement() {\n        var dividerElement = document.createElement(\"div\");\n        dividerElement.addStyleClass(\"scope-bar-divider\");\n        this.filterBarElement.appendChild(dividerElement);\n    }\n\n    var updateFilterHandler = this._updateFilter.bind(this);\n    function createFilterElement(category, label) {\n        var categoryElement = document.createElement(\"li\");\n        categoryElement.category = category;\n        categoryElement.className = category;\n        categoryElement.addEventListener(\"click\", updateFilterHandler, false);\n        categoryElement.textContent = label;\n\n        this.filterBarElement.appendChild(categoryElement);\n\n        return categoryElement;\n    }\n\n    this.allElement = createFilterElement.call(this, \"all\", WebInspector.UIString(\"All\"));\n    createDividerElement.call(this);\n    this.errorElement = createFilterElement.call(this, \"errors\", WebInspector.UIString(\"Errors\"));\n    this.warningElement = createFilterElement.call(this, \"warnings\", WebInspector.UIString(\"Warnings\"));\n    this.logElement = createFilterElement.call(this, \"logs\", WebInspector.UIString(\"Logs\"));\n\n    this.filter(this.allElement, false);\n    this._registerShortcuts();\n\n    this.messagesElement.addEventListener(\"contextmenu\", this._handleContextMenuEvent.bind(this), false);\n\n    this._customFormatters = {\n        \"object\": this._formatobject,\n        \"array\":  this._formatarray,\n        \"node\":   this._formatnode,\n        \"string\": this._formatstring\n    };\n\n    this._registerConsoleDomainDispatcher();\n}\n\nWebInspector.ConsoleView.prototype = {\n    _registerConsoleDomainDispatcher: function() {\n        var console = this;\n        var dispatcher = {\n            addConsoleMessage: function(payload)\n            {\n                var consoleMessage = new WebInspector.ConsoleMessage(\n                    payload.source,\n                    payload.type,\n                    payload.level,\n                    payload.line,\n                    payload.url,\n                    payload.repeatCount,\n                    payload.message,\n                    payload.parameters,\n                    payload.stackTrace,\n                    payload.requestId);\n                console.addMessage(consoleMessage);\n            },\n\n            updateConsoleMessageExpiredCount: function(count)\n            {\n                var message = String.sprintf(WebInspector.UIString(\"%d console messages are not shown.\"), count);\n                console.addMessage(WebInspector.ConsoleMessage.createTextMessage(message, WebInspector.ConsoleMessage.MessageLevel.Warning));\n            },\n\n            updateConsoleMessageRepeatCount: function(count)\n            {\n                var msg = console.previousMessage;\n                var prevRepeatCount = msg.totalRepeatCount;\n\n                if (!console.commandSincePreviousMessage) {\n                    msg.repeatDelta = count - prevRepeatCount;\n                    msg.repeatCount = msg.repeatCount + msg.repeatDelta;\n                    msg.totalRepeatCount = count;\n                    msg._updateRepeatCount();\n                    console._incrementErrorWarningCount(msg);\n                } else {\n                    var msgCopy = new WebInspector.ConsoleMessage(msg.source, msg.type, msg.level, msg.line, msg.url, count - prevRepeatCount, msg._messageText, msg._parameters, msg._stackTrace, msg._requestId);\n                    msgCopy.totalRepeatCount = count;\n                    msgCopy._formatMessage();\n                    console.addMessage(msgCopy);\n                }\n            },\n\n            consoleMessagesCleared: function()\n            {\n                console.clearMessages();\n            },\n        }\n        InspectorBackend.registerDomainDispatcher(\"Console\", dispatcher);\n    },\n\n    _updateFilter: function(e)\n    {\n        var isMac = WebInspector.isMac();\n        var selectMultiple = false;\n        if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)\n            selectMultiple = true;\n        if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)\n            selectMultiple = true;\n\n        this.filter(e.target, selectMultiple);\n    },\n\n    filter: function(target, selectMultiple)\n    {\n        function unselectAll()\n        {\n            this.allElement.removeStyleClass(\"selected\");\n            this.errorElement.removeStyleClass(\"selected\");\n            this.warningElement.removeStyleClass(\"selected\");\n            this.logElement.removeStyleClass(\"selected\");\n\n            this.messagesElement.removeStyleClass(\"filter-all\");\n            this.messagesElement.removeStyleClass(\"filter-errors\");\n            this.messagesElement.removeStyleClass(\"filter-warnings\");\n            this.messagesElement.removeStyleClass(\"filter-logs\");\n        }\n\n        var targetFilterClass = \"filter-\" + target.category;\n\n        if (target.category === \"all\") {\n            if (target.hasStyleClass(\"selected\")) {\n                // We can't unselect all, so we break early here\n                return;\n            }\n\n            unselectAll.call(this);\n        } else {\n            // Something other than all is being selected, so we want to unselect all\n            if (this.allElement.hasStyleClass(\"selected\")) {\n                this.allElement.removeStyleClass(\"selected\");\n                this.messagesElement.removeStyleClass(\"filter-all\");\n            }\n        }\n\n        if (!selectMultiple) {\n            // If multiple selection is off, we want to unselect everything else\n            // and just select ourselves.\n            unselectAll.call(this);\n\n            target.addStyleClass(\"selected\");\n            this.messagesElement.addStyleClass(targetFilterClass);\n\n            return;\n        }\n\n        if (target.hasStyleClass(\"selected\")) {\n            // If selectMultiple is turned on, and we were selected, we just\n            // want to unselect ourselves.\n            target.removeStyleClass(\"selected\");\n            this.messagesElement.removeStyleClass(targetFilterClass);\n        } else {\n            // If selectMultiple is turned on, and we weren't selected, we just\n            // want to select ourselves.\n            target.addStyleClass(\"selected\");\n            this.messagesElement.addStyleClass(targetFilterClass);\n        }\n    },\n\n    _toggleConsoleButtonClicked: function()\n    {\n        this.drawer.visibleView = this;\n    },\n\n    attach: function(mainElement, statusBarElement)\n    {\n        mainElement.appendChild(this.element);\n        statusBarElement.appendChild(this.clearButton);\n        statusBarElement.appendChild(this.filterBarElement);\n    },\n\n    show: function()\n    {\n        this.toggleConsoleButton.addStyleClass(\"toggled-on\");\n        this.toggleConsoleButton.title = WebInspector.UIString(\"Hide console.\");\n        if (!this.prompt.isCaretInsidePrompt())\n            this.prompt.moveCaretToEndOfPrompt();\n    },\n\n    afterShow: function()\n    {\n        WebInspector.currentFocusElement = this.promptElement;\n    },\n\n    hide: function()\n    {\n        this.toggleConsoleButton.removeStyleClass(\"toggled-on\");\n        this.toggleConsoleButton.title = WebInspector.UIString(\"Show console.\");\n    },\n\n    _scheduleScrollIntoView: function()\n    {\n        if (this._scrollIntoViewTimer)\n            return;\n\n        function scrollIntoView()\n        {\n            this.promptElement.scrollIntoView(true);\n            delete this._scrollIntoViewTimer;\n        }\n        this._scrollIntoViewTimer = setTimeout(scrollIntoView.bind(this), 20);\n    },\n\n    addMessage: function(msg)\n    {\n        var shouldScrollToLastMessage = this.messagesElement.isScrolledToBottom();\n\n        if (msg instanceof WebInspector.ConsoleMessage && !(msg instanceof WebInspector.ConsoleCommandResult)) {\n            this._incrementErrorWarningCount(msg);\n            WebInspector.resourceTreeModel.addConsoleMessage(msg);\n            WebInspector.panels.scripts.addConsoleMessage(msg);\n            this.commandSincePreviousMessage = false;\n            this.previousMessage = msg;\n        } else if (msg instanceof WebInspector.ConsoleCommand) {\n            if (this.previousMessage) {\n                this.commandSincePreviousMessage = true;\n            }\n        }\n\n        this.messages.push(msg);\n\n        if (msg.type === WebInspector.ConsoleMessage.MessageType.EndGroup) {\n            var parentGroup = this.currentGroup.parentGroup\n            if (parentGroup)\n                this.currentGroup = parentGroup;\n        } else {\n            if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {\n                var group = new WebInspector.ConsoleGroup(this.currentGroup);\n                this.currentGroup.messagesElement.appendChild(group.element);\n                this.currentGroup = group;\n            }\n\n            this.currentGroup.addMessage(msg);\n        }\n\n        if (shouldScrollToLastMessage)\n            this._scheduleScrollIntoView();\n    },\n\n    _incrementErrorWarningCount: function(msg)\n    {\n        switch (msg.level) {\n            case WebInspector.ConsoleMessage.MessageLevel.Warning:\n                WebInspector.warnings += msg.repeatDelta;\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Error:\n                WebInspector.errors += msg.repeatDelta;\n                break;\n        }\n    },\n\n    requestClearMessages: function()\n    {\n        InspectorBackend.clearConsoleMessages();\n    },\n\n    clearMessages: function()\n    {\n        WebInspector.resourceTreeModel.clearConsoleMessages();\n        WebInspector.panels.scripts.clearConsoleMessages();\n\n        this.messages = [];\n\n        this.currentGroup = this.topGroup;\n        this.topGroup.messagesElement.removeChildren();\n\n        WebInspector.errors = 0;\n        WebInspector.warnings = 0;\n\n        delete this.commandSincePreviousMessage;\n        delete this.previousMessage;\n    },\n\n    completions: function(wordRange, bestMatchOnly, completionsReadyCallback)\n    {\n        // Pass less stop characters to rangeOfWord so the range will be a more complete expression.\n        var expressionRange = wordRange.startContainer.rangeOfWord(wordRange.startOffset, ExpressionStopCharacters, this.promptElement, \"backward\");\n        var expressionString = expressionRange.toString();\n        var lastIndex = expressionString.length - 1;\n\n        var dotNotation = (expressionString[lastIndex] === \".\");\n        var bracketNotation = (expressionString[lastIndex] === \"[\");\n\n        if (dotNotation || bracketNotation)\n            expressionString = expressionString.substr(0, lastIndex);\n\n        var prefix = wordRange.toString();\n        if (!expressionString && !prefix)\n            return;\n\n        var reportCompletions = this._reportCompletions.bind(this, bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix);\n        // Collect comma separated object properties for the completion.\n\n        var includeCommandLineAPI = (!dotNotation && !bracketNotation);\n        var injectedScriptAccess;\n        if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused)\n            InspectorBackend.getCompletionsOnCallFrame(WebInspector.panels.scripts.selectedCallFrameId(), expressionString, includeCommandLineAPI, reportCompletions);\n        else\n            InspectorBackend.getCompletions(expressionString, includeCommandLineAPI, reportCompletions);\n    },\n\n    _reportCompletions: function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, result, isException) {\n        if (isException)\n            return;\n\n        if (bracketNotation) {\n            if (prefix.length && prefix[0] === \"'\")\n                var quoteUsed = \"'\";\n            else\n                var quoteUsed = \"\\\"\";\n        }\n\n        var results = [];\n        var properties = Object.keys(result).sort();\n\n        for (var i = 0; i < properties.length; ++i) {\n            var property = properties[i];\n\n            if (dotNotation && !/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(property))\n                continue;\n\n            if (bracketNotation) {\n                if (!/^[0-9]+$/.test(property))\n                    property = quoteUsed + property.escapeCharacters(quoteUsed + \"\\\\\") + quoteUsed;\n                property += \"]\";\n            }\n\n            if (property.length < prefix.length)\n                continue;\n            if (property.indexOf(prefix) !== 0)\n                continue;\n\n            results.push(property);\n            if (bestMatchOnly)\n                break;\n        }\n        completionsReadyCallback(results);\n    },\n\n    _clearButtonClicked: function()\n    {\n        this.requestClearMessages();\n    },\n\n    _handleContextMenuEvent: function(event)\n    {\n        if (!window.getSelection().isCollapsed) {\n            // If there is a selection, we want to show our normal context menu\n            // (with Copy, etc.), and not Clear Console.\n            return;\n        }\n\n        var itemAction = function () {\n            WebInspector.settings.monitoringXHREnabled = !WebInspector.settings.monitoringXHREnabled;\n            InspectorBackend.setMonitoringXHREnabled(WebInspector.settings.monitoringXHREnabled);\n        }.bind(this);\n        var contextMenu = new WebInspector.ContextMenu();\n        contextMenu.appendCheckboxItem(WebInspector.UIString(\"XMLHttpRequest logging\"), itemAction, WebInspector.settings.monitoringXHREnabled)\n        contextMenu.appendItem(WebInspector.UIString(\"Clear Console\"), this.requestClearMessages.bind(this));\n        contextMenu.show(event);\n    },\n\n    _messagesSelectStart: function(event)\n    {\n        if (this._selectionTimeout)\n            clearTimeout(this._selectionTimeout);\n\n        this.prompt.clearAutoComplete();\n\n        function moveBackIfOutside()\n        {\n            delete this._selectionTimeout;\n            if (!this.prompt.isCaretInsidePrompt() && window.getSelection().isCollapsed)\n                this.prompt.moveCaretToEndOfPrompt();\n            this.prompt.autoCompleteSoon();\n        }\n\n        this._selectionTimeout = setTimeout(moveBackIfOutside.bind(this), 100);\n    },\n\n    _messagesClicked: function(event)\n    {\n        var link = event.target.enclosingNodeOrSelfWithNodeName(\"a\");\n        if (!link || !link.representedNode)\n            return;\n\n        WebInspector.updateFocusedNode(link.representedNode.id);\n        event.stopPropagation();\n        event.preventDefault();\n    },\n\n    _registerShortcuts: function()\n    {\n        this._shortcuts = {};\n\n        var shortcut = WebInspector.KeyboardShortcut;\n        var shortcutK = shortcut.makeDescriptor(\"k\", WebInspector.KeyboardShortcut.Modifiers.Meta);\n        // This case requires a separate bound function as its isMacOnly property should not be shared among different shortcut handlers.\n        this._shortcuts[shortcutK.key] = this.requestClearMessages.bind(this);\n        this._shortcuts[shortcutK.key].isMacOnly = true;\n\n        var clearConsoleHandler = this.requestClearMessages.bind(this);\n        var shortcutL = shortcut.makeDescriptor(\"l\", WebInspector.KeyboardShortcut.Modifiers.Ctrl);\n        this._shortcuts[shortcutL.key] = clearConsoleHandler;\n\n        var section = WebInspector.shortcutsHelp.section(WebInspector.UIString(\"Console\"));\n        var keys = WebInspector.isMac() ? [ shortcutK.name, shortcutL.name ] : [ shortcutL.name ];\n        section.addAlternateKeys(keys, WebInspector.UIString(\"Clear Console\"));\n\n        keys = [\n            shortcut.shortcutToString(shortcut.Keys.Tab),\n            shortcut.shortcutToString(shortcut.Keys.Tab, shortcut.Modifiers.Shift)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Next/previous suggestion\"));\n        section.addKey(shortcut.shortcutToString(shortcut.Keys.Right), WebInspector.UIString(\"Accept suggestion\"));\n        keys = [\n            shortcut.shortcutToString(shortcut.Keys.Down),\n            shortcut.shortcutToString(shortcut.Keys.Up)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Next/previous line\"));\n        keys = [\n            shortcut.shortcutToString(\"N\", shortcut.Modifiers.Alt),\n            shortcut.shortcutToString(\"P\", shortcut.Modifiers.Alt)\n        ];\n        if (WebInspector.isMac())\n            section.addRelatedKeys(keys, WebInspector.UIString(\"Next/previous command\"));\n        section.addKey(shortcut.shortcutToString(shortcut.Keys.Enter), WebInspector.UIString(\"Execute command\"));\n    },\n\n    _promptKeyDown: function(event)\n    {\n        if (isEnterKey(event)) {\n            this._enterKeyPressed(event);\n            return;\n        }\n\n        var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event);\n        var handler = this._shortcuts[shortcut];\n        if (handler) {\n            if (!this._shortcuts[shortcut].isMacOnly || WebInspector.isMac()) {\n                handler();\n                event.preventDefault();\n                return;\n            }\n        }\n    },\n\n    evalInInspectedWindow: function(expression, objectGroup, includeCommandLineAPI, callback)\n    {\n        if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) {\n            WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, objectGroup, includeCommandLineAPI, callback);\n            return;\n        }\n\n        if (!expression) {\n            // There is no expression, so the completion should happen against global properties.\n            expression = \"this\";\n        }\n\n        function evalCallback(result)\n        {\n            callback(WebInspector.RemoteObject.fromPayload(result));\n        }\n        InspectorBackend.evaluate(expression, objectGroup, includeCommandLineAPI, evalCallback);\n    },\n\n    _enterKeyPressed: function(event)\n    {\n        if (event.altKey || event.ctrlKey || event.shiftKey)\n            return;\n\n        event.preventDefault();\n        event.stopPropagation();\n\n        this.prompt.clearAutoComplete(true);\n\n        var str = this.prompt.text;\n        if (!str.length)\n            return;\n\n        var commandMessage = new WebInspector.ConsoleCommand(str);\n        this.addMessage(commandMessage);\n\n        var self = this;\n        function printResult(result)\n        {\n            self.prompt.history.push(str);\n            self.prompt.historyOffset = 0;\n            self.prompt.text = \"\";\n\n            WebInspector.settings.consoleHistory = self.prompt.history.slice(-30);\n\n            self.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));\n        }\n        this.evalInInspectedWindow(str, \"console\", true, printResult);\n    },\n\n    _format: function(output, forceObjectFormat)\n    {\n        var isProxy = (output != null && typeof output === \"object\");\n        var type = (forceObjectFormat ? \"object\" : WebInspector.RemoteObject.type(output));\n\n        var formatter = this._customFormatters[type];\n        if (!formatter || !isProxy) {\n            formatter = this._formatvalue;\n            output = output.description;\n        }\n\n        var span = document.createElement(\"span\");\n        span.className = \"console-formatted-\" + type + \" source-code\";\n        formatter.call(this, output, span);\n        return span;\n    },\n\n    _formatvalue: function(val, elem)\n    {\n        elem.appendChild(document.createTextNode(val));\n    },\n\n    _formatobject: function(obj, elem)\n    {\n        elem.appendChild(new WebInspector.ObjectPropertiesSection(obj, obj.description, null, true).element);\n    },\n\n    _formatnode: function(object, elem)\n    {\n        function printNode(nodeId)\n        {\n            if (!nodeId) {\n                // Sometimes DOM is loaded after the sync message is being formatted, so we get no\n                // nodeId here. So we fall back to object formatting here.\n                this._formatobject(object, elem);\n                return;\n            }\n            var treeOutline = new WebInspector.ElementsTreeOutline();\n            treeOutline.showInElementsPanelEnabled = true;\n            treeOutline.rootDOMNode = WebInspector.domAgent.nodeForId(nodeId);\n            treeOutline.element.addStyleClass(\"outline-disclosure\");\n            if (!treeOutline.children[0].hasChildren)\n                treeOutline.element.addStyleClass(\"single-node\");\n            elem.appendChild(treeOutline.element);\n        }\n        object.pushNodeToFrontend(printNode.bind(this));\n    },\n\n    _formatarray: function(arr, elem)\n    {\n        arr.getOwnProperties(false, this._printArray.bind(this, elem));\n    },\n\n    _formatstring: function(output, elem)\n    {\n        var span = document.createElement(\"span\");\n        span.className = \"console-formatted-string source-code\";\n        span.appendChild(WebInspector.linkifyStringAsFragment(output.description));\n\n        // Make black quotes.\n        elem.removeStyleClass(\"console-formatted-string\");\n        elem.appendChild(document.createTextNode(\"\\\"\"));\n        elem.appendChild(span);\n        elem.appendChild(document.createTextNode(\"\\\"\"));\n    },\n\n    _printArray: function(elem, properties)\n    {\n        if (!properties)\n            return;\n\n        var elements = [];\n        for (var i = 0; i < properties.length; ++i) {\n            var name = properties[i].name;\n            if (name == parseInt(name))\n                elements[name] = this._formatAsArrayEntry(properties[i].value);\n        }\n\n        elem.appendChild(document.createTextNode(\"[\"));\n        for (var i = 0; i < elements.length; ++i) {\n            var element = elements[i];\n            if (element)\n                elem.appendChild(element);\n            else\n                elem.appendChild(document.createTextNode(\"undefined\"))\n            if (i < elements.length - 1)\n                elem.appendChild(document.createTextNode(\", \"));\n        }\n        elem.appendChild(document.createTextNode(\"]\"));\n    },\n\n    _formatAsArrayEntry: function(output)\n    {\n        // Prevent infinite expansion of cross-referencing arrays.\n        return this._format(output, WebInspector.RemoteObject.type(output) === \"array\");\n    }\n}\n\nWebInspector.ConsoleView.prototype.__proto__ = WebInspector.View.prototype;\n\nWebInspector.ConsoleMessage = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, requestId)\n{\n    this.source = source;\n    this.type = type;\n    this.level = level;\n    this.line = line;\n    this.url = url;\n    this.repeatCount = repeatCount;\n    this.repeatDelta = repeatCount;\n    this.totalRepeatCount = repeatCount;\n    this._messageText = message;\n    this._parameters = parameters;\n    this._stackTrace = stackTrace;\n    this._requestId = requestId;\n\n    if (stackTrace && stackTrace.length) {\n        var topCallFrame = stackTrace[0];\n        if (!this.url)\n            this.url = topCallFrame.scriptName;\n        if (!this.line)\n            this.line = topCallFrame.lineNumber;\n    }\n\n    this._formatMessage();\n}\n\nWebInspector.ConsoleMessage.createTextMessage = function(text, level)\n{\n    level = level || WebInspector.ConsoleMessage.MessageLevel.Log;\n    return new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Log, level, 0, null, 1, null, [text], null);\n}\n\nWebInspector.ConsoleMessage.prototype = {\n    _formatMessage: function()\n    {\n        var stackTrace = this._stackTrace;\n        var messageText;\n        switch (this.type) {\n            case WebInspector.ConsoleMessage.MessageType.Trace:\n                messageText = document.createTextNode(\"console.trace()\");\n                break;\n            case WebInspector.ConsoleMessage.MessageType.UncaughtException:\n                messageText = document.createTextNode(this._messageText);\n                break;\n            case WebInspector.ConsoleMessage.MessageType.NetworkError:\n                var resource = this._requestId && WebInspector.networkResourceById(this._requestId);\n                if (resource) {\n                    stackTrace = resource.stackTrace;\n\n                    messageText = document.createElement(\"span\");\n                    messageText.appendChild(document.createTextNode(resource.requestMethod + \" \"));\n                    messageText.appendChild(WebInspector.linkifyURLAsNode(resource.url));\n                    if (resource.failed)\n                        messageText.appendChild(document.createTextNode(\" \" + resource.localizedFailDescription));\n                    else\n                        messageText.appendChild(document.createTextNode(\" \" + resource.statusCode + \" (\" + resource.statusText + \")\"));\n                } else\n                    messageText = this._format([this._messageText]);\n                break;\n            case WebInspector.ConsoleMessage.MessageType.Assert:\n                var args = [WebInspector.UIString(\"Assertion failed:\")];\n                if (this._parameters)\n                    args = args.concat(this._parameters);\n                messageText = this._format(args);\n                break;\n            case WebInspector.ConsoleMessage.MessageType.Object:\n                var obj = this._parameters ? this._parameters[0] : undefined;\n                var args = [\"%O\", obj];\n                messageText = this._format(args);\n                break;\n            default:\n                var args = this._parameters || [this._messageText];\n                messageText = this._format(args);\n                break;\n        }\n\n        this._formattedMessage = document.createElement(\"span\");\n        this._formattedMessage.className = \"console-message-text source-code\";\n\n        if (this.url && this.url !== \"undefined\") {\n            var urlElement = WebInspector.linkifyResourceAsNode(this.url, \"scripts\", this.line, \"console-message-url\");\n            this._formattedMessage.appendChild(urlElement);\n        }\n\n        this._formattedMessage.appendChild(messageText);\n\n        if (this._stackTrace) {\n            switch (this.type) {\n                case WebInspector.ConsoleMessage.MessageType.Trace:\n                case WebInspector.ConsoleMessage.MessageType.UncaughtException:\n                case WebInspector.ConsoleMessage.MessageType.NetworkError:\n                case WebInspector.ConsoleMessage.MessageType.Assert: {\n                    var ol = document.createElement(\"ol\");\n                    ol.className = \"outline-disclosure\";\n                    var treeOutline = new TreeOutline(ol);\n\n                    var content = this._formattedMessage;\n                    var root = new TreeElement(content, null, true);\n                    content.treeElementForTest = root;\n                    treeOutline.appendChild(root);\n                    if (this.type === WebInspector.ConsoleMessage.MessageType.Trace)\n                        root.expand();\n\n                    this._populateStackTraceTreeElement(root);\n                    this._formattedMessage = ol;\n                }\n            }\n        }\n\n        // This is used for inline message bubbles in SourceFrames, or other plain-text representations.\n        this.message = this._formattedMessage.textContent;\n    },\n\n    isErrorOrWarning: function()\n    {\n        return (this.level === WebInspector.ConsoleMessage.MessageLevel.Warning || this.level === WebInspector.ConsoleMessage.MessageLevel.Error);\n    },\n\n    _format: function(parameters)\n    {\n        // This node is used like a Builder. Values are continually appended onto it.\n        var formattedResult = document.createElement(\"span\");\n        if (!parameters.length)\n            return formattedResult;\n\n        // Formatting code below assumes that parameters are all wrappers whereas frontend console\n        // API allows passing arbitrary values as messages (strings, numbers, etc.). Wrap them here.\n        for (var i = 0; i < parameters.length; ++i) {\n            if (typeof parameters[i] === \"object\")\n                parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]);\n            else\n                parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]);\n        }\n\n        // There can be string log and string eval result. We distinguish between them based on message type.\n        var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === \"string\" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;\n\n        // Multiple parameters with the first being a format string. Save unused substitutions.\n        if (shouldFormatMessage) {\n            // Multiple parameters with the first being a format string. Save unused substitutions.\n            var result = this._formatWithSubstitutionString(parameters, formattedResult);\n            parameters = result.unusedSubstitutions;\n            if (parameters.length)\n                formattedResult.appendChild(document.createTextNode(\" \"));\n        }\n\n        // Single parameter, or unused substitutions from above.\n        for (var i = 0; i < parameters.length; ++i) {\n            // Inline strings when formatting.\n            if (shouldFormatMessage && parameters[i].type === \"string\")\n                formattedResult.appendChild(document.createTextNode(parameters[i].description));\n            else\n                formattedResult.appendChild(WebInspector.console._format(parameters[i]));\n            if (i < parameters.length - 1)\n                formattedResult.appendChild(document.createTextNode(\" \"));\n        }\n        return formattedResult;\n    },\n\n    _formatWithSubstitutionString: function(parameters, formattedResult)\n    {\n        var formatters = {}\n        for (var i in String.standardFormatters)\n            formatters[i] = String.standardFormatters[i];\n\n        function consoleFormatWrapper(force)\n        {\n            return function(obj) {\n                return WebInspector.console._format(obj, force);\n            };\n        }\n\n        // Firebug uses %o for formatting objects.\n        formatters.o = consoleFormatWrapper();\n        // Firebug allows both %i and %d for formatting integers.\n        formatters.i = formatters.d;\n        // Support %O to force object formatting, instead of the type-based %o formatting.\n        formatters.O = consoleFormatWrapper(true);\n\n        function append(a, b)\n        {\n            if (!(b instanceof Node))\n                a.appendChild(WebInspector.linkifyStringAsFragment(b.toString()));\n            else\n                a.appendChild(b);\n            return a;\n        }\n\n        // String.format does treat formattedResult like a Builder, result is an object.\n        return String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);\n    },\n\n    toMessageElement: function()\n    {\n        if (this._element)\n            return this._element;\n\n        var element = document.createElement(\"div\");\n        element.message = this;\n        element.className = \"console-message\";\n\n        this._element = element;\n\n        switch (this.level) {\n            case WebInspector.ConsoleMessage.MessageLevel.Tip:\n                element.addStyleClass(\"console-tip-level\");\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Log:\n                element.addStyleClass(\"console-log-level\");\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Debug:\n                element.addStyleClass(\"console-debug-level\");\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Warning:\n                element.addStyleClass(\"console-warning-level\");\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Error:\n                element.addStyleClass(\"console-error-level\");\n                break;\n        }\n\n        if (this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)\n            element.addStyleClass(\"console-group-title\");\n\n        if (this.elementsTreeOutline) {\n            element.addStyleClass(\"outline-disclosure\");\n            element.appendChild(this.elementsTreeOutline.element);\n            return element;\n        }\n\n        element.appendChild(this._formattedMessage);\n\n        if (this.repeatCount > 1)\n            this._updateRepeatCount();\n\n        return element;\n    },\n\n    _populateStackTraceTreeElement: function(parentTreeElement)\n    {\n        for (var i = 0; i < this._stackTrace.length; i++) {\n            var frame = this._stackTrace[i];\n\n            var content = document.createElement(\"div\");\n            var messageTextElement = document.createElement(\"span\");\n            messageTextElement.className = \"console-message-text source-code\";\n            var functionName = frame.functionName || WebInspector.UIString(\"(anonymous function)\");\n            messageTextElement.appendChild(document.createTextNode(functionName));\n            content.appendChild(messageTextElement);\n\n            var urlElement = WebInspector.linkifyResourceAsNode(frame.scriptName, \"scripts\", frame.lineNumber, \"console-message-url\");\n            content.appendChild(urlElement);\n\n            var treeElement = new TreeElement(content);\n            parentTreeElement.appendChild(treeElement);\n        }\n    },\n\n    _updateRepeatCount: function() {\n        if (!this.repeatCountElement) {\n            this.repeatCountElement = document.createElement(\"span\");\n            this.repeatCountElement.className = \"bubble\";\n\n            this._element.insertBefore(this.repeatCountElement, this._element.firstChild);\n            this._element.addStyleClass(\"repeated-message\");\n        }\n        this.repeatCountElement.textContent = this.repeatCount;\n    },\n\n    toString: function()\n    {\n        var sourceString;\n        switch (this.source) {\n            case WebInspector.ConsoleMessage.MessageSource.HTML:\n                sourceString = \"HTML\";\n                break;\n            case WebInspector.ConsoleMessage.MessageSource.WML:\n                sourceString = \"WML\";\n                break;\n            case WebInspector.ConsoleMessage.MessageSource.XML:\n                sourceString = \"XML\";\n                break;\n            case WebInspector.ConsoleMessage.MessageSource.JS:\n                sourceString = \"JS\";\n                break;\n            case WebInspector.ConsoleMessage.MessageSource.CSS:\n                sourceString = \"CSS\";\n                break;\n            case WebInspector.ConsoleMessage.MessageSource.Other:\n                sourceString = \"Other\";\n                break;\n        }\n\n        var typeString;\n        switch (this.type) {\n            case WebInspector.ConsoleMessage.MessageType.Log:\n            case WebInspector.ConsoleMessage.MessageType.UncaughtException:\n            case WebInspector.ConsoleMessage.MessageType.NetworkError:\n                typeString = \"Log\";\n                break;\n            case WebInspector.ConsoleMessage.MessageType.Object:\n                typeString = \"Object\";\n                break;\n            case WebInspector.ConsoleMessage.MessageType.Trace:\n                typeString = \"Trace\";\n                break;\n            case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:\n            case WebInspector.ConsoleMessage.MessageType.StartGroup:\n                typeString = \"Start Group\";\n                break;\n            case WebInspector.ConsoleMessage.MessageType.EndGroup:\n                typeString = \"End Group\";\n                break;\n            case WebInspector.ConsoleMessage.MessageType.Assert:\n                typeString = \"Assert\";\n                break;\n            case WebInspector.ConsoleMessage.MessageType.Result:\n                typeString = \"Result\";\n                break;\n        }\n\n        var levelString;\n        switch (this.level) {\n            case WebInspector.ConsoleMessage.MessageLevel.Tip:\n                levelString = \"Tip\";\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Log:\n                levelString = \"Log\";\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Warning:\n                levelString = \"Warning\";\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Debug:\n                levelString = \"Debug\";\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Error:\n                levelString = \"Error\";\n                break;\n        }\n\n        return sourceString + \" \" + typeString + \" \" + levelString + \": \" + this._formattedMessage.textContent + \"\\n\" + this.url + \" line \" + this.line;\n    },\n\n    isEqual: function(msg)\n    {\n        if (!msg)\n            return false;\n\n        if (this._stackTrace) {\n            if (!msg._stackTrace)\n                return false;\n            var l = this._stackTrace;\n            var r = msg._stackTrace;\n            for (var i = 0; i < l.length; i++) {\n                if (l[i].scriptName !== r[i].scriptName ||\n                    l[i].functionName !== r[i].functionName ||\n                    l[i].lineNumber !== r[i].lineNumber ||\n                    l[i].column !== r[i].column)\n                    return false;\n            }\n        }\n\n        return (this.source === msg.source)\n            && (this.type === msg.type)\n            && (this.level === msg.level)\n            && (this.line === msg.line)\n            && (this.url === msg.url)\n            && (this.message === msg.message)\n            && (this._requestId === msg._requestId);\n    }\n}\n\n// Note: Keep these constants in sync with the ones in Console.h\nWebInspector.ConsoleMessage.MessageSource = {\n    HTML: 0,\n    WML: 1,\n    XML: 2,\n    JS: 3,\n    CSS: 4,\n    Other: 5\n}\n\nWebInspector.ConsoleMessage.MessageType = {\n    Log: 0,\n    Object: 1,\n    Trace: 2,\n    StartGroup: 3,\n    StartGroupCollapsed: 4,\n    EndGroup: 5,\n    Assert: 6,\n    UncaughtException: 7,\n    NetworkError:8,\n    Result: 9\n}\n\nWebInspector.ConsoleMessage.MessageLevel = {\n    Tip: 0,\n    Log: 1,\n    Warning: 2,\n    Error: 3,\n    Debug: 4\n}\n\nWebInspector.ConsoleCommand = function(command)\n{\n    this.command = command;\n}\n\nWebInspector.ConsoleCommand.prototype = {\n    toMessageElement: function()\n    {\n        var element = document.createElement(\"div\");\n        element.command = this;\n        element.className = \"console-user-command\";\n\n        var commandTextElement = document.createElement(\"span\");\n        commandTextElement.className = \"console-message-text source-code\";\n        commandTextElement.textContent = this.command;\n        element.appendChild(commandTextElement);\n\n        return element;\n    }\n}\n\nWebInspector.ConsoleCommandResult = function(result, originatingCommand)\n{\n    var level = (result.isError() ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);\n    this.originatingCommand = originatingCommand;\n    WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, 1, null, [result]);\n}\n\nWebInspector.ConsoleCommandResult.prototype = {\n    toMessageElement: function()\n    {\n        var element = WebInspector.ConsoleMessage.prototype.toMessageElement.call(this);\n        element.addStyleClass(\"console-user-command-result\");\n        return element;\n    }\n}\n\nWebInspector.ConsoleCommandResult.prototype.__proto__ = WebInspector.ConsoleMessage.prototype;\n\nWebInspector.ConsoleGroup = function(parentGroup)\n{\n    this.parentGroup = parentGroup;\n\n    var element = document.createElement(\"div\");\n    element.className = \"console-group\";\n    element.group = this;\n    this.element = element;\n\n    var messagesElement = document.createElement(\"div\");\n    messagesElement.className = \"console-group-messages\";\n    element.appendChild(messagesElement);\n    this.messagesElement = messagesElement;\n}\n\nWebInspector.ConsoleGroup.prototype = {\n    addMessage: function(msg)\n    {\n        var element = msg.toMessageElement();\n\n        if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {\n            this.messagesElement.parentNode.insertBefore(element, this.messagesElement);\n            element.addEventListener(\"click\", this._titleClicked.bind(this), false);\n            var groupElement = element.enclosingNodeOrSelfWithClass(\"console-group\");\n            if (groupElement && msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)\n                groupElement.addStyleClass(\"collapsed\");\n        } else\n            this.messagesElement.appendChild(element);\n\n        if (element.previousSibling && msg.originatingCommand && element.previousSibling.command === msg.originatingCommand)\n            element.previousSibling.addStyleClass(\"console-adjacent-user-command-result\");\n    },\n\n    _titleClicked: function(event)\n    {\n        var groupTitleElement = event.target.enclosingNodeOrSelfWithClass(\"console-group-title\");\n        if (groupTitleElement) {\n            var groupElement = groupTitleElement.enclosingNodeOrSelfWithClass(\"console-group\");\n            if (groupElement)\n                if (groupElement.hasStyleClass(\"collapsed\"))\n                    groupElement.removeStyleClass(\"collapsed\");\n                else\n                    groupElement.addStyleClass(\"collapsed\");\n            groupTitleElement.scrollIntoViewIfNeeded(true);\n        }\n\n        event.stopPropagation();\n        event.preventDefault();\n    }\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ContextMenu.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ContextMenu = function() {\n    this._items = [];\n    this._handlers = {};\n}\n\nWebInspector.ContextMenu.prototype = {\n    show: function(event)\n    {\n        // Remove trailing separator.\n        while (this._items.length > 0 && !(\"id\" in this._items[this._items.length - 1]))\n            this._items.splice(this._items.length - 1, 1);\n\n        if (this._items.length) {\n            WebInspector._contextMenu = this;\n            InspectorFrontendHost.showContextMenu(event, this._items);\n        }\n        event.stopPropagation();\n    },\n\n    appendItem: function(label, handler, disabled)\n    {\n        var id = this._items.length;\n        this._items.push({type: \"item\", id: id, label: label, enabled: !disabled});\n        this._handlers[id] = handler;\n    },\n\n    appendCheckboxItem: function(label, handler, checked, disabled)\n    {\n        var id = this._items.length;\n        this._items.push({type: \"checkbox\", id: id, label: label, checked: !!checked, enabled: !disabled});\n        this._handlers[id] = handler;\n    },\n\n    appendSeparator: function()\n    {\n        // No separator dupes allowed.\n        if (this._items.length === 0)\n            return;\n        if (!(\"id\" in this._items[this._items.length - 1]))\n            return;\n        this._items.push({type: \"separator\"});\n    },\n\n    _itemSelected: function(id)\n    {\n        if (this._handlers[id])\n            this._handlers[id].call(this);\n    }\n}\n\nWebInspector.contextMenuItemSelected = function(id)\n{\n    if (WebInspector._contextMenu)\n        WebInspector._contextMenu._itemSelected(id);\n}\n\nWebInspector.contextMenuCleared = function()\n{\n    // FIXME: Unfortunately, contextMenuCleared is invoked between show and item selected\n    // so we can't delete last menu object from WebInspector. Fix the contract.\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/CookieItemsView.js",
    "content": "/*\n * Copyright (C) 2009 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.CookieItemsView = function(treeElement, cookieDomain)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"storage-view\");\n\n    this._deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Delete\"), \"delete-storage-status-bar-item\");\n    this._deleteButton.visible = false;\n    this._deleteButton.addEventListener(\"click\", this._deleteButtonClicked.bind(this), false);\n\n    this._refreshButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Refresh\"), \"refresh-storage-status-bar-item\");\n    this._refreshButton.addEventListener(\"click\", this._refreshButtonClicked.bind(this), false);\n\n    this._treeElement = treeElement;\n    this._cookieDomain = cookieDomain;\n\n    this._emptyMsgElement = document.createElement(\"div\");\n    this._emptyMsgElement.className = \"storage-empty-view\";\n    this._emptyMsgElement.textContent = WebInspector.UIString(\"This site has no cookies.\");\n    this.element.appendChild(this._emptyMsgElement);\n}\n\nWebInspector.CookieItemsView.prototype = {\n    get statusBarItems()\n    {\n        return [this._refreshButton.element, this._deleteButton.element];\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this._update();\n    },\n\n    hide: function()\n    {\n        WebInspector.View.prototype.hide.call(this);\n        this._deleteButton.visible = false;\n    },\n\n    resize: function()\n    {\n        if (this._cookiesTable)\n            this._cookiesTable.updateWidths();\n    },\n\n    _update: function()\n    {\n        WebInspector.Cookies.getCookiesAsync(this._updateWithCookies.bind(this));\n    },\n\n    _updateWithCookies: function(allCookies, isAdvanced)\n    {\n        this._cookies = isAdvanced ? this._filterCookiesForDomain(allCookies) : allCookies;\n\n        if (!this._cookies.length) {\n            // Nothing to show.\n            this._emptyMsgElement.removeStyleClass(\"hidden\");\n            this._deleteButton.visible = false;\n            if (this._cookiesTable)\n                this._cookiesTable.element.addStyleClass(\"hidden\");\n            return;\n        }\n\n        if (!this._cookiesTable) {\n            this._cookiesTable = isAdvanced ? new WebInspector.CookiesTable(this._cookieDomain, false, this._deleteCookie.bind(this)) : new WebInspector.SimpleCookiesTable();\n            this.element.appendChild(this._cookiesTable.element);\n        }\n\n        this._cookiesTable.setCookies(this._cookies);\n        this._cookiesTable.element.removeStyleClass(\"hidden\");\n        this._emptyMsgElement.addStyleClass(\"hidden\");\n        if (isAdvanced) {\n            this._treeElement.subtitle = String.sprintf(WebInspector.UIString(\"%d cookies (%s)\"), this._cookies.length,\n                Number.bytesToString(this._totalSize));\n            this._deleteButton.visible = true;\n        }\n        this._cookiesTable.updateWidths();\n    },\n\n    _filterCookiesForDomain: function(allCookies)\n    {\n        var cookies = [];\n        var resourceURLsForDocumentURL = [];\n        this._totalSize = 0;\n\n        function populateResourcesForDocuments(resource)\n        {\n            var url = resource.documentURL.asParsedURL();\n            if (url && url.host == this._cookieDomain)\n                resourceURLsForDocumentURL.push(resource.url);\n        }\n        WebInspector.forAllResources(populateResourcesForDocuments.bind(this));\n\n        for (var i = 0; i < allCookies.length; ++i) {\n            var pushed = false;\n            var size = allCookies[i].size;\n            for (var j = 0; j < resourceURLsForDocumentURL.length; ++j) {\n                var resourceURL = resourceURLsForDocumentURL[j];\n                if (WebInspector.Cookies.cookieMatchesResourceURL(allCookies[i], resourceURL)) {\n                    this._totalSize += size;\n                    if (!pushed) {\n                        pushed = true;\n                        cookies.push(allCookies[i]);\n                    }\n                }\n            }\n        }\n        return cookies;\n    },\n\n    _deleteCookie: function(cookie)\n    {\n        InspectorBackend.deleteCookie(cookie.name, this._cookieDomain);\n        this._update();\n    },\n\n    _deleteButtonClicked: function()\n    {\n        if (this._cookiesTable.selectedCookie)\n            this._deleteCookie(this._cookiesTable.selectedCookie);\n    },\n\n    _refreshButtonClicked: function(event)\n    {\n        this._update();\n    }\n}\n\nWebInspector.CookieItemsView.prototype.__proto__ = WebInspector.View.prototype;\n\nWebInspector.SimpleCookiesTable = function()\n{\n    this.element = document.createElement(\"div\");\n    var columns = {};\n    columns[0] = {};\n    columns[1] = {};\n    columns[0].title = WebInspector.UIString(\"Name\");\n    columns[1].title = WebInspector.UIString(\"Value\");\n\n    this._dataGrid = new WebInspector.DataGrid(columns);\n    this._dataGrid.autoSizeColumns(20, 80);\n    this.element.appendChild(this._dataGrid.element);\n    this._dataGrid.updateWidths();\n}\n\nWebInspector.SimpleCookiesTable.prototype = {\n    setCookies: function(cookies)\n    {\n        this._dataGrid.removeChildren();\n        var addedCookies = {};\n        for (var i = 0; i < cookies.length; ++i) {\n            if (addedCookies[cookies[i].name])\n                continue;\n            addedCookies[cookies[i].name] = true;\n            var data = {};\n            data[0] = cookies[i].name;\n            data[1] = cookies[i].value;\n\n            var node = new WebInspector.DataGridNode(data, false);\n            node.selectable = true;\n            this._dataGrid.appendChild(node);\n        }\n        this._dataGrid.children[0].selected = true;\n    },\n\n    resize: function()\n    {\n        if (this._dataGrid)\n            this._dataGrid.updateWidths();\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/CookieParser.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Ideally, we would rely on platform support for parsing a cookie, since\n// this would save us from any potential inconsistency. However, exposing\n// platform cookie parsing logic would require quite a bit of additional \n// plumbing, and at least some platforms lack support for parsing Cookie,\n// which is in a format slightly different from Set-Cookie and is normally \n// only required on the server side.\n\nWebInspector.CookieParser = function()\n{\n}\n\nWebInspector.CookieParser.prototype = {\n    get cookies()\n    {\n        return this._cookies;\n    },\n\n    parseCookie: function(cookieHeader)\n    {\n        if (!this._initialize(cookieHeader))\n            return;\n\n        for (var kv = this._extractKeyValue(); kv; kv = this._extractKeyValue()) {\n            if (kv.key.charAt(0) === \"$\" && this._lastCookie)\n                this._lastCookie.addAttribute(kv.key.slice(1), kv.value);\n            else if (kv.key.toLowerCase() !== \"$version\" && typeof kv.value === \"string\")\n                this._addCookie(kv, WebInspector.Cookie.Type.Request);\n            this._advanceAndCheckCookieDelimiter();\n        }\n        this._flushCookie();\n        return this._cookies;\n    },\n\n    parseSetCookie: function(setCookieHeader)\n    {\n        if (!this._initialize(setCookieHeader))\n            return;\n        for (var kv = this._extractKeyValue(); kv; kv = this._extractKeyValue()) {\n            if (this._lastCookie)\n                this._lastCookie.addAttribute(kv.key, kv.value);\n            else \n                this._addCookie(kv, WebInspector.Cookie.Type.Response);\n            if (this._advanceAndCheckCookieDelimiter())\n                this._flushCookie();\n        }\n        this._flushCookie();\n        return this._cookies;\n    },\n\n    _initialize: function(headerValue)\n    {\n        this._input = headerValue;\n        if (typeof headerValue !== \"string\")\n            return false;\n        this._cookies = [];\n        this._lastCookie = null;\n        this._originalInputLength = this._input.length;\n        return true;\n    },\n\n    _flushCookie: function()\n    {\n        if (this._lastCookie)\n            this._lastCookie.size = this._originalInputLength - this._input.length - this._lastCookiePosition;\n        this._lastCookie = null;\n    },\n\n    _extractKeyValue: function()\n    {\n        if (!this._input || !this._input.length)\n            return null;\n        // Note: RFCs offer an option for quoted values that may contain commas and semicolons.\n        // Many browsers/platforms do not support this, however (see http://webkit.org/b/16699\n        // and http://crbug.com/12361). The logic below matches latest versions of IE, Firefox,\n        // Chrome and Safari on some old platforms. The latest version of Safari supports quoted\n        // cookie values, though. \n        var keyValueMatch = /^[ \\t]*([^\\s=;]+)[ \\t]*(?:=[ \\t]*([^;\\n]*))?/.exec(this._input);\n        if (!keyValueMatch) {\n            console.log(\"Failed parsing cookie header before: \" + this._input);\n            return null;\n        }\n\n        var result = {\n            key: keyValueMatch[1],\n            value: keyValueMatch[2] && keyValueMatch[2].trim(),\n            position: this._originalInputLength - this._input.length\n        };\n        this._input = this._input.slice(keyValueMatch[0].length);\n        return result;\n    },\n\n    _advanceAndCheckCookieDelimiter: function()\n    {\n        var match = /^\\s*[\\n;]\\s*/.exec(this._input);\n        if (!match)\n            return false;\n        this._input = this._input.slice(match[0].length);\n        return match[0].match(\"\\n\") !== null;\n    },\n\n    _addCookie: function(keyValue, type)\n    {\n        if (this._lastCookie)\n            this._lastCookie.size = keyValue.position - this._lastCookiePosition;\n        // Mozilla bug 169091: Mozilla, IE and Chrome treat single token (w/o \"=\") as\n        // specifying a value for a cookie with empty name.\n        this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value, type) :\n            new WebInspector.Cookie(\"\", keyValue.key, type);\n        this._lastCookiePosition = keyValue.position;\n        this._cookies.push(this._lastCookie);\n    }\n};\n\nWebInspector.CookieParser.parseCookie = function(header)\n{\n    return (new WebInspector.CookieParser()).parseCookie(header);\n}\n\nWebInspector.CookieParser.parseSetCookie = function(header)\n{\n    return (new WebInspector.CookieParser()).parseSetCookie(header);\n}\n\nWebInspector.Cookie = function(name, value, type)\n{\n    this.name = name;\n    this.value = value;\n    this.type = type;\n    this._attributes = {};\n}\n\nWebInspector.Cookie.prototype = {\n    get httpOnly()\n    {\n        return \"httponly\" in this._attributes;\n    },\n\n    get secure()\n    {\n        return \"secure\" in this._attributes;\n    },\n\n    get session()\n    {\n        // RFC 2965 suggests using Discard attribute to mark session cookies, but this does not seem to be widely used.\n        // Check for absence of explicity max-age or expiry date instead.\n        return  !(\"expries\" in this._attributes || \"max-age\" in this._attributes);\n    },\n\n    get path()\n    {\n        return this._attributes.path;\n    },\n\n    get domain()\n    {\n        return this._attributes.domain;\n    },\n\n    expires: function(requestDate)\n    {\n        return this._attributes.expires ? new Date(this._attributes.expires) :\n            (this._attributes[\"max-age\"] ? new Date(requestDate.getTime() + 1000 * this._attributes[\"max-age\"]) : null);\n    },\n\n    get attributes()\n    {\n        return this._attributes;\n    },\n\n    addAttribute: function(key, value)\n    {\n        this._attributes[key.toLowerCase()] = value;\n    }\n}\n\nWebInspector.Cookie.Type = {\n    Request: 0,\n    Response: 1\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/CookiesTable.js",
    "content": "/*\n * Copyright (C) 2009 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.CookiesTable = function(cookieDomain, expandable, deleteCallback)\n{\n    this._cookieDomain = cookieDomain;\n\n    var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };\n    columns[0].title = WebInspector.UIString(\"Name\");\n    columns[0].sortable = true;\n    columns[0].disclosure = expandable;\n    columns[0].width = \"24%\";\n    columns[1].title = WebInspector.UIString(\"Value\");\n    columns[1].sortable = true;\n    columns[1].width = \"34%\";\n    columns[2].title = WebInspector.UIString(\"Domain\");\n    columns[2].sortable = true;\n    columns[2].width = \"7%\";\n    columns[3].title = WebInspector.UIString(\"Path\");\n    columns[3].sortable = true;\n    columns[3].width = \"7%\";\n    columns[4].title = WebInspector.UIString(\"Expires\");\n    columns[4].sortable = true;\n    columns[4].width = \"7%\";\n    columns[5].title = WebInspector.UIString(\"Size\");\n    columns[5].aligned = \"right\";\n    columns[5].sortable = true;\n    columns[5].width = \"7%\";\n    columns[6].title = WebInspector.UIString(\"HTTP\");\n    columns[6].aligned = \"centered\";\n    columns[6].sortable = true;\n    columns[6].width = \"7%\";\n    columns[7].title = WebInspector.UIString(\"Secure\");\n    columns[7].aligned = \"centered\";\n    columns[7].sortable = true;\n    columns[7].width = \"7%\";\n\n    this._dataGrid = new WebInspector.DataGrid(columns, null, deleteCallback ? this._onDeleteFromGrid.bind(this) : null);\n    this._dataGrid.addEventListener(\"sorting changed\", this._rebuildTable, this);\n\n    this.element = this._dataGrid.element;\n    this._data = [];\n    this._deleteCallback = deleteCallback;\n}\n\nWebInspector.CookiesTable.prototype = {\n    updateWidths: function()\n    {\n        if (this._dataGrid)\n            this._dataGrid.updateWidths();\n    },\n\n    setCookies: function(cookies)\n    {\n        this._data = [{cookies: cookies}];\n        this._rebuildTable();\n    },\n\n    addCookiesFolder: function(folderName, cookies)\n    {\n        this._data.push({cookies: cookies, folderName: folderName});\n        this._rebuildTable();\n    },\n\n    get selectedCookie()\n    {\n        var node = this._dataGrid.selectedNode;\n        return node ? node.cookie : null;\n    },\n\n    _rebuildTable: function()\n    {\n        this._dataGrid.removeChildren();\n        for (var i = 0; i < this._data.length; ++i) {\n            var item = this._data[i];\n            if (item.folderName) {\n                var groupData = [ item.folderName, \"\", \"\", \"\", \"\", this._totalSize(item.cookies), \"\", \"\" ];\n                var groupNode = new WebInspector.DataGridNode(groupData);\n                groupNode.selectable = true;\n                this._dataGrid.appendChild(groupNode);\n                groupNode.element.addStyleClass(\"row-group\");\n                this._populateNode(groupNode, item.cookies);\n                groupNode.expand();\n            } else\n                this._populateNode(this._dataGrid, item.cookies);\n        }\n    },\n\n    _populateNode: function(parentNode, cookies)\n    {\n        var selectedCookie = this.selectedCookie;\n        parentNode.removeChildren();\n        if (!cookies)\n            return;\n\n        this._sortCookies(cookies);\n        for (var i = 0; i < cookies.length; ++i) {\n            var cookieNode = this._createGridNode(cookies[i]);\n            parentNode.appendChild(cookieNode);\n            if (selectedCookie === cookies[i])\n                cookieNode.selected = true;\n        }\n    },\n\n    _totalSize: function(cookies)\n    {\n        var totalSize = 0;\n        for (var i = 0; cookies && i < cookies.length; ++i)\n            totalSize += cookies[i].size;\n        return totalSize;\n    },\n\n    _sortCookies: function(cookies)\n    {\n        var sortDirection = this._dataGrid.sortOrder === \"ascending\" ? 1 : -1;\n\n        function localeCompare(field, cookie1, cookie2)\n        {\n            return sortDirection * (cookie1[field] + \"\").localeCompare(cookie2[field] + \"\")\n        }\n\n        function numberCompare(field, cookie1, cookie2)\n        {\n            return sortDirection * (cookie1[field] - cookie2[field]);\n        }\n\n        function expiresCompare(cookie1, cookie2)\n        {\n            if (cookie1.session !== cookie2.session)\n                return sortDirection * (cookie1.session ? 1 : -1);\n\n            if (cookie1.session)\n                return 0;\n\n            return sortDirection * (cookie1.expires - cookie2.expires);\n        }\n\n        var comparator;\n        switch (parseInt(this._dataGrid.sortColumnIdentifier)) {\n            case 0: comparator = localeCompare.bind(this, \"name\"); break;\n            case 1: comparator = localeCompare.bind(this, \"value\"); break;\n            case 2: comparator = localeCompare.bind(this, \"domain\"); break;\n            case 3: comparator = localeCompare.bind(this, \"path\"); break;\n            case 4: comparator = expiresCompare; break;\n            case 5: comparator = numberCompare.bind(this, \"size\"); break;\n            case 6: comparator = localeCompare.bind(this, \"httpOnly\"); break;\n            case 7: comparator = localeCompare.bind(this, \"secure\"); break;\n            default: localeCompare.bind(this, \"name\");\n        }\n\n        cookies.sort(comparator);\n    },\n\n    _createGridNode: function(cookie)\n    {\n        var data = {};\n        data[0] = cookie.name;\n        data[1] = cookie.value;\n        data[2] = cookie.domain || \"\";\n        data[3] = cookie.path || \"\";\n        data[4] = cookie.type === WebInspector.Cookie.Type.Request ? \"\" :\n            (cookie.session ? WebInspector.UIString(\"Session\") : new Date(cookie.expires).toGMTString());\n        data[5] = cookie.size;\n        var checkmark = \"\\u2713\";\n        data[6] = (cookie.httpOnly ? checkmark : \"\");\n        data[7] = (cookie.secure ? checkmark : \"\");\n\n        var node = new WebInspector.DataGridNode(data);\n        node.cookie = cookie;\n        node.selectable = true;\n        return node;\n    },\n\n    _onDeleteFromGrid: function(node)\n    {\n        this._deleteCallback(node.cookie);\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DOMAgent.js",
    "content": "/*\n * Copyright (C) 2009, 2010 Google Inc. All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DOMNode = function(doc, payload) {\n    this.ownerDocument = doc;\n\n    this.id = payload.id;\n    this.nodeType = payload.nodeType;\n    this.nodeName = payload.nodeName;\n    this.localName = payload.localName;\n    this._nodeValue = payload.nodeValue;\n    this.textContent = this.nodeValue;\n\n    this.attributes = [];\n    this._attributesMap = {};\n    if (payload.attributes)\n        this._setAttributesPayload(payload.attributes);\n\n    this._childNodeCount = payload.childNodeCount;\n    this.children = null;\n\n    this.nextSibling = null;\n    this.prevSibling = null;\n    this.firstChild = null;\n    this.lastChild = null;\n    this.parentNode = null;\n\n    if (payload.children)\n        this._setChildrenPayload(payload.children);\n\n    this._computedStyle = null;\n    this.style = null;\n    this._matchedCSSRules = [];\n\n    this.breakpoints = {};\n\n    if (this.nodeType === Node.ELEMENT_NODE) {\n        // HTML and BODY from internal iframes should not overwrite top-level ones.\n        if (!this.ownerDocument.documentElement && this.nodeName === \"HTML\")\n            this.ownerDocument.documentElement = this;\n        if (!this.ownerDocument.body && this.nodeName === \"BODY\")\n            this.ownerDocument.body = this;\n        if (payload.documentURL)\n            this.documentURL = payload.documentURL;\n    } else if (this.nodeType === Node.DOCUMENT_TYPE_NODE) {\n        this.publicId = payload.publicId;\n        this.systemId = payload.systemId;\n        this.internalSubset = payload.internalSubset;\n    } else if (this.nodeType === Node.DOCUMENT_NODE) {\n        this.documentURL = payload.documentURL;\n    } else if (this.nodeType === Node.ATTRIBUTE_NODE) {\n        this.name = payload.name;\n        this.value = payload.value;\n    }\n}\n\nWebInspector.DOMNode.prototype = {\n    hasAttributes: function()\n    {\n        return this.attributes.length > 0;\n    },\n\n    hasChildNodes: function()\n    {\n        return this._childNodeCount > 0;\n    },\n\n    get nodeValue() {\n        return this._nodeValue;\n    },\n\n    set nodeValue(value) {\n        if (this.nodeType != Node.TEXT_NODE)\n            return;\n        this.ownerDocument._domAgent.setTextNodeValueAsync(this, value, function() {});\n    },\n\n    getAttribute: function(name)\n    {\n        var attr = this._attributesMap[name];\n        return attr ? attr.value : undefined;\n    },\n\n    setAttribute: function(name, value)\n    {\n        var self = this;\n        var callback = function()\n        {\n            var attr = self._attributesMap[name];\n            if (attr)\n                attr.value = value;\n            else\n                attr = self._addAttribute(name, value);\n        };\n        this.ownerDocument._domAgent.setAttributeAsync(this, name, value, callback);\n    },\n\n    removeAttribute: function(name)\n    {\n        var self = this;\n        var callback = function()\n        {\n            delete self._attributesMap[name];\n            for (var i = 0;  i < self.attributes.length; ++i) {\n                if (self.attributes[i].name == name) {\n                    self.attributes.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        this.ownerDocument._domAgent.removeAttributeAsync(this, name, callback);\n    },\n\n    path: function()\n    {\n        var path = [];\n        var node = this;\n        while (node && \"index\" in node && node.nodeName.length) {\n            path.push([node.index, node.nodeName]);\n            node = node.parentNode;\n        }\n        path.reverse();\n        return path.join(\",\");\n    },\n\n    _setAttributesPayload: function(attrs)\n    {\n        this.attributes = [];\n        this._attributesMap = {};\n        for (var i = 0; i < attrs.length; i += 2)\n            this._addAttribute(attrs[i], attrs[i + 1]);\n    },\n\n    _insertChild: function(prev, payload)\n    {\n        var node = new WebInspector.DOMNode(this.ownerDocument, payload);\n        if (!prev) {\n            if (!this.children) {\n                // First node\n                this.children = [ node ];\n            } else\n                this.children.unshift(node);\n        } else\n            this.children.splice(this.children.indexOf(prev) + 1, 0, node);\n        this._renumber();\n        return node;\n    },\n\n    removeChild_: function(node)\n    {\n        this.children.splice(this.children.indexOf(node), 1);\n        node.parentNode = null;\n        this._renumber();\n    },\n\n    _setChildrenPayload: function(payloads)\n    {\n        this.children = [];\n        for (var i = 0; i < payloads.length; ++i) {\n            var payload = payloads[i];\n            var node = new WebInspector.DOMNode(this.ownerDocument, payload);\n            this.children.push(node);\n        }\n        this._renumber();\n    },\n\n    _renumber: function()\n    {\n        this._childNodeCount = this.children.length;\n        if (this._childNodeCount == 0) {\n            this.firstChild = null;\n            this.lastChild = null;\n            return;\n        }\n        this.firstChild = this.children[0];\n        this.lastChild = this.children[this._childNodeCount - 1];\n        for (var i = 0; i < this._childNodeCount; ++i) {\n            var child = this.children[i];\n            child.index = i;\n            child.nextSibling = i + 1 < this._childNodeCount ? this.children[i + 1] : null;\n            child.prevSibling = i - 1 >= 0 ? this.children[i - 1] : null;\n            child.parentNode = this;\n        }\n    },\n\n    _addAttribute: function(name, value)\n    {\n        var attr = {\n            \"name\": name,\n            \"value\": value,\n            \"_node\": this\n        };\n        this._attributesMap[name] = attr;\n        this.attributes.push(attr);\n    }\n}\n\nWebInspector.DOMDocument = function(domAgent, defaultView, payload)\n{\n    WebInspector.DOMNode.call(this, this, payload);\n    this._listeners = {};\n    this._domAgent = domAgent;\n    this.defaultView = defaultView;\n}\n\nWebInspector.DOMDocument.prototype = {\n\n    addEventListener: function(name, callback)\n    {\n        var listeners = this._listeners[name];\n        if (!listeners) {\n            listeners = [];\n            this._listeners[name] = listeners;\n        }\n        listeners.push(callback);\n    },\n\n    removeEventListener: function(name, callback)\n    {\n        var listeners = this._listeners[name];\n        if (!listeners)\n            return;\n\n        var index = listeners.indexOf(callback);\n        if (index != -1)\n            listeners.splice(index, 1);\n    },\n\n    _fireDomEvent: function(name, event)\n    {\n        var listeners = this._listeners[name];\n        if (!listeners)\n            return;\n\n        for (var i = 0; i < listeners.length; ++i) {\n            var listener = listeners[i];\n            listener.call(this, event);\n        }\n    }\n}\n\nWebInspector.DOMDocument.prototype.__proto__ = WebInspector.DOMNode.prototype;\n\n\nWebInspector.DOMWindow = function(domAgent)\n{\n    this._domAgent = domAgent;\n}\n\nWebInspector.DOMWindow.prototype = {\n    get document()\n    {\n        return this._domAgent.document;\n    },\n\n    get Node()\n    {\n        return WebInspector.DOMNode;\n    },\n\n    get Element()\n    {\n        return WebInspector.DOMNode;\n    },\n\n    Object: function()\n    {\n    }\n}\n\nWebInspector.DOMAgent = function() {\n    this._window = new WebInspector.DOMWindow(this);\n    this._idToDOMNode = null;\n    this.document = null;\n    InspectorBackend.registerDomainDispatcher(\"DOM\", new WebInspector.DOMDispatcher(this));\n}\n\nWebInspector.DOMAgent.prototype = {\n    get domWindow()\n    {\n        return this._window;\n    },\n\n    getChildNodesAsync: function(parent, callback)\n    {\n        var children = parent.children;\n        if (children) {\n            callback(children);\n            return;\n        }\n        function mycallback() {\n            callback(parent.children);\n        }\n        InspectorBackend.getChildNodes(parent.id, mycallback);\n    },\n\n    setAttributeAsync: function(node, name, value, callback)\n    {\n        var mycallback = this._didApplyDomChange.bind(this, node, callback);\n        InspectorBackend.setAttribute(node.id, name, value, mycallback);\n    },\n\n    removeAttributeAsync: function(node, name, callback)\n    {\n        var mycallback = this._didApplyDomChange.bind(this, node, callback);\n        InspectorBackend.removeAttribute(node.id, name, mycallback);\n    },\n\n    setTextNodeValueAsync: function(node, text, callback)\n    {\n        var mycallback = this._didApplyDomChange.bind(this, node, callback);\n        InspectorBackend.setTextNodeValue(node.id, text, mycallback);\n    },\n\n    _didApplyDomChange: function(node, callback, success)\n    {\n        if (!success)\n            return;\n        callback();\n        // TODO(pfeldman): Fix this hack.\n        var elem = WebInspector.panels.elements.treeOutline.findTreeElement(node);\n        if (elem)\n            elem.updateTitle();\n    },\n\n    _attributesUpdated: function(nodeId, attrsArray)\n    {\n        var node = this._idToDOMNode[nodeId];\n        node._setAttributesPayload(attrsArray);\n        var event = {target: node};\n        this.document._fireDomEvent(\"DOMAttrModified\", event);\n    },\n\n    _characterDataModified: function(nodeId, newValue)\n    {\n        var node = this._idToDOMNode[nodeId];\n        node._nodeValue = newValue;\n        node.textContent = newValue;\n        var event = { target : node };\n        this.document._fireDomEvent(\"DOMCharacterDataModified\", event);\n    },\n\n    nodeForId: function(nodeId)\n    {\n        return this._idToDOMNode[nodeId];\n    },\n\n    _setDocument: function(payload)\n    {\n        this._idToDOMNode = {};\n        if (payload && \"id\" in payload) {\n            this.document = new WebInspector.DOMDocument(this, this._window, payload);\n            this._idToDOMNode[payload.id] = this.document;\n            this._bindNodes(this.document.children);\n            WebInspector.breakpointManager.restoreDOMBreakpoints();\n        } else\n            this.document = null;\n        WebInspector.panels.elements.setDocument(this.document);\n    },\n\n    _setDetachedRoot: function(payload)\n    {\n        var root = new WebInspector.DOMNode(this.document, payload);\n        this._idToDOMNode[payload.id] = root;\n    },\n\n    _setChildNodes: function(parentId, payloads)\n    {\n        var parent = this._idToDOMNode[parentId];\n        parent._setChildrenPayload(payloads);\n        this._bindNodes(parent.children);\n    },\n\n    _bindNodes: function(children)\n    {\n        for (var i = 0; i < children.length; ++i) {\n            var child = children[i];\n            this._idToDOMNode[child.id] = child;\n            if (child.children)\n                this._bindNodes(child.children);\n        }\n    },\n\n    _childNodeCountUpdated: function(nodeId, newValue)\n    {\n        var node = this._idToDOMNode[nodeId];\n        node._childNodeCount = newValue;\n        var outline = WebInspector.panels.elements.treeOutline;\n        var treeElement = outline.findTreeElement(node);\n        if (treeElement)\n            treeElement.hasChildren = newValue;\n    },\n\n    _childNodeInserted: function(parentId, prevId, payload)\n    {\n        var parent = this._idToDOMNode[parentId];\n        var prev = this._idToDOMNode[prevId];\n        var node = parent._insertChild(prev, payload);\n        this._idToDOMNode[node.id] = node;\n        var event = { target : node, relatedNode : parent };\n        this.document._fireDomEvent(\"DOMNodeInserted\", event);\n    },\n\n    _childNodeRemoved: function(parentId, nodeId)\n    {\n        var parent = this._idToDOMNode[parentId];\n        var node = this._idToDOMNode[nodeId];\n        parent.removeChild_(node);\n        var event = { target : node, relatedNode : parent };\n        this.document._fireDomEvent(\"DOMNodeRemoved\", event);\n        delete this._idToDOMNode[nodeId];\n        this._removeBreakpoints(node);\n    },\n\n    _removeBreakpoints: function(node)\n    {\n        for (var type in node.breakpoints)\n            node.breakpoints[type].remove();\n        if (!node.children)\n            return;\n        for (var i = 0; i < node.children.length; ++i)\n            this._removeBreakpoints(node.children[i]);\n    }\n}\n\nWebInspector.DOMDispatcher = function(domAgent)\n{\n    this._domAgent = domAgent;\n}\n\nWebInspector.DOMDispatcher.prototype = {\n    setDocument: function(payload)\n    {\n        this._domAgent._setDocument(payload);\n    },\n\n    attributesUpdated: function(nodeId, attrsArray)\n    {\n        this._domAgent._attributesUpdated(nodeId, attrsArray);\n    },\n\n    characterDataModified: function(nodeId, newValue)\n    {\n        this._domAgent._characterDataModified(nodeId, newValue);\n    },\n\n    setChildNodes: function(parentId, payloads)\n    {\n        this._domAgent._setChildNodes(parentId, payloads);\n    },\n\n    setDetachedRoot: function(payload)\n    {\n        this._domAgent._setDetachedRoot(payload);\n    },\n\n    childNodeCountUpdated: function(nodeId, newValue)\n    {\n        this._domAgent._childNodeCountUpdated(nodeId, newValue);\n    },\n\n    childNodeInserted: function(parentId, prevId, payload)\n    {\n        this._domAgent._childNodeInserted(parentId, prevId, payload);\n    },\n\n    childNodeRemoved: function(parentId, nodeId)\n    {\n        this._domAgent._childNodeRemoved(parentId, nodeId);\n    }\n}\n\nWebInspector.ApplicationCacheDispatcher = function()\n{\n}\n\nWebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync = function(callback)\n{\n    function mycallback(applicationCaches)\n    {\n        // FIXME: Currently, this list only returns a single application cache.\n        if (applicationCaches)\n            callback(applicationCaches);\n    }\n\n    InspectorBackend.getApplicationCaches(mycallback);\n}\n\nWebInspector.ApplicationCacheDispatcher.prototype = {\n    updateApplicationCacheStatus: function(status)\n    {\n        WebInspector.panels.resources.updateApplicationCacheStatus(status);\n    },\n\n    updateNetworkState: function(isNowOnline)\n    {\n        WebInspector.panels.resources.updateNetworkState(isNowOnline);\n    }\n}\n\nInspectorBackend.registerDomainDispatcher(\"ApplicationCache\", new WebInspector.ApplicationCacheDispatcher());\n\nWebInspector.Cookies = {}\n\nWebInspector.Cookies.getCookiesAsync = function(callback)\n{\n    function mycallback(cookies, cookiesString)\n    {\n        if (cookiesString)\n            callback(WebInspector.Cookies.buildCookiesFromString(cookiesString), false);\n        else\n            callback(cookies, true);\n    }\n\n    InspectorBackend.getCookies(mycallback);\n}\n\nWebInspector.Cookies.buildCookiesFromString = function(rawCookieString)\n{\n    var rawCookies = rawCookieString.split(/;\\s*/);\n    var cookies = [];\n\n    if (!(/^\\s*$/.test(rawCookieString))) {\n        for (var i = 0; i < rawCookies.length; ++i) {\n            var cookie = rawCookies[i];\n            var delimIndex = cookie.indexOf(\"=\");\n            var name = cookie.substring(0, delimIndex);\n            var value = cookie.substring(delimIndex + 1);\n            var size = name.length + value.length;\n            cookies.push({ name: name, value: value, size: size });\n        }\n    }\n\n    return cookies;\n}\n\nWebInspector.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL)\n{\n    var url = resourceURL.asParsedURL();\n    if (!url || !this.cookieDomainMatchesResourceDomain(cookie.domain, url.host))\n        return false;\n    return (url.path.indexOf(cookie.path) === 0\n        && (!cookie.port || url.port == cookie.port)\n        && (!cookie.secure || url.scheme === \"https\"));\n}\n\nWebInspector.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain)\n{\n    if (cookieDomain.charAt(0) !== '.')\n        return resourceDomain === cookieDomain;\n    return !!resourceDomain.match(new RegExp(\"^([^\\\\.]+\\\\.)?\" + cookieDomain.substring(1).escapeForRegExp() + \"$\"), \"i\");\n}\n\nWebInspector.EventListeners = {}\n\nWebInspector.EventListeners.getEventListenersForNodeAsync = function(node, callback)\n{\n    if (!node)\n        return;\n    InspectorBackend.getEventListenersForNode(node.id, callback);\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DOMStorage.js",
    "content": "/*\n * Copyright (C) 2008 Nokia Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DOMStorage = function(id, domain, isLocalStorage)\n{\n    this._id = id;\n    this._domain = domain;\n    this._isLocalStorage = isLocalStorage;\n}\n\nWebInspector.DOMStorage.prototype = {\n    get id()\n    {\n        return this._id;\n    },\n\n    get domain()\n    {\n        return this._domain;\n    },\n\n    get isLocalStorage()\n    {\n        return this._isLocalStorage;\n    },\n\n    getEntries: function(callback)\n    {\n        InspectorBackend.getDOMStorageEntries(this._id, callback);\n    },\n    \n    setItem: function(key, value, callback)\n    {\n        InspectorBackend.setDOMStorageItem(this._id, key, value, callback);\n    },\n    \n    removeItem: function(key, callback)\n    {\n        InspectorBackend.removeDOMStorageItem(this._id, key, callback);\n    }\n}\n\n\nWebInspector.DOMStorageDispatcher = function()\n{\n}\n\nWebInspector.DOMStorageDispatcher.prototype = {\n    addDOMStorage: function(payload)\n    {\n        if (!WebInspector.panels.resources)\n            return;\n        var domStorage = new WebInspector.DOMStorage(\n            payload.id,\n            payload.host,\n            payload.isLocalStorage);\n        WebInspector.panels.resources.addDOMStorage(domStorage);\n    },\n\n    selectDOMStorage: function(o)\n    {\n        WebInspector.showPanel(\"resources\");\n        WebInspector.panels.resources.selectDOMStorage(o);\n    },\n\n    updateDOMStorage: function(storageId)\n    {\n        WebInspector.panels.resources.updateDOMStorage(storageId);\n    }\n}\n\nInspectorBackend.registerDomainDispatcher(\"DOMStorage\", new WebInspector.DOMStorageDispatcher());\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DOMStorageItemsView.js",
    "content": "/*\n * Copyright (C) 2008 Nokia Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DOMStorageItemsView = function(domStorage)\n{\n    WebInspector.View.call(this);\n\n    this.domStorage = domStorage;\n\n    this.element.addStyleClass(\"storage-view\");\n    this.element.addStyleClass(\"table\");\n\n    this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Delete\"), \"delete-storage-status-bar-item\");\n    this.deleteButton.visible = false;\n    this.deleteButton.addEventListener(\"click\", this._deleteButtonClicked.bind(this), false);\n\n    this.refreshButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Refresh\"), \"refresh-storage-status-bar-item\");\n    this.refreshButton.addEventListener(\"click\", this._refreshButtonClicked.bind(this), false);\n}\n\nWebInspector.DOMStorageItemsView.prototype = {\n    get statusBarItems()\n    {\n        return [this.refreshButton.element, this.deleteButton.element];\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this.update();\n    },\n\n    hide: function()\n    {\n        WebInspector.View.prototype.hide.call(this);\n        this.deleteButton.visible = false;\n    },\n\n    update: function()\n    {\n        this.element.removeChildren();\n        var callback = this._showDOMStorageEntries.bind(this);\n        this.domStorage.getEntries(callback);\n    },\n\n    _showDOMStorageEntries: function(entries)\n    {\n        this._dataGrid = this._dataGridForDOMStorageEntries(entries);\n        this.element.appendChild(this._dataGrid.element);\n        this._dataGrid.autoSizeColumns(10);\n        this.deleteButton.visible = true;\n    },\n\n    resize: function()\n    {\n        if (this._dataGrid)\n            this._dataGrid.updateWidths();\n    },\n\n    _dataGridForDOMStorageEntries: function(entries)\n    {\n        var columns = {};\n        columns[0] = {};\n        columns[1] = {};\n        columns[0].title = WebInspector.UIString(\"Key\");\n        columns[1].title = WebInspector.UIString(\"Value\");\n\n        var nodes = [];\n\n        var keys = [];\n        var length = entries.length;\n        for (var i = 0; i < entries.length; i++) {\n            var data = {};\n\n            var key = entries[i][0];\n            data[0] = key;\n            var value = entries[i][1];\n            data[1] = value;\n            var node = new WebInspector.DataGridNode(data, false);\n            node.selectable = true;\n            nodes.push(node);\n            keys.push(key);\n        }\n\n        var dataGrid = new WebInspector.DataGrid(columns, this._editingCallback.bind(this), this._deleteCallback.bind(this));\n        var length = nodes.length;\n        for (var i = 0; i < length; ++i)\n            dataGrid.appendChild(nodes[i]);\n        dataGrid.addCreationNode(false);\n        if (length > 0)\n            nodes[0].selected = true;\n        return dataGrid;\n    },\n\n    _deleteButtonClicked: function(event)\n    {\n        if (!this._dataGrid || !this._dataGrid.selectedNode)\n            return;\n\n        this._deleteCallback(this._dataGrid.selectedNode);\n    },\n\n    _refreshButtonClicked: function(event)\n    {\n        this.update();\n    },\n    \n    _editingCallback: function(editingNode, columnIdentifier, oldText, newText)\n    {\n        var domStorage = this.domStorage;\n        if (columnIdentifier === 0) {\n            if (oldText)\n                domStorage.removeItem(oldText);\n\n            domStorage.setItem(newText, editingNode.data[1]);\n        } else {\n            domStorage.setItem(editingNode.data[0], newText);\n        }\n        \n        this.update();\n    },\n    \n    _deleteCallback: function(node)\n    {\n        if (!node || node.isCreationNode)\n            return;\n\n        if (this.domStorage)\n            this.domStorage.removeItem(node.data[0]);\n            \n        this.update();\n    }\n}\n\nWebInspector.DOMStorageItemsView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DOMSyntaxHighlighter.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DOMSyntaxHighlighter = function(mimeType)\n{\n    this._tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(mimeType);\n}\n\nWebInspector.DOMSyntaxHighlighter.prototype = {\n    createSpan: function(content, className)\n    {\n        var span = document.createElement(\"span\");\n        span.className = \"webkit-\" + className;\n        span.appendChild(document.createTextNode(content));\n        return span;\n    },\n\n    syntaxHighlightNode: function(node)\n    {\n        this._tokenizer.condition = this._tokenizer.initialCondition;\n        var lines = node.textContent.split(\"\\n\");\n        node.removeChildren();\n\n        for (var i = lines[0].length ? 0 : 1; i < lines.length; ++i) {\n            var line = lines[i];\n            var plainTextStart = 0;\n            this._tokenizer.line = line;\n            var column = 0;\n            do {\n                var newColumn = this._tokenizer.nextToken(column);\n                var tokenType = this._tokenizer.tokenType;\n                if (tokenType) {\n                    if (column > plainTextStart) {\n                        var plainText = line.substring(plainTextStart, column);\n                        node.appendChild(document.createTextNode(plainText));\n                    }\n                    var token = line.substring(column, newColumn);\n                    node.appendChild(this.createSpan(token, tokenType));\n                    plainTextStart = newColumn;\n                }\n                column = newColumn;\n           } while (column < line.length)\n\n           if (plainTextStart < line.length) {\n               var plainText = line.substring(plainTextStart, line.length);\n               node.appendChild(document.createTextNode(plainText));\n           }\n           if (i < lines.length - 1)\n               node.appendChild(document.createElement(\"br\"));\n        }\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DataGrid.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *        notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *        notice, this list of conditions and the following disclaimer in the\n *        documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.         IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DataGrid = function(columns, editCallback, deleteCallback)\n{\n    this.element = document.createElement(\"div\");\n    this.element.className = \"data-grid\";\n    this.element.tabIndex = 0;\n    this.element.addEventListener(\"keydown\", this._keyDown.bind(this), false);\n\n    this._headerTable = document.createElement(\"table\");\n    this._headerTable.className = \"header\";\n    this._headerTableHeaders = {};\n\n    this._dataTable = document.createElement(\"table\");\n    this._dataTable.className = \"data\";\n\n    this._dataTable.addEventListener(\"mousedown\", this._mouseDownInDataTable.bind(this), true);\n    this._dataTable.addEventListener(\"click\", this._clickInDataTable.bind(this), true);\n    \n    this._dataTable.addEventListener(\"contextmenu\", this._contextMenuInDataTable.bind(this), true);\n    \n    // FIXME: Add a createCallback which is different from editCallback and has different\n    // behavior when creating a new node.\n    if (editCallback) {\n        this._dataTable.addEventListener(\"dblclick\", this._ondblclick.bind(this), false);\n        this._editCallback = editCallback;\n    }\n    if (deleteCallback)\n        this._deleteCallback = deleteCallback;\n    \n    this.aligned = {};\n\n    this._scrollContainer = document.createElement(\"div\");\n    this._scrollContainer.className = \"data-container\";\n    this._scrollContainer.appendChild(this._dataTable);\n\n    this.element.appendChild(this._headerTable);\n    this.element.appendChild(this._scrollContainer);\n\n    var headerRow = document.createElement(\"tr\");\n    var columnGroup = document.createElement(\"colgroup\");\n    this._columnCount = 0;\n\n    for (var columnIdentifier in columns) {\n        var column = columns[columnIdentifier];\n        if (column.disclosure)\n            this.disclosureColumnIdentifier = columnIdentifier;\n\n        var col = document.createElement(\"col\");\n        if (column.width)\n            col.style.width = column.width;\n        column.element = col;\n        columnGroup.appendChild(col);\n\n        var cell = document.createElement(\"th\");\n        cell.className = columnIdentifier + \"-column\";\n        cell.columnIdentifier = columnIdentifier;\n        this._headerTableHeaders[columnIdentifier] = cell;\n\n        var div = document.createElement(\"div\");\n        if (column.titleDOMFragment)\n            div.appendChild(column.titleDOMFragment);\n        else\n            div.textContent = column.title;\n        cell.appendChild(div);\n\n        if (column.sort) {\n            cell.addStyleClass(\"sort-\" + column.sort);\n            this._sortColumnCell = cell;\n        }\n\n        if (column.sortable) {\n            cell.addEventListener(\"click\", this._clickInHeaderCell.bind(this), false);\n            cell.addStyleClass(\"sortable\");\n        }\n\n        if (column.aligned)\n            this.aligned[columnIdentifier] = column.aligned;\n\n        headerRow.appendChild(cell);\n\n        ++this._columnCount;\n    }\n\n    columnGroup.span = this._columnCount;\n\n    var cell = document.createElement(\"th\");\n    cell.className = \"corner\";\n    headerRow.appendChild(cell);\n\n    this._headerTableColumnGroup = columnGroup;\n    this._headerTable.appendChild(this._headerTableColumnGroup);\n    this.headerTableBody.appendChild(headerRow);\n\n    var fillerRow = document.createElement(\"tr\");\n    fillerRow.className = \"filler\";\n\n    for (var columnIdentifier in columns) {\n        var column = columns[columnIdentifier];\n        var cell = document.createElement(\"td\");\n        cell.className = columnIdentifier + \"-column\";\n        fillerRow.appendChild(cell);\n    }\n\n    this._dataTableColumnGroup = columnGroup.cloneNode(true);\n    this._dataTable.appendChild(this._dataTableColumnGroup);\n    this.dataTableBody.appendChild(fillerRow);\n\n    this.columns = columns || {};\n    this._columnsArray = [];\n    for (var columnIdentifier in columns) {\n        columns[columnIdentifier].ordinal = this._columnsArray.length;\n        this._columnsArray.push(columns[columnIdentifier]);\n    }\n\n    for (var i = 0; i < this._columnsArray.length; ++i)\n        this._columnsArray[i].bodyElement = this._dataTableColumnGroup.children[i];\n\n    this.children = [];\n    this.selectedNode = null;\n    this.expandNodesWhenArrowing = false;\n    this.root = true;\n    this.hasChildren = false;\n    this.expanded = true;\n    this.revealed = true;\n    this.selected = false;\n    this.dataGrid = this;\n    this.indentWidth = 15;\n    this.resizers = [];\n    this._columnWidthsInitialized = false;\n}\n\nWebInspector.DataGrid.prototype = {\n    _ondblclick: function(event)\n    {\n        if (this._editing || this._editingNode)\n            return;\n\n        this._startEditing(event.target);\n    },\n\n    _startEditingColumnOfDataGridNode: function(node, column)\n    {\n        this._editing = true;\n        this._editingNode = node;\n        this._editingNode.select();\n\n        var element = this._editingNode._element.children[column];\n        WebInspector.startEditing(element, {\n            context: element.textContent,\n            commitHandler: this._editingCommitted.bind(this),\n            cancelHandler: this._editingCancelled.bind(this)\n        });\n        window.getSelection().setBaseAndExtent(element, 0, element, 1);\n    },\n\n    _startEditing: function(target)\n    {\n        var element = target.enclosingNodeOrSelfWithNodeName(\"td\");\n        if (!element)\n            return;\n\n        this._editingNode = this.dataGridNodeFromNode(target);\n        if (!this._editingNode) {\n            if (!this.creationNode)\n                return;\n            this._editingNode = this.creationNode;\n        }\n\n        // Force editing the 1st column when editing the creation node\n        if (this._editingNode.isCreationNode)\n            return this._startEditingColumnOfDataGridNode(this._editingNode, 0);\n\n        this._editing = true;\n        WebInspector.startEditing(element, {\n            context: element.textContent,\n            commitHandler: this._editingCommitted.bind(this),\n            cancelHandler: this._editingCancelled.bind(this)\n        });\n        window.getSelection().setBaseAndExtent(element, 0, element, 1);\n    },\n\n    _editingCommitted: function(element, newText, oldText, context, moveDirection)\n    {\n        // FIXME: We need more column identifiers here throughout this function.\n        // Not needed yet since only editable DataGrid is DOM Storage, which is Key - Value.\n        \n        // FIXME: Better way to do this than regular expressions?\n        var columnIdentifier = parseInt(element.className.match(/\\b(\\d+)-column\\b/)[1]);\n\n        var textBeforeEditing = this._editingNode.data[columnIdentifier];\n        var currentEditingNode = this._editingNode;\n\n        function moveToNextIfNeeded(wasChange) {\n            if (!moveDirection)\n                return;\n\n            if (moveDirection === \"forward\") {\n                if (currentEditingNode.isCreationNode && columnIdentifier === 0 && !wasChange)\n                    return;\n\n                if (columnIdentifier === 0)\n                    return this._startEditingColumnOfDataGridNode(currentEditingNode, 1);\n\n                var nextDataGridNode = currentEditingNode.traverseNextNode(true, null, true);\n                if (nextDataGridNode)\n                    return this._startEditingColumnOfDataGridNode(nextDataGridNode, 0);\n                if (currentEditingNode.isCreationNode && wasChange) {\n                    addCreationNode(false);\n                    return this._startEditingColumnOfDataGridNode(this.creationNode, 0);\n                }\n                return;\n            }\n\n            if (moveDirection === \"backward\") {\n                if (columnIdentifier === 1)\n                    return this._startEditingColumnOfDataGridNode(currentEditingNode, 0);\n                    var nextDataGridNode = currentEditingNode.traversePreviousNode(true, null, true);\n\n                if (nextDataGridNode)\n                    return this._startEditingColumnOfDataGridNode(nextDataGridNode, 1);\n                return;\n            }\n        }\n\n        if (textBeforeEditing == newText) {\n            this._editingCancelled(element);\n            moveToNextIfNeeded.call(this, false);\n            return;\n        }\n\n        // Update the text in the datagrid that we typed\n        this._editingNode.data[columnIdentifier] = newText;\n        \n        // Make the callback - expects an editing node (table row), the column number that is being edited,\n        // the text that used to be there, and the new text.\n        this._editCallback(this._editingNode, columnIdentifier, textBeforeEditing, newText);\n\n        if (this._editingNode.isCreationNode)\n            this.addCreationNode(false);\n\n        this._editingCancelled(element);\n        moveToNextIfNeeded.call(this, true);\n    },\n\n    _editingCancelled: function(element, context)\n    {\n        delete this._editing;\n        this._editingNode = null;\n    },\n    \n    get sortColumnIdentifier()\n    {\n        if (!this._sortColumnCell)\n            return null;\n        return this._sortColumnCell.columnIdentifier;\n    },\n\n    get sortOrder()\n    {\n        if (!this._sortColumnCell || this._sortColumnCell.hasStyleClass(\"sort-ascending\"))\n            return \"ascending\";\n        if (this._sortColumnCell.hasStyleClass(\"sort-descending\"))\n            return \"descending\";\n        return null;\n    },\n\n    get headerTableBody()\n    {\n        if (\"_headerTableBody\" in this)\n            return this._headerTableBody;\n\n        this._headerTableBody = this._headerTable.getElementsByTagName(\"tbody\")[0];\n        if (!this._headerTableBody) {\n            this._headerTableBody = this.element.ownerDocument.createElement(\"tbody\");\n            this._headerTable.insertBefore(this._headerTableBody, this._headerTable.tFoot);\n        }\n\n        return this._headerTableBody;\n    },\n\n    get dataTableBody()\n    {\n        if (\"_dataTableBody\" in this)\n            return this._dataTableBody;\n\n        this._dataTableBody = this._dataTable.getElementsByTagName(\"tbody\")[0];\n        if (!this._dataTableBody) {\n            this._dataTableBody = this.element.ownerDocument.createElement(\"tbody\");\n            this._dataTable.insertBefore(this._dataTableBody, this._dataTable.tFoot);\n        }\n\n        return this._dataTableBody;\n    },\n\n    autoSizeColumns: function(minPercent, maxPercent, maxDescentLevel)\n    {\n        if (minPercent)\n            minPercent = Math.min(minPercent, Math.floor(100 / this._columnCount));\n        var widths = {};\n        var columns = this.columns;\n        for (var columnIdentifier in columns)\n            widths[columnIdentifier] = (columns[columnIdentifier].title || \"\").length;\n\n        var children = maxDescentLevel ? this._enumerateChildren(this, [], maxDescentLevel + 1) : this.children;\n        for (var i = 0; i < children.length; ++i) {\n            var node = children[i];\n            for (var columnIdentifier in columns) {\n                var text = node.data[columnIdentifier] || \"\";\n                if (text.length > widths[columnIdentifier])\n                    widths[columnIdentifier] = text.length;\n            }\n        }\n\n        var totalColumnWidths = 0;\n        for (var columnIdentifier in columns)\n            totalColumnWidths += widths[columnIdentifier];\n\n        var recoupPercent = 0;\n        for (var columnIdentifier in columns) {\n            var width = Math.round(100 * widths[columnIdentifier] / totalColumnWidths);\n            if (minPercent && width < minPercent) {\n                recoupPercent += (minPercent - width);\n                width = minPercent;\n            } else if (maxPercent && width > maxPercent) {\n                recoupPercent -= (width - maxPercent);\n                width = maxPercent;\n            }\n            widths[columnIdentifier] = width;\n        }\n\n        while (minPercent && recoupPercent > 0) {\n            for (var columnIdentifier in columns) {\n                if (widths[columnIdentifier] > minPercent) {\n                    --widths[columnIdentifier];\n                    --recoupPercent;\n                    if (!recoupPercent)\n                        break;\n                }\n            }\n        }\n\n        while (maxPercent && recoupPercent < 0) {\n            for (var columnIdentifier in columns) {\n                if (widths[columnIdentifier] < maxPercent) {\n                    ++widths[columnIdentifier];\n                    ++recoupPercent;\n                    if (!recoupPercent)\n                        break;\n                }\n            }\n        }\n\n        for (var columnIdentifier in columns)\n            columns[columnIdentifier].element.style.width = widths[columnIdentifier] + \"%\";\n        this._columnWidthsInitialized = false;\n        this.updateWidths();\n    },\n\n    _enumerateChildren: function(rootNode, result, maxLevel)\n    {\n        if (!rootNode.root)\n            result.push(rootNode);\n        if (!maxLevel)\n            return;\n        for (var i = 0; i < rootNode.children.length; ++i)\n            this._enumerateChildren(rootNode.children[i], result, maxLevel - 1);\n        return result;\n    },\n\n    // Updates the widths of the table, including the positions of the column\n    // resizers.\n    //\n    // IMPORTANT: This function MUST be called once after the element of the\n    // DataGrid is attached to its parent element and every subsequent time the\n    // width of the parent element is changed in order to make it possible to\n    // resize the columns.\n    //\n    // If this function is not called after the DataGrid is attached to its\n    // parent element, then the DataGrid's columns will not be resizable.\n    updateWidths: function()\n    {\n        var headerTableColumns = this._headerTableColumnGroup.children;\n        \n        var tableWidth = this._dataTable.offsetWidth;\n        var numColumns = headerTableColumns.length;\n        \n        // Do not attempt to use offsetes if we're not attached to the document tree yet.\n        if (!this._columnWidthsInitialized && this.element.offsetWidth) {\n            // Give all the columns initial widths now so that during a resize,\n            // when the two columns that get resized get a percent value for\n            // their widths, all the other columns already have percent values\n            // for their widths.\n            for (var i = 0; i < numColumns; i++) {\n                var columnWidth = this.headerTableBody.rows[0].cells[i].offsetWidth;\n                var percentWidth = ((columnWidth / tableWidth) * 100) + \"%\";\n                this._headerTableColumnGroup.children[i].style.width = percentWidth;\n                this._dataTableColumnGroup.children[i].style.width = percentWidth;\n            }\n            this._columnWidthsInitialized = true;\n        }\n        this._positionResizers();\n        this.dispatchEventToListeners(\"width changed\");\n    },\n\n    columnWidthsMap: function()\n    {\n        var result = {};\n        for (var i = 0; i < this._columnsArray.length; ++i) {\n            var width = this._headerTableColumnGroup.children[i].style.width;\n            result[this._columnsArray[i].columnIdentifier] = parseFloat(width);\n        }\n        return result;\n    },\n\n    applyColumnWidthsMap: function(columnWidthsMap)\n    {\n        for (var columnIdentifier in this.columns) {\n            var column = this.columns[columnIdentifier];\n            var width = (columnWidthsMap[columnIdentifier] || 0) + \"%\";\n            this._headerTableColumnGroup.children[column.ordinal].style.width = width;\n            this._dataTableColumnGroup.children[column.ordinal].style.width = width;\n        }\n\n        // Normalize widths\n        delete this._columnWidthsInitialized;\n        this.updateWidths();\n    },\n\n    isColumnVisible: function(columnIdentifier)\n    {\n        var column = this.columns[columnIdentifier];\n        var columnElement = column.element;\n        return !columnElement.hidden;\n    },\n\n    showColumn: function(columnIdentifier)\n    {\n        var column = this.columns[columnIdentifier];\n        var columnElement = column.element;\n        if (!columnElement.hidden)\n            return;\n\n        columnElement.hidden = false;\n        columnElement.removeStyleClass(\"hidden\");\n\n        var columnBodyElement = column.bodyElement;\n        columnBodyElement.hidden = false;\n        columnBodyElement.removeStyleClass(\"hidden\");\n    },\n\n    hideColumn: function(columnIdentifier)\n    {\n        var column = this.columns[columnIdentifier];\n        var columnElement = column.element;\n        if (columnElement.hidden)\n            return;\n\n        var oldWidth = parseFloat(columnElement.style.width);\n\n        columnElement.hidden = true;\n        columnElement.addStyleClass(\"hidden\");\n        columnElement.style.width = 0;\n\n        var columnBodyElement = column.bodyElement;\n        columnBodyElement.hidden = true;\n        columnBodyElement.addStyleClass(\"hidden\");\n        columnBodyElement.style.width = 0;\n\n        this._columnWidthsInitialized = false;\n    },\n\n    get scrollContainer()\n    {\n        return this._scrollContainer;        \n    },\n\n    isScrolledToLastRow: function()\n    {\n        return this._scrollContainer.isScrolledToBottom();\n    },\n\n    scrollToLastRow: function()\n    {\n        this._scrollContainer.scrollTop = this._scrollContainer.scrollHeight - this._scrollContainer.offsetHeight;\n    },\n\n    _positionResizers: function()\n    {\n        var headerTableColumns = this._headerTableColumnGroup.children;\n        var numColumns = headerTableColumns.length;\n        var left = 0;\n        var previousResizer = null;\n\n        // Make n - 1 resizers for n columns. \n        for (var i = 0; i < numColumns - 1; i++) {\n            var resizer = this.resizers[i];\n\n            if (!resizer) {\n                // This is the first call to updateWidth, so the resizers need\n                // to be created.\n                resizer = document.createElement(\"div\");\n                resizer.addStyleClass(\"data-grid-resizer\");\n                // This resizer is associated with the column to its right.\n                resizer.addEventListener(\"mousedown\", this._startResizerDragging.bind(this), false);\n                this.element.appendChild(resizer);\n                this.resizers[i] = resizer;\n            }\n\n            // Get the width of the cell in the first (and only) row of the\n            // header table in order to determine the width of the column, since\n            // it is not possible to query a column for its width.\n            left += this.headerTableBody.rows[0].cells[i].offsetWidth;\n\n            var columnIsVisible = !this._headerTableColumnGroup.children[i].hidden;\n            if (columnIsVisible) {\n                resizer.style.removeProperty(\"display\");\n                resizer.style.left = left + \"px\";\n                resizer.leftNeighboringColumnID = i;\n                if (previousResizer)\n                    previousResizer.rightNeighboringColumnID = i;\n                previousResizer = resizer;\n            } else {\n                resizer.style.setProperty(\"display\", \"none\");\n                resizer.leftNeighboringColumnID = 0;\n                resizer.rightNeighboringColumnID = 0;\n            }\n        }\n        if (previousResizer)\n            previousResizer.rightNeighboringColumnID = numColumns - 1;\n    },\n\n    addCreationNode: function(hasChildren)\n    {\n        if (this.creationNode)\n            this.creationNode.makeNormal();\n\n        var emptyData = {};\n        for (var column in this.columns)\n            emptyData[column] = '';\n        this.creationNode = new WebInspector.CreationDataGridNode(emptyData, hasChildren);\n        this.appendChild(this.creationNode);\n    },\n\n    appendChild: function(child)\n    {\n        this.insertChild(child, this.children.length);\n    },\n\n    insertChild: function(child, index)\n    {\n        if (!child)\n            throw(\"insertChild: Node can't be undefined or null.\");\n        if (child.parent === this)\n            throw(\"insertChild: Node is already a child of this node.\");\n\n        if (child.parent)\n            child.parent.removeChild(child);\n\n        this.children.splice(index, 0, child);\n        this.hasChildren = true;\n\n        child.parent = this;\n        child.dataGrid = this.dataGrid;\n        child._recalculateSiblings(index);\n\n        delete child._depth;\n        delete child._revealed;\n        delete child._attached;\n        child._shouldRefreshChildren = true;\n\n        var current = child.children[0];\n        while (current) {\n            current.dataGrid = this.dataGrid;\n            delete current._depth;\n            delete current._revealed;\n            delete current._attached;\n            current._shouldRefreshChildren = true;\n            current = current.traverseNextNode(false, child, true);\n        }\n\n        if (this.expanded)\n            child._attach();\n    },\n\n    removeChild: function(child)\n    {\n        if (!child)\n            throw(\"removeChild: Node can't be undefined or null.\");\n        if (child.parent !== this)\n            throw(\"removeChild: Node is not a child of this node.\");\n\n        child.deselect();\n        child._detach();\n\n        this.children.remove(child, true);\n\n        if (child.previousSibling)\n            child.previousSibling.nextSibling = child.nextSibling;\n        if (child.nextSibling)\n            child.nextSibling.previousSibling = child.previousSibling;\n\n        child.dataGrid = null;\n        child.parent = null;\n        child.nextSibling = null;\n        child.previousSibling = null;\n\n        if (this.children.length <= 0)\n            this.hasChildren = false;\n    },\n\n    removeChildren: function()\n    {\n        for (var i = 0; i < this.children.length; ++i) {\n            var child = this.children[i];\n            child.deselect();\n            child._detach();\n\n            child.dataGrid = null;\n            child.parent = null;\n            child.nextSibling = null;\n            child.previousSibling = null;\n        }\n\n        this.children = [];\n        this.hasChildren = false;\n    },\n\n    removeChildrenRecursive: function()\n    {\n        var childrenToRemove = this.children;\n\n        var child = this.children[0];\n        while (child) {\n            if (child.children.length)\n                childrenToRemove = childrenToRemove.concat(child.children);\n            child = child.traverseNextNode(false, this, true);\n        }\n\n        for (var i = 0; i < childrenToRemove.length; ++i) {\n            var child = childrenToRemove[i];\n            child.deselect();\n            child._detach();\n\n            child.children = [];\n            child.dataGrid = null;\n            child.parent = null;\n            child.nextSibling = null;\n            child.previousSibling = null;\n        }\n\n        this.children = [];\n    },\n\n    sortNodes: function(comparator, reverseMode)\n    {\n        function comparatorWrapper(a, b)\n        {\n            if (a._dataGridNode._data.summaryRow)\n                return 1;\n            if (b._dataGridNode._data.summaryRow)\n                return -1;\n\n            var aDataGirdNode = a._dataGridNode;\n            var bDataGirdNode = b._dataGridNode;\n            return reverseMode ? comparator(bDataGirdNode, aDataGirdNode) : comparator(aDataGirdNode, bDataGirdNode);\n        }\n\n        var tbody = this.dataTableBody;\n        var tbodyParent = tbody.parentElement;\n        tbodyParent.removeChild(tbody);\n\n        var childNodes = tbody.childNodes;\n        var fillerRow = childNodes[childNodes.length - 1];\n\n        var sortedRows = Array.prototype.slice.call(childNodes, 0, childNodes.length - 1);\n        sortedRows.sort(comparatorWrapper);\n        var sortedRowsLength = sortedRows.length;\n\n        tbody.removeChildren();\n        var previousSiblingNode = null;\n        for (var i = 0; i < sortedRowsLength; ++i) {\n            var row = sortedRows[i];\n            var node = row._dataGridNode;\n            node.previousSibling = previousSiblingNode;\n            if (previousSiblingNode)\n                previousSiblingNode.nextSibling = node;\n            tbody.appendChild(row);\n            previousSiblingNode = node;\n        }\n        if (previousSiblingNode)\n            previousSiblingNode.nextSibling = null;\n\n        tbody.appendChild(fillerRow);\n        tbodyParent.appendChild(tbody);\n    },\n\n    _keyDown: function(event)\n    {\n        if (!this.selectedNode || event.shiftKey || event.metaKey || event.ctrlKey || this._editing)\n            return;\n\n        var handled = false;\n        var nextSelectedNode;\n        if (event.keyIdentifier === \"Up\" && !event.altKey) {\n            nextSelectedNode = this.selectedNode.traversePreviousNode(true);\n            while (nextSelectedNode && !nextSelectedNode.selectable)\n                nextSelectedNode = nextSelectedNode.traversePreviousNode(!this.expandTreeNodesWhenArrowing);\n            handled = nextSelectedNode ? true : false;\n        } else if (event.keyIdentifier === \"Down\" && !event.altKey) {\n            nextSelectedNode = this.selectedNode.traverseNextNode(true);\n            while (nextSelectedNode && !nextSelectedNode.selectable)\n                nextSelectedNode = nextSelectedNode.traverseNextNode(!this.expandTreeNodesWhenArrowing);\n            handled = nextSelectedNode ? true : false;\n        } else if (event.keyIdentifier === \"Left\") {\n            if (this.selectedNode.expanded) {\n                if (event.altKey)\n                    this.selectedNode.collapseRecursively();\n                else\n                    this.selectedNode.collapse();\n                handled = true;\n            } else if (this.selectedNode.parent && !this.selectedNode.parent.root) {\n                handled = true;\n                if (this.selectedNode.parent.selectable) {\n                    nextSelectedNode = this.selectedNode.parent;\n                    handled = nextSelectedNode ? true : false;\n                } else if (this.selectedNode.parent)\n                    this.selectedNode.parent.collapse();\n            }\n        } else if (event.keyIdentifier === \"Right\") {\n            if (!this.selectedNode.revealed) {\n                this.selectedNode.reveal();\n                handled = true;\n            } else if (this.selectedNode.hasChildren) {\n                handled = true;\n                if (this.selectedNode.expanded) {\n                    nextSelectedNode = this.selectedNode.children[0];\n                    handled = nextSelectedNode ? true : false;\n                } else {\n                    if (event.altKey)\n                        this.selectedNode.expandRecursively();\n                    else\n                        this.selectedNode.expand();\n                }\n            }\n        } else if (event.keyCode === 8 || event.keyCode === 46) {\n            if (this._deleteCallback) {\n                handled = true;\n                this._deleteCallback(this.selectedNode);\n            }\n        } else if (isEnterKey(event)) {\n            if (this._editCallback) {\n                handled = true;\n                // The first child of the selected element is the <td class=\"0-column\">,\n                // and that's what we want to edit.\n                this._startEditing(this.selectedNode._element.children[0]);\n            }\n        }\n\n        if (nextSelectedNode) {\n            nextSelectedNode.reveal();\n            nextSelectedNode.select();\n        }\n\n        if (handled) {\n            event.preventDefault();\n            event.stopPropagation();\n        }\n    },\n\n    expand: function()\n    {\n        // This is the root, do nothing.\n    },\n\n    collapse: function()\n    {\n        // This is the root, do nothing.\n    },\n\n    reveal: function()\n    {\n        // This is the root, do nothing.\n    },\n\n    dataGridNodeFromNode: function(target)\n    {\n        var rowElement = target.enclosingNodeOrSelfWithNodeName(\"tr\");\n        return rowElement._dataGridNode;\n    },\n\n    dataGridNodeFromPoint: function(x, y)\n    {\n        var node = this._dataTable.ownerDocument.elementFromPoint(x, y);\n        var rowElement = node.enclosingNodeOrSelfWithNodeName(\"tr\");\n        return rowElement._dataGridNode;\n    },\n\n    _clickInHeaderCell: function(event)\n    {\n        var cell = event.target.enclosingNodeOrSelfWithNodeName(\"th\");\n        if (!cell || !cell.columnIdentifier || !cell.hasStyleClass(\"sortable\"))\n            return;\n\n        var sortOrder = this.sortOrder;\n\n        if (this._sortColumnCell)\n            this._sortColumnCell.removeMatchingStyleClasses(\"sort-\\\\w+\");\n\n        if (cell == this._sortColumnCell) {\n            if (sortOrder === \"ascending\")\n                sortOrder = \"descending\";\n            else\n                sortOrder = \"ascending\";\n        }\n\n        this._sortColumnCell = cell;\n\n        cell.addStyleClass(\"sort-\" + sortOrder);\n\n        this.dispatchEventToListeners(\"sorting changed\");\n    },\n\n    markColumnAsSortedBy: function(columnIdentifier, sortOrder)\n    {\n        if (this._sortColumnCell)\n            this._sortColumnCell.removeMatchingStyleClasses(\"sort-\\\\w+\");\n        this._sortColumnCell = this._headerTableHeaders[columnIdentifier];\n        this._sortColumnCell.addStyleClass(\"sort-\" + sortOrder);\n    },\n\n    headerTableHeader: function(columnIdentifier)\n    {\n        return this._headerTableHeaders[columnIdentifier];\n    },\n\n    _mouseDownInDataTable: function(event)\n    {\n        var gridNode = this.dataGridNodeFromNode(event.target);\n        if (!gridNode || !gridNode.selectable)\n            return;\n\n        if (gridNode.isEventWithinDisclosureTriangle(event))\n            return;\n\n        if (event.metaKey) {\n            if (gridNode.selected)\n                gridNode.deselect();\n            else\n                gridNode.select();\n        } else\n            gridNode.select();\n    },\n    \n    _contextMenuInDataTable: function(event)\n    {\n        var gridNode = this.dataGridNodeFromNode(event.target);\n        if (!gridNode || !gridNode.selectable)\n            return;\n        \n        if (gridNode.isEventWithinDisclosureTriangle(event))\n            return;\n      \n        var contextMenu = new WebInspector.ContextMenu();\n        \n        // FIXME: Use the column names for Editing, instead of just \"Edit\".\n        if (this.dataGrid._editCallback) {\n            if (gridNode === this.creationNode)\n                contextMenu.appendItem(WebInspector.UIString(\"Add New\"), this._startEditing.bind(this, event.target));\n            else\n                contextMenu.appendItem(WebInspector.UIString(\"Edit\"), this._startEditing.bind(this, event.target));\n        }\n        if (this.dataGrid._deleteCallback && gridNode !== this.creationNode)\n            contextMenu.appendItem(WebInspector.UIString(\"Delete\"), this._deleteCallback.bind(this, gridNode));\n        \n        contextMenu.show(event);\n    },\n\n    _clickInDataTable: function(event)\n    {\n        var gridNode = this.dataGridNodeFromNode(event.target);\n        if (!gridNode || !gridNode.hasChildren)\n            return;\n\n        if (!gridNode.isEventWithinDisclosureTriangle(event))\n            return;\n\n        if (gridNode.expanded) {\n            if (event.altKey)\n                gridNode.collapseRecursively();\n            else\n                gridNode.collapse();\n        } else {\n            if (event.altKey)\n                gridNode.expandRecursively();\n            else\n                gridNode.expand();\n        }\n    },\n    \n    _startResizerDragging: function(event)\n    {\n        this.currentResizer = event.target;\n        if (!this.currentResizer.rightNeighboringColumnID)\n            return;\n        WebInspector.elementDragStart(this.lastResizer, this._resizerDragging.bind(this),\n            this._endResizerDragging.bind(this), event, \"col-resize\");\n    },\n    \n    _resizerDragging: function(event)\n    {\n        var resizer = this.currentResizer;\n        if (!resizer)\n            return;\n        \n        // Constrain the dragpoint to be within the containing div of the\n        // datagrid.\n        var dragPoint = event.clientX - this.element.totalOffsetLeft;\n        // Constrain the dragpoint to be within the space made up by the\n        // column directly to the left and the column directly to the right.\n        var leftEdgeOfPreviousColumn = 0;\n        var firstRowCells = this.headerTableBody.rows[0].cells;\n        for (var i = 0; i < resizer.leftNeighboringColumnID; i++)\n            leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth;\n            \n        var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[resizer.leftNeighboringColumnID].offsetWidth + firstRowCells[resizer.rightNeighboringColumnID].offsetWidth;\n\n        // Give each column some padding so that they don't disappear.\n        var leftMinimum = leftEdgeOfPreviousColumn + this.ColumnResizePadding;\n        var rightMaximum = rightEdgeOfNextColumn - this.ColumnResizePadding;\n\n        dragPoint = Number.constrain(dragPoint, leftMinimum, rightMaximum);\n\n        resizer.style.left = (dragPoint - this.CenterResizerOverBorderAdjustment) + \"px\";\n\n        var percentLeftColumn = (((dragPoint - leftEdgeOfPreviousColumn) / this._dataTable.offsetWidth) * 100) + \"%\";\n        this._headerTableColumnGroup.children[resizer.leftNeighboringColumnID].style.width = percentLeftColumn;\n        this._dataTableColumnGroup.children[resizer.leftNeighboringColumnID].style.width = percentLeftColumn;\n\n        var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / this._dataTable.offsetWidth) * 100) + \"%\";\n        this._headerTableColumnGroup.children[resizer.rightNeighboringColumnID].style.width =  percentRightColumn;\n        this._dataTableColumnGroup.children[resizer.rightNeighboringColumnID].style.width = percentRightColumn;\n\n        this._positionResizers();\n        event.preventDefault();\n        this.dispatchEventToListeners(\"width changed\");\n    },\n    \n    _endResizerDragging: function(event)\n    {\n        WebInspector.elementDragEnd(event);\n        this.currentResizer = null;\n        this.dispatchEventToListeners(\"width changed\");\n    },\n    \n    ColumnResizePadding: 10,\n    \n    CenterResizerOverBorderAdjustment: 3,\n}\n\nWebInspector.DataGrid.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.DataGridNode = function(data, hasChildren)\n{\n    this._expanded = false;\n    this._selected = false;\n    this._shouldRefreshChildren = true;\n    this._data = data || {};\n    this.hasChildren = hasChildren || false;\n    this.children = [];\n    this.dataGrid = null;\n    this.parent = null;\n    this.previousSibling = null;\n    this.nextSibling = null;\n    this.disclosureToggleWidth = 10;\n}\n\nWebInspector.DataGridNode.prototype = {\n    selectable: true,\n\n    get element()\n    {\n        if (this._element)\n            return this._element;\n\n        if (!this.dataGrid)\n            return null;\n\n        this._element = document.createElement(\"tr\");\n        this._element._dataGridNode = this;\n\n        if (this.hasChildren)\n            this._element.addStyleClass(\"parent\");\n        if (this.expanded)\n            this._element.addStyleClass(\"expanded\");\n        if (this.selected)\n            this._element.addStyleClass(\"selected\");\n        if (this.revealed)\n            this._element.addStyleClass(\"revealed\");\n\n        this.createCells();\n        return this._element;\n    },\n\n    createCells: function()\n    {\n        for (var columnIdentifier in this.dataGrid.columns) {\n            var cell = this.createCell(columnIdentifier);\n            this._element.appendChild(cell);\n        }\n    },\n\n    get data()\n    {\n        return this._data;\n    },\n\n    set data(x)\n    {\n        this._data = x || {};\n        this.refresh();\n    },\n\n    get revealed()\n    {\n        if (\"_revealed\" in this)\n            return this._revealed;\n\n        var currentAncestor = this.parent;\n        while (currentAncestor && !currentAncestor.root) {\n            if (!currentAncestor.expanded) {\n                this._revealed = false;\n                return false;\n            }\n\n            currentAncestor = currentAncestor.parent;\n        }\n\n        this._revealed = true;\n        return true;\n    },\n\n    set hasChildren(x)\n    {\n        if (this._hasChildren === x)\n            return;\n\n        this._hasChildren = x;\n\n        if (!this._element)\n            return;\n\n        if (this._hasChildren)\n        {\n            this._element.addStyleClass(\"parent\");\n            if (this.expanded)\n                this._element.addStyleClass(\"expanded\");\n        }\n        else\n        {\n            this._element.removeStyleClass(\"parent\");\n            this._element.removeStyleClass(\"expanded\");\n        }\n    },\n\n    get hasChildren()\n    {\n        return this._hasChildren;\n    },\n\n    set revealed(x)\n    {\n        if (this._revealed === x)\n            return;\n\n        this._revealed = x;\n\n        if (this._element) {\n            if (this._revealed)\n                this._element.addStyleClass(\"revealed\");\n            else\n                this._element.removeStyleClass(\"revealed\");\n        }\n\n        for (var i = 0; i < this.children.length; ++i)\n            this.children[i].revealed = x && this.expanded;\n    },\n\n    get depth()\n    {\n        if (\"_depth\" in this)\n            return this._depth;\n        if (this.parent && !this.parent.root)\n            this._depth = this.parent.depth + 1;\n        else\n            this._depth = 0;\n        return this._depth;\n    },\n\n    get shouldRefreshChildren()\n    {\n        return this._shouldRefreshChildren;\n    },\n\n    set shouldRefreshChildren(x)\n    {\n        this._shouldRefreshChildren = x;\n        if (x && this.expanded)\n            this.expand();\n    },\n\n    get selected()\n    {\n        return this._selected;\n    },\n\n    set selected(x)\n    {\n        if (x)\n            this.select();\n        else\n            this.deselect();\n    },\n\n    get expanded()\n    {\n        return this._expanded;\n    },\n\n    set expanded(x)\n    {\n        if (x)\n            this.expand();\n        else\n            this.collapse();\n    },\n\n    refresh: function()\n    {\n        if (!this._element || !this.dataGrid)\n            return;\n\n        this._element.removeChildren();\n        this.createCells();\n    },\n\n    createCell: function(columnIdentifier)\n    {\n        var cell = document.createElement(\"td\");\n        cell.className = columnIdentifier + \"-column\";\n\n        var alignment = this.dataGrid.aligned[columnIdentifier];\n        if (alignment)\n            cell.addStyleClass(alignment);\n\n        var div = document.createElement(\"div\");\n        div.textContent = this.data[columnIdentifier];\n        cell.appendChild(div);\n\n        if (columnIdentifier === this.dataGrid.disclosureColumnIdentifier) {\n            cell.addStyleClass(\"disclosure\");\n            if (this.depth)\n                cell.style.setProperty(\"padding-left\", (this.depth * this.dataGrid.indentWidth) + \"px\");\n        }\n\n        return cell;\n    },\n\n    // Share these functions with DataGrid. They are written to work with a DataGridNode this object.\n    appendChild: WebInspector.DataGrid.prototype.appendChild,\n    insertChild: WebInspector.DataGrid.prototype.insertChild,\n    removeChild: WebInspector.DataGrid.prototype.removeChild,\n    removeChildren: WebInspector.DataGrid.prototype.removeChildren,\n    removeChildrenRecursive: WebInspector.DataGrid.prototype.removeChildrenRecursive,\n\n    _recalculateSiblings: function(myIndex)\n    {\n        if (!this.parent)\n            return;\n\n        var previousChild = (myIndex > 0 ? this.parent.children[myIndex - 1] : null);\n\n        if (previousChild) {\n            previousChild.nextSibling = this;\n            this.previousSibling = previousChild;\n        } else\n            this.previousSibling = null;\n\n        var nextChild = this.parent.children[myIndex + 1];\n\n        if (nextChild) {\n            nextChild.previousSibling = this;\n            this.nextSibling = nextChild;\n        } else\n            this.nextSibling = null;\n    },\n\n    collapse: function()\n    {\n        if (this._element)\n            this._element.removeStyleClass(\"expanded\");\n\n        this._expanded = false;\n\n        for (var i = 0; i < this.children.length; ++i)\n            this.children[i].revealed = false;\n\n        this.dispatchEventToListeners(\"collapsed\");\n    },\n\n    collapseRecursively: function()\n    {\n        var item = this;\n        while (item) {\n            if (item.expanded)\n                item.collapse();\n            item = item.traverseNextNode(false, this, true);\n        }\n    },\n\n    expand: function()\n    {\n        if (!this.hasChildren || this.expanded)\n            return;\n\n        if (this.revealed && !this._shouldRefreshChildren)\n            for (var i = 0; i < this.children.length; ++i)\n                this.children[i].revealed = true;\n\n        if (this._shouldRefreshChildren) {\n            for (var i = 0; i < this.children.length; ++i)\n                this.children[i]._detach();\n\n            this.dispatchEventToListeners(\"populate\");\n\n            if (this._attached) {\n                for (var i = 0; i < this.children.length; ++i) {\n                    var child = this.children[i];\n                    if (this.revealed)\n                        child.revealed = true;\n                    child._attach();\n                }\n            }\n\n            delete this._shouldRefreshChildren;\n        }\n\n        if (this._element)\n            this._element.addStyleClass(\"expanded\");\n\n        this._expanded = true;\n\n        this.dispatchEventToListeners(\"expanded\");\n    },\n\n    expandRecursively: function()\n    {\n        var item = this;\n        while (item) {\n            item.expand();\n            item = item.traverseNextNode(false, this);\n        }\n    },\n\n    reveal: function()\n    {\n        var currentAncestor = this.parent;\n        while (currentAncestor && !currentAncestor.root) {\n            if (!currentAncestor.expanded)\n                currentAncestor.expand();\n            currentAncestor = currentAncestor.parent;\n        }\n\n        this.element.scrollIntoViewIfNeeded(false);\n\n        this.dispatchEventToListeners(\"revealed\");\n    },\n\n    select: function(supressSelectedEvent)\n    {\n        if (!this.dataGrid || !this.selectable || this.selected)\n            return;\n\n        if (this.dataGrid.selectedNode)\n            this.dataGrid.selectedNode.deselect();\n\n        this._selected = true;\n        this.dataGrid.selectedNode = this;\n\n        if (this._element)\n            this._element.addStyleClass(\"selected\");\n\n        if (!supressSelectedEvent)\n            this.dispatchEventToListeners(\"selected\");\n    },\n\n    deselect: function(supressDeselectedEvent)\n    {\n        if (!this.dataGrid || this.dataGrid.selectedNode !== this || !this.selected)\n            return;\n\n        this._selected = false;\n        this.dataGrid.selectedNode = null;\n\n        if (this._element)\n            this._element.removeStyleClass(\"selected\");\n\n        if (!supressDeselectedEvent)\n            this.dispatchEventToListeners(\"deselected\");\n    },\n\n    traverseNextNode: function(skipHidden, stayWithin, dontPopulate, info)\n    {\n        if (!dontPopulate && this.hasChildren)\n            this.dispatchEventToListeners(\"populate\");\n\n        if (info)\n            info.depthChange = 0;\n\n        var node = (!skipHidden || this.revealed) ? this.children[0] : null;\n        if (node && (!skipHidden || this.expanded)) {\n            if (info)\n                info.depthChange = 1;\n            return node;\n        }\n\n        if (this === stayWithin)\n            return null;\n\n        node = (!skipHidden || this.revealed) ? this.nextSibling : null;\n        if (node)\n            return node;\n\n        node = this;\n        while (node && !node.root && !((!skipHidden || node.revealed) ? node.nextSibling : null) && node.parent !== stayWithin) {\n            if (info)\n                info.depthChange -= 1;\n            node = node.parent;\n        }\n\n        if (!node)\n            return null;\n\n        return (!skipHidden || node.revealed) ? node.nextSibling : null;\n    },\n\n    traversePreviousNode: function(skipHidden, dontPopulate)\n    {\n        var node = (!skipHidden || this.revealed) ? this.previousSibling : null;\n        if (!dontPopulate && node && node.hasChildren)\n            node.dispatchEventToListeners(\"populate\");\n\n        while (node && ((!skipHidden || (node.revealed && node.expanded)) ? node.children[node.children.length - 1] : null)) {\n            if (!dontPopulate && node.hasChildren)\n                node.dispatchEventToListeners(\"populate\");\n            node = ((!skipHidden || (node.revealed && node.expanded)) ? node.children[node.children.length - 1] : null);\n        }\n\n        if (node)\n            return node;\n\n        if (!this.parent || this.parent.root)\n            return null;\n\n        return this.parent;\n    },\n\n    isEventWithinDisclosureTriangle: function(event)\n    {\n        if (!this.hasChildren)\n            return false;\n        var cell = event.target.enclosingNodeOrSelfWithNodeName(\"td\");\n        if (!cell.hasStyleClass(\"disclosure\"))\n            return false;\n        var computedLeftPadding = window.getComputedStyle(cell).getPropertyCSSValue(\"padding-left\").getFloatValue(CSSPrimitiveValue.CSS_PX);\n        var left = cell.totalOffsetLeft + computedLeftPadding;\n        return event.pageX >= left && event.pageX <= left + this.disclosureToggleWidth;\n    },\n\n    _attach: function()\n    {\n        if (!this.dataGrid || this._attached)\n            return;\n\n        this._attached = true;\n\n        var nextNode = null;\n        var previousNode = this.traversePreviousNode(true, true);\n        if (previousNode && previousNode.element.parentNode && previousNode.element.nextSibling)\n            var nextNode = previousNode.element.nextSibling;\n        if (!nextNode)\n            nextNode = this.dataGrid.dataTableBody.lastChild;\n        this.dataGrid.dataTableBody.insertBefore(this.element, nextNode);\n\n        if (this.expanded)\n            for (var i = 0; i < this.children.length; ++i)\n                this.children[i]._attach();\n    },\n\n    _detach: function()\n    {\n        if (!this._attached)\n            return;\n\n        this._attached = false;\n\n        if (this._element && this._element.parentNode)\n            this._element.parentNode.removeChild(this._element);\n\n        for (var i = 0; i < this.children.length; ++i)\n            this.children[i]._detach();\n    },\n\n    savePosition: function()\n    {\n        if (this._savedPosition)\n            return;\n\n        if (!this.parent)\n            throw(\"savePosition: Node must have a parent.\");\n        this._savedPosition = {\n            parent: this.parent,\n            index: this.parent.children.indexOf(this)\n        };\n    },\n\n    restorePosition: function()\n    {\n        if (!this._savedPosition)\n            return;\n\n        if (this.parent !== this._savedPosition.parent)\n            this._savedPosition.parent.insertChild(this, this._savedPosition.index);\n\n        delete this._savedPosition;\n    }\n}\n\nWebInspector.DataGridNode.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.CreationDataGridNode = function(data, hasChildren)\n{\n    WebInspector.DataGridNode.call(this, data, hasChildren);\n    this.isCreationNode = true;\n}\n\nWebInspector.CreationDataGridNode.prototype = {\n    makeNormal: function()\n    {\n        delete this.isCreationNode;\n        delete this.makeNormal;\n    }\n}\n\nWebInspector.CreationDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Database.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Database = function(id, domain, name, version)\n{\n    this._id = id;\n    this._domain = domain;\n    this._name = name;\n    this._version = version;\n}\n\nWebInspector.Database.prototype = {\n    get id()\n    {\n        return this._id;\n    },\n\n    get name()\n    {\n        return this._name;\n    },\n\n    set name(x)\n    {\n        this._name = x;\n    },\n\n    get version()\n    {\n        return this._version;\n    },\n\n    set version(x)\n    {\n        this._version = x;\n    },\n\n    get domain()\n    {\n        return this._domain;\n    },\n\n    set domain(x)\n    {\n        this._domain = x;\n    },\n\n    get displayDomain()\n    {\n        return WebInspector.Resource.prototype.__lookupGetter__(\"displayDomain\").call(this);\n    },\n\n    getTableNames: function(callback)\n    {\n        function sortingCallback(names)\n        {\n            callback(names.sort());\n        }\n        InspectorBackend.getDatabaseTableNames(this._id, sortingCallback);\n    },\n    \n    executeSql: function(query, onSuccess, onError)\n    {\n        function callback(success, transactionId)\n        {\n            if (!success) {\n                onError(WebInspector.UIString(\"Database not found.\"));\n                return;\n            }\n            WebInspector.DatabaseDispatcher._callbacks[transactionId] = {\"onSuccess\": onSuccess, \"onError\": onError};\n        }\n        InspectorBackend.executeSQL(this._id, query, callback);\n    }\n}\n\nWebInspector.DatabaseDispatcher = function()\n{\n}\n\nWebInspector.DatabaseDispatcher._callbacks = {};\n\nWebInspector.DatabaseDispatcher.prototype = {\n    addDatabase: function(payload)\n    {\n        var database = new WebInspector.Database(\n            payload.id,\n            payload.domain,\n            payload.name,\n            payload.version);\n        WebInspector.panels.resources.addDatabase(database);\n    },\n\n    selectDatabase: function(o)\n    {\n        WebInspector.showPanel(\"resources\");\n        WebInspector.panels.resources.selectDatabase(o);\n    },\n\n    sqlTransactionSucceeded: function(transactionId, columnNames, values)\n    {\n        if (!WebInspector.DatabaseDispatcher._callbacks[transactionId])\n            return;\n    \n        var callback = WebInspector.DatabaseDispatcher._callbacks[transactionId].onSuccess;\n        delete WebInspector.DatabaseDispatcher._callbacks[transactionId];\n        if (callback)\n            callback(columnNames, values);\n    },\n\n    sqlTransactionFailed: function(transactionId, errorObj)\n    {\n        if (!WebInspector.DatabaseDispatcher._callbacks[transactionId])\n            return;\n\n        var callback = WebInspector.DatabaseDispatcher._callbacks[transactionId].onError;\n        delete WebInspector.DatabaseDispatcher._callbacks[transactionId];\n        if (callback)\n             callback(errorObj);\n    }\n}\n\nInspectorBackend.registerDomainDispatcher(\"Database\", new WebInspector.DatabaseDispatcher());\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DatabaseQueryView.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DatabaseQueryView = function(database)\n{\n    WebInspector.View.call(this);\n\n    this.database = database;\n\n    this.element.addStyleClass(\"storage-view\");\n    this.element.addStyleClass(\"query\");\n    this.element.addStyleClass(\"monospace\");\n    this.element.tabIndex = 0;\n\n    this.element.addEventListener(\"selectstart\", this._selectStart.bind(this), false);\n\n    this.promptElement = document.createElement(\"div\");\n    this.promptElement.className = \"database-query-prompt\";\n    this.promptElement.appendChild(document.createElement(\"br\"));\n    this.promptElement.addEventListener(\"keydown\", this._promptKeyDown.bind(this), true);\n    this.element.appendChild(this.promptElement);\n\n    this.prompt = new WebInspector.TextPrompt(this.promptElement, this.completions.bind(this), \" \");\n}\n\nWebInspector.DatabaseQueryView.prototype = {\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n\n        function moveBackIfOutside()\n        {\n            if (!this.prompt.isCaretInsidePrompt() && window.getSelection().isCollapsed)\n                this.prompt.moveCaretToEndOfPrompt();\n        }\n\n        setTimeout(moveBackIfOutside.bind(this), 0);\n    },\n\n    completions: function(wordRange, bestMatchOnly, completionsReadyCallback)\n    {\n        var prefix = wordRange.toString().toLowerCase();\n        if (!prefix.length)\n            return;\n\n        var results = [];\n\n        function accumulateMatches(textArray)\n        {\n            if (bestMatchOnly && results.length)\n                return;\n            for (var i = 0; i < textArray.length; ++i) {\n                var text = textArray[i].toLowerCase();\n                if (text.length < prefix.length)\n                    continue;\n                if (text.indexOf(prefix) !== 0)\n                    continue;\n                results.push(textArray[i]);\n                if (bestMatchOnly)\n                    return;\n            }\n        }\n        \n        function tableNamesCallback(tableNames)\n        {\n            accumulateMatches(tableNames.map(function(name) { return name + \" \" }));\n            accumulateMatches([\"SELECT \", \"FROM \", \"WHERE \", \"LIMIT \", \"DELETE FROM \", \"CREATE \", \"DROP \", \"TABLE \", \"INDEX \", \"UPDATE \", \"INSERT INTO \", \"VALUES (\"]);\n\n            completionsReadyCallback(results);\n        }\n        this.database.getTableNames(tableNamesCallback);\n    },\n\n    _promptKeyDown: function(event)\n    {\n        if (isEnterKey(event)) {\n            this._enterKeyPressed(event);\n            return;\n        }\n    },\n\n    _selectStart: function(event)\n    {\n        if (this._selectionTimeout)\n            clearTimeout(this._selectionTimeout);\n\n        this.prompt.clearAutoComplete();\n\n        function moveBackIfOutside()\n        {\n            delete this._selectionTimeout;\n            if (!this.prompt.isCaretInsidePrompt() && window.getSelection().isCollapsed)\n                this.prompt.moveCaretToEndOfPrompt();\n            this.prompt.autoCompleteSoon();\n        }\n\n        this._selectionTimeout = setTimeout(moveBackIfOutside.bind(this), 100);\n    },\n\n    _enterKeyPressed: function(event)\n    {\n        event.preventDefault();\n        event.stopPropagation();\n\n        this.prompt.clearAutoComplete(true);\n\n        var query = this.prompt.text;\n        if (!query.length)\n            return;\n\n        this.prompt.history.push(query);\n        this.prompt.historyOffset = 0;\n        this.prompt.text = \"\";\n\n        this.database.executeSql(query, this._queryFinished.bind(this, query), this._queryError.bind(this, query));\n    },\n\n    _queryFinished: function(query, columnNames, values)\n    {\n        var dataGrid = WebInspector.panels.resources.dataGridForResult(columnNames, values);\n        var trimmedQuery = query.trim();\n\n        if (dataGrid) {\n            dataGrid.element.addStyleClass(\"inline\");\n            this._appendQueryResult(trimmedQuery, dataGrid.element);\n            dataGrid.autoSizeColumns(5);            \n        }\n\n        if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table /i))\n            WebInspector.panels.resources.updateDatabaseTables(this.database);\n    },\n\n    _queryError: function(query, error)\n    {\n        if (error.message)\n            var message = error.message;\n        else if (error.code == 2)\n            var message = WebInspector.UIString(\"Database no longer has expected version.\");\n        else\n            var message = WebInspector.UIString(\"An unexpected error %s occurred.\", error.code);\n\n        this._appendQueryResult(query, message, \"error\");\n    },\n\n    _appendQueryResult: function(query, result, resultClassName)\n    {\n        var element = document.createElement(\"div\");\n        element.className = \"database-user-query\";\n\n        var commandTextElement = document.createElement(\"span\");\n        commandTextElement.className = \"database-query-text\";\n        commandTextElement.textContent = query;\n        element.appendChild(commandTextElement);\n\n        var resultElement = document.createElement(\"div\");\n        resultElement.className = \"database-query-result\";\n\n        if (resultClassName)\n            resultElement.addStyleClass(resultClassName);\n\n        if (typeof result === \"string\" || result instanceof String)\n            resultElement.textContent = result;\n        else if (result && result.nodeName)\n            resultElement.appendChild(result);\n\n        if (resultElement.childNodes.length)\n            element.appendChild(resultElement);\n\n        this.element.insertBefore(element, this.promptElement);\n        this.promptElement.scrollIntoView(false);\n    }\n}\n\nWebInspector.DatabaseQueryView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DatabaseTableView.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DatabaseTableView = function(database, tableName)\n{\n    WebInspector.View.call(this);\n\n    this.database = database;\n    this.tableName = tableName;\n\n    this.element.addStyleClass(\"storage-view\");\n    this.element.addStyleClass(\"table\");\n\n    this.refreshButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Refresh\"), \"refresh-storage-status-bar-item\");\n    this.refreshButton.addEventListener(\"click\", this._refreshButtonClicked.bind(this), false);\n}\n\nWebInspector.DatabaseTableView.prototype = {\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this.update();\n    },\n\n    get statusBarItems()\n    {\n        return [this.refreshButton.element];\n    },\n\n    update: function()\n    {\n        this.database.executeSql(\"SELECT * FROM \" + this.tableName, this._queryFinished.bind(this), this._queryError.bind(this));\n    },\n\n    _queryFinished: function(columnNames, values)\n    {\n        this.element.removeChildren();\n\n        var dataGrid = WebInspector.panels.resources.dataGridForResult(columnNames, values);\n        if (!dataGrid) {\n            var emptyMsgElement = document.createElement(\"div\");\n            emptyMsgElement.className = \"storage-empty-view\";\n            emptyMsgElement.textContent = WebInspector.UIString(\"The “%s”\\ntable is empty.\", this.tableName);\n            this.element.appendChild(emptyMsgElement);\n            return;\n        }\n\n        this.element.appendChild(dataGrid.element);\n        dataGrid.autoSizeColumns(5);\n    },\n\n    _queryError: function(error)\n    {\n        this.element.removeChildren();\n\n        var errorMsgElement = document.createElement(\"div\");\n        errorMsgElement.className = \"storage-table-error\";\n        errorMsgElement.textContent = WebInspector.UIString(\"An error occurred trying to\\nread the “%s” table.\", this.tableName);\n        this.element.appendChild(errorMsgElement);\n    },\n\n    _refreshButtonClicked: function(event)\n    {\n        this.update();\n    }\n}\n\nWebInspector.DatabaseTableView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DebuggerModel.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DebuggerModel = function()\n{\n    this._paused = false;\n    this._callFrames = [];\n    this._breakpoints = {};\n    this._scripts = {};\n\n    InspectorBackend.registerDomainDispatcher(\"Debugger\", new WebInspector.DebuggerDispatcher(this));\n}\n\nWebInspector.DebuggerModel.Events = {\n    DebuggerPaused: \"debugger-paused\",\n    DebuggerResumed: \"debugger-resumed\",\n    ParsedScriptSource: \"parsed-script-source\",\n    FailedToParseScriptSource: \"failed-to-parse-script-source\",\n    ScriptSourceChanged: \"script-source-changed\",\n    BreakpointAdded: \"breakpoint-added\",\n    BreakpointRemoved: \"breakpoint-removed\",\n    BreakpointResolved: \"breakpoint-resolved\"\n}\n\nWebInspector.DebuggerModel.prototype = {\n    enableDebugger: function()\n    {\n        InspectorBackend.enableDebugger();\n        if (this._breakpointsPushedToBackend)\n            return;\n        var breakpoints = WebInspector.settings.breakpoints;\n        for (var i = 0; i < breakpoints.length; ++i) {\n            var breakpoint = breakpoints[i];\n            if (typeof breakpoint.url !== \"string\" || typeof breakpoint.lineNumber !== \"number\" || typeof breakpoint.columnNumber !== \"number\" ||\n                typeof breakpoint.condition !== \"string\" || typeof breakpoint.enabled !== \"boolean\")\n                continue;\n            this.setBreakpoint(breakpoint.url, breakpoint.lineNumber, breakpoint.columnNumber, breakpoint.condition, breakpoint.enabled);\n        }\n        this._breakpointsPushedToBackend = true;\n    },\n\n    disableDebugger: function()\n    {\n        InspectorBackend.disableDebugger();\n    },\n\n    continueToLocation: function(sourceID, lineNumber, columnNumber)\n    {\n        InspectorBackend.continueToLocation(sourceID, lineNumber, columnNumber);\n    },\n\n    setBreakpoint: function(url, lineNumber, columnNumber, condition, enabled)\n    {\n        function didSetBreakpoint(breakpointsPushedToBackend, breakpointId, locations)\n        {\n            if (!breakpointId)\n                return;\n            var breakpoint = new WebInspector.Breakpoint(breakpointId, url, \"\", lineNumber, columnNumber, condition, enabled);\n            breakpoint.locations = locations;\n            this._breakpoints[breakpointId] = breakpoint;\n            if (breakpointsPushedToBackend)\n                this._saveBreakpoints();\n            this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointAdded, breakpoint);\n        }\n        InspectorBackend.setJavaScriptBreakpoint(url, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this, this._breakpointsPushedToBackend));\n    },\n\n    setBreakpointBySourceId: function(sourceID, lineNumber, columnNumber, condition, enabled)\n    {\n        function didSetBreakpoint(breakpointId, actualLineNumber, actualColumnNumber)\n        {\n            if (!breakpointId)\n                return;\n            var breakpoint = new WebInspector.Breakpoint(breakpointId, \"\", sourceID, lineNumber, columnNumber, condition, enabled);\n            breakpoint.addLocation(sourceID, actualLineNumber, actualColumnNumber);\n            this._breakpoints[breakpointId] = breakpoint;\n            this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointAdded, breakpoint);\n        }\n        InspectorBackend.setJavaScriptBreakpointBySourceId(sourceID, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this));\n    },\n\n    removeBreakpoint: function(breakpointId)\n    {\n        InspectorBackend.removeJavaScriptBreakpoint(breakpointId);\n        var breakpoint = this._breakpoints[breakpointId];\n        delete this._breakpoints[breakpointId];\n        this._saveBreakpoints();\n        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointRemoved, breakpointId);\n    },\n\n    updateBreakpoint: function(breakpointId, condition, enabled)\n    {\n        var breakpoint = this._breakpoints[breakpointId];\n        this.removeBreakpoint(breakpointId);\n        if (breakpoint.url)\n            this.setBreakpoint(breakpoint.url, breakpoint.lineNumber, breakpoint.columnNumber, condition, enabled);\n        else\n            this.setBreakpointBySourceId(breakpoint.sourceID, breakpoint.lineNumber, breakpoint.columnNumber, condition, enabled);\n    },\n\n    _breakpointResolved: function(breakpointId, sourceID, lineNumber, columnNumber)\n    {\n        var breakpoint = this._breakpoints[breakpointId];\n        if (!breakpoint)\n            return;\n        breakpoint.addLocation(sourceID, lineNumber, columnNumber);\n        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointResolved, breakpoint);\n    },\n\n    _saveBreakpoints: function()\n    {\n        var serializedBreakpoints = [];\n        for (var id in this._breakpoints) {\n            var breakpoint = this._breakpoints[id];\n            if (!breakpoint.url)\n                continue;\n            var serializedBreakpoint = {};\n            serializedBreakpoint.url = breakpoint.url;\n            serializedBreakpoint.lineNumber = breakpoint.lineNumber;\n            serializedBreakpoint.columnNumber = breakpoint.columnNumber;\n            serializedBreakpoint.condition = breakpoint.condition;\n            serializedBreakpoint.enabled = breakpoint.enabled;\n            serializedBreakpoints.push(serializedBreakpoint);\n        }\n        WebInspector.settings.breakpoints = serializedBreakpoints;\n    },\n\n    get breakpoints()\n    {\n        return this._breakpoints;\n    },\n\n    breakpointForId: function(breakpointId)\n    {\n        return this._breakpoints[breakpointId];\n    },\n\n    queryBreakpoints: function(filter)\n    {\n        var breakpoints = [];\n        for (var id in this._breakpoints) {\n           var breakpoint = this._breakpoints[id];\n           if (filter(breakpoint))\n               breakpoints.push(breakpoint);\n        }\n        return breakpoints;\n    },\n\n    reset: function()\n    {\n        this._paused = false;\n        this._callFrames = [];\n        for (var id in this._breakpoints) {\n            var breakpoint = this._breakpoints[id];\n            if (!breakpoint.url)\n                this.removeBreakpoint(id);\n            else\n                breakpoint.locations = [];\n        }\n        this._scripts = {};\n    },\n\n    scriptForSourceID: function(sourceID)\n    {\n        return this._scripts[sourceID];\n    },\n\n    scriptsForURL: function(url)\n    {\n        return this.queryScripts(function(s) { return s.sourceURL === url; });\n    },\n\n    queryScripts: function(filter)\n    {\n        var scripts = [];\n        for (var sourceID in this._scripts) {\n            var script = this._scripts[sourceID];\n            if (filter(script))\n                scripts.push(script);\n        }\n        return scripts;\n    },\n\n    editScriptSource: function(sourceID, scriptSource)\n    {\n        function didEditScriptSource(success, newBodyOrErrorMessage, callFrames)\n        {\n            if (success) {\n                if (callFrames && callFrames.length)\n                    this._callFrames = callFrames;\n                this._updateScriptSource(sourceID, newBodyOrErrorMessage);\n            } else\n                WebInspector.log(newBodyOrErrorMessage, WebInspector.ConsoleMessage.MessageLevel.Warning);\n        }\n        InspectorBackend.editScriptSource(sourceID, scriptSource, didEditScriptSource.bind(this));\n    },\n\n    _updateScriptSource: function(sourceID, scriptSource)\n    {\n        var script = this._scripts[sourceID];\n        var oldSource = script.source;\n        script.source = scriptSource;\n\n        // Clear and re-create breakpoints according to text diff.\n        var diff = Array.diff(oldSource.split(\"\\n\"), script.source.split(\"\\n\"));\n        for (var id in this._breakpoints) {\n            var breakpoint = this._breakpoints[id];\n            if (breakpoint.url) {\n                if (breakpoint.url !== script.sourceURL)\n                    continue;\n            } else {\n                if (breakpoint.sourceID !== sourceID)\n                    continue;\n            }\n            this.removeBreakpoint(breakpoint.id);\n            var lineNumber = breakpoint.lineNumber;\n            var newLineNumber = diff.left[lineNumber].row;\n            if (newLineNumber === undefined) {\n                for (var i = lineNumber - 1; i >= 0; --i) {\n                    if (diff.left[i].row === undefined)\n                        continue;\n                    var shiftedLineNumber = diff.left[i].row + lineNumber - i;\n                    if (shiftedLineNumber < diff.right.length) {\n                        var originalLineNumber = diff.right[shiftedLineNumber].row;\n                        if (originalLineNumber === lineNumber || originalLineNumber === undefined)\n                            newLineNumber = shiftedLineNumber;\n                    }\n                    break;\n                }\n            }\n            if (newLineNumber === undefined)\n                continue;\n            if (breakpoint.url)\n                this.setBreakpoint(breakpoint.url, newLineNumber, breakpoint.columnNumber, breakpoint.condition, breakpoint.enabled);\n            else\n                this.setBreakpointBySourceId(sourceID, newLineNumber, breakpoint.columnNumber, breakpoint.condition, breakpoint.enabled);\n        }\n\n        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ScriptSourceChanged, { sourceID: sourceID, oldSource: oldSource });\n    },\n\n    get callFrames()\n    {\n        return this._callFrames;\n    },\n\n    _pausedScript: function(details)\n    {\n        this._paused = true;\n        this._callFrames = details.callFrames;\n        details.breakpoint = this._breakpointForCallFrame(details.callFrames[0]);\n        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerPaused, details);\n    },\n\n    _resumedScript: function()\n    {\n        this._paused = false;\n        this._callFrames = [];\n        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerResumed);\n    },\n\n    _breakpointForCallFrame: function(callFrame)\n    {\n        function match(location)\n        {\n            if (location.sourceID != callFrame.sourceID)\n                return false;\n            return location.lineNumber === callFrame.line && location.columnNumber === callFrame.column;\n        }\n        for (var id in this._breakpoints) {\n            var breakpoint = this._breakpoints[id];\n            for (var i = 0; i < breakpoint.locations.length; ++i) {\n                if (match(breakpoint.locations[i]))\n                    return breakpoint;\n            }\n        }\n    },\n\n    _parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType)\n    {\n        var script = new WebInspector.Script(sourceID, sourceURL, \"\", lineOffset, columnOffset, length, undefined, undefined, scriptWorldType);\n        this._scripts[sourceID] = script;\n        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script);\n    },\n\n    _failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)\n    {\n        var script = new WebInspector.Script(null, sourceURL, source, startingLine, errorLine, errorMessage, undefined);\n        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, script);\n    }\n}\n\nWebInspector.DebuggerModel.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.DebuggerEventTypes = {\n    JavaScriptPause: 0,\n    JavaScriptBreakpoint: 1,\n    NativeBreakpoint: 2\n};\n\nWebInspector.DebuggerDispatcher = function(debuggerModel)\n{\n    this._debuggerModel = debuggerModel;\n}\n\nWebInspector.DebuggerDispatcher.prototype = {\n    pausedScript: function(details)\n    {\n        this._debuggerModel._pausedScript(details);\n    },\n\n    resumedScript: function()\n    {\n        this._debuggerModel._resumedScript();\n    },\n\n    debuggerWasEnabled: function()\n    {\n        WebInspector.panels.scripts.debuggerWasEnabled();\n    },\n\n    debuggerWasDisabled: function()\n    {\n        WebInspector.panels.scripts.debuggerWasDisabled();\n    },\n\n    parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType)\n    {\n        this._debuggerModel._parsedScriptSource(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType);\n    },\n\n    failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)\n    {\n        this._debuggerModel._failedToParseScriptSource(sourceURL, source, startingLine, errorLine, errorMessage);\n    },\n\n    breakpointResolved: function(breakpointId, sourceID, lineNumber, columnNumber)\n    {\n        this._debuggerModel._breakpointResolved(breakpointId, sourceID, lineNumber, columnNumber);\n    },\n\n    didCreateWorker: function()\n    {\n        var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;\n        workersPane.addWorker.apply(workersPane, arguments);\n    },\n\n    didDestroyWorker: function()\n    {\n        var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;\n        workersPane.removeWorker.apply(workersPane, arguments);\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/DetailedHeapshotView.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.DetailedHeapshotView = function(parent, profile)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"heap-snapshot-view\");\n\n    this.parent = parent;\n    this.profile = profile;\n}\n\nWebInspector.DetailedHeapshotView.prototype = {\n    get profile()\n    {\n        return this._profile;\n    },\n\n    set profile(profile)\n    {\n        this._profile = profile;\n    }\n};\n\nWebInspector.DetailedHeapshotView.prototype.__proto__ = WebInspector.View.prototype;\n\nWebInspector.DetailedHeapshotProfileType = function()\n{\n    WebInspector.ProfileType.call(this, WebInspector.HeapSnapshotProfileType.TypeId, WebInspector.UIString(\"HEAP SNAPSHOTS\"));\n}\n\nWebInspector.DetailedHeapshotProfileType.prototype = {\n    get buttonTooltip()\n    {\n        return WebInspector.UIString(\"Take heap snapshot.\");\n    },\n\n    get buttonStyle()\n    {\n        return \"heap-snapshot-status-bar-item status-bar-item\";\n    },\n\n    buttonClicked: function()\n    {\n        WebInspector.panels.profiles.takeHeapSnapshot(true);\n    },\n\n    get welcomeMessage()\n    {\n        return WebInspector.UIString(\"Get a heap snapshot by pressing the %s button on the status bar.\");\n    },\n\n    createSidebarTreeElementForProfile: function(profile)\n    {\n        return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString(\"Snapshot %d\"), \"heap-snapshot-sidebar-tree-item\");\n    },\n\n    createView: function(profile)\n    {\n        return new WebInspector.DetailedHeapshotView(WebInspector.panels.profiles, profile);\n    }\n}\n\nWebInspector.DetailedHeapshotProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Drawer.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Drawer = function()\n{\n    WebInspector.View.call(this, document.getElementById(\"drawer\"));\n\n    this._savedHeight = 200; // Default.\n    this.state = WebInspector.Drawer.State.Hidden;\n    this.fullPanel = false;\n\n    this._mainElement = document.getElementById(\"main\");\n    this._toolbarElement = document.getElementById(\"toolbar\");\n    this._mainStatusBar = document.getElementById(\"main-status-bar\");\n    this._mainStatusBar.addEventListener(\"mousedown\", this._startStatusBarDragging.bind(this), true);\n    this._viewStatusBar = document.getElementById(\"other-drawer-status-bar-items\");\n    this._counters = document.getElementById(\"counters\");\n    this._drawerStatusBar = document.getElementById(\"drawer-status-bar\");\n}\n\nWebInspector.Drawer.prototype = {\n    get visibleView()\n    {\n        return this._visibleView;\n    },\n\n    set visibleView(x)\n    {\n        if (this._visibleView === x) {\n            if (this.visible && this.fullPanel)\n                return;\n            this.visible = !this.visible;\n            return;\n        }\n\n        var firstTime = !this._visibleView;\n        if (this._visibleView)\n            this._visibleView.hide();\n\n        this._visibleView = x;\n\n        if (x && !firstTime) {\n            this._safelyRemoveChildren();\n            this._viewStatusBar.removeChildren(); // optimize this? call old.detach()\n            x.attach(this.element, this._viewStatusBar);\n            x.show();\n            this.visible = true;\n        }\n    },\n\n    get savedHeight()\n    {\n        var height = this._savedHeight || this.element.offsetHeight;\n        return Number.constrain(height, Preferences.minConsoleHeight, window.innerHeight - this._mainElement.totalOffsetTop - Preferences.minConsoleHeight);\n    },\n\n    showView: function(view)\n    {\n        if (!this.visible || this.visibleView !== view)\n            this.visibleView = view;\n    },\n\n    show: function()\n    {\n        if (this._animating || this.visible)\n            return;\n\n        if (this.visibleView)\n            this.visibleView.show();\n\n        WebInspector.View.prototype.show.call(this);\n\n        this._animating = true;\n\n        document.body.addStyleClass(\"drawer-visible\");\n\n        var anchoredItems = document.getElementById(\"anchored-status-bar-items\");\n        var height = (this.fullPanel ? window.innerHeight - this._toolbarElement.offsetHeight : this.savedHeight);\n        var animations = [\n            {element: this.element, end: {height: height}},\n            {element: this._mainElement, end: {bottom: height}},\n            {element: this._mainStatusBar, start: {\"padding-left\": anchoredItems.offsetWidth - 1}, end: {\"padding-left\": 0}},\n            {element: this._viewStatusBar, start: {opacity: 0}, end: {opacity: 1}}\n        ];\n\n        this._drawerStatusBar.insertBefore(anchoredItems, this._drawerStatusBar.firstChild);\n\n        if (this._currentPanelCounters) {\n            var oldRight = this._drawerStatusBar.clientWidth - (this._counters.offsetLeft + this._currentPanelCounters.offsetWidth);\n            var newRight = WebInspector.Panel.counterRightMargin;\n            var rightPadding = (oldRight - newRight);\n            animations.push({element: this._currentPanelCounters, start: {\"padding-right\": rightPadding}, end: {\"padding-right\": 0}});\n            this._currentPanelCounters.parentNode.removeChild(this._currentPanelCounters);\n            this._mainStatusBar.appendChild(this._currentPanelCounters);\n        }\n\n        function animationFinished()\n        {\n            if (\"updateStatusBarItems\" in WebInspector.currentPanel)\n                WebInspector.currentPanel.updateStatusBarItems();\n            if (this.visibleView.afterShow)\n                this.visibleView.afterShow();\n            delete this._animating;\n            delete this._currentAnimation;\n            this.state = (this.fullPanel ? WebInspector.Drawer.State.Full : WebInspector.Drawer.State.Variable);\n            if (this._currentPanelCounters)\n                this._currentPanelCounters.removeAttribute(\"style\");\n        }\n\n        this._currentAnimation = WebInspector.animateStyle(animations, this._animationDuration(), animationFinished.bind(this));\n    },\n\n    hide: function()\n    {\n        if (this._animating || !this.visible)\n            return;\n\n        WebInspector.View.prototype.hide.call(this);\n\n        if (this.visibleView)\n            this.visibleView.hide();\n\n        this._animating = true;\n\n        if (!this.fullPanel)\n            this._savedHeight = this.element.offsetHeight;\n\n        if (this.element === WebInspector.currentFocusElement || this.element.isAncestor(WebInspector.currentFocusElement))\n            WebInspector.currentFocusElement = WebInspector.previousFocusElement;\n\n        var anchoredItems = document.getElementById(\"anchored-status-bar-items\");\n\n        // Temporarily set properties and classes to mimic the post-animation values so panels\n        // like Elements in their updateStatusBarItems call will size things to fit the final location.\n        this._mainStatusBar.style.setProperty(\"padding-left\", (anchoredItems.offsetWidth - 1) + \"px\");\n        document.body.removeStyleClass(\"drawer-visible\");\n        if (\"updateStatusBarItems\" in WebInspector.currentPanel)\n            WebInspector.currentPanel.updateStatusBarItems();\n        document.body.addStyleClass(\"drawer-visible\");\n\n        var animations = [\n            {element: this._mainElement, end: {bottom: 0}},\n            {element: this._mainStatusBar, start: {\"padding-left\": 0}, end: {\"padding-left\": anchoredItems.offsetWidth - 1}},\n            {element: this._viewStatusBar, start: {opacity: 1}, end: {opacity: 0}}\n        ];\n\n        if (this._currentPanelCounters) {\n            var newRight = this._drawerStatusBar.clientWidth - this._counters.offsetLeft;\n            var oldRight = this._mainStatusBar.clientWidth - (this._currentPanelCounters.offsetLeft + this._currentPanelCounters.offsetWidth);\n            var rightPadding = (newRight - oldRight);\n            animations.push({element: this._currentPanelCounters, start: {\"padding-right\": 0}, end: {\"padding-right\": rightPadding}});\n        }\n\n        function animationFinished()\n        {\n            WebInspector.currentPanel.resize();\n            this._mainStatusBar.insertBefore(anchoredItems, this._mainStatusBar.firstChild);\n            this._mainStatusBar.style.removeProperty(\"padding-left\");\n\n            if (this._currentPanelCounters) {\n                this._currentPanelCounters.setAttribute(\"style\", null);\n                this._currentPanelCounters.parentNode.removeChild(this._currentPanelCounters);\n                this._counters.insertBefore(this._currentPanelCounters, this._counters.firstChild);\n            }\n\n            document.body.removeStyleClass(\"drawer-visible\");\n            delete this._animating;\n            delete this._currentAnimation;\n            this.state = WebInspector.Drawer.State.Hidden;\n        }\n\n        this._currentAnimation = WebInspector.animateStyle(animations, this._animationDuration(), animationFinished.bind(this));\n    },\n\n    resize: function()\n    {\n        if (this.state === WebInspector.Drawer.State.Hidden)\n            return;\n\n        var height;\n        if (this.state === WebInspector.Drawer.State.Variable) {\n            height = parseInt(this.element.style.height);\n            height = Number.constrain(height, Preferences.minConsoleHeight, window.innerHeight - this._mainElement.totalOffsetTop - Preferences.minConsoleHeight);\n        } else\n            height = window.innerHeight - this._toolbarElement.offsetHeight;\n\n        this._mainElement.style.bottom = height + \"px\";\n        this.element.style.height = height + \"px\";\n    },\n\n    enterPanelMode: function()\n    {\n        this._cancelAnimationIfNeeded();\n        this.fullPanel = true;\n        \n        if (this.visible) {\n            this._savedHeight = this.element.offsetHeight;\n            var height = window.innerHeight - this._toolbarElement.offsetHeight;\n            this._animateDrawerHeight(height, WebInspector.Drawer.State.Full);\n        }\n    },\n\n    exitPanelMode: function()\n    {\n        this._cancelAnimationIfNeeded();\n        this.fullPanel = false;\n\n        if (this.visible) {\n            // If this animation gets cancelled, we want the state of the drawer to be Variable,\n            // so that the new animation can't do an immediate transition between Hidden/Full states.\n            this.state = WebInspector.Drawer.State.Variable;\n            var height = this.savedHeight;\n            this._animateDrawerHeight(height, WebInspector.Drawer.State.Variable);\n        }\n    },\n\n    immediatelyExitPanelMode: function()\n    {\n        this.visible = false;\n        this.fullPanel = false;\n    },\n\n    immediatelyFinishAnimation: function()\n    {\n        if (this._currentAnimation)\n            this._currentAnimation.forceComplete();\n    },\n\n    set currentPanelCounters(x)\n    {\n        if (!x) {\n            if (this._currentPanelCounters)\n                this._currentPanelCounters.parentElement.removeChild(this._currentPanelCounters);\n            delete this._currentPanelCounters;\n            return;\n        }\n\n        this._currentPanelCounters = x;\n        if (this.visible)\n            this._mainStatusBar.appendChild(x);\n        else\n            this._counters.insertBefore(x, this._counters.firstChild);\n    },\n\n    _cancelAnimationIfNeeded: function()\n    {\n        if (this._animating) {\n            if (this._currentAnimation)\n                this._currentAnimation.cancel();\n            delete this._animating;\n            delete this._currentAnimation;\n        }\n    },\n\n    _animateDrawerHeight: function(height, finalState)\n    {\n        this._animating = true;\n        var animations = [\n            {element: this.element, end: {height: height}},\n            {element: this._mainElement, end: {bottom: height}}\n        ];\n\n        function animationFinished()\n        {\n            delete this._animating;\n            delete this._currentAnimation;\n            this.state = finalState;\n        }\n\n        this._currentAnimation = WebInspector.animateStyle(animations, this._animationDuration(), animationFinished.bind(this));\n    },\n\n    _animationDuration: function()\n    {\n        // Immediate if going between Hidden and Full in full panel mode\n        if (this.fullPanel && (this.state === WebInspector.Drawer.State.Hidden || this.state === WebInspector.Drawer.State.Full))\n            return 0;\n\n        return (window.event && window.event.shiftKey ? 2000 : 250);\n    },\n\n    _safelyRemoveChildren: function()\n    {\n        var child = this.element.firstChild;\n        while (child) {\n            if (child.id !== \"drawer-status-bar\") {\n                var moveTo = child.nextSibling;\n                this.element.removeChild(child);\n                child = moveTo;\n            } else\n                child = child.nextSibling;\n        }\n    },\n\n    _startStatusBarDragging: function(event)\n    {\n        if (!this.visible || event.target !== this._mainStatusBar)\n            return;\n\n        WebInspector.elementDragStart(this._mainStatusBar, this._statusBarDragging.bind(this), this._endStatusBarDragging.bind(this), event, \"row-resize\");\n\n        this._statusBarDragOffset = event.pageY - this.element.totalOffsetTop;\n\n        event.stopPropagation();\n    },\n\n    _statusBarDragging: function(event)\n    {\n        var height = window.innerHeight - event.pageY + this._statusBarDragOffset;\n        height = Number.constrain(height, Preferences.minConsoleHeight, window.innerHeight - this._mainElement.totalOffsetTop - Preferences.minConsoleHeight);\n\n        this._mainElement.style.bottom = height + \"px\";\n        this.element.style.height = height + \"px\";\n\n        event.preventDefault();\n        event.stopPropagation();\n    },\n\n    _endStatusBarDragging: function(event)\n    {\n        WebInspector.elementDragEnd(event);\n\n        this._savedHeight = this.element.offsetHeight;\n        delete this._statusBarDragOffset;\n\n        event.stopPropagation();\n    }\n}\n\nWebInspector.Drawer.prototype.__proto__ = WebInspector.View.prototype;\n\nWebInspector.Drawer.State = {\n    Hidden: 0,\n    Variable: 1,\n    Full: 2\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ElementsPanel.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ElementsPanel = function()\n{\n    WebInspector.Panel.call(this, \"elements\");\n\n    this.contentElement = document.createElement(\"div\");\n    this.contentElement.id = \"elements-content\";\n    this.contentElement.className = \"outline-disclosure source-code\";\n\n    this.treeOutline = new WebInspector.ElementsTreeOutline();\n    this.treeOutline.panel = this;\n    this.treeOutline.includeRootDOMNode = false;\n    this.treeOutline.selectEnabled = true;\n\n    this.treeOutline.focusedNodeChanged = function(forceUpdate)\n    {\n        if (this.panel.visible && WebInspector.currentFocusElement !== document.getElementById(\"search\"))\n            WebInspector.currentFocusElement = this.element;\n\n        this.panel.updateBreadcrumb(forceUpdate);\n\n        for (var pane in this.panel.sidebarPanes)\n           this.panel.sidebarPanes[pane].needsUpdate = true;\n\n        this.panel.updateStyles(true);\n        this.panel.updateMetrics();\n        this.panel.updateProperties();\n        this.panel.updateEventListeners();\n\n        if (this._focusedDOMNode) {\n            InspectorBackend.addInspectedNode(this._focusedDOMNode.id);\n            WebInspector.extensionServer.notifyObjectSelected(this.panel.name);\n        }\n    };\n\n    this.contentElement.appendChild(this.treeOutline.element);\n\n    this.crumbsElement = document.createElement(\"div\");\n    this.crumbsElement.className = \"crumbs\";\n    this.crumbsElement.addEventListener(\"mousemove\", this._mouseMovedInCrumbs.bind(this), false);\n    this.crumbsElement.addEventListener(\"mouseout\", this._mouseMovedOutOfCrumbs.bind(this), false);\n\n    this.sidebarPanes = {};\n    this.sidebarPanes.computedStyle = new WebInspector.ComputedStyleSidebarPane();\n    this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle);\n    this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane();\n    this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();\n    if (Preferences.nativeInstrumentationEnabled)\n        this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();\n    this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane();\n\n    this.sidebarPanes.styles.onexpand = this.updateStyles.bind(this);\n    this.sidebarPanes.metrics.onexpand = this.updateMetrics.bind(this);\n    this.sidebarPanes.properties.onexpand = this.updateProperties.bind(this);\n    this.sidebarPanes.eventListeners.onexpand = this.updateEventListeners.bind(this);\n\n    this.sidebarPanes.styles.expanded = true;\n\n    this.sidebarPanes.styles.addEventListener(\"style edited\", this._stylesPaneEdited, this);\n    this.sidebarPanes.styles.addEventListener(\"style property toggled\", this._stylesPaneEdited, this);\n    this.sidebarPanes.metrics.addEventListener(\"metrics edited\", this._metricsPaneEdited, this);\n    WebInspector.cssModel.addEventListener(\"stylesheet changed\", this._styleSheetChanged, this);\n\n    this.sidebarElement = document.createElement(\"div\");\n    this.sidebarElement.id = \"elements-sidebar\";\n\n    for (var pane in this.sidebarPanes)\n        this.sidebarElement.appendChild(this.sidebarPanes[pane].element);\n\n    this.sidebarResizeElement = document.createElement(\"div\");\n    this.sidebarResizeElement.className = \"sidebar-resizer-vertical\";\n    this.sidebarResizeElement.addEventListener(\"mousedown\", this.rightSidebarResizerDragStart.bind(this), false);\n\n    this._nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Select an element in the page to inspect it.\"), \"node-search-status-bar-item\");\n    this._nodeSearchButton.addEventListener(\"click\", this.toggleSearchingForNode.bind(this), false);\n\n    this.element.appendChild(this.contentElement);\n    this.element.appendChild(this.sidebarElement);\n    this.element.appendChild(this.sidebarResizeElement);\n\n    this._registerShortcuts();\n\n    this.reset();\n}\n\nWebInspector.ElementsPanel.prototype = {\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Elements\");\n    },\n\n    get statusBarItems()\n    {\n        return [this._nodeSearchButton.element, this.crumbsElement];\n    },\n\n    get defaultFocusedElement()\n    {\n        return this.treeOutline.element;\n    },\n\n    updateStatusBarItems: function()\n    {\n        this.updateBreadcrumbSizes();\n    },\n\n    show: function()\n    {\n        WebInspector.Panel.prototype.show.call(this);\n        this.sidebarResizeElement.style.right = (this.sidebarElement.offsetWidth - 3) + \"px\";\n        this.updateBreadcrumb();\n        this.treeOutline.updateSelection();\n        if (this.recentlyModifiedNodes.length)\n            this.updateModifiedNodes();\n    },\n\n    hide: function()\n    {\n        WebInspector.Panel.prototype.hide.call(this);\n\n        WebInspector.highlightDOMNode(0);\n        this.setSearchingForNode(false);\n    },\n\n    resize: function()\n    {\n        this.treeOutline.updateSelection();\n        this.updateBreadcrumbSizes();\n    },\n\n    reset: function()\n    {\n        if (this.focusedDOMNode)\n            this._selectedPathOnReset = this.focusedDOMNode.path();\n\n        this.rootDOMNode = null;\n        this.focusedDOMNode = null;\n\n        WebInspector.highlightDOMNode(0);\n\n        this.recentlyModifiedNodes = [];\n\n        delete this.currentQuery;\n    },\n\n    setDocument: function(inspectedRootDocument)\n    {\n        this.reset();\n        this.searchCanceled();\n\n        if (!inspectedRootDocument)\n            return;\n\n        inspectedRootDocument.addEventListener(\"DOMNodeInserted\", this._nodeInserted.bind(this));\n        inspectedRootDocument.addEventListener(\"DOMNodeRemoved\", this._nodeRemoved.bind(this));\n        inspectedRootDocument.addEventListener(\"DOMAttrModified\", this._attributesUpdated.bind(this));\n        inspectedRootDocument.addEventListener(\"DOMCharacterDataModified\", this._characterDataModified.bind(this));\n\n        this.rootDOMNode = inspectedRootDocument;\n\n        function selectNode(candidateFocusNode)\n        {\n            if (!candidateFocusNode)\n                candidateFocusNode = inspectedRootDocument.body || inspectedRootDocument.documentElement;\n\n            if (!candidateFocusNode)\n                return;\n\n            this.focusedDOMNode = candidateFocusNode;\n            if (this.treeOutline.selectedTreeElement)\n                this.treeOutline.selectedTreeElement.expand();\n        }\n\n        function selectLastSelectedNode(nodeId)\n        {\n            if (this.focusedDOMNode) {\n                // Focused node has been explicitly set while reaching out for the last selected node.\n                return;\n            }\n            var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : 0;\n            selectNode.call(this, node);\n        }\n\n        if (this._selectedPathOnReset)\n            InspectorBackend.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this));\n        else\n            selectNode.call(this);\n        delete this._selectedPathOnReset;\n    },\n\n    searchCanceled: function()\n    {\n        delete this._searchQuery;\n        this._hideSearchHighlights();\n\n        WebInspector.updateSearchMatchesCount(0, this);\n\n        this._currentSearchResultIndex = 0;\n        this._searchResults = [];\n        InspectorBackend.searchCanceled();\n    },\n\n    performSearch: function(query)\n    {\n        // Call searchCanceled since it will reset everything we need before doing a new search.\n        this.searchCanceled();\n\n        var whitespaceTrimmedQuery = query.trim();\n        if (!whitespaceTrimmedQuery.length)\n            return;\n\n        this._updatedMatchCountOnce = false;\n        this._matchesCountUpdateTimeout = null;\n        this._searchQuery = query;\n\n        InspectorBackend.performSearch(whitespaceTrimmedQuery, false);\n    },\n\n    populateHrefContextMenu: function(contextMenu, event, anchorElement)\n    {\n        if (!anchorElement.href)\n            return false;\n\n        var resourceURL = WebInspector.resourceURLForRelatedNode(this.focusedDOMNode, anchorElement.href);\n        if (!resourceURL)\n            return false;\n\n        // Add resource-related actions.\n        contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspector.openResource.bind(null, resourceURL, false));\n        if (WebInspector.resourceForURL(resourceURL))\n            contextMenu.appendItem(WebInspector.UIString(\"Open Link in Resources Panel\"), WebInspector.openResource.bind(null, resourceURL, true));\n        return true;\n    },\n\n    switchToAndFocus: function(node)\n    {\n        // Reset search restore.\n        WebInspector.cancelSearch();\n        WebInspector.currentPanel = this;\n        this.focusedDOMNode = node;\n    },\n\n    _updateMatchesCount: function()\n    {\n        WebInspector.updateSearchMatchesCount(this._searchResults.length, this);\n        this._matchesCountUpdateTimeout = null;\n        this._updatedMatchCountOnce = true;\n    },\n\n    _updateMatchesCountSoon: function()\n    {\n        if (!this._updatedMatchCountOnce)\n            return this._updateMatchesCount();\n        if (this._matchesCountUpdateTimeout)\n            return;\n        // Update the matches count every half-second so it doesn't feel twitchy.\n        this._matchesCountUpdateTimeout = setTimeout(this._updateMatchesCount.bind(this), 500);\n    },\n\n    addNodesToSearchResult: function(nodeIds)\n    {\n        if (!nodeIds.length)\n            return;\n\n        for (var i = 0; i < nodeIds.length; ++i) {\n            var nodeId = nodeIds[i];\n            var node = WebInspector.domAgent.nodeForId(nodeId);\n            if (!node)\n                continue;\n\n            this._currentSearchResultIndex = 0;\n            this._searchResults.push(node);\n        }\n        this._highlightCurrentSearchResult();\n        this._updateMatchesCountSoon();\n    },\n\n    jumpToNextSearchResult: function()\n    {\n        if (!this._searchResults || !this._searchResults.length)\n            return;\n\n        if (++this._currentSearchResultIndex >= this._searchResults.length)\n            this._currentSearchResultIndex = 0;\n        this._highlightCurrentSearchResult();\n    },\n\n    jumpToPreviousSearchResult: function()\n    {\n        if (!this._searchResults || !this._searchResults.length)\n            return;\n\n        if (--this._currentSearchResultIndex < 0)\n            this._currentSearchResultIndex = (this._searchResults.length - 1);\n        this._highlightCurrentSearchResult();\n    },\n\n    _highlightCurrentSearchResult: function()\n    {\n        this._hideSearchHighlights();\n        var node = this._searchResults[this._currentSearchResultIndex];\n        var treeElement = this.treeOutline.findTreeElement(node);\n        if (treeElement) {\n            treeElement.highlightSearchResults(this._searchQuery);\n            treeElement.reveal();\n        }\n    },\n\n    _hideSearchHighlights: function(node)\n    {\n        for (var i = 0; this._searchResults && i < this._searchResults.length; ++i) {\n            var node = this._searchResults[i];\n            var treeElement = this.treeOutline.findTreeElement(node);\n            if (treeElement)\n                treeElement.highlightSearchResults(null);\n        }\n    },\n\n    renameSelector: function(oldIdentifier, newIdentifier, oldSelector, newSelector)\n    {\n        // TODO: Implement Shifting the oldSelector, and its contents to a newSelector\n    },\n\n    get rootDOMNode()\n    {\n        return this.treeOutline.rootDOMNode;\n    },\n\n    set rootDOMNode(x)\n    {\n        this.treeOutline.rootDOMNode = x;\n    },\n\n    get focusedDOMNode()\n    {\n        return this.treeOutline.focusedDOMNode;\n    },\n\n    set focusedDOMNode(x)\n    {\n        this.treeOutline.focusedDOMNode = x;\n    },\n\n    _attributesUpdated: function(event)\n    {\n        this.recentlyModifiedNodes.push({node: event.target, updated: true});\n        if (this.visible)\n            this._updateModifiedNodesSoon();\n    },\n\n    _characterDataModified: function(event)\n    {\n        this.recentlyModifiedNodes.push({node: event.target, updated: true});\n        if (this.visible)\n            this._updateModifiedNodesSoon();\n    },\n\n    _nodeInserted: function(event)\n    {\n        this.recentlyModifiedNodes.push({node: event.target, parent: event.relatedNode, inserted: true});\n        if (this.visible)\n            this._updateModifiedNodesSoon();\n    },\n\n    _nodeRemoved: function(event)\n    {\n        this.recentlyModifiedNodes.push({node: event.target, parent: event.relatedNode, removed: true});\n        if (this.visible)\n            this._updateModifiedNodesSoon();\n    },\n\n    _updateModifiedNodesSoon: function()\n    {\n        if (\"_updateModifiedNodesTimeout\" in this)\n            return;\n        this._updateModifiedNodesTimeout = setTimeout(this.updateModifiedNodes.bind(this), 0);\n    },\n\n    updateModifiedNodes: function()\n    {\n        if (\"_updateModifiedNodesTimeout\" in this) {\n            clearTimeout(this._updateModifiedNodesTimeout);\n            delete this._updateModifiedNodesTimeout;\n        }\n\n        var updatedParentTreeElements = [];\n        var updateBreadcrumbs = false;\n\n        for (var i = 0; i < this.recentlyModifiedNodes.length; ++i) {\n            var replaced = this.recentlyModifiedNodes[i].replaced;\n            var parent = this.recentlyModifiedNodes[i].parent;\n            var node = this.recentlyModifiedNodes[i].node;\n\n            if (this.recentlyModifiedNodes[i].updated) {\n                var nodeItem = this.treeOutline.findTreeElement(node);\n                if (nodeItem)\n                    nodeItem.updateTitle();\n                continue;\n            }\n            \n            if (!parent)\n                continue;\n\n            var parentNodeItem = this.treeOutline.findTreeElement(parent);\n            if (parentNodeItem && !parentNodeItem.alreadyUpdatedChildren) {\n                parentNodeItem.updateChildren(replaced);\n                parentNodeItem.alreadyUpdatedChildren = true;\n                updatedParentTreeElements.push(parentNodeItem);\n            }\n\n            if (!updateBreadcrumbs && (this.focusedDOMNode === parent || isAncestorNode(this.focusedDOMNode, parent)))\n                updateBreadcrumbs = true;\n        }\n\n        for (var i = 0; i < updatedParentTreeElements.length; ++i)\n            delete updatedParentTreeElements[i].alreadyUpdatedChildren;\n\n        this.recentlyModifiedNodes = [];\n\n        if (updateBreadcrumbs)\n            this.updateBreadcrumb(true);\n    },\n\n    _stylesPaneEdited: function()\n    {\n        // Once styles are edited, the Metrics pane should be updated.\n        this.sidebarPanes.metrics.needsUpdate = true;\n        this.updateMetrics();\n    },\n\n    _metricsPaneEdited: function()\n    {\n        // Once metrics are edited, the Styles pane should be updated.\n        this.sidebarPanes.styles.needsUpdate = true;\n        this.updateStyles(true);\n    },\n\n    _styleSheetChanged: function()\n    {\n        this._metricsPaneEdited();\n        this._stylesPaneEdited();\n    },\n\n    _mouseMovedInCrumbs: function(event)\n    {\n        var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);\n        var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass(\"crumb\");\n\n        WebInspector.highlightDOMNode(crumbElement ? crumbElement.representedObject.id : 0);\n\n        if (\"_mouseOutOfCrumbsTimeout\" in this) {\n            clearTimeout(this._mouseOutOfCrumbsTimeout);\n            delete this._mouseOutOfCrumbsTimeout;\n        }\n    },\n\n    _mouseMovedOutOfCrumbs: function(event)\n    {\n        var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);\n        if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.crumbsElement))\n            return;\n\n        WebInspector.highlightDOMNode(0);\n\n        this._mouseOutOfCrumbsTimeout = setTimeout(this.updateBreadcrumbSizes.bind(this), 1000);\n    },\n\n    updateBreadcrumb: function(forceUpdate)\n    {\n        if (!this.visible)\n            return;\n\n        var crumbs = this.crumbsElement;\n\n        var handled = false;\n        var foundRoot = false;\n        var crumb = crumbs.firstChild;\n        while (crumb) {\n            if (crumb.representedObject === this.rootDOMNode)\n                foundRoot = true;\n\n            if (foundRoot)\n                crumb.addStyleClass(\"dimmed\");\n            else\n                crumb.removeStyleClass(\"dimmed\");\n\n            if (crumb.representedObject === this.focusedDOMNode) {\n                crumb.addStyleClass(\"selected\");\n                handled = true;\n            } else {\n                crumb.removeStyleClass(\"selected\");\n            }\n\n            crumb = crumb.nextSibling;\n        }\n\n        if (handled && !forceUpdate) {\n            // We don't need to rebuild the crumbs, but we need to adjust sizes\n            // to reflect the new focused or root node.\n            this.updateBreadcrumbSizes();\n            return;\n        }\n\n        crumbs.removeChildren();\n\n        var panel = this;\n\n        function selectCrumbFunction(event)\n        {\n            var crumb = event.currentTarget;\n            if (crumb.hasStyleClass(\"collapsed\")) {\n                // Clicking a collapsed crumb will expose the hidden crumbs.\n                if (crumb === panel.crumbsElement.firstChild) {\n                    // If the focused crumb is the first child, pick the farthest crumb\n                    // that is still hidden. This allows the user to expose every crumb.\n                    var currentCrumb = crumb;\n                    while (currentCrumb) {\n                        var hidden = currentCrumb.hasStyleClass(\"hidden\");\n                        var collapsed = currentCrumb.hasStyleClass(\"collapsed\");\n                        if (!hidden && !collapsed)\n                            break;\n                        crumb = currentCrumb;\n                        currentCrumb = currentCrumb.nextSibling;\n                    }\n                }\n\n                panel.updateBreadcrumbSizes(crumb);\n            } else {\n                // Clicking a dimmed crumb or double clicking (event.detail >= 2)\n                // will change the root node in addition to the focused node.\n                if (event.detail >= 2 || crumb.hasStyleClass(\"dimmed\"))\n                    panel.rootDOMNode = crumb.representedObject.parentNode;\n                panel.focusedDOMNode = crumb.representedObject;\n            }\n\n            event.preventDefault();\n        }\n\n        foundRoot = false;\n        for (var current = this.focusedDOMNode; current; current = current.parentNode) {\n            if (current.nodeType === Node.DOCUMENT_NODE)\n                continue;\n\n            if (current === this.rootDOMNode)\n                foundRoot = true;\n\n            var crumb = document.createElement(\"span\");\n            crumb.className = \"crumb\";\n            crumb.representedObject = current;\n            crumb.addEventListener(\"mousedown\", selectCrumbFunction, false);\n\n            var crumbTitle;\n            switch (current.nodeType) {\n                case Node.ELEMENT_NODE:\n                    this.decorateNodeLabel(current, crumb);\n                    break;\n\n                case Node.TEXT_NODE:\n                    if (isNodeWhitespace.call(current))\n                        crumbTitle = WebInspector.UIString(\"(whitespace)\");\n                    else\n                        crumbTitle = WebInspector.UIString(\"(text)\");\n                    break\n\n                case Node.COMMENT_NODE:\n                    crumbTitle = \"<!-->\";\n                    break;\n\n                case Node.DOCUMENT_TYPE_NODE:\n                    crumbTitle = \"<!DOCTYPE>\";\n                    break;\n\n                default:\n                    crumbTitle = this.treeOutline.nodeNameToCorrectCase(current.nodeName);\n            }\n\n            if (!crumb.childNodes.length) {\n                var nameElement = document.createElement(\"span\");\n                nameElement.textContent = crumbTitle;\n                crumb.appendChild(nameElement);\n                crumb.title = crumbTitle;\n            }\n\n            if (foundRoot)\n                crumb.addStyleClass(\"dimmed\");\n            if (current === this.focusedDOMNode)\n                crumb.addStyleClass(\"selected\");\n            if (!crumbs.childNodes.length)\n                crumb.addStyleClass(\"end\");\n\n            crumbs.appendChild(crumb);\n        }\n\n        if (crumbs.hasChildNodes())\n            crumbs.lastChild.addStyleClass(\"start\");\n\n        this.updateBreadcrumbSizes();\n    },\n\n    decorateNodeLabel: function(node, parentElement)\n    {\n        var title = this.treeOutline.nodeNameToCorrectCase(node.nodeName);\n\n        var nameElement = document.createElement(\"span\");\n        nameElement.textContent = title;\n        parentElement.appendChild(nameElement);\n\n        var idAttribute = node.getAttribute(\"id\");\n        if (idAttribute) {\n            var idElement = document.createElement(\"span\");\n            parentElement.appendChild(idElement);\n\n            var part = \"#\" + idAttribute;\n            title += part;\n            idElement.appendChild(document.createTextNode(part));\n\n            // Mark the name as extra, since the ID is more important.\n            nameElement.className = \"extra\";\n        }\n\n        var classAttribute = node.getAttribute(\"class\");\n        if (classAttribute) {\n            var classes = classAttribute.split(/\\s+/);\n            var foundClasses = {};\n\n            if (classes.length) {\n                var classesElement = document.createElement(\"span\");\n                classesElement.className = \"extra\";\n                parentElement.appendChild(classesElement);\n\n                for (var i = 0; i < classes.length; ++i) {\n                    var className = classes[i];\n                    if (className && !(className in foundClasses)) {\n                        var part = \".\" + className;\n                        title += part;\n                        classesElement.appendChild(document.createTextNode(part));\n                        foundClasses[className] = true;\n                    }\n                }\n            }\n        }\n        parentElement.title = title;\n    },\n\n    linkifyNodeReference: function(node)\n    {\n        var link = document.createElement(\"span\");\n        link.className = \"node-link\";\n        this.decorateNodeLabel(node, link);\n        WebInspector.wireElementWithDOMNode(link, node.id);\n        return link;\n    },\n\n    linkifyNodeById: function(nodeId)\n    {\n        var node = WebInspector.domAgent.nodeForId(nodeId);\n        if (!node)\n            return document.createTextNode(WebInspector.UIString(\"<node>\"));\n        return this.linkifyNodeReference(node);\n    },\n\n    updateBreadcrumbSizes: function(focusedCrumb)\n    {\n        if (!this.visible)\n            return;\n\n        if (document.body.offsetWidth <= 0) {\n            // The stylesheet hasn't loaded yet or the window is closed,\n            // so we can't calculate what is need. Return early.\n            return;\n        }\n\n        var crumbs = this.crumbsElement;\n        if (!crumbs.childNodes.length || crumbs.offsetWidth <= 0)\n            return; // No crumbs, do nothing.\n\n        // A Zero index is the right most child crumb in the breadcrumb.\n        var selectedIndex = 0;\n        var focusedIndex = 0;\n        var selectedCrumb;\n\n        var i = 0;\n        var crumb = crumbs.firstChild;\n        while (crumb) {\n            // Find the selected crumb and index. \n            if (!selectedCrumb && crumb.hasStyleClass(\"selected\")) {\n                selectedCrumb = crumb;\n                selectedIndex = i;\n            }\n\n            // Find the focused crumb index. \n            if (crumb === focusedCrumb)\n                focusedIndex = i;\n\n            // Remove any styles that affect size before\n            // deciding to shorten any crumbs.\n            if (crumb !== crumbs.lastChild)\n                crumb.removeStyleClass(\"start\");\n            if (crumb !== crumbs.firstChild)\n                crumb.removeStyleClass(\"end\");\n\n            crumb.removeStyleClass(\"compact\");\n            crumb.removeStyleClass(\"collapsed\");\n            crumb.removeStyleClass(\"hidden\");\n\n            crumb = crumb.nextSibling;\n            ++i;\n        }\n\n        // Restore the start and end crumb classes in case they got removed in coalesceCollapsedCrumbs().\n        // The order of the crumbs in the document is opposite of the visual order.\n        crumbs.firstChild.addStyleClass(\"end\");\n        crumbs.lastChild.addStyleClass(\"start\");\n\n        function crumbsAreSmallerThanContainer()\n        {\n            var rightPadding = 20;\n            var errorWarningElement = document.getElementById(\"error-warning-count\");\n            if (!WebInspector.drawer.visible && errorWarningElement)\n                rightPadding += errorWarningElement.offsetWidth;\n            return ((crumbs.totalOffsetLeft + crumbs.offsetWidth + rightPadding) < window.innerWidth);\n        }\n\n        if (crumbsAreSmallerThanContainer())\n            return; // No need to compact the crumbs, they all fit at full size.\n\n        var BothSides = 0;\n        var AncestorSide = -1;\n        var ChildSide = 1;\n\n        function makeCrumbsSmaller(shrinkingFunction, direction, significantCrumb)\n        {\n            if (!significantCrumb)\n                significantCrumb = (focusedCrumb || selectedCrumb);\n\n            if (significantCrumb === selectedCrumb)\n                var significantIndex = selectedIndex;\n            else if (significantCrumb === focusedCrumb)\n                var significantIndex = focusedIndex;\n            else {\n                var significantIndex = 0;\n                for (var i = 0; i < crumbs.childNodes.length; ++i) {\n                    if (crumbs.childNodes[i] === significantCrumb) {\n                        significantIndex = i;\n                        break;\n                    }\n                }\n            }\n\n            function shrinkCrumbAtIndex(index)\n            {\n                var shrinkCrumb = crumbs.childNodes[index];\n                if (shrinkCrumb && shrinkCrumb !== significantCrumb)\n                    shrinkingFunction(shrinkCrumb);\n                if (crumbsAreSmallerThanContainer())\n                    return true; // No need to compact the crumbs more.\n                return false;\n            }\n\n            // Shrink crumbs one at a time by applying the shrinkingFunction until the crumbs\n            // fit in the container or we run out of crumbs to shrink.\n            if (direction) {\n                // Crumbs are shrunk on only one side (based on direction) of the signifcant crumb.\n                var index = (direction > 0 ? 0 : crumbs.childNodes.length - 1);\n                while (index !== significantIndex) {\n                    if (shrinkCrumbAtIndex(index))\n                        return true;\n                    index += (direction > 0 ? 1 : -1);\n                }\n            } else {\n                // Crumbs are shrunk in order of descending distance from the signifcant crumb,\n                // with a tie going to child crumbs.\n                var startIndex = 0;\n                var endIndex = crumbs.childNodes.length - 1;\n                while (startIndex != significantIndex || endIndex != significantIndex) {\n                    var startDistance = significantIndex - startIndex;\n                    var endDistance = endIndex - significantIndex;\n                    if (startDistance >= endDistance)\n                        var index = startIndex++;\n                    else\n                        var index = endIndex--;\n                    if (shrinkCrumbAtIndex(index))\n                        return true;\n                }\n            }\n\n            // We are not small enough yet, return false so the caller knows.\n            return false;\n        }\n\n        function coalesceCollapsedCrumbs()\n        {\n            var crumb = crumbs.firstChild;\n            var collapsedRun = false;\n            var newStartNeeded = false;\n            var newEndNeeded = false;\n            while (crumb) {\n                var hidden = crumb.hasStyleClass(\"hidden\");\n                if (!hidden) {\n                    var collapsed = crumb.hasStyleClass(\"collapsed\"); \n                    if (collapsedRun && collapsed) {\n                        crumb.addStyleClass(\"hidden\");\n                        crumb.removeStyleClass(\"compact\");\n                        crumb.removeStyleClass(\"collapsed\");\n\n                        if (crumb.hasStyleClass(\"start\")) {\n                            crumb.removeStyleClass(\"start\");\n                            newStartNeeded = true;\n                        }\n\n                        if (crumb.hasStyleClass(\"end\")) {\n                            crumb.removeStyleClass(\"end\");\n                            newEndNeeded = true;\n                        }\n\n                        continue;\n                    }\n\n                    collapsedRun = collapsed;\n\n                    if (newEndNeeded) {\n                        newEndNeeded = false;\n                        crumb.addStyleClass(\"end\");\n                    }\n                } else\n                    collapsedRun = true;\n                crumb = crumb.nextSibling;\n            }\n\n            if (newStartNeeded) {\n                crumb = crumbs.lastChild;\n                while (crumb) {\n                    if (!crumb.hasStyleClass(\"hidden\")) {\n                        crumb.addStyleClass(\"start\");\n                        break;\n                    }\n                    crumb = crumb.previousSibling;\n                }\n            }\n        }\n\n        function compact(crumb)\n        {\n            if (crumb.hasStyleClass(\"hidden\"))\n                return;\n            crumb.addStyleClass(\"compact\");\n        }\n\n        function collapse(crumb, dontCoalesce)\n        {\n            if (crumb.hasStyleClass(\"hidden\"))\n                return;\n            crumb.addStyleClass(\"collapsed\");\n            crumb.removeStyleClass(\"compact\");\n            if (!dontCoalesce)\n                coalesceCollapsedCrumbs();\n        }\n\n        function compactDimmed(crumb)\n        {\n            if (crumb.hasStyleClass(\"dimmed\"))\n                compact(crumb);\n        }\n\n        function collapseDimmed(crumb)\n        {\n            if (crumb.hasStyleClass(\"dimmed\"))\n                collapse(crumb);\n        }\n\n        if (!focusedCrumb) {\n            // When not focused on a crumb we can be biased and collapse less important\n            // crumbs that the user might not care much about.\n\n            // Compact child crumbs.\n            if (makeCrumbsSmaller(compact, ChildSide))\n                return;\n\n            // Collapse child crumbs.\n            if (makeCrumbsSmaller(collapse, ChildSide))\n                return;\n\n            // Compact dimmed ancestor crumbs.\n            if (makeCrumbsSmaller(compactDimmed, AncestorSide))\n                return;\n\n            // Collapse dimmed ancestor crumbs.\n            if (makeCrumbsSmaller(collapseDimmed, AncestorSide))\n                return;\n        }\n\n        // Compact ancestor crumbs, or from both sides if focused.\n        if (makeCrumbsSmaller(compact, (focusedCrumb ? BothSides : AncestorSide)))\n            return;\n\n        // Collapse ancestor crumbs, or from both sides if focused.\n        if (makeCrumbsSmaller(collapse, (focusedCrumb ? BothSides : AncestorSide)))\n            return;\n\n        if (!selectedCrumb)\n            return;\n\n        // Compact the selected crumb.\n        compact(selectedCrumb);\n        if (crumbsAreSmallerThanContainer())\n            return;\n\n        // Collapse the selected crumb as a last resort. Pass true to prevent coalescing.\n        collapse(selectedCrumb, true);\n    },\n\n    updateStyles: function(forceUpdate)\n    {\n        var stylesSidebarPane = this.sidebarPanes.styles;\n        var computedStylePane = this.sidebarPanes.computedStyle;\n        if ((!stylesSidebarPane.expanded && !computedStylePane.expanded) || !stylesSidebarPane.needsUpdate)\n            return;\n\n        stylesSidebarPane.update(this.focusedDOMNode, null, forceUpdate);\n        stylesSidebarPane.needsUpdate = false;\n    },\n\n    updateMetrics: function()\n    {\n        var metricsSidebarPane = this.sidebarPanes.metrics;\n        if (!metricsSidebarPane.expanded || !metricsSidebarPane.needsUpdate)\n            return;\n\n        metricsSidebarPane.update(this.focusedDOMNode);\n        metricsSidebarPane.needsUpdate = false;\n    },\n\n    updateProperties: function()\n    {\n        var propertiesSidebarPane = this.sidebarPanes.properties;\n        if (!propertiesSidebarPane.expanded || !propertiesSidebarPane.needsUpdate)\n            return;\n\n        propertiesSidebarPane.update(this.focusedDOMNode);\n        propertiesSidebarPane.needsUpdate = false;\n    },\n\n    updateEventListeners: function()\n    {\n        var eventListenersSidebarPane = this.sidebarPanes.eventListeners;\n        if (!eventListenersSidebarPane.expanded || !eventListenersSidebarPane.needsUpdate)\n            return;\n\n        eventListenersSidebarPane.update(this.focusedDOMNode);\n        eventListenersSidebarPane.needsUpdate = false;\n    },\n\n    _registerShortcuts: function()\n    {\n        var shortcut = WebInspector.KeyboardShortcut;\n        var section = WebInspector.shortcutsHelp.section(WebInspector.UIString(\"Elements Panel\"));\n        var keys = [\n            shortcut.shortcutToString(shortcut.Keys.Up),\n            shortcut.shortcutToString(shortcut.Keys.Down)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Navigate elements\"));\n        var keys = [\n            shortcut.shortcutToString(shortcut.Keys.Right),\n            shortcut.shortcutToString(shortcut.Keys.Left)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Expand/collapse\"));\n        section.addKey(shortcut.shortcutToString(shortcut.Keys.Enter), WebInspector.UIString(\"Edit attribute\"));\n\n        this.sidebarPanes.styles.registerShortcuts();\n    },\n\n    handleShortcut: function(event)\n    {\n        // Cmd/Control + Shift + C should be a shortcut to clicking the Node Search Button.\n        // This shortcut matches Firebug.\n        if (event.keyIdentifier === \"U+0043\") {     // C key\n            if (WebInspector.isMac())\n                var isNodeSearchKey = event.metaKey && !event.ctrlKey && !event.altKey && event.shiftKey;\n            else\n                var isNodeSearchKey = event.ctrlKey && !event.metaKey && !event.altKey && event.shiftKey;\n\n            if (isNodeSearchKey) {\n                this.toggleSearchingForNode();\n                event.handled = true;\n                return;\n            }\n        }\n    },\n\n    handleCopyEvent: function(event)\n    {\n        // Don't prevent the normal copy if the user has a selection.\n        if (!window.getSelection().isCollapsed)\n            return;\n        event.clipboardData.clearData();\n        event.preventDefault();\n        InspectorBackend.copyNode(this.focusedDOMNode.id);\n    },\n\n    rightSidebarResizerDragStart: function(event)\n    {\n        WebInspector.elementDragStart(this.sidebarElement, this.rightSidebarResizerDrag.bind(this), this.rightSidebarResizerDragEnd.bind(this), event, \"col-resize\");\n    },\n\n    rightSidebarResizerDragEnd: function(event)\n    {\n        WebInspector.elementDragEnd(event);\n        this.saveSidebarWidth();\n    },\n\n    rightSidebarResizerDrag: function(event)\n    {\n        var x = event.pageX;\n        var newWidth = Number.constrain(window.innerWidth - x, Preferences.minElementsSidebarWidth, window.innerWidth * 0.66);\n        this.setSidebarWidth(newWidth);\n        event.preventDefault();\n    },\n\n    setSidebarWidth: function(newWidth)\n    {\n        this.sidebarElement.style.width = newWidth + \"px\";\n        this.contentElement.style.right = newWidth + \"px\";\n        this.sidebarResizeElement.style.right = (newWidth - 3) + \"px\";\n        this.treeOutline.updateSelection();\n    },\n\n    updateFocusedNode: function(nodeId)\n    {\n        var node = WebInspector.domAgent.nodeForId(nodeId);\n        if (!node)\n            return;\n\n        this.focusedDOMNode = node;\n        this._nodeSearchButton.toggled = false;\n    },\n\n    _setSearchingForNode: function(enabled)\n    {\n        this._nodeSearchButton.toggled = enabled;\n    },\n\n    setSearchingForNode: function(enabled)\n    {\n        InspectorBackend.setSearchingForNode(enabled, this._setSearchingForNode.bind(this));\n    },\n\n    toggleSearchingForNode: function()\n    {\n        this.setSearchingForNode(!this._nodeSearchButton.toggled);\n    },\n\n    elementsToRestoreScrollPositionsFor: function()\n    {\n        return [ this.contentElement, this.sidebarElement ];\n    }\n}\n\nWebInspector.ElementsPanel.prototype.__proto__ = WebInspector.Panel.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ElementsTreeOutline.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ElementsTreeOutline = function() {\n    this.element = document.createElement(\"ol\");\n    this.element.addEventListener(\"mousedown\", this._onmousedown.bind(this), false);\n    this.element.addEventListener(\"mousemove\", this._onmousemove.bind(this), false);\n    this.element.addEventListener(\"mouseout\", this._onmouseout.bind(this), false);\n\n    TreeOutline.call(this, this.element);\n\n    this.includeRootDOMNode = true;\n    this.selectEnabled = false;\n    this.showInElementsPanelEnabled = false;\n    this.rootDOMNode = null;\n    this.focusedDOMNode = null;\n\n    this.element.addEventListener(\"contextmenu\", this._contextMenuEventFired.bind(this), true);\n}\n\nWebInspector.ElementsTreeOutline.prototype = {\n    get rootDOMNode()\n    {\n        return this._rootDOMNode;\n    },\n\n    set rootDOMNode(x)\n    {\n        if (this._rootDOMNode === x)\n            return;\n\n        this._rootDOMNode = x;\n\n        this._isXMLMimeType = !!(WebInspector.mainResource && WebInspector.mainResource.mimeType && WebInspector.mainResource.mimeType.match(/x(?:ht)?ml/i));\n\n        this.update();\n    },\n\n    get isXMLMimeType()\n    {\n        return this._isXMLMimeType;\n    },\n\n    nodeNameToCorrectCase: function(nodeName)\n    {\n        return this.isXMLMimeType ? nodeName : nodeName.toLowerCase();\n    },\n\n    get focusedDOMNode()\n    {\n        return this._focusedDOMNode;\n    },\n\n    set focusedDOMNode(x)\n    {\n        if (this._focusedDOMNode === x) {\n            this.revealAndSelectNode(x);\n            return;\n        }\n\n        this._focusedDOMNode = x;\n\n        this.revealAndSelectNode(x);\n\n        // The revealAndSelectNode() method might find a different element if there is inlined text,\n        // and the select() call would change the focusedDOMNode and reenter this setter. So to\n        // avoid calling focusedNodeChanged() twice, first check if _focusedDOMNode is the same\n        // node as the one passed in.\n        if (this._focusedDOMNode === x)\n            this.focusedNodeChanged();\n    },\n\n    get editing()\n    {\n        return this._editing;\n    },\n\n    update: function()\n    {\n        var selectedNode = this.selectedTreeElement ? this.selectedTreeElement.representedObject : null;\n\n        this.removeChildren();\n\n        if (!this.rootDOMNode)\n            return;\n\n        var treeElement;\n        if (this.includeRootDOMNode) {\n            treeElement = new WebInspector.ElementsTreeElement(this.rootDOMNode);\n            treeElement.selectable = this.selectEnabled;\n            this.appendChild(treeElement);\n        } else {\n            // FIXME: this could use findTreeElement to reuse a tree element if it already exists\n            var node = this.rootDOMNode.firstChild;\n            while (node) {\n                treeElement = new WebInspector.ElementsTreeElement(node);\n                treeElement.selectable = this.selectEnabled;\n                this.appendChild(treeElement);\n                node = node.nextSibling;\n            }\n        }\n\n        if (selectedNode)\n            this.revealAndSelectNode(selectedNode);\n    },\n\n    updateSelection: function()\n    {\n        if (!this.selectedTreeElement)\n            return;\n        var element = this.treeOutline.selectedTreeElement;\n        element.updateSelection();\n    },\n\n    focusedNodeChanged: function(forceUpdate) {},\n\n    findTreeElement: function(node)\n    {\n        var treeElement = TreeOutline.prototype.findTreeElement.call(this, node, isAncestorNode, parentNode);\n        if (!treeElement && node.nodeType === Node.TEXT_NODE) {\n            // The text node might have been inlined if it was short, so try to find the parent element.\n            treeElement = TreeOutline.prototype.findTreeElement.call(this, node.parentNode, isAncestorNode, parentNode);\n        }\n\n        return treeElement;\n    },\n\n    createTreeElementFor: function(node)\n    {\n        var treeElement = this.findTreeElement(node);\n        if (treeElement)\n            return treeElement;\n        if (!node.parentNode)\n            return null;\n\n        var treeElement = this.createTreeElementFor(node.parentNode);\n        if (treeElement && treeElement.showChild(node.index))\n            return treeElement.children[node.index];\n\n        return null;\n    },\n\n    set suppressRevealAndSelect(x)\n    {\n        if (this._suppressRevealAndSelect === x)\n            return;\n        this._suppressRevealAndSelect = x;\n    },\n\n    revealAndSelectNode: function(node)\n    {\n        if (!node || this._suppressRevealAndSelect)\n            return;\n\n        var treeElement = this.createTreeElementFor(node);\n        if (!treeElement)\n            return;\n\n        treeElement.reveal();\n        treeElement.select();\n    },\n\n    _treeElementFromEvent: function(event)\n    {\n        var root = this.element;\n\n        // We choose this X coordinate based on the knowledge that our list\n        // items extend nearly to the right edge of the outer <ol>.\n        var x = root.totalOffsetLeft + root.offsetWidth - 20;\n\n        var y = event.pageY;\n\n        // Our list items have 1-pixel cracks between them vertically. We avoid\n        // the cracks by checking slightly above and slightly below the mouse\n        // and seeing if we hit the same element each time.\n        var elementUnderMouse = this.treeElementFromPoint(x, y);\n        var elementAboveMouse = this.treeElementFromPoint(x, y - 2);\n        var element;\n        if (elementUnderMouse === elementAboveMouse)\n            element = elementUnderMouse;\n        else\n            element = this.treeElementFromPoint(x, y + 2);\n\n        return element;\n    },\n\n    _onmousedown: function(event)\n    {\n        var element = this._treeElementFromEvent(event);\n\n        if (!element || element.isEventWithinDisclosureTriangle(event))\n            return;\n\n        element.select();\n    },\n\n    _onmousemove: function(event)\n    {\n        var element = this._treeElementFromEvent(event);\n        if (element && this._previousHoveredElement === element)\n            return;\n\n        if (this._previousHoveredElement) {\n            this._previousHoveredElement.hovered = false;\n            delete this._previousHoveredElement;\n        }\n\n        if (element) {\n            element.hovered = true;\n            this._previousHoveredElement = element;\n\n            // Lazily compute tag-specific tooltips.\n            if (element.representedObject && !element.tooltip)\n                element._createTooltipForNode();\n        }\n\n        WebInspector.highlightDOMNode(element ? element.representedObject.id : 0);\n    },\n\n    _onmouseout: function(event)\n    {\n        var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);\n        if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.element))\n            return;\n\n        if (this._previousHoveredElement) {\n            this._previousHoveredElement.hovered = false;\n            delete this._previousHoveredElement;\n        }\n\n        WebInspector.highlightDOMNode(0);\n    },\n\n    _contextMenuEventFired: function(event)\n    {\n        var listItem = event.target.enclosingNodeOrSelfWithNodeName(\"LI\");\n        if (!listItem || !listItem.treeElement)\n            return;\n\n        var contextMenu = new WebInspector.ContextMenu();\n        if (this.showInElementsPanelEnabled) {\n            function focusElement()\n            {\n                WebInspector.panels.elements.switchToAndFocus(listItem.treeElement.representedObject);\n            }\n            contextMenu.appendItem(WebInspector.UIString(\"Reveal in Elements Panel\"), focusElement.bind(this));\n        } else {\n            var href = event.target.enclosingNodeOrSelfWithClass(\"webkit-html-resource-link\") || event.target.enclosingNodeOrSelfWithClass(\"webkit-html-external-link\");\n            var tag = event.target.enclosingNodeOrSelfWithClass(\"webkit-html-tag\");\n            var textNode = event.target.enclosingNodeOrSelfWithClass(\"webkit-html-text-node\");\n            var needSeparator;\n            if (href)\n                needSeparator = WebInspector.panels.elements.populateHrefContextMenu(contextMenu, event, href);\n            if (tag && listItem.treeElement._populateTagContextMenu) {\n                if (needSeparator)\n                    contextMenu.appendSeparator();\n                listItem.treeElement._populateTagContextMenu(contextMenu, event);\n            } else if (textNode && listItem.treeElement._populateTextContextMenu) {\n                if (needSeparator)\n                    contextMenu.appendSeparator();\n                listItem.treeElement._populateTextContextMenu(contextMenu, textNode);\n            }\n        }\n        contextMenu.show(event);\n    }\n}\n\nWebInspector.ElementsTreeOutline.prototype.__proto__ = TreeOutline.prototype;\n\nWebInspector.ElementsTreeElement = function(node, elementCloseTag)\n{\n    this._elementCloseTag = elementCloseTag;\n    var hasChildrenOverride = !elementCloseTag && node.hasChildNodes() && !this._showInlineText(node);\n\n    // The title will be updated in onattach.\n    TreeElement.call(this, \"\", node, hasChildrenOverride);\n\n    if (this.representedObject.nodeType == Node.ELEMENT_NODE && !elementCloseTag)\n        this._canAddAttributes = true;\n    this._searchQuery = null;\n    this._expandedChildrenLimit = WebInspector.ElementsTreeElement.InitialChildrenLimit;\n}\n\nWebInspector.ElementsTreeElement.InitialChildrenLimit = 500;\n\n// A union of HTML4 and HTML5-Draft elements that explicitly\n// or implicitly (for HTML5) forbid the closing tag.\n// FIXME: Revise once HTML5 Final is published.\nWebInspector.ElementsTreeElement.ForbiddenClosingTagElements = [\n    \"area\", \"base\", \"basefont\", \"br\", \"canvas\", \"col\", \"command\", \"embed\", \"frame\",\n    \"hr\", \"img\", \"input\", \"isindex\", \"keygen\", \"link\", \"meta\", \"param\", \"source\"\n].keySet();\n\n// These tags we do not allow editing their tag name.\nWebInspector.ElementsTreeElement.EditTagBlacklist = [\n    \"html\", \"head\", \"body\"\n].keySet();\n\nWebInspector.ElementsTreeElement.prototype = {\n    highlightSearchResults: function(searchQuery)\n    {\n        if (this._searchQuery === searchQuery)\n            return;\n\n        this._searchQuery = searchQuery;\n        this.updateTitle();\n    },\n\n    get hovered()\n    {\n        return this._hovered;\n    },\n\n    set hovered(x)\n    {\n        if (this._hovered === x)\n            return;\n\n        this._hovered = x;\n\n        if (this.listItemElement) {\n            if (x) {\n                this.updateSelection();\n                this.listItemElement.addStyleClass(\"hovered\");\n            } else {\n                this.listItemElement.removeStyleClass(\"hovered\");\n            }\n        }\n    },\n\n    get expandedChildrenLimit()\n    {\n        return this._expandedChildrenLimit;\n    },\n\n    set expandedChildrenLimit(x)\n    {\n        if (this._expandedChildrenLimit === x)\n            return;\n\n        this._expandedChildrenLimit = x;\n        if (this.treeOutline && !this._updateChildrenInProgress)\n            this._updateChildren(true);\n    },\n\n    get expandedChildCount()\n    {\n        var count = this.children.length;\n        if (count && this.children[count - 1]._elementCloseTag)\n            count--;\n        if (count && this.children[count - 1].expandAllButton)\n            count--;\n        return count;\n    },\n\n    showChild: function(index)\n    {\n        if (this._elementCloseTag)\n            return;\n\n        if (index >= this.expandedChildrenLimit) {\n            this._expandedChildrenLimit = index + 1;\n            this._updateChildren(true);\n        }\n\n        // Whether index-th child is visible in the children tree\n        return this.expandedChildCount > index;\n    },\n\n    _createTooltipForNode: function()\n    {\n        var node = this.representedObject;\n        if (!node.nodeName || node.nodeName.toLowerCase() !== \"img\")\n            return;\n\n        function setTooltip(properties)\n        {\n            if (!properties)\n                return;\n\n            if (properties.offsetHeight === properties.naturalHeight && properties.offsetWidth === properties.naturalWidth)\n                this.tooltip = WebInspector.UIString(\"%d × %d pixels\", properties.offsetWidth, properties.offsetHeight);\n            else\n                this.tooltip = WebInspector.UIString(\"%d × %d pixels (Natural: %d × %d pixels)\", properties.offsetWidth, properties.offsetHeight, properties.naturalWidth, properties.naturalHeight);\n        }\n        InspectorBackend.getNodeProperties(node.id, [\"naturalHeight\", \"naturalWidth\", \"offsetHeight\", \"offsetWidth\"], setTooltip.bind(this));\n    },\n\n    updateSelection: function()\n    {\n        var listItemElement = this.listItemElement;\n        if (!listItemElement)\n            return;\n\n        if (document.body.offsetWidth <= 0) {\n            // The stylesheet hasn't loaded yet or the window is closed,\n            // so we can't calculate what is need. Return early.\n            return;\n        }\n\n        if (!this.selectionElement) {\n            this.selectionElement = document.createElement(\"div\");\n            this.selectionElement.className = \"selection selected\";\n            listItemElement.insertBefore(this.selectionElement, listItemElement.firstChild);\n        }\n\n        this.selectionElement.style.height = listItemElement.offsetHeight + \"px\";\n    },\n\n    onattach: function()\n    {\n        if (this._hovered) {\n            this.updateSelection();\n            this.listItemElement.addStyleClass(\"hovered\");\n        }\n\n        this.updateTitle();\n\n        this._preventFollowingLinksOnDoubleClick();\n    },\n\n    _preventFollowingLinksOnDoubleClick: function()\n    {\n        var links = this.listItemElement.querySelectorAll(\"li > .webkit-html-tag > .webkit-html-attribute > .webkit-html-external-link, li > .webkit-html-tag > .webkit-html-attribute > .webkit-html-resource-link\");\n        if (!links)\n            return;\n\n        for (var i = 0; i < links.length; ++i)\n            links[i].preventFollowOnDoubleClick = true;\n    },\n\n    onpopulate: function()\n    {\n        if (this.children.length || this._showInlineText(this.representedObject) || this._elementCloseTag)\n            return;\n\n        this.updateChildren();\n    },\n\n    updateChildren: function(fullRefresh)\n    {\n        if (this._elementCloseTag)\n            return;\n\n        WebInspector.domAgent.getChildNodesAsync(this.representedObject, this._updateChildren.bind(this, fullRefresh));\n    },\n\n    insertChildElement: function(child, index, closingTag)\n    {\n        var newElement = new WebInspector.ElementsTreeElement(child, closingTag);\n        newElement.selectable = this.treeOutline.selectEnabled;\n        this.insertChild(newElement, index);\n        return newElement;\n    },\n\n    moveChild: function(child, targetIndex)\n    {\n        var wasSelected = child.selected;\n        this.removeChild(child);\n        this.insertChild(child, targetIndex);\n        if (wasSelected)\n            child.select();\n    },\n\n    _updateChildren: function(fullRefresh)\n    {\n        if (this._updateChildrenInProgress)\n            return;\n\n        this._updateChildrenInProgress = true;\n        var focusedNode = this.treeOutline.focusedDOMNode;\n        var originalScrollTop;\n        if (fullRefresh) {\n            var treeOutlineContainerElement = this.treeOutline.element.parentNode;\n            originalScrollTop = treeOutlineContainerElement.scrollTop;\n            var selectedTreeElement = this.treeOutline.selectedTreeElement;\n            if (selectedTreeElement && selectedTreeElement.hasAncestor(this))\n                this.select();\n            this.removeChildren();\n        }\n\n        var treeElement = this;\n        var treeChildIndex = 0;\n        var elementToSelect;\n\n        function updateChildrenOfNode(node)\n        {\n            var treeOutline = treeElement.treeOutline;\n            var child = node.firstChild;\n            while (child) {\n                var currentTreeElement = treeElement.children[treeChildIndex];\n                if (!currentTreeElement || currentTreeElement.representedObject !== child) {\n                    // Find any existing element that is later in the children list.\n                    var existingTreeElement = null;\n                    for (var i = (treeChildIndex + 1), size = treeElement.expandedChildCount; i < size; ++i) {\n                        if (treeElement.children[i].representedObject === child) {\n                            existingTreeElement = treeElement.children[i];\n                            break;\n                        }\n                    }\n\n                    if (existingTreeElement && existingTreeElement.parent === treeElement) {\n                        // If an existing element was found and it has the same parent, just move it.\n                        treeElement.moveChild(existingTreeElement, treeChildIndex);\n                    } else {\n                        // No existing element found, insert a new element.\n                        if (treeChildIndex < treeElement.expandedChildrenLimit) {\n                            var newElement = treeElement.insertChildElement(child, treeChildIndex);\n                            if (child === focusedNode)\n                                elementToSelect = newElement;\n                            if (treeElement.expandedChildCount > treeElement.expandedChildrenLimit)\n                                treeElement.expandedChildrenLimit++;\n                        }\n                    }\n                }\n\n                child = child.nextSibling;\n                ++treeChildIndex;\n            }\n        }\n\n        // Remove any tree elements that no longer have this node (or this node's contentDocument) as their parent.\n        for (var i = (this.children.length - 1); i >= 0; --i) {\n            var currentChild = this.children[i];\n            var currentNode = currentChild.representedObject;\n            var currentParentNode = currentNode.parentNode;\n\n            if (currentParentNode === this.representedObject)\n                continue;\n\n            var selectedTreeElement = this.treeOutline.selectedTreeElement;\n            if (selectedTreeElement && (selectedTreeElement === currentChild || selectedTreeElement.hasAncestor(currentChild)))\n                this.select();\n\n            this.removeChildAtIndex(i);\n        }\n\n        updateChildrenOfNode(this.representedObject);\n        this.adjustCollapsedRange(false);\n\n        var lastChild = this.children[this.children.length - 1];\n        if (this.representedObject.nodeType == Node.ELEMENT_NODE && (!lastChild || !lastChild._elementCloseTag))\n            this.insertChildElement(this.representedObject, this.children.length, true);\n\n        // We want to restore the original selection and tree scroll position after a full refresh, if possible.\n        if (fullRefresh && elementToSelect) {\n            elementToSelect.select();\n            if (treeOutlineContainerElement && originalScrollTop <= treeOutlineContainerElement.scrollHeight)\n                treeOutlineContainerElement.scrollTop = originalScrollTop;\n        }\n\n        delete this._updateChildrenInProgress;\n    },\n\n    adjustCollapsedRange: function()\n    {\n        // Ensure precondition: only the tree elements for node children are found in the tree\n        // (not the Expand All button or the closing tag).\n        if (this.expandAllButtonElement && this.expandAllButtonElement.__treeElement.parent)\n            this.removeChild(this.expandAllButtonElement.__treeElement);\n\n        var node = this.representedObject;\n        if (!node.children)\n            return;\n        var childNodeCount = node.children.length;\n\n        // In case some nodes from the expanded range were removed, pull some nodes from the collapsed range into the expanded range at the bottom.\n        for (var i = this.expandedChildCount, limit = Math.min(this.expandedChildrenLimit, childNodeCount); i < limit; ++i)\n            this.insertChildElement(node.children[i], i);\n\n        var expandedChildCount = this.expandedChildCount;\n        if (childNodeCount > this.expandedChildCount) {\n            var targetButtonIndex = expandedChildCount;\n            if (!this.expandAllButtonElement) {\n                var item = new TreeElement(null, null, false);\n                item.titleHTML = \"<button class=\\\"show-all-nodes\\\" value=\\\"\\\" />\";\n                item.selectable = false;\n                item.expandAllButton = true;\n                this.insertChild(item, targetButtonIndex);\n                this.expandAllButtonElement = item.listItemElement.firstChild;\n                this.expandAllButtonElement.__treeElement = item;\n                this.expandAllButtonElement.addEventListener(\"click\", this.handleLoadAllChildren.bind(this), false);\n            } else if (!this.expandAllButtonElement.__treeElement.parent)\n                this.insertChild(this.expandAllButtonElement.__treeElement, targetButtonIndex);\n            this.expandAllButtonElement.textContent = WebInspector.UIString(\"Show All Nodes (%d More)\", childNodeCount - expandedChildCount);\n        } else if (this.expandAllButtonElement)\n            delete this.expandAllButtonElement;\n    },\n\n    handleLoadAllChildren: function()\n    {\n        this.expandedChildrenLimit = Math.max(this.representedObject._childNodeCount, this.expandedChildrenLimit + WebInspector.ElementsTreeElement.InitialChildrenLimit);\n    },\n\n    onexpand: function()\n    {\n        if (this._elementCloseTag)\n            return;\n\n        this.updateTitle();\n        this.treeOutline.updateSelection();\n    },\n\n    oncollapse: function()\n    {\n        if (this._elementCloseTag)\n            return;\n\n        this.updateTitle();\n        this.treeOutline.updateSelection();\n    },\n\n    onreveal: function()\n    {\n        if (this.listItemElement)\n            this.listItemElement.scrollIntoViewIfNeeded(false);\n    },\n\n    onselect: function(treeElement, selectedByUser)\n    {\n        this.treeOutline.suppressRevealAndSelect = true;\n        this.treeOutline.focusedDOMNode = this.representedObject;\n        if (selectedByUser)\n            WebInspector.highlightDOMNode(this.representedObject.id);\n        this.updateSelection();\n        this.treeOutline.suppressRevealAndSelect = false;\n    },\n\n    ondelete: function()\n    {\n        var startTagTreeElement = this.treeOutline.findTreeElement(this.representedObject);\n        startTagTreeElement ? startTagTreeElement.remove() : this.remove();\n        return true;\n    },\n\n    onenter: function()\n    {\n        // On Enter or Return start editing the first attribute\n        // or create a new attribute on the selected element.\n        if (this.treeOutline.editing)\n            return false;\n\n        this._startEditing();\n\n        // prevent a newline from being immediately inserted\n        return true;\n    },\n\n    selectOnMouseDown: function(event)\n    {\n        TreeElement.prototype.selectOnMouseDown.call(this, event);\n\n        if (this._editing)\n            return;\n\n        if (this.treeOutline.showInElementsPanelEnabled) {\n            WebInspector.showPanel(\"elements\");\n            WebInspector.panels.elements.focusedDOMNode = this.representedObject;\n        }\n\n        // Prevent selecting the nearest word on double click.\n        if (event.detail >= 2)\n            event.preventDefault();\n    },\n\n    ondblclick: function(event)\n    {\n        if (this._editing || this._elementCloseTag)\n            return;\n\n        if (this._startEditingTarget(event.target))\n            return;\n\n        if (this.hasChildren && !this.expanded)\n            this.expand();\n    },\n\n    _insertInLastAttributePosition: function(tag, node)\n    {\n        if (tag.getElementsByClassName(\"webkit-html-attribute\").length > 0)\n            tag.insertBefore(node, tag.lastChild);\n        else {\n            var nodeName = tag.textContent.match(/^<(.*?)>$/)[1];\n            tag.textContent = '';\n            tag.appendChild(document.createTextNode('<'+nodeName));\n            tag.appendChild(node);\n            tag.appendChild(document.createTextNode('>'));\n        }\n\n        this.updateSelection();\n    },\n\n    _startEditingTarget: function(eventTarget)\n    {\n        if (this.treeOutline.focusedDOMNode != this.representedObject)\n            return;\n\n        if (this.representedObject.nodeType != Node.ELEMENT_NODE && this.representedObject.nodeType != Node.TEXT_NODE)\n            return false;\n\n        var textNode = eventTarget.enclosingNodeOrSelfWithClass(\"webkit-html-text-node\");\n        if (textNode)\n            return this._startEditingTextNode(textNode);\n\n        var attribute = eventTarget.enclosingNodeOrSelfWithClass(\"webkit-html-attribute\");\n        if (attribute)\n            return this._startEditingAttribute(attribute, eventTarget);\n\n        var tagName = eventTarget.enclosingNodeOrSelfWithClass(\"webkit-html-tag-name\");\n        if (tagName)\n            return this._startEditingTagName(tagName);\n\n        var newAttribute = eventTarget.enclosingNodeOrSelfWithClass(\"add-attribute\");\n        if (newAttribute)\n            return this._addNewAttribute();\n\n        return false;\n    },\n\n    _populateTagContextMenu: function(contextMenu, event)\n    {\n        var attribute = event.target.enclosingNodeOrSelfWithClass(\"webkit-html-attribute\");\n        var newAttribute = event.target.enclosingNodeOrSelfWithClass(\"add-attribute\");\n\n        // Add attribute-related actions.\n        contextMenu.appendItem(WebInspector.UIString(\"Add Attribute\"), this._addNewAttribute.bind(this));\n        if (attribute && !newAttribute)\n            contextMenu.appendItem(WebInspector.UIString(\"Edit Attribute\"), this._startEditingAttribute.bind(this, attribute, event.target));\n        contextMenu.appendSeparator();\n\n        // Add free-form node-related actions.\n        contextMenu.appendItem(WebInspector.UIString(\"Edit as HTML\"), this._editAsHTML.bind(this));\n        contextMenu.appendItem(WebInspector.UIString(\"Copy as HTML\"), this._copyHTML.bind(this));\n        contextMenu.appendItem(WebInspector.UIString(\"Delete Node\"), this.remove.bind(this));\n\n        if (Preferences.nativeInstrumentationEnabled) {\n            // Add debbuging-related actions\n            contextMenu.appendSeparator();\n\n            function handlerFunction(nodeId, breakType)\n            {\n                WebInspector.breakpointManager.createDOMBreakpoint(nodeId, breakType);\n                WebInspector.panels.elements.sidebarPanes.domBreakpoints.expand();\n            }\n            var node = this.representedObject;\n            for (var key in WebInspector.DOMBreakpointTypes) {\n                var type = WebInspector.DOMBreakpointTypes[key];\n                var label = WebInspector.domBreakpointTypeContextMenuLabel(type);\n                var breakpoint = node.breakpoints[type];\n                if (!breakpoint)\n                    var handler = handlerFunction.bind(this, node.id, type);\n                else\n                    var handler = breakpoint.remove.bind(breakpoint);\n                contextMenu.appendCheckboxItem(label, handler, !!breakpoint);\n            }\n        }\n    },\n\n    _populateTextContextMenu: function(contextMenu, textNode)\n    {\n        contextMenu.appendItem(WebInspector.UIString(\"Edit Text\"), this._startEditingTextNode.bind(this, textNode));\n    },\n\n    _startEditing: function()\n    {\n        if (this.treeOutline.focusedDOMNode !== this.representedObject)\n            return;\n\n        var listItem = this._listItemNode;\n\n        if (this._canAddAttributes) {\n            var attribute = listItem.getElementsByClassName(\"webkit-html-attribute\")[0];\n            if (attribute)\n                return this._startEditingAttribute(attribute, attribute.getElementsByClassName(\"webkit-html-attribute-value\")[0]);\n\n            return this._addNewAttribute();\n        }\n\n        if (this.representedObject.nodeType === Node.TEXT_NODE) {\n            var textNode = listItem.getElementsByClassName(\"webkit-html-text-node\")[0];\n            if (textNode)\n                return this._startEditingTextNode(textNode);\n            return;\n        }\n    },\n\n    _addNewAttribute: function()\n    {\n        // Cannot just convert the textual html into an element without\n        // a parent node. Use a temporary span container for the HTML.\n        var container = document.createElement(\"span\");\n        container.innerHTML = this._attributeHTML(\" \", \"\");\n        var attr = container.firstChild;\n        attr.style.marginLeft = \"2px\"; // overrides the .editing margin rule\n        attr.style.marginRight = \"2px\"; // overrides the .editing margin rule\n\n        var tag = this.listItemElement.getElementsByClassName(\"webkit-html-tag\")[0];\n        this._insertInLastAttributePosition(tag, attr);\n        return this._startEditingAttribute(attr, attr);\n    },\n\n    _triggerEditAttribute: function(attributeName)\n    {\n        var attributeElements = this.listItemElement.getElementsByClassName(\"webkit-html-attribute-name\");\n        for (var i = 0, len = attributeElements.length; i < len; ++i) {\n            if (attributeElements[i].textContent === attributeName) {\n                for (var elem = attributeElements[i].nextSibling; elem; elem = elem.nextSibling) {\n                    if (elem.nodeType !== Node.ELEMENT_NODE)\n                        continue;\n\n                    if (elem.hasStyleClass(\"webkit-html-attribute-value\"))\n                        return this._startEditingAttribute(elem.parentNode, elem);\n                }\n            }\n        }\n    },\n\n    _startEditingAttribute: function(attribute, elementForSelection)\n    {\n        if (WebInspector.isBeingEdited(attribute))\n            return true;\n\n        var attributeNameElement = attribute.getElementsByClassName(\"webkit-html-attribute-name\")[0];\n        if (!attributeNameElement)\n            return false;\n\n        var attributeName = attributeNameElement.innerText;\n\n        function removeZeroWidthSpaceRecursive(node)\n        {\n            if (node.nodeType === Node.TEXT_NODE) {\n                node.nodeValue = node.nodeValue.replace(/\\u200B/g, \"\");\n                return;\n            }\n\n            if (node.nodeType !== Node.ELEMENT_NODE)\n                return;\n\n            for (var child = node.firstChild; child; child = child.nextSibling)\n                removeZeroWidthSpaceRecursive(child);\n        }\n\n        // Remove zero-width spaces that were added by nodeTitleInfo.\n        removeZeroWidthSpaceRecursive(attribute);\n\n        this._editing = WebInspector.startEditing(attribute, {\n            context: attributeName,\n            commitHandler: this._attributeEditingCommitted.bind(this),\n            cancelHandler: this._editingCancelled.bind(this)\n        });\n        window.getSelection().setBaseAndExtent(elementForSelection, 0, elementForSelection, 1);\n\n        return true;\n    },\n\n    _startEditingTextNode: function(textNode)\n    {\n        if (WebInspector.isBeingEdited(textNode))\n            return true;\n\n        this._editing = WebInspector.startEditing(textNode, {\n            context: null,\n            commitHandler: this._textNodeEditingCommitted.bind(this),\n            cancelHandler: this._editingCancelled.bind(this)\n        });\n        window.getSelection().setBaseAndExtent(textNode, 0, textNode, 1);\n\n        return true;\n    },\n\n    _startEditingTagName: function(tagNameElement)\n    {\n        if (!tagNameElement) {\n            tagNameElement = this.listItemElement.getElementsByClassName(\"webkit-html-tag-name\")[0];\n            if (!tagNameElement)\n                return false;\n        }\n\n        var tagName = tagNameElement.textContent;\n        if (WebInspector.ElementsTreeElement.EditTagBlacklist[tagName.toLowerCase()])\n            return false;\n\n        if (WebInspector.isBeingEdited(tagNameElement))\n            return true;\n\n        var closingTagElement = this._distinctClosingTagElement();\n\n        function keyupListener(event)\n        {\n            if (closingTagElement)\n                closingTagElement.textContent = \"</\" + tagNameElement.textContent + \">\";\n        }\n\n        function editingComitted(element, newTagName)\n        {\n            tagNameElement.removeEventListener('keyup', keyupListener, false);\n            this._tagNameEditingCommitted.apply(this, arguments);\n        }\n\n        function editingCancelled()\n        {\n            tagNameElement.removeEventListener('keyup', keyupListener, false);\n            this._editingCancelled.apply(this, arguments);\n        }\n\n        tagNameElement.addEventListener('keyup', keyupListener, false);\n\n        this._editing = WebInspector.startEditing(tagNameElement, {\n            context: tagName,\n            commitHandler: editingComitted.bind(this),\n            cancelHandler: editingCancelled.bind(this)\n        });\n        window.getSelection().setBaseAndExtent(tagNameElement, 0, tagNameElement, 1);\n        return true;\n    },\n\n    _startEditingAsHTML: function(commitCallback, initialValue)\n    {\n        if (this._htmlEditElement && WebInspector.isBeingEdited(this._htmlEditElement))\n            return true;\n\n        this._htmlEditElement = document.createElement(\"div\");\n        this._htmlEditElement.className = \"source-code elements-tree-editor\";\n        this._htmlEditElement.textContent = initialValue;\n\n        // Hide header items.\n        var child = this.listItemElement.firstChild;\n        while (child) {\n            child.style.display = \"none\";\n            child = child.nextSibling;\n        }\n        // Hide children item.\n        if (this._childrenListNode)\n            this._childrenListNode.style.display = \"none\";\n        // Append editor.\n        this.listItemElement.appendChild(this._htmlEditElement);\n\n        this.updateSelection();\n\n        function commit()\n        {\n            commitCallback(this._htmlEditElement.textContent);\n            dispose.call(this);\n        }\n\n        function dispose()\n        {\n            delete this._editing;\n\n            // Remove editor.\n            this.listItemElement.removeChild(this._htmlEditElement);\n            delete this._htmlEditElement;\n            // Unhide children item.\n            if (this._childrenListNode)\n                this._childrenListNode.style.removeProperty(\"display\");\n            // Unhide header items.\n            var child = this.listItemElement.firstChild;\n            while (child) {\n                child.style.removeProperty(\"display\");\n                child = child.nextSibling;\n            }\n\n            this.updateSelection();\n        }\n\n        this._editing = WebInspector.startEditing(this._htmlEditElement, {\n            context: null,\n            commitHandler: commit.bind(this),\n            cancelHandler: dispose.bind(this),\n            multiline: true\n        });\n    },\n\n    _attributeEditingCommitted: function(element, newText, oldText, attributeName, moveDirection)\n    {\n        delete this._editing;\n\n        // Before we do anything, determine where we should move\n        // next based on the current element's settings\n        var moveToAttribute, moveToTagName, moveToNewAttribute;\n        if (moveDirection) {\n            var found = false;\n\n            // Search for the attribute's position, and then decide where to move to.\n            var attributes = this.representedObject.attributes;\n            for (var i = 0; i < attributes.length; ++i) {\n                if (attributes[i].name === attributeName) {\n                    found = true;\n                    if (moveDirection === \"backward\") {\n                        if (i === 0)\n                            moveToTagName = true;\n                        else\n                            moveToAttribute = attributes[i - 1].name;\n                    } else if (moveDirection === \"forward\") {\n                        if (i === attributes.length - 1)\n                            moveToNewAttribute = true;\n                        else\n                            moveToAttribute = attributes[i + 1].name;\n                    }\n                }\n            }\n\n            // Moving From the \"New Attribute\" position.\n            if (!found) {\n                if (moveDirection === \"backward\" && attributes.length > 0)\n                    moveToAttribute = attributes[attributes.length - 1].name;\n                else if (moveDirection === \"forward\") {\n                    if (!/^\\s*$/.test(newText))\n                        moveToNewAttribute = true;\n                    else\n                        moveToTagName = true;\n                }\n            }\n        }\n\n        function moveToNextAttributeIfNeeded()\n        {\n            // Cleanup empty new attribute sections.\n            if (element.textContent.trim().length === 0)\n                element.parentNode.removeChild(element);\n\n            // Make the move.\n            if (moveToAttribute)\n                this._triggerEditAttribute(moveToAttribute);\n            else if (moveToNewAttribute)\n                this._addNewAttribute();\n            else if (moveToTagName)\n                this._startEditingTagName();\n        }\n\n        function regenerateStyledAttribute(name, value)\n        {\n            var previous = element.previousSibling;\n            if (!previous || previous.nodeType !== Node.TEXT_NODE)\n                element.parentNode.insertBefore(document.createTextNode(\" \"), element);\n\n            // outerHTML should not be used to replace node content in IE, updated with replaceChild usage\n\t\t\telement.innerHTML = this._attributeHTML(name, value);\n\t\t\telement.parentNode.replaceChild(element.firstChild, element);\n            //element.outerHTML = this._attributeHTML(name, value);\n        }\n\n        var parseContainerElement = document.createElement(\"span\");\n        parseContainerElement.innerHTML = \"<span \" + newText + \"></span>\";\n        var parseElement = parseContainerElement.firstChild;\n\n        if (!parseElement) {\n            this._editingCancelled(element, attributeName);\n            moveToNextAttributeIfNeeded.call(this);\n            return;\n        }\n\n        if (!parseElement.hasAttributes()) {\n            this.representedObject.removeAttribute(attributeName);\n            this.treeOutline.focusedNodeChanged(true);\n            moveToNextAttributeIfNeeded.call(this);\n            return;\n        }\n\n        var foundOriginalAttribute = false;\n        for (var i = 0; i < parseElement.attributes.length; ++i) {\n            var attr = parseElement.attributes[i];\n            foundOriginalAttribute = foundOriginalAttribute || attr.name === attributeName;\n            try {\n                this.representedObject.setAttribute(attr.name, attr.value);\n                regenerateStyledAttribute.call(this, attr.name, attr.value);\n            } catch(e) {} // ignore invalid attribute (innerHTML doesn't throw errors, but this can)\n        }\n\n        if (!foundOriginalAttribute)\n            this.representedObject.removeAttribute(attributeName);\n\n        this.treeOutline.focusedNodeChanged(true);\n\n        moveToNextAttributeIfNeeded.call(this);\n    },\n\n    _tagNameEditingCommitted: function(element, newText, oldText, tagName, moveDirection)\n    {\n        delete this._editing;\n        var self = this;\n\n        function cancel()\n        {\n            var closingTagElement = self._distinctClosingTagElement();\n            if (closingTagElement)\n                closingTagElement.textContent = \"</\" + tagName + \">\";\n\n            self._editingCancelled(element, tagName);\n            moveToNextAttributeIfNeeded.call(self);\n        }\n\n        function moveToNextAttributeIfNeeded()\n        {\n            if (moveDirection !== \"forward\") {\n                this._addNewAttribute();\n                return;\n            }\n\n            var attributes = this.representedObject.attributes;\n            if (attributes.length > 0)\n                this._triggerEditAttribute(attributes[0].name);\n            else\n                this._addNewAttribute();\n        }\n\n        newText = newText.trim();\n        if (newText === oldText) {\n            cancel();\n            return;\n        }\n\n        var treeOutline = this.treeOutline;\n        var wasExpanded = this.expanded;\n\n        function changeTagNameCallback(nodeId)\n        {\n            if (!nodeId) {\n                cancel();\n                return;\n            }\n\n            // Select it and expand if necessary. We force tree update so that it processes dom events and is up to date.\n            WebInspector.panels.elements.updateModifiedNodes();\n\n            WebInspector.updateFocusedNode(nodeId);\n            var newTreeItem = treeOutline.findTreeElement(WebInspector.domAgent.nodeForId(nodeId));\n            if (wasExpanded)\n                newTreeItem.expand();\n\n            moveToNextAttributeIfNeeded.call(newTreeItem);\n        }\n\n        InspectorBackend.changeTagName(this.representedObject.id, newText, changeTagNameCallback);\n    },\n\n    _textNodeEditingCommitted: function(element, newText)\n    {\n        delete this._editing;\n\n        var textNode;\n        if (this.representedObject.nodeType === Node.ELEMENT_NODE) {\n            // We only show text nodes inline in elements if the element only\n            // has a single child, and that child is a text node.\n            textNode = this.representedObject.firstChild;\n        } else if (this.representedObject.nodeType == Node.TEXT_NODE)\n            textNode = this.representedObject;\n\n        textNode.nodeValue = newText;\n    },\n\n    _editingCancelled: function(element, context)\n    {\n        delete this._editing;\n\n        // Need to restore attributes structure.\n        this.updateTitle();\n    },\n\n    _distinctClosingTagElement: function()\n    {\n        // FIXME: Improve the Tree Element / Outline Abstraction to prevent crawling the DOM\n\n        // For an expanded element, it will be the last element with class \"close\"\n        // in the child element list.\n        if (this.expanded) {\n            var closers = this._childrenListNode.querySelectorAll(\".close\");\n            return closers[closers.length-1];\n        }\n\n        // Remaining cases are single line non-expanded elements with a closing\n        // tag, or HTML elements without a closing tag (such as <br>). Return\n        // null in the case where there isn't a closing tag.\n        var tags = this.listItemElement.getElementsByClassName(\"webkit-html-tag\");\n        return (tags.length === 1 ? null : tags[tags.length-1]);\n    },\n\n    updateTitle: function()\n    {\n        // If we are editing, return early to prevent canceling the edit.\n        // After editing is committed updateTitle will be called.\n        if (this._editing)\n            return;\n\n        this.titleHTML = \"<span class=\\\"highlight\\\">\" + this._nodeTitleInfo(WebInspector.linkifyURL).titleHTML + \"</span>\";\n        delete this.selectionElement;\n        this.updateSelection();\n        this._preventFollowingLinksOnDoubleClick();\n        this._highlightSearchResults();\n    },\n\n    _attributeHTML: function(name, value, node, linkify)\n    {\n        var hasText = (value.length > 0);\n        var html = \"<span class=\\\"webkit-html-attribute\\\"><span class=\\\"webkit-html-attribute-name\\\">\" + name.escapeHTML() + \"</span>\";\n\n        if (hasText)\n            html += \"=&#8203;\\\"\";\n\n        if (linkify && (name === \"src\" || name === \"href\")) {\n            var rewrittenHref = WebInspector.resourceURLForRelatedNode(node, value);\n            value = value.replace(/([\\/;:\\)\\]\\}])/g, \"$1\\u200B\");\n            html += linkify(rewrittenHref, value, \"webkit-html-attribute-value\", node.nodeName.toLowerCase() === \"a\");\n        } else {\n            value = value.escapeHTML().replace(/([\\/;:\\)\\]\\}])/g, \"$1&#8203;\");\n            html += \"<span class=\\\"webkit-html-attribute-value\\\">\" + value + \"</span>\";\n        }\n\n        if (hasText)\n            html += \"\\\"\";\n\n        html += \"</span>\";\n        return html;\n    },\n\n    _tagHTML: function(tagName, isClosingTag, isDistinctTreeElement, linkify)\n    {\n        var node = this.representedObject;\n        var result = \"<span class=\\\"webkit-html-tag\" + (isClosingTag && isDistinctTreeElement ? \" close\" : \"\")  + \"\\\">&lt;\";\n        result += \"<span \" + (isClosingTag ? \"\" : \"class=\\\"webkit-html-tag-name\\\"\") + \">\" + (isClosingTag ? \"/\" : \"\") + tagName + \"</span>\";\n        if (!isClosingTag && node.hasAttributes()) {\n            for (var i = 0; i < node.attributes.length; ++i) {\n                var attr = node.attributes[i];\n                result += \" \" + this._attributeHTML(attr.name, attr.value, node, linkify);\n            }\n        }\n        result += \"&gt;</span>&#8203;\";\n\n        return result;\n    },\n\n    _nodeTitleInfo: function(linkify)\n    {\n        var node = this.representedObject;\n        var info = {titleHTML: \"\", hasChildren: this.hasChildren};\n\n        switch (node.nodeType) {\n            case Node.DOCUMENT_NODE:\n                info.titleHTML = \"Document\";\n                break;\n\n            case Node.DOCUMENT_FRAGMENT_NODE:\n                info.titleHTML = \"Document Fragment\";\n                break;\n\n            case Node.ATTRIBUTE_NODE:\n                var value = node.value || \"\\u200B\"; // Zero width space to force showing an empty value.\n                info.titleHTML = this._attributeHTML(node.name, value);\n                break;\n\n            case Node.ELEMENT_NODE:\n                var tagName = this.treeOutline.nodeNameToCorrectCase(node.nodeName).escapeHTML();\n                if (this._elementCloseTag) {\n                    info.titleHTML = this._tagHTML(tagName, true, true);\n                    info.hasChildren = false;\n                    break;\n                }\n\n                var titleHTML = this._tagHTML(tagName, false, false, linkify);\n\n                var textChild = onlyTextChild.call(node);\n                var showInlineText = textChild && textChild.textContent.length < Preferences.maxInlineTextChildLength;\n\n                if (!this.expanded && (!showInlineText && (this.treeOutline.isXMLMimeType || !WebInspector.ElementsTreeElement.ForbiddenClosingTagElements[tagName]))) {\n                    if (this.hasChildren)\n                        titleHTML += \"<span class=\\\"webkit-html-text-node\\\">&#8230;</span>&#8203;\";\n                    titleHTML += this._tagHTML(tagName, true, false);\n                }\n\n                // If this element only has a single child that is a text node,\n                // just show that text and the closing tag inline rather than\n                // create a subtree for them\n                if (showInlineText) {\n                    titleHTML += \"<span class=\\\"webkit-html-text-node\\\">\" + textChild.nodeValue.escapeHTML() + \"</span>&#8203;\" + this._tagHTML(tagName, true, false);\n                    info.hasChildren = false;\n                }\n                info.titleHTML = titleHTML;\n                break;\n\n            case Node.TEXT_NODE:\n                if (isNodeWhitespace.call(node))\n                    info.titleHTML = \"(whitespace)\";\n                else {\n                    if (node.parentNode && node.parentNode.nodeName.toLowerCase() === \"script\") {\n                        var newNode = document.createElement(\"span\");\n                        newNode.textContent = node.textContent;\n\n                        var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(\"text/javascript\");\n                        javascriptSyntaxHighlighter.syntaxHighlightNode(newNode);\n\n                        info.titleHTML = \"<span class=\\\"webkit-html-text-node webkit-html-js-node\\\">\" + newNode.innerHTML.replace(/^[\\n\\r]*/, \"\").replace(/\\s*$/, \"\") + \"</span>\";\n                    } else if (node.parentNode && node.parentNode.nodeName.toLowerCase() === \"style\") {\n                        var newNode = document.createElement(\"span\");\n                        newNode.textContent = node.textContent;\n\n                        var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(\"text/css\");\n                        cssSyntaxHighlighter.syntaxHighlightNode(newNode);\n\n                        info.titleHTML = \"<span class=\\\"webkit-html-text-node webkit-html-css-node\\\">\" + newNode.innerHTML.replace(/^[\\n\\r]*/, \"\").replace(/\\s*$/, \"\") + \"</span>\";\n                    } else\n                        info.titleHTML = \"\\\"<span class=\\\"webkit-html-text-node\\\">\" + node.nodeValue.escapeHTML() + \"</span>\\\"\";\n                }\n                break;\n\n            case Node.COMMENT_NODE:\n                info.titleHTML = \"<span class=\\\"webkit-html-comment\\\">&lt;!--\" + node.nodeValue.escapeHTML() + \"--&gt;</span>\";\n                break;\n\n            case Node.DOCUMENT_TYPE_NODE:\n                var titleHTML = \"<span class=\\\"webkit-html-doctype\\\">&lt;!DOCTYPE \" + node.nodeName;\n                if (node.publicId) {\n                    titleHTML += \" PUBLIC \\\"\" + node.publicId + \"\\\"\";\n                    if (node.systemId)\n                        titleHTML += \" \\\"\" + node.systemId + \"\\\"\";\n                } else if (node.systemId)\n                    titleHTML += \" SYSTEM \\\"\" + node.systemId + \"\\\"\";\n                if (node.internalSubset)\n                    titleHTML += \" [\" + node.internalSubset + \"]\";\n                titleHTML += \"&gt;</span>\";\n                info.titleHTML = titleHTML;\n                break;\n\n            case Node.CDATA_SECTION_NODE:\n                info.titleHTML = \"<span class=\\\"webkit-html-text-node\\\">&lt;![CDATA[\" + node.nodeValue.escapeHTML() + \"]]&gt;</span>\";\n                break;\n            default:\n                info.titleHTML = this.treeOutline.nodeNameToCorrectCase(node.nodeName).collapseWhitespace().escapeHTML();\n        }\n\n        return info;\n    },\n\n    _showInlineText: function(node)\n    {\n        if (node.nodeType === Node.ELEMENT_NODE) {\n            var textChild = onlyTextChild.call(node);\n            if (textChild && textChild.textContent.length < Preferences.maxInlineTextChildLength)\n                return true;\n        }\n        return false;\n    },\n\n    remove: function()\n    {\n        var parentElement = this.parent;\n        if (!parentElement)\n            return;\n\n        var self = this;\n        function removeNodeCallback(removedNodeId)\n        {\n            // -1 is an error code, which means removing the node from the DOM failed,\n            // so we shouldn't remove it from the tree.\n            if (removedNodeId === -1)\n                return;\n\n            parentElement.removeChild(self);\n            parentElement.adjustCollapsedRange(true);\n        }\n\n        InspectorBackend.removeNode(this.representedObject.id, removeNodeCallback);\n    },\n\n    _editAsHTML: function()\n    {\n        var treeOutline = this.treeOutline;\n        var node = this.representedObject;\n        var wasExpanded = this.expanded;\n\n        function selectNode(nodeId)\n        {\n            if (!nodeId)\n                return;\n\n            // Select it and expand if necessary. We force tree update so that it processes dom events and is up to date.\n            WebInspector.panels.elements.updateModifiedNodes();\n\n            WebInspector.updateFocusedNode(nodeId);\n            if (wasExpanded) {\n                var newTreeItem = treeOutline.findTreeElement(WebInspector.domAgent.nodeForId(nodeId));\n                if (newTreeItem)\n                    newTreeItem.expand();\n            }\n        }\n\n        function commitChange(value)\n        {\n            InspectorBackend.setOuterHTML(node.id, value, selectNode);\n        }\n\n        InspectorBackend.getOuterHTML(node.id, this._startEditingAsHTML.bind(this, commitChange));\n    },\n\n    _copyHTML: function()\n    {\n        InspectorBackend.copyNode(this.representedObject.id);\n    },\n\n    _highlightSearchResults: function()\n    {\n        if (!this._searchQuery)\n            return;\n        var text = this.listItemElement.textContent;\n        var regexObject = createSearchRegex(this._searchQuery);\n\n        var offset = 0;\n        var match = regexObject.exec(text);\n        while (match) {\n            highlightSearchResult(this.listItemElement, offset + match.index, match[0].length);\n            offset += match.index + 1;\n            text = text.substring(match.index + 1);\n            match = regexObject.exec(text);\n        }\n    }\n}\n\nWebInspector.ElementsTreeElement.prototype.__proto__ = TreeElement.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/EventListenersSidebarPane.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.EventListenersSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Event Listeners\"));\n    this.bodyElement.addStyleClass(\"events-pane\");\n\n    this.sections = [];\n\n    this.settingsSelectElement = document.createElement(\"select\");\n\n    var option = document.createElement(\"option\");\n    option.value = \"all\";\n    option.label = WebInspector.UIString(\"All Nodes\");\n    this.settingsSelectElement.appendChild(option);\n\n    option = document.createElement(\"option\");\n    option.value = \"selected\";\n    option.label = WebInspector.UIString(\"Selected Node Only\");\n    this.settingsSelectElement.appendChild(option);\n\n    var filter = WebInspector.settings.eventListenersFilter;\n    if (filter === \"all\")\n        this.settingsSelectElement[0].selected = true;\n    else if (filter === \"selected\")\n        this.settingsSelectElement[1].selected = true;\n    this.settingsSelectElement.addEventListener(\"click\", function(event) { event.stopPropagation() }, false);\n    this.settingsSelectElement.addEventListener(\"change\", this._changeSetting.bind(this), false);\n\n    this.titleElement.appendChild(this.settingsSelectElement);\n}\n\nWebInspector.EventListenersSidebarPane.prototype = {\n    update: function(node)\n    {\n        var body = this.bodyElement;\n        body.removeChildren();\n        this.sections = [];\n\n        var self = this;\n        function callback(nodeId, eventListeners) {\n            var sectionNames = [];\n            var sectionMap = {};\n            for (var i = 0; i < eventListeners.length; ++i) {\n                var eventListener = eventListeners[i];\n                eventListener.node = WebInspector.domAgent.nodeForId(eventListener.nodeId);\n                delete eventListener.nodeId; // no longer needed\n                if (/^function _inspectorCommandLineAPI_logEvent\\(/.test(eventListener.listenerBody.toString()))\n                    continue; // ignore event listeners generated by monitorEvent\n                var type = eventListener.type;\n                var section = sectionMap[type];\n                if (!section) {\n                    section = new WebInspector.EventListenersSection(type, nodeId);\n                    sectionMap[type] = section;\n                    sectionNames.push(type);\n                    self.sections.push(section);\n                }\n                section.addListener(eventListener);\n            }\n            \n            if (sectionNames.length === 0) {\n                var div = document.createElement(\"div\");\n                div.className = \"info\";\n                div.textContent = WebInspector.UIString(\"No Event Listeners\");\n                body.appendChild(div);\n                return;\n            }\n\n            sectionNames.sort();\n            for (var i = 0; i < sectionNames.length; ++i) {\n                var section = sectionMap[sectionNames[i]];\n                section.update();\n                body.appendChild(section.element);\n            }\n        }\n\n        WebInspector.EventListeners.getEventListenersForNodeAsync(node, callback);\n    },\n\n    _changeSetting: function(event)\n    {\n        var selectedOption = this.settingsSelectElement[this.settingsSelectElement.selectedIndex];\n        WebInspector.settings.eventListenersFilter = selectedOption.value;\n\n        for (var i = 0; i < this.sections.length; ++i)\n            this.sections[i].update();\n    }\n}\n\nWebInspector.EventListenersSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.EventListenersSection = function(title, nodeId)\n{\n    this.eventListeners = [];\n    this._nodeId = nodeId;\n    WebInspector.PropertiesSection.call(this, title);\n\n    // Changed from a Properties List\n    this.propertiesElement.parentNode.removeChild(this.propertiesElement);\n    delete this.propertiesElement;\n    delete this.propertiesTreeOutline;\n\n    this.eventBars = document.createElement(\"div\");\n    this.eventBars.className = \"event-bars\";\n    this.element.appendChild(this.eventBars);\n}\n\nWebInspector.EventListenersSection.prototype = {\n    update: function()\n    {\n        // A Filtered Array simplifies when to create connectors\n        var filteredEventListeners = this.eventListeners;\n        if (WebInspector.settings.eventListenersFilter === \"selected\") {\n            filteredEventListeners = [];\n            for (var i = 0; i < this.eventListeners.length; ++i) {\n                var eventListener = this.eventListeners[i];\n                if (eventListener.node.id === this._nodeId)\n                    filteredEventListeners.push(eventListener);\n            }\n        }\n\n        this.eventBars.removeChildren();\n        var length = filteredEventListeners.length;\n        for (var i = 0; i < length; ++i) {\n            var eventListener = filteredEventListeners[i];\n            var eventListenerBar = new WebInspector.EventListenerBar(eventListener, this._nodeId);\n            this.eventBars.appendChild(eventListenerBar.element);\n        }\n    },\n\n    addListener: function(eventListener)\n    {\n        this.eventListeners.push(eventListener);\n    }\n}\n\nWebInspector.EventListenersSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype;\n\nWebInspector.EventListenerBar = function(eventListener, nodeId)\n{\n    this.eventListener = eventListener;\n    this._nodeId = nodeId;\n    WebInspector.ObjectPropertiesSection.call(this);\n    this._setNodeTitle();\n    this._setFunctionSubtitle();\n    this.editable = false;\n    this.element.className = \"event-bar\"; /* Changed from \"section\" */\n    this.headerElement.addStyleClass(\"source-code\");\n    this.propertiesElement.className = \"event-properties properties-tree source-code\"; /* Changed from \"properties\" */\n}\n\nWebInspector.EventListenerBar.prototype = {\n    update: function()\n    {\n        function updateWithNodeObject(nodeObject)\n        {\n            var properties = [];\n            if (nodeObject)\n                properties.push(new WebInspector.RemoteObjectProperty(\"node\", nodeObject));\n\n            for (var propertyName in this.eventListener) {\n                var value = WebInspector.RemoteObject.fromPrimitiveValue(this.eventListener[propertyName]);\n                properties.push(new WebInspector.RemoteObjectProperty(propertyName, value));\n            }\n            this.updateProperties(properties);\n        }\n        var node = this.eventListener.node;\n        delete this.eventListener.node;\n        WebInspector.RemoteObject.resolveNode(node, updateWithNodeObject.bind(this));\n    },\n\n    _setNodeTitle: function()\n    {\n        var node = this.eventListener.node;\n        if (!node)\n            return;\n\n        if (node.nodeType === Node.DOCUMENT_NODE) {\n            this.titleElement.textContent = \"document\";\n            return;\n        }\n\n        if (node.id === this._nodeId) {\n            this.titleElement.textContent = appropriateSelectorForNode(node);\n            return;\n        }\n\n        this.titleElement.removeChildren();\n        this.titleElement.appendChild(WebInspector.panels.elements.linkifyNodeReference(this.eventListener.node));\n    },\n\n    _setFunctionSubtitle: function()\n    {\n        // Requires that Function.toString() return at least the function's signature.\n        if (this.eventListener.sourceName) {\n            this.subtitleElement.removeChildren();\n            this.subtitleElement.appendChild(WebInspector.linkifyResourceAsNode(this.eventListener.sourceName, \"scripts\", this.eventListener.lineNumber));\n        } else {\n            var match = this.eventListener.listenerBody.match(/function ([^\\(]+?)\\(/);\n            if (match)\n                this.subtitleElement.textContent = match[1];\n            else\n                this.subtitleElement.textContent = WebInspector.UIString(\"(anonymous function)\");\n        }\n    }\n}\n\nWebInspector.EventListenerBar.prototype.__proto__ = WebInspector.ObjectPropertiesSection.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ExtensionAPI.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.injectedExtensionAPI = function(InjectedScriptHost, inspectedWindow, injectedScriptId)\n{\n\n// Here and below, all constructors are private to API implementation.\n// For a public type Foo, if internal fields are present, these are on\n// a private FooImpl type, an instance of FooImpl is used in a closure\n// by Foo consutrctor to re-bind publicly exported members to an instance\n// of Foo.\n\nfunction EventSinkImpl(type, customDispatch)\n{\n    this._type = type;\n    this._listeners = [];\n    this._customDispatch = customDispatch;\n}\n\nEventSinkImpl.prototype = {\n    addListener: function(callback)\n    {\n        if (typeof callback != \"function\")\n            throw new \"addListener: callback is not a function\";\n        if (this._listeners.length === 0)\n            extensionServer.sendRequest({ command: \"subscribe\", type: this._type });\n        this._listeners.push(callback);\n        extensionServer.registerHandler(\"notify-\" + this._type, bind(this._dispatch, this));\n    },\n\n    removeListener: function(callback)\n    {\n        var listeners = this._listeners;\n\n        for (var i = 0; i < listeners.length; ++i) {\n            if (listeners[i] === callback) {\n                listeners.splice(i, 1);\n                break;\n            }\n        }\n        if (this._listeners.length === 0)\n            extensionServer.sendRequest({ command: \"unsubscribe\", type: this._type });\n    },\n\n    _fire: function()\n    {\n        var listeners = this._listeners.slice();\n        for (var i = 0; i < listeners.length; ++i)\n            listeners[i].apply(null, arguments);\n    },\n\n    _dispatch: function(request)\n    {\n         if (this._customDispatch)\n             this._customDispatch.call(this, request);\n         else\n             this._fire.apply(this, request.arguments);\n    }\n}\n\nfunction InspectorExtensionAPI()\n{\n    this.audits = new Audits();\n    this.inspectedWindow = new InspectedWindow();\n    this.panels = new Panels();\n    this.resources = new Resources();\n\n    this.onReset = new EventSink(\"reset\");\n}\n\nInspectorExtensionAPI.prototype = {\n    log: function(message)\n    {\n        extensionServer.sendRequest({ command: \"log\", message: message });\n    }\n}\n\nfunction Resources()\n{\n    function resourceDispatch(request)\n    {\n        var resource = request.arguments[1];\n        resource.__proto__ = new Resource(request.arguments[0]);\n        this._fire(resource);\n    }\n    this.onFinished = new EventSink(\"resource-finished\", resourceDispatch);\n}\n\nResources.prototype = {\n    getHAR: function(callback)\n    {\n        function callbackWrapper(result)\n        {\n            var entries = (result && result.entries) || [];\n            for (var i = 0; i < entries.length; ++i) {\n                entries[i].__proto__ = new Resource(entries[i]._resourceId);\n                delete entries[i]._resourceId;\n            }\n            callback(result);\n        }\n        return extensionServer.sendRequest({ command: \"getHAR\" }, callback && callbackWrapper);\n    },\n\n    addRequestHeaders: function(headers)\n    {\n        return extensionServer.sendRequest({ command: \"addRequestHeaders\", headers: headers, extensionId: location.hostname });\n    }\n}\n\nfunction ResourceImpl(id)\n{\n    this._id = id;\n}\n\nResourceImpl.prototype = {\n    getContent: function(callback)\n    {\n        function callbackWrapper(response)\n        {\n            callback(response.content, response.encoding);\n        }\n        extensionServer.sendRequest({ command: \"getResourceContent\", id: this._id }, callback && callbackWrapper);\n    }\n};\n\nfunction Panels()\n{\n    var panels = {\n        elements: new ElementsPanel()\n    };\n\n    function panelGetter(name)\n    {\n        return panels[name];\n    }\n    for (var panel in panels)\n        this.__defineGetter__(panel, bind(panelGetter, null, panel));\n}\n\nPanels.prototype = {\n    create: function(title, iconURL, pageURL, callback)\n    {\n        var id = \"extension-panel-\" + extensionServer.nextObjectId();\n        var request = {\n            command: \"createPanel\",\n            id: id,\n            title: title,\n            icon: expandURL(iconURL),\n            url: expandURL(pageURL)\n        };\n        extensionServer.sendRequest(request, callback && bind(callback, this, new ExtensionPanel(id)));\n    }\n}\n\nfunction PanelImpl(id)\n{\n    this._id = id;\n}\n\nfunction PanelWithSidebarImpl(id)\n{\n    PanelImpl.call(this, id);\n}\n\nPanelWithSidebarImpl.prototype = {\n    createSidebarPane: function(title, url, callback)\n    {\n        var id = \"extension-sidebar-\" + extensionServer.nextObjectId();\n        var request = {\n            command: \"createSidebarPane\",\n            panel: this._id,\n            id: id,\n            title: title,\n            url: expandURL(url)\n        };\n        function callbackWrapper()\n        {\n            callback(new ExtensionSidebarPane(id));\n        }\n        extensionServer.sendRequest(request, callback && callbackWrapper);\n    },\n\n    createWatchExpressionSidebarPane: function(title, callback)\n    {\n        var id = \"watch-sidebar-\" + extensionServer.nextObjectId();\n        var request = {\n            command: \"createWatchExpressionSidebarPane\",\n            panel: this._id,\n            id: id,\n            title: title\n        };\n        function callbackWrapper()\n        {\n            callback(new WatchExpressionSidebarPane(id));\n        }\n        extensionServer.sendRequest(request, callback && callbackWrapper);\n    }\n}\n\nPanelWithSidebarImpl.prototype.__proto__ = PanelImpl.prototype;\n\nfunction ElementsPanel()\n{\n    var id = \"elements\";\n    PanelWithSidebar.call(this, id);\n    this.onSelectionChanged = new EventSink(\"panel-objectSelected-\" + id);\n}\n\nfunction ExtensionPanel(id)\n{\n    Panel.call(this, id);\n    this.onSearch = new EventSink(\"panel-search-\" + id);\n}\n\nfunction ExtensionSidebarPaneImpl(id)\n{\n    this._id = id;\n}\n\nExtensionSidebarPaneImpl.prototype = {\n    setHeight: function(height)\n    {\n        extensionServer.sendRequest({ command: \"setSidebarHeight\", id: this._id, height: height });\n    }\n}\n\nfunction WatchExpressionSidebarPaneImpl(id)\n{\n    ExtensionSidebarPaneImpl.call(this, id);\n    this.onUpdated = new EventSink(\"watch-sidebar-updated-\" + id);\n}\n\nWatchExpressionSidebarPaneImpl.prototype = {\n    setExpression: function(expression, rootTitle)\n    {\n        extensionServer.sendRequest({ command: \"setWatchSidebarContent\", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true });\n    },\n\n    setObject: function(jsonObject, rootTitle)\n    {\n        extensionServer.sendRequest({ command: \"setWatchSidebarContent\", id: this._id, expression: jsonObject, rootTitle: rootTitle });\n    }\n}\n\nWatchExpressionSidebarPaneImpl.prototype.__proto__ = ExtensionSidebarPaneImpl.prototype;\n\nfunction WatchExpressionSidebarPane(id)\n{\n    var impl = new WatchExpressionSidebarPaneImpl(id);\n    ExtensionSidebarPane.call(this, id, impl);\n}\n\nfunction Audits()\n{\n}\n\nAudits.prototype = {\n    addCategory: function(displayName, resultCount)\n    {\n        var id = \"extension-audit-category-\" + extensionServer.nextObjectId();\n        extensionServer.sendRequest({ command: \"addAuditCategory\", id: id, displayName: displayName, resultCount: resultCount });\n        return new AuditCategory(id);\n    }\n}\n\nfunction AuditCategoryImpl(id)\n{\n    function auditResultDispatch(request)\n    {\n        var auditResult = new AuditResult(request.arguments[0]);\n        try {\n            this._fire(auditResult);\n        } catch (e) {\n            console.error(\"Uncaught exception in extension audit event handler: \" + e);\n            auditResult.done();\n        }\n    }\n    this._id = id;\n    this.onAuditStarted = new EventSink(\"audit-started-\" + id, auditResultDispatch);\n}\n\nfunction AuditResultImpl(id)\n{\n    this._id = id;\n\n    var formatterTypes = [\n        \"url\",\n        \"snippet\",\n        \"text\"\n    ];\n    for (var i = 0; i < formatterTypes.length; ++i)\n        this[formatterTypes[i]] = bind(this._nodeFactory, null, formatterTypes[i]);\n}\n\nAuditResultImpl.prototype = {\n    addResult: function(displayName, description, severity, details)\n    {\n        // shorthand for specifying details directly in addResult().\n        if (details && !(details instanceof AuditResultNode))\n            details = details instanceof Array ? this.createNode.apply(this, details) : this.createNode(details);\n\n        var request = {\n            command: \"addAuditResult\",\n            resultId: this._id,\n            displayName: displayName,\n            description: description,\n            severity: severity,\n            details: details\n        };\n        extensionServer.sendRequest(request);\n    },\n\n    createResult: function()\n    {\n        var node = new AuditResultNode();\n        node.contents = Array.prototype.slice.call(arguments);\n        return node;\n    },\n\n    done: function()\n    {\n        extensionServer.sendRequest({ command: \"stopAuditCategoryRun\", resultId: this._id });\n    },\n\n    get Severity()\n    {\n        return apiPrivate.audits.Severity;\n    },\n\n    _nodeFactory: function(type)\n    {\n        return {\n            type: type,\n            arguments: Array.prototype.slice.call(arguments, 1)\n        };\n    }\n}\n\nfunction AuditResultNode(contents)\n{\n    this.contents = contents;\n    this.children = [];\n    this.expanded = false;\n}\n\nAuditResultNode.prototype = {\n    addChild: function()\n    {\n        var node = AuditResultImpl.prototype.createResult.apply(null, arguments);\n        this.children.push(node);\n        return node;\n    }\n};\n\nfunction InspectedWindow()\n{\n    this.onDOMContentLoaded = new EventSink(\"inspectedPageDOMContentLoaded\");\n    this.onLoaded = new EventSink(\"inspectedPageLoaded\");\n    this.onNavigated = new EventSink(\"inspectedURLChanged\");\n}\n\nInspectedWindow.prototype = {\n    reload: function(userAgent)\n    {\n        return extensionServer.sendRequest({ command: \"reload\", userAgent: userAgent });\n    },\n\n    eval: function(expression, callback)\n    {\n        function callbackWrapper(result)\n        {\n            var value = result.value;\n            if (!result.isException)\n                value = value === \"undefined\" ? undefined : JSON.parse(value);\n            callback(value, result.isException);\n        }\n        return extensionServer.sendRequest({ command: \"evaluateOnInspectedPage\", expression: expression }, callback && callbackWrapper);\n    }\n}\n\nfunction ExtensionServerClient()\n{\n    this._callbacks = {};\n    this._handlers = {};\n    this._lastRequestId = 0;\n    this._lastObjectId = 0;\n\n    this.registerHandler(\"callback\", bind(this._onCallback, this));\n\n    var channel = new MessageChannel();\n    this._port = channel.port1;\n    this._port.addEventListener(\"message\", bind(this._onMessage, this), false);\n    this._port.start();\n\n    top.postMessage(\"registerExtension\", [ channel.port2 ], \"*\");\n}\n\nExtensionServerClient.prototype = {\n    sendRequest: function(message, callback)\n    {\n        if (typeof callback === \"function\")\n            message.requestId = this._registerCallback(callback);\n        return this._port.postMessage(message);\n    },\n\n    registerHandler: function(command, handler)\n    {\n        this._handlers[command] = handler;\n    },\n\n    nextObjectId: function()\n    {\n        return injectedScriptId + \"_\" + ++this._lastObjectId;\n    },\n\n    _registerCallback: function(callback)\n    {\n        var id = ++this._lastRequestId;\n        this._callbacks[id] = callback;\n        return id;\n    },\n\n    _onCallback: function(request)\n    {\n        if (request.requestId in this._callbacks) {\n            var callback = this._callbacks[request.requestId];\n            delete this._callbacks[request.requestId];\n            callback(request.result);\n        }\n    },\n\n    _onMessage: function(event)\n    {\n        var request = event.data;\n        var handler = this._handlers[request.command];\n        if (handler)\n            handler.call(this, request);\n    }\n}\n\nfunction expandURL(url)\n{\n    if (!url)\n        return url;\n    if (/^[^/]+:/.exec(url)) // See if url has schema.\n        return url;\n    var baseURL = location.protocol + \"//\" + location.hostname + location.port;\n    if (/^\\//.exec(url))\n        return baseURL + url;\n    return baseURL + location.pathname.replace(/\\/[^/]*$/,\"/\") + url;\n}\n\nfunction bind(func, thisObject)\n{\n    var args = Array.prototype.slice.call(arguments, 2);\n    return function() { return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0))); };\n}\n\nfunction populateInterfaceClass(interface, implementation)\n{\n    for (var member in implementation) {\n        if (member.charAt(0) === \"_\")\n            continue;\n        var value = implementation[member];\n        interface[member] = typeof value === \"function\" ? bind(value, implementation)\n            : interface[member] = implementation[member];\n    }\n}\n\nfunction declareInterfaceClass(implConstructor)\n{\n    return function()\n    {\n        var impl = { __proto__: implConstructor.prototype };\n        implConstructor.apply(impl, arguments);\n        populateInterfaceClass(this, impl);\n    }\n}\n\nvar AuditCategory = declareInterfaceClass(AuditCategoryImpl);\nvar AuditResult = declareInterfaceClass(AuditResultImpl);\nvar EventSink = declareInterfaceClass(EventSinkImpl);\nvar ExtensionSidebarPane = declareInterfaceClass(ExtensionSidebarPaneImpl);\nvar Panel = declareInterfaceClass(PanelImpl);\nvar PanelWithSidebar = declareInterfaceClass(PanelWithSidebarImpl);\nvar Resource = declareInterfaceClass(ResourceImpl);\nvar WatchExpressionSidebarPane = declareInterfaceClass(WatchExpressionSidebarPaneImpl);\n\nvar extensionServer = new ExtensionServerClient();\n\nwebInspector = new InspectorExtensionAPI();\n\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ExtensionAPISchema.json",
    "content": "[\n  {\n    \"namespace\": \"experimental.webInspector.inspectedWindow\",\n    \"description\": \"Provides access to the window being inspected.\",\n    \"functions\": [\n      {\n        \"name\": \"eval\",\n        \"type\": \"function\",\n        \"description\": \"Evaluates a JavaScript expression in the context of inspected page (NOTE: the expression must evaluate to a JSON-compliant object, otherwise the exception is thrown)\",\n        \"parameters\": [\n          {\n            \"name\": \"expression\",\n            \"type\": \"string\",\n            \"description\": \"An expression to evaluate.\"\n          },\n          {\n            \"name\": \"callback\",\n            \"type\": \"function\",\n            \"description\": \"A function called when evaluation completes.\",\n            \"parameters\": [\n              {\n                \"name\": \"result\",\n                \"type\": \"object\",\n                \"description\": \"The result of evaluation\"\n              },\n              {\n                \"name\": \"isException\",\n                \"type\": \"boolean\",\n                \"description\": \"Set if an exception was caught while evaluating the expression\"\n              }\n            ]\n          }\n        ]\n      }\n    ],\n    \"events\": [\n      {\n        \"name\": \"onDOMContentLoaded\",\n        \"type\": \"function\",\n        \"description\": \"Fired after DOMContentLoaded event on inspected page is fired.\"\n      },\n      {\n        \"name\": \"onLoaded\",\n        \"type\": \"function\",\n        \"description\": \"Fired after load event on inspected page is fired.\"\n      },\n      {\n        \"name\": \"onNavigated\",\n        \"type\": \"function\",\n        \"description\": \"Fired when navigation occurs in the window being inspected.\"\n      }\n    ]\n  },\n  {\n    \"namespace\": \"experimental.webInspector.panels\",\n    \"types\": [\n      {\n        \"id\": \"PanelWithSidebars\",\n        \"type\": \"object\",\n        \"isInstanceOf\": \"Panel\",\n        \"description\": \"A panel within Web Inspector UI that has sidebars.\",\n        \"functions\": [\n          {\n            \"name\": \"createSidebarPane\",\n            \"type\": \"function\",\n            \"description\": \"Creates a pane within panel's sidebar.\",\n            \"parameters\": [\n              {\n                \"name\": \"title\",\n                \"type\": \"string\",\n                \"description\": \"A text that is displayed in sidebar caption.\"\n              },\n              {\n                \"name\": \"url\",\n                \"type\": \"string\",\n                \"description\": \"An URL of the page that represents the sidebar.\"\n              },\n              {\n                \"name\": \"callback\",\n                \"type\": \"function\",\n                \"description\": \"A callback invoked when sidebar is created\",\n                \"parameters\": [\n                  {\n                    \"name\": \"result\",\n                    \"description\": \"An ExtensionSidebarPane object for created sidebar pane\",\n                    \"$ref\": \"ExtensionSidebarPane\"\n                  }\n                ]\n              }\n            ]\n          },\n          {\n            \"name\": \"createWatchExpressionSidebarPane\",\n            \"type\": \"function\",\n            \"description\": \"Creates a pane with an object property tree (similar to a watch sidebar pane).\",\n            \"parameters\": [\n              {\n                \"name\": \"title\",\n                \"type\": \"string\",\n                \"description\": \"A text that is displayed in sidebar caption.\"\n              },\n              {\n                \"name\": \"callback\",\n                \"type\": \"function\",\n                \"description\": \"A callback invoked when sidebar is created\",\n                \"parameters\": [\n                  {\n                    \"name\": \"result\",\n                    \"description\": \"A WatchExpressionSidebarPane object for created sidebar pane\",\n                    \"$ref\": \"WatchExpressionSidebarPane\"\n                  }\n                ]\n              }\n            ]\n          }\n        ]\n      },\n      {\n        \"id\": \"ElementsPanel\",\n        \"type\": \"object\",\n        \"isInstanceOf\": \"PanelWithSidebars\",\n        \"description\": \"Represents Elements panel\",\n        \"events\": [\n          {\n            \"name\": \"onSelectionChanged\",\n            \"description\": \"Fired when an objects is selected in the panel.\"\n          }\n        ]\n      },\n      {\n        \"id\": \"ExtensionPanel\",\n        \"type\": \"object\",\n        \"isInstanceOf\": \"Panel\",\n        \"description\": \"Represents a panel created by extension\",\n        \"events\": [\n          {\n            \"name\": \"onSearch\",\n            \"description\": \"Fired upon a search action (start of a new search, search result navigation or search being canceled).\",\n            \"parameters\": [\n              {\n                \"name\": \"action\",\n                \"type\": \"string\",\n                \"description\": \"Type of search action being performed.\"\n              },\n              {\n                \"name\": \"queryString\",\n                \"type\": \"string\",\n                \"optional\": true,\n                \"description\": \"Query string (only for 'performSearch')\"\n              }\n            ]\n          }\n       \t]\n      },\n      {\n        \"id\": \"ExtensionSidebarPane\",\n        \"type\": \"object\",\n        \"description\": \"A sidebar created by the extension.\",\n        \"functions\": [\n          {\n            \"name\": \"setHeight\",\n            \"type\": \"function\",\n            \"description\": \"Sets the height of the sidebar.\",\n            \"parameters\": [\n              {\n                \"name\": \"height\",\n                \"type\": \"string\",\n                \"description\": \"A CSS-like size specification, e.g. '10px' or '12pt'\"\n              }\n            ]\n          }\n        ]\n      },\n      {\n        \"id\": \"WatchExpressionSidebarPane\",\n        \"type\": \"object\",\n        \"description\": \"A sidebar created by the extension.\",\n        \"functions\": [\n          {\n            \"name\": \"setHeight\",\n            \"type\": \"function\",\n            \"description\": \"Sets the height of the sidebar.\",\n            \"parameters\": [\n              {\n                \"name\": \"height\",\n                \"type\": \"string\",\n                \"description\": \"A CSS-like size specification, e.g. '10px' or '12pt'\"\n              }\n            ]\n          },\n          {\n            \"name\": \"setExpression\",\n            \"type\": \"function\",\n            \"description\": \"Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.\",\n            \"parameters\": [\n              {\n                \"name\": \"expression\",\n                \"type\": \"string\",\n                \"description\": \"An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.\"\n              },\n              {\n                \"name\": \"rootTitle\",\n                \"type\": \"string\",\n                \"optional\": true,\n                \"description\": \"An optional title for the root of the expression tree.\"\n              }\n            ]\n          },\n          {\n            \"name\": \"setObject\",\n            \"type\": \"function\",\n            \"description\": \"Sets a JSON-compliant object to be displayed in the sidebar pane.\",\n            \"parameters\": [\n              {\n                \"name\": \"jsonObject\",\n                \"type\": \"string\",\n                \"description\": \"An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).\"\n              },\n              {\n                \"name\": \"rootTitle\",\n                \"type\": \"string\",\n                \"optional\": true,\n                \"description\": \"An optional title for the root of the expression tree.\"\n              }\n            ]\n          }\n        ]\n      }\n    ],\n    \"properties\": {\n      \"scripts\": {\n        \"$ref\": \"ScriptsPanel\",\n        \"description\": \"Scripts panel\"\n      }\n    },\n    \"functions\": [\n      {\n        \"name\": \"create\",\n        \"type\": \"function\",\n        \"description\": \"Creates an extension panel.\",\n        \"parameters\": [\n          {\n            \"name\": \"title\",\n            \"type\": \"string\",\n            \"description\": \"Title that is displayed under the extension icon in the toolbar.\"\n          },\n          {\n            \"name\": \"iconURL\",\n            \"type\": \"string\",\n            \"description\": \"An URL of the toolbar icon.\"\n          },\n          {\n            \"name\": \"pageURL\",\n            \"type\": \"string\",\n            \"description\": \"An URL of the page that represents this panel.\"\n          }\n        ],\n        \"returns\" : {\n          \"$ref\": \"ExtensionPanel\",\n          \"description\": \"A panel that was created.\"\n        }\n      }\n    ]\n  },\n  {\n    \"namespace\": \"experimental.webInspector.resources\",\n    \"types\": [\n      {\n        \"id\": \"Resource\",\n        \"type\": \"object\",\n        \"description\": \"Represents a resource (document, script, image etc). See HAR Specification for reference.\",\n        \"functions\": [\n          {\n            \"name\": \"getContent\",\n            \"type\": \"function\",\n            \"description\": \"Returns resource content.\",\n            \"parameters\": [\n              {\n                \"name\": \"callback\",\n                \"type\": \"function\",\n                \"description\": \"A function that is called upon request completion.\",\n                \"parameters\": [\n                  {\n                    \"name\": \"content\",\n                    \"type\": \"string\",\n                    \"description\": \"Resource content (potentially encoded).\"\n                  },\n                  {\n                    \"name\": \"encoding\",\n                    \"type\": \"string\",\n                    \"description\": \"Empty if content is not encoded, encoding name otherwise. Currently, only base64 supported.\"\n                  }\n                ]\n              }\n            ]\n          }\n        ]\n      }\n    ],\n    \"functions\": [\n      {\n        \"name\": \"getHAR\",\n        \"type\": \"function\",\n        \"description\": \"Returns HAR archive that contains all known resource objects.\",\n        \"parameters\": [\n          {\n            \"name\": \"callback\",\n            \"type\": \"function\",\n            \"description\": \"A function that is called upon request completion.\",\n            \"parameters\": [\n              {\n                \"name\": \"har\",\n                \"type\": \"object\",\n                \"description\": \"A HAR archieve. See HAR specification for details.\"\n              }\n            ]\n          }\n        ]\n      }\n    ],\n    \"events\": [\n      {\n        \"name\": \"onFinished\",\n        \"type\": \"function\",\n        \"description\": \"Fired when a resource request is finished and all resource data are available.\",\n        \"parameters\": [\n          { \"name\": \"resource\", \"$ref\": \"Resource\" }\n        ]\n      }\n    ]\n  },\n  {\n    \"namespace\": \"experimental.webInspector.audits\",\n    \"functions\": [\n      {\n        \"name\": \"addCategory\",\n        \"type\": \"function\",\n        \"description\": \"Adds an audit category.\",\n        \"parameters\": [\n          { \"name\": \"displayName\", \"type\": \"string\", \"description\": \"A display name for the category\" },\n          { \"name\": \"resultCount\", \"type\": \"number\", \"description\": \"The expected number of audit results in the category.\" }\n        ],\n        \"returns\": {\n          \"$ref\": \"AuditCategory\"\n        }\n      }\n    ],\n    \"types\": [\n      {\n        \"id\": \"AuditCategory\",\n        \"type\": \"object\",\n        \"description\": \"A set of audit rules\",\n        \"events\": [\n          {\n            \"name\": \"onAuditStarted\",\n            \"type\": \"function\",\n            \"description\": \"Fired when the audit is started, if the category is enabled -- the extension is expected to begin executing audit rules.\",\n            \"parameters\": [\n              { \"name\": \"results\", \"$ref\": \"AuditResults\" }\n            ]\n          }\n        ]\n      },\n      {\n        \"id\": \"FormattedValue\",\n        \"type\": \"object\",\n        \"description\": \"A value returned from one of the formatters (an URL, code snippet etc), to be passed to createResult or addChild\"\n      },\n      {\n        \"id\": \"AuditResults\",\n        \"type\": \"object\",\n        \"description\": \"A collection of audit results for current run of the audit category\",\n        \"functions\": [\n          {\n            \"name\": \"addResult\",\n            \"type\": \"function\",\n            \"parameters\": [\n              {\n                \"name\": \"displayName\",\n                \"type\": \"string\",\n                \"description\": \"A concise, high-level description of audit rule result\"\n              },\n              {\n                \"name\": \"description\",\n                \"type\": \"string\",\n                \"description\": \"A detailed description of what the displayName means\"\n              },\n              {\n                \"name\": \"severity\",\n                \"$ref\": \"AuditResultSeverety\"\n              },\n              {\n                \"name\": \"details\",\n                \"$ref\": \"AuditResultNode\",\n                \"optional\": true,\n                \"description\": \"A subtree that appears under added result that may provide additional details on the violations found\"\n              }\n            ]\n          },\n          {\n            \"name\": \"createResult\",\n            \"type\": \"function\",\n            \"description\": \"Creates a result node that may be user as details parameters to addResult\",\n            \"parameters\": [\n              {\n                \"name\": \"content ...\",\n                \"choices\": [\n                  { \"type\": \"string\" },\n                  { \"$ref\": \"FormattedValue\" }\n                ],\n                \"description\": \"Either string or formatted values returned by one of AuditResult formatters (url, snippet etc)\"\n              }\n            ],\n            \"returns\": {\n              \"$ref\": \"AuditResultNode\"\n            }\n          },\n          {\n            \"name\": \"done\",\n            \"type\": \"function\",\n            \"description\": \"Signals the WebInspector Audits panel that the run of this category is over. Normally the run completes automatically when a number of added top-level results is equal to that declared when AuditCategory was created.\"\n          },\n          {\n            \"name\": \"url\",\n            \"type\": \"function\",\n            \"description\": \"Render passed value as an URL in the Audits panel\",\n            \"parameters\": [\n              { \"name\": \"href\", \"type\": \"string\", \"description\": \"An URL that will appear as href value on resulting link\" },\n              { \"name\": \"displayText\", \"type\": \"string\", \"description\": \"A text that will appear to user\", \"optional\": true }\n            ],\n            \"returns\": { \"$ref\": \"FormattedValue\" }\n          },\n          {\n            \"name\": \"snippet\",\n            \"type\": \"function\",\n            \"description\": \"Render passed text as a code snippet in the Audits panel\",\n            \"parameters\": [\n              { \"name\": \"text\", \"type\": \"string\", \"description\": \"Snippet text\" }\n            ],\n            \"returns\": { \"$ref\": \"FormattedValue\" }\n          }\n        ],\n        \"properties\": {\n          \"Severity\": {\n            \"$ref\": \"AuditResultSeverity\",\n            \"description\": \"A class that contains possible values for audit result severities.\"\n          },\n          \"text\": {\n            \"type\": \"string\",\n            \"description\": \"The contents of the node.\"\n          },\n          \"children\": {\n            \"optional\": true,\n            \"type\": \"array\",\n            \"items\": { \"$ref\": \"AuditResultNode\" },\n            \"description\": \"Children of this node.\"\n          },\n          \"expanded\": {\n            \"optional\": \"true\",\n            \"type\": \"boolean\",\n            \"description\": \"Whether the node is expanded by default.\"\n          }\n        }\n      },\n      {\n        \"id\": \"AuditResultNode\",\n        \"type\": \"object\",\n        \"description\": \"A node in the audit result trees. Displays some content and optionally has children node\",\n        \"functions\": [\n          {\n            \"name\": \"addChild\",\n            \"description\": \"Adds another child node to this node\",\n            \"parameters\": [\n              {\n                \"name\": \"content ...\",\n                \"choices\": [\n                  { \"type\": \"string\" },\n                  { \"$ref\": \"FormattedValue\" }\n                ],\n                \"description\": \"Either string or formatted values returned by one of AuditResult formatters (url, snippet etc)\"\n              }\n            ],\n            \"returns\": {\n              \"$ref\": \"AuditResultNode\"\n            }\n          }\n        ],\n        \"properties\": {\n          \"expanded\": {\n            \"type\": \"boolean\",\n            \"description\": \"If set, the subtree will always be expanded\"\n          }\n        }\n      },\n      {\n        \"id\": \"AuditResultSeverity\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"Info\": {\n            \"type\": \"string\"\n          },\n          \"Warning\": {\n            \"type\": \"string\"\n          },\n          \"Severe\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    ]\n  }\n]\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ExtensionAuditCategory.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ExtensionAuditCategory = function(id, displayName, ruleCount)\n{\n    this._id = id;\n    this._displayName = displayName;\n    this._ruleCount  = ruleCount;\n}\n\nWebInspector.ExtensionAuditCategory.prototype = {\n    // AuditCategory interface\n    get id()\n    {\n        return this._id;\n    },\n\n    get displayName()\n    {\n        return this._displayName;\n    },\n\n    get ruleCount()\n    {\n        return this._ruleCount;\n    },\n\n    run: function(resources, callback)\n    {\n        new WebInspector.ExtensionAuditCategoryResults(this, callback);\n    }\n}\n\nWebInspector.ExtensionAuditCategoryResults = function(category, callback)\n{\n    this._category = category;\n    this._pendingRules = category.ruleCount;\n    this._ruleCompletionCallback = callback;\n\n    this.id = category.id + \"-\" + ++WebInspector.ExtensionAuditCategoryResults._lastId;\n    WebInspector.extensionServer.startAuditRun(category, this);\n}\n\nWebInspector.ExtensionAuditCategoryResults.prototype = {\n    get complete()\n    {\n        return !this._pendingRules;\n    },\n\n    cancel: function()\n    {\n        while (!this.complete)\n            this._addResult(null);\n    },\n\n    addResult: function(displayName, description, severity, details)\n    {\n        var result = new WebInspector.AuditRuleResult(displayName);\n        result.addChild(description);\n        result.severity = severity;\n        if (details)\n            this._addNode(result, details);\n        this._addResult(result);\n    },\n\n    _addNode: function(parent, node)\n    {\n        var addedNode = parent.addChild(node.contents, node.expanded);\n        if (node.children) {\n            for (var i = 0; i < node.children.length; ++i)\n                this._addNode(addedNode, node.children[i]);\n        }\n    },\n\n    _addResult: function(result)\n    {\n        this._ruleCompletionCallback(result);\n        this._pendingRules--;\n        if (!this._pendingRules)\n            WebInspector.extensionServer.stopAuditRun(this);\n    }\n}\n\nWebInspector.ExtensionAuditCategoryResults._lastId = 0;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ExtensionCommon.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.commonExtensionSymbols = function(apiPrivate)\n{\n    \n    if (!apiPrivate.audits)\n        apiPrivate.audits = {};\n\n    apiPrivate.audits.Severity = {\n        Info: \"info\",\n        Warning: \"warning\",\n        Severe: \"severe\"\n    };\n}\n\nWebInspector.extensionAPI = {};\n\nWebInspector.commonExtensionSymbols(WebInspector.extensionAPI);\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ExtensionPanel.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ExtensionPanel = function(id, label, iconURL, options)\n{\n    this.toolbarItemLabel = label;\n    this._addStyleRule(\".toolbar-item.\" + id + \" .toolbar-icon\", \"background-image: url(\" + iconURL + \");\");\n    WebInspector.Panel.call(this, id);\n}\n\nWebInspector.ExtensionPanel.prototype = {\n    get defaultFocusedElement()\n    {\n        return this.sidebarTreeElement || this.element;\n    },\n\n    updateMainViewWidth: function(width)\n    {\n        this.bodyElement.style.left = width + \"px\";\n        this.resize();\n    },\n\n    searchCanceled: function(startingNewSearch)\n    {\n        WebInspector.extensionServer.notifySearchAction(this._id, \"cancelSearch\");\n        WebInspector.Panel.prototype.searchCanceled.apply(this, arguments);\n    },\n\n    performSearch: function(query)\n    {\n        WebInspector.extensionServer.notifySearchAction(this._id, \"performSearch\", query);\n        WebInspector.Panel.prototype.performSearch.apply(this, arguments);\n    },\n\n    jumpToNextSearchResult: function()\n    {\n        WebInspector.extensionServer.notifySearchAction(this._id, \"nextSearchResult\");\n        WebInspector.Panel.prototype.jumpToNextSearchResult.call(this);\n    },\n\n    jumpToPreviousSearchResult: function()\n    {\n        WebInspector.extensionServer.notifySearchAction(this._id, \"previousSearchResult\");\n        WebInspector.Panel.prototype.jumpToPreviousSearchResult.call(this);\n    },\n\n    _addStyleRule: function(selector, body)\n    {\n        var style = document.createElement(\"style\");\n        style.textContent = selector + \" { \" + body + \" }\";\n        document.head.appendChild(style);\n    }\n}\n\nWebInspector.ExtensionPanel.prototype.__proto__ = WebInspector.Panel.prototype;\n\nWebInspector.ExtensionWatchSidebarPane = function(title, id)\n{\n    WebInspector.SidebarPane.call(this, title);\n    this._id = id;\n}\n\nWebInspector.ExtensionWatchSidebarPane.prototype = {\n    setObject: function(object, title)\n    {\n        this._setObject(WebInspector.RemoteObject.fromLocalObject(object), title);\n    },\n\n    setExpression: function(expression, title)\n    {\n        InspectorBackend.evaluate(expression, \"extension-watch\", false, this._onEvaluate.bind(this, title));\n    },\n\n    _onEvaluate: function(title, result)\n    {\n        this._setObject(WebInspector.RemoteObject.fromPayload(result), title);\n    },\n\n    _setObject: function(object, title)\n    {\n        this.bodyElement.removeChildren();\n        var section = new WebInspector.ObjectPropertiesSection(object, title, null, true);\n        if (!title)\n            section.headerElement.addStyleClass(\"hidden\");\n        section.expanded = true;\n        this.bodyElement.appendChild(section.element);\n        WebInspector.extensionServer.notifyExtensionWatchSidebarUpdated(this._id);\n    }\n}\n\nWebInspector.ExtensionWatchSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ExtensionRegistryStub.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n(function() {\n    var ExtensionRegistryImpl = modjewel.require(\"weinre/client/ExtensionRegistryImpl\")\n    window.InspectorExtensionRegistry = new ExtensionRegistryImpl()\n})()\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ExtensionServer.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ExtensionServer = function()\n{\n    this._clientObjects = {};\n    this._handlers = {};\n    this._subscribers = {};\n    this._extraHeaders = {};\n    this._status = new WebInspector.ExtensionStatus();\n\n    this._registerHandler(\"addRequestHeaders\", this._onAddRequestHeaders.bind(this));\n    this._registerHandler(\"addAuditCategory\", this._onAddAuditCategory.bind(this));\n    this._registerHandler(\"addAuditResult\", this._onAddAuditResult.bind(this));\n    this._registerHandler(\"createPanel\", this._onCreatePanel.bind(this));\n    this._registerHandler(\"createSidebarPane\", this._onCreateSidebar.bind(this));\n    this._registerHandler(\"createWatchExpressionSidebarPane\", this._onCreateWatchExpressionSidebarPane.bind(this));\n    this._registerHandler(\"evaluateOnInspectedPage\", this._onEvaluateOnInspectedPage.bind(this));\n    this._registerHandler(\"getHAR\", this._onGetHAR.bind(this));\n    this._registerHandler(\"getResourceContent\", this._onGetResourceContent.bind(this));\n    this._registerHandler(\"log\", this._onLog.bind(this));\n    this._registerHandler(\"reload\", this._onReload.bind(this));\n    this._registerHandler(\"setSidebarHeight\", this._onSetSidebarHeight.bind(this));\n    this._registerHandler(\"setWatchSidebarContent\", this._onSetWatchSidebarContent.bind(this));\n    this._registerHandler(\"stopAuditCategoryRun\", this._onStopAuditCategoryRun.bind(this));\n    this._registerHandler(\"subscribe\", this._onSubscribe.bind(this));\n    this._registerHandler(\"unsubscribe\", this._onUnsubscribe.bind(this));\n\n    window.addEventListener(\"message\", this._onWindowMessage.bind(this), false);\n}\n\nWebInspector.ExtensionServer.prototype = {\n    notifyPanelShown: function(panelName)\n    {\n        this._postNotification(\"panel-shown-\" + panelName);\n    },\n\n    notifyObjectSelected: function(panelId, objectId)\n    {\n        this._postNotification(\"panel-objectSelected-\" + panelId, objectId);\n    },\n\n    notifySearchAction: function(panelId, action, searchString)\n    {\n        this._postNotification(\"panel-search-\" + panelId, action, searchString);\n    },\n\n    notifyPageLoaded: function(milliseconds)\n    {\n        this._postNotification(\"inspectedPageLoaded\", milliseconds);\n    },\n\n    notifyPageDOMContentLoaded: function(milliseconds)\n    {\n        this._postNotification(\"inspectedPageDOMContentLoaded\", milliseconds);\n    },\n\n    notifyInspectedURLChanged: function()\n    {\n        this._postNotification(\"inspectedURLChanged\");\n    },\n\n    notifyInspectorReset: function()\n    {\n        this._postNotification(\"reset\");\n    },\n\n    notifyExtensionWatchSidebarUpdated: function(id)\n    {\n        this._postNotification(\"watch-sidebar-updated-\" + id);\n    },\n\n    startAuditRun: function(category, auditRun)\n    {\n        this._clientObjects[auditRun.id] = auditRun;\n        this._postNotification(\"audit-started-\" + category.id, auditRun.id);\n    },\n\n    stopAuditRun: function(auditRun)\n    {\n        delete this._clientObjects[auditRun.id];\n    },\n\n    _notifyResourceFinished: function(event)\n    {\n        var resource = event.data;\n        this._postNotification(\"resource-finished\", resource.identifier, (new WebInspector.HAREntry(resource)).build());\n    },\n\n    _postNotification: function(type, details)\n    {\n        var subscribers = this._subscribers[type];\n        if (!subscribers)\n            return;\n        var message = {\n            command: \"notify-\" + type,\n            arguments: Array.prototype.slice.call(arguments, 1)\n        };\n        for (var i = 0; i < subscribers.length; ++i)\n            subscribers[i].postMessage(message);\n    },\n\n    _onSubscribe: function(message, port)\n    {\n        var subscribers = this._subscribers[message.type];\n        if (subscribers)\n            subscribers.push(port);\n        else\n            this._subscribers[message.type] = [ port ];\n    },\n\n    _onUnsubscribe: function(message, port)\n    {\n        var subscribers = this._subscribers[message.type];\n        if (!subscribers)\n            return;\n        subscribers.remove(port);\n        if (!subscribers.length)\n            delete this._subscribers[message.type];\n    },\n\n    _onAddRequestHeaders: function(message)\n    {\n        var id = message.extensionId;\n        if (typeof id !== \"string\")\n            return this._status.E_BADARGTYPE(\"extensionId\", typeof id, \"string\");\n        var extensionHeaders = this._extraHeaders[id];\n        if (!extensionHeaders) {\n            extensionHeaders = {};\n            this._extraHeaders[id] = extensionHeaders;\n        }\n        for (name in message.headers)\n            extensionHeaders[name] = message.headers[name];\n        var allHeaders = {};\n        for (extension in this._extraHeaders) {\n            var headers = this._extraHeaders[extension];\n            for (name in headers) {\n                if (typeof headers[name] === \"string\")\n                    allHeaders[name] = headers[name];\n            }\n        }\n        InspectorBackend.setExtraHeaders(allHeaders);\n    },\n\n    _onCreatePanel: function(message, port)\n    {\n        var id = message.id;\n        // The ids are generated on the client API side and must be unique, so the check below\n        // shouldn't be hit unless someone is bypassing the API.\n        if (id in this._clientObjects || id in WebInspector.panels)\n            return this._status.E_EXISTS(id);\n        var panel = new WebInspector.ExtensionPanel(id, message.title, message.icon);\n        this._clientObjects[id] = panel;\n\n        var toolbarElement = document.getElementById(\"toolbar\");\n        var lastToolbarItem = WebInspector.panelOrder[WebInspector.panelOrder.length - 1].toolbarItem;\n        WebInspector.addPanelToolbarIcon(toolbarElement, panel, lastToolbarItem);\n        WebInspector.panels[id] = panel;\n        var iframe = this._createClientIframe(panel.element, message.url);\n        iframe.style.height = \"100%\";\n        return this._status.OK();\n    },\n\n    _onCreateSidebar: function(message)\n    {\n        var sidebar = this._createSidebar(message, WebInspector.SidebarPane);\n        if (sidebar.isError)\n            return sidebar;\n        this._createClientIframe(sidebar.bodyElement, message.url);\n        return this._status.OK();\n    },\n\n    _onCreateWatchExpressionSidebarPane: function(message)\n    {\n        var sidebar = this._createSidebar(message, WebInspector.ExtensionWatchSidebarPane);\n        return sidebar.isError ? sidebar : this._status.OK();\n    },\n\n    _createSidebar: function(message, constructor)\n    {\n        var panel = WebInspector.panels[message.panel];\n        if (!panel)\n            return this._status.E_NOTFOUND(message.panel);\n        if (!panel.sidebarElement || !panel.sidebarPanes)\n            return this._status.E_NOTSUPPORTED();\n        var id = message.id;\n        var sidebar = new constructor(message.title, message.id);\n        this._clientObjects[id] = sidebar;\n        panel.sidebarPanes[id] = sidebar;\n        panel.sidebarElement.appendChild(sidebar.element);\n\n        return sidebar;\n    },\n\n    _createClientIframe: function(parent, url, requestId, port)\n    {\n        var iframe = document.createElement(\"iframe\");\n        iframe.src = url;\n        iframe.style.width = \"100%\";\n        parent.appendChild(iframe);\n        return iframe;\n    },\n\n    _onSetSidebarHeight: function(message)\n    {\n        var sidebar = this._clientObjects[message.id];\n        if (!sidebar)\n            return this._status.E_NOTFOUND(message.id);\n        sidebar.bodyElement.firstChild.style.height = message.height;\n    },\n\n    _onSetWatchSidebarContent: function(message)\n    {\n        var sidebar = this._clientObjects[message.id];\n        if (!sidebar)\n            return this._status.E_NOTFOUND(message.id);\n        if (message.evaluateOnPage)\n            sidebar.setExpression(message.expression, message.rootTitle);\n        else\n            sidebar.setObject(message.expression, message.rootTitle);\n    },\n\n    _onLog: function(message)\n    {\n        WebInspector.log(message.message);\n    },\n\n    _onReload: function(message)\n    {\n        if (typeof message.userAgent === \"string\")\n            InspectorBackend.setUserAgentOverride(message.userAgent);\n\n        InspectorBackend.reloadPage(false);\n        return this._status.OK();\n    },\n\n    _onEvaluateOnInspectedPage: function(message, port)\n    {\n        function callback(resultPayload)\n        {\n            var resultObject = WebInspector.RemoteObject.fromPayload(resultPayload);\n            var result = {};\n            if (resultObject.isError())\n                result.isException = true;\n            result.value = resultObject.description;\n            this._dispatchCallback(message.requestId, port, result);\n        }\n        var evalExpression = \"JSON.stringify(eval(unescape('\" + escape(message.expression) + \"')));\";\n        InspectorBackend.evaluate(evalExpression, \"none\", true, callback.bind(this));\n    },\n\n    _onRevealAndSelect: function(message)\n    {\n        if (message.panelId === \"resources\" && type === \"resource\")\n            return this._onRevealAndSelectResource(message);\n        else\n            return this._status.E_NOTSUPPORTED(message.panelId, message.type);\n    },\n\n    _onRevealAndSelectResource: function(message)\n    {\n        var id = message.id;\n        var resource = null;\n\n        resource = WebInspector.networkResourceById(id) || WebInspector.resourceForURL(id);\n        if (!resource)\n            return this._status.E_NOTFOUND(typeof id + \": \" + id);\n\n        WebInspector.panels.resources.showResource(resource, message.line);\n        WebInspector.showPanel(\"resources\");\n    },\n\n    _dispatchCallback: function(requestId, port, result)\n    {\n        port.postMessage({ command: \"callback\", requestId: requestId, result: result });\n    },\n\n    _onGetHAR: function(request)\n    {\n        var harLog = new WebInspector.HARLog();\n        harLog.includeResourceIds = true;\n        return harLog.build();\n    },\n\n    _onGetResourceContent: function(message, port)\n    {\n        function onContentAvailable(content, encoded)\n        {\n            var response = {\n                encoding: encoded ? \"base64\" : \"\",\n                content: content\n            };\n            this._dispatchCallback(message.requestId, port, response);\n        }\n        var resource = WebInspector.networkResourceById(message.id);\n        if (!resource)\n            return this._status.E_NOTFOUND(message.id);\n        resource.requestContent(onContentAvailable.bind(this));\n    },\n\n    _onAddAuditCategory: function(request)\n    {\n        var category = new WebInspector.ExtensionAuditCategory(request.id, request.displayName, request.resultCount);\n        if (WebInspector.panels.audits.getCategory(category.id))\n            return this._status.E_EXISTS(category.id);\n        this._clientObjects[request.id] = category;\n        WebInspector.panels.audits.addCategory(category);\n    },\n\n    _onAddAuditResult: function(request)\n    {\n        var auditResult = this._clientObjects[request.resultId];\n        if (!auditResult)\n            return this._status.E_NOTFOUND(request.resultId);\n        try {\n            auditResult.addResult(request.displayName, request.description, request.severity, request.details);\n        } catch (e) {\n            return e;\n        }\n        return this._status.OK();\n    },\n\n    _onStopAuditCategoryRun: function(request)\n    {\n        var auditRun = this._clientObjects[request.resultId];\n        if (!auditRun)\n            return this._status.E_NOTFOUND(request.resultId);\n        auditRun.cancel();\n    },\n\n    initExtensions: function()\n    {\n        // The networkManager is normally created after the ExtensionServer is constructed, but before initExtensions() is called.\n        WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._notifyResourceFinished, this);\n\n        InspectorExtensionRegistry.getExtensionsAsync();\n    },\n\n    _addExtensions: function(extensions)\n    {\n        // See ExtensionAPI.js and ExtensionCommon.js for details.\n        InspectorFrontendHost.setExtensionAPI(this._buildExtensionAPIInjectedScript());\n        for (var i = 0; i < extensions.length; ++i) {\n            var extension = extensions[i];\n            try {\n                if (!extension.startPage)\n                    return;\n                var iframe = document.createElement(\"iframe\");\n                iframe.src = extension.startPage;\n                iframe.style.display = \"none\";\n                document.body.appendChild(iframe);\n            } catch (e) {\n                console.error(\"Failed to initialize extension \" + extension.startPage + \":\" + e);\n            }\n        }\n    },\n\n    _buildExtensionAPIInjectedScript: function()\n    {\n        var resourceTypes = {};\n        var resourceTypeProperties = Object.getOwnPropertyNames(WebInspector.Resource.Type);\n        for (var i = 0; i < resourceTypeProperties.length; ++i) {\n             var propName = resourceTypeProperties[i];\n             var propValue = WebInspector.Resource.Type[propName];\n             if (typeof propValue === \"number\")\n                 resourceTypes[propName] = WebInspector.Resource.Type.toString(propValue);\n        }\n        var platformAPI = WebInspector.buildPlatformExtensionAPI ? WebInspector.buildPlatformExtensionAPI() : \"\";\n        return \"(function(){ \" +\n            \"var apiPrivate = {};\" +\n            \"(\" + WebInspector.commonExtensionSymbols.toString() + \")(apiPrivate);\" +\n            \"(\" + WebInspector.injectedExtensionAPI.toString() + \").apply(this, arguments);\" +\n            platformAPI +\n            \"})\";\n    },\n\n    _onWindowMessage: function(event)\n    {\n        if (event.data !== \"registerExtension\")\n            return;\n        var port = event.ports[0];\n        port.addEventListener(\"message\", this._onmessage.bind(this), false);\n        port.start();\n    },\n\n    _onmessage: function(event)\n    {\n        var request = event.data;\n        var result;\n\n        if (request.command in this._handlers)\n            result = this._handlers[request.command](request, event.target);\n        else\n            result = this._status.E_NOTSUPPORTED(request.command);\n\n        if (result && request.requestId)\n            this._dispatchCallback(request.requestId, event.target, result);\n    },\n\n    _registerHandler: function(command, callback)\n    {\n        this._handlers[command] = callback;\n    }\n}\n\nWebInspector.ExtensionServer._statuses =\n{\n    OK: \"\",\n    E_EXISTS: \"Object already exists: %s\",\n    E_BADARG: \"Invalid argument %s: %s\",\n    E_BADARGTYPE: \"Invalid type for argument %s: got %s, expected %s\",\n    E_NOTFOUND: \"Object not found: %s\",\n    E_NOTSUPPORTED: \"Object does not support requested operation: %s\",\n}\n\nWebInspector.ExtensionStatus = function()\n{\n    function makeStatus(code)\n    {\n        var description = WebInspector.ExtensionServer._statuses[code] || code;\n        var details = Array.prototype.slice.call(arguments, 1);\n        var status = { code: code, description: description, details: details };\n        if (code !== \"OK\") {\n            status.isError = true;\n            console.log(\"Extension server error: \" + String.vsprintf(description, details));\n        }\n        return status;\n    }\n    for (status in WebInspector.ExtensionServer._statuses)\n        this[status] = makeStatus.bind(null, status);\n}\n\nWebInspector.addExtensions = function(extensions)\n{\n    WebInspector.extensionServer._addExtensions(extensions);\n}\n\nWebInspector.extensionServer = new WebInspector.ExtensionServer();\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/FontView.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.FontView = function(resource)\n{\n    WebInspector.ResourceView.call(this, resource);\n\n    this.element.addStyleClass(\"font\");\n}\n\nWebInspector.FontView.prototype = {\n    hasContent: function()\n    {\n        return true;\n    },\n\n    _createContentIfNeeded: function()\n    {\n        if (this.fontPreviewElement)\n            return;\n\n        var uniqueFontName = \"WebInspectorFontPreview\" + this.resource.identifier;\n\n        this.fontStyleElement = document.createElement(\"style\");\n        this.fontStyleElement.textContent = \"@font-face { font-family: \\\"\" + uniqueFontName + \"\\\"; src: url(\" + this.resource.url + \"); }\";\n        document.head.appendChild(this.fontStyleElement);\n\n        this.fontPreviewElement = document.createElement(\"div\");\n        this.element.appendChild(this.fontPreviewElement);\n\n        this.fontPreviewElement.style.setProperty(\"font-family\", uniqueFontName, null);\n        this.fontPreviewElement.innerHTML = \"ABCDEFGHIJKLM<br>NOPQRSTUVWXYZ<br>abcdefghijklm<br>nopqrstuvwxyz<br>1234567890\";\n        this._lineCount = this.fontPreviewElement.getElementsByTagName(\"br\").length + 1;\n\n        this.updateFontPreviewSize();\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.ResourceView.prototype.show.call(this, parentElement);\n        this._createContentIfNeeded();\n        this.updateFontPreviewSize();\n    },\n\n    resize: function()\n    {\n        this.updateFontPreviewSize();\n        WebInspector.ResourceView.prototype.resize.call(this);\n    },\n\n    updateFontPreviewSize: function()\n    {\n        if (!this.fontPreviewElement || !this.visible)\n            return;\n\n        var measureFontSize = 50;\n        this.fontPreviewElement.style.setProperty(\"font-size\", measureFontSize + \"px\", null);\n        this.fontPreviewElement.style.setProperty(\"position\", \"absolute\", null);\n        this.fontPreviewElement.style.removeProperty(\"height\");\n\n        var height = this.fontPreviewElement.offsetHeight;\n        var width = this.fontPreviewElement.offsetWidth;\n\n        // Subtract some padding. This should match the padding in the CSS plus room for the scrollbar.\n        var containerWidth = this.element.offsetWidth - 50;\n\n        if (!height || !width || !containerWidth) {\n            this.fontPreviewElement.style.removeProperty(\"font-size\");\n            this.fontPreviewElement.style.removeProperty(\"position\");\n            return;\n        }\n\n        var realLineHeight = Math.floor(height / this._lineCount);\n        var fontSizeLineRatio = measureFontSize / realLineHeight;\n        var widthRatio = containerWidth / width;\n        var finalFontSize = Math.floor(realLineHeight * widthRatio * fontSizeLineRatio) - 2;\n\n        this.fontPreviewElement.style.setProperty(\"font-size\", finalFontSize + \"px\", null);\n        this.fontPreviewElement.style.setProperty(\"height\", this.fontPreviewElement.offsetHeight + \"px\", null);\n        this.fontPreviewElement.style.removeProperty(\"position\");\n    }\n}\n\nWebInspector.FontView.prototype.__proto__ = WebInspector.ResourceView.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/GoToLineDialog.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.GoToLineDialog = function(view)\n{\n    this._element = document.createElement(\"div\");\n    this._element.className = \"go-to-line-dialog\";\n    this._element.addEventListener(\"keydown\", this._onKeyDown.bind(this), false);\n    this._closeKeys = [\n        WebInspector.KeyboardShortcut.Keys.Enter.code,\n        WebInspector.KeyboardShortcut.Keys.Esc.code,\n    ];\n\n    var dialogWindow = this._element;\n\n    dialogWindow.createChild(\"label\").innerText = WebInspector.UIString(\"Go to line: \");\n\n    this._input = dialogWindow.createChild(\"input\");\n    this._input.setAttribute(\"type\", \"text\");\n    this._input.setAttribute(\"size\", 6);\n    var linesCount = view.textModel.linesCount;\n    if (linesCount)\n        this._input.setAttribute(\"title\", WebInspector.UIString(\"1 - %d\", linesCount));\n    var blurHandler = this._onBlur.bind(this);\n    this._input.addEventListener(\"blur\", blurHandler, false);\n    \n\n    var go = dialogWindow.createChild(\"button\");\n    go.innerText = WebInspector.UIString(\"Go\");\n    go.addEventListener(\"click\", this._onClick.bind(this), false);\n    go.addEventListener(\"mousedown\", function(e) {\n        // Ok button click will close the dialog, removing onBlur listener\n        // to let click event be handled.\n        this._input.removeEventListener(\"blur\", blurHandler, false);\n    }.bind(this), false);\n\n    this._view = view;\n    view.element.appendChild(this._element);\n\n    this._previousFocusElement = WebInspector.currentFocusElement;\n    WebInspector.currentFocusElement = this._input;\n    this._input.select();\n}\n\nWebInspector.GoToLineDialog.show = function(sourceView)\n{\n    if (this._instance)\n        return;\n    this._instance = new WebInspector.GoToLineDialog(sourceView);\n}\n\nWebInspector.GoToLineDialog.prototype = {\n    _hide: function()\n    {\n        if (this._isHiding)\n            return;\n        this._isHiding = true;\n\n        WebInspector.currentFocusElement = this._previousFocusElement;\n        WebInspector.GoToLineDialog._instance = null;\n        this._element.parentElement.removeChild(this._element);\n    },\n\n    _onBlur: function(event)\n    {\n        this._hide();\n    },\n\n    _onKeyDown: function(event)\n    {\n        if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Tab.code) {\n            event.preventDefault();\n            return;\n        }\n\n        if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code)\n            this._highlightSelectedLine();\n\n        if (this._closeKeys.indexOf(event.keyCode) >= 0) {\n            this._hide();\n            event.stopPropagation();\n        }\n    },\n\n    _onClick: function(event)\n    {\n        this._highlightSelectedLine();\n        this._hide();\n    },\n\n    _highlightSelectedLine: function()\n    {\n        var value = this._input.value;\n        var lineNumber = parseInt(value, 10);\n        if (!isNaN(lineNumber) && lineNumber > 0) {\n            lineNumber = Math.min(lineNumber, this._view.textModel.linesCount);\n            this._view.highlightLine(lineNumber);\n        }\n    }\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/HAREntry.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// See http://groups.google.com/group/http-archive-specification/web/har-1-2-spec\n// for HAR specification.\n\nWebInspector.HAREntry = function(resource)\n{\n    this._resource = resource;\n}\n\nWebInspector.HAREntry.prototype = {\n    build: function()\n    {\n        return {\n            pageref: this._resource.documentURL,\n            startedDateTime: new Date(this._resource.startTime * 1000),\n            time: WebInspector.HAREntry._toMilliseconds(this._resource.duration),\n            request: this._buildRequest(),\n            response: this._buildResponse(),\n            // cache: {...}, -- Not supproted yet.\n            timings: this._buildTimings()\n        };\n    },\n\n    _buildRequest: function()\n    {\n        var res = {\n            method: this._resource.requestMethod,\n            url: this._resource.url,\n            // httpVersion: \"HTTP/1.1\" -- Not available.\n            headers: this._buildHeaders(this._resource.requestHeaders),\n            headersSize: -1, // Not available.\n            bodySize: -1 // Not available.\n        };\n        if (this._resource.queryParameters)\n            res.queryString = this._buildParameters(this._resource.queryParameters);\n        if (this._resource.requestFormData)\n            res.postData = this._buildPostData();\n        if (this._resource.requestCookies)\n            res.cookies = this._buildCookies(this._resource.requestCookies);\n        return res;\n    },\n\n    _buildResponse: function()\n    {\n        var res = {\n            status: this._resource.statusCode,\n            statusText: this._resource.statusText,\n            // \"httpVersion\": \"HTTP/1.1\" -- Not available.\n            headers: this._buildHeaders(this._resource.responseHeaders),\n            content: this._buildContent(),\n            redirectURL: this._resource.responseHeaderValue(\"Location\") || \"\",\n            headersSize: -1, // Not available.\n            bodySize: this._resource.resourceSize\n        };\n        if (this._resource.responseCookies)\n            res.cookies = this._buildCookies(this._resource.responseCookies);\n        return res;\n    },\n\n    _buildContent: function()\n    {\n        return {\n            size: this._resource.resourceSize,\n            // compression: 0, -- Not available.\n            mimeType: this._resource.mimeType,\n            // text: -- Not available.\n        };\n    },\n\n    _buildTimings: function()\n    {\n        var waitForConnection = this._interval(\"connectStart\", \"connectEnd\");\n        var blocked;\n        var connect;\n        var dns = this._interval(\"dnsStart\", \"dnsEnd\");\n        var send = this._interval(\"sendStart\", \"sendEnd\");\n        var ssl = this._interval(\"sslStart\", \"sslEnd\");\n\n        if (ssl !== -1 && send !== -1)\n            send -= ssl;\n\n        if (this._resource.connectionReused) {\n            connect = -1;\n            blocked = waitForConnection;\n        } else {\n            blocked = 0;\n            connect = waitForConnection;\n            if (dns !== -1)\n                connect -= dns;\n        }\n\n        return {\n            blocked: blocked,\n            dns: dns,\n            connect: connect,\n            send: send,\n            wait: this._interval(\"sendEnd\", \"receiveHeadersEnd\"),\n            receive: WebInspector.HAREntry._toMilliseconds(this._resource.receiveDuration),\n            ssl: ssl\n        };\n    },\n\n    _buildHeaders: function(headers)\n    {\n        var result = [];\n        for (var name in headers)\n            result.push({ name: name, value: headers[name] });\n        return result;\n    },\n\n    _buildPostData: function()\n    {\n        var res = {\n            mimeType: this._resource.requestHeaderValue(\"Content-Type\"),\n            text: this._resource.requestFormData\n        };\n        if (this._resource.formParameters)\n           res.params = this._buildParameters(this._resource.formParameters);\n        return res;\n    },\n\n    _buildParameters: function(parameters)\n    {\n        return parameters.slice();\n    },\n\n    _buildCookies: function(cookies)\n    {\n        return cookies.map(this._buildCookie.bind(this));\n    },\n\n    _buildCookie: function(cookie)\n    {\n        \n        return {\n            name: cookie.name,\n            value: cookie.value,\n            path: cookie.path,\n            domain: cookie.domain,\n            expires: cookie.expires(new Date(this._resource.startTime * 1000)),\n            httpOnly: cookie.httpOnly,\n            secure: cookie.secure\n        };\n    },\n\n    _interval: function(start, end)\n    {\n        var timing = this._resource.timing;\n        if (!timing)\n            return -1;\n        var startTime = timing[start];\n        return typeof startTime !== \"number\" || startTime === -1 ? -1 : Math.round(timing[end] - startTime);\n    }\n}\n\nWebInspector.HAREntry._toMilliseconds = function(time)\n{\n    return time === -1 ? -1 : Math.round(time * 1000);\n}\n\nWebInspector.HARLog = function()\n{\n    this.includeResourceIds = false;\n}\n\nWebInspector.HARLog.prototype = {\n    build: function()\n    {\n        var webKitVersion = /AppleWebKit\\/([^ ]+)/.exec(window.navigator.userAgent);\n        \n        return {\n            version: \"1.2\",\n            creator: {\n                name: \"WebInspector\",\n                version: webKitVersion ? webKitVersion[1] : \"n/a\"\n            },\n            pages: this._buildPages(),\n            entries: WebInspector.networkResources.map(this._convertResource.bind(this))\n        }\n    },\n\n    _buildPages: function()\n    {\n        return [\n            {\n                startedDateTime: new Date(WebInspector.mainResource.startTime * 1000),\n                id: WebInspector.mainResource.documentURL,\n                title: \"\",\n                pageTimings: this.buildMainResourceTimings()\n            }\n        ];\n    },\n\n    buildMainResourceTimings: function()\n    {\n        return {\n             onContentLoad: this._pageEventTime(WebInspector.mainResourceDOMContentTime),\n             onLoad: this._pageEventTime(WebInspector.mainResourceLoadTime),\n        }\n    },\n\n    _convertResource: function(resource)\n    {\n        var entry = (new WebInspector.HAREntry(resource)).build();\n        if (this.includeResourceIds)\n            entry._resourceId = resource.identifier;\n        return entry;\n    },\n\n    _pageEventTime: function(time)\n    {\n        var startTime = WebInspector.mainResource.startTime;\n        if (time === -1 || startTime === -1)\n            return -1;\n        return WebInspector.HAREntry._toMilliseconds(time - startTime);\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/HeapSnapshot.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.HeapSnapshotArraySlice = function(snapshot, arrayName, start, end)\n{\n    // Note: we don't reference snapshot contents directly to avoid\n    // holding references to big chunks of data.\n    this._snapshot = snapshot;\n    this._arrayName = arrayName;\n    this._start = start;\n    this.length = end - start;\n}\n\nWebInspector.HeapSnapshotArraySlice.prototype = {\n    item: function(index)\n    {\n        return this._snapshot[this._arrayName][this._start + index];\n    }\n}\n\nWebInspector.HeapSnapshotEdge = function(snapshot, edges, edgeIndex)\n{\n    this._snapshot = snapshot;\n    this._edges = edges;\n    this.edgeIndex = edgeIndex || 0;\n}\n\nWebInspector.HeapSnapshotEdge.prototype = {\n    clone: function()\n    {\n        return new WebInspector.HeapSnapshotEdge(this._snapshot, this._edges, this.edgeIndex);\n    },\n\n    get hasStringName()\n    {\n        if (!this.isShortcut)\n            return this._hasStringName;\n        return isNaN(parseInt(this._name, 10));\n    },\n\n    get isElement()\n    {\n        return this._type() === this._snapshot._edgeElementType;\n    },\n\n    get isHidden()\n    {\n        return this._type() === this._snapshot._edgeHiddenType;\n    },\n\n    get isInternal()\n    {\n        return this._type() === this._snapshot._edgeInternalType;\n    },\n\n    get isShortcut()\n    {\n        return this._type() === this._snapshot._edgeShortcutType;\n    },\n\n    get name()\n    {\n        if (!this.isShortcut)\n            return this._name;\n        var numName = parseInt(this._name, 10);\n        return isNaN(numName) ? this._name : numName;\n    },\n\n    get node()\n    {\n        return new WebInspector.HeapSnapshotNode(this._snapshot, this.nodeIndex);\n    },\n\n    get nodeIndex()\n    {\n        return this._edges.item(this.edgeIndex + this._snapshot._edgeToNodeOffset);\n    },\n\n    get rawEdges()\n    {\n        return this._edges;\n    },\n\n    toString: function()\n    {\n        switch (this.type) {\n        case \"context\": return \"->\" + this.name;\n        case \"element\": return \"[\" + this.name + \"]\";\n        case \"property\":\n            return this.name.indexOf(\" \") === -1 ? \".\" + this.name : \"[\\\"\" + this.name + \"\\\"]\";\n        case \"shortcut\":\n            var name = this.name;\n            if (typeof name === \"string\")\n                return this.name.indexOf(\" \") === -1 ? \".\" + this.name : \"[\\\"\" + this.name + \"\\\"]\";\n            else\n                return \"[\" + this.name + \"]\";\n        case \"internal\":\n        case \"hidden\":\n            return \"{\" + this.name + \"}\";\n        };\n        return \"?\" + this.name + \"?\";\n    },\n\n    get type()\n    {\n        return this._snapshot._edgeTypes[this._type()];\n    },\n\n    get _hasStringName()\n    {\n        return !this.isElement && !this.isHidden;\n    },\n\n    get _name()\n    {\n        return this._hasStringName ? this._snapshot._strings[this._nameOrIndex] : this._nameOrIndex;\n    },\n\n    get _nameOrIndex()\n    {\n        return this._edges.item(this.edgeIndex + this._snapshot._edgeNameOffset);\n    },\n\n    _type: function()\n    {\n        return this._edges.item(this.edgeIndex + this._snapshot._edgeTypeOffset);\n    }\n};\n\nWebInspector.HeapSnapshotEdgeIterator = function(edge)\n{\n    this.edge = edge;\n}\n\nWebInspector.HeapSnapshotEdgeIterator.prototype = {\n    first: function()\n    {\n        this.edge.edgeIndex = 0;\n    },\n\n    hasNext: function()\n    {\n        return this.edge.edgeIndex < this.edge._edges.length;\n    },\n\n    get index()\n    {\n        return this.edge.edgeIndex;\n    },\n\n    set index(newIndex)\n    {\n        this.edge.edgeIndex = newIndex;\n    },\n\n    get item()\n    {\n        return this.edge;\n    },\n\n    next: function()\n    {\n        this.edge.edgeIndex += this.edge._snapshot._edgeFieldsCount;\n    }\n};\n\nWebInspector.HeapSnapshotNode = function(snapshot, nodeIndex)\n{\n    this._snapshot = snapshot;\n    this._firstNodeIndex = nodeIndex;\n    this.nodeIndex = nodeIndex;\n}\n\nWebInspector.HeapSnapshotNode.prototype = {\n    get className()\n    {\n        switch (this.type) {\n        case \"hidden\":\n            return WebInspector.UIString(\"(system)\");\n        case \"object\":\n            return this.name;\n        case \"code\":\n            return WebInspector.UIString(\"(compiled code)\");\n        default:\n            return \"(\" + this.type + \")\";\n        }\n    },\n\n    dominatorIndex: function()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._dominatorOffset];\n    },\n\n    get edges()\n    {\n        return new WebInspector.HeapSnapshotEdgeIterator(new WebInspector.HeapSnapshotEdge(this._snapshot, this.rawEdges));\n    },\n\n    get edgesCount()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._edgesCountOffset];\n    },\n\n    get id()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._nodeIdOffset];\n    },\n\n    get instancesCount()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._nodeInstancesCountOffset];\n    },\n\n    get isHidden()\n    {\n        return this._type() === this._snapshot._nodeHiddenType;\n    },\n\n    get isRoot()\n    {\n        return this.nodeIndex === this._snapshot._rootNodeIndex;\n    },\n\n    get name()\n    {\n        return this._snapshot._strings[this._name()];\n    },\n\n    get rawEdges()\n    {\n        var firstEdgeIndex = this._firstEdgeIndex();\n        return new WebInspector.HeapSnapshotArraySlice(this._snapshot, \"_nodes\", firstEdgeIndex, firstEdgeIndex + this.edgesCount * this._snapshot._edgeFieldsCount);\n    },\n\n    get retainedSize()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._nodeRetainedSizeOffset];\n    },\n\n    get retainers()\n    {\n        return new WebInspector.HeapSnapshotEdgeIterator(new WebInspector.HeapSnapshotEdge(this._snapshot, this._snapshot.retainers(this)));\n    },\n\n    get selfSize()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._nodeSelfSizeOffset];\n    },\n\n    get type()\n    {\n        return this._snapshot._nodeTypes[this._type()];\n    },\n\n    _name: function()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._nodeNameOffset];\n    },\n\n    get _nodes()\n    {\n        return this._snapshot._nodes;\n    },\n\n    _firstEdgeIndex: function()\n    {\n        return this.nodeIndex + this._snapshot._firstEdgeOffset;\n    },\n\n    get _nextNodeIndex()\n    {\n        return this._firstEdgeIndex() + this.edgesCount * this._snapshot._edgeFieldsCount;\n    },\n\n    _type: function()\n    {\n        return this._nodes[this.nodeIndex + this._snapshot._nodeTypeOffset];\n    }\n};\n\nWebInspector.HeapSnapshotNodeIterator = function(node)\n{\n    this.node = node;\n}\n\nWebInspector.HeapSnapshotNodeIterator.prototype = {\n    first: function()\n    {\n        this.node.nodeIndex = this.node._firstNodeIndex;\n    },\n\n    hasNext: function()\n    {\n        return this.node.nodeIndex < this.node._nodes.length;\n    },\n\n    get index()\n    {\n        return this.node.nodeIndex;\n    },\n\n    set index(newIndex)\n    {\n        this.node.nodeIndex = newIndex;\n    },\n\n    get item()\n    {\n        return this.node;\n    },\n\n    next: function()\n    {\n        this.node.nodeIndex = this.node._nextNodeIndex;\n    }\n}\n\nWebInspector.HeapSnapshot = function(profile)\n{\n    this._nodes = profile.nodes;\n    this._strings = profile.strings;\n\n    this._init();\n}\n\nWebInspector.HeapSnapshot.prototype = {\n    _init: function()\n    {\n        this._metaNodeIndex = 0;\n        this._rootNodeIndex = 1;\n        var meta = this._nodes[this._metaNodeIndex];\n        this._nodeTypeOffset = meta.fields.indexOf(\"type\");\n        this._nodeNameOffset = meta.fields.indexOf(\"name\");\n        this._nodeIdOffset = meta.fields.indexOf(\"id\");\n        this._nodeInstancesCountOffset = this._nodeIdOffset;\n        this._nodeSelfSizeOffset = meta.fields.indexOf(\"self_size\");\n        this._nodeRetainedSizeOffset = meta.fields.indexOf(\"retained_size\");\n        this._dominatorOffset = meta.fields.indexOf(\"dominator\");\n        this._edgesCountOffset = meta.fields.indexOf(\"children_count\");\n        this._firstEdgeOffset = meta.fields.indexOf(\"children\");\n        this._nodeTypes = meta.types[this._nodeTypeOffset];\n        this._nodeHiddenType = this._nodeTypes.indexOf(\"hidden\");\n        var edgesMeta = meta.types[this._firstEdgeOffset];\n        this._edgeFieldsCount = edgesMeta.fields.length;\n        this._edgeTypeOffset = edgesMeta.fields.indexOf(\"type\");\n        this._edgeNameOffset = edgesMeta.fields.indexOf(\"name_or_index\");\n        this._edgeToNodeOffset = edgesMeta.fields.indexOf(\"to_node\");\n        this._edgeTypes = edgesMeta.types[this._edgeTypeOffset];\n        this._edgeElementType = this._edgeTypes.indexOf(\"element\");\n        this._edgeHiddenType = this._edgeTypes.indexOf(\"hidden\");\n        this._edgeInternalType = this._edgeTypes.indexOf(\"internal\");\n        this._edgeShortcutType = this._edgeTypes.indexOf(\"shortcut\");\n    },\n\n    dispose: function()\n    {\n        delete this._nodes;\n        delete this._strings;\n        if (this._idsMap)\n            delete this._idsMap;\n        if (this._retainers) {\n            delete this._retainers;\n            delete this._nodesToRetainers;\n        }\n        if (this._aggregates) {\n            delete this._aggregates;\n            this._aggregatesWithIndexes = false;\n        }\n    },\n\n    get allNodes()\n    {\n        return new WebInspector.HeapSnapshotNodeIterator(this.rootNode);\n    },\n\n    get nodesCount()\n    {\n        if (this._nodesCount)\n            return this._nodesCount;\n\n        this._nodesCount = 0;\n        for (var iter = this.allNodes; iter.hasNext(); iter.next())\n            ++this._nodesCount;\n        return this._nodesCount;\n    },\n\n    restore: function(profile)\n    {\n        this._nodes = profile.nodes;\n        this._strings = profile.strings;\n    },\n\n    get rootNode()\n    {\n        return new WebInspector.HeapSnapshotNode(this, this._rootNodeIndex);\n    },\n\n    get totalSize()\n    {\n        return this.rootNode.retainedSize;\n    },\n\n    get idsMap()\n    {\n        if (this._idsMap)\n            return this._idsMap;\n\n        this._idsMap = [];\n        for (var iter = this.allNodes; iter.hasNext(); iter.next()) {\n            this._idsMap[iter.node.id] = true;\n        }\n        return this._idsMap;\n    },\n\n    retainers: function(node)\n    {\n        if (!this._retainers)\n            this._buildRetainers();\n\n        var retIndexFrom = this._nodesToRetainers[node.nodeIndex];\n        var retIndexTo = this._nodesToRetainers[node._nextNodeIndex];\n        return new WebInspector.HeapSnapshotArraySlice(this, \"_retainers\", retIndexFrom, retIndexTo);\n    },\n\n    aggregates: function(withNodeIndexes)\n    {\n        if (!this._aggregates)\n            this._buildAggregates();\n        if (withNodeIndexes && !this._aggregatesWithIndexes)\n            this._buildAggregatesIndexes();\n        return this._aggregates;\n    },\n\n    _buildRetainers: function()\n    {\n        this._nodesToRetainers = [];\n        for (var nodesIter = this.allNodes; nodesIter.hasNext(); nodesIter.next()) {\n            var node = nodesIter.node;\n            if (!(node.nodeIndex in this._nodesToRetainers))\n                this._nodesToRetainers[node.nodeIndex] = 0;\n            for (var edgesIter = node.edges; edgesIter.hasNext(); edgesIter.next()) {\n                var edge = edgesIter.edge;\n                var nodeIndex = edge.nodeIndex;\n                if (!(nodeIndex in this._nodesToRetainers))\n                    this._nodesToRetainers[nodeIndex] = 0;\n                this._nodesToRetainers[nodeIndex] += this._edgeFieldsCount;\n            }\n        }\n        nodesIter = this.allNodes;\n        var node = nodesIter.node;\n        var prevIndex = this._nodesToRetainers[node.nodeIndex] = 0;\n        var prevRetsCount = this._nodesToRetainers[node.nodeIndex];\n        nodesIter.next();\n        for (; nodesIter.hasNext(); nodesIter.next()) {\n            node = nodesIter.node;\n            var savedRefsCount = this._nodesToRetainers[node.nodeIndex];\n            this._nodesToRetainers[node.nodeIndex] = prevIndex + prevRetsCount;\n            prevIndex = this._nodesToRetainers[node.nodeIndex];\n            prevRetsCount = savedRefsCount;\n        }\n        this._retainers = new Array(prevIndex + prevRetsCount);\n        this._nodesToRetainers[this._nodes.length] = this._retainers.length;\n        for (nodesIter = this.allNodes; nodesIter.hasNext(); nodesIter.next()) {\n            node = nodesIter.node;\n            var retsCount = this._nodesToRetainers[node._nextNodeIndex] - this._nodesToRetainers[node.nodeIndex];\n            if (retsCount > 0) {\n                this._retainers[this._nodesToRetainers[node.nodeIndex]] = retsCount;\n            }\n        }\n        for (nodesIter = this.allNodes; nodesIter.hasNext(); nodesIter.next()) {\n            node = nodesIter.node;\n            for (var edgesIter = node.edges; edgesIter.hasNext(); edgesIter.next()) {\n                var edge = edgesIter.edge;\n                var nodeIndex = edge.nodeIndex;\n                var retIndex = this._nodesToRetainers[nodeIndex];\n                this._retainers[retIndex] -= this._edgeFieldsCount;\n                var idx = retIndex + this._retainers[retIndex];\n                this._retainers[idx + this._edgeTypeOffset] = edge._type();\n                this._retainers[idx + this._edgeNameOffset] = edge._nameOrIndex;\n                this._retainers[idx + this._edgeToNodeOffset] = node.nodeIndex;\n            }\n        }\n    },\n\n    _buildAggregates: function()\n    {\n        this._aggregates = {};\n        for (var iter = this.allNodes; iter.hasNext(); iter.next()) {\n            var node = iter.node;\n            var className = node.className;\n            var nameMatters = node.type === \"object\";\n            if (node.selfSize === 0)\n                continue;\n            if (!(className in this._aggregates))\n                this._aggregates[className] = { count: 0, self: 0, maxRet: 0, type: node.type, name: nameMatters ? node.name : null, idxs: [] };\n            var clss = this._aggregates[className];\n            ++clss.count;\n            clss.self += node.selfSize;\n            if (node.retainedSize > clss.maxRet)\n                clss.maxRet = node.retainedSize;\n        }\n    },\n\n    _buildAggregatesIndexes: function()\n    {\n        for (var iter = this.allNodes; iter.hasNext(); iter.next()) {\n            var node = iter.node;\n            var className = node.className;\n            var clss = this._aggregates[className];\n            if (clss)\n                clss.idxs.push(node.nodeIndex);\n        }\n\n        var nodeA = new WebInspector.HeapSnapshotNode(this);\n        var nodeB = new WebInspector.HeapSnapshotNode(this);\n        for (var clss in this._aggregates)\n            this._aggregates[clss].idxs.sort(\n                function(idxA, idxB) {\n                    nodeA.nodeIndex = idxA;\n                    nodeB.nodeIndex = idxB;\n                    return nodeA.id < nodeB.id ? -1 : 1;\n                });\n\n        this._aggregatesWithIndexes = true;\n    }\n};\n\nWebInspector.HeapSnapshotFilteredOrderedIterator = function(snapshot, iterator, filter)\n{\n    this._snapshot = snapshot;\n    this._filter = filter;\n    this._iterator = iterator;\n    this._iterationOrder = null;\n    this._position = 0;\n    this._lastComparator = null;\n}\n\nWebInspector.HeapSnapshotFilteredOrderedIterator.prototype = {\n    _createIterationOrder: function()\n    {\n        this._iterationOrder = [];\n        var iterator = this._iterator;\n        if (!this._filter) {\n            for (iterator.first(); iterator.hasNext(); iterator.next())\n                this._iterationOrder.push(iterator.index);\n        } else {\n            for (iterator.first(); iterator.hasNext(); iterator.next()) {\n                if (this._filter(iterator.item))\n                    this._iterationOrder.push(iterator.index);\n            }\n        }\n    },\n\n    first: function()\n    {\n        this._position = 0;\n    },\n\n    hasNext: function()\n    {\n        return this._position < this._iterationOrder.length;\n    },\n\n    get isEmpty()\n    {\n        if (this._iterationOrder)\n            return !this._iterationOrder.length;\n        var iterator = this._iterator;\n        if (!this._filter) {\n            iterator.first();\n            return !iterator.hasNext();\n        }\n        for (iterator.first(); iterator.hasNext(); iterator.next())\n            if (this._filter(iterator.item)) return false;\n        return true;\n    },\n\n    get item()\n    {\n        this._iterator.index = this._iterationOrder[this._position];\n        return this._iterator.item;\n    },\n\n    get lastComparator()\n    {\n        return this._lastComparator;\n    },\n\n    get length()\n    {\n        if (!this._iterationOrder)\n            this._createIterationOrder();\n        return this._iterationOrder.length;\n    },\n\n    next: function()\n    {\n        ++this._position;\n    }\n}\n\nWebInspector.HeapSnapshotFilteredOrderedIterator.prototype.createComparator = function(fieldNames)\n{\n    return {fieldName1:fieldNames[0], ascending1:fieldNames[1], fieldName2:fieldNames[2], ascending2:fieldNames[3]};\n}\n\nWebInspector.HeapSnapshotEdgesProvider = function(snapshot, rawEdges, filter)\n{\n    WebInspector.HeapSnapshotFilteredOrderedIterator.call(this, snapshot, new WebInspector.HeapSnapshotEdgeIterator(new WebInspector.HeapSnapshotEdge(snapshot, rawEdges)), filter);\n}\n\nWebInspector.HeapSnapshotEdgesProvider.prototype = {\n    sort: function(comparator)\n    {\n        if (this._lastComparator === comparator)\n            return false;\n        this._lastComparator = comparator;\n        var fieldName1 = comparator.fieldName1;\n        var fieldName2 = comparator.fieldName2;\n        var ascending1 = comparator.ascending1;\n        var ascending2 = comparator.ascending2;\n\n        var edgeA = this._iterator.item.clone();\n        var edgeB = edgeA.clone();\n        var nodeA = new WebInspector.HeapSnapshotNode(this._snapshot);\n        var nodeB = new WebInspector.HeapSnapshotNode(this._snapshot);\n\n        function sortByEdgeFieldName(ascending, indexA, indexB)\n        {\n            edgeA.edgeIndex = indexA;\n            edgeB.edgeIndex = indexB;\n            if (edgeB.name === \"__proto__\") return -1;\n            if (edgeA.name === \"__proto__\") return 1;\n            var result =\n                edgeA.hasStringName === edgeB.hasStringName ?\n                (edgeA.name < edgeB.name ? -1 : (edgeA.name > edgeB.name ? 1 : 0)) :\n                (edgeA.hasStringName ? -1 : 1);\n            return ascending ? result : -result;\n        }\n\n        function sortByNodeField(fieldName, ascending, indexA, indexB)\n        {\n            edgeA.edgeIndex = indexA;\n            edgeB.edgeIndex = indexB;\n            nodeA.nodeIndex = edgeA.nodeIndex;\n            nodeB.nodeIndex = edgeB.nodeIndex;\n            var valueA = nodeA[fieldName];\n            var valueB = nodeB[fieldName];\n            var result = valueA < valueB ? -1 : (valueA > valueB ? 1 : 0);\n            return ascending ? result : -result;\n        }\n\n        if (!this._iterationOrder)\n            this._createIterationOrder();\n\n        function sortByEdgeAndNode(indexA, indexB) {\n            var result = sortByEdgeFieldName(ascending1, indexA, indexB);\n            if (result === 0)\n                result = sortByNodeField(fieldName2, ascending2, indexA, indexB);\n            return result;\n        }\n\n        function sortByNodeAndEdge(indexA, indexB) {\n            var result = sortByNodeField(fieldName1, ascending1, indexA, indexB);\n            if (result === 0)\n                result = sortByEdgeFieldName(ascending2, indexA, indexB);\n            return result;\n        }\n\n        function sortByNodeAndNode(indexA, indexB) {\n            var result = sortByNodeField(fieldName1, ascending1, indexA, indexB);\n            if (result === 0)\n                result = sortByNodeField(fieldName2, ascending2, indexA, indexB);\n            return result;\n        }\n\n        if (fieldName1 === \"!edgeName\")\n            this._iterationOrder.sort(sortByEdgeAndNode);\n        else if (fieldName2 === \"!edgeName\")\n            this._iterationOrder.sort(sortByNodeAndEdge);\n        else\n            this._iterationOrder.sort(sortByNodeAndNode);\n        return true;\n    }\n};\n\nWebInspector.HeapSnapshotEdgesProvider.prototype.__proto__ = WebInspector.HeapSnapshotFilteredOrderedIterator.prototype;\n\nWebInspector.HeapSnapshotNodesProvider = function(snapshot, nodes, filter)\n{\n    WebInspector.HeapSnapshotFilteredOrderedIterator.call(this, snapshot, nodes, filter);\n}\n\nWebInspector.HeapSnapshotNodesProvider.prototype = {\n    sort: function(comparator)\n    {\n        if (this._lastComparator === comparator)\n            return false;\n        this._lastComparator = comparator;\n        var fieldName1 = comparator.fieldName1;\n        var fieldName2 = comparator.fieldName2;\n        var ascending1 = comparator.ascending1;\n        var ascending2 = comparator.ascending2;\n\n        var nodeA = new WebInspector.HeapSnapshotNode(this._snapshot);\n        var nodeB = new WebInspector.HeapSnapshotNode(this._snapshot);\n\n        function sortByNodeField(fieldName, ascending, indexA, indexB)\n        {\n            nodeA.nodeIndex = indexA;\n            nodeB.nodeIndex = indexB;\n            var valueA = nodeA[fieldName];\n            var valueB = nodeB[fieldName];\n            var result = valueA < valueB ? -1 : (valueA > valueB ? 1 : 0);\n            return ascending ? result : -result;\n        }\n\n        if (!this._iterationOrder)\n            this._createIterationOrder();\n\n        function sortByComparator(indexA, indexB) {\n            var result = sortByNodeField(fieldName1, ascending1, indexA, indexB);\n            if (result === 0)\n                result = sortByNodeField(fieldName2, ascending2, indexA, indexB);\n            return result;\n        }\n\n        this._iterationOrder.sort(sortByComparator);\n        return true;\n    }\n};\n\nWebInspector.HeapSnapshotNodesProvider.prototype.__proto__ = WebInspector.HeapSnapshotFilteredOrderedIterator.prototype;\n\nWebInspector.HeapSnapshotPathFinder = function(snapshot, targetNodeIndex)\n{\n    this._snapshot = snapshot;\n    this._maxLength = 1;\n    this._lengthLimit = 15;\n    this._targetNodeIndex = targetNodeIndex;\n    this._currentPath = null;\n    this._skipHidden = !WebInspector.DetailedHeapshotView.prototype.showHiddenData;\n    this._rootChildren = this._fillRootChildren();\n}\n\nWebInspector.HeapSnapshotPathFinder.prototype = {\n    findNext: function()\n    {\n        for (var i = 0; i < 100000; ++i) {\n            if (!this._buildNextPath()) {\n                if (++this._maxLength >= this._lengthLimit)\n                    return null;\n                this._currentPath = null;\n                if (!this._buildNextPath())\n                    return null;\n            }\n            if (this._isPathFound())\n                return {path:this._pathToString(this._currentPath), len:this._currentPath.length};\n        }\n\n        return false;\n    },\n\n    _fillRootChildren: function()\n    {\n        var result = [];\n        for (var iter = this._snapshot.rootNode.edges; iter.hasNext(); iter.next())\n            result[iter.edge.nodeIndex] = true;\n        return result;\n    },\n\n    _appendToCurrentPath: function(iter)\n    {\n        this._currentPath._cache[this._lastEdge.nodeIndex] = true;\n        this._currentPath.push(iter);\n    },\n\n    _removeLastFromCurrentPath: function()\n    {\n        this._currentPath.pop();\n        delete this._currentPath._cache[this._lastEdge.nodeIndex];\n    },\n\n    _hasInPath: function(nodeIndex)\n    {\n        return this._targetNodeIndex === nodeIndex\n            || !!this._currentPath._cache[nodeIndex];\n    },\n\n    _isPathFound: function()\n    {\n        return this._currentPath.length === this._maxLength\n            && this._lastEdge.nodeIndex in this._rootChildren;\n    },\n\n    get _lastEdgeIter()\n    {\n        return this._currentPath[this._currentPath.length - 1];\n    },\n\n    get _lastEdge()\n    {\n        return this._lastEdgeIter.edge;\n    },\n\n    _skipEdge: function(edge)\n    {\n        return (this._skipHidden && (edge.isHidden || edge.node.isHidden))\n            || this._hasInPath(edge.nodeIndex);\n    },\n\n    _nextEdgeIter: function()\n    {\n        var iter = this._lastEdgeIter;\n        while (this._skipEdge(iter.edge) && iter.hasNext())\n            iter.next();\n        return iter;\n    },\n\n    _buildNextPath: function()\n    {\n        if (this._currentPath !== null) {\n            var iter = this._lastEdgeIter;\n            while (true) {\n                iter.next();\n                if (iter.hasNext())\n                    return true;\n                while (true) {\n                    if (this._currentPath.length > 1) {\n                        this._removeLastFromCurrentPath();\n                        iter = this._lastEdgeIter;\n                        iter.next();\n                        iter = this._nextEdgeIter();\n                        if (iter.hasNext()) {\n                            while (this._currentPath.length < this._maxLength) {\n                                iter = this._nextEdgeIter();\n                                if (iter.hasNext())\n                                    this._appendToCurrentPath(iter.edge.node.retainers);\n                                else\n                                    return true;\n                            }\n                            return true;\n                        }\n                    } else\n                        return false;\n                }\n            }\n        } else {\n            var node = new WebInspector.HeapSnapshotNode(this._snapshot, this._targetNodeIndex);\n            this._currentPath = [node.retainers];\n            this._currentPath._cache = {};\n            while (this._currentPath.length < this._maxLength) {\n                var iter = this._nextEdgeIter();\n                if (iter.hasNext())\n                    this._appendToCurrentPath(iter.edge.node.retainers);\n                else\n                    break;\n            }\n            return true;\n        }\n    },\n\n    _nodeToString: function(node)\n    {\n        if (node.id === 1)\n            return node.name;\n        else\n            return node.name + \"@\" + node.id;\n    },\n\n    _pathToString: function(path)\n    {\n        if (!path)\n            return \"\";\n        var sPath = [];\n        for (var j = 0; j < path.length; ++j)\n            sPath.push(path[j].edge.toString());\n        sPath.push(this._nodeToString(path[path.length - 1].edge.node));\n        sPath.reverse();\n        return sPath.join(\"\");\n    }\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/HeapSnapshotView.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.HeapSnapshotView = function(parent, profile)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"heap-snapshot-view\");\n\n    this.parent = parent;\n    this.parent.addEventListener(\"profile added\", this._updateBaseOptions, this);\n\n    this.showCountAsPercent = false;\n    this.showSizeAsPercent = false;\n    this.showCountDeltaAsPercent = false;\n    this.showSizeDeltaAsPercent = false;\n\n    this.categories = {\n        code: new WebInspector.ResourceCategory(\"code\", WebInspector.UIString(\"Code\"), \"rgb(255,121,0)\"),\n        data: new WebInspector.ResourceCategory(\"data\", WebInspector.UIString(\"Objects\"), \"rgb(47,102,236)\")\n    };\n\n    var summaryContainer = document.createElement(\"div\");\n    summaryContainer.id = \"heap-snapshot-summary-container\";\n\n    this.countsSummaryBar = new WebInspector.SummaryBar(this.categories);\n    this.countsSummaryBar.element.className = \"heap-snapshot-summary\";\n    this.countsSummaryBar.calculator = new WebInspector.HeapSummaryCountCalculator();\n    var countsLabel = document.createElement(\"div\");\n    countsLabel.className = \"heap-snapshot-summary-label\";\n    countsLabel.textContent = WebInspector.UIString(\"Count\");\n    this.countsSummaryBar.element.appendChild(countsLabel);\n    summaryContainer.appendChild(this.countsSummaryBar.element);\n\n    this.sizesSummaryBar = new WebInspector.SummaryBar(this.categories);\n    this.sizesSummaryBar.element.className = \"heap-snapshot-summary\";\n    this.sizesSummaryBar.calculator = new WebInspector.HeapSummarySizeCalculator();\n    var sizesLabel = document.createElement(\"label\");\n    sizesLabel.className = \"heap-snapshot-summary-label\";\n    sizesLabel.textContent = WebInspector.UIString(\"Size\");\n    this.sizesSummaryBar.element.appendChild(sizesLabel);\n    summaryContainer.appendChild(this.sizesSummaryBar.element);\n\n    this.element.appendChild(summaryContainer);\n\n    var columns = {\n        cons: { title: WebInspector.UIString(\"Constructor\"), disclosure: true, sortable: true },\n        count: { title: WebInspector.UIString(\"Count\"), width: \"54px\", sortable: true },\n        size: { title: WebInspector.UIString(\"Size\"), width: \"72px\", sort: \"descending\", sortable: true },\n        // \\xb1 is a \"plus-minus\" sign.\n        countDelta: { title: WebInspector.UIString(\"\\xb1 Count\"), width: \"72px\", sortable: true },\n        sizeDelta: { title: WebInspector.UIString(\"\\xb1 Size\"), width: \"72px\", sortable: true }\n    };\n\n    this.dataGrid = new WebInspector.DataGrid(columns);\n    this.dataGrid.addEventListener(\"sorting changed\", this._sortData, this);\n    this.dataGrid.element.addEventListener(\"mousedown\", this._mouseDownInDataGrid.bind(this), true);\n    this.element.appendChild(this.dataGrid.element);\n\n    this.profile = profile;\n\n    this.baseSelectElement = document.createElement(\"select\");\n    this.baseSelectElement.className = \"status-bar-item\";\n    this.baseSelectElement.addEventListener(\"change\", this._changeBase.bind(this), false);\n    this._updateBaseOptions();\n\n    this.percentButton = new WebInspector.StatusBarButton(\"\", \"percent-time-status-bar-item status-bar-item\");\n    this.percentButton.addEventListener(\"click\", this._percentClicked.bind(this), false);\n\n    this._loadProfile(this.profile, profileCallback.bind(this));\n\n    function profileCallback(profile)\n    {\n        var list = this._profiles();\n        var profileIndex;\n        for (var i = 0; i < list.length; ++i)\n            if (list[i].uid === profile.uid) {\n                profileIndex = i;\n                break;\n            }\n        if (profileIndex > 0)\n            this.baseSelectElement.selectedIndex = profileIndex - 1;\n        else\n            this.baseSelectElement.selectedIndex = profileIndex;\n        this._resetDataGridList(resetCompleted.bind(this));\n    }\n\n    function resetCompleted()\n    {\n        this.refresh();\n        this._updatePercentButton();\n    }\n}\n\nWebInspector.HeapSnapshotView.prototype = {\n    get statusBarItems()\n    {\n        return [this.baseSelectElement, this.percentButton.element];\n    },\n\n    get profile()\n    {\n        return this._profile;\n    },\n\n    set profile(profile)\n    {\n        this._profile = profile;\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this.dataGrid.updateWidths();\n    },\n\n    hide: function()\n    {\n        WebInspector.View.prototype.hide.call(this);\n        this._currentSearchResultIndex = -1;\n    },\n\n    resize: function()\n    {\n        if (this.dataGrid)\n            this.dataGrid.updateWidths();\n    },\n\n    refresh: function()\n    {\n        this.dataGrid.removeChildren();\n\n        var children = this.snapshotDataGridList.children;\n        var count = children.length;\n        for (var index = 0; index < count; ++index)\n            this.dataGrid.appendChild(children[index]);\n\n        this._updateSummaryGraph();\n    },\n\n    refreshShowAsPercents: function()\n    {\n        this._updatePercentButton();\n        this.refreshVisibleData();\n    },\n\n    _deleteSearchMatchedFlags: function(node)\n    {\n        delete node._searchMatchedConsColumn;\n        delete node._searchMatchedCountColumn;\n        delete node._searchMatchedSizeColumn;\n        delete node._searchMatchedCountDeltaColumn;\n        delete node._searchMatchedSizeDeltaColumn;\n    },\n\n    searchCanceled: function()\n    {\n        if (this._searchResults) {\n            for (var i = 0; i < this._searchResults.length; ++i) {\n                var profileNode = this._searchResults[i].profileNode;\n                this._deleteSearchMatchedFlags(profileNode);\n                profileNode.refresh();\n            }\n        }\n\n        delete this._searchFinishedCallback;\n        this._currentSearchResultIndex = -1;\n        this._searchResults = [];\n    },\n\n    performSearch: function(query, finishedCallback)\n    {\n        // Call searchCanceled since it will reset everything we need before doing a new search.\n        this.searchCanceled();\n\n        query = query.trim();\n\n        if (!query.length)\n            return;\n\n        this._searchFinishedCallback = finishedCallback;\n\n        var helper = WebInspector.HeapSnapshotView.SearchHelper;\n\n        var operationAndNumber = helper.parseOperationAndNumber(query);\n        var operation = operationAndNumber[0];\n        var queryNumber = operationAndNumber[1];\n\n        var percentUnits = helper.percents.test(query);\n        var megaBytesUnits = helper.megaBytes.test(query);\n        var kiloBytesUnits = helper.kiloBytes.test(query);\n        var bytesUnits = helper.bytes.test(query);\n\n        var queryNumberBytes = (megaBytesUnits ? (queryNumber * 1024 * 1024) : (kiloBytesUnits ? (queryNumber * 1024) : queryNumber));\n\n        function matchesQuery(heapSnapshotDataGridNode)\n        {\n            WebInspector.HeapSnapshotView.prototype._deleteSearchMatchedFlags(heapSnapshotDataGridNode);\n\n            if (percentUnits) {\n                heapSnapshotDataGridNode._searchMatchedCountColumn = operation(heapSnapshotDataGridNode.countPercent, queryNumber);\n                heapSnapshotDataGridNode._searchMatchedSizeColumn = operation(heapSnapshotDataGridNode.sizePercent, queryNumber);\n                heapSnapshotDataGridNode._searchMatchedCountDeltaColumn = operation(heapSnapshotDataGridNode.countDeltaPercent, queryNumber);\n                heapSnapshotDataGridNode._searchMatchedSizeDeltaColumn = operation(heapSnapshotDataGridNode.sizeDeltaPercent, queryNumber);\n            } else if (megaBytesUnits || kiloBytesUnits || bytesUnits) {\n                heapSnapshotDataGridNode._searchMatchedSizeColumn = operation(heapSnapshotDataGridNode.size, queryNumberBytes);\n                heapSnapshotDataGridNode._searchMatchedSizeDeltaColumn = operation(heapSnapshotDataGridNode.sizeDelta, queryNumberBytes);\n            } else {\n                heapSnapshotDataGridNode._searchMatchedCountColumn = operation(heapSnapshotDataGridNode.count, queryNumber);\n                heapSnapshotDataGridNode._searchMatchedCountDeltaColumn = operation(heapSnapshotDataGridNode.countDelta, queryNumber);\n            }\n\n            if (heapSnapshotDataGridNode.constructorName.hasSubstring(query, true))\n                heapSnapshotDataGridNode._searchMatchedConsColumn = true;\n\n            if (heapSnapshotDataGridNode._searchMatchedConsColumn ||\n                heapSnapshotDataGridNode._searchMatchedCountColumn ||\n                heapSnapshotDataGridNode._searchMatchedSizeColumn ||\n                heapSnapshotDataGridNode._searchMatchedCountDeltaColumn ||\n                heapSnapshotDataGridNode._searchMatchedSizeDeltaColumn) {\n                heapSnapshotDataGridNode.refresh();\n                return true;\n            }\n\n            return false;\n        }\n\n        var current = this.snapshotDataGridList.children[0];\n        var depth = 0;\n        var info = {};\n\n        // The second and subsequent levels of heap snapshot nodes represent retainers,\n        // so recursive expansion will be infinite, since a graph is being traversed.\n        // So default to a recursion cap of 2 levels.\n        var maxDepth = 2;\n\n        while (current) {\n            if (matchesQuery(current))\n                this._searchResults.push({ profileNode: current });\n            current = current.traverseNextNode(false, null, (depth >= maxDepth), info);\n            depth += info.depthChange;\n        }\n\n        finishedCallback(this, this._searchResults.length);\n    },\n\n    // FIXME: move these methods to a superclass, inherit both views from it.\n    jumpToFirstSearchResult: WebInspector.CPUProfileView.prototype.jumpToFirstSearchResult,\n    jumpToLastSearchResult: WebInspector.CPUProfileView.prototype.jumpToLastSearchResult,\n    jumpToNextSearchResult: WebInspector.CPUProfileView.prototype.jumpToNextSearchResult,\n    jumpToPreviousSearchResult: WebInspector.CPUProfileView.prototype.jumpToPreviousSearchResult,\n    showingFirstSearchResult: WebInspector.CPUProfileView.prototype.showingFirstSearchResult,\n    showingLastSearchResult: WebInspector.CPUProfileView.prototype.showingLastSearchResult,\n    _jumpToSearchResult: WebInspector.CPUProfileView.prototype._jumpToSearchResult,\n\n    refreshVisibleData: function()\n    {\n        var child = this.dataGrid.children[0];\n        while (child) {\n            child.refresh();\n            child = child.traverseNextNode(false, null, true);\n        }\n        this._updateSummaryGraph();\n    },\n\n    _changeBase: function()\n    {\n        if (this.baseSnapshot.uid === this._profiles()[this.baseSelectElement.selectedIndex].uid)\n            return;\n\n        this._resetDataGridList(resetCompleted.bind(this));\n\n        function resetCompleted() {\n            this.refresh();\n\n            if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)\n                return;\n\n            // The current search needs to be performed again. First negate out previous match\n            // count by calling the search finished callback with a negative number of matches.\n            // Then perform the search again with the same query and callback.\n            this._searchFinishedCallback(this, -this._searchResults.length);\n            this.performSearch(this.currentQuery, this._searchFinishedCallback);\n        }\n    },\n\n    _createSnapshotDataGridList: function()\n    {\n        if (this._snapshotDataGridList)\n          delete this._snapshotDataGridList;\n\n        this._snapshotDataGridList = new WebInspector.HeapSnapshotDataGridList(this, this.baseSnapshot.entries, this.profile.entries);\n        return this._snapshotDataGridList;\n    },\n\n    _profiles: function()\n    {\n        return WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId);\n    },\n\n    _loadProfile: function(profile, callback)\n    {\n        WebInspector.panels.profiles.loadHeapSnapshot(profile.uid, callback);\n    },\n\n    processLoadedSnapshot: function(profile, loadedSnapshot)\n    {\n        var snapshot = WebInspector.HeapSnapshotView.prototype._convertSnapshot(loadedSnapshot);\n        profile.children = snapshot.children;\n        profile.entries = snapshot.entries;\n        profile.lowlevels = snapshot.lowlevels;\n        WebInspector.HeapSnapshotView.prototype._prepareProfile(profile);\n    },\n\n    _mouseDownInDataGrid: function(event)\n    {\n        if (event.detail < 2)\n            return;\n\n        var cell = event.target.enclosingNodeOrSelfWithNodeName(\"td\");\n        if (!cell || (!cell.hasStyleClass(\"count-column\") && !cell.hasStyleClass(\"size-column\") && !cell.hasStyleClass(\"countDelta-column\") && !cell.hasStyleClass(\"sizeDelta-column\")))\n            return;\n\n        if (cell.hasStyleClass(\"count-column\"))\n            this.showCountAsPercent = !this.showCountAsPercent;\n        else if (cell.hasStyleClass(\"size-column\"))\n            this.showSizeAsPercent = !this.showSizeAsPercent;\n        else if (cell.hasStyleClass(\"countDelta-column\"))\n            this.showCountDeltaAsPercent = !this.showCountDeltaAsPercent;\n        else if (cell.hasStyleClass(\"sizeDelta-column\"))\n            this.showSizeDeltaAsPercent = !this.showSizeDeltaAsPercent;\n\n        this.refreshShowAsPercents();\n\n        event.preventDefault();\n        event.stopPropagation();\n    },\n\n    get _isShowingAsPercent()\n    {\n        return this.showCountAsPercent && this.showSizeAsPercent && this.showCountDeltaAsPercent && this.showSizeDeltaAsPercent;\n    },\n\n    _percentClicked: function(event)\n    {\n        var currentState = this._isShowingAsPercent;\n        this.showCountAsPercent = !currentState;\n        this.showSizeAsPercent = !currentState;\n        this.showCountDeltaAsPercent = !currentState;\n        this.showSizeDeltaAsPercent = !currentState;\n        this.refreshShowAsPercents();\n    },\n\n    _convertSnapshot: function(loadedSnapshot)\n    {\n        var snapshot = new WebInspector.HeapSnapshot(loadedSnapshot);\n        var result = {lowlevels: {}, entries: {}, children: {}};\n        var rootEdgesIter = snapshot.rootNode.edges;\n        for (var iter = rootEdgesIter; iter.hasNext(); iter.next()) {\n            var node = iter.edge.node;\n            if (node.isHidden)\n                result.lowlevels[node.name] = {count: node.instancesCount, size: node.selfSize, type: node.name};\n            else if (node.instancesCount)\n                result.entries[node.name] = {constructorName: node.name, count: node.instancesCount, size: node.selfSize};\n            else {\n                var entry = {constructorName: node.name};\n                for (var innerIter = node.edges; innerIter.hasNext(); innerIter.next()) {\n                    var edge = innerIter.edge;\n                    entry[edge.nodeIndex] = {constructorName: edge.node.name, count: edge.name};\n                }\n                result.children[rootEdgesIter.edge.nodeIndex] = entry;\n            }\n        }\n        return result;\n    },\n\n    _prepareProfile: function(profile)\n    {\n        for (var profileEntry in profile.entries)\n            profile.entries[profileEntry].retainers = {};\n        profile.clusters = {};\n\n        for (var addr in profile.children) {\n            var retainer = profile.children[addr];\n            var retainerId = retainer.constructorName + \":\" + addr;\n            for (var childAddr in retainer) {\n                if (childAddr === \"constructorName\") continue;\n                var item = retainer[childAddr];\n                var itemId = item.constructorName + \":\" + childAddr;\n                if ((item.constructorName === \"Object\" || item.constructorName === \"Array\")) {\n                    if (!(itemId in profile.clusters))\n                        profile.clusters[itemId] = { constructorName: itemId, retainers: {} };\n                    mergeRetainers(profile.clusters[itemId], item);\n                }\n                mergeRetainers(profile.entries[item.constructorName], item);\n            }\n        }\n\n        function mergeRetainers(entry, item)\n        {\n            if (!(retainer.constructorName in entry.retainers))\n               entry.retainers[retainer.constructorName] = { constructorName: retainer.constructorName, count: 0, clusters: {} };\n            var retainerEntry = entry.retainers[retainer.constructorName];\n            retainerEntry.count += item.count;\n            if (retainer.constructorName === \"Object\" || retainer.constructorName === \"Array\")\n                retainerEntry.clusters[retainerId] = true;\n        }\n    },\n\n    _resetDataGridList: function(callback)\n    {\n        this._loadProfile(this._profiles()[this.baseSelectElement.selectedIndex], profileLoaded.bind(this));\n\n        function profileLoaded(profile)\n        {\n            this.baseSnapshot = profile;\n            var lastComparator = WebInspector.HeapSnapshotDataGridList.propertyComparator(\"size\", false);\n            if (this.snapshotDataGridList)\n                lastComparator = this.snapshotDataGridList.lastComparator;\n            this.snapshotDataGridList = this._createSnapshotDataGridList();\n            this.snapshotDataGridList.sort(lastComparator, true);\n            callback();\n        }\n    },\n\n    _sortData: function()\n    {\n        var sortAscending = this.dataGrid.sortOrder === \"ascending\";\n        var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;\n        var sortProperty = {\n            cons: [\"constructorName\", null],\n            count: [\"count\", \"constructorName\"],\n            size: [\"size\", \"constructorName\"],\n            countDelta: [this.showCountDeltaAsPercent ? \"countDeltaPercent\" : \"countDelta\", \"constructorName\"],\n            sizeDelta: [this.showSizeDeltaAsPercent ? \"sizeDeltaPercent\" : \"sizeDelta\", \"constructorName\"]\n        }[sortColumnIdentifier];\n\n        this.snapshotDataGridList.sort(WebInspector.HeapSnapshotDataGridList.propertyComparator(sortProperty[0], sortProperty[1], sortAscending));\n\n        this.refresh();\n    },\n\n    _updateBaseOptions: function()\n    {\n        var list = this._profiles();\n        // We're assuming that snapshots can only be added.\n        if (this.baseSelectElement.length === list.length)\n            return;\n\n        for (var i = this.baseSelectElement.length, n = list.length; i < n; ++i) {\n            var baseOption = document.createElement(\"option\");\n            var title = list[i].title;\n            if (!title.indexOf(UserInitiatedProfileName))\n                title = WebInspector.UIString(\"Snapshot %d\", title.substring(UserInitiatedProfileName.length + 1));\n            baseOption.label = WebInspector.UIString(\"Compared to %s\", title);\n            this.baseSelectElement.appendChild(baseOption);\n        }\n    },\n\n    _updatePercentButton: function()\n    {\n        if (this._isShowingAsPercent) {\n            this.percentButton.title = WebInspector.UIString(\"Show absolute counts and sizes.\");\n            this.percentButton.toggled = true;\n        } else {\n            this.percentButton.title = WebInspector.UIString(\"Show counts and sizes as percentages.\");\n            this.percentButton.toggled = false;\n        }\n    },\n\n    _updateSummaryGraph: function()\n    {\n        this.countsSummaryBar.calculator.showAsPercent = this._isShowingAsPercent;\n        this.countsSummaryBar.update(this.profile.lowlevels);\n\n        this.sizesSummaryBar.calculator.showAsPercent = this._isShowingAsPercent;\n        this.sizesSummaryBar.update(this.profile.lowlevels);\n    }\n};\n\nWebInspector.HeapSnapshotView.prototype.__proto__ = WebInspector.View.prototype;\n\nWebInspector.HeapSnapshotView.SearchHelper = {\n    // In comparators, we assume that a value from a node is passed as the first parameter.\n    operations: {\n        LESS: function (a, b) { return a !== null && a < b; },\n        LESS_OR_EQUAL: function (a, b) { return a !== null && a <= b; },\n        EQUAL: function (a, b) { return a !== null && a === b; },\n        GREATER_OR_EQUAL: function (a, b) { return a !== null && a >= b; },\n        GREATER: function (a, b) { return a !== null && a > b; }\n    },\n\n    operationParsers: {\n        LESS: /^<(\\d+)/,\n        LESS_OR_EQUAL: /^<=(\\d+)/,\n        GREATER_OR_EQUAL: /^>=(\\d+)/,\n        GREATER: /^>(\\d+)/\n    },\n\n    parseOperationAndNumber: function(query)\n    {\n        var operations = WebInspector.HeapSnapshotView.SearchHelper.operations;\n        var parsers = WebInspector.HeapSnapshotView.SearchHelper.operationParsers;\n        for (var operation in parsers) {\n            var match = query.match(parsers[operation]);\n            if (match !== null)\n                return [operations[operation], parseFloat(match[1])];\n        }\n        return [operations.EQUAL, parseFloat(query)];\n    },\n\n    percents: /%$/,\n\n    megaBytes: /MB$/i,\n\n    kiloBytes: /KB$/i,\n\n    bytes: /B$/i\n}\n\nWebInspector.HeapSummaryCalculator = function(lowLevelField)\n{\n    this.total = 1;\n    this.lowLevelField = lowLevelField;\n}\n\nWebInspector.HeapSummaryCalculator.prototype = {\n    computeSummaryValues: function(lowLevels)\n    {\n        var highLevels = { data: 0, code: 0 };\n        this.total = 0;\n        for (var item in lowLevels) {\n            var highItem = this._highFromLow(item);\n            if (highItem) {\n                var value = lowLevels[item][this.lowLevelField];\n                highLevels[highItem] += value;\n                this.total += value;\n            }\n        }\n        var result = { categoryValues: highLevels };\n        if (!this.showAsPercent)\n            result.total = this.total;\n        return result;\n    },\n\n    formatValue: function(value)\n    {\n        if (this.showAsPercent)\n            return WebInspector.UIString(\"%.2f%%\", value / this.total * 100.0);\n        else\n            return this._valueToString(value);\n    },\n\n    get showAsPercent()\n    {\n        return this._showAsPercent;\n    },\n\n    set showAsPercent(x)\n    {\n        this._showAsPercent = x;\n    }\n}\n\nWebInspector.HeapSummaryCountCalculator = function()\n{\n    WebInspector.HeapSummaryCalculator.call(this, \"count\");\n}\n\nWebInspector.HeapSummaryCountCalculator.prototype = {\n    _highFromLow: function(type)\n    {\n        if (type === \"CODE_TYPE\" || type === \"SHARED_FUNCTION_INFO_TYPE\" || type === \"SCRIPT_TYPE\") return \"code\";\n        if (type === \"STRING_TYPE\" || type === \"HEAP_NUMBER_TYPE\" || type.match(/^JS_/)) return \"data\";\n        return null;\n    },\n\n    _valueToString: function(value)\n    {\n        return value.toString();\n    }\n}\n\nWebInspector.HeapSummaryCountCalculator.prototype.__proto__ = WebInspector.HeapSummaryCalculator.prototype;\n\nWebInspector.HeapSummarySizeCalculator = function()\n{\n    WebInspector.HeapSummaryCalculator.call(this, \"size\");\n}\n\nWebInspector.HeapSummarySizeCalculator.prototype = {\n    _highFromLow: function(type)\n    {\n        if (type === \"CODE_TYPE\" || type === \"SHARED_FUNCTION_INFO_TYPE\" || type === \"SCRIPT_TYPE\")\n            return \"code\";\n        if (type === \"STRING_TYPE\" || type === \"HEAP_NUMBER_TYPE\" || type.match(/^JS_/) || type.match(/_ARRAY_TYPE$/))\n            return \"data\";\n        return null;\n    },\n\n    _valueToString: Number.bytesToString\n}\n\nWebInspector.HeapSummarySizeCalculator.prototype.__proto__ = WebInspector.HeapSummaryCalculator.prototype;\n\nWebInspector.HeapSnapshotDataGridNodeWithRetainers = function(owningTree)\n{\n    this.tree = owningTree;\n\n    WebInspector.DataGridNode.call(this, null, this._hasRetainers);\n\n    this.addEventListener(\"populate\", this._populate, this);\n};\n\nWebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype = {\n    isEmptySet: function(set)\n    {\n        for (var x in set)\n            return false;\n        return true;\n    },\n\n    get _hasRetainers()\n    {\n        return !this.isEmptySet(this.retainers);\n    },\n\n    get _parent()\n    {\n        // For top-level nodes, return owning tree as a parent, not data grid.\n        return this.parent !== this.dataGrid ? this.parent : this.tree;\n    },\n\n    _populate: function(event)\n    {\n        function appendDiffEntry(baseItem, snapshotItem)\n        {\n            this.appendChild(new WebInspector.HeapSnapshotDataGridRetainerNode(this.snapshotView, baseItem, snapshotItem, this.tree));\n        }\n\n        this.produceDiff(this.baseRetainers, this.retainers, appendDiffEntry.bind(this));\n\n        if (this._parent) {\n            var currentComparator = this._parent.lastComparator;\n            if (currentComparator)\n                this.sort(currentComparator, true);\n        }\n\n        this.removeEventListener(\"populate\", this._populate, this);\n    },\n\n    produceDiff: function(baseEntries, currentEntries, callback)\n    {\n        for (var item in currentEntries)\n            callback(baseEntries[item], currentEntries[item]);\n\n        for (item in baseEntries) {\n            if (!(item in currentEntries))\n                callback(baseEntries[item], null);\n        }\n    },\n\n    sort: function(comparator, force) {\n        if (!force && this.lastComparator === comparator)\n            return;\n\n        this.children.sort(comparator);\n        var childCount = this.children.length;\n        for (var childIndex = 0; childIndex < childCount; ++childIndex)\n            this.children[childIndex]._recalculateSiblings(childIndex);\n        for (var i = 0; i < this.children.length; ++i) {\n            var child = this.children[i];\n            if (!force && (!child.expanded || child.lastComparator === comparator))\n                continue;\n            child.sort(comparator, force);\n        }\n        this.lastComparator = comparator;\n    },\n\n    signForDelta: function(delta) {\n        if (delta === 0)\n            return \"\";\n        if (delta > 0)\n            return \"+\";\n        else\n            return \"\\u2212\";  // Math minus sign, same width as plus.\n    },\n\n    showDeltaAsPercent: function(value)\n    {\n        if (value === Number.POSITIVE_INFINITY)\n            return WebInspector.UIString(\"new\");\n        else if (value === Number.NEGATIVE_INFINITY)\n            return WebInspector.UIString(\"deleted\");\n        if (value > 1000.0)\n            return WebInspector.UIString(\"%s >1000%%\", this.signForDelta(value));\n        return WebInspector.UIString(\"%s%.2f%%\", this.signForDelta(value), Math.abs(value));\n    },\n\n    getTotalCount: function()\n    {\n        if (!this._count) {\n            this._count = 0;\n            for (var i = 0, n = this.children.length; i < n; ++i)\n                this._count += this.children[i].count;\n        }\n        return this._count;\n    },\n\n    getTotalSize: function()\n    {\n        if (!this._size) {\n            this._size = 0;\n            for (var i = 0, n = this.children.length; i < n; ++i)\n                this._size += this.children[i].size;\n        }\n        return this._size;\n    },\n\n    get countPercent()\n    {\n        return this.count / this._parent.getTotalCount() * 100.0;\n    },\n\n    get sizePercent()\n    {\n        return this.size / this._parent.getTotalSize() * 100.0;\n    },\n\n    get countDeltaPercent()\n    {\n        if (this.baseCount > 0) {\n            if (this.count > 0)\n                return this.countDelta / this.baseCount * 100.0;\n            else\n                return Number.NEGATIVE_INFINITY;\n        } else\n            return Number.POSITIVE_INFINITY;\n    },\n\n    get sizeDeltaPercent()\n    {\n        if (this.baseSize > 0) {\n            if (this.size > 0)\n                return this.sizeDelta / this.baseSize * 100.0;\n            else\n                return Number.NEGATIVE_INFINITY;\n        } else\n            return Number.POSITIVE_INFINITY;\n    },\n\n    get data()\n    {\n        var data = {};\n\n        data[\"cons\"] = this.constructorName;\n\n        if (this.snapshotView.showCountAsPercent)\n            data[\"count\"] = WebInspector.UIString(\"%.2f%%\", this.countPercent);\n        else\n            data[\"count\"] = this.count;\n\n        if (this.size !== null) {\n            if (this.snapshotView.showSizeAsPercent)\n                data[\"size\"] = WebInspector.UIString(\"%.2f%%\", this.sizePercent);\n            else\n                data[\"size\"] = Number.bytesToString(this.size);\n        } else\n            data[\"size\"] = \"\";\n\n        if (this.snapshotView.showCountDeltaAsPercent)\n            data[\"countDelta\"] = this.showDeltaAsPercent(this.countDeltaPercent);\n        else\n            data[\"countDelta\"] = WebInspector.UIString(\"%s%d\", this.signForDelta(this.countDelta), Math.abs(this.countDelta));\n\n        if (this.sizeDelta !== null) {\n            if (this.snapshotView.showSizeDeltaAsPercent)\n                data[\"sizeDelta\"] = this.showDeltaAsPercent(this.sizeDeltaPercent);\n            else\n                data[\"sizeDelta\"] = WebInspector.UIString(\"%s%s\", this.signForDelta(this.sizeDelta), Number.bytesToString(Math.abs(this.sizeDelta)));\n        } else\n            data[\"sizeDelta\"] = \"\";\n\n        return data;\n    },\n\n    createCell: function(columnIdentifier)\n    {\n        var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);\n\n        if ((columnIdentifier === \"cons\" && this._searchMatchedConsColumn) ||\n            (columnIdentifier === \"count\" && this._searchMatchedCountColumn) ||\n            (columnIdentifier === \"size\" && this._searchMatchedSizeColumn) ||\n            (columnIdentifier === \"countDelta\" && this._searchMatchedCountDeltaColumn) ||\n            (columnIdentifier === \"sizeDelta\" && this._searchMatchedSizeDeltaColumn))\n            cell.addStyleClass(\"highlight\");\n\n        return cell;\n    }\n};\n\nWebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.__proto__ = WebInspector.DataGridNode.prototype;\n\nWebInspector.HeapSnapshotDataGridNode = function(snapshotView, baseEntry, snapshotEntry, owningTree)\n{\n    this.snapshotView = snapshotView;\n\n    if (!snapshotEntry)\n        snapshotEntry = { constructorName: baseEntry.constructorName, count: 0, size: 0, retainers: {} };\n    this.constructorName = snapshotEntry.constructorName;\n    this.count = snapshotEntry.count;\n    this.size = snapshotEntry.size;\n    this.retainers = snapshotEntry.retainers;\n\n    if (!baseEntry)\n        baseEntry = { count: 0, size: 0, retainers: {} };\n    this.baseCount = baseEntry.count;\n    this.countDelta = this.count - this.baseCount;\n    this.baseSize = baseEntry.size;\n    this.sizeDelta = this.size - this.baseSize;\n    this.baseRetainers = baseEntry.retainers;\n\n    WebInspector.HeapSnapshotDataGridNodeWithRetainers.call(this, owningTree);\n};\n\nWebInspector.HeapSnapshotDataGridNode.prototype.__proto__ = WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype;\n\nWebInspector.HeapSnapshotDataGridList = function(snapshotView, baseEntries, snapshotEntries)\n{\n    this.tree = this;\n    this.snapshotView = snapshotView;\n    this.children = [];\n    this.lastComparator = null;\n    this.populateChildren(baseEntries, snapshotEntries);\n};\n\nWebInspector.HeapSnapshotDataGridList.prototype = {\n    appendChild: function(child)\n    {\n        this.insertChild(child, this.children.length);\n    },\n\n    insertChild: function(child, index)\n    {\n        this.children.splice(index, 0, child);\n    },\n\n    removeChildren: function()\n    {\n        this.children = [];\n    },\n\n    populateChildren: function(baseEntries, snapshotEntries)\n    {\n        function appendListEntry(baseItem, snapshotItem)\n        {\n            this.appendChild(new WebInspector.HeapSnapshotDataGridNode(this.snapshotView, baseItem, snapshotItem, this));\n        }\n        this.produceDiff(baseEntries, snapshotEntries, appendListEntry.bind(this));\n    },\n\n    produceDiff: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.produceDiff,\n    sort: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.sort,\n    getTotalCount: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.getTotalCount,\n    getTotalSize: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.getTotalSize\n};\n\nWebInspector.HeapSnapshotDataGridList.propertyComparators = [{}, {}];\n\nWebInspector.HeapSnapshotDataGridList.propertyComparator = function(property, property2, isAscending)\n{\n    var propertyHash = property + \"#\" + property2;\n    var comparator = this.propertyComparators[(isAscending ? 1 : 0)][propertyHash];\n    if (!comparator) {\n        comparator = function(lhs, rhs) {\n            var l = lhs[property], r = rhs[property];\n            var result = 0;\n            if (l !== null && r !== null) {\n                result = l < r ? -1 : (l > r ? 1 : 0);\n            }\n            if (result !== 0 || property2 === null) {\n                return isAscending ? result : -result;\n            } else {\n                l = lhs[property2];\n                r = rhs[property2];\n                return l < r ? -1 : (l > r ? 1 : 0);\n            }\n        };\n        this.propertyComparators[(isAscending ? 1 : 0)][propertyHash] = comparator;\n    }\n    return comparator;\n};\n\nWebInspector.HeapSnapshotDataGridRetainerNode = function(snapshotView, baseEntry, snapshotEntry, owningTree)\n{\n    this.snapshotView = snapshotView;\n\n    if (!snapshotEntry)\n        snapshotEntry = { constructorName: baseEntry.constructorName, count: 0, clusters: {} };\n    this.constructorName = snapshotEntry.constructorName;\n    this.count = snapshotEntry.count;\n    this.retainers = this._calculateRetainers(this.snapshotView.profile, snapshotEntry.clusters);\n\n    if (!baseEntry)\n        baseEntry = { count: 0, clusters: {} };\n    this.baseCount = baseEntry.count;\n    this.countDelta = this.count - this.baseCount;\n    this.baseRetainers = this._calculateRetainers(this.snapshotView.baseSnapshot, baseEntry.clusters);\n\n    this.size = null;\n    this.sizeDelta = null;\n\n    WebInspector.HeapSnapshotDataGridNodeWithRetainers.call(this, owningTree);\n}\n\nWebInspector.HeapSnapshotDataGridRetainerNode.prototype = {\n    get sizePercent()\n    {\n        return null;\n    },\n\n    get sizeDeltaPercent()\n    {\n        return null;\n    },\n\n    _calculateRetainers: function(snapshot, clusters)\n    {\n        var retainers = {};\n        if (this.isEmptySet(clusters)) {\n            if (this.constructorName in snapshot.entries)\n                return snapshot.entries[this.constructorName].retainers;\n        } else {\n            // In case when an entry is retained by clusters, we need to gather up the list\n            // of retainers by merging retainers of every cluster.\n            // E.g. having such a tree:\n            //   A\n            //     Object:1  10\n            //       X       3\n            //       Y       4\n            //     Object:2  5\n            //       X       6\n            //\n            // will result in a following retainers list: X 9, Y 4.\n            for (var clusterName in clusters) {\n                if (clusterName in snapshot.clusters) {\n                    var clusterRetainers = snapshot.clusters[clusterName].retainers;\n                    for (var clusterRetainer in clusterRetainers) {\n                        var clusterRetainerEntry = clusterRetainers[clusterRetainer];\n                        if (!(clusterRetainer in retainers))\n                            retainers[clusterRetainer] = { constructorName: clusterRetainerEntry.constructorName, count: 0, clusters: {} };\n                        retainers[clusterRetainer].count += clusterRetainerEntry.count;\n                        for (var clusterRetainerCluster in clusterRetainerEntry.clusters)\n                            retainers[clusterRetainer].clusters[clusterRetainerCluster] = true;\n                    }\n                }\n            }\n        }\n        return retainers;\n    }\n};\n\nWebInspector.HeapSnapshotDataGridRetainerNode.prototype.__proto__ = WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype;\n\n\nWebInspector.HeapSnapshotProfileType = function()\n{\n    WebInspector.ProfileType.call(this, WebInspector.HeapSnapshotProfileType.TypeId, WebInspector.UIString(\"HEAP SNAPSHOTS\"));\n}\n\nWebInspector.HeapSnapshotProfileType.TypeId = \"HEAP\";\n\nWebInspector.HeapSnapshotProfileType.prototype = {\n    get buttonTooltip()\n    {\n        return WebInspector.UIString(\"Take heap snapshot.\");\n    },\n\n    get buttonStyle()\n    {\n        return \"heap-snapshot-status-bar-item status-bar-item\";\n    },\n\n    buttonClicked: function()\n    {\n        InspectorBackend.takeHeapSnapshot(false);\n    },\n\n    get welcomeMessage()\n    {\n        return WebInspector.UIString(\"Get a heap snapshot by pressing the %s button on the status bar.\");\n    },\n\n    createSidebarTreeElementForProfile: function(profile)\n    {\n        return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString(\"Snapshot %d\"), \"heap-snapshot-sidebar-tree-item\");\n    },\n\n    createView: function(profile)\n    {\n        return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, profile);\n    }\n}\n\nWebInspector.HeapSnapshotProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/HelpScreen.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.HelpScreen = function(title)\n{\n    this._element = document.createElement(\"div\");\n    this._element.className = \"help-window-outer\";\n    this._element.addEventListener(\"keydown\", this._onKeyDown.bind(this), false);\n\n    var mainWindow = this._element.createChild(\"div\", \"help-window-main\");\n    var captionWindow = mainWindow.createChild(\"div\", \"help-window-caption\");\n    var closeButton = captionWindow.createChild(\"button\", \"help-close-button\");\n    this.contentElement = mainWindow.createChild(\"div\", \"help-content\");\n    this.contentElement.tabIndex = 0;\n    this.contentElement.addEventListener(\"blur\", this._onBlur.bind(this), false);\n    captionWindow.createChild(\"h1\", \"help-window-title\").innerText = title;\n\n    closeButton.innerText = \"\\u2716\"; // Code stands for HEAVY MULTIPLICATION X.\n    closeButton.addEventListener(\"click\", this._hide.bind(this), false);\n    this._closeKeys = [\n        WebInspector.KeyboardShortcut.Keys.Enter.code,\n        WebInspector.KeyboardShortcut.Keys.Esc.code,\n        WebInspector.KeyboardShortcut.Keys.Space.code,\n    ];\n    document.body.appendChild(this._element);\n}\n\nWebInspector.HelpScreen.prototype = {\n    show: function()\n    {\n        if (this._isShown)\n            return;\n\n        this._element.style.visibility = \"visible\";\n        this._isShown = true;\n        this._previousFocusElement = WebInspector.currentFocusElement;\n        WebInspector.currentFocusElement = this.contentElement;\n    },\n\n    _hide: function()\n    {\n        this._isShown = false;\n        this._element.style.visibility = \"hidden\";\n        WebInspector.currentFocusElement = this._previousFocusElement;\n    },\n\n    _onKeyDown: function(event)\n    {\n        if (this._isShown && this._closeKeys.indexOf(event.keyCode) >= 0) {\n            this._hide();\n            event.stopPropagation();\n        }\n    },\n\n    _onBlur: function()\n    {\n         // Pretend we're modal, grab focus back if we're still shown.\n        if (this._isShown)\n            WebInspector.currentFocusElement = this.contentElement;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ImageView.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ImageView = function(resource)\n{\n    WebInspector.ResourceView.call(this, resource);\n\n    this.element.addStyleClass(\"image\");\n}\n\nWebInspector.ImageView.prototype = {\n    hasContent: function()\n    {\n        return true;\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.ResourceView.prototype.show.call(this, parentElement);\n        this._createContentIfNeeded();\n    },\n\n    _createContentIfNeeded: function()\n    {\n        if (this._container)\n            return;\n\n        var imageContainer = document.createElement(\"div\");\n        imageContainer.className = \"image\";\n        this.element.appendChild(imageContainer);\n\n        var imagePreviewElement = document.createElement(\"img\");\n        imagePreviewElement.addStyleClass(\"resource-image-view\");\n        imageContainer.appendChild(imagePreviewElement);\n\n        this._container = document.createElement(\"div\");\n        this._container.className = \"info\";\n        this.element.appendChild(this._container);\n\n        var imageNameElement = document.createElement(\"h1\");\n        imageNameElement.className = \"title\";\n        imageNameElement.textContent = this.resource.displayName;\n        this._container.appendChild(imageNameElement);\n\n        var infoListElement = document.createElement(\"dl\");\n        infoListElement.className = \"infoList\";\n\n        this.resource.populateImageSource(imagePreviewElement);\n\n        function onImageLoad()\n        {\n            var content = this.resource.content;\n            if (content)\n                var resourceSize = this._base64ToSize(content);\n            else\n                var resourceSize = this.resource.resourceSize;\n\n            var imageProperties = [\n                { name: WebInspector.UIString(\"Dimensions\"), value: WebInspector.UIString(\"%d × %d\", imagePreviewElement.naturalWidth, imagePreviewElement.naturalHeight) },\n                { name: WebInspector.UIString(\"File size\"), value: Number.bytesToString(resourceSize) },\n                { name: WebInspector.UIString(\"MIME type\"), value: this.resource.mimeType }\n            ];\n    \n            infoListElement.removeChildren();\n            for (var i = 0; i < imageProperties.length; ++i) {\n                var dt = document.createElement(\"dt\");\n                dt.textContent = imageProperties[i].name;\n                infoListElement.appendChild(dt);\n                var dd = document.createElement(\"dd\");\n                dd.textContent = imageProperties[i].value;\n                infoListElement.appendChild(dd);\n            }\n            var dt = document.createElement(\"dt\");\n            dt.textContent = WebInspector.UIString(\"URL\");\n            infoListElement.appendChild(dt);\n            var dd = document.createElement(\"dd\");\n            dd.appendChild(WebInspector.linkifyURLAsNode(this.resource.url));\n            infoListElement.appendChild(dd);\n\n            this._container.appendChild(infoListElement);\n        }\n        imagePreviewElement.addEventListener(\"load\", onImageLoad.bind(this), false);\n    },\n\n    _base64ToSize: function(content)\n    {\n        if (!content.length)\n            return 0;\n        var size = (content.length || 0) * 3 / 4;\n        if (content.length > 0 && content[content.length - 1] === \"=\")\n            size--;\n        if (content.length > 1 && content[content.length - 2] === \"=\")\n            size--;\n        return size;\n    }\n}\n\nWebInspector.ImageView.prototype.__proto__ = WebInspector.ResourceView.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/InjectedFakeWorker.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar InjectedFakeWorker = function(InjectedScriptHost, inspectedWindow, injectedScriptId)\n{\n\nWorker = function(url)\n{\n    var impl = new FakeWorker(this, url);\n    if (impl === null)\n        return null;\n\n    this.isFake = true;\n    this.postMessage = bind(impl.postMessage, impl);\n    this.terminate = bind(impl.terminate, impl);\n\n    function onmessageGetter()\n    {\n        return impl.channel.port1.onmessage;\n    }\n    function onmessageSetter(callback)\n    {\n        impl.channel.port1.onmessage = callback;\n    }\n    this.__defineGetter__(\"onmessage\", onmessageGetter);\n    this.__defineSetter__(\"onmessage\", onmessageSetter);\n    this.addEventListener = bind(impl.channel.port1.addEventListener, impl.channel.port1);\n    this.removeEventListener = bind(impl.channel.port1.removeEventListener, impl.channel.port1);\n    this.dispatchEvent = bind(impl.channel.port1.dispatchEvent, impl.channel.port1);\n}\n\nfunction FakeWorker(worker, url)\n{\n    var scriptURL = this._expandURLAndCheckOrigin(document.baseURI, location.href, url);\n\n    this._worker = worker;\n    this._id = InjectedScriptHost.nextWorkerId();\n    this.channel = new MessageChannel();\n    this._listeners = [];\n    this._buildWorker(scriptURL);\n\n    InjectedScriptHost.didCreateWorker(this._id, scriptURL.url, false);\n}\n\nFakeWorker.prototype = {\n    postMessage: function(msg, opt_ports)\n    {\n        if (this._frame != null)\n            this.channel.port1.postMessage.apply(this.channel.port1, arguments);\n        else if (this._pendingMessages)\n            this._pendingMessages.push(arguments)\n        else\n            this._pendingMessages = [ arguments ];\n    },\n\n    terminate: function()\n    {\n        InjectedScriptHost.didDestroyWorker(this._id);\n\n        this.channel.port1.close();\n        this.channel.port2.close();\n        if (this._frame != null)\n            this._frame.frameElement.parentNode.removeChild(this._frame.frameElement);\n        this._frame = null;\n        this._worker = null; // Break reference loop.\n    },\n\n    _buildWorker: function(url)\n    {\n        var code = this._loadScript(url.url);\n        var iframeElement = document.createElement(\"iframe\");\n        iframeElement.style.display = \"none\";\n\n        this._document = document;\n        iframeElement.onload = bind(this._onWorkerFrameLoaded, this, iframeElement, url, code);\n\n        if (document.body)\n            this._attachWorkerFrameToDocument(iframeElement, url, code);\n        else\n            window.addEventListener(\"load\", bind(this._attachWorkerFrameToDocument, this, iframeElement), false);\n    },\n\n    _attachWorkerFrameToDocument: function(iframeElement)\n    {\n        document.body.appendChild(iframeElement);\n    },\n\n    _onWorkerFrameLoaded: function(iframeElement, url, code)\n    {\n        var frame = iframeElement.contentWindow;\n        this._frame = frame;\n        this._setupWorkerContext(frame, url);\n\n        var frameContents = '(function() { var location = __devtools.location; var window; ' + code + '})();\\n' + '//@ sourceURL=' + url.url;\n\n        frame.eval(frameContents);\n        if (this._pendingMessages) {\n            for (var msg = 0; msg < this._pendingMessages.length; ++msg)\n                this.postMessage.apply(this, this._pendingMessages[msg]);\n            delete this._pendingMessages;\n        }\n    },\n\n    _setupWorkerContext: function(workerFrame, url)\n    {\n        workerFrame.__devtools = {\n            handleException: bind(this._handleException, this),\n            location: url.mockLocation()\n        };\n\n        var self = this;\n\n        function onmessageGetter()\n        {\n            return self.channel.port2.onmessage ? self.channel.port2.onmessage.originalCallback : null;\n        }\n\n        function onmessageSetter(callback)\n        {\n            var wrappedCallback = bind(self._callbackWrapper, self, callback);\n            wrappedCallback.originalCallback = callback;\n            self.channel.port2.onmessage = wrappedCallback;\n        }\n\n        workerFrame.__defineGetter__(\"onmessage\", onmessageGetter);\n        workerFrame.__defineSetter__(\"onmessage\", onmessageSetter);\n        workerFrame.addEventListener = bind(this._addEventListener, this);\n        workerFrame.removeEventListener = bind(this._removeEventListener, this);\n        workerFrame.dispatchEvent = bind(this.channel.port2.dispatchEvent, this.channel.port2);\n        workerFrame.postMessage = bind(this.channel.port2.postMessage, this.channel.port2);\n        workerFrame.importScripts = bind(this._importScripts, this, workerFrame);\n        workerFrame.close = bind(this.terminate, this);\n    },\n\n    _addEventListener: function(type, callback, useCapture)\n    {\n        var wrappedCallback = bind(this._callbackWrapper, this, callback);\n        wrappedCallback.originalCallback = callback;\n        wrappedCallback.type = type;\n        wrappedCallback.useCapture = Boolean(useCapture);\n\n        this.channel.port2.addEventListener(type, wrappedCallback, useCapture);\n        this._listeners.push(wrappedCallback);\n    },\n\n    _removeEventListener: function(type, callback, useCapture)\n    {\n        var listeners = this._listeners;\n        for (var i = 0; i < listeners.length; ++i) {\n            if (listeners[i].originalCallback === callback &&\n                listeners[i].type === type && \n                listeners[i].useCapture === Boolean(useCapture)) {\n                this.channel.port2.removeEventListener(type, listeners[i], useCapture);\n                listeners[i] = listeners[listeners.length - 1];\n                listeners.pop();\n                break;\n            }\n        }\n    },\n\n    _callbackWrapper: function(callback, msg)\n    {\n        // Shortcut -- if no exception handlers installed, avoid try/catch so as not to obscure line number.\n        if (!this._frame.onerror && !this._worker.onerror) {\n            callback(msg);\n            return;\n        }\n\n        try {\n            callback(msg);\n        } catch (e) {\n            this._handleException(e, this._frame.onerror, this._worker.onerror);\n        }\n    },\n\n    _handleException: function(e)\n    {\n        // NB: it should be an ErrorEvent, but creating it from script is not\n        // currently supported, so emulate it on top of plain vanilla Event.\n        var errorEvent = this._document.createEvent(\"Event\");\n        errorEvent.initEvent(\"Event\", false, false);\n        errorEvent.message = \"Uncaught exception\";\n\n        for (var i = 1; i < arguments.length; ++i) {\n            if (arguments[i] && arguments[i](errorEvent))\n                return;\n        }\n\n        throw e;\n    },\n\n    _importScripts: function(targetFrame)\n    {\n        for (var i = 1; i < arguments.length; ++i) {\n            var workerOrigin = targetFrame.__devtools.location.href;\n            var url = this._expandURLAndCheckOrigin(workerOrigin, workerOrigin, arguments[i]);\n            targetFrame.eval(this._loadScript(url.url) + \"\\n//@ sourceURL= \" + url.url);\n        }\n    },\n\n    _loadScript: function(url)\n    {\n        var xhr = new XMLHttpRequest();\n        xhr.open(\"GET\", url, false);\n        xhr.send(null);\n\n        var text = xhr.responseText;\n        if (xhr.status != 0 && xhr.status/100 !== 2) { // We're getting status === 0 when using file://.\n            console.error(\"Failed to load worker: \" + url + \"[\" + xhr.status + \"]\");\n            text = \"\"; // We've got error message, not worker code.\n        }\n        return text;\n    },\n\n    _expandURLAndCheckOrigin: function(baseURL, origin, url)\n    {\n        var scriptURL = new URL(baseURL).completeWith(url);\n\n        if (!scriptURL.sameOrigin(origin))\n            throw new DOMCoreException(\"SECURITY_ERR\",18);\n        return scriptURL;\n    }\n};\n\nfunction URL(url)\n{\n    this.url = url;\n    this.split();\n}\n\nURL.prototype = {\n    urlRegEx: (/^(http[s]?|file):\\/\\/([^\\/:]*)(:[\\d]+)?(?:(\\/[^#?]*)(\\?[^#]*)?(?:#(.*))?)?$/i),\n\n    split: function()\n    {\n        function emptyIfNull(str)\n        {\n            return str == null ? \"\" : str;\n        }\n        var parts = this.urlRegEx.exec(this.url);\n\n        this.schema = parts[1];\n        this.host = parts[2];\n        this.port = emptyIfNull(parts[3]);\n        this.path = emptyIfNull(parts[4]);\n        this.query = emptyIfNull(parts[5]);\n        this.fragment = emptyIfNull(parts[6]);\n    },\n\n    mockLocation: function()\n    {\n        var host = this.host.replace(/^[^@]*@/, \"\");\n\n        return {\n            href:     this.url,\n            protocol: this.schema + \":\",\n            host:     host,\n            hostname: host,\n            port:     this.port,\n            pathname: this.path,\n            search:   this.query,\n            hash:     this.fragment\n        };\n    },\n\n    completeWith: function(url)\n    {\n        if (url === \"\" || /^[^/]*:/.exec(url)) // If given absolute url, return as is now.\n            return new URL(url);\n\n        var relParts = /^([^#?]*)(.*)$/.exec(url); // => [ url, path, query-andor-fragment ]\n\n        var path = (relParts[1].slice(0, 1) === \"/\" ? \"\" : this.path.replace(/[^/]*$/, \"\")) + relParts[1];\n        path = path.replace(/(\\/\\.)+(\\/|$)/g, \"/\").replace(/[^/]*\\/\\.\\.(\\/|$)/g, \"\");\n\n        return new URL(this.schema + \"://\" + this.host + this.port + path + relParts[2]);\n    },\n\n    sameOrigin: function(url)\n    {\n        function normalizePort(schema, port)\n        {\n            var portNo = port.slice(1);\n            return (schema === \"https\" && portNo == 443 || schema === \"http\" && portNo == 80) ? \"\" : port;\n        }\n\n        var other = new URL(url);\n\n        return this.schema === other.schema &&\n            this.host === other.host &&\n            normalizePort(this.schema, this.port) === normalizePort(other.schema, other.port);\n    }\n};\n\nfunction DOMCoreException(name, code)\n{\n    function formatError()\n    {\n        return \"Error: \" + this.message;\n    }\n\n    this.name = name;\n    this.message = name + \": DOM Exception \" + code;\n    this.code = code;\n    this.toString = bind(formatError, this);\n}\n\nfunction bind(func, thisObject)\n{\n    var args = Array.prototype.slice.call(arguments, 2);\n    return function() { return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0))); };\n}\n\nfunction noop()\n{\n}\n\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/InspectorBackendStub.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n(function() {\n    var InspectorBackendImpl = modjewel.require(\"weinre/client/InspectorBackendImpl\")\n    window.InspectorBackend = new InspectorBackendImpl()\n})()\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/InspectorBackendStub.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource prefix=\"/webkit/inspector\">\n    <file>InspectorBackendStub.js</file>\n</qresource>\n</RCC>\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/InspectorFrontendHostStub.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n(function() {\n    var InspectorFrontEndHostImpl = modjewel.require(\"weinre/client/InspectorFrontendHostImpl\")\n    window.InspectorFrontendHost = new InspectorFrontEndHostImpl()\n})()\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/KeyboardShortcut.js",
    "content": "/*\n * Copyright (C) 2009 Apple Inc. All rights reserved.\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.KeyboardShortcut = function()\n{\n};\n\n/**\n * Constants for encoding modifier key set as a bit mask.\n * @see #_makeKeyFromCodeAndModifiers\n */\nWebInspector.KeyboardShortcut.Modifiers = {\n    None: 0,   // Constant for empty modifiers set.\n    Shift: 1,\n    Ctrl: 2,\n    Alt: 4,\n    Meta: 8,   // Command key on Mac, Win key on other platforms.\n    get CtrlOrMeta()\n    {\n        // \"default\" command/ctrl key for platform, Command on Mac, Ctrl on other platforms\n        return WebInspector.isMac() ? this.Meta : this.Ctrl;\n    }\n};\n\nWebInspector.KeyboardShortcut.Keys = {\n    Backspace: { code: 8, name: \"\\u21a4\" },\n    Tab: { code: 9, name: { mac: \"\\u21e5\", other: \"<Tab>\" } },\n    Enter: { code: 13, name: { mac: \"\\u21a9\", other: \"<Enter>\" } },\n    Esc: { code: 27, name: { mac: \"\\u238b\", other: \"<Esc>\" } },\n    Space: { code: 32, name: \"<Space>\" },\n    PageUp: { code: 33,  name: { mac: \"\\u21de\", other: \"<PageUp>\" } },      // also NUM_NORTH_EAST\n    PageDown: { code: 34, name: { mac: \"\\u21df\", other: \"<PageDown>\" } },   // also NUM_SOUTH_EAST\n    End: { code: 35, name: { mac: \"\\u2197\", other: \"<End>\" } },             // also NUM_SOUTH_WEST\n    Home: { code: 36, name: { mac: \"\\u2196\", other: \"<Home>\" } },           // also NUM_NORTH_WEST\n    Left: { code: 37, name: \"\\u2190\" },           // also NUM_WEST\n    Up: { code: 38, name: \"\\u2191\" },             // also NUM_NORTH\n    Right: { code: 39, name: \"\\u2192\" },          // also NUM_EAST\n    Down: { code: 40, name: \"\\u2193\" },           // also NUM_SOUTH\n    Delete: { code: 46, name: \"<Del>\" },\n    Zero: { code: 48, name: \"0\" },\n    F1: { code: 112, name: \"F1\" },\n    F2: { code: 113, name: \"F2\" },\n    F3: { code: 114, name: \"F3\" },\n    F4: { code: 115, name: \"F4\" },\n    F5: { code: 116, name: \"F5\" },\n    F6: { code: 117, name: \"F6\" },\n    F7: { code: 118, name: \"F7\" },\n    F8: { code: 119, name: \"F8\" },\n    F9: { code: 120, name: \"F9\" },\n    F10: { code: 121, name: \"F10\" },\n    F11: { code: 122, name: \"F11\" },\n    F12: { code: 123, name: \"F12\" },\n    Semicolon: { code: 186, name: \";\" },\n    Plus: { code: 187, name: \"+\" },\n    Comma: { code: 188, name: \",\" },\n    Minus: { code: 189, name: \"-\" },\n    Period: { code: 190, name: \".\" },\n    Slash: { code: 191, name: \"/\" },\n    Apostrophe: { code: 192, name: \"`\" },\n    SingleQuote: { code: 222, name: \"\\'\" }\n};\n\n/**\n * Creates a number encoding keyCode in the lower 8 bits and modifiers mask in the higher 8 bits.\n * It is useful for matching pressed keys.\n * keyCode is the Code of the key, or a character \"a-z\" which is converted to a keyCode value.\n * optModifiers is an Optional list of modifiers passed as additional paramerters.\n */\nWebInspector.KeyboardShortcut.makeKey = function(keyCode, optModifiers)\n{\n    if (typeof keyCode === \"string\")\n        keyCode = keyCode.charCodeAt(0) - 32;\n    var modifiers = WebInspector.KeyboardShortcut.Modifiers.None;\n    for (var i = 1; i < arguments.length; i++)\n        modifiers |= arguments[i];\n    return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode, modifiers);\n};\n\nWebInspector.KeyboardShortcut.makeKeyFromEvent = function(keyboardEvent)\n{\n    var modifiers = WebInspector.KeyboardShortcut.Modifiers.None;\n    if (keyboardEvent.shiftKey)\n        modifiers |= WebInspector.KeyboardShortcut.Modifiers.Shift;\n    if (keyboardEvent.ctrlKey)\n        modifiers |= WebInspector.KeyboardShortcut.Modifiers.Ctrl;\n    if (keyboardEvent.altKey)\n        modifiers |= WebInspector.KeyboardShortcut.Modifiers.Alt;\n    if (keyboardEvent.metaKey)\n        modifiers |= WebInspector.KeyboardShortcut.Modifiers.Meta;\n    return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyboardEvent.keyCode, modifiers);\n};\n\nWebInspector.KeyboardShortcut.makeDescriptor = function(key, optModifiers)\n{\n    var modifiers = 0;\n    for (var i = 1; i < arguments.length; i++)\n        modifiers |= arguments[i];\n\n    return {\n        key: WebInspector.KeyboardShortcut.makeKey(typeof key === \"string\" ? key : key.code, modifiers),\n        name: WebInspector.KeyboardShortcut.shortcutToString(key, modifiers)\n    };\n}\n\nWebInspector.KeyboardShortcut.shortcutToString = function(key, modifiers)\n{\n    return WebInspector.KeyboardShortcut._modifiersToString(modifiers) + WebInspector.KeyboardShortcut._keyName(key);\n}\n\nWebInspector.KeyboardShortcut._keyName = function(key)\n{\n    if (typeof key === \"string\")\n        return key.toUpperCase();\n    if (typeof key.name === \"string\")\n        return key.name;\n    return key.name[WebInspector.platform] || key.name.other;\n}\n\nWebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers = function(keyCode, modifiers)\n{\n    return (keyCode & 255) | (modifiers << 8);\n};\n\nWebInspector.KeyboardShortcut._modifiersToString = function(modifiers)\n{\n    var cmdKey = \"\\u2318\";\n    var optKey = \"\\u2325\";\n    var shiftKey = \"\\u21e7\";\n    var ctrlKey = \"\\u2303\";\n\n    var isMac = WebInspector.isMac();\n    var res = \"\";\n    if (modifiers & WebInspector.KeyboardShortcut.Modifiers.Ctrl)\n        res += isMac ? ctrlKey : \"<Ctrl> + \";\n    if (modifiers & WebInspector.KeyboardShortcut.Modifiers.Alt)\n        res += isMac ? optKey : \"<Alt> + \";\n    if (modifiers & WebInspector.KeyboardShortcut.Modifiers.Shift)\n        res += isMac ? shiftKey : \"<Shift> + \";\n    if (modifiers & WebInspector.KeyboardShortcut.Modifiers.Meta)\n        res += isMac ? cmdKey : \"<Win> + \";\n\n    return res;\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/MetricsSidebarPane.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.MetricsSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Metrics\"));\n    this._inlineStyleId = null;\n}\n\nWebInspector.MetricsSidebarPane.prototype = {\n    update: function(node)\n    {\n        if (node)\n            this.node = node;\n        else\n            node = this.node;\n\n        if (!node || !node.ownerDocument.defaultView || node.nodeType !== Node.ELEMENT_NODE) {\n            this.bodyElement.removeChildren();\n            return;\n        }\n\n        var self = this;\n        var callback = function(style) {\n            if (!style)\n                return;\n            self._update(style);\n        };\n        WebInspector.cssModel.getComputedStyleAsync(node.id, callback);\n\n        var inlineStyleCallback = function(style) {\n            if (!style)\n                return;\n            self.inlineStyle = style;\n        };\n        WebInspector.cssModel.getInlineStyleAsync(node.id, inlineStyleCallback);\n    },\n\n    _update: function(style)\n    {\n        // Updating with computed style.\n        var metricsElement = document.createElement(\"div\");\n        metricsElement.className = \"metrics\";\n\n        function createBoxPartElement(style, name, side, suffix)\n        {\n            var propertyName = (name !== \"position\" ? name + \"-\" : \"\") + side + suffix;\n            var value = style.getPropertyValue(propertyName);\n            if (value === \"\" || (name !== \"position\" && value === \"0px\"))\n                value = \"\\u2012\";\n            else if (name === \"position\" && value === \"auto\")\n                value = \"\\u2012\";\n            value = value.replace(/px$/, \"\");\n\n            var element = document.createElement(\"div\");\n            element.className = side;\n            element.textContent = value;\n            element.addEventListener(\"dblclick\", this.startEditing.bind(this, element, name, propertyName), false);\n            return element;\n        }\n\n        // Display types for which margin is ignored.\n        var noMarginDisplayType = {\n            \"table-cell\": true,\n            \"table-column\": true,\n            \"table-column-group\": true,\n            \"table-footer-group\": true,\n            \"table-header-group\": true,\n            \"table-row\": true,\n            \"table-row-group\": true\n        };\n\n        // Display types for which padding is ignored.\n        var noPaddingDisplayType = {\n            \"table-column\": true,\n            \"table-column-group\": true,\n            \"table-footer-group\": true,\n            \"table-header-group\": true,\n            \"table-row\": true,\n            \"table-row-group\": true\n        };\n\n        // Position types for which top, left, bottom and right are ignored.\n        var noPositionType = {\n            \"static\": true\n        };\n\n        var boxes = [\"content\", \"padding\", \"border\", \"margin\", \"position\"];\n        var boxLabels = [WebInspector.UIString(\"content\"), WebInspector.UIString(\"padding\"), WebInspector.UIString(\"border\"), WebInspector.UIString(\"margin\"), WebInspector.UIString(\"position\")];\n        var previousBox;\n        for (var i = 0; i < boxes.length; ++i) {\n            var name = boxes[i];\n\n            if (name === \"margin\" && noMarginDisplayType[style.getPropertyValue(\"display\")])\n                continue;\n            if (name === \"padding\" && noPaddingDisplayType[style.getPropertyValue(\"display\")])\n                continue;\n            if (name === \"position\" && noPositionType[style.getPropertyValue(\"position\")])\n                continue;\n\n            var boxElement = document.createElement(\"div\");\n            boxElement.className = name;\n\n            if (name === \"content\") {\n                var width = style.getPropertyValue(\"width\").replace(/px$/, \"\");\n                var widthElement = document.createElement(\"span\");\n                widthElement.textContent = width;\n                widthElement.addEventListener(\"dblclick\", this.startEditing.bind(this, widthElement, \"width\", \"width\"), false);\n\n                var height = style.getPropertyValue(\"height\").replace(/px$/, \"\");\n                var heightElement = document.createElement(\"span\");\n                heightElement.textContent = height;\n                heightElement.addEventListener(\"dblclick\", this.startEditing.bind(this, heightElement, \"height\", \"height\"), false);\n\n                boxElement.appendChild(widthElement);\n                boxElement.appendChild(document.createTextNode(\" \\u00D7 \"));\n                boxElement.appendChild(heightElement);\n            } else {\n                var suffix = (name === \"border\" ? \"-width\" : \"\");\n\n                var labelElement = document.createElement(\"div\");\n                labelElement.className = \"label\";\n                labelElement.textContent = boxLabels[i];\n                boxElement.appendChild(labelElement);\n\n                boxElement.appendChild(createBoxPartElement.call(this, style, name, \"top\", suffix));\n                boxElement.appendChild(document.createElement(\"br\"));\n                boxElement.appendChild(createBoxPartElement.call(this, style, name, \"left\", suffix));\n\n                if (previousBox)\n                    boxElement.appendChild(previousBox);\n\n                boxElement.appendChild(createBoxPartElement.call(this, style, name, \"right\", suffix));\n                boxElement.appendChild(document.createElement(\"br\"));\n                boxElement.appendChild(createBoxPartElement.call(this, style, name, \"bottom\", suffix));\n            }\n\n            previousBox = boxElement;\n        }\n\n        metricsElement.appendChild(previousBox);\n        this.bodyElement.removeChildren();\n        this.bodyElement.appendChild(metricsElement);\n    },\n\n    startEditing: function(targetElement, box, styleProperty)\n    {\n        if (WebInspector.isBeingEdited(targetElement))\n            return;\n\n        var context = { box: box, styleProperty: styleProperty };\n\n        WebInspector.startEditing(targetElement, {\n            context: context,\n            commitHandler: this.editingCommitted.bind(this),\n            cancelHandler: this.editingCancelled.bind(this)\n        });\n    },\n\n    editingCancelled: function(element, context)\n    {\n        this.update();\n    },\n\n    editingCommitted: function(element, userInput, previousContent, context)\n    {\n        if (!this.inlineStyle) {\n            // Element has no renderer.\n            return this.editingCancelled(element, context); // nothing changed, so cancel\n        }\n\n        if (userInput === previousContent)\n            return this.editingCancelled(element, context); // nothing changed, so cancel\n\n        if (context.box !== \"position\" && (!userInput || userInput === \"\\u2012\"))\n            userInput = \"0px\";\n        else if (context.box === \"position\" && (!userInput || userInput === \"\\u2012\"))\n            userInput = \"auto\";\n\n        // Append a \"px\" unit if the user input was just a number.\n        if (/^\\d+$/.test(userInput))\n            userInput += \"px\";\n\n        var self = this;\n        var callback = function(style) {\n            if (!style)\n                return;\n            self.inlineStyle = style;\n            self.dispatchEventToListeners(\"metrics edited\");\n            self.update();\n        };\n\n        function setEnabledValueCallback(context, style)\n        {\n            var property = style.getLiveProperty(context.styleProperty);\n            if (!property)\n                style.appendProperty(context.styleProperty, userInput, callback);\n             else\n                property.setValue(userInput, callback);\n        }\n\n        var allProperties = this.inlineStyle.allProperties;\n        for (var i = 0; i < allProperties.length; ++i) {\n            var property = allProperties[i];\n            if (property.name !== context.styleProperty || property.inactive)\n                continue;\n            if (property.disabled)\n                property.setDisabled(false, setEnabledValueCallback.bind(null, context));\n            else\n                property.setValue(userInput, callback);\n            return;\n        }\n\n        this.inlineStyle.appendProperty(context.styleProperty, userInput, callback);\n    }\n}\n\nWebInspector.MetricsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/NetworkItemView.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.NetworkItemView = function(resource)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"network-item-view\");\n\n    this._headersView = new WebInspector.ResourceHeadersView(resource);\n    // Do not store reference to content view - it can be recreated.\n    var contentView = WebInspector.ResourceView.resourceViewForResource(resource);\n\n    this._tabbedPane = new WebInspector.TabbedPane(this.element);\n    this._tabbedPane.appendTab(\"headers\", WebInspector.UIString(\"Headers\"), this._headersView);\n    if (contentView.hasContent()) {\n        // Reusing this view, so hide it at first.\n        contentView.visible = false;\n        this._tabbedPane.appendTab(\"content\", WebInspector.UIString(\"Content\"), contentView);\n    }\n    if (Preferences.showCookiesTab) {\n        this._cookiesView = new WebInspector.ResourceCookiesView(resource);\n        this._tabbedPane.appendTab(\"cookies\", WebInspector.UIString(\"Cookies\"), this._cookiesView);\n    }\n    if (Preferences.showTimingTab) {\n        var timingView = new WebInspector.ResourceTimingView(resource);\n        this._tabbedPane.appendTab(\"timing\", WebInspector.UIString(\"Timing\"), timingView);\n    }\n\n    this._tabbedPane.addEventListener(\"tab-selected\", this._tabSelected, this);\n}\n\nWebInspector.NetworkItemView.prototype = {\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this._selectTab();\n    },\n\n    _selectTab: function(tabId)\n    {\n        if (!tabId)\n            tabId = WebInspector.settings.resourceViewTab;\n\n        if (!this._tabbedPane.selectTab(tabId)) {\n            this._isInFallbackSelection = true;\n            this._tabbedPane.selectTab(\"headers\");\n            delete this._isInFallbackSelection;\n        }\n    },\n\n    _tabSelected: function(event)\n    {\n        WebInspector.settings.resourceViewTab = event.data.tabId;\n    },\n\n    resize: function()\n    {\n        if (this._cookiesView && this._cookiesView.visible)\n            this._cookiesView.resize();\n    }\n}\n\nWebInspector.NetworkItemView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/NetworkManager.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.NetworkManager = function(resourceTreeModel)\n{\n    WebInspector.Object.call(this);\n    this._resourceTreeModel = resourceTreeModel;\n    this._dispatcher = new WebInspector.NetworkDispatcher(resourceTreeModel, this);\n    InspectorBackend.cachedResources(this._processCachedResources.bind(this));\n}\n\nWebInspector.NetworkManager.EventTypes = {\n    ResourceStarted: \"ResourceStarted\",\n    ResourceUpdated: \"ResourceUpdated\",\n    ResourceFinished: \"ResourceFinished\",\n    MainResourceCommitLoad: \"MainResourceCommitLoad\"\n}\n\nWebInspector.NetworkManager.prototype = {\n    reset: function()\n    {\n        WebInspector.panels.network.clear();\n        this._resourceTreeModel.reset();\n        InspectorBackend.cachedResources(this._processCachedResources.bind(this));\n    },\n\n    requestContent: function(resource, base64Encode, callback)\n    {\n        function callbackWrapper(success, content)\n        {\n            callback(success ? content : null);\n        }\n        InspectorBackend.resourceContent(resource.loader.frameId, resource.url, base64Encode, callbackWrapper);\n    },\n\n    _processCachedResources: function(mainFramePayload)\n    {\n        var mainResource = this._dispatcher._addFramesRecursively(mainFramePayload);\n        WebInspector.mainResource = mainResource;\n        mainResource.isMainResource = true;\n    },\n\n    inflightResourceForURL: function(url)\n    {\n        return this._dispatcher._inflightResourcesByURL[url];\n    }\n}\n\nWebInspector.NetworkManager.prototype.__proto__ = WebInspector.Object.prototype;\n\nWebInspector.NetworkDispatcher = function(resourceTreeModel, manager)\n{\n    this._manager = manager;\n    this._inflightResourcesById = {};\n    this._inflightResourcesByURL = {};\n    this._resourceTreeModel = resourceTreeModel;\n    this._lastIdentifierForCachedResource = 0;\n    InspectorBackend.registerDomainDispatcher(\"Network\", this);\n}\n\nWebInspector.NetworkDispatcher.prototype = {\n    _updateResourceWithRequest: function(resource, request)\n    {\n        resource.requestMethod = request.httpMethod;\n        resource.requestHeaders = request.httpHeaderFields;\n        resource.requestFormData = request.requestFormData;\n    },\n\n    _updateResourceWithResponse: function(resource, response)\n    {\n        if (resource.isNull)\n            return;\n\n        resource.mimeType = response.mimeType;\n        resource.expectedContentLength = response.expectedContentLength;\n        resource.textEncodingName = response.textEncodingName;\n        resource.suggestedFilename = response.suggestedFilename;\n        resource.statusCode = response.httpStatusCode;\n        resource.statusText = response.httpStatusText;\n\n        resource.responseHeaders = response.httpHeaderFields;\n        resource.connectionReused = response.connectionReused;\n        resource.connectionID = response.connectionID;\n\n        if (response.wasCached)\n            resource.cached = true;\n        else\n            resource.timing = response.timing;\n\n        if (response.loadInfo) {\n            if (response.loadInfo.httpStatusCode)\n                resource.statusCode = response.loadInfo.httpStatusCode;\n            if (response.loadInfo.httpStatusText)\n                resource.statusText = response.loadInfo.httpStatusText;\n            resource.requestHeaders = response.loadInfo.requestHeaders;\n            resource.responseHeaders = response.loadInfo.responseHeaders;\n        }\n    },\n\n    _updateResourceWithCachedResource: function(resource, cachedResource)\n    {\n        resource.type = WebInspector.Resource.Type[cachedResource.type];\n        resource.resourceSize = cachedResource.encodedSize;\n        this._updateResourceWithResponse(resource, cachedResource.response);\n    },\n\n    identifierForInitialRequest: function(identifier, url, loader, callStack)\n    {\n        this._startResource(this._createResource(identifier, url, loader, callStack));\n    },\n\n    willSendRequest: function(identifier, time, request, redirectResponse)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        // Redirect may have empty URL and we'd like to not crash with invalid HashMap entry.\n        // See http/tests/misc/will-send-request-returns-null-on-redirect.html\n        var isRedirect = !redirectResponse.isNull && request.url.length;\n        if (isRedirect) {\n            this.didReceiveResponse(identifier, time, \"Other\", redirectResponse);\n            resource = this._appendRedirect(resource.identifier, time, request.url);\n        }\n\n        this._updateResourceWithRequest(resource, request);\n        resource.startTime = time;\n\n        if (isRedirect)\n            this._startResource(resource);\n        else\n            this._updateResource(resource);\n    },\n\n    markResourceAsCached: function(identifier)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        resource.cached = true;\n        this._updateResource(resource);\n    },\n\n    didReceiveResponse: function(identifier, time, resourceType, response)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        resource.responseReceivedTime = time;\n        resource.type = WebInspector.Resource.Type[resourceType];\n\n        this._updateResourceWithResponse(resource, response);\n\n        this._updateResource(resource);\n        this._resourceTreeModel.addResourceToFrame(resource.loader.frameId, resource);\n    },\n\n    didReceiveContentLength: function(identifier, time, lengthReceived)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        resource.resourceSize += lengthReceived;\n        resource.endTime = time;\n\n        this._updateResource(resource);\n    },\n\n    didFinishLoading: function(identifier, finishTime)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        this._finishResource(resource, finishTime);\n    },\n\n    didFailLoading: function(identifier, time, localizedDescription)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        resource.failed = true;\n        resource.localizedFailDescription = localizedDescription;\n        this._finishResource(resource, time);\n    },\n\n    didLoadResourceFromMemoryCache: function(time, cachedResource)\n    {\n        var resource = this._createResource(\"cached:\" + ++this._lastIdentifierForCachedResource, cachedResource.url, cachedResource.loader);\n        this._updateResourceWithCachedResource(resource, cachedResource);\n        resource.cached = true;\n        resource.requestMethod = \"GET\";\n        this._startResource(resource);\n        resource.startTime = resource.responseReceivedTime = time;\n        this._finishResource(resource, time);\n        this._resourceTreeModel.addResourceToFrame(resource.loader.frameId, resource);\n    },\n\n    frameDetachedFromParent: function(frameId)\n    {\n        this._resourceTreeModel.frameDetachedFromParent(frameId);\n    },\n\n    setInitialContent: function(identifier, sourceString, type)\n    {\n        var resource = WebInspector.networkResourceById(identifier);\n        if (!resource)\n            return;\n\n        resource.type = WebInspector.Resource.Type[type];\n        resource.setInitialContent(sourceString);\n        this._updateResource(resource);\n    },\n\n    didCommitLoadForFrame: function(frame, loader)\n    {\n        this._resourceTreeModel.didCommitLoadForFrame(frame, loader);\n        if (!frame.parentId) {\n            var mainResource = this._resourceTreeModel.resourceForURL(frame.url);\n            if (mainResource) {\n                WebInspector.mainResource = mainResource;\n                mainResource.isMainResource = true;\n                this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.MainResourceCommitLoad, mainResource);\n            }\n        }\n    },\n\n    didCreateWebSocket: function(identifier, requestURL)\n    {\n        var resource = this._createResource(identifier, requestURL);\n        resource.type = WebInspector.Resource.Type.WebSocket;\n        this._startResource(resource);\n    },\n\n    willSendWebSocketHandshakeRequest: function(identifier, time, request)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        resource.requestMethod = \"GET\";\n        resource.requestHeaders = request.webSocketHeaderFields;\n        resource.webSocketRequestKey3 = request.webSocketRequestKey3;\n        resource.startTime = time;\n\n        this._updateResource(resource);\n    },\n\n    didReceiveWebSocketHandshakeResponse: function(identifier, time, response)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n\n        resource.statusCode = response.statusCode;\n        resource.statusText = response.statusText;\n        resource.responseHeaders = response.webSocketHeaderFields;\n        resource.webSocketChallengeResponse = response.webSocketChallengeResponse;\n        resource.responseReceivedTime = time;\n\n        this._updateResource(resource);\n    },\n\n    didCloseWebSocket: function(identifier, time)\n    {\n        var resource = this._inflightResourcesById[identifier];\n        if (!resource)\n            return;\n        this._finishResource(resource, time);\n    },\n\n    _appendRedirect: function(identifier, time, redirectURL)\n    {\n        var originalResource = this._inflightResourcesById[identifier];\n        var previousRedirects = originalResource.redirects || [];\n        originalResource.identifier = \"redirected:\" + identifier + \".\" + previousRedirects.length;\n        delete originalResource.redirects;\n        this._finishResource(originalResource, time);\n        var newResource = this._createResource(identifier, redirectURL, originalResource.loader, originalResource.stackTrace);\n        newResource.redirects = previousRedirects.concat(originalResource);\n        return newResource;\n    },\n\n    _startResource: function(resource)\n    {\n        this._inflightResourcesById[resource.identifier] = resource;\n        this._inflightResourcesByURL[resource.url] = resource;\n        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceStarted, resource);\n    },\n\n    _updateResource: function(resource)\n    {\n        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceUpdated, resource);\n    },\n\n    _finishResource: function(resource, finishTime)\n    {\n        resource.endTime = finishTime;\n        resource.finished = true;\n        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceFinished, resource);\n        delete this._inflightResourcesById[resource.identifier];\n        delete this._inflightResourcesByURL[resource.url];\n    },\n\n    _addFramesRecursively: function(framePayload)\n    {\n        var frameResource = this._createResource(null, framePayload.resource.url, framePayload.resource.loader);\n        this._updateResourceWithRequest(frameResource, framePayload.resource.request);\n        this._updateResourceWithResponse(frameResource, framePayload.resource.response);\n        frameResource.type = WebInspector.Resource.Type[\"Document\"];\n        frameResource.finished = true;\n\n        this._resourceTreeModel.addOrUpdateFrame(framePayload);\n        this._resourceTreeModel.addResourceToFrame(framePayload.id, frameResource);\n\n        for (var i = 0; framePayload.children && i < framePayload.children.length; ++i)\n            this._addFramesRecursively(framePayload.children[i]);\n\n        if (!framePayload.subresources)\n            return;\n\n        for (var i = 0; i < framePayload.subresources.length; ++i) {\n            var cachedResource = framePayload.subresources[i];\n            var resource = this._createResource(null, cachedResource.url, cachedResource.loader);\n            this._updateResourceWithCachedResource(resource, cachedResource);\n            resource.finished = true;\n            this._resourceTreeModel.addResourceToFrame(framePayload.id, resource);\n        }\n        return frameResource;\n    },\n\n    _dispatchEventToListeners: function(eventType, resource)\n    {\n        this._manager.dispatchEventToListeners(eventType, resource);\n    },\n\n    _createResource: function(identifier, url, loader, stackTrace)\n    {\n        var resource = new WebInspector.Resource(identifier, url);\n        resource.loader = loader;\n        if (loader)\n            resource.documentURL = loader.url;\n        resource.stackTrace = stackTrace;\n        return resource;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/NetworkPanel.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.NetworkPanel = function()\n{\n    WebInspector.Panel.call(this, \"network\");\n\n    this.createSidebar();\n    this.sidebarElement.className = \"network-sidebar\";\n\n    this._resources = [];\n    this._resourcesById = {};\n    this._resourcesByURL = {};\n    this._staleResources = [];\n    this._resourceGridNodes = {};\n    this._mainResourceLoadTime = -1;\n    this._mainResourceDOMContentTime = -1;\n    this._hiddenCategories = {};\n\n    this._categories = WebInspector.resourceCategories;\n\n    this.containerElement = document.createElement(\"div\");\n    this.containerElement.id = \"network-container\";\n    this.sidebarElement.appendChild(this.containerElement);\n\n    this._viewsContainerElement = document.createElement(\"div\");\n    this._viewsContainerElement.id = \"network-views\";\n    this._viewsContainerElement.className = \"hidden\";\n    this.element.appendChild(this._viewsContainerElement);\n\n    this._closeButtonElement = document.createElement(\"button\");\n    this._closeButtonElement.id = \"network-close-button\";\n    this._closeButtonElement.addEventListener(\"click\", this._toggleGridMode.bind(this), false);\n    this._viewsContainerElement.appendChild(this._closeButtonElement);\n\n    this._createSortingFunctions();\n    this._createTable();\n    this._createTimelineGrid();\n    this._createStatusbarButtons();\n    this._createFilterStatusBarItems();\n    this._createSummaryBar();\n\n    if (!WebInspector.settings.resourcesLargeRows)\n        this._setLargerResources(WebInspector.settings.resourcesLargeRows);\n\n    this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this), true);\n    // Enable faster hint.\n    this._popoverHelper.setTimeout(100);\n\n    this.calculator = new WebInspector.NetworkTransferTimeCalculator();\n    this._filter(this._filterAllElement, false);\n\n    this._toggleGridMode();\n\n    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this);\n    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._onResourceUpdated, this);\n    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceUpdated, this);\n    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.MainResourceCommitLoad, this._onMainResourceCommitLoad, this);\n}\n\nWebInspector.NetworkPanel.prototype = {\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Network\");\n    },\n\n    get statusBarItems()\n    {\n        return [this._largerResourcesButton.element, this._preserveLogToggle.element, this._clearButton.element, this._filterBarElement];\n    },\n\n    isCategoryVisible: function(categoryName)\n    {\n        return true;\n    },\n\n    elementsToRestoreScrollPositionsFor: function()\n    {\n        return [this.containerElement, this._dataGrid.scrollContainer];\n    },\n\n    resize: function()\n    {\n        WebInspector.Panel.prototype.resize.call(this);\n        this._dataGrid.updateWidths();\n        this._positionSummaryBar();\n    },\n\n    updateSidebarWidth: function(width)\n    {\n        if (!this._viewingResourceMode)\n            return;\n        WebInspector.Panel.prototype.updateSidebarWidth.call(this, width);\n    },\n\n    updateMainViewWidth: function(width)\n    {\n        this._viewsContainerElement.style.left = width + \"px\";\n    },\n\n    handleShortcut: function(event)\n    {\n        if (this._viewingResourceMode && event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) {\n            this._toggleGridMode();\n            event.handled = true;\n        }\n    },\n\n    _positionSummaryBar: function()\n    {\n        // Position the total bar.\n\n        var fillerRow = this._dataGrid.dataTableBody.lastChild;\n        if (this._summaryBarElement.parentElement !== this.element && fillerRow.offsetHeight > 0) {\n            // Glue status to bottom.\n            if (this._summaryBarRowNode) {\n                this._dataGrid.removeChild(this._summaryBarRowNode);\n                delete this._summaryBarRowNode;\n            }\n            this._summaryBarElement.addStyleClass(\"network-summary-bar-bottom\");\n            this.element.appendChild(this._summaryBarElement);\n            this._dataGrid.element.style.bottom = \"20px\";\n            return;\n        }\n\n        if (!this._summaryBarRowNode && !fillerRow.offsetHeight) {\n            // Glue status to table.\n            this._summaryBarRowNode = new WebInspector.NetworkTotalGridNode(this._summaryBarElement);\n            this._summaryBarElement.removeStyleClass(\"network-summary-bar-bottom\");\n            this._dataGrid.appendChild(this._summaryBarRowNode);\n            this._dataGrid.element.style.bottom = 0;\n            this._sortItems();\n        }\n        this._updateOffscreenRows();\n    },\n\n    _resetSummaryBar: function()\n    {\n        delete this._summaryBarRowNode;\n        this._summaryBarElement.parentElement.removeChild(this._summaryBarElement);\n        this._updateSummaryBar();\n    },\n\n    _createTimelineGrid: function()\n    {\n        this._timelineGrid = new WebInspector.TimelineGrid();\n        this._timelineGrid.element.addStyleClass(\"network-timeline-grid\");\n        this._dataGrid.element.appendChild(this._timelineGrid.element);\n    },\n\n    _createTable: function()\n    {\n        var columns = {name: {}, method: {}, status: {}, type: {}, size: {}, time: {}, timeline: {}};\n        columns.name.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString(\"Name\"), WebInspector.UIString(\"Path\"));\n        columns.name.sortable = true;\n        columns.name.width = \"20%\";\n        columns.name.disclosure = true;\n\n        columns.method.title = WebInspector.UIString(\"Method\");\n        columns.method.sortable = true;\n        columns.method.width = \"7%\";\n\n        columns.status.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString(\"Status\"), WebInspector.UIString(\"Text\"));\n        columns.status.sortable = true;\n        columns.status.width = \"8%\";\n\n        columns.type.title = WebInspector.UIString(\"Type\");\n        columns.type.sortable = true;\n        columns.type.width = \"10%\";\n\n        columns.size.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString(\"Size\"), WebInspector.UIString(\"Transfer\"));\n        columns.size.sortable = true;\n        columns.size.width = \"10%\";\n        columns.size.aligned = \"right\";\n\n        columns.time.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString(\"Time\"), WebInspector.UIString(\"Latency\"));\n        columns.time.sortable = true;\n        columns.time.width = \"10%\";\n        columns.time.aligned = \"right\";\n\n        columns.timeline.title = \"\";\n        columns.timeline.sortable = false;\n        columns.timeline.width = \"37%\";\n        columns.timeline.sort = \"ascending\";\n\n        this._dataGrid = new WebInspector.DataGrid(columns);\n        this._dataGrid.element.addEventListener(\"contextmenu\", this._contextMenu.bind(this), true);\n        this.containerElement.appendChild(this._dataGrid.element);\n        this._dataGrid.addEventListener(\"sorting changed\", this._sortItems, this);\n        this._dataGrid.addEventListener(\"width changed\", this._updateDividersIfNeeded, this);\n        this._dataGrid.scrollContainer.addEventListener(\"scroll\", this._updateOffscreenRows.bind(this));\n\n        this._patchTimelineHeader();\n    },\n\n    _makeHeaderFragment: function(title, subtitle)\n    {\n        var fragment = document.createDocumentFragment();\n        fragment.appendChild(document.createTextNode(title));\n        var subtitleDiv = document.createElement(\"div\");\n        subtitleDiv.className = \"network-header-subtitle\";\n        subtitleDiv.textContent = subtitle;\n        fragment.appendChild(subtitleDiv);\n        return fragment;\n    },\n\n    _patchTimelineHeader: function()\n    {\n        var timelineSorting = document.createElement(\"select\");\n\n        var option = document.createElement(\"option\");\n        option.value = \"startTime\";\n        option.label = WebInspector.UIString(\"Timeline\");\n        timelineSorting.appendChild(option);\n\n        option = document.createElement(\"option\");\n        option.value = \"startTime\";\n        option.label = WebInspector.UIString(\"Start Time\");\n        timelineSorting.appendChild(option);\n\n        option = document.createElement(\"option\");\n        option.value = \"responseTime\";\n        option.label = WebInspector.UIString(\"Response Time\");\n        timelineSorting.appendChild(option);\n\n        option = document.createElement(\"option\");\n        option.value = \"endTime\";\n        option.label = WebInspector.UIString(\"End Time\");\n        timelineSorting.appendChild(option);\n\n        option = document.createElement(\"option\");\n        option.value = \"duration\";\n        option.label = WebInspector.UIString(\"Duration\");\n        timelineSorting.appendChild(option);\n\n        option = document.createElement(\"option\");\n        option.value = \"latency\";\n        option.label = WebInspector.UIString(\"Latency\");\n        timelineSorting.appendChild(option);\n\n        var header = this._dataGrid.headerTableHeader(\"timeline\");\n        header.replaceChild(timelineSorting, header.firstChild);\n\n        timelineSorting.addEventListener(\"click\", function(event) { event.stopPropagation() }, false);\n        timelineSorting.addEventListener(\"change\", this._sortByTimeline.bind(this), false);\n        this._timelineSortSelector = timelineSorting;\n    },\n\n    _createSortingFunctions: function()\n    {\n        this._sortingFunctions = {};\n        this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameComparator;\n        this._sortingFunctions.method = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"method\", false);\n        this._sortingFunctions.status = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"statusCode\", false);\n        this._sortingFunctions.type = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"mimeType\", false);\n        this._sortingFunctions.size = WebInspector.NetworkDataGridNode.SizeComparator;\n        this._sortingFunctions.time = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"duration\", false);\n        this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"startTime\", false);\n        this._sortingFunctions.startTime = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"startTime\", false);\n        this._sortingFunctions.endTime = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"endTime\", false);\n        this._sortingFunctions.responseTime = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"responseReceivedTime\", false);\n        this._sortingFunctions.duration = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"duration\", true);\n        this._sortingFunctions.latency = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, \"latency\", true);\n\n        var timeCalculator = new WebInspector.NetworkTransferTimeCalculator();\n        var durationCalculator = new WebInspector.NetworkTransferDurationCalculator();\n\n        this._calculators = {};\n        this._calculators.timeline = timeCalculator;\n        this._calculators.startTime = timeCalculator;\n        this._calculators.endTime = timeCalculator;\n        this._calculators.responseTime = timeCalculator;\n        this._calculators.duration = durationCalculator;\n        this._calculators.latency = durationCalculator;\n    },\n\n    _sortItems: function()\n    {\n        var columnIdentifier = this._dataGrid.sortColumnIdentifier;\n        if (columnIdentifier === \"timeline\") {\n            this._sortByTimeline();\n            return;\n        }\n        var sortingFunction = this._sortingFunctions[columnIdentifier];\n        if (!sortingFunction)\n            return;\n\n        this._dataGrid.sortNodes(sortingFunction, this._dataGrid.sortOrder === \"descending\");\n        this._timelineSortSelector.selectedIndex = 0;\n        this._updateOffscreenRows();\n    },\n\n    _sortByTimeline: function()\n    {\n        var selectedIndex = this._timelineSortSelector.selectedIndex;\n        if (!selectedIndex)\n            selectedIndex = 1; // Sort by start time by default.\n        var selectedOption = this._timelineSortSelector[selectedIndex];\n        var value = selectedOption.value;\n\n        var sortingFunction = this._sortingFunctions[value];\n        this._dataGrid.sortNodes(sortingFunction);\n        this.calculator = this._calculators[value];\n        if (this.calculator.startAtZero)\n            this._timelineGrid.hideEventDividers();\n        else\n            this._timelineGrid.showEventDividers();\n        this._dataGrid.markColumnAsSortedBy(\"timeline\", \"ascending\");\n        this._updateOffscreenRows();\n    },\n\n    _createFilterStatusBarItems: function()\n    {\n        var filterBarElement = document.createElement(\"div\");\n        filterBarElement.className = \"scope-bar status-bar-item\";\n        filterBarElement.id = \"network-filter\";\n\n        function createFilterElement(category, label)\n        {\n            var categoryElement = document.createElement(\"li\");\n            categoryElement.category = category;\n            categoryElement.className = category;\n            categoryElement.appendChild(document.createTextNode(label));\n            categoryElement.addEventListener(\"click\", this._updateFilter.bind(this), false);\n            filterBarElement.appendChild(categoryElement);\n\n            return categoryElement;\n        }\n\n        this._filterAllElement = createFilterElement.call(this, \"all\", WebInspector.UIString(\"All\"));\n\n        // Add a divider\n        var dividerElement = document.createElement(\"div\");\n        dividerElement.addStyleClass(\"scope-bar-divider\");\n        filterBarElement.appendChild(dividerElement);\n\n        for (var category in this._categories)\n            createFilterElement.call(this, category, this._categories[category].title);\n        this._filterBarElement = filterBarElement;\n    },\n\n    _createSummaryBar: function()\n    {\n        this._summaryBarElement = document.createElement(\"div\");\n        this._summaryBarElement.className = \"network-summary-bar\";\n        this.containerElement.appendChild(this._summaryBarElement);\n    },\n\n    _updateSummaryBar: function()\n    {\n        this._positionSummaryBar(); // Grid is growing.\n        var numRequests = this._resources.length;\n\n        if (!numRequests) {\n            if (this._summaryBarElement._isDisplayingWarning)\n                return;\n            this._summaryBarElement._isDisplayingWarning = true;\n\n            var img = document.createElement(\"img\");\n            img.src = \"Images/warningIcon.png\";\n            this._summaryBarElement.removeChildren();\n            this._summaryBarElement.appendChild(img);\n            this._summaryBarElement.appendChild(document.createTextNode(\" \"));\n            this._summaryBarElement.appendChild(document.createTextNode(\n                WebInspector.UIString(\"No requests captured. Reload the page to see detailed information on the network activity.\")));\n            return;\n        }\n        delete this._summaryBarElement._isDisplayingWarning;\n\n        var transferSize = 0;\n        var baseTime = -1;\n        var maxTime = -1;\n        for (var i = 0; i < this._resources.length; ++i) {\n            var resource = this._resources[i];\n            transferSize += (resource.cached || !resource.transferSize) ? 0 : resource.transferSize;\n            if (resource.isMainResource)\n                baseTime = resource.startTime;\n            if (resource.endTime > maxTime)\n                maxTime = resource.endTime;\n        }\n        var text = String.sprintf(WebInspector.UIString(\"%d requests\"), numRequests);\n        text += \"  \\u2758  \" + String.sprintf(WebInspector.UIString(\"%s transferred\"), Number.bytesToString(transferSize));\n        if (baseTime !== -1 && this._mainResourceLoadTime !== -1 && this._mainResourceDOMContentTime !== -1 && this._mainResourceDOMContentTime > baseTime) {\n            text += \"  \\u2758  \" + String.sprintf(WebInspector.UIString(\"%s (onload: %s, DOMContentLoaded: %s)\"),\n                        Number.secondsToString(maxTime - baseTime),\n                        Number.secondsToString(this._mainResourceLoadTime - baseTime),\n                        Number.secondsToString(this._mainResourceDOMContentTime - baseTime));\n        }\n        this._summaryBarElement.textContent = text;\n    },\n\n    _showCategory: function(category)\n    {\n        this._dataGrid.element.addStyleClass(\"filter-\" + category);\n        delete this._hiddenCategories[category];\n    },\n\n    _hideCategory: function(category)\n    {\n        this._dataGrid.element.removeStyleClass(\"filter-\" + category);\n        this._hiddenCategories[category] = true;\n    },\n\n    _updateFilter: function(e)\n    {\n        var isMac = WebInspector.isMac();\n        var selectMultiple = false;\n        if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)\n            selectMultiple = true;\n        if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)\n            selectMultiple = true;\n\n        this._filter(e.target, selectMultiple);\n        this._positionSummaryBar();\n    },\n\n    _filter: function(target, selectMultiple)\n    {\n        function unselectAll()\n        {\n            for (var i = 0; i < this._filterBarElement.childNodes.length; ++i) {\n                var child = this._filterBarElement.childNodes[i];\n                if (!child.category)\n                    continue;\n\n                child.removeStyleClass(\"selected\");\n                this._hideCategory(child.category);\n            }\n        }\n\n        if (target.category === this._filterAllElement) {\n            if (target.hasStyleClass(\"selected\")) {\n                // We can't unselect All, so we break early here\n                return;\n            }\n\n            // If All wasn't selected, and now is, unselect everything else.\n            unselectAll.call(this);\n        } else {\n            // Something other than All is being selected, so we want to unselect All.\n            if (this._filterAllElement.hasStyleClass(\"selected\")) {\n                this._filterAllElement.removeStyleClass(\"selected\");\n                this._hideCategory(\"all\");\n            }\n        }\n\n        if (!selectMultiple) {\n            // If multiple selection is off, we want to unselect everything else\n            // and just select ourselves.\n            unselectAll.call(this);\n\n            target.addStyleClass(\"selected\");\n            this._showCategory(target.category);\n            return;\n        }\n\n        if (target.hasStyleClass(\"selected\")) {\n            // If selectMultiple is turned on, and we were selected, we just\n            // want to unselect ourselves.\n            target.removeStyleClass(\"selected\");\n            this._hideCategory(target.category);\n        } else {\n            // If selectMultiple is turned on, and we weren't selected, we just\n            // want to select ourselves.\n            target.addStyleClass(\"selected\");\n            this._showCategory(target.category);\n        }\n        this._updateOffscreenRows();\n    },\n\n    _scheduleRefresh: function()\n    {\n        if (this._needsRefresh)\n            return;\n\n        this._needsRefresh = true;\n\n        if (this.visible && !(\"_refreshTimeout\" in this))\n            this._refreshTimeout = setTimeout(this.refresh.bind(this), 500);\n    },\n\n    _updateDividersIfNeeded: function(force)\n    {\n        var timelineColumn = this._dataGrid.columns.timeline;\n        for (var i = 0; i < this._dataGrid.resizers.length; ++i) {\n            if (timelineColumn.ordinal === this._dataGrid.resizers[i].rightNeighboringColumnID) {\n                // Position timline grid location.\n                this._timelineGrid.element.style.left = this._dataGrid.resizers[i].style.left;\n                this._timelineGrid.element.style.right = \"18px\";\n            }\n        }\n\n        var proceed = true;\n        if (!this.visible) {\n            this._scheduleRefresh();\n            proceed = false;\n        } else\n            proceed = this._timelineGrid.updateDividers(force, this.calculator);\n\n        if (!proceed)\n            return;\n\n        if (this.calculator.startAtZero || !this.calculator.computePercentageFromEventTime) {\n            // If our current sorting method starts at zero, that means it shows all\n            // resources starting at the same point, and so onLoad event and DOMContent\n            // event lines really wouldn't make much sense here, so don't render them.\n            // Additionally, if the calculator doesn't have the computePercentageFromEventTime\n            // function defined, we are probably sorting by size, and event times aren't relevant\n            // in this case.\n            return;\n        }\n\n        this._timelineGrid.removeEventDividers();\n        if (this._mainResourceLoadTime !== -1) {\n            var percent = this.calculator.computePercentageFromEventTime(this._mainResourceLoadTime);\n\n            var loadDivider = document.createElement(\"div\");\n            loadDivider.className = \"network-event-divider network-red-divider\";\n\n            var loadDividerPadding = document.createElement(\"div\");\n            loadDividerPadding.className = \"network-event-divider-padding\";\n            loadDividerPadding.title = WebInspector.UIString(\"Load event fired\");\n            loadDividerPadding.appendChild(loadDivider);\n            loadDividerPadding.style.left = percent + \"%\";\n            this._timelineGrid.addEventDivider(loadDividerPadding);\n        }\n\n        if (this._mainResourceDOMContentTime !== -1) {\n            var percent = this.calculator.computePercentageFromEventTime(this._mainResourceDOMContentTime);\n\n            var domContentDivider = document.createElement(\"div\");\n            domContentDivider.className = \"network-event-divider network-blue-divider\";\n\n            var domContentDividerPadding = document.createElement(\"div\");\n            domContentDividerPadding.className = \"network-event-divider-padding\";\n            domContentDividerPadding.title = WebInspector.UIString(\"DOMContent event fired\");\n            domContentDividerPadding.appendChild(domContentDivider);\n            domContentDividerPadding.style.left = percent + \"%\";\n            this._timelineGrid.addEventDivider(domContentDividerPadding);\n        }\n    },\n\n    _refreshIfNeeded: function()\n    {\n        if (this._needsRefresh)\n            this.refresh();\n    },\n\n    _invalidateAllItems: function()\n    {\n        this._staleResources = this._resources.slice();\n    },\n\n    get calculator()\n    {\n        return this._calculator;\n    },\n\n    set calculator(x)\n    {\n        if (!x || this._calculator === x)\n            return;\n\n        this._calculator = x;\n        this._calculator.reset();\n\n        this._invalidateAllItems();\n        this.refresh();\n    },\n\n    _resourceGridNode: function(resource)\n    {\n        return this._resourceGridNodes[resource.identifier];\n    },\n\n    revealAndSelectItem: function(resource)\n    {\n        var node = this._resourceGridNode(resource);\n        if (node) {\n            node.reveal();\n            node.select(true);\n        }\n    },\n\n    addEventDivider: function(divider)\n    {\n        this._timelineGrid.addEventDivider(divider);\n    },\n\n    _createStatusbarButtons: function()\n    {\n        this._preserveLogToggle = new WebInspector.StatusBarButton(WebInspector.UIString(\"Preserve Log upon Navigation\"), \"record-profile-status-bar-item\");\n        this._preserveLogToggle.addEventListener(\"click\", this._onPreserveLogClicked.bind(this), false);\n\n        this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Clear\"), \"clear-status-bar-item\");\n        this._clearButton.addEventListener(\"click\", this._reset.bind(this), false);\n\n        this._largerResourcesButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Use small resource rows.\"), \"network-larger-resources-status-bar-item\");\n        this._largerResourcesButton.toggled = WebInspector.settings.resourcesLargeRows;\n        this._largerResourcesButton.addEventListener(\"click\", this._toggleLargerResources.bind(this), false);\n    },\n\n    set mainResourceLoadTime(x)\n    {\n        if (this._mainResourceLoadTime === x)\n            return;\n\n        this._mainResourceLoadTime = x || -1;\n        // Update the dividers to draw the new line\n        this._updateDividersIfNeeded(true);\n    },\n\n    set mainResourceDOMContentTime(x)\n    {\n        if (this._mainResourceDOMContentTime === x)\n            return;\n\n        this._mainResourceDOMContentTime = x || -1;\n        this._updateDividersIfNeeded(true);\n    },\n\n    show: function()\n    {\n        WebInspector.Panel.prototype.show.call(this);\n        this._refreshIfNeeded();\n\n        if (this.visibleView)\n            this.visibleView.show(this._viewsContainerElement);\n\n        this._dataGrid.updateWidths();\n        this._positionSummaryBar();\n    },\n\n    hide: function()\n    {\n        WebInspector.Panel.prototype.hide.call(this);\n        this._popoverHelper.hidePopup();\n    },\n\n    get searchableViews()\n    {\n        var views = [];\n        return views;\n    },\n\n    searchMatchFound: function(view, matches)\n    {\n        this._resourceGridNode(view.resource).searchMatches = matches;\n    },\n\n    searchCanceled: function(startingNewSearch)\n    {\n        WebInspector.Panel.prototype.searchCanceled.call(this, startingNewSearch);\n\n        if (startingNewSearch || !this._resources)\n            return;\n    },\n\n    performSearch: function(query)\n    {\n        WebInspector.Panel.prototype.performSearch.call(this, query);\n    },\n\n    refresh: function()\n    {\n        this._needsRefresh = false;\n        if (\"_refreshTimeout\" in this) {\n            clearTimeout(this._refreshTimeout);\n            delete this._refreshTimeout;\n        }\n\n        var wasScrolledToLastRow = this._dataGrid.isScrolledToLastRow();\n        var staleItemsLength = this._staleResources.length;\n        var boundariesChanged = false;\n\n        for (var i = 0; i < staleItemsLength; ++i) {\n            var resource = this._staleResources[i];\n            var node = this._resourceGridNode(resource);\n            if (!node) {\n                // Create the timeline tree element and graph.\n                node = new WebInspector.NetworkDataGridNode(this, resource);\n                this._resourceGridNodes[resource.identifier] = node;\n                this._dataGrid.appendChild(node);\n            }\n            node.refreshResource();\n\n            if (this.calculator.updateBoundaries(resource))\n                boundariesChanged = true;\n        }\n\n        if (boundariesChanged) {\n            // The boundaries changed, so all item graphs are stale.\n            this._invalidateAllItems();\n            staleItemsLength = this._staleResources.length;\n        }\n\n        for (var i = 0; i < staleItemsLength; ++i)\n            this._resourceGridNode(this._staleResources[i]).refreshGraph(this.calculator);\n\n        this._staleResources = [];\n        this._sortItems();\n        this._updateSummaryBar();\n        this._dataGrid.updateWidths();\n\n        if (wasScrolledToLastRow)\n            this._dataGrid.scrollToLastRow();\n    },\n\n    _onPreserveLogClicked: function(e)\n    {\n        this._preserveLogToggle.toggled = !this._preserveLogToggle.toggled;\n    },\n\n    _reset: function()\n    {\n        this._popoverHelper.hidePopup();\n        this._closeVisibleResource();\n\n        this._toggleGridMode();\n\n        // Begin reset timeline\n        if (this._calculator)\n            this._calculator.reset();\n\n        this._resources = [];\n        this._resourcesById = {};\n        this._resourcesByURL = {};\n        this._staleResources = [];\n        this._resourceGridNodes = {};\n\n        this._dataGrid.removeChildren();\n        delete this._summaryBarRowNode;\n        this._updateDividersIfNeeded(true);\n        // End reset timeline.\n\n        this._mainResourceLoadTime = -1;\n        this._mainResourceDOMContentTime = -1;\n\n        this._viewsContainerElement.removeChildren();\n        this._viewsContainerElement.appendChild(this._closeButtonElement);\n        this._resetSummaryBar();\n    },\n\n    get resources()\n    {\n        return this._resources;\n    },\n\n    resourceById: function(id)\n    {\n        return this._resourcesById[id];\n    },\n\n    _onResourceStarted: function(event)\n    {\n        this._appendResource(event.data);\n    },\n\n    _appendResource: function(resource)\n    {\n        this._resources.push(resource);\n        this._resourcesById[resource.identifier] = resource;\n        this._resourcesByURL[resource.url] = resource;\n\n        // Pull all the redirects of the main resource upon commit load.\n        if (resource.redirects) {\n            for (var i = 0; i < resource.redirects.length; ++i)\n                this._refreshResource(resource.redirects[i]);\n        }\n\n        this._refreshResource(resource);\n    },\n\n    _onResourceUpdated: function(event)\n    {\n        this._refreshResource(event.data);\n    },\n\n    _refreshResource: function(resource)\n    {\n        this._staleResources.push(resource);\n        this._scheduleRefresh();\n\n        var oldView = WebInspector.ResourceView.existingResourceViewForResource(resource);\n        if (!oldView)\n            return;\n\n        if (WebInspector.ResourceView.resourceViewTypeMatchesResource(resource))\n            return;\n\n        var newView = WebInspector.ResourceView.recreateResourceView(resource);\n        if (this.visibleView === oldView)\n            this.visibleView = newView;\n    },\n\n    clear: function()\n    {\n        if (this._preserveLogToggle.toggled)\n            return;\n        this._reset();\n    },\n\n    _onMainResourceCommitLoad: function()\n    {\n        if (this._preserveLogToggle.toggled)\n            return;\n\n        this._reset();\n        // Now resurrect the main resource along with all redirects that lead to it.\n        var resourcesToAppend = (WebInspector.mainResource.redirects || []).concat(WebInspector.mainResource);\n        resourcesToAppend.forEach(this._appendResource, this);\n    },\n\n    canShowSourceLine: function(url, line)\n    {\n        return !!this._resourcesByURL[url];\n    },\n\n    showSourceLine: function(url, line)\n    {\n        this._showResource(this._resourcesByURL[url], line);\n    },\n\n    _showResource: function(resource, line)\n    {\n        if (!resource)\n            return;\n\n        this._popoverHelper.hidePopup();\n\n        this._toggleViewingResourceMode();\n\n        if (this.visibleView) {\n            this.visibleView.detach();\n            delete this.visibleView;\n        }\n\n        var view = new WebInspector.NetworkItemView(resource);\n        view.show(this._viewsContainerElement);\n        this.visibleView = view;\n\n        this.updateSidebarWidth();\n    },\n\n    _closeVisibleResource: function()\n    {\n        this.element.removeStyleClass(\"viewing-resource\");\n\n        if (this.visibleView) {\n            this.visibleView.detach();\n            delete this.visibleView;\n        }\n\n        if (this._lastSelectedGraphTreeElement)\n            this._lastSelectedGraphTreeElement.select(true);\n\n        this.updateSidebarWidth();\n    },\n\n    _toggleLargerResources: function()\n    {\n        WebInspector.settings.resourcesLargeRows = !WebInspector.settings.resourcesLargeRows;\n        this._setLargerResources(WebInspector.settings.resourcesLargeRows);\n    },\n\n    _setLargerResources: function(enabled)\n    {\n        this._largerResourcesButton.toggled = enabled;\n        if (!enabled) {\n            this._largerResourcesButton.title = WebInspector.UIString(\"Use large resource rows.\");\n            this._dataGrid.element.addStyleClass(\"small\");\n            this._timelineGrid.element.addStyleClass(\"small\");\n            this._viewsContainerElement.addStyleClass(\"small\");\n        } else {\n            this._largerResourcesButton.title = WebInspector.UIString(\"Use small resource rows.\");\n            this._dataGrid.element.removeStyleClass(\"small\");\n            this._timelineGrid.element.removeStyleClass(\"small\");\n            this._viewsContainerElement.removeStyleClass(\"small\");\n        }\n        this._positionSummaryBar();\n    },\n\n    _getPopoverAnchor: function(element)\n    {\n        var anchor = element.enclosingNodeOrSelfWithClass(\"network-graph-bar\") || element.enclosingNodeOrSelfWithClass(\"network-graph-label\");\n        if (!anchor)\n            return null;\n        var resource = anchor.parentElement.resource;\n        return resource && resource.timing ? anchor : null;\n    },\n\n    _showPopover: function(anchor)\n    {\n        var resource = anchor.parentElement.resource;\n        var tableElement = WebInspector.ResourceTimingView.createTimingTable(resource);\n        var popover = new WebInspector.Popover(tableElement);\n        popover.show(anchor);\n        return popover;\n    },\n\n    _toggleGridMode: function()\n    {\n        if (this._viewingResourceMode) {\n            this._viewingResourceMode = false;\n            this.element.removeStyleClass(\"viewing-resource\");\n            this._dataGrid.element.removeStyleClass(\"viewing-resource-mode\");\n            this._viewsContainerElement.addStyleClass(\"hidden\");\n            this.sidebarElement.style.right = 0;\n            this.sidebarElement.style.removeProperty(\"width\");\n            if (this._dataGrid.selectedNode)\n                this._dataGrid.selectedNode.selected = false;\n        }\n\n        if (this._briefGrid) {\n            this._dataGrid.element.removeStyleClass(\"full-grid-mode\");\n            this._dataGrid.element.addStyleClass(\"brief-grid-mode\");\n\n            this._dataGrid.hideColumn(\"method\");\n            this._dataGrid.hideColumn(\"status\");\n            this._dataGrid.hideColumn(\"type\");\n            this._dataGrid.hideColumn(\"size\");\n            this._dataGrid.hideColumn(\"time\");\n\n            var widths = {};\n            widths.name = 20;\n            widths.timeline = 80;\n        } else {\n            this._dataGrid.element.addStyleClass(\"full-grid-mode\");\n            this._dataGrid.element.removeStyleClass(\"brief-grid-mode\");\n\n            this._dataGrid.showColumn(\"method\");\n            this._dataGrid.showColumn(\"status\");\n            this._dataGrid.showColumn(\"type\");\n            this._dataGrid.showColumn(\"size\");\n            this._dataGrid.showColumn(\"time\");\n\n            var widths = {};\n            widths.name = 20;\n            widths.method = 7;\n            widths.status = 8;\n            widths.type = 10;\n            widths.size = 10;\n            widths.time = 10;\n            widths.timeline = 37;\n        }\n\n        this._dataGrid.showColumn(\"timeline\");\n        this._dataGrid.applyColumnWidthsMap(widths);\n\n    },\n\n    _toggleViewingResourceMode: function()\n    {\n        if (this._viewingResourceMode)\n            return;\n        this._viewingResourceMode = true;\n        this._preservedColumnWidths = this._dataGrid.columnWidthsMap();\n\n        this.element.addStyleClass(\"viewing-resource\");\n        this._dataGrid.element.addStyleClass(\"viewing-resource-mode\");\n        this._dataGrid.element.removeStyleClass(\"full-grid-mode\");\n        this._dataGrid.element.removeStyleClass(\"brief-grid-mode\");\n\n        this._dataGrid.hideColumn(\"method\");\n        this._dataGrid.hideColumn(\"status\");\n        this._dataGrid.hideColumn(\"type\");\n        this._dataGrid.hideColumn(\"size\");\n        this._dataGrid.hideColumn(\"time\");\n        this._dataGrid.hideColumn(\"timeline\");\n\n        this._viewsContainerElement.removeStyleClass(\"hidden\");\n        this.updateSidebarWidth(200);\n\n        var widths = {};\n        widths.name = 100;\n        this._dataGrid.applyColumnWidthsMap(widths);\n    },\n\n    _contextMenu: function(event)\n    {\n        // createBlobURL is enabled conditionally, do not expose resource export if it's not available.\n        if (typeof window.webkitURL.createObjectURL !== \"function\" || !Preferences.resourceExportEnabled)\n            return;\n\n        var contextMenu = new WebInspector.ContextMenu();\n        var gridNode = this._dataGrid.dataGridNodeFromNode(event.target);\n        var resource = gridNode && gridNode._resource;\n        if (resource)\n            contextMenu.appendItem(WebInspector.UIString(\"Export to HAR\"), this._exportResource.bind(this, resource));\n        contextMenu.appendItem(WebInspector.UIString(\"Export all to HAR\"), this._exportAll.bind(this));\n        contextMenu.show(event);\n    },\n\n    _exportAll: function()\n    {\n        var harArchive = {\n            log: (new WebInspector.HARLog()).build()\n        }\n        InspectorFrontendHost.copyText(JSON.stringify(harArchive));\n    },\n\n    _exportResource: function(resource)\n    {\n        var har = (new WebInspector.HAREntry(resource)).build();\n        InspectorFrontendHost.copyText(JSON.stringify(har));\n    },\n\n    _updateOffscreenRows: function(e)\n    {\n        var dataTableBody = this._dataGrid.dataTableBody;\n        var rows = dataTableBody.children;\n        var recordsCount = rows.length;\n        if (recordsCount < 2)\n            return;  // Filler row only.\n\n        var visibleTop = this._dataGrid.scrollContainer.scrollTop;\n        var visibleBottom = visibleTop + this._dataGrid.scrollContainer.offsetHeight;\n\n        var rowHeight = 0;\n\n        // Filler is at recordsCount - 1.\n        var unfilteredRowIndex = 0;\n        for (var i = 0; i < recordsCount - 1; ++i) {\n            var row = rows[i];\n            // Don't touch summaty - quit instead.\n            if (this._summaryBarRowNode && row === this._summaryBarRowNode.element)\n                break;\n\n            var dataGridNode = this._dataGrid.dataGridNodeFromNode(row);\n            if (dataGridNode.isFilteredOut()) {\n                row.removeStyleClass(\"offscreen\");\n                continue;\n            }\n\n            if (!rowHeight)\n                rowHeight = row.offsetHeight;\n\n            var rowIsVisible = unfilteredRowIndex * rowHeight < visibleBottom && (unfilteredRowIndex + 1) * rowHeight > visibleTop;\n            if (rowIsVisible !== row.rowIsVisible) {\n                if (rowIsVisible)\n                    row.removeStyleClass(\"offscreen\");\n                else\n                    row.addStyleClass(\"offscreen\");\n                row.rowIsVisible = rowIsVisible;\n            }\n            unfilteredRowIndex++;\n        }\n    }\n}\n\nWebInspector.NetworkPanel.prototype.__proto__ = WebInspector.Panel.prototype;\n\nWebInspector.NetworkBaseCalculator = function()\n{\n}\n\nWebInspector.NetworkBaseCalculator.prototype = {\n    computeSummaryValues: function(items)\n    {\n        var total = 0;\n        var categoryValues = {};\n\n        var itemsLength = items.length;\n        for (var i = 0; i < itemsLength; ++i) {\n            var item = items[i];\n            var value = this._value(item);\n            if (typeof value === \"undefined\")\n                continue;\n            if (!(item.category.name in categoryValues))\n                categoryValues[item.category.name] = 0;\n            categoryValues[item.category.name] += value;\n            total += value;\n        }\n\n        return {categoryValues: categoryValues, total: total};\n    },\n\n    computeBarGraphPercentages: function(item)\n    {\n        return {start: 0, middle: 0, end: (this._value(item) / this.boundarySpan) * 100};\n    },\n\n    computeBarGraphLabels: function(item)\n    {\n        var label = this.formatValue(this._value(item));\n        return {left: label, right: label, tooltip: label};\n    },\n\n    get boundarySpan()\n    {\n        return this.maximumBoundary - this.minimumBoundary;\n    },\n\n    updateBoundaries: function(item)\n    {\n        this.minimumBoundary = 0;\n\n        var value = this._value(item);\n        if (typeof this.maximumBoundary === \"undefined\" || value > this.maximumBoundary) {\n            this.maximumBoundary = value;\n            return true;\n        }\n        return false;\n    },\n\n    reset: function()\n    {\n        delete this.minimumBoundary;\n        delete this.maximumBoundary;\n    },\n\n    _value: function(item)\n    {\n        return 0;\n    },\n\n    formatValue: function(value)\n    {\n        return value.toString();\n    }\n}\n\nWebInspector.NetworkTimeCalculator = function(startAtZero)\n{\n    WebInspector.NetworkBaseCalculator.call(this);\n    this.startAtZero = startAtZero;\n}\n\nWebInspector.NetworkTimeCalculator.prototype = {\n    computeSummaryValues: function(resources)\n    {\n        var resourcesByCategory = {};\n        var resourcesLength = resources.length;\n        for (var i = 0; i < resourcesLength; ++i) {\n            var resource = resources[i];\n            if (!(resource.category.name in resourcesByCategory))\n                resourcesByCategory[resource.category.name] = [];\n            resourcesByCategory[resource.category.name].push(resource);\n        }\n\n        var earliestStart;\n        var latestEnd;\n        var categoryValues = {};\n        for (var category in resourcesByCategory) {\n            resourcesByCategory[category].sort(WebInspector.Resource.CompareByTime);\n            categoryValues[category] = 0;\n\n            var segment = {start: -1, end: -1};\n\n            var categoryResources = resourcesByCategory[category];\n            var resourcesLength = categoryResources.length;\n            for (var i = 0; i < resourcesLength; ++i) {\n                var resource = categoryResources[i];\n                if (resource.startTime === -1 || resource.endTime === -1)\n                    continue;\n\n                if (typeof earliestStart === \"undefined\")\n                    earliestStart = resource.startTime;\n                else\n                    earliestStart = Math.min(earliestStart, resource.startTime);\n\n                if (typeof latestEnd === \"undefined\")\n                    latestEnd = resource.endTime;\n                else\n                    latestEnd = Math.max(latestEnd, resource.endTime);\n\n                if (resource.startTime <= segment.end) {\n                    segment.end = Math.max(segment.end, resource.endTime);\n                    continue;\n                }\n\n                categoryValues[category] += segment.end - segment.start;\n\n                segment.start = resource.startTime;\n                segment.end = resource.endTime;\n            }\n\n            // Add the last segment\n            categoryValues[category] += segment.end - segment.start;\n        }\n\n        return {categoryValues: categoryValues, total: latestEnd - earliestStart};\n    },\n\n    computeBarGraphPercentages: function(resource)\n    {\n        if (resource.startTime !== -1)\n            var start = ((resource.startTime - this.minimumBoundary) / this.boundarySpan) * 100;\n        else\n            var start = 0;\n\n        if (resource.responseReceivedTime !== -1)\n            var middle = ((resource.responseReceivedTime - this.minimumBoundary) / this.boundarySpan) * 100;\n        else\n            var middle = (this.startAtZero ? start : 100);\n\n        if (resource.endTime !== -1)\n            var end = ((resource.endTime - this.minimumBoundary) / this.boundarySpan) * 100;\n        else\n            var end = (this.startAtZero ? middle : 100);\n\n        if (this.startAtZero) {\n            end -= start;\n            middle -= start;\n            start = 0;\n        }\n\n        return {start: start, middle: middle, end: end};\n    },\n\n    computePercentageFromEventTime: function(eventTime)\n    {\n        // This function computes a percentage in terms of the total loading time\n        // of a specific event. If startAtZero is set, then this is useless, and we\n        // want to return 0.\n        if (eventTime !== -1 && !this.startAtZero)\n            return ((eventTime - this.minimumBoundary) / this.boundarySpan) * 100;\n\n        return 0;\n    },\n\n    computeBarGraphLabels: function(resource)\n    {\n        var rightLabel = \"\";\n        if (resource.responseReceivedTime !== -1 && resource.endTime !== -1)\n            rightLabel = this.formatValue(resource.endTime - resource.responseReceivedTime);\n\n        var hasLatency = resource.latency > 0;\n        if (hasLatency)\n            var leftLabel = this.formatValue(resource.latency);\n        else\n            var leftLabel = rightLabel;\n\n        if (resource.timing)\n            return {left: leftLabel, right: rightLabel};\n\n        if (hasLatency && rightLabel) {\n            var total = this.formatValue(resource.duration);\n            var tooltip = WebInspector.UIString(\"%s latency, %s download (%s total)\", leftLabel, rightLabel, total);\n        } else if (hasLatency)\n            var tooltip = WebInspector.UIString(\"%s latency\", leftLabel);\n        else if (rightLabel)\n            var tooltip = WebInspector.UIString(\"%s download\", rightLabel);\n\n        if (resource.cached)\n            tooltip = WebInspector.UIString(\"%s (from cache)\", tooltip);\n        return {left: leftLabel, right: rightLabel, tooltip: tooltip};\n    },\n\n    updateBoundaries: function(resource)\n    {\n        var didChange = false;\n\n        var lowerBound;\n        if (this.startAtZero)\n            lowerBound = 0;\n        else\n            lowerBound = this._lowerBound(resource);\n\n        if (lowerBound !== -1 && (typeof this.minimumBoundary === \"undefined\" || lowerBound < this.minimumBoundary)) {\n            this.minimumBoundary = lowerBound;\n            didChange = true;\n        }\n\n        var upperBound = this._upperBound(resource);\n        if (upperBound !== -1 && (typeof this.maximumBoundary === \"undefined\" || upperBound > this.maximumBoundary)) {\n            this.maximumBoundary = upperBound;\n            didChange = true;\n        }\n\n        return didChange;\n    },\n\n    formatValue: function(value)\n    {\n        return Number.secondsToString(value);\n    },\n\n    _lowerBound: function(resource)\n    {\n        return 0;\n    },\n\n    _upperBound: function(resource)\n    {\n        return 0;\n    }\n}\n\nWebInspector.NetworkTimeCalculator.prototype.__proto__ = WebInspector.NetworkBaseCalculator.prototype;\n\nWebInspector.NetworkTransferTimeCalculator = function()\n{\n    WebInspector.NetworkTimeCalculator.call(this, false);\n}\n\nWebInspector.NetworkTransferTimeCalculator.prototype = {\n    formatValue: function(value)\n    {\n        return Number.secondsToString(value);\n    },\n\n    _lowerBound: function(resource)\n    {\n        return resource.startTime;\n    },\n\n    _upperBound: function(resource)\n    {\n        return resource.endTime;\n    }\n}\n\nWebInspector.NetworkTransferTimeCalculator.prototype.__proto__ = WebInspector.NetworkTimeCalculator.prototype;\n\nWebInspector.NetworkTransferDurationCalculator = function()\n{\n    WebInspector.NetworkTimeCalculator.call(this, true);\n}\n\nWebInspector.NetworkTransferDurationCalculator.prototype = {\n    formatValue: function(value)\n    {\n        return Number.secondsToString(value);\n    },\n\n    _upperBound: function(resource)\n    {\n        return resource.duration;\n    }\n}\n\nWebInspector.NetworkTransferDurationCalculator.prototype.__proto__ = WebInspector.NetworkTimeCalculator.prototype;\n\nWebInspector.NetworkDataGridNode = function(panel, resource)\n{\n    WebInspector.DataGridNode.call(this, {});\n    this._panel = panel;\n    this._resource = resource;\n}\n\nWebInspector.NetworkDataGridNode.prototype = {\n    createCells: function()\n    {\n        this._nameCell = this._createDivInTD(\"name\");\n        this._methodCell = this._createDivInTD(\"method\");\n        this._statusCell = this._createDivInTD(\"status\");\n        this._typeCell = this._createDivInTD(\"type\");\n        this._sizeCell = this._createDivInTD(\"size\");\n        this._timeCell = this._createDivInTD(\"time\");\n        this._createTimelineCell();\n        this._nameCell.addEventListener(\"click\", this.select.bind(this), false);\n        this._nameCell.addEventListener(\"dblclick\", this._openInNewTab.bind(this), false);\n    },\n\n    isFilteredOut: function()\n    {\n        if (!this._panel._hiddenCategories.all)\n            return false;\n        return this._resource.category.name in this._panel._hiddenCategories;\n    },\n\n    select: function()\n    {\n        this._panel._showResource(this._resource);\n        WebInspector.DataGridNode.prototype.select.apply(this, arguments);\n    },\n\n    _openInNewTab: function()\n    {\n        InspectorBackend.openInInspectedWindow(this._resource.url);\n    },\n\n    get selectable()\n    {\n        if (!this._panel._viewingResourceMode)\n            return false;\n        return !this.isFilteredOut();\n    },\n\n    _createDivInTD: function(columnIdentifier)\n    {\n        var td = document.createElement(\"td\");\n        td.className = columnIdentifier + \"-column\";\n        var div = document.createElement(\"div\");\n        td.appendChild(div);\n        this._element.appendChild(td);\n        return div;\n    },\n\n    _createTimelineCell: function()\n    {\n        this._graphElement = document.createElement(\"div\");\n        this._graphElement.className = \"network-graph-side\";\n\n        this._barAreaElement = document.createElement(\"div\");\n        //    this._barAreaElement.className = \"network-graph-bar-area hidden\";\n        this._barAreaElement.className = \"network-graph-bar-area\";\n        this._barAreaElement.resource = this._resource;\n        this._graphElement.appendChild(this._barAreaElement);\n\n        this._barLeftElement = document.createElement(\"div\");\n        this._barLeftElement.className = \"network-graph-bar waiting\";\n        this._barAreaElement.appendChild(this._barLeftElement);\n\n        this._barRightElement = document.createElement(\"div\");\n        this._barRightElement.className = \"network-graph-bar\";\n        this._barAreaElement.appendChild(this._barRightElement);\n\n\n        this._labelLeftElement = document.createElement(\"div\");\n        this._labelLeftElement.className = \"network-graph-label waiting\";\n        this._barAreaElement.appendChild(this._labelLeftElement);\n\n        this._labelRightElement = document.createElement(\"div\");\n        this._labelRightElement.className = \"network-graph-label\";\n        this._barAreaElement.appendChild(this._labelRightElement);\n\n        this._graphElement.addEventListener(\"mouseover\", this._refreshLabelPositions.bind(this), false);\n\n        this._timelineCell = document.createElement(\"td\");\n        this._timelineCell.className = \"timeline-column\";\n        this._element.appendChild(this._timelineCell);\n        this._timelineCell.appendChild(this._graphElement);\n    },\n\n    refreshResource: function()\n    {\n        this._refreshNameCell();\n\n        this._methodCell.textContent = this._resource.requestMethod;\n\n        this._refreshStatusCell();\n\n        if (this._resource.mimeType) {\n            this._typeCell.removeStyleClass(\"network-dim-cell\");\n            this._typeCell.textContent = this._resource.mimeType;\n        } else {\n            this._typeCell.addStyleClass(\"network-dim-cell\");\n            this._typeCell.textContent = WebInspector.UIString(\"Pending\");\n        }\n\n        this._refreshSizeCell();\n        this._refreshTimeCell();\n\n        if (this._resource.cached)\n            this._graphElement.addStyleClass(\"resource-cached\");\n\n        this._element.addStyleClass(\"network-item\");\n        if (!this._element.hasStyleClass(\"network-category-\" + this._resource.category.name)) {\n            this._element.removeMatchingStyleClasses(\"network-category-\\\\w+\");\n            this._element.addStyleClass(\"network-category-\" + this._resource.category.name);\n        }\n    },\n\n    _refreshNameCell: function()\n    {\n        this._nameCell.removeChildren();\n\n        if (this._resource.category === WebInspector.resourceCategories.images) {\n            var previewImage = document.createElement(\"img\");\n            previewImage.className = \"image-network-icon-preview\";\n            this._resource.populateImageSource(previewImage);\n\n            var iconElement = document.createElement(\"div\");\n            iconElement.className = \"icon\";\n            iconElement.appendChild(previewImage);\n        } else {\n            var iconElement = document.createElement(\"img\");\n            iconElement.className = \"icon\";\n        }\n        this._nameCell.appendChild(iconElement);\n        this._nameCell.appendChild(document.createTextNode(this._fileName()));\n\n\n        var subtitle = this._resource.displayDomain;\n\n        if (this._resource.path && this._resource.lastPathComponent) {\n            var lastPathComponentIndex = this._resource.path.lastIndexOf(\"/\" + this._resource.lastPathComponent);\n            if (lastPathComponentIndex != -1)\n                subtitle += this._resource.path.substring(0, lastPathComponentIndex);\n        }\n\n        this._appendSubtitle(this._nameCell, subtitle);\n        this._nameCell.title = this._resource.url;\n    },\n\n    _fileName: function()\n    {\n        var fileName = this._resource.displayName;\n        if (this._resource.queryString)\n            fileName += \"?\" + this._resource.queryString;\n        return fileName;\n    },\n\n    _refreshStatusCell: function()\n    {\n        this._statusCell.removeChildren();\n\n        var fromCache = this._resource.cached;\n        if (fromCache) {\n            this._statusCell.textContent = WebInspector.UIString(\"(from cache)\");\n            this._statusCell.addStyleClass(\"network-dim-cell\");\n            return;\n        }\n\n        this._statusCell.removeStyleClass(\"network-dim-cell\");\n        if (this._resource.statusCode) {\n            this._statusCell.appendChild(document.createTextNode(this._resource.statusCode));\n            this._statusCell.removeStyleClass(\"network-dim-cell\");\n            this._appendSubtitle(this._statusCell, this._resource.statusText);\n            this._statusCell.title = this._resource.statusCode + \" \" + this._resource.statusText;\n        } else {\n            this._statusCell.addStyleClass(\"network-dim-cell\");\n            this._statusCell.textContent = WebInspector.UIString(\"Pending\");\n        }\n    },\n\n    _refreshSizeCell: function()\n    {\n        var resourceSize = typeof this._resource.resourceSize === \"number\" ? Number.bytesToString(this._resource.resourceSize) : \"?\";\n        var transferSize = typeof this._resource.transferSize === \"number\" ? Number.bytesToString(this._resource.transferSize) : \"?\";\n        var fromCache = this._resource.cached;\n        this._sizeCell.textContent = !fromCache ? resourceSize : WebInspector.UIString(\"(from cache)\");\n        if (fromCache)\n            this._sizeCell.addStyleClass(\"network-dim-cell\");\n        else\n            this._sizeCell.removeStyleClass(\"network-dim-cell\");\n        if (!fromCache)\n            this._appendSubtitle(this._sizeCell, transferSize);\n    },\n\n    _refreshTimeCell: function()\n    {\n        if (this._resource.duration > 0) {\n            this._timeCell.removeStyleClass(\"network-dim-cell\");\n            this._timeCell.textContent = Number.secondsToString(this._resource.duration);\n            this._appendSubtitle(this._timeCell, Number.secondsToString(this._resource.latency));\n        } else {\n            this._timeCell.addStyleClass(\"network-dim-cell\");\n            this._timeCell.textContent = WebInspector.UIString(\"Pending\");\n        }\n    },\n\n    _appendSubtitle: function(cellElement, subtitleText)\n    {\n        var subtitleElement = document.createElement(\"div\");\n        subtitleElement.className = \"network-cell-subtitle\";\n        subtitleElement.textContent = subtitleText;\n        cellElement.appendChild(subtitleElement);\n    },\n\n    refreshGraph: function(calculator)\n    {\n        var percentages = calculator.computeBarGraphPercentages(this._resource);\n        this._percentages = percentages;\n\n        this._barAreaElement.removeStyleClass(\"hidden\");\n\n        if (!this._graphElement.hasStyleClass(\"network-category-\" + this._resource.category.name)) {\n            this._graphElement.removeMatchingStyleClasses(\"network-category-\\\\w+\");\n            this._graphElement.addStyleClass(\"network-category-\" + this._resource.category.name);\n        }\n\n        this._barLeftElement.style.setProperty(\"left\", percentages.start + \"%\");\n        this._barRightElement.style.setProperty(\"right\", (100 - percentages.end) + \"%\");\n\n        this._barLeftElement.style.setProperty(\"right\", (100 - percentages.end) + \"%\");\n        this._barRightElement.style.setProperty(\"left\", percentages.middle + \"%\");\n\n        var labels = calculator.computeBarGraphLabels(this._resource);\n        this._labelLeftElement.textContent = labels.left;\n        this._labelRightElement.textContent = labels.right;\n\n        var tooltip = (labels.tooltip || \"\");\n        this._barLeftElement.title = tooltip;\n        this._labelLeftElement.title = tooltip;\n        this._labelRightElement.title = tooltip;\n        this._barRightElement.title = tooltip;\n    },\n\n    _refreshLabelPositions: function()\n    {\n        if (!this._percentages)\n            return;\n        this._labelLeftElement.style.removeProperty(\"left\");\n        this._labelLeftElement.style.removeProperty(\"right\");\n        this._labelLeftElement.removeStyleClass(\"before\");\n        this._labelLeftElement.removeStyleClass(\"hidden\");\n\n        this._labelRightElement.style.removeProperty(\"left\");\n        this._labelRightElement.style.removeProperty(\"right\");\n        this._labelRightElement.removeStyleClass(\"after\");\n        this._labelRightElement.removeStyleClass(\"hidden\");\n\n        var labelPadding = 10;\n        var barRightElementOffsetWidth = this._barRightElement.offsetWidth;\n        var barLeftElementOffsetWidth = this._barLeftElement.offsetWidth;\n\n        if (this._barLeftElement) {\n            var leftBarWidth = barLeftElementOffsetWidth - labelPadding;\n            var rightBarWidth = (barRightElementOffsetWidth - barLeftElementOffsetWidth) - labelPadding;\n        } else {\n            var leftBarWidth = (barLeftElementOffsetWidth - barRightElementOffsetWidth) - labelPadding;\n            var rightBarWidth = barRightElementOffsetWidth - labelPadding;\n        }\n\n        var labelLeftElementOffsetWidth = this._labelLeftElement.offsetWidth;\n        var labelRightElementOffsetWidth = this._labelRightElement.offsetWidth;\n\n        var labelBefore = (labelLeftElementOffsetWidth > leftBarWidth);\n        var labelAfter = (labelRightElementOffsetWidth > rightBarWidth);\n        var graphElementOffsetWidth = this._graphElement.offsetWidth;\n\n        if (labelBefore && (graphElementOffsetWidth * (this._percentages.start / 100)) < (labelLeftElementOffsetWidth + 10))\n            var leftHidden = true;\n\n        if (labelAfter && (graphElementOffsetWidth * ((100 - this._percentages.end) / 100)) < (labelRightElementOffsetWidth + 10))\n            var rightHidden = true;\n\n        if (barLeftElementOffsetWidth == barRightElementOffsetWidth) {\n            // The left/right label data are the same, so a before/after label can be replaced by an on-bar label.\n            if (labelBefore && !labelAfter)\n                leftHidden = true;\n            else if (labelAfter && !labelBefore)\n                rightHidden = true;\n        }\n\n        if (labelBefore) {\n            if (leftHidden)\n                this._labelLeftElement.addStyleClass(\"hidden\");\n            this._labelLeftElement.style.setProperty(\"right\", (100 - this._percentages.start) + \"%\");\n            this._labelLeftElement.addStyleClass(\"before\");\n        } else {\n            this._labelLeftElement.style.setProperty(\"left\", this._percentages.start + \"%\");\n            this._labelLeftElement.style.setProperty(\"right\", (100 - this._percentages.middle) + \"%\");\n        }\n\n        if (labelAfter) {\n            if (rightHidden)\n                this._labelRightElement.addStyleClass(\"hidden\");\n            this._labelRightElement.style.setProperty(\"left\", this._percentages.end + \"%\");\n            this._labelRightElement.addStyleClass(\"after\");\n        } else {\n            this._labelRightElement.style.setProperty(\"left\", this._percentages.middle + \"%\");\n            this._labelRightElement.style.setProperty(\"right\", (100 - this._percentages.end) + \"%\");\n        }\n    }\n}\n\nWebInspector.NetworkDataGridNode.NameComparator = function(a, b)\n{\n    var aFileName = a._resource.displayName + (a._resource.queryString ? a._resource.queryString : \"\");\n    var bFileName = b._resource.displayName + (b._resource.queryString ? b._resource.queryString : \"\");\n    if (aFileName > bFileName)\n        return 1;\n    if (bFileName > aFileName)\n        return -1;\n    return 0;\n}\n\nWebInspector.NetworkDataGridNode.SizeComparator = function(a, b)\n{\n    if (b._resource.cached && !a._resource.cached)\n        return 1;\n    if (a._resource.cached && !b._resource.cached)\n        return -1;\n\n    if (a._resource.resourceSize === b._resource.resourceSize)\n        return 0;\n\n    return a._resource.resourceSize - b._resource.resourceSize;\n}\n\nWebInspector.NetworkDataGridNode.ResourcePropertyComparator = function(propertyName, revert, a, b)\n{\n    var aValue = a._resource[propertyName];\n    var bValue = b._resource[propertyName];\n    if (aValue > bValue)\n        return revert ? -1 : 1;\n    if (bValue > aValue)\n        return revert ? 1 : -1;\n    return 0;\n}\n\nWebInspector.NetworkDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;\n\nWebInspector.NetworkTotalGridNode = function(element)\n{\n    this._summaryBarElement = element;\n    WebInspector.DataGridNode.call(this, {summaryRow: true});\n}\n\nWebInspector.NetworkTotalGridNode.prototype = {\n    isFilteredOut: function()\n    {\n        return false;\n    },\n\n    get selectable()\n    {\n        return false;\n    },\n\n    createCells: function()\n    {\n        var td = document.createElement(\"td\");\n        td.setAttribute(\"colspan\", 7);\n        td.className = \"network-summary\";\n        td.appendChild(this._summaryBarElement);\n        this._element.appendChild(td);\n    }\n}\n\nWebInspector.NetworkTotalGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Object.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Object = function() {\n}\n\nWebInspector.Object.prototype = {\n    addEventListener: function(eventType, listener, thisObject)\n    {\n        if (!(\"_listeners\" in this))\n            this._listeners = {};\n        if (!(eventType in this._listeners))\n            this._listeners[eventType] = [];\n        this._listeners[eventType].push({ thisObject: thisObject, listener: listener });\n    },\n\n    removeEventListener: function(eventType, listener, thisObject)\n    {\n        if (!(\"_listeners\" in this) || !(eventType in this._listeners))\n            return;\n        var listeners = this._listeners[eventType];\n        for (var i = 0; i < listeners.length; ++i) {\n            if (listener && listeners[i].listener === listener && listeners[i].thisObject === thisObject)\n                listeners.splice(i, 1);\n            else if (!listener && thisObject && listeners[i].thisObject === thisObject)\n                listeners.splice(i, 1);\n        }\n\n        if (!listeners.length)\n            delete this._listeners[eventType];\n    },\n\n    removeAllListeners: function()\n    {\n        delete this._listeners;\n    },\n\n    dispatchEventToListeners: function(eventType, eventData)\n    {\n        if (!(\"_listeners\" in this) || !(eventType in this._listeners))\n            return;\n\n        var stoppedPropagation = false;\n\n        function stopPropagation()\n        {\n            stoppedPropagation = true;\n        }\n\n        function preventDefault()\n        {\n            this.defaultPrevented = true;\n        }\n\n        var event = {target: this, type: eventType, data: eventData, defaultPrevented: false};\n        event.stopPropagation = stopPropagation;\n        event.preventDefault = preventDefault;\n\n        var listeners = this._listeners[eventType].slice(0);\n        for (var i = 0; i < listeners.length; ++i) {\n            listeners[i].listener.call(listeners[i].thisObject, event);\n            if (stoppedPropagation)\n                break;\n        }\n\n        return event.defaultPrevented;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ObjectPropertiesSection.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder, ignoreHasOwnProperty, extraProperties, treeElementConstructor)\n{\n    this.emptyPlaceholder = (emptyPlaceholder || WebInspector.UIString(\"No Properties\"));\n    this.object = object;\n    this.ignoreHasOwnProperty = ignoreHasOwnProperty;\n    this.extraProperties = extraProperties;\n    this.treeElementConstructor = treeElementConstructor || WebInspector.ObjectPropertyTreeElement;\n    this.editable = true;\n\n    WebInspector.PropertiesSection.call(this, title, subtitle);\n}\n\nWebInspector.ObjectPropertiesSection.prototype = {\n    onpopulate: function()\n    {\n        this.update();\n    },\n\n    update: function()\n    {\n        var self = this;\n        var callback = function(properties) {\n            if (!properties)\n                return;\n            self.updateProperties(properties);\n        };\n        this.object.getProperties(this.ignoreHasOwnProperty, true, callback);\n    },\n\n    updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)\n    {\n        if (!rootTreeElementConstructor)\n            rootTreeElementConstructor = this.treeElementConstructor;\n            \n        if (!rootPropertyComparer)\n            rootPropertyComparer = WebInspector.ObjectPropertiesSection.CompareProperties;\n            \n        if (this.extraProperties)\n            for (var i = 0; i < this.extraProperties.length; ++i)\n                properties.push(this.extraProperties[i]);\n                \n        properties.sort(rootPropertyComparer);\n\n        this.propertiesTreeOutline.removeChildren();\n\n        for (var i = 0; i < properties.length; ++i) {\n            properties[i].parentObject = this.object;\n            this.propertiesTreeOutline.appendChild(new rootTreeElementConstructor(properties[i]));\n        }\n\n        if (!this.propertiesTreeOutline.children.length) {\n            var title = \"<div class=\\\"info\\\">\" + this.emptyPlaceholder + \"</div>\";\n            var infoElement = new TreeElement(null, null, false);\n            infoElement.titleHTML = title;\n            this.propertiesTreeOutline.appendChild(infoElement);\n        }\n        this.propertiesForTest = properties;\n    }\n}\n\nWebInspector.ObjectPropertiesSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype;\n\nWebInspector.ObjectPropertiesSection.CompareProperties = function(propertyA, propertyB) \n{\n    var a = propertyA.name;\n    var b = propertyB.name;\n    if (a === \"__proto__\")\n        return 1;\n    if (b === \"__proto__\")\n        return -1;\n\n    // if used elsewhere make sure to\n    //  - convert a and b to strings (not needed here, properties are all strings)\n    //  - check if a == b (not needed here, no two properties can be the same)\n\n    var diff = 0;\n    var chunk = /^\\d+|^\\D+/;\n    var chunka, chunkb, anum, bnum;\n    while (diff === 0) {\n        if (!a && b)\n            return -1;\n        if (!b && a)\n            return 1;\n        chunka = a.match(chunk)[0];\n        chunkb = b.match(chunk)[0];\n        anum = !isNaN(chunka);\n        bnum = !isNaN(chunkb);\n        if (anum && !bnum)\n            return -1;\n        if (bnum && !anum)\n            return 1;\n        if (anum && bnum) {\n            diff = chunka - chunkb;\n            if (diff === 0 && chunka.length !== chunkb.length) {\n                if (!+chunka && !+chunkb) // chunks are strings of all 0s (special case)\n                    return chunka.length - chunkb.length;\n                else\n                    return chunkb.length - chunka.length;\n            }\n        } else if (chunka !== chunkb)\n            return (chunka < chunkb) ? -1 : 1;\n        a = a.substring(chunka.length);\n        b = b.substring(chunkb.length);\n    }\n    return diff;\n}\n\nWebInspector.ObjectPropertyTreeElement = function(property)\n{\n    this.property = property;\n\n    // Pass an empty title, the title gets made later in onattach.\n    TreeElement.call(this, \"\", null, false);\n}\n\nWebInspector.ObjectPropertyTreeElement.prototype = {\n    onpopulate: function()\n    {\n        if (this.children.length && !this.shouldRefreshChildren)\n            return;\n\n        var callback = function(properties) {\n            this.removeChildren();\n            if (!properties)\n                return;\n\n            properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties);\n            for (var i = 0; i < properties.length; ++i) {\n                this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));\n            }\n        };\n        this.property.value.getOwnProperties(true, callback.bind(this));\n    },\n\n    ondblclick: function(event)\n    {\n        this.startEditing();\n    },\n\n    onattach: function()\n    {\n        this.update();\n    },\n\n    update: function()\n    {\n        this.nameElement = document.createElement(\"span\");\n        this.nameElement.className = \"name\";\n        this.nameElement.textContent = this.property.name;\n\n        var separatorElement = document.createElement(\"span\");\n        separatorElement.className = \"separator\";\n        separatorElement.textContent = \": \";\n        \n        this.valueElement = document.createElement(\"span\");\n        this.valueElement.className = \"value\";\n\n        var description = this.property.value.description;\n        // Render \\n as a nice unicode cr symbol.\n        if (this.property.value.type === \"string\" && typeof description === \"string\")\n            description = description.replace(/\\n/g, \"\\u21B5\");\n        this.valueElement.textContent = description;\n\n        if (this.property.isGetter)\n            this.valueElement.addStyleClass(\"dimmed\");\n        if (this.property.value.isError())\n            this.valueElement.addStyleClass(\"error\");\n        if (this.property.value.type)\n            this.valueElement.addStyleClass(\"console-formatted-\" + this.property.value.type);\n        if (this.property.value.type === \"node\")\n            this.valueElement.addEventListener(\"contextmenu\", this._contextMenuEventFired.bind(this), false);\n\n        this.listItemElement.removeChildren();\n\n        this.listItemElement.appendChild(this.nameElement);\n        this.listItemElement.appendChild(separatorElement);\n        this.listItemElement.appendChild(this.valueElement);\n        this.hasChildren = this.property.value.hasChildren;\n    },\n\n    _contextMenuEventFired: function()\n    {\n        function selectNode(nodeId)\n        {\n            if (nodeId) {\n                WebInspector.panels.elements.switchToAndFocus(WebInspector.domAgent.nodeForId(nodeId));\n            }\n        }\n\n        function revealElement()\n        {\n            this.property.value.pushNodeToFrontend(selectNode);\n        }\n\n        var contextMenu = new WebInspector.ContextMenu();\n        contextMenu.appendItem(WebInspector.UIString(\"Reveal in Elements Panel\"), revealElement.bind(this));\n        contextMenu.show(event);\n    },\n\n    updateSiblings: function()\n    {\n        if (this.parent.root)\n            this.treeOutline.section.update();\n        else\n            this.parent.shouldRefreshChildren = true;\n    },\n\n    startEditing: function()\n    {\n        if (WebInspector.isBeingEdited(this.valueElement) || !this.treeOutline.section.editable)\n            return;\n\n        var context = { expanded: this.expanded };\n\n        // Lie about our children to prevent expanding on double click and to collapse subproperties.\n        this.hasChildren = false;\n\n        this.listItemElement.addStyleClass(\"editing-sub-part\");\n\n        WebInspector.startEditing(this.valueElement, {\n            context: context,\n            commitHandler: this.editingCommitted.bind(this),\n            cancelHandler: this.editingCancelled.bind(this)\n        });\n    },\n\n    editingEnded: function(context)\n    {\n        this.listItemElement.scrollLeft = 0;\n        this.listItemElement.removeStyleClass(\"editing-sub-part\");\n        if (context.expanded)\n            this.expand();\n    },\n\n    editingCancelled: function(element, context)\n    {\n        this.update();\n        this.editingEnded(context);\n    },\n\n    editingCommitted: function(element, userInput, previousContent, context)\n    {\n        if (userInput === previousContent)\n            return this.editingCancelled(element, context); // nothing changed, so cancel\n\n        this.applyExpression(userInput, true);\n\n        this.editingEnded(context);\n    },\n\n    applyExpression: function(expression, updateInterface)\n    {\n        expression = expression.trim();\n        var expressionLength = expression.length;\n        var self = this;\n        var callback = function(success) {\n            if (!updateInterface)\n                return;\n\n            if (!success)\n                self.update();\n\n            if (!expressionLength) {\n                // The property was deleted, so remove this tree element.\n                self.parent.removeChild(this);\n            } else {\n                // Call updateSiblings since their value might be based on the value that just changed.\n                self.updateSiblings();\n            }\n        };\n        this.property.parentObject.setPropertyValue(this.property.name, expression.trim(), callback);\n    }\n}\n\nWebInspector.ObjectPropertyTreeElement.prototype.__proto__ = TreeElement.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Panel.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Panel = function(name)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"panel\");\n    this.element.addStyleClass(name);\n    this._panelName = name;\n\n    WebInspector.settings.installApplicationSetting(this._sidebarWidthSettingName(), undefined);\n}\n\n// Should by in sync with style declarations.\nWebInspector.Panel.counterRightMargin = 25;\n\nWebInspector.Panel.prototype = {\n    get toolbarItem()\n    {\n        if (this._toolbarItem)\n            return this._toolbarItem;\n\n        // Sample toolbar item as markup:\n        // <button class=\"toolbar-item resources toggleable\">\n        // <div class=\"toolbar-icon\"></div>\n        // <div class=\"toolbar-label\">Resources</div>\n        // </button>\n\n        this._toolbarItem = document.createElement(\"button\");\n        this._toolbarItem.className = \"toolbar-item toggleable\";\n        this._toolbarItem.panel = this;\n\n        this._toolbarItem.addStyleClass(this._panelName);\n\n        var iconElement = document.createElement(\"div\");\n        iconElement.className = \"toolbar-icon\";\n        this._toolbarItem.appendChild(iconElement);\n\n        if (\"toolbarItemLabel\" in this) {\n            var labelElement = document.createElement(\"div\");\n            labelElement.className = \"toolbar-label\";\n            labelElement.textContent = this.toolbarItemLabel;\n            this._toolbarItem.appendChild(labelElement);\n        }\n\n        return this._toolbarItem;\n    },\n\n    get name()\n    {\n        return this._panelName;\n    },\n\n    show: function()\n    {\n        WebInspector.View.prototype.show.call(this);\n\n        var statusBarItems = this.statusBarItems;\n        if (statusBarItems) {\n            this._statusBarItemContainer = document.createElement(\"div\");\n            for (var i = 0; i < statusBarItems.length; ++i)\n                this._statusBarItemContainer.appendChild(statusBarItems[i]);\n            document.getElementById(\"main-status-bar\").appendChild(this._statusBarItemContainer);\n        }\n\n        if (\"_toolbarItem\" in this)\n            this._toolbarItem.addStyleClass(\"toggled-on\");\n\n        WebInspector.currentFocusElement = this.defaultFocusedElement;\n\n        this.restoreSidebarWidth();\n        this._restoreScrollPositions();\n    },\n\n    hide: function()\n    {\n        this._storeScrollPositions();\n        WebInspector.View.prototype.hide.call(this);\n\n        if (this._statusBarItemContainer && this._statusBarItemContainer.parentNode)\n            this._statusBarItemContainer.parentNode.removeChild(this._statusBarItemContainer);\n        delete this._statusBarItemContainer;\n        if (\"_toolbarItem\" in this)\n            this._toolbarItem.removeStyleClass(\"toggled-on\");\n    },\n\n    get defaultFocusedElement()\n    {\n        return this.sidebarTreeElement || this.element;\n    },\n\n    attach: function()\n    {\n        if (!this.element.parentNode)\n            document.getElementById(\"main-panels\").appendChild(this.element);\n    },\n\n    searchCanceled: function()\n    {\n        if (this._searchResults) {\n            for (var i = 0; i < this._searchResults.length; ++i) {\n                var view = this._searchResults[i];\n                if (view.searchCanceled)\n                    view.searchCanceled();\n                delete view.currentQuery;\n            }\n        }\n\n        WebInspector.updateSearchMatchesCount(0, this);\n\n        if (this._currentSearchChunkIntervalIdentifier) {\n            clearInterval(this._currentSearchChunkIntervalIdentifier);\n            delete this._currentSearchChunkIntervalIdentifier;\n        }\n\n        this._totalSearchMatches = 0;\n        this._currentSearchResultIndex = 0;\n        this._searchResults = [];\n    },\n\n    performSearch: function(query)\n    {\n        // Call searchCanceled since it will reset everything we need before doing a new search.\n        this.searchCanceled(true);\n\n        var searchableViews = this.searchableViews;\n        if (!searchableViews || !searchableViews.length)\n            return;\n\n        var parentElement = this.viewsContainerElement;\n        var visibleView = this.visibleView;\n        var sortFuction = this.searchResultsSortFunction;\n\n        var matchesCountUpdateTimeout = null;\n\n        function updateMatchesCount()\n        {\n            WebInspector.updateSearchMatchesCount(this._totalSearchMatches, this);\n            matchesCountUpdateTimeout = null;\n        }\n\n        function updateMatchesCountSoon()\n        {\n            if (matchesCountUpdateTimeout)\n                return;\n            // Update the matches count every half-second so it doesn't feel twitchy.\n            matchesCountUpdateTimeout = setTimeout(updateMatchesCount.bind(this), 500);\n        }\n\n        function finishedCallback(view, searchMatches)\n        {\n            if (!searchMatches)\n                return;\n\n            this._totalSearchMatches += searchMatches;\n            this._searchResults.push(view);\n\n            if (sortFuction)\n                this._searchResults.sort(sortFuction);\n\n            if (this.searchMatchFound)\n                this.searchMatchFound(view, searchMatches);\n\n            updateMatchesCountSoon.call(this);\n\n            if (view === visibleView)\n                view.jumpToFirstSearchResult();\n        }\n\n        var i = 0;\n        var panel = this;\n        var boundFinishedCallback = finishedCallback.bind(this);\n        var chunkIntervalIdentifier = null;\n\n        // Split up the work into chunks so we don't block the\n        // UI thread while processing.\n\n        function processChunk()\n        {\n            var view = searchableViews[i];\n\n            if (++i >= searchableViews.length) {\n                if (panel._currentSearchChunkIntervalIdentifier === chunkIntervalIdentifier)\n                    delete panel._currentSearchChunkIntervalIdentifier;\n                clearInterval(chunkIntervalIdentifier);\n            }\n\n            if (!view)\n                return;\n\n            if (view.element.parentNode !== parentElement && view.element.parentNode && parentElement)\n                view.detach();\n\n            view.currentQuery = query;\n            view.performSearch(query, boundFinishedCallback);\n        }\n\n        processChunk();\n\n        chunkIntervalIdentifier = setInterval(processChunk, 25);\n        this._currentSearchChunkIntervalIdentifier = chunkIntervalIdentifier;\n    },\n\n    jumpToNextSearchResult: function()\n    {\n        if (!this.showView || !this._searchResults || !this._searchResults.length)\n            return;\n\n        var showFirstResult = false;\n\n        this._currentSearchResultIndex = this._searchResults.indexOf(this.visibleView);\n        if (this._currentSearchResultIndex === -1) {\n            this._currentSearchResultIndex = 0;\n            showFirstResult = true;\n        }\n\n        var currentView = this._searchResults[this._currentSearchResultIndex];\n\n        if (currentView.showingLastSearchResult()) {\n            if (++this._currentSearchResultIndex >= this._searchResults.length)\n                this._currentSearchResultIndex = 0;\n            currentView = this._searchResults[this._currentSearchResultIndex];\n            showFirstResult = true;\n        }\n\n        if (currentView !== this.visibleView) {\n            this.showView(currentView);\n            WebInspector.focusSearchField();\n        }\n\n        if (showFirstResult)\n            currentView.jumpToFirstSearchResult();\n        else\n            currentView.jumpToNextSearchResult();\n    },\n\n    jumpToPreviousSearchResult: function()\n    {\n        if (!this.showView || !this._searchResults || !this._searchResults.length)\n            return;\n\n        var showLastResult = false;\n\n        this._currentSearchResultIndex = this._searchResults.indexOf(this.visibleView);\n        if (this._currentSearchResultIndex === -1) {\n            this._currentSearchResultIndex = 0;\n            showLastResult = true;\n        }\n\n        var currentView = this._searchResults[this._currentSearchResultIndex];\n\n        if (currentView.showingFirstSearchResult()) {\n            if (--this._currentSearchResultIndex < 0)\n                this._currentSearchResultIndex = (this._searchResults.length - 1);\n            currentView = this._searchResults[this._currentSearchResultIndex];\n            showLastResult = true;\n        }\n\n        if (currentView !== this.visibleView) {\n            this.showView(currentView);\n            WebInspector.focusSearchField();\n        }\n\n        if (showLastResult)\n            currentView.jumpToLastSearchResult();\n        else\n            currentView.jumpToPreviousSearchResult();\n    },\n\n    createSidebar: function(parentElement, resizerParentElement)\n    {\n        if (this.sidebarElement)\n            return;\n\n        if (!parentElement)\n            parentElement = this.element;\n\n        if (!resizerParentElement)\n            resizerParentElement = parentElement;\n\n        this.sidebarElement = document.createElement(\"div\");\n        this.sidebarElement.className = \"sidebar\";\n        parentElement.appendChild(this.sidebarElement);\n\n        this.sidebarResizeElement = document.createElement(\"div\");\n        this.sidebarResizeElement.className = \"sidebar-resizer-vertical\";\n        this.sidebarResizeElement.addEventListener(\"mousedown\", this._startSidebarDragging.bind(this), false);\n        resizerParentElement.appendChild(this.sidebarResizeElement);\n\n        this.sidebarTreeElement = document.createElement(\"ol\");\n        this.sidebarTreeElement.className = \"sidebar-tree\";\n        this.sidebarElement.appendChild(this.sidebarTreeElement);\n\n        this.sidebarTree = new TreeOutline(this.sidebarTreeElement);\n        this.sidebarTree.panel = this;\n    },\n\n    _sidebarWidthSettingName: function()\n    {\n        return this._panelName + \"SidebarWidth\";\n    },\n\n    _startSidebarDragging: function(event)\n    {\n        WebInspector.elementDragStart(this.sidebarResizeElement, this._sidebarDragging.bind(this), this._endSidebarDragging.bind(this), event, \"col-resize\");\n    },\n\n    _sidebarDragging: function(event)\n    {\n        this.updateSidebarWidth(event.pageX);\n\n        event.preventDefault();\n    },\n\n    _endSidebarDragging: function(event)\n    {\n        WebInspector.elementDragEnd(event);\n        this.saveSidebarWidth();\n    },\n\n    updateSidebarWidth: function(width)\n    {\n        if (!this.sidebarElement)\n            return;\n\n        if (this.sidebarElement.offsetWidth <= 0) {\n            // The stylesheet hasn't loaded yet or the window is closed,\n            // so we can't calculate what is need. Return early.\n            return;\n        }\n\n        if (!(\"_currentSidebarWidth\" in this))\n            this._currentSidebarWidth = this.sidebarElement.offsetWidth;\n\n        if (typeof width === \"undefined\")\n            width = this._currentSidebarWidth;\n\n        width = Number.constrain(width, Preferences.minSidebarWidth, window.innerWidth / 2);\n\n        this._currentSidebarWidth = width;\n        this.setSidebarWidth(width);\n\n        this.updateMainViewWidth(width);\n    },\n\n    setSidebarWidth: function(width)\n    {\n        this.sidebarElement.style.width = width + \"px\";\n        this.sidebarResizeElement.style.left = (width - 3) + \"px\";\n    },\n\n    restoreSidebarWidth: function()\n    {\n        var sidebarWidth = WebInspector.settings[this._sidebarWidthSettingName()];\n        this.updateSidebarWidth(sidebarWidth);\n    },\n\n    saveSidebarWidth: function()\n    {\n        if (!this.sidebarElement)\n            return;\n        WebInspector.settings[this._sidebarWidthSettingName()] = this.sidebarElement.offsetWidth;\n    },\n\n    updateMainViewWidth: function(width)\n    {\n        // Should be implemented by ancestors.\n    },\n\n    resize: function()\n    {\n        var visibleView = this.visibleView;\n        if (visibleView && \"resize\" in visibleView)\n            visibleView.resize();\n    },\n\n    canShowSourceLine: function(url, line)\n    {\n        return false;\n    },\n\n    showSourceLine: function(url, line)\n    {\n        return false;\n    },\n\n    elementsToRestoreScrollPositionsFor: function()\n    {\n        return [];\n    },\n\n    _storeScrollPositions: function()\n    {\n        var elements = this.elementsToRestoreScrollPositionsFor();\n        for (var i = 0; i < elements.length; ++i) {\n            var container = elements[i];\n            container._scrollTop = container.scrollTop;\n        }\n    },\n\n    _restoreScrollPositions: function()\n    {\n        var elements = this.elementsToRestoreScrollPositionsFor();\n        for (var i = 0; i < elements.length; ++i) {\n            var container = elements[i];\n            if (container._scrollTop)\n                container.scrollTop = container._scrollTop;\n        }\n    }\n}\n\nWebInspector.Panel.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/PanelEnablerView.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.PanelEnablerView = function(identifier, headingText, disclaimerText, buttonTitle)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"panel-enabler-view\");\n    this.element.addStyleClass(identifier);\n\n    this.contentElement = document.createElement(\"div\");\n    this.contentElement.className = \"panel-enabler-view-content\";\n    this.element.appendChild(this.contentElement);\n\n    this.imageElement = document.createElement(\"img\");\n    this.contentElement.appendChild(this.imageElement);\n\n    this.choicesForm = document.createElement(\"form\");\n    this.contentElement.appendChild(this.choicesForm);\n\n    this.headerElement = document.createElement(\"h1\");\n    this.headerElement.textContent = headingText;\n    this.choicesForm.appendChild(this.headerElement);\n\n    var self = this;\n    function enableOption(text, checked) {\n        var label = document.createElement(\"label\");\n        var option = document.createElement(\"input\");\n        option.type = \"radio\";\n        option.name = \"enable-option\";\n        if (checked)\n            option.checked = true;\n        label.appendChild(option);\n        label.appendChild(document.createTextNode(text));\n        self.choicesForm.appendChild(label);\n        return option;\n    };\n\n    this.enabledForSession = enableOption(WebInspector.UIString(\"Only enable for this session\"), true);\n    this.enabledAlways = enableOption(WebInspector.UIString(\"Always enable\"));\n\n    this.disclaimerElement = document.createElement(\"div\");\n    this.disclaimerElement.className = \"panel-enabler-disclaimer\";\n    this.disclaimerElement.textContent = disclaimerText;\n    this.choicesForm.appendChild(this.disclaimerElement);\n\n    this.enableButton = document.createElement(\"button\");\n    this.enableButton.setAttribute(\"type\", \"button\");\n    this.enableButton.textContent = buttonTitle;\n    this.enableButton.addEventListener(\"click\", this._enableButtonCicked.bind(this), false);\n    this.choicesForm.appendChild(this.enableButton);\n}\n\nWebInspector.PanelEnablerView.prototype = {\n    _enableButtonCicked: function()\n    {\n        this.dispatchEventToListeners(\"enable clicked\");\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n\n        setTimeout(this.resize.bind(this), 0);\n    },\n\n    resize: function()\n    {\n        this.imageElement.removeStyleClass(\"hidden\");\n\n        if (this.element.offsetWidth < (this.choicesForm.offsetWidth + this.imageElement.offsetWidth))\n            this.imageElement.addStyleClass(\"hidden\");\n    },\n\n    get alwaysEnabled() {\n        return this.enabledAlways.checked;\n    }\n}\n\nWebInspector.PanelEnablerView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Placard.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Placard = function(title, subtitle)\n{\n    this.element = document.createElement(\"div\");\n    this.element.className = \"placard\";\n    this.element.placard = this;\n\n    this.titleElement = document.createElement(\"div\");\n    this.titleElement.className = \"title\";\n\n    this.subtitleElement = document.createElement(\"div\");\n    this.subtitleElement.className = \"subtitle\";\n\n    this.element.appendChild(this.subtitleElement);\n    this.element.appendChild(this.titleElement);\n\n    this.title = title;\n    this.subtitle = subtitle;\n    this.selected = false;\n}\n\nWebInspector.Placard.prototype = {\n    get title()\n    {\n        return this._title;\n    },\n\n    set title(x)\n    {\n        if (this._title === x)\n            return;\n        this._title = x;\n        this.titleElement.textContent = x;\n    },\n\n    get subtitle()\n    {\n        return this._subtitle;\n    },\n\n    set subtitle(x)\n    {\n        if (this._subtitle === x)\n            return;\n        this._subtitle = x;\n        this.subtitleElement.textContent = x;\n    },\n\n    get selected()\n    {\n        return this._selected;\n    },\n\n    set selected(x)\n    {\n        if (x)\n            this.select();\n        else\n            this.deselect();\n    },\n\n    select: function()\n    {\n        if (this._selected)\n            return;\n        this._selected = true;\n        this.element.addStyleClass(\"selected\");\n    },\n\n    deselect: function()\n    {\n        if (!this._selected)\n            return;\n        this._selected = false;\n        this.element.removeStyleClass(\"selected\");\n    },\n\n    toggleSelected: function()\n    {\n        this.selected = !this.selected;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/PleaseWaitMessage.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.PleaseWaitMessage = function()\n{\n    this.element = document.createElement(\"div\");\n    this.element.className = \"please-wait-msg\";\n    this.element.textContent = WebInspector.UIString(\"Please wait\\u2026\");\n\n    this.cancelButton = document.createElement(\"button\");\n    this.cancelButton.textContent = WebInspector.UIString(\"Cancel\");\n    this.cancelButton.addEventListener(\"click\", this._cancelClicked.bind(this), false);\n}\n\nWebInspector.PleaseWaitMessage.prototype = {\n    _cancelClicked: function()\n    {\n        if (this._cancelCallback) {\n            var cancelCallback = this._cancelCallback;\n            delete this._cancelCallback;\n            cancelCallback();\n        }\n    },\n\n    hide: function()\n    {\n        var instance = WebInspector.PleaseWaitMessage.prototype.instance;\n        var message = instance.element;\n        if (message.parentNode)\n            message.parentNode.removeChild(message);\n    },\n\n    get instance()\n    {\n        if (!\"_instance\" in WebInspector.PleaseWaitMessage.prototype)\n            WebInspector.PleaseWaitMessage.prototype._instance = new WebInspector.PleaseWaitMessage();\n        return WebInspector.PleaseWaitMessage.prototype._instance;\n    },\n\n    show: function(element, cancelCallback)\n    {\n        var instance = WebInspector.PleaseWaitMessage.prototype.instance;\n        var message = instance.element;\n        if (message.parentNode === element)\n            return;\n        else if (message.parentNode)\n            message.parentNode.removeChild(message);\n        if (message.childNodes.length > 1)\n            message.removeChild(instance.cancelButton);\n        if (cancelCallback) {\n            message.appendChild(instance.cancelButton);\n            instance._cancelCallback = cancelCallback;\n        }\n        element.appendChild(message);\n    },\n\n    startAction: function(element, actionCallback, cancelCallback)\n    {\n        var instance = WebInspector.PleaseWaitMessage.prototype.instance;\n        var message = instance.element;\n        if (message.parentNode === element) {\n            actionCallback();\n            return;\n        }\n     \n        function doAction()\n        {\n            try {\n                actionCallback();\n            } finally {\n                if (message.parentNode)\n                    message.parentNode.removeChild(message);\n            }\n        }\n\n        WebInspector.PleaseWaitMessage.prototype.show(element, cancelCallback);\n        setTimeout(doAction, 0);\n    }\n};\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Popover.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Popover = function(contentElement)\n{\n    this.element = document.createElement(\"div\");\n    this.element.className = \"popover\";\n\n    this._popupArrowElement = document.createElement(\"div\");\n    this._popupArrowElement.className = \"arrow\";\n    this.element.appendChild(this._popupArrowElement);\n\n    this.contentElement = contentElement;\n    this._contentDiv = document.createElement(\"div\");\n    this._contentDiv.className = \"content\";\n}\n\nWebInspector.Popover.prototype = {\n    show: function(anchor, preferredWidth, preferredHeight)\n    {\n        // This should not happen, but we hide previous popup to be on the safe side.\n        if (WebInspector.Popover._popoverElement)\n            document.body.removeChild(WebInspector.Popover._popoverElement);\n        WebInspector.Popover._popoverElement = this.element;\n\n        // Temporarily attach in order to measure preferred dimensions.\n        this.contentElement.positionAt(0, 0);\n        document.body.appendChild(this.contentElement);\n        var preferredWidth = preferredWidth || this.contentElement.offsetWidth;\n        var preferredHeight = preferredHeight || this.contentElement.offsetHeight;\n\n        this._contentDiv.appendChild(this.contentElement);\n        this.element.appendChild(this._contentDiv);\n        document.body.appendChild(this.element);\n        this._positionElement(anchor, preferredWidth, preferredHeight);\n    },\n\n    hide: function()\n    {\n        if (WebInspector.Popover._popoverElement) {\n            delete WebInspector.Popover._popoverElement;\n            document.body.removeChild(this.element);\n        }\n    },\n\n    _positionElement: function(anchorElement, preferredWidth, preferredHeight)\n    {\n        var borderWidth = 25;\n        var scrollerWidth = 11;\n        var arrowHeight = 15;\n        var arrowOffset = 10;\n        var borderRadius = 10;\n\n        // Skinny tooltips are not pretty, their arrow location is not nice.\n        preferredWidth = Math.max(preferredWidth, 50);\n        var totalWidth = window.innerWidth;\n        var totalHeight = window.innerHeight;\n\n        var anchorBox = {x: anchorElement.totalOffsetLeft, y: anchorElement.totalOffsetTop, width: anchorElement.offsetWidth, height: anchorElement.offsetHeight};\n        while (anchorElement !== document.body) {\n            if (anchorElement.scrollLeft)\n                anchorBox.x -= anchorElement.scrollLeft;\n            if (anchorElement.scrollTop)\n                anchorBox.y -= anchorElement.scrollTop;\n            anchorElement = anchorElement.parentElement;\n        }\n\n        var newElementPosition = { x: 0, y: 0, width: preferredWidth + scrollerWidth, height: preferredHeight };\n\n        var verticalAlignment;\n        var roomAbove = anchorBox.y;\n        var roomBelow = totalHeight - anchorBox.y - anchorBox.height;\n\n        if (roomAbove > roomBelow) {\n            // Positioning above the anchor.\n            if (anchorBox.y > newElementPosition.height + arrowHeight + borderRadius)\n                newElementPosition.y = anchorBox.y - newElementPosition.height - arrowHeight;\n            else {\n                newElementPosition.y = borderRadius * 2;\n                newElementPosition.height = anchorBox.y - borderRadius * 2 - arrowHeight;\n            }\n            verticalAlignment = \"bottom\";\n        } else {\n            // Positioning below the anchor.\n            newElementPosition.y = anchorBox.y + anchorBox.height + arrowHeight;\n            if (newElementPosition.y + newElementPosition.height + arrowHeight - borderWidth >= totalHeight)\n                newElementPosition.height = totalHeight - anchorBox.y - anchorBox.height - borderRadius * 2 - arrowHeight;\n            // Align arrow.\n            verticalAlignment = \"top\";\n        }\n\n        var horizontalAlignment;\n        if (anchorBox.x + newElementPosition.width < totalWidth) {\n            newElementPosition.x = Math.max(borderRadius, anchorBox.x - borderRadius - arrowOffset);\n            horizontalAlignment = \"left\";\n        } else if (newElementPosition.width + borderRadius * 2 < totalWidth) {\n            newElementPosition.x = totalWidth - newElementPosition.width - borderRadius;\n            horizontalAlignment = \"right\";\n            // Position arrow accurately.\n            var arrowRightPosition = Math.max(0, totalWidth - anchorBox.x - anchorBox.width - borderRadius - arrowOffset);\n            arrowRightPosition += anchorBox.width / 2;\n            this._popupArrowElement.style.right = arrowRightPosition + \"px\";\n        } else {\n            newElementPosition.x = borderRadius;\n            newElementPosition.width = totalWidth - borderRadius * 2;\n            newElementPosition.height += scrollerWidth;\n            horizontalAlignment = \"left\";\n            if (verticalAlignment === \"bottom\")\n                newElementPosition.y -= scrollerWidth;\n            // Position arrow accurately.\n            this._popupArrowElement.style.left = Math.max(0, anchorBox.x - borderRadius * 2 - arrowOffset) + \"px\";\n            this._popupArrowElement.style.left += anchorBox.width / 2;\n        }\n\n        this.element.className = \"popover \" + verticalAlignment + \"-\" + horizontalAlignment + \"-arrow\";\n        this.element.positionAt(newElementPosition.x - borderWidth, newElementPosition.y - borderWidth);\n        this.element.style.width = newElementPosition.width + borderWidth * 2 + \"px\";\n        this.element.style.height = newElementPosition.height + borderWidth * 2 + \"px\";\n    }\n}\n\nWebInspector.PopoverHelper = function(panelElement, getAnchor, showPopup, showOnClick, onHide)\n{\n    this._panelElement = panelElement;\n    this._getAnchor = getAnchor;\n    this._showPopup = showPopup;\n    this._showOnClick = showOnClick;\n    this._onHide = onHide;\n    panelElement.addEventListener(\"mousedown\", this._mouseDown.bind(this), false);\n    panelElement.addEventListener(\"mousemove\", this._mouseMove.bind(this), false);\n    this.setTimeout(1000);\n}\n\nWebInspector.PopoverHelper.prototype = {\n    setTimeout: function(timeout)\n    {\n         this._timeout = timeout;\n    },\n\n    _mouseDown: function(event)\n    {\n        this._killHidePopupTimer();\n        this._handleMouseAction(event, true);\n    },\n\n    _mouseMove: function(event)\n    {\n        // Pretend that nothing has happened.\n        if (this._hoverElement === event.target || (this._hoverElement && this._hoverElement.isAncestor(event.target)))\n            return;\n\n        // User has 500ms (this._timeout / 2) to reach the popup.\n        if (this._popup && !this._hidePopupTimer) {\n            var self = this;\n            function doHide()\n            {\n                self._hidePopup();\n                delete self._hidePopupTimer;\n            }\n            this._hidePopupTimer = setTimeout(doHide, this._timeout / 2);\n        }\n\n        this._handleMouseAction(event);\n    },\n\n    _handleMouseAction: function(event, isMouseDown)\n    {\n        this._resetHoverTimer();\n\n        this._hoverElement = this._getAnchor(event.target);\n        if (!this._hoverElement)\n            return;\n\n        var toolTipDelay = isMouseDown ? 0 : (this._popup ? this._timeout * 0.6 : this._timeout);\n        this._hoverTimer = setTimeout(this._mouseHover.bind(this, this._hoverElement), toolTipDelay);\n    },\n\n    _resetHoverTimer: function()\n    {\n        if (this._hoverTimer) {\n            clearTimeout(this._hoverTimer);\n            delete this._hoverTimer;\n        }\n    },\n\n    hidePopup: function()\n    {\n        this._resetHoverTimer();\n        this._hidePopup();\n    },\n\n    _hidePopup: function()\n    {\n        if (!this._popup)\n            return;\n\n        if (this._onHide)\n            this._onHide();\n\n        this._popup.hide();\n        delete this._popup;\n    },\n\n    _mouseHover: function(element)\n    {\n        delete this._hoverTimer;\n\n        this._popup = this._showPopup(element);\n        if (this._popup)\n            this._popup.contentElement.addEventListener(\"mousemove\", this._killHidePopupTimer.bind(this), true);\n    },\n\n    _killHidePopupTimer: function()\n    {\n        if (this._hidePopupTimer) {\n            clearTimeout(this._hidePopupTimer);\n            delete this._hidePopupTimer;\n\n            // We know that we reached the popup, but we might have moved over other elements.\n            // Discard pending command.\n            this._resetHoverTimer();\n        }\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ProfileDataGridTree.js",
    "content": "/*\n * Copyright (C) 2009 280 North Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ProfileDataGridNode = function(profileView, profileNode, owningTree, hasChildren)\n{\n    this.profileView = profileView;\n    this.profileNode = profileNode;\n\n    WebInspector.DataGridNode.call(this, null, hasChildren);\n\n    this.addEventListener(\"populate\", this._populate, this);\n\n    this.tree = owningTree;\n\n    this.childrenByCallUID = {};\n    this.lastComparator = null;\n\n    this.callUID = profileNode.callUID;\n    this.selfTime = profileNode.selfTime;\n    this.totalTime = profileNode.totalTime;\n    this.functionName = profileNode.functionName;\n    this.numberOfCalls = profileNode.numberOfCalls;\n    this.url = profileNode.url;\n}\n\nWebInspector.ProfileDataGridNode.prototype = {\n    get data()\n    {\n        function formatMilliseconds(time)\n        {\n            return Number.secondsToString(time / 1000, !Preferences.samplingCPUProfiler);\n        }\n\n        var data = {};\n\n        data[\"function\"] = this.functionName;\n        data[\"calls\"] = this.numberOfCalls;\n\n        if (this.profileView.showSelfTimeAsPercent)\n            data[\"self\"] = WebInspector.UIString(\"%.2f%%\", this.selfPercent);\n        else\n            data[\"self\"] = formatMilliseconds(this.selfTime);\n\n        if (this.profileView.showTotalTimeAsPercent)\n            data[\"total\"] = WebInspector.UIString(\"%.2f%%\", this.totalPercent);\n        else\n            data[\"total\"] = formatMilliseconds(this.totalTime);\n\n        if (this.profileView.showAverageTimeAsPercent)\n            data[\"average\"] = WebInspector.UIString(\"%.2f%%\", this.averagePercent);\n        else\n            data[\"average\"] = formatMilliseconds(this.averageTime);\n\n        return data;\n    },\n\n    createCell: function(columnIdentifier)\n    {\n        var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);\n\n        if (columnIdentifier === \"self\" && this._searchMatchedSelfColumn)\n            cell.addStyleClass(\"highlight\");\n        else if (columnIdentifier === \"total\" && this._searchMatchedTotalColumn)\n            cell.addStyleClass(\"highlight\");\n        else if (columnIdentifier === \"average\" && this._searchMatchedAverageColumn)\n            cell.addStyleClass(\"highlight\");\n        else if (columnIdentifier === \"calls\" && this._searchMatchedCallsColumn)\n            cell.addStyleClass(\"highlight\");\n\n        if (columnIdentifier !== \"function\")\n            return cell;\n\n        if (this.profileNode._searchMatchedFunctionColumn)\n            cell.addStyleClass(\"highlight\");\n\n        if (this.profileNode.url) {\n            var lineNumber;\n            if (this.profileNode.lineNumber > 0)\n                lineNumber = this.profileNode.lineNumber;\n            var urlElement = WebInspector.linkifyResourceAsNode(this.profileNode.url, \"scripts\", lineNumber, \"profile-node-file\");\n            cell.insertBefore(urlElement, cell.firstChild);\n        }\n\n        return cell;\n    },\n\n    select: function(supressSelectedEvent)\n    {\n        WebInspector.DataGridNode.prototype.select.call(this, supressSelectedEvent);\n        this.profileView._dataGridNodeSelected(this);\n    },\n\n    deselect: function(supressDeselectedEvent)\n    {\n        WebInspector.DataGridNode.prototype.deselect.call(this, supressDeselectedEvent);\n        this.profileView._dataGridNodeDeselected(this);\n    },\n\n    sort: function(/*Function*/ comparator, /*Boolean*/ force)\n    {\n        var gridNodeGroups = [[this]];\n\n        for (var gridNodeGroupIndex = 0; gridNodeGroupIndex < gridNodeGroups.length; ++gridNodeGroupIndex) {\n            var gridNodes = gridNodeGroups[gridNodeGroupIndex];\n            var count = gridNodes.length;\n\n            for (var index = 0; index < count; ++index) {\n                var gridNode = gridNodes[index];\n\n                // If the grid node is collapsed, then don't sort children (save operation for later).\n                // If the grid node has the same sorting as previously, then there is no point in sorting it again.\n                if (!force && (!gridNode.expanded || gridNode.lastComparator === comparator)) {\n                    if (gridNode.children.length)\n                        gridNode.shouldRefreshChildren = true;\n                    continue;\n                }\n\n                gridNode.lastComparator = comparator;\n\n                var children = gridNode.children;\n                var childCount = children.length;\n\n                if (childCount) {\n                    children.sort(comparator);\n\n                    for (var childIndex = 0; childIndex < childCount; ++childIndex)\n                        children[childIndex]._recalculateSiblings(childIndex);\n\n                    gridNodeGroups.push(children);\n                }\n            }\n        }\n    },\n\n    insertChild: function(/*ProfileDataGridNode*/ profileDataGridNode, index)\n    {\n        WebInspector.DataGridNode.prototype.insertChild.call(this, profileDataGridNode, index);\n\n        this.childrenByCallUID[profileDataGridNode.callUID] = profileDataGridNode;\n    },\n\n    removeChild: function(/*ProfileDataGridNode*/ profileDataGridNode)\n    {\n        WebInspector.DataGridNode.prototype.removeChild.call(this, profileDataGridNode);\n\n        delete this.childrenByCallUID[profileDataGridNode.callUID];\n    },\n\n    removeChildren: function(/*ProfileDataGridNode*/ profileDataGridNode)\n    {\n        WebInspector.DataGridNode.prototype.removeChildren.call(this);\n\n        this.childrenByCallUID = {};\n    },\n\n    findChild: function(/*Node*/ node)\n    {\n        if (!node)\n            return null;\n        return this.childrenByCallUID[node.callUID];\n    },\n\n    get averageTime()\n    {\n        return this.selfTime / Math.max(1, this.numberOfCalls);\n    },\n\n    get averagePercent()\n    {\n        return this.averageTime / this.tree.totalTime * 100.0;\n    },\n\n    get selfPercent()\n    {\n        return this.selfTime / this.tree.totalTime * 100.0;\n    },\n\n    get totalPercent()\n    {\n        return this.totalTime / this.tree.totalTime * 100.0;\n    },\n\n    get _parent()\n    {\n        return this.parent !== this.dataGrid ? this.parent : this.tree;\n    },\n\n    _populate: function(event)\n    {\n        this._sharedPopulate();\n\n        if (this._parent) {\n            var currentComparator = this._parent.lastComparator;\n\n            if (currentComparator)\n                this.sort(currentComparator, true);\n        }\n\n        if (this.removeEventListener)\n            this.removeEventListener(\"populate\", this._populate, this);\n    },\n\n    // When focusing and collapsing we modify lots of nodes in the tree.\n    // This allows us to restore them all to their original state when we revert.\n    _save: function()\n    {\n        if (this._savedChildren)\n            return;\n\n        this._savedSelfTime = this.selfTime;\n        this._savedTotalTime = this.totalTime;\n        this._savedNumberOfCalls = this.numberOfCalls;\n\n        this._savedChildren = this.children.slice();\n    },\n\n    // When focusing and collapsing we modify lots of nodes in the tree.\n    // This allows us to restore them all to their original state when we revert.\n    _restore: function()\n    {\n        if (!this._savedChildren)\n            return;\n\n        this.selfTime = this._savedSelfTime;\n        this.totalTime = this._savedTotalTime;\n        this.numberOfCalls = this._savedNumberOfCalls;\n\n        this.removeChildren();\n\n        var children = this._savedChildren;\n        var count = children.length;\n\n        for (var index = 0; index < count; ++index) {\n            children[index]._restore();\n            this.appendChild(children[index]);\n        }\n    },\n\n    _merge: function(child, shouldAbsorb)\n    {\n        this.selfTime += child.selfTime;\n\n        if (!shouldAbsorb) {\n            this.totalTime += child.totalTime;\n            this.numberOfCalls += child.numberOfCalls;\n        }\n\n        var children = this.children.slice();\n\n        this.removeChildren();\n\n        var count = children.length;\n\n        for (var index = 0; index < count; ++index) {\n            if (!shouldAbsorb || children[index] !== child)\n                this.appendChild(children[index]);\n        }\n\n        children = child.children.slice();\n        count = children.length;\n\n        for (var index = 0; index < count; ++index) {\n            var orphanedChild = children[index],\n                existingChild = this.childrenByCallUID[orphanedChild.callUID];\n\n            if (existingChild)\n                existingChild._merge(orphanedChild, false);\n            else\n                this.appendChild(orphanedChild);\n        }\n    }\n}\n\nWebInspector.ProfileDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;\n\nWebInspector.ProfileDataGridTree = function(profileView, profileNode)\n{\n    this.tree = this;\n    this.children = [];\n\n    this.profileView = profileView;\n\n    this.totalTime = profileNode.totalTime;\n    this.lastComparator = null;\n\n    this.childrenByCallUID = {};\n}\n\nWebInspector.ProfileDataGridTree.prototype = {\n    get expanded()\n    {\n        return true;\n    },\n\n    appendChild: function(child)\n    {\n        this.insertChild(child, this.children.length);\n    },\n\n    insertChild: function(child, index)\n    {\n        this.children.splice(index, 0, child);\n        this.childrenByCallUID[child.callUID] = child;\n    },\n\n    removeChildren: function()\n    {\n        this.children = [];\n        this.childrenByCallUID = {};\n    },\n\n    findChild: WebInspector.ProfileDataGridNode.prototype.findChild,\n    sort: WebInspector.ProfileDataGridNode.prototype.sort,\n\n    _save: function()\n    {\n        if (this._savedChildren)\n            return;\n\n        this._savedTotalTime = this.totalTime;\n        this._savedChildren = this.children.slice();\n    },\n\n    restore: function()\n    {\n        if (!this._savedChildren)\n            return;\n\n        this.children = this._savedChildren;\n        this.totalTime = this._savedTotalTime;\n\n        var children = this.children;\n        var count = children.length;\n\n        for (var index = 0; index < count; ++index)\n            children[index]._restore();\n\n        this._savedChildren = null;\n    }\n}\n\nWebInspector.ProfileDataGridTree.propertyComparators = [{}, {}];\n\nWebInspector.ProfileDataGridTree.propertyComparator = function(/*String*/ property, /*Boolean*/ isAscending)\n{\n    var comparator = this.propertyComparators[(isAscending ? 1 : 0)][property];\n\n    if (!comparator) {\n        if (isAscending) {\n            comparator = function(lhs, rhs)\n            {\n                if (lhs[property] < rhs[property])\n                    return -1;\n\n                if (lhs[property] > rhs[property])\n                    return 1;\n\n                return 0;\n            }\n        } else {\n            comparator = function(lhs, rhs)\n            {\n                if (lhs[property] > rhs[property])\n                    return -1;\n\n                if (lhs[property] < rhs[property])\n                    return 1;\n\n                return 0;\n            }\n        }\n\n        this.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;\n    }\n\n    return comparator;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ProfileView.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// FIXME: Rename the file.\n\nWebInspector.CPUProfileView = function(profile)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"profile-view\");\n\n    this.showSelfTimeAsPercent = true;\n    this.showTotalTimeAsPercent = true;\n    this.showAverageTimeAsPercent = true;\n\n    var columns = { \"self\": { title: WebInspector.UIString(\"Self\"), width: \"72px\", sort: \"descending\", sortable: true },\n                    \"total\": { title: WebInspector.UIString(\"Total\"), width: \"72px\", sortable: true },\n                    \"average\": { title: WebInspector.UIString(\"Average\"), width: \"72px\", sortable: true },\n                    \"calls\": { title: WebInspector.UIString(\"Calls\"), width: \"54px\", sortable: true },\n                    \"function\": { title: WebInspector.UIString(\"Function\"), disclosure: true, sortable: true } };\n\n    if (Preferences.samplingCPUProfiler) {\n        delete columns.average;\n        delete columns.calls;\n    }\n\n    this.dataGrid = new WebInspector.DataGrid(columns);\n    this.dataGrid.addEventListener(\"sorting changed\", this._sortData, this);\n    this.dataGrid.element.addEventListener(\"mousedown\", this._mouseDownInDataGrid.bind(this), true);\n    this.element.appendChild(this.dataGrid.element);\n\n    this.viewSelectElement = document.createElement(\"select\");\n    this.viewSelectElement.className = \"status-bar-item\";\n    this.viewSelectElement.addEventListener(\"change\", this._changeView.bind(this), false);\n    this.view = \"Heavy\";\n\n    var heavyViewOption = document.createElement(\"option\");\n    heavyViewOption.label = WebInspector.UIString(\"Heavy (Bottom Up)\");\n    var treeViewOption = document.createElement(\"option\");\n    treeViewOption.label = WebInspector.UIString(\"Tree (Top Down)\");\n    this.viewSelectElement.appendChild(heavyViewOption);\n    this.viewSelectElement.appendChild(treeViewOption);\n\n    this.percentButton = new WebInspector.StatusBarButton(\"\", \"percent-time-status-bar-item\");\n    this.percentButton.addEventListener(\"click\", this._percentClicked.bind(this), false);\n\n    this.focusButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Focus selected function.\"), \"focus-profile-node-status-bar-item\");\n    this.focusButton.disabled = true;\n    this.focusButton.addEventListener(\"click\", this._focusClicked.bind(this), false);\n\n    this.excludeButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Exclude selected function.\"), \"exclude-profile-node-status-bar-item\");\n    this.excludeButton.disabled = true;\n    this.excludeButton.addEventListener(\"click\", this._excludeClicked.bind(this), false);\n\n    this.resetButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Restore all functions.\"), \"reset-profile-status-bar-item\");\n    this.resetButton.visible = false;\n    this.resetButton.addEventListener(\"click\", this._resetClicked.bind(this), false);\n\n    this.profile = profile;\n\n    var self = this;\n    function profileCallback(profile)\n    {\n        self.profile.head = profile.head;\n        self._assignParentsInProfile();\n      \n        self.profileDataGridTree = self.bottomUpProfileDataGridTree;\n        self.profileDataGridTree.sort(WebInspector.ProfileDataGridTree.propertyComparator(\"selfTime\", false));\n     \n        self.refresh();\n     \n        self._updatePercentButton();\n    }\n\n    InspectorBackend.getProfile(this.profile.typeId, this.profile.uid, profileCallback);\n}\n\nWebInspector.CPUProfileView.prototype = {\n    get statusBarItems()\n    {\n        return [this.viewSelectElement, this.percentButton.element, this.focusButton.element, this.excludeButton.element, this.resetButton.element];\n    },\n\n    get profile()\n    {\n        return this._profile;\n    },\n\n    set profile(profile)\n    {\n        this._profile = profile;\n    },\n\n    get bottomUpProfileDataGridTree()\n    {\n        if (!this._bottomUpProfileDataGridTree)\n            this._bottomUpProfileDataGridTree = new WebInspector.BottomUpProfileDataGridTree(this, this.profile.head);\n        return this._bottomUpProfileDataGridTree;\n    },\n\n    get topDownProfileDataGridTree()\n    {\n        if (!this._topDownProfileDataGridTree)\n            this._topDownProfileDataGridTree = new WebInspector.TopDownProfileDataGridTree(this, this.profile.head);\n        return this._topDownProfileDataGridTree;\n    },\n\n    get currentTree()\n    {\n        return this._currentTree;\n    },\n\n    set currentTree(tree)\n    {\n        this._currentTree = tree;\n        this.refresh();\n    },\n\n    get topDownTree()\n    {\n        if (!this._topDownTree) {\n            this._topDownTree = WebInspector.TopDownTreeFactory.create(this.profile.head);\n            this._sortProfile(this._topDownTree);\n        }\n\n        return this._topDownTree;\n    },\n\n    get bottomUpTree()\n    {\n        if (!this._bottomUpTree) {\n            this._bottomUpTree = WebInspector.BottomUpTreeFactory.create(this.profile.head);\n            this._sortProfile(this._bottomUpTree);\n        }\n\n        return this._bottomUpTree;\n    },\n\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this.dataGrid.updateWidths();\n    },\n\n    hide: function()\n    {\n        WebInspector.View.prototype.hide.call(this);\n        this._currentSearchResultIndex = -1;\n    },\n\n    resize: function()\n    {\n        if (this.dataGrid)\n            this.dataGrid.updateWidths();\n    },\n\n    refresh: function()\n    {\n        var selectedProfileNode = this.dataGrid.selectedNode ? this.dataGrid.selectedNode.profileNode : null;\n\n        this.dataGrid.removeChildren();\n\n        var children = this.profileDataGridTree.children;\n        var count = children.length;\n\n        for (var index = 0; index < count; ++index)\n            this.dataGrid.appendChild(children[index]);\n\n        if (selectedProfileNode)\n            selectedProfileNode.selected = true;\n    },\n\n    refreshVisibleData: function()\n    {\n        var child = this.dataGrid.children[0];\n        while (child) {\n            child.refresh();\n            child = child.traverseNextNode(false, null, true);\n        }\n    },\n\n    refreshShowAsPercents: function()\n    {\n        this._updatePercentButton();\n        this.refreshVisibleData();\n    },\n\n    searchCanceled: function()\n    {\n        if (this._searchResults) {\n            for (var i = 0; i < this._searchResults.length; ++i) {\n                var profileNode = this._searchResults[i].profileNode;\n\n                delete profileNode._searchMatchedSelfColumn;\n                delete profileNode._searchMatchedTotalColumn;\n                delete profileNode._searchMatchedCallsColumn;\n                delete profileNode._searchMatchedFunctionColumn;\n\n                profileNode.refresh();\n            }\n        }\n\n        delete this._searchFinishedCallback;\n        this._currentSearchResultIndex = -1;\n        this._searchResults = [];\n    },\n\n    performSearch: function(query, finishedCallback)\n    {\n        // Call searchCanceled since it will reset everything we need before doing a new search.\n        this.searchCanceled();\n\n        query = query.trim();\n\n        if (!query.length)\n            return;\n\n        this._searchFinishedCallback = finishedCallback;\n\n        var greaterThan = (query.indexOf(\">\") === 0);\n        var lessThan = (query.indexOf(\"<\") === 0);\n        var equalTo = (query.indexOf(\"=\") === 0 || ((greaterThan || lessThan) && query.indexOf(\"=\") === 1));\n        var percentUnits = (query.lastIndexOf(\"%\") === (query.length - 1));\n        var millisecondsUnits = (query.length > 2 && query.lastIndexOf(\"ms\") === (query.length - 2));\n        var secondsUnits = (!millisecondsUnits && query.lastIndexOf(\"s\") === (query.length - 1));\n\n        var queryNumber = parseFloat(query);\n        if (greaterThan || lessThan || equalTo) {\n            if (equalTo && (greaterThan || lessThan))\n                queryNumber = parseFloat(query.substring(2));\n            else\n                queryNumber = parseFloat(query.substring(1));\n        }\n\n        var queryNumberMilliseconds = (secondsUnits ? (queryNumber * 1000) : queryNumber);\n\n        // Make equalTo implicitly true if it wasn't specified there is no other operator.\n        if (!isNaN(queryNumber) && !(greaterThan || lessThan))\n            equalTo = true;\n\n        function matchesQuery(/*ProfileDataGridNode*/ profileDataGridNode)\n        {\n            delete profileDataGridNode._searchMatchedSelfColumn;\n            delete profileDataGridNode._searchMatchedTotalColumn;\n            delete profileDataGridNode._searchMatchedAverageColumn;\n            delete profileDataGridNode._searchMatchedCallsColumn;\n            delete profileDataGridNode._searchMatchedFunctionColumn;\n\n            if (percentUnits) {\n                if (lessThan) {\n                    if (profileDataGridNode.selfPercent < queryNumber)\n                        profileDataGridNode._searchMatchedSelfColumn = true;\n                    if (profileDataGridNode.totalPercent < queryNumber)\n                        profileDataGridNode._searchMatchedTotalColumn = true;\n                    if (profileDataGridNode.averagePercent < queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedAverageColumn = true;\n                } else if (greaterThan) {\n                    if (profileDataGridNode.selfPercent > queryNumber)\n                        profileDataGridNode._searchMatchedSelfColumn = true;\n                    if (profileDataGridNode.totalPercent > queryNumber)\n                        profileDataGridNode._searchMatchedTotalColumn = true;\n                    if (profileDataGridNode.averagePercent < queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedAverageColumn = true;\n                }\n\n                if (equalTo) {\n                    if (profileDataGridNode.selfPercent == queryNumber)\n                        profileDataGridNode._searchMatchedSelfColumn = true;\n                    if (profileDataGridNode.totalPercent == queryNumber)\n                        profileDataGridNode._searchMatchedTotalColumn = true;\n                    if (profileDataGridNode.averagePercent < queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedAverageColumn = true;\n                }\n            } else if (millisecondsUnits || secondsUnits) {\n                if (lessThan) {\n                    if (profileDataGridNode.selfTime < queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedSelfColumn = true;\n                    if (profileDataGridNode.totalTime < queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedTotalColumn = true;\n                    if (profileDataGridNode.averageTime < queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedAverageColumn = true;\n                } else if (greaterThan) {\n                    if (profileDataGridNode.selfTime > queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedSelfColumn = true;\n                    if (profileDataGridNode.totalTime > queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedTotalColumn = true;\n                    if (profileDataGridNode.averageTime > queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedAverageColumn = true;\n                }\n\n                if (equalTo) {\n                    if (profileDataGridNode.selfTime == queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedSelfColumn = true;\n                    if (profileDataGridNode.totalTime == queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedTotalColumn = true;\n                    if (profileDataGridNode.averageTime == queryNumberMilliseconds)\n                        profileDataGridNode._searchMatchedAverageColumn = true;\n                }\n            } else {\n                if (equalTo && profileDataGridNode.numberOfCalls == queryNumber)\n                    profileDataGridNode._searchMatchedCallsColumn = true;\n                if (greaterThan && profileDataGridNode.numberOfCalls > queryNumber)\n                    profileDataGridNode._searchMatchedCallsColumn = true;\n                if (lessThan && profileDataGridNode.numberOfCalls < queryNumber)\n                    profileDataGridNode._searchMatchedCallsColumn = true;\n            }\n\n            if (profileDataGridNode.functionName.hasSubstring(query, true) || profileDataGridNode.url.hasSubstring(query, true))\n                profileDataGridNode._searchMatchedFunctionColumn = true;\n\n            if (profileDataGridNode._searchMatchedSelfColumn ||\n                profileDataGridNode._searchMatchedTotalColumn ||\n                profileDataGridNode._searchMatchedAverageColumn ||\n                profileDataGridNode._searchMatchedCallsColumn ||\n                profileDataGridNode._searchMatchedFunctionColumn)\n            {\n                profileDataGridNode.refresh();\n                return true;\n            }\n\n            return false;\n        }\n\n        var current = this.profileDataGridTree.children[0];\n\n        while (current) {\n            if (matchesQuery(current)) {\n                this._searchResults.push({ profileNode: current });\n            }\n\n            current = current.traverseNextNode(false, null, false);\n        }\n\n        finishedCallback(this, this._searchResults.length);\n    },\n\n    jumpToFirstSearchResult: function()\n    {\n        if (!this._searchResults || !this._searchResults.length)\n            return;\n        this._currentSearchResultIndex = 0;\n        this._jumpToSearchResult(this._currentSearchResultIndex);\n    },\n\n    jumpToLastSearchResult: function()\n    {\n        if (!this._searchResults || !this._searchResults.length)\n            return;\n        this._currentSearchResultIndex = (this._searchResults.length - 1);\n        this._jumpToSearchResult(this._currentSearchResultIndex);\n    },\n\n    jumpToNextSearchResult: function()\n    {\n        if (!this._searchResults || !this._searchResults.length)\n            return;\n        if (++this._currentSearchResultIndex >= this._searchResults.length)\n            this._currentSearchResultIndex = 0;\n        this._jumpToSearchResult(this._currentSearchResultIndex);\n    },\n\n    jumpToPreviousSearchResult: function()\n    {\n        if (!this._searchResults || !this._searchResults.length)\n            return;\n        if (--this._currentSearchResultIndex < 0)\n            this._currentSearchResultIndex = (this._searchResults.length - 1);\n        this._jumpToSearchResult(this._currentSearchResultIndex);\n    },\n\n    showingFirstSearchResult: function()\n    {\n        return (this._currentSearchResultIndex === 0);\n    },\n\n    showingLastSearchResult: function()\n    {\n        return (this._searchResults && this._currentSearchResultIndex === (this._searchResults.length - 1));\n    },\n\n    _jumpToSearchResult: function(index)\n    {\n        var searchResult = this._searchResults[index];\n        if (!searchResult)\n            return;\n\n        var profileNode = searchResult.profileNode;\n        profileNode.reveal();\n        profileNode.select();\n    },\n\n    _changeView: function(event)\n    {\n        if (!event || !this.profile)\n            return;\n\n        if (event.target.selectedIndex == 1 && this.view == \"Heavy\") {\n            this.profileDataGridTree = this.topDownProfileDataGridTree;\n            this._sortProfile();\n            this.view = \"Tree\";\n        } else if (event.target.selectedIndex == 0 && this.view == \"Tree\") {\n            this.profileDataGridTree = this.bottomUpProfileDataGridTree;\n            this._sortProfile();\n            this.view = \"Heavy\";\n        }\n\n        if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)\n            return;\n\n        // The current search needs to be performed again. First negate out previous match\n        // count by calling the search finished callback with a negative number of matches.\n        // Then perform the search again the with same query and callback.\n        this._searchFinishedCallback(this, -this._searchResults.length);\n        this.performSearch(this.currentQuery, this._searchFinishedCallback);\n    },\n\n    _percentClicked: function(event)\n    {\n        var currentState = this.showSelfTimeAsPercent && this.showTotalTimeAsPercent && this.showAverageTimeAsPercent;\n        this.showSelfTimeAsPercent = !currentState;\n        this.showTotalTimeAsPercent = !currentState;\n        this.showAverageTimeAsPercent = !currentState;\n        this.refreshShowAsPercents();\n    },\n\n    _updatePercentButton: function()\n    {\n        if (this.showSelfTimeAsPercent && this.showTotalTimeAsPercent && this.showAverageTimeAsPercent) {\n            this.percentButton.title = WebInspector.UIString(\"Show absolute total and self times.\");\n            this.percentButton.toggled = true;\n        } else {\n            this.percentButton.title = WebInspector.UIString(\"Show total and self times as percentages.\");\n            this.percentButton.toggled = false;\n        }\n    },\n\n    _focusClicked: function(event)\n    {\n        if (!this.dataGrid.selectedNode)\n            return;\n\n        this.resetButton.visible = true;\n        this.profileDataGridTree.focus(this.dataGrid.selectedNode);\n        this.refresh();\n        this.refreshVisibleData();\n    },\n\n    _excludeClicked: function(event)\n    {\n        var selectedNode = this.dataGrid.selectedNode\n\n        if (!selectedNode)\n            return;\n\n        selectedNode.deselect();\n\n        this.resetButton.visible = true;\n        this.profileDataGridTree.exclude(selectedNode);\n        this.refresh();\n        this.refreshVisibleData();\n    },\n\n    _resetClicked: function(event)\n    {\n        this.resetButton.visible = false;\n        this.profileDataGridTree.restore();\n        this.refresh();\n        this.refreshVisibleData();\n    },\n\n    _dataGridNodeSelected: function(node)\n    {\n        this.focusButton.disabled = false;\n        this.excludeButton.disabled = false;\n    },\n\n    _dataGridNodeDeselected: function(node)\n    {\n        this.focusButton.disabled = true;\n        this.excludeButton.disabled = true;\n    },\n\n    _sortData: function(event)\n    {\n        this._sortProfile(this.profile);\n    },\n\n    _sortProfile: function()\n    {\n        var sortAscending = this.dataGrid.sortOrder === \"ascending\";\n        var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;\n        var sortProperty = {\n                \"average\": \"averageTime\",\n                \"self\": \"selfTime\",\n                \"total\": \"totalTime\",\n                \"calls\": \"numberOfCalls\",\n                \"function\": \"functionName\"\n            }[sortColumnIdentifier];\n\n        this.profileDataGridTree.sort(WebInspector.ProfileDataGridTree.propertyComparator(sortProperty, sortAscending));\n\n        this.refresh();\n    },\n\n    _mouseDownInDataGrid: function(event)\n    {\n        if (event.detail < 2)\n            return;\n\n        var cell = event.target.enclosingNodeOrSelfWithNodeName(\"td\");\n        if (!cell || (!cell.hasStyleClass(\"total-column\") && !cell.hasStyleClass(\"self-column\") && !cell.hasStyleClass(\"average-column\")))\n            return;\n\n        if (cell.hasStyleClass(\"total-column\"))\n            this.showTotalTimeAsPercent = !this.showTotalTimeAsPercent;\n        else if (cell.hasStyleClass(\"self-column\"))\n            this.showSelfTimeAsPercent = !this.showSelfTimeAsPercent;\n        else if (cell.hasStyleClass(\"average-column\"))\n            this.showAverageTimeAsPercent = !this.showAverageTimeAsPercent;\n\n        this.refreshShowAsPercents();\n\n        event.preventDefault();\n        event.stopPropagation();\n    },\n\n    _assignParentsInProfile: function()\n    {\n        var head = this.profile.head;\n        head.parent = null;\n        head.head = null;\n        var nodesToTraverse = [ { parent: head, children: head.children } ];\n        while (nodesToTraverse.length > 0) {\n            var pair = nodesToTraverse.shift();\n            var parent = pair.parent;\n            var children = pair.children;\n            var length = children.length;\n            for (var i = 0; i < length; ++i) {\n                children[i].head = head;\n                children[i].parent = parent;\n                if (children[i].children.length > 0)\n                    nodesToTraverse.push({ parent: children[i], children: children[i].children });\n            }\n        }\n    }\n}\n\nWebInspector.CPUProfileView.prototype.__proto__ = WebInspector.View.prototype;\n\nWebInspector.CPUProfileType = function()\n{\n    WebInspector.ProfileType.call(this, WebInspector.CPUProfileType.TypeId, WebInspector.UIString(\"CPU PROFILES\"));\n    this._recording = false;\n}\n\nWebInspector.CPUProfileType.TypeId = \"CPU\";\n\nWebInspector.CPUProfileType.prototype = {\n    get buttonTooltip()\n    {\n        return this._recording ? WebInspector.UIString(\"Stop profiling.\") : WebInspector.UIString(\"Start profiling.\");\n    },\n\n    get buttonStyle()\n    {\n        return this._recording ? \"record-profile-status-bar-item status-bar-item toggled-on\" : \"record-profile-status-bar-item status-bar-item\";\n    },\n\n    buttonClicked: function()\n    {\n        this._recording = !this._recording;\n\n        if (this._recording)\n            InspectorBackend.startProfiling();\n        else\n            InspectorBackend.stopProfiling();\n    },\n\n    get welcomeMessage()\n    {\n        return WebInspector.UIString(\"Control CPU profiling by pressing the %s button on the status bar.\");\n    },\n\n    setRecordingProfile: function(isProfiling)\n    {\n        this._recording = isProfiling;\n    },\n\n    createSidebarTreeElementForProfile: function(profile)\n    {\n        return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString(\"Profile %d\"), \"profile-sidebar-tree-item\");\n    },\n\n    createView: function(profile)\n    {\n        return new WebInspector.CPUProfileView(profile);\n    }\n}\n\nWebInspector.CPUProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ProfilesPanel.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar UserInitiatedProfileName = \"org.webkit.profiles.user-initiated\";\n\nWebInspector.ProfileType = function(id, name)\n{\n    this._id = id;\n    this._name = name;\n}\n\nWebInspector.ProfileType.URLRegExp = /webkit-profile:\\/\\/(.+)\\/(.+)#([0-9]+)/;\n\nWebInspector.ProfileType.prototype = {\n    get buttonTooltip()\n    {\n        return \"\";\n    },\n\n    get buttonStyle()\n    {\n        return undefined;\n    },\n\n    get buttonCaption()\n    {\n        return this.name;\n    },\n\n    get id()\n    {\n        return this._id;\n    },\n\n    get name()\n    {\n        return this._name;\n    },\n\n    buttonClicked: function()\n    {\n    },\n\n    viewForProfile: function(profile)\n    {\n        if (!profile._profileView)\n            profile._profileView = this.createView(profile);\n        return profile._profileView;\n    },\n\n    get welcomeMessage()\n    {\n        return \"\";\n    },\n\n    // Must be implemented by subclasses.\n    createView: function(profile)\n    {\n        throw new Error(\"Needs implemented.\");\n    },\n\n    // Must be implemented by subclasses.\n    createSidebarTreeElementForProfile: function(profile)\n    {\n        throw new Error(\"Needs implemented.\");\n    }\n}\n\nWebInspector.ProfilesPanel = function()\n{\n    WebInspector.Panel.call(this, \"profiles\");\n\n    this.createSidebar();\n\n    this._profileTypesByIdMap = {};\n    this._profileTypeButtonsByIdMap = {};\n\n    var panelEnablerHeading = WebInspector.UIString(\"You need to enable profiling before you can use the Profiles panel.\");\n    var panelEnablerDisclaimer = WebInspector.UIString(\"Enabling profiling will make scripts run slower.\");\n    var panelEnablerButton = WebInspector.UIString(\"Enable Profiling\");\n    this.panelEnablerView = new WebInspector.PanelEnablerView(\"profiles\", panelEnablerHeading, panelEnablerDisclaimer, panelEnablerButton);\n    this.panelEnablerView.addEventListener(\"enable clicked\", this._enableProfiling, this);\n\n    this.element.appendChild(this.panelEnablerView.element);\n\n    this.profileViews = document.createElement(\"div\");\n    this.profileViews.id = \"profile-views\";\n    this.element.appendChild(this.profileViews);\n\n    this.enableToggleButton = new WebInspector.StatusBarButton(\"\", \"enable-toggle-status-bar-item\");\n    this.enableToggleButton.addEventListener(\"click\", this._toggleProfiling.bind(this), false);\n\n    this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Clear all profiles.\"), \"clear-status-bar-item\");\n    this.clearResultsButton.addEventListener(\"click\", this._clearProfiles.bind(this), false);\n\n    this.profileViewStatusBarItemsContainer = document.createElement(\"div\");\n    this.profileViewStatusBarItemsContainer.className = \"status-bar-items\";\n\n    this.welcomeView = new WebInspector.WelcomeView(\"profiles\", WebInspector.UIString(\"Welcome to the Profiles panel\"));\n    this.element.appendChild(this.welcomeView.element);\n\n    this._profiles = [];\n    this._profilerEnabled = Preferences.profilerAlwaysEnabled;\n    this._reset();\n    InspectorBackend.registerDomainDispatcher(\"Profiler\", new WebInspector.ProfilerDispatcher(this));\n}\n\nWebInspector.ProfilesPanel.prototype = {\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Profiles\");\n    },\n\n    get statusBarItems()\n    {\n        function clickHandler(profileType, buttonElement)\n        {\n            profileType.buttonClicked.call(profileType);\n            this.updateProfileTypeButtons();\n        }\n\n        var items = [this.enableToggleButton.element];\n        // FIXME: Generate a single \"combo-button\".\n        for (var typeId in this._profileTypesByIdMap) {\n            var profileType = this.getProfileType(typeId);\n            if (profileType.buttonStyle) {\n                var button = new WebInspector.StatusBarButton(profileType.buttonTooltip, profileType.buttonStyle, profileType.buttonCaption);\n                this._profileTypeButtonsByIdMap[typeId] = button.element;\n                button.element.addEventListener(\"click\", clickHandler.bind(this, profileType, button.element), false);\n                items.push(button.element);\n            }\n        }\n        items.push(this.clearResultsButton.element, this.profileViewStatusBarItemsContainer);\n        return items;\n    },\n\n    show: function()\n    {\n        WebInspector.Panel.prototype.show.call(this);\n        this._populateProfiles();\n    },\n\n    _profilerWasEnabled: function()\n    {\n        if (this._profilerEnabled)\n            return;\n\n        this._profilerEnabled = true;\n\n        this._reset();\n        if (this.visible)\n            this._populateProfiles();\n    },\n\n    _profilerWasDisabled: function()\n    {\n        if (!this._profilerEnabled)\n            return;\n\n        this._profilerEnabled = false;\n        this._reset();\n    },\n\n    _reset: function()\n    {\n        for (var i = 0; i < this._profiles.length; ++i)\n            delete this._profiles[i]._profileView;\n        delete this.visibleView;\n\n        delete this.currentQuery;\n        this.searchCanceled();\n\n        this._profiles = [];\n        this._profilesIdMap = {};\n        this._profileGroups = {};\n        this._profileGroupsForLinks = {};\n        this._profilesWereRequested = false;\n\n        this.sidebarTreeElement.removeStyleClass(\"some-expandable\");\n\n        for (var typeId in this._profileTypesByIdMap)\n            this.getProfileType(typeId).treeElement.removeChildren();\n\n        this.profileViews.removeChildren();\n\n        this.profileViewStatusBarItemsContainer.removeChildren();\n\n        this.removeAllListeners();\n\n        this._updateInterface();\n        this.welcomeView.show();\n    },\n\n    _clearProfiles: function()\n    {\n        InspectorBackend.clearProfiles();\n        this._reset();\n    },\n\n    registerProfileType: function(profileType)\n    {\n        this._profileTypesByIdMap[profileType.id] = profileType;\n        profileType.treeElement = new WebInspector.SidebarSectionTreeElement(profileType.name, null, true);\n        this.sidebarTree.appendChild(profileType.treeElement);\n        profileType.treeElement.expand();\n        this._addWelcomeMessage(profileType);\n    },\n\n    _addWelcomeMessage: function(profileType)\n    {\n        var message = profileType.welcomeMessage;\n        // Message text is supposed to have a '%s' substring as a placeholder\n        // for a status bar button. If it is there, we split the message in two\n        // parts, and insert the button between them.\n        var buttonPos = message.indexOf(\"%s\");\n        if (buttonPos > -1) {\n            var container = document.createDocumentFragment();\n            var part1 = document.createElement(\"span\");\n            part1.innerHTML = message.substr(0, buttonPos);\n            container.appendChild(part1);\n     \n            var button = new WebInspector.StatusBarButton(profileType.buttonTooltip, profileType.buttonStyle, profileType.buttonCaption);\n            container.appendChild(button.element);\n       \n            var part2 = document.createElement(\"span\");\n            part2.innerHTML = message.substr(buttonPos + 2);\n            container.appendChild(part2);\n            this.welcomeView.addMessage(container);\n        } else\n            this.welcomeView.addMessage(message);\n    },\n\n    _makeKey: function(text, profileTypeId)\n    {\n        return escape(text) + '/' + escape(profileTypeId);\n    },\n\n    _addProfileHeader: function(profile)\n    {\n        if (this.hasTemporaryProfile(profile.typeId)) {\n            if (profile.typeId === WebInspector.CPUProfileType.TypeId)\n                this._removeProfileHeader(this._temporaryRecordingProfile);\n            else\n                this._removeProfileHeader(this._temporaryTakingSnapshot);\n        }\n\n        var typeId = profile.typeId;\n        var profileType = this.getProfileType(typeId);\n        var sidebarParent = profileType.treeElement;\n        var small = false;\n        var alternateTitle;\n\n        profile.__profilesPanelProfileType = profileType;\n        this._profiles.push(profile);\n        this._profilesIdMap[this._makeKey(profile.uid, typeId)] = profile;\n\n        if (profile.title.indexOf(UserInitiatedProfileName) !== 0) {\n            var profileTitleKey = this._makeKey(profile.title, typeId);\n            if (!(profileTitleKey in this._profileGroups))\n                this._profileGroups[profileTitleKey] = [];\n\n            var group = this._profileGroups[profileTitleKey];\n            group.push(profile);\n\n            if (group.length === 2) {\n                // Make a group TreeElement now that there are 2 profiles.\n                group._profilesTreeElement = new WebInspector.ProfileGroupSidebarTreeElement(profile.title);\n\n                // Insert at the same index for the first profile of the group.\n                var index = sidebarParent.children.indexOf(group[0]._profilesTreeElement);\n                sidebarParent.insertChild(group._profilesTreeElement, index);\n\n                // Move the first profile to the group.\n                var selected = group[0]._profilesTreeElement.selected;\n                sidebarParent.removeChild(group[0]._profilesTreeElement);\n                group._profilesTreeElement.appendChild(group[0]._profilesTreeElement);\n                if (selected) {\n                    group[0]._profilesTreeElement.select();\n                    group[0]._profilesTreeElement.reveal();\n                }\n\n                group[0]._profilesTreeElement.small = true;\n                group[0]._profilesTreeElement.mainTitle = WebInspector.UIString(\"Run %d\", 1);\n\n                this.sidebarTreeElement.addStyleClass(\"some-expandable\");\n            }\n\n            if (group.length >= 2) {\n                sidebarParent = group._profilesTreeElement;\n                alternateTitle = WebInspector.UIString(\"Run %d\", group.length);\n                small = true;\n            }\n        }\n\n        var profileTreeElement = profileType.createSidebarTreeElementForProfile(profile);\n        profile.sideBarElement = profileTreeElement;\n        profileTreeElement.small = small;\n        if (alternateTitle)\n            profileTreeElement.mainTitle = alternateTitle;\n        profile._profilesTreeElement = profileTreeElement;\n\n        sidebarParent.appendChild(profileTreeElement);\n        if (!profile.isTemporary) {\n            this.welcomeView.hide();\n            if (!this.visibleView)\n                this.showProfile(profile);\n            this.dispatchEventToListeners(\"profile added\");\n        }\n    },\n\n    _removeProfileHeader: function(profile)\n    {\n        var typeId = profile.typeId;\n        var profileType = this.getProfileType(typeId);\n        var sidebarParent = profileType.treeElement;\n\n        for (var i = 0; i < this._profiles.length; ++i) {\n            if (this._profiles[i].uid === profile.uid) {\n                profile = this._profiles[i];\n                this._profiles.splice(i, 1);\n                break;\n            }\n        }\n        delete this._profilesIdMap[this._makeKey(profile.uid, typeId)];\n\n        var profileTitleKey = this._makeKey(profile.title, typeId);\n        delete this._profileGroups[profileTitleKey];\n\n        sidebarParent.removeChild(profile._profilesTreeElement);\n\n        if (!profile.isTemporary)\n            InspectorBackend.removeProfile(profile.typeId, profile.uid);\n\n        // No other item will be selected if there aren't any other profiles, so\n        // make sure that view gets cleared when the last profile is removed.\n        if (!this._profiles.length)\n            this.closeVisibleView();\n    },\n\n    showProfile: function(profile)\n    {\n        if (!profile || profile.isTemporary)\n            return;\n\n        this.closeVisibleView();\n\n        var view = profile.__profilesPanelProfileType.viewForProfile(profile);\n\n        view.show(this.profileViews);\n\n        profile._profilesTreeElement.select(true);\n        profile._profilesTreeElement.reveal();\n\n        this.visibleView = view;\n\n        this.profileViewStatusBarItemsContainer.removeChildren();\n\n        var statusBarItems = view.statusBarItems;\n        if (statusBarItems)\n            for (var i = 0; i < statusBarItems.length; ++i)\n                this.profileViewStatusBarItemsContainer.appendChild(statusBarItems[i]);\n    },\n\n    getProfiles: function(typeId)\n    {\n        var result = [];\n        var profilesCount = this._profiles.length;\n        for (var i = 0; i < profilesCount; ++i) {\n            var profile = this._profiles[i];\n            if (!profile.isTemporary && profile.typeId === typeId)\n                result.push(profile);\n        }\n        return result;\n    },\n\n    hasTemporaryProfile: function(typeId)\n    {\n        var profilesCount = this._profiles.length;\n        for (var i = 0; i < profilesCount; ++i)\n            if (this._profiles[i].typeId === typeId && this._profiles[i].isTemporary)\n                return true;\n        return false;\n    },\n\n    hasProfile: function(profile)\n    {\n        return !!this._profilesIdMap[this._makeKey(profile.uid, profile.typeId)];\n    },\n\n    loadHeapSnapshot: function(uid, callback)\n    {\n        var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];\n        if (!profile)\n            return;\n\n        if (profile._loaded)\n            callback(profile);\n        else if (profile._is_loading)\n            profile._callbacks.push(callback);\n        else {\n            profile._is_loading = true;\n            profile._callbacks = [callback];\n            profile._json = \"\";\n            profile.sideBarElement.subtitle = WebInspector.UIString(\"Loading…\");\n            InspectorBackend.getProfile(profile.typeId, profile.uid);\n        }\n    },\n\n    _addHeapSnapshotChunk: function(uid, chunk)\n    {\n        var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];\n        if (!profile || profile._loaded || !profile._is_loading)\n            return;\n\n        profile._json += chunk;\n    },\n\n    _finishHeapSnapshot: function(uid)\n    {\n        var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];\n        if (!profile || profile._loaded || !profile._is_loading)\n            return;\n\n        var callbacks = profile._callbacks;\n        delete profile._callbacks;\n        profile.sideBarElement.subtitle = WebInspector.UIString(\"Parsing…\");\n        window.setTimeout(doParse, 0);\n\n        function doParse()\n        {\n            var loadedSnapshot = JSON.parse(profile._json);\n            delete profile._json;\n            delete profile._is_loading;\n            profile._loaded = true;\n            profile.sideBarElement.subtitle = \"\";\n            if (!Preferences.detailedHeapProfiles)\n                WebInspector.HeapSnapshotView.prototype.processLoadedSnapshot(profile, loadedSnapshot);\n            else\n                WebInspector.DetailedHeapshotView.prototype.processLoadedSnapshot(profile, loadedSnapshot);\n            for (var i = 0; i < callbacks.length; ++i)\n                callbacks[i](profile);\n        }\n    },\n\n    showView: function(view)\n    {\n        this.showProfile(view.profile);\n    },\n\n    getProfileType: function(typeId)\n    {\n        return this._profileTypesByIdMap[typeId];\n    },\n\n    showProfileForURL: function(url)\n    {\n        var match = url.match(WebInspector.ProfileType.URLRegExp);\n        if (!match)\n            return;\n        this.showProfile(this._profilesIdMap[this._makeKey(match[3], match[1])]);\n    },\n\n    updateProfileTypeButtons: function()\n    {\n        for (var typeId in this._profileTypeButtonsByIdMap) {\n            var buttonElement = this._profileTypeButtonsByIdMap[typeId];\n            var profileType = this.getProfileType(typeId);\n            buttonElement.className = profileType.buttonStyle;\n            buttonElement.title = profileType.buttonTooltip;\n            // FIXME: Apply profileType.buttonCaption once captions are added to button controls.\n        }\n    },\n\n    closeVisibleView: function()\n    {\n        if (this.visibleView)\n            this.visibleView.hide();\n        delete this.visibleView;\n    },\n\n    displayTitleForProfileLink: function(title, typeId)\n    {\n        title = unescape(title);\n        if (title.indexOf(UserInitiatedProfileName) === 0) {\n            title = WebInspector.UIString(\"Profile %d\", title.substring(UserInitiatedProfileName.length + 1));\n        } else {\n            var titleKey = this._makeKey(title, typeId);\n            if (!(titleKey in this._profileGroupsForLinks))\n                this._profileGroupsForLinks[titleKey] = 0;\n\n            var groupNumber = ++this._profileGroupsForLinks[titleKey];\n\n            if (groupNumber > 2)\n                // The title is used in the console message announcing that a profile has started so it gets\n                // incremented twice as often as it's displayed\n                title += \" \" + WebInspector.UIString(\"Run %d\", (groupNumber + 1) / 2);\n        }\n        \n        return title;\n    },\n\n    get searchableViews()\n    {\n        var views = [];\n\n        var visibleView = this.visibleView;\n        if (visibleView && visibleView.performSearch)\n            views.push(visibleView);\n\n        var profilesLength = this._profiles.length;\n        for (var i = 0; i < profilesLength; ++i) {\n            var profile = this._profiles[i];\n            var view = profile.__profilesPanelProfileType.viewForProfile(profile);\n            if (!view.performSearch || view === visibleView)\n                continue;\n            views.push(view);\n        }\n\n        return views;\n    },\n\n    searchMatchFound: function(view, matches)\n    {\n        view.profile._profilesTreeElement.searchMatches = matches;\n    },\n\n    searchCanceled: function(startingNewSearch)\n    {\n        WebInspector.Panel.prototype.searchCanceled.call(this, startingNewSearch);\n\n        if (!this._profiles)\n            return;\n\n        for (var i = 0; i < this._profiles.length; ++i) {\n            var profile = this._profiles[i];\n            profile._profilesTreeElement.searchMatches = 0;\n        }\n    },\n\n    _updateInterface: function()\n    {\n        // FIXME: Replace ProfileType-specific button visibility changes by a single ProfileType-agnostic \"combo-button\" visibility change.\n        if (this._profilerEnabled) {\n            this.enableToggleButton.title = WebInspector.UIString(\"Profiling enabled. Click to disable.\");\n            this.enableToggleButton.toggled = true;\n            for (var typeId in this._profileTypeButtonsByIdMap)\n                this._profileTypeButtonsByIdMap[typeId].removeStyleClass(\"hidden\");\n            this.profileViewStatusBarItemsContainer.removeStyleClass(\"hidden\");\n            this.clearResultsButton.element.removeStyleClass(\"hidden\");\n            this.panelEnablerView.visible = false;\n        } else {\n            this.enableToggleButton.title = WebInspector.UIString(\"Profiling disabled. Click to enable.\");\n            this.enableToggleButton.toggled = false;\n            for (var typeId in this._profileTypeButtonsByIdMap)\n                this._profileTypeButtonsByIdMap[typeId].addStyleClass(\"hidden\");\n            this.profileViewStatusBarItemsContainer.addStyleClass(\"hidden\");\n            this.clearResultsButton.element.addStyleClass(\"hidden\");\n            this.panelEnablerView.visible = true;\n        }\n    },\n\n    _enableProfiling: function()\n    {\n        if (this._profilerEnabled)\n            return;\n        this._toggleProfiling(this.panelEnablerView.alwaysEnabled);\n    },\n\n    _toggleProfiling: function(optionalAlways)\n    {\n        if (this._profilerEnabled) {\n            WebInspector.settings.profilerEnabled = false;\n            InspectorBackend.disableProfiler(true);\n        } else {\n            WebInspector.settings.profilerEnabled = !!optionalAlways;\n            InspectorBackend.enableProfiler();\n        }\n    },\n\n    _populateProfiles: function()\n    {\n        if (!this._profilerEnabled || this._profilesWereRequested)\n            return;\n\n        function populateCallback(profileHeaders) {\n            profileHeaders.sort(function(a, b) { return a.uid - b.uid; });\n            var profileHeadersLength = profileHeaders.length;\n            for (var i = 0; i < profileHeadersLength; ++i)\n                if (!this.hasProfile(profileHeaders[i]))\n                   this._addProfileHeader(profileHeaders[i]);\n        }\n\n        InspectorBackend.getProfileHeaders(populateCallback.bind(this));\n\n        this._profilesWereRequested = true;\n    },\n\n    updateMainViewWidth: function(width)\n    {\n        this.welcomeView.element.style.left = width + \"px\";\n        this.profileViews.style.left = width + \"px\";\n        this.profileViewStatusBarItemsContainer.style.left = Math.max(155, width) + \"px\";\n        this.resize();\n    },\n\n    _setRecordingProfile: function(isProfiling)\n    {\n        this.getProfileType(WebInspector.CPUProfileType.TypeId).setRecordingProfile(isProfiling);\n        if (this.hasTemporaryProfile(WebInspector.CPUProfileType.TypeId) !== isProfiling) {\n            if (!this._temporaryRecordingProfile) {\n                this._temporaryRecordingProfile = {\n                    typeId: WebInspector.CPUProfileType.TypeId,\n                    title: WebInspector.UIString(\"Recording…\"),\n                    uid: -1,\n                    isTemporary: true\n                };\n            }\n            if (isProfiling)\n                this._addProfileHeader(this._temporaryRecordingProfile);\n            else\n                this._removeProfileHeader(this._temporaryRecordingProfile);\n        }\n        this.updateProfileTypeButtons();\n    },\n\n    takeHeapSnapshot: function(detailed)\n    {\n        if (!this.hasTemporaryProfile(WebInspector.HeapSnapshotProfileType.TypeId)) {\n            if (!this._temporaryTakingSnapshot) {\n                this._temporaryTakingSnapshot = {\n                    typeId: WebInspector.HeapSnapshotProfileType.TypeId,\n                    title: WebInspector.UIString(\"Snapshotting…\"),\n                    uid: -1,\n                    isTemporary: true\n                };\n            }\n            this._addProfileHeader(this._temporaryTakingSnapshot);\n        }\n        InspectorBackend.takeHeapSnapshot(detailed);\n    },\n\n    _reportHeapSnapshotProgress: function(done, total)\n    {\n        if (this.hasTemporaryProfile(WebInspector.HeapSnapshotProfileType.TypeId)) {\n            this._temporaryTakingSnapshot.sideBarElement.subtitle = WebInspector.UIString(\"%.2f%%\", (done / total) * 100);\n            if (done >= total)\n                this._removeProfileHeader(this._temporaryTakingSnapshot);\n        }\n    }\n}\n\nWebInspector.ProfilesPanel.prototype.__proto__ = WebInspector.Panel.prototype;\n\n\nWebInspector.ProfilerDispatcher = function(profiler)\n{\n    this._profiler = profiler;\n}\n\nWebInspector.ProfilerDispatcher.prototype = {\n    profilerWasEnabled: function()\n    {\n        this._profiler._profilerWasEnabled();\n    },\n\n    profilerWasDisabled: function()\n    {\n        this._profiler._profilerWasDisabled();\n    },\n\n    resetProfiles: function()\n    {\n        this._profiler._reset();\n    },\n\n    addProfileHeader: function(profile)\n    {\n        this._profiler._addProfileHeader(profile);\n    },\n\n    addHeapSnapshotChunk: function(uid, chunk)\n    {\n        this._profiler._addHeapSnapshotChunk(uid, chunk);\n    },\n\n    finishHeapSnapshot: function(uid)\n    {\n        this._profiler._finishHeapSnapshot(uid);\n    },\n\n    setRecordingProfile: function(isProfiling)\n    {\n        this._profiler._setRecordingProfile(isProfiling);\n    },\n\n    reportHeapSnapshotProgress: function(done, total)\n    {\n        this._profiler._reportHeapSnapshotProgress(done, total);\n    }\n}\n\nWebInspector.ProfileSidebarTreeElement = function(profile, titleFormat, className)\n{\n    this.profile = profile;\n    this._titleFormat = titleFormat;\n\n    if (this.profile.title.indexOf(UserInitiatedProfileName) === 0)\n        this._profileNumber = this.profile.title.substring(UserInitiatedProfileName.length + 1);\n\n    WebInspector.SidebarTreeElement.call(this, className, \"\", \"\", profile, false);\n\n    this.refreshTitles();\n}\n\nWebInspector.ProfileSidebarTreeElement.prototype = {\n    onselect: function()\n    {\n        this.treeOutline.panel.showProfile(this.profile);\n    },\n\n    ondelete: function()\n    {\n        this.treeOutline.panel._removeProfileHeader(this.profile);\n        return true;\n    },\n\n    get mainTitle()\n    {\n        if (this._mainTitle)\n            return this._mainTitle;\n        if (this.profile.title.indexOf(UserInitiatedProfileName) === 0)\n            return WebInspector.UIString(this._titleFormat, this._profileNumber);\n        return this.profile.title;\n    },\n\n    set mainTitle(x)\n    {\n        this._mainTitle = x;\n        this.refreshTitles();\n    },\n\n    set searchMatches(matches)\n    {\n        if (!matches) {\n            if (!this.bubbleElement)\n                return;\n            this.bubbleElement.removeStyleClass(\"search-matches\");\n            this.bubbleText = \"\";\n            return;\n        }\n\n        this.bubbleText = matches;\n        this.bubbleElement.addStyleClass(\"search-matches\");\n    }\n}\n\nWebInspector.ProfileSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;\n\nWebInspector.ProfileGroupSidebarTreeElement = function(title, subtitle)\n{\n    WebInspector.SidebarTreeElement.call(this, \"profile-group-sidebar-tree-item\", title, subtitle, null, true);\n}\n\nWebInspector.ProfileGroupSidebarTreeElement.prototype = {\n    onselect: function()\n    {\n        if (this.children.length > 0)\n            WebInspector.panels.profiles.showProfile(this.children[this.children.length - 1].profile);\n    }\n}\n\nWebInspector.ProfileGroupSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/PropertiesSection.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Google Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.PropertiesSection = function(title, subtitle)\n{\n    WebInspector.Section.call(this, title, subtitle);\n\n    this.headerElement.addStyleClass(\"monospace\");\n    this.propertiesElement = document.createElement(\"ol\");\n    this.propertiesElement.className = \"properties properties-tree monospace\";\n    this.propertiesElement.tabIndex = 0;\n    this.propertiesTreeOutline = new TreeOutline(this.propertiesElement);\n    this.propertiesTreeOutline.section = this;\n\n    this.element.appendChild(this.propertiesElement);\n}\n\nWebInspector.PropertiesSection.prototype.__proto__ = WebInspector.Section.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/PropertiesSidebarPane.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.PropertiesSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Properties\"));\n}\n\nWebInspector.PropertiesSidebarPane.prototype = {\n    update: function(node)\n    {\n        var body = this.bodyElement;\n\n        if (!node) {\n            body.removeChildren();\n            this.sections = [];\n            return;\n        }\n\n        function callback(prototypes)\n        {\n            var body = this.bodyElement;\n            body.removeChildren();\n            this.sections = [];\n\n            // Get array of prototype user-friendly names.\n            for (var i = 0; i < prototypes.length; ++i) {\n                var prototype = WebInspector.RemoteObject.fromPayload(prototypes[i]);\n                var title = prototype.description;\n                if (title.match(/Prototype$/))\n                    title = title.replace(/Prototype$/, \"\");\n                var section = new WebInspector.ObjectPropertiesSection(prototype, title);\n                this.sections.push(section);\n                body.appendChild(section.element);\n            }\n        }\n        InspectorBackend.getNodePrototypes(node.id, callback.bind(this));\n    }\n}\n\nWebInspector.PropertiesSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/RemoteObject.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.RemoteObject = function(objectId, type, description, hasChildren)\n{\n    this._objectId = objectId;\n    this._type = type;\n    this._description = description;\n    this._hasChildren = hasChildren;\n}\n\nWebInspector.RemoteObject.fromPrimitiveValue = function(value)\n{\n    return new WebInspector.RemoteObject(null, typeof value, value);\n}\n\nWebInspector.RemoteObject.fromLocalObject = function(value)\n{\n    return new WebInspector.LocalJSONObject(value);\n}\n\nWebInspector.RemoteObject.resolveNode = function(node, callback)\n{\n    function mycallback(object)\n    {\n        callback(object ? WebInspector.RemoteObject.fromPayload(object) : null);\n    }\n    InspectorBackend.resolveNode(node.id, mycallback);\n}\n\nWebInspector.RemoteObject.fromPayload = function(payload)\n{\n    if (typeof payload === \"object\")\n        return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.description, payload.hasChildren);\n    // FIXME: make sure we only get here with real payloads in the new DebuggerAgent.js.\n    return payload;\n}\n\nWebInspector.RemoteObject.type = function(remoteObject)\n{\n    if (remoteObject === null)\n        return \"null\";\n\n    var type = typeof remoteObject;\n    if (type !== \"object\" && type !== \"function\")\n        return type;\n\n    return remoteObject.type;\n}\n\nWebInspector.RemoteObject.prototype = {\n    get objectId()\n    {\n        return this._objectId;\n    },\n\n    get type()\n    {\n        return this._type;\n    },\n\n    get description()\n    {\n        return this._description;\n    },\n\n    get hasChildren()\n    {\n        return this._hasChildren;\n    },\n\n    isError: function()\n    {\n        return this._type === \"error\";\n    },\n\n    getOwnProperties: function(abbreviate, callback)\n    {\n        this.getProperties(false, abbreviate, callback);\n    },\n\n    getProperties: function(ignoreHasOwnProperty, abbreviate, callback)\n    {\n        if (!this._objectId) {\n            callback([]);\n            return;\n        }\n        function remoteObjectBinder(properties)\n        {\n            for (var i = 0; properties && i < properties.length; ++i)\n                properties[i].value = WebInspector.RemoteObject.fromPayload(properties[i].value);\n            callback(properties);\n        }\n        InspectorBackend.getProperties(this._objectId, !!ignoreHasOwnProperty, abbreviate, remoteObjectBinder);\n    },\n\n    setPropertyValue: function(name, value, callback)\n    {\n        if (!this._objectId) {\n            callback(false);\n            return;\n        }\n        InspectorBackend.setPropertyValue(this._objectId, name, value, callback);\n    },\n\n    pushNodeToFrontend: function(callback)\n    {\n        InspectorBackend.pushNodeToFrontend(this._objectId, callback);\n    }\n}\n\nWebInspector.RemoteObjectProperty = function(name, value)\n{\n    this.name = name;\n    this.value = value;\n}\n\n// The below is a wrapper around a local object that provides an interface comaptible\n// with RemoteObject, to be used by the UI code (primarily ObjectPropertiesSection).\n// Note that only JSON-compliant objects are currently supported, as there's no provision\n// for traversing prototypes, extracting class names via constuctor, handling properties\n// or functions.\n\nWebInspector.LocalJSONObject = function(value)\n{\n    this._value = value;\n}\n\nWebInspector.LocalJSONObject.prototype = {\n    get description()\n    {\n        var type = this.type;\n        switch (type) {\n            case \"array\":\n                return \"[\" + this._value.length + \"]\";\n            case \"object\":\n                return this.hasChildren ? \"{...}\" : \"{ }\";\n            default:\n                return JSON.stringify(this._value);\n        }\n    },\n\n    get type()\n    {\n        if (this._value === null)\n            return \"null\";\n        if (this._value instanceof Array)\n            return \"array\";\n        return typeof this._value;\n    },\n\n    get hasChildren()\n    {\n        return typeof this._value === \"object\" && this._value !== null && Object.keys(this._value).length;\n    },\n\n    getOwnProperties: function(abbreviate, callback)\n    {\n        return this.getProperties(false, abbreviate, callback);\n    },\n\n    getProperties: function(ignoreHasOwnProperty, abbreviate, callback)\n    {\n        function buildProperty(propName)\n        {\n            return new WebInspector.RemoteObjectProperty(propName, new WebInspector.LocalJSONObject(this._value[propName]));\n        }\n        callback(Object.keys(this._value).map(buildProperty.bind(this)));\n    },\n\n    isError: function()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Resource.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nWebInspector.Resource = function(identifier, url)\n{\n    this.identifier = identifier;\n    this.url = url;\n    this._startTime = -1;\n    this._endTime = -1;\n    this._category = WebInspector.resourceCategories.other;\n    this._pendingContentCallbacks = [];\n    this._responseHeadersSize = 0;\n}\n\n// Keep these in sync with WebCore::InspectorResource::Type\nWebInspector.Resource.Type = {\n    Document:   0,\n    Stylesheet: 1,\n    Image:      2,\n    Font:       3,\n    Script:     4,\n    XHR:        5,\n    WebSocket:  7,\n    Other:      8,\n\n    isTextType: function(type)\n    {\n        return (type === this.Document) || (type === this.Stylesheet) || (type === this.Script) || (type === this.XHR);\n    },\n\n    toUIString: function(type)\n    {\n        switch (type) {\n            case this.Document:\n                return WebInspector.UIString(\"Document\");\n            case this.Stylesheet:\n                return WebInspector.UIString(\"Stylesheet\");\n            case this.Image:\n                return WebInspector.UIString(\"Image\");\n            case this.Font:\n                return WebInspector.UIString(\"Font\");\n            case this.Script:\n                return WebInspector.UIString(\"Script\");\n            case this.XHR:\n                return WebInspector.UIString(\"XHR\");\n            case this.WebSocket:\n                return WebInspector.UIString(\"WebSocket\");\n            case this.Other:\n            default:\n                return WebInspector.UIString(\"Other\");\n        }\n    },\n\n    // Returns locale-independent string identifier of resource type (primarily for use in extension API).\n    // The IDs need to be kept in sync with webInspector.resoureces.Types object in ExtensionAPI.js.\n    toString: function(type)\n    {\n        switch (type) {\n            case this.Document:\n                return \"document\";\n            case this.Stylesheet:\n                return \"stylesheet\";\n            case this.Image:\n                return \"image\";\n            case this.Font:\n                return \"font\";\n            case this.Script:\n                return \"script\";\n            case this.XHR:\n                return \"xhr\";\n            case this.WebSocket:\n                return \"websocket\";\n            case this.Other:\n            default:\n                return \"other\";\n        }\n    }\n}\n\nWebInspector.Resource.prototype = {\n    get url()\n    {\n        return this._url;\n    },\n\n    set url(x)\n    {\n        if (this._url === x)\n            return;\n\n        this._url = x;\n        delete this._parsedQueryParameters;\n\n        var parsedURL = x.asParsedURL();\n        this.domain = parsedURL ? parsedURL.host : \"\";\n        this.path = parsedURL ? parsedURL.path : \"\";\n        this.lastPathComponent = \"\";\n        if (parsedURL && parsedURL.path) {\n            // First cut the query params.\n            var path = parsedURL.path;\n            var indexOfQuery = path.indexOf(\"?\");\n            if (indexOfQuery !== -1)\n                path = path.substring(0, indexOfQuery);\n\n            // Then take last path component.\n            var lastSlashIndex = path.lastIndexOf(\"/\");\n            if (lastSlashIndex !== -1)\n                this.lastPathComponent = path.substring(lastSlashIndex + 1);\n        }\n        this.lastPathComponentLowerCase = this.lastPathComponent.toLowerCase();\n    },\n\n    get documentURL()\n    {\n        return this._documentURL;\n    },\n\n    set documentURL(x)\n    {\n        this._documentURL = x;\n    },\n\n    get displayName()\n    {\n        if (this._displayName)\n            return this._displayName;\n        this._displayName = this.lastPathComponent;\n        if (!this._displayName)\n            this._displayName = this.displayDomain;\n        if (!this._displayName && this.url)\n            this._displayName = this.url.trimURL(WebInspector.mainResource ? WebInspector.mainResource.domain : \"\");\n        if (this._displayName === \"/\")\n            this._displayName = this.url;\n        return this._displayName;\n    },\n\n    get displayDomain()\n    {\n        // WebInspector.Database calls this, so don't access more than this.domain.\n        if (this.domain && (!WebInspector.mainResource || (WebInspector.mainResource && this.domain !== WebInspector.mainResource.domain)))\n            return this.domain;\n        return \"\";\n    },\n\n    get startTime()\n    {\n        return this._startTime || -1;\n    },\n\n    set startTime(x)\n    {\n        this._startTime = x;\n    },\n\n    get responseReceivedTime()\n    {\n        return this._responseReceivedTime || -1;\n    },\n\n    set responseReceivedTime(x)\n    {\n        this._responseReceivedTime = x;\n    },\n\n    get endTime()\n    {\n        return this._endTime || -1;\n    },\n\n    set endTime(x)\n    {\n        if (this.timing && this.timing.requestTime) {\n            // Check against accurate responseReceivedTime.\n            this._endTime = Math.max(x, this.responseReceivedTime);\n        } else {\n            // Prefer endTime since it might be from the network stack.\n            this._endTime = x;\n            if (this._responseReceivedTime > x)\n                this._responseReceivedTime = x;\n        }\n    },\n\n    get duration()\n    {\n        if (this._endTime === -1 || this._startTime === -1)\n            return -1;\n        return this._endTime - this._startTime;\n    },\n\n    get latency()\n    {\n        if (this._responseReceivedTime === -1 || this._startTime === -1)\n            return -1;\n        return this._responseReceivedTime - this._startTime;\n    },\n\n    get receiveDuration()\n    {\n        if (this._endTime === -1 || this._responseReceivedTime === -1)\n            return -1;\n        return this._endTime - this._responseReceivedTime;\n    },\n\n    get resourceSize()\n    {\n        return this._resourceSize || 0;\n    },\n\n    set resourceSize(x)\n    {\n        this._resourceSize = x;\n    },\n\n    get transferSize()\n    {\n        if (this.cached)\n            return 0;\n        if (this.statusCode === 304) // Not modified\n            return this._responseHeadersSize;\n        // FIXME: We prefer using Content-Length over resourceSize as\n        // resourceSize may differ from actual transfer size if platform's\n        // network stack performed decoding (e.g. gzip decompression).\n        // The Content-Length, though, is expected to come from raw\n        // response headers and will reflect actual transfer length.\n        // This won't work for chunked content encoding, so fall back to\n        // resourceSize when we don't have Content-Length. This still won't\n        // work for chunks with non-trivial encodings. We need a way to\n        // get actaul transfer size from the network stack.\n        var bodySize = Number(this.responseHeaders[\"Content-Length\"] || this.resourceSize);\n        return this._responseHeadersSize + bodySize;\n    },\n\n    get expectedContentLength()\n    {\n        return this._expectedContentLength || 0;\n    },\n\n    set expectedContentLength(x)\n    {\n        this._expectedContentLength = x;\n    },\n\n    get finished()\n    {\n        return this._finished;\n    },\n\n    set finished(x)\n    {\n        if (this._finished === x)\n            return;\n\n        this._finished = x;\n\n        if (x) {\n            this._checkWarnings();\n            this.dispatchEventToListeners(\"finished\");\n            if (this._pendingContentCallbacks.length)\n                this._innerRequestContent();\n        }\n    },\n\n    get failed()\n    {\n        return this._failed;\n    },\n\n    set failed(x)\n    {\n        this._failed = x;\n    },\n\n    get category()\n    {\n        return this._category;\n    },\n\n    set category(x)\n    {\n        this._category = x;\n    },\n\n    get cached()\n    {\n        return this._cached;\n    },\n\n    set cached(x)\n    {\n        this._cached = x;\n        if (x)\n            delete this._timing;\n    },\n\n    get timing()\n    {\n        return this._timing;\n    },\n\n    set timing(x)\n    {\n        if (x && !this._cached) {\n            // Take startTime and responseReceivedTime from timing data for better accuracy.\n            // Timing's requestTime is a baseline in seconds, rest of the numbers there are ticks in millis.\n            this._startTime = x.requestTime;\n            this._responseReceivedTime = x.requestTime + x.receiveHeadersEnd / 1000.0;\n\n            this._timing = x;\n            this.dispatchEventToListeners(\"timing changed\");\n        }\n    },\n\n    get mimeType()\n    {\n        return this._mimeType;\n    },\n\n    set mimeType(x)\n    {\n        this._mimeType = x;\n    },\n\n    get type()\n    {\n        return this._type;\n    },\n\n    set type(x)\n    {\n        if (this._type === x)\n            return;\n\n        this._type = x;\n\n        switch (x) {\n            case WebInspector.Resource.Type.Document:\n                this.category = WebInspector.resourceCategories.documents;\n                break;\n            case WebInspector.Resource.Type.Stylesheet:\n                this.category = WebInspector.resourceCategories.stylesheets;\n                break;\n            case WebInspector.Resource.Type.Script:\n                this.category = WebInspector.resourceCategories.scripts;\n                break;\n            case WebInspector.Resource.Type.Image:\n                this.category = WebInspector.resourceCategories.images;\n                break;\n            case WebInspector.Resource.Type.Font:\n                this.category = WebInspector.resourceCategories.fonts;\n                break;\n            case WebInspector.Resource.Type.XHR:\n                this.category = WebInspector.resourceCategories.xhr;\n                break;\n            case WebInspector.Resource.Type.WebSocket:\n                this.category = WebInspector.resourceCategories.websockets;\n                break;\n            case WebInspector.Resource.Type.Other:\n            default:\n                this.category = WebInspector.resourceCategories.other;\n                break;\n        }\n    },\n\n    get requestHeaders()\n    {\n        return this._requestHeaders || {};\n    },\n\n    set requestHeaders(x)\n    {\n        this._requestHeaders = x;\n        delete this._sortedRequestHeaders;\n        delete this._requestCookies;\n\n        this.dispatchEventToListeners(\"requestHeaders changed\");\n    },\n\n    get sortedRequestHeaders()\n    {\n        if (this._sortedRequestHeaders !== undefined)\n            return this._sortedRequestHeaders;\n\n        this._sortedRequestHeaders = [];\n        for (var key in this.requestHeaders)\n            this._sortedRequestHeaders.push({header: key, value: this.requestHeaders[key]});\n        this._sortedRequestHeaders.sort(function(a,b) { return a.header.localeCompare(b.header) });\n\n        return this._sortedRequestHeaders;\n    },\n\n    requestHeaderValue: function(headerName)\n    {\n        return this._headerValue(this.requestHeaders, headerName);\n    },\n\n    get requestCookies()\n    {\n        if (!this._requestCookies)\n            this._requestCookies = WebInspector.CookieParser.parseCookie(this.requestHeaderValue(\"Cookie\"));\n        return this._requestCookies;\n    },\n\n    get requestFormData()\n    {\n        return this._requestFormData;\n    },\n\n    set requestFormData(x)\n    {\n        this._requestFormData = x;\n        delete this._parsedFormParameters;\n    },\n\n    get responseHeaders()\n    {\n        return this._responseHeaders || {};\n    },\n\n    set responseHeaders(x)\n    {\n        this._responseHeaders = x;\n        // FIXME: we should take actual headers size from network stack, when possible.\n        this._responseHeadersSize = this._headersSize(x);\n        delete this._sortedResponseHeaders;\n        delete this._responseCookies;\n\n        this.dispatchEventToListeners(\"responseHeaders changed\");\n    },\n\n    get sortedResponseHeaders()\n    {\n        if (this._sortedResponseHeaders !== undefined)\n            return this._sortedResponseHeaders;\n\n        this._sortedResponseHeaders = [];\n        for (var key in this.responseHeaders)\n            this._sortedResponseHeaders.push({header: key, value: this.responseHeaders[key]});\n        this._sortedResponseHeaders.sort(function(a,b) { return a.header.localeCompare(b.header) });\n\n        return this._sortedResponseHeaders;\n    },\n\n    responseHeaderValue: function(headerName)\n    {\n        return this._headerValue(this.responseHeaders, headerName);\n    },\n\n    get responseCookies()\n    {\n        if (!this._responseCookies)\n            this._responseCookies = WebInspector.CookieParser.parseSetCookie(this.responseHeaderValue(\"Set-Cookie\"));\n        return this._responseCookies;\n    },\n\n    get queryParameters()\n    {\n        if (this._parsedQueryParameters)\n            return this._parsedQueryParameters;\n        var queryString = this.url.split(\"?\", 2)[1];\n        if (!queryString)\n            return;\n        this._parsedQueryParameters = this._parseParameters(queryString);\n        return this._parsedQueryParameters;\n    },\n\n    get formParameters()\n    {\n        if (this._parsedFormParameters)\n            return this._parsedFormParameters;\n        if (!this.requestFormData)\n            return;\n        var requestContentType = this.requestHeaderValue(\"Content-Type\");\n        if (!requestContentType || !requestContentType.match(/^application\\/x-www-form-urlencoded\\s*(;.*)?$/i))\n            return;\n        this._parsedFormParameters = this._parseParameters(this.requestFormData);\n        return this._parsedFormParameters;\n    },\n\n    _parseParameters: function(queryString)\n    {\n        function parseNameValue(pair)\n        {\n            var parameter = {};\n            var splitPair = pair.split(\"=\", 2);\n\n            parameter.name = splitPair[0];\n            if (splitPair.length === 1)\n                parameter.value = \"\";\n            else\n                parameter.value = splitPair[1];\n            return parameter;\n        }\n        return queryString.split(\"&\").map(parseNameValue);\n    },\n\n    _headerValue: function(headers, headerName)\n    {\n        headerName = headerName.toLowerCase();\n        for (var header in headers) {\n            if (header.toLowerCase() === headerName)\n                return headers[header];\n        }\n    },\n\n    _headersSize: function(headers)\n    {\n        var size = 0;\n        for (var header in headers)\n            size += header.length + headers[header].length + 3; // _typical_ overhead per herader is \": \".length + \"\\n\".length.\n        return size;\n    },\n\n    get errors()\n    {\n        return this._errors || 0;\n    },\n\n    set errors(x)\n    {\n        this._errors = x;\n        this.dispatchEventToListeners(\"errors-warnings-updated\");\n    },\n\n    get warnings()\n    {\n        return this._warnings || 0;\n    },\n\n    set warnings(x)\n    {\n        this._warnings = x;\n        this.dispatchEventToListeners(\"errors-warnings-updated\");\n    },\n\n    clearErrorsAndWarnings: function()\n    {\n        this._warnings = 0;\n        this._errors = 0;\n        this.dispatchEventToListeners(\"errors-warnings-updated\");\n    },\n\n    _mimeTypeIsConsistentWithType: function()\n    {\n        // If status is an error, content is likely to be of an inconsistent type,\n        // as it's going to be an error message. We do not want to emit a warning\n        // for this, though, as this will already be reported as resource loading failure.\n        if (this.statusCode >= 400)\n            return true;\n\n        if (typeof this.type === \"undefined\"\n            || this.type === WebInspector.Resource.Type.Other\n            || this.type === WebInspector.Resource.Type.XHR\n            || this.type === WebInspector.Resource.Type.WebSocket)\n            return true;\n\n        if (!this.mimeType)\n            return true; // Might be not known for cached resources with null responses.\n\n        if (this.mimeType in WebInspector.MIMETypes)\n            return this.type in WebInspector.MIMETypes[this.mimeType];\n\n        return false;\n    },\n\n    _checkWarnings: function()\n    {\n        for (var warning in WebInspector.Warnings)\n            this._checkWarning(WebInspector.Warnings[warning]);\n    },\n\n    _checkWarning: function(warning)\n    {\n        var msg;\n        switch (warning.id) {\n            case WebInspector.Warnings.IncorrectMIMEType.id:\n                if (!this._mimeTypeIsConsistentWithType())\n                    msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.Other,\n                        WebInspector.ConsoleMessage.MessageType.Log,\n                        WebInspector.ConsoleMessage.MessageLevel.Warning,\n                        -1,\n                        this.url,\n                        1,\n                        String.sprintf(WebInspector.Warnings.IncorrectMIMEType.message, WebInspector.Resource.Type.toUIString(this.type), this.mimeType),\n                        null,\n                        null);\n                break;\n        }\n\n        if (msg)\n            WebInspector.console.addMessage(msg);\n    },\n\n    get content()\n    {\n        return this._content;\n    },\n\n    get contentTimestamp()\n    {\n        return this._contentTimestamp;\n    },\n\n    setInitialContent: function(content)\n    {\n        this._content = content;\n    },\n\n    isLocallyModified: function()\n    {\n        return !!this._baseRevision;\n    },\n\n    setContent: function(newContent, onRevert)\n    {\n        var revisionResource = new WebInspector.Resource(null, this.url);\n        revisionResource.type = this.type;\n        revisionResource.loader = this.loader;\n        revisionResource.timestamp = this.timestamp;\n        revisionResource._content = this._content;\n        revisionResource._actualResource = this;\n        revisionResource._fireOnRevert = onRevert;\n\n        if (this.finished)\n            revisionResource.finished = true;\n        else {\n            function finished()\n            {\n                this.removeEventListener(\"finished\", finished);\n                revisionResource.finished = true;\n            }\n            this.addEventListener(\"finished\", finished.bind(this));\n        }\n\n        if (!this._baseRevision)\n            this._baseRevision = revisionResource;\n        else\n            revisionResource._baseRevision = this._baseRevision;\n\n        var data = { revision: revisionResource };\n        this._content = newContent;\n        this.timestamp = new Date();\n        this.dispatchEventToListeners(\"content-changed\", data);\n    },\n\n    revertToThis: function()\n    {\n        if (!this._actualResource || !this._fireOnRevert)\n            return;\n\n        function callback(content)\n        {\n            if (content)\n                this._fireOnRevert(content);\n        }\n        this.requestContent(callback.bind(this));\n    },\n\n    get baseRevision()\n    {\n        return this._baseRevision;\n    },\n\n    requestContent: function(callback)\n    {\n        // We do not support content retrieval for WebSockets at the moment.\n        // Since WebSockets are potentially long-living, fail requests immediately\n        // to prevent caller blocking until resource is marked as finished.\n        if (this.type === WebInspector.Resource.Type.WebSocket) {\n            callback(null, null);\n            return;\n        }\n        if (typeof this._content !== \"undefined\") {\n            callback(this.content, this._contentEncoded);\n            return;\n        }\n        this._pendingContentCallbacks.push(callback);\n        if (this.finished)\n            this._innerRequestContent();\n    },\n\n    populateImageSource: function(image)\n    {\n        function onResourceContent()\n        {\n            image.src = this._contentURL();\n        }\n\n        if (Preferences.useDataURLForResourceImageIcons)\n            this.requestContent(onResourceContent.bind(this));\n        else\n            image.src = this.url;\n    },\n\n    _contentURL: function()\n    {\n        var maxDataUrlSize = 1024 * 1024;\n        // If resource content is not available or won't fit a data URL, fall back to using original URL.\n        if (this._content == null || this._content.length > maxDataUrlSize)\n            return this.url;\n\n        return \"data:\" + this.mimeType + (this._contentEncoded ? \";base64,\" : \",\") + this._content;\n    },\n\n    _innerRequestContent: function()\n    {\n        if (this._contentRequested)\n            return;\n        this._contentRequested = true;\n        this._contentEncoded = !WebInspector.Resource.Type.isTextType(this.type);\n\n        function onResourceContent(data)\n        {\n            this._content = data;\n            var callbacks = this._pendingContentCallbacks.slice();\n            for (var i = 0; i < callbacks.length; ++i)\n                callbacks[i](this._content, this._contentEncoded);\n            this._pendingContentCallbacks.length = 0;\n            delete this._contentRequested;\n        }\n        WebInspector.networkManager.requestContent(this, this._contentEncoded, onResourceContent.bind(this));\n    }\n}\n\nWebInspector.Resource.prototype.__proto__ = WebInspector.Object.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ResourceCategory.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ResourceCategory = function(name, title, color)\n{\n    this.name = name;\n    this.title = title;\n    this.color = color;\n}\n\nWebInspector.ResourceCategory.prototype = {\n    toString: function()\n    {\n        return this.title;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ResourceCookiesView.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ResourceCookiesView = function(resource)\n{\n    WebInspector.View.call(this);\n    this.element.addStyleClass(\"resource-cookies-view\");\n\n    this._resource = resource;\n\n    resource.addEventListener(\"requestHeaders changed\", this.show, this);\n    resource.addEventListener(\"responseHeaders changed\", this.show, this);\n}\n\nWebInspector.ResourceCookiesView.prototype = {\n    show: function(parentElement)\n    {\n        if (!this._resource.requestCookies && !this._resource.responseCookies) {\n            if (!this._emptyMsgElement) {\n                this._emptyMsgElement = document.createElement(\"div\");\n                this._emptyMsgElement.className = \"storage-empty-view\";\n                this._emptyMsgElement.textContent = WebInspector.UIString(\"This request has no cookies.\");\n                this.element.appendChild(this._emptyMsgElement);\n            }\n            WebInspector.View.prototype.show.call(this, parentElement);\n            return;\n        }\n\n        if (this._emptyMsgElement)\n            this._emptyMsgElement.parentElement.removeChild(this._emptyMsgElement);\n\n        if (!this._cookiesTable) {\n            this._cookiesTable = new WebInspector.CookiesTable(null, true, true);\n            this._cookiesTable.addCookiesFolder(WebInspector.UIString(\"Request Cookies\"), this._resource.requestCookies);\n            this._cookiesTable.addCookiesFolder(WebInspector.UIString(\"Response Cookies\"), this._resource.responseCookies);\n            this.element.appendChild(this._cookiesTable.element);\n        }\n\n        WebInspector.View.prototype.show.call(this, parentElement);\n        this._cookiesTable.updateWidths();\n    }\n}\n\nWebInspector.ResourceCookiesView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ResourceHeadersView.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) IBM Corp. 2009  All rights reserved.\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ResourceHeadersView = function(resource)\n{\n    WebInspector.View.call(this);\n    this.element.addStyleClass(\"resource-headers-view\");\n\n    this._resource = resource;\n\n    this._headersListElement = document.createElement(\"ol\");\n    this._headersListElement.className = \"outline-disclosure\";\n    this.element.appendChild(this._headersListElement);\n\n    this._headersTreeOutline = new TreeOutline(this._headersListElement);\n    this._headersTreeOutline.expandTreeElementsWhenArrowing = true;\n\n    this._urlTreeElement = new TreeElement(\"\", null, false);\n    this._urlTreeElement.selectable = false;\n    this._headersTreeOutline.appendChild(this._urlTreeElement);\n\n    this._requestMethodTreeElement = new TreeElement(\"\", null, false);\n    this._requestMethodTreeElement.selectable = false;\n    this._headersTreeOutline.appendChild(this._requestMethodTreeElement);\n\n    this._statusCodeTreeElement = new TreeElement(\"\", null, false);\n    this._statusCodeTreeElement.selectable = false;\n    this._headersTreeOutline.appendChild(this._statusCodeTreeElement);\n     \n    this._requestHeadersTreeElement = new TreeElement(\"\", null, true);\n    this._requestHeadersTreeElement.expanded = true;\n    this._requestHeadersTreeElement.selectable = false;\n    this._headersTreeOutline.appendChild(this._requestHeadersTreeElement);\n\n    this._decodeHover = WebInspector.UIString(\"Double-Click to toggle between URL encoded and decoded formats\");\n    this._decodeRequestParameters = true;\n\n    this._queryStringTreeElement = new TreeElement(\"\", null, true);\n    this._queryStringTreeElement.expanded = true;\n    this._queryStringTreeElement.selectable = false;\n    this._queryStringTreeElement.hidden = true;\n    this._headersTreeOutline.appendChild(this._queryStringTreeElement);\n\n    this._formDataTreeElement = new TreeElement(\"\", null, true);\n    this._formDataTreeElement.expanded = true;\n    this._formDataTreeElement.selectable = false;\n    this._formDataTreeElement.hidden = true;\n    this._headersTreeOutline.appendChild(this._formDataTreeElement);\n\n    this._requestPayloadTreeElement = new TreeElement(WebInspector.UIString(\"Request Payload\"), null, true);\n    this._requestPayloadTreeElement.expanded = true;\n    this._requestPayloadTreeElement.selectable = false;\n    this._requestPayloadTreeElement.hidden = true;\n    this._headersTreeOutline.appendChild(this._requestPayloadTreeElement);\n\n    this._responseHeadersTreeElement = new TreeElement(\"\", null, true);\n    this._responseHeadersTreeElement.expanded = true;\n    this._responseHeadersTreeElement.selectable = false;\n    this._headersTreeOutline.appendChild(this._responseHeadersTreeElement);\n\n    resource.addEventListener(\"requestHeaders changed\", this._refreshRequestHeaders, this);\n    resource.addEventListener(\"responseHeaders changed\", this._refreshResponseHeaders, this);\n    resource.addEventListener(\"finished\", this._refreshHTTPInformation, this);\n\n    this._refreshURL();\n    this._refreshQueryString();\n    this._refreshRequestHeaders();\n    this._refreshResponseHeaders();\n    this._refreshHTTPInformation();\n}\n\nWebInspector.ResourceHeadersView.prototype = {\n\n    _refreshURL: function()\n    {\n        this._urlTreeElement.titleHTML = \"<div class=\\\"header-name\\\">\" + WebInspector.UIString(\"Request URL\") + \":</div>\" +\n            \"<div class=\\\"header-value source-code\\\">\" + this._resource.url.escapeHTML() + \"</div>\";\n    },\n\n    _refreshQueryString: function()\n    {\n        var queryParameters = this._resource.queryParameters;\n        this._queryStringTreeElement.hidden = !queryParameters;\n        if (queryParameters)\n            this._refreshParms(WebInspector.UIString(\"Query String Parameters\"), queryParameters, this._queryStringTreeElement);\n    },\n\n    _refreshFormData: function()\n    {\n        this._formDataTreeElement.hidden = true;\n        this._requestPayloadTreeElement.hidden = true;\n\n        var formData = this._resource.requestFormData;\n        if (!formData)\n            return;\n\n        var formParameters = this._resource.formParameters;\n        if (formParameters) {\n            this._formDataTreeElement.hidden = false;\n            this._refreshParms(WebInspector.UIString(\"Form Data\"), formParameters, this._formDataTreeElement);\n        } else {\n            this._requestPayloadTreeElement.hidden = false;\n            this._refreshRequestPayload(formData);\n        }\n    },\n\n    _refreshRequestPayload: function(formData)\n    {\n        this._requestPayloadTreeElement.removeChildren();\n\n        var title = \"<div class=\\\"raw-form-data header-value source-code\\\">\" + formData.escapeHTML() + \"</div>\";\n        var parmTreeElement = new TreeElement(null, null, false);\n        parmTreeElement.titleHTML = title;\n        parmTreeElement.selectable = false;\n        this._requestPayloadTreeElement.appendChild(parmTreeElement);\n    },\n\n    _refreshParms: function(title, parms, parmsTreeElement)\n    {\n        parmsTreeElement.removeChildren();\n\n        parmsTreeElement.titleHTML = title + \"<span class=\\\"header-count\\\">\" + WebInspector.UIString(\" (%d)\", parms.length) + \"</span>\";\n\n        for (var i = 0; i < parms.length; ++i) {\n            var name = parms[i].name;\n            var value = parms[i].value;\n\n            var errorDecoding = false;\n            if (this._decodeRequestParameters) {\n                if (value.indexOf(\"%\") >= 0) {\n                    try {\n                        value = decodeURIComponent(value);\n                    } catch(e) {\n                        errorDecoding = true;\n                    }\n                }\n                    \n                value = value.replace(/\\+/g, \" \");\n            }\n\n            valueEscaped = value.escapeHTML();\n            if (errorDecoding)\n                valueEscaped += \" <span class=\\\"error-message\\\">\" + WebInspector.UIString(\"(unable to decode value)\").escapeHTML() + \"</span>\";\n\n            var title = \"<div class=\\\"header-name\\\">\" + name.escapeHTML() + \":</div>\";\n            title += \"<div class=\\\"header-value source-code\\\">\" + valueEscaped + \"</div>\";\n\n            var parmTreeElement = new TreeElement(null, null, false);\n            parmTreeElement.titleHTML = title;\n            parmTreeElement.selectable = false;\n            parmTreeElement.tooltip = this._decodeHover;\n            parmTreeElement.ondblclick = this._toggleURLdecoding.bind(this);\n            parmsTreeElement.appendChild(parmTreeElement);\n        }\n    },\n\n    _toggleURLdecoding: function(event)\n    {\n        this._decodeRequestParameters = !this._decodeRequestParameters;\n        this._refreshQueryString();\n        this._refreshFormData();\n    },\n\n    _getHeaderValue: function(headers, key)\n    {\n        var lowerKey = key.toLowerCase();\n        for (var testKey in headers) {\n            if (testKey.toLowerCase() === lowerKey)\n                return headers[testKey];\n        }\n    },\n\n    _refreshRequestHeaders: function()\n    {\n        var additionalRow = null;\n        if (typeof this._resource.webSocketRequestKey3 !== \"undefined\")\n            additionalRow = {header: \"(Key3)\", value: this._resource.webSocketRequestKey3};\n        this._refreshHeaders(WebInspector.UIString(\"Request Headers\"), this._resource.sortedRequestHeaders, additionalRow, this._requestHeadersTreeElement);\n        this._refreshFormData();\n    },\n\n    _refreshResponseHeaders: function()\n    {\n        var additionalRow = null;\n        if (typeof this._resource.webSocketChallengeResponse !== \"undefined\")\n            additionalRow = {header: \"(Challenge Response)\", value: this._resource.webSocketChallengeResponse};\n        this._refreshHeaders(WebInspector.UIString(\"Response Headers\"), this._resource.sortedResponseHeaders, additionalRow, this._responseHeadersTreeElement);\n    },\n\n    _refreshHTTPInformation: function()\n    {\n        var requestMethodElement = this._requestMethodTreeElement;\n        requestMethodElement.hidden = !this._resource.statusCode;\n        var statusCodeElement = this._statusCodeTreeElement;\n        statusCodeElement.hidden = !this._resource.statusCode;\n        var statusCodeImage = \"\";\n\n        if (this._resource.statusCode) {\n            var statusImageSource = \"\";\n            if (this._resource.statusCode < 300 || this._resource.statusCode === 304)\n                statusImageSource = \"Images/successGreenDot.png\";\n            else if (this._resource.statusCode < 400)\n                statusImageSource = \"Images/warningOrangeDot.png\";\n            else\n                statusImageSource = \"Images/errorRedDot.png\";\n\n            var statusTextEscaped = this._resource.statusCode + \" \" + this._resource.statusText.escapeHTML();\n            statusCodeImage = \"<img class=\\\"resource-status-image\\\" src=\\\"\" + statusImageSource + \"\\\" title=\\\"\" + statusTextEscaped + \"\\\">\";\n    \n            requestMethodElement.titleHTML = \"<div class=\\\"header-name\\\">\" + WebInspector.UIString(\"Request Method\") + \":</div>\" +\n                \"<div class=\\\"header-value source-code\\\">\" + this._resource.requestMethod + \"</div>\";\n\n            statusCodeElement.titleHTML = \"<div class=\\\"header-name\\\">\" + WebInspector.UIString(\"Status Code\") + \":</div>\" +\n                statusCodeImage + \"<div class=\\\"header-value source-code\\\">\" + statusTextEscaped + \"</div>\";\n        }\n    },\n    \n    _refreshHeaders: function(title, headers, additionalRow, headersTreeElement)\n    {\n        headersTreeElement.removeChildren();\n\n        var length = headers.length;\n        headersTreeElement.titleHTML = title.escapeHTML() + \"<span class=\\\"header-count\\\">\" + WebInspector.UIString(\" (%d)\", length) + \"</span>\";\n        headersTreeElement.hidden = !length;\n\n        var length = headers.length;\n        for (var i = 0; i < length; ++i) {\n            var title = \"<div class=\\\"header-name\\\">\" + headers[i].header.escapeHTML() + \":</div>\";\n            title += \"<div class=\\\"header-value source-code\\\">\" + headers[i].value.escapeHTML() + \"</div>\"\n\n            var headerTreeElement = new TreeElement(null, null, false);\n            headerTreeElement.titleHTML = title;\n            headerTreeElement.selectable = false;\n            headersTreeElement.appendChild(headerTreeElement);\n        }\n\n        if (additionalRow) {\n            var title = \"<div class=\\\"header-name\\\">\" + additionalRow.header.escapeHTML() + \":</div>\";\n            title += \"<div class=\\\"header-value source-code\\\">\" + additionalRow.value.escapeHTML() + \"</div>\"\n\n            var headerTreeElement = new TreeElement(null, null, false);\n            headerTreeElement.titleHTML = title;\n            headerTreeElement.selectable = false;\n            headersTreeElement.appendChild(headerTreeElement);\n        }\n    }\n}\n\nWebInspector.ResourceHeadersView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ResourceTimingView.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ResourceTimingView = function(resource)\n{\n    WebInspector.View.call(this);\n    this.element.addStyleClass(\"resource-timing-view\");\n\n    this._resource = resource;\n\n    resource.addEventListener(\"timing changed\", this._refresh, this);\n}\n\nWebInspector.ResourceTimingView.prototype = {\n    show: function(parentElement)\n    {\n        if (!this._resource.timing) {\n            if (!this._emptyMsgElement) {\n                this._emptyMsgElement = document.createElement(\"div\");\n                this._emptyMsgElement.className = \"storage-empty-view\";\n                this._emptyMsgElement.textContent = WebInspector.UIString(\"This request has no detailed timing info.\");\n                this.element.appendChild(this._emptyMsgElement);\n            }\n            WebInspector.View.prototype.show.call(this, parentElement);\n            return;\n        }\n\n        if (this._emptyMsgElement)\n            this._emptyMsgElement.parentElement.removeChild(this._emptyMsgElement);\n\n        this._refresh();\n        WebInspector.View.prototype.show.call(this, parentElement);\n    },\n\n    _refresh: function()\n    {\n        if (this._tableElement)\n            this._tableElement.parentElement.removeChild(this._tableElement);\n\n        this._tableElement = WebInspector.ResourceTimingView.createTimingTable(this._resource);\n        this.element.appendChild(this._tableElement);\n    }\n}\n\nWebInspector.ResourceTimingView.createTimingTable = function(resource)\n{\n    var tableElement = document.createElement(\"table\");\n    var rows = [];\n\n    function addRow(title, className, start, end, color)\n    {\n        var row = {};\n        row.title = title;\n        row.className = className;\n        row.start = start;\n        row.end = end;\n        rows.push(row);\n    }\n\n    if (resource.timing.proxyStart !== -1)\n        addRow(WebInspector.UIString(\"Proxy\"), \"proxy\", resource.timing.proxyStart, resource.timing.proxyEnd);\n\n    if (resource.timing.dnsStart !== -1)\n        addRow(WebInspector.UIString(\"DNS Lookup\"), \"dns\", resource.timing.dnsStart, resource.timing.dnsEnd);\n\n    if (resource.timing.connectStart !== -1) {\n        if (resource.connectionReused)\n            addRow(WebInspector.UIString(\"Blocking\"), \"connecting\", resource.timing.connectStart, resource.timing.connectEnd);\n        else {\n            var connectStart = resource.timing.connectStart;\n            // Connection includes DNS, subtract it here.\n            if (resource.timing.dnsStart !== -1)\n                connectStart += resource.timing.dnsEnd - resource.timing.dnsStart;\n            addRow(WebInspector.UIString(\"Connecting\"), \"connecting\", connectStart, resource.timing.connectEnd);\n        }\n    }\n\n    if (resource.timing.sslStart !== -1)\n        addRow(WebInspector.UIString(\"SSL\"), \"ssl\", resource.timing.sslStart, resource.timing.sslEnd);\n\n    var sendStart = resource.timing.sendStart;\n    if (resource.timing.sslStart !== -1)\n        sendStart += resource.timing.sslEnd - resource.timing.sslStart;\n    \n    addRow(WebInspector.UIString(\"Sending\"), \"sending\", resource.timing.sendStart, resource.timing.sendEnd);\n    addRow(WebInspector.UIString(\"Waiting\"), \"waiting\", resource.timing.sendEnd, resource.timing.receiveHeadersEnd);\n    addRow(WebInspector.UIString(\"Receiving\"), \"receiving\", (resource.responseReceivedTime - resource.timing.requestTime) * 1000, (resource.endTime - resource.timing.requestTime) * 1000);\n\n    var chartWidth = 200;\n    var total = (resource.endTime - resource.timing.requestTime) * 1000;\n    var scale = chartWidth / total;\n\n    for (var i = 0; i < rows.length; ++i) {\n        var tr = document.createElement(\"tr\");\n        tableElement.appendChild(tr);\n\n        var td = document.createElement(\"td\");\n        td.textContent = rows[i].title;\n        tr.appendChild(td);\n\n        td = document.createElement(\"td\");\n        td.width = chartWidth + \"px\";\n\n        var row = document.createElement(\"div\");\n        row.className = \"network-timing-row\";\n        td.appendChild(row);\n\n        var bar = document.createElement(\"span\");\n        bar.className = \"network-timing-bar \" + rows[i].className;\n        bar.style.left = scale * rows[i].start + \"px\";\n        bar.style.right = scale * (total - rows[i].end) + \"px\";\n        bar.style.backgroundColor = rows[i].color;\n        bar.textContent = \"\\u200B\"; // Important for 0-time items to have 0 width.\n        row.appendChild(bar);\n\n        var title = document.createElement(\"span\");\n        title.className = \"network-timing-bar-title\";\n        if (total - rows[i].end < rows[i].start)\n            title.style.right = (scale * (total - rows[i].end) + 3) + \"px\";\n        else\n            title.style.left = (scale * rows[i].start + 3) + \"px\";\n        title.textContent = Number.millisToString(rows[i].end - rows[i].start);\n        row.appendChild(title);\n\n        tr.appendChild(td);\n    }\n    return tableElement;\n}\n\nWebInspector.ResourceTimingView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ResourceTreeModel.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nWebInspector.ResourceTreeModel = function()\n{\n    this.reset();\n}\n\nWebInspector.ResourceTreeModel.prototype = {\n    reset: function()\n    {\n        this._resourcesByURL = {};\n        this._resourcesByFrameId = {};\n        this._subframes = {};\n        if (WebInspector.panels)\n            WebInspector.panels.resources.clear();\n    },\n\n    addOrUpdateFrame: function(frame)\n    {\n        var tmpResource = new WebInspector.Resource(null, frame.url);\n        WebInspector.panels.resources.addOrUpdateFrame(frame.parentId, frame.id, frame.name, tmpResource.displayName);\n        var subframes = this._subframes[frame.parentId];\n        if (!subframes) {\n            subframes = {};\n            this._subframes[frame.parentId || 0] = subframes;\n        }\n        subframes[frame.id] = true;\n    },\n\n    didCommitLoadForFrame: function(frame, loader)\n    {\n        // frame.parentId === 0 is when main frame navigation happens.\n        this._clearChildFramesAndResources(frame.parentId ? frame.id : 0, loader.loaderId);\n\n        this.addOrUpdateFrame(frame);\n\n        var resourcesForFrame = this._resourcesByFrameId[frame.id];\n        for (var i = 0; resourcesForFrame && i < resourcesForFrame.length; ++i)\n            WebInspector.panels.resources.addResourceToFrame(frame.id, resourcesForFrame[i]);\n    },\n\n    frameDetachedFromParent: function(frameId)\n    {\n        this._clearChildFramesAndResources(frameId, 0);\n        WebInspector.panels.resources.removeFrame(frameId);\n    },\n\n    addResourceToFrame: function(frameId, resource)\n    {\n        var resourcesForFrame = this._resourcesByFrameId[frameId];\n        if (!resourcesForFrame) {\n            resourcesForFrame = [];\n            this._resourcesByFrameId[frameId] = resourcesForFrame;\n        }\n        resourcesForFrame.push(resource);\n        this._bindResourceURL(resource);\n\n        WebInspector.panels.resources.addResourceToFrame(frameId, resource);\n    },\n\n    forAllResources: function(callback)\n    {\n        this._callForFrameResources(0, callback);\n    },\n\n    addConsoleMessage: function(msg)\n    {\n        var resource = this.resourceForURL(msg.url);\n        if (!resource)\n            return;\n\n        switch (msg.level) {\n        case WebInspector.ConsoleMessage.MessageLevel.Warning:\n            resource.warnings += msg.repeatDelta;\n            break;\n        case WebInspector.ConsoleMessage.MessageLevel.Error:\n            resource.errors += msg.repeatDelta;\n            break;\n        }\n\n        var view = WebInspector.ResourceView.resourceViewForResource(resource);\n        if (view.addMessage)\n            view.addMessage(msg);\n    },\n\n    clearConsoleMessages: function()\n    {\n        function callback(resource)\n        {\n            resource.clearErrorsAndWarnings();\n        }\n        this.forAllResources(callback);\n    },\n\n    resourceForURL: function(url)\n    {\n        // FIXME: receive frameId here.\n        var entry = this._resourcesByURL[url];\n        if (entry instanceof Array)\n            return entry[0];\n        return entry;\n    },\n\n    _bindResourceURL: function(resource)\n    {\n        var resourceForURL = this._resourcesByURL[resource.url];\n        if (!resourceForURL)\n            this._resourcesByURL[resource.url] = resource;\n        else if (resourceForURL instanceof Array)\n            resourceForURL.push(resource);\n        else\n            this._resourcesByURL[resource.url] = [resourceForURL, resource];\n    },\n\n    _clearChildFramesAndResources: function(frameId, loaderId)\n    {\n        WebInspector.panels.resources.removeResourcesFromFrame(frameId);\n\n        this._clearResources(frameId, loaderId);\n        var subframes = this._subframes[frameId];\n        if (!subframes)\n            return;\n\n        for (var childFrameId in subframes) {\n            WebInspector.panels.resources.removeFrame(childFrameId);\n            this._clearChildFramesAndResources(childFrameId, loaderId);\n        }\n        delete this._subframes[frameId];\n    },\n\n    _clearResources: function(frameId, loaderToPreserveId)\n    {\n        var resourcesForFrame = this._resourcesByFrameId[frameId];\n        if (!resourcesForFrame)\n            return;\n\n        var preservedResourcesForFrame = [];\n        for (var i = 0; i < resourcesForFrame.length; ++i) {\n            var resource = resourcesForFrame[i];\n            if (resource.loader.loaderId === loaderToPreserveId) {\n                preservedResourcesForFrame.push(resource);\n                continue;\n            }\n            this._unbindResourceURL(resource);\n        }\n\n        delete this._resourcesByFrameId[frameId];\n        if (preservedResourcesForFrame.length)\n            this._resourcesByFrameId[frameId] = preservedResourcesForFrame;\n    },\n\n    _callForFrameResources: function(frameId, callback)\n    {\n        var resources = this._resourcesByFrameId[frameId];\n        for (var i = 0; resources && i < resources.length; ++i) {\n            if (callback(resources[i]))\n                return true;\n        }\n        \n        var frames = this._subframes[frameId];\n        if (frames) {\n            for (var id in frames) {\n                if (this._callForFrameResources(id, callback))\n                    return true;\n            }\n        }\n        return false;\n    },\n\n    _unbindResourceURL: function(resource)\n    {\n        var resourceForURL = this._resourcesByURL[resource.url];\n        if (!resourceForURL)\n            return;\n\n        if (resourceForURL instanceof Array) {\n            resourceForURL.remove(resource, true);\n            if (resourceForURL.length === 1)\n                this._resourcesByURL[resource.url] = resourceForURL[0];\n            return;\n        }\n\n        delete this._resourcesByURL[resource.url];\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ResourceView.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) IBM Corp. 2009  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ResourceView = function(resource)\n{\n    WebInspector.View.call(this);\n    this.element.addStyleClass(\"resource-view\");\n    this.resource = resource;\n}\n\nWebInspector.ResourceView.prototype = {\n    hasContent: function()\n    {\n        return false;\n    }\n}\n\nWebInspector.ResourceView.prototype.__proto__ = WebInspector.View.prototype;\n\nWebInspector.ResourceView.createResourceView = function(resource)\n{\n    switch (resource.category) {\n    case WebInspector.resourceCategories.documents:\n    case WebInspector.resourceCategories.stylesheets:\n    case WebInspector.resourceCategories.scripts:\n    case WebInspector.resourceCategories.xhr:\n        var contentProvider = new WebInspector.SourceFrameContentProviderForResource(resource);\n        var isScript = resource.type === WebInspector.Resource.Type.Script;\n        var view = new WebInspector.SourceFrame(contentProvider, resource.url, isScript);\n        view.resource = resource;\n        return view;\n    case WebInspector.resourceCategories.images:\n        return new WebInspector.ImageView(resource);\n    case WebInspector.resourceCategories.fonts:\n        return new WebInspector.FontView(resource);\n    default:\n        return new WebInspector.ResourceView(resource);\n    }\n}\n\nWebInspector.ResourceView.resourceViewTypeMatchesResource = function(resource)\n{\n    var resourceView = resource._resourcesView;\n    switch (resource.category) {\n    case WebInspector.resourceCategories.documents:\n    case WebInspector.resourceCategories.stylesheets:\n    case WebInspector.resourceCategories.scripts:\n    case WebInspector.resourceCategories.xhr:\n        return resourceView.__proto__ === WebInspector.SourceFrame.prototype;\n    case WebInspector.resourceCategories.images:\n        return resourceView.__proto__ === WebInspector.ImageView.prototype;\n    case WebInspector.resourceCategories.fonts:\n        return resourceView.__proto__ === WebInspector.FontView.prototype;\n    default:\n        return resourceView.__proto__ === WebInspector.ResourceView.prototype;\n    }\n}\n\nWebInspector.ResourceView.resourceViewForResource = function(resource)\n{\n    if (!resource)\n        return null;\n    if (!resource._resourcesView)\n        resource._resourcesView = WebInspector.ResourceView.createResourceView(resource);\n    return resource._resourcesView;\n}\n\nWebInspector.ResourceView.recreateResourceView = function(resource)\n{\n    var newView = WebInspector.ResourceView.createResourceView(resource);\n\n    var oldView = resource._resourcesView;\n    var oldViewParentNode = oldView.visible ? oldView.element.parentNode : null;\n    var scrollTop = oldView.scrollTop;\n\n    resource._resourcesView.detach();\n    delete resource._resourcesView;\n\n    resource._resourcesView = newView;\n\n    if (oldViewParentNode)\n        newView.show(oldViewParentNode);\n    if (scrollTop)\n        newView.scrollTop = scrollTop;\n\n    return newView;\n}\n\nWebInspector.ResourceView.existingResourceViewForResource = function(resource)\n{\n    if (!resource)\n        return null;\n    return resource._resourcesView;\n}\n\n\nWebInspector.SourceFrameContentProviderForResource = function(resource)\n{\n    WebInspector.SourceFrameContentProvider.call(this);\n    this._resource = resource;\n}\n\n//This is a map from resource.type to mime types\n//found in WebInspector.SourceTokenizer.Registry.\nWebInspector.SourceFrameContentProviderForResource.DefaultMIMETypeForResourceType = {\n    0: \"text/html\",\n    1: \"text/css\",\n    4: \"text/javascript\"\n}\n\nWebInspector.SourceFrameContentProviderForResource.prototype = {\n    requestContent: function(callback)\n    {\n        function contentLoaded(text)\n        {\n            var mimeType = WebInspector.SourceFrameContentProviderForResource.DefaultMIMETypeForResourceType[this._resource.type] || this._resource.mimeType;\n            if (this._resource.type !== WebInspector.Resource.Type.Script) {\n                // WebKit html lexer normalizes line endings and scripts are passed to VM with \"\\n\" line endings.\n                // However, resource content has original line endings, so we have to normalize line endings here.\n                text = text.replace(/\\r\\n/g, \"\\n\");\n            }\n            var sourceMapping = new WebInspector.IdenticalSourceMapping();\n            var scripts = WebInspector.debuggerModel.scriptsForURL(this._resource.url);\n            var scriptRanges = WebInspector.ScriptFormatter.findScriptRanges(text.lineEndings(), scripts);\n            callback(mimeType, new WebInspector.SourceFrameContent(text, sourceMapping, scriptRanges));\n        }\n        this._resource.requestContent(contentLoaded.bind(this));\n    }\n}\n\nWebInspector.SourceFrameContentProviderForResource.prototype.__proto__ = WebInspector.SourceFrameContentProvider.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ResourcesPanel.js",
    "content": "/*\n * Copyright (C) 2007, 2008, 2010 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ResourcesPanel = function(database)\n{\n    WebInspector.Panel.call(this, \"resources\");\n\n    WebInspector.settings.installApplicationSetting(\"resourcesLastSelectedItem\", {});\n\n    this.createSidebar();\n    this.sidebarElement.addStyleClass(\"outline-disclosure filter-all children small\");\n    this.sidebarTreeElement.removeStyleClass(\"sidebar-tree\");\n\n    this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString(\"Frames\"), \"Frames\", \"frame-storage-tree-item\");\n    this.sidebarTree.appendChild(this.resourcesListTreeElement);\n    this._treeElementForFrameId = {};\n\n    this.databasesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString(\"Databases\"), \"Databases\", \"database-storage-tree-item\");\n    this.sidebarTree.appendChild(this.databasesListTreeElement);\n\n    this.localStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString(\"Local Storage\"), \"LocalStorage\", \"domstorage-storage-tree-item local-storage\");\n    this.sidebarTree.appendChild(this.localStorageListTreeElement);\n\n    this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString(\"Session Storage\"), \"SessionStorage\", \"domstorage-storage-tree-item session-storage\");\n    this.sidebarTree.appendChild(this.sessionStorageListTreeElement);\n\n    this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString(\"Cookies\"), \"Cookies\", \"cookie-storage-tree-item\");\n    this.sidebarTree.appendChild(this.cookieListTreeElement);\n\n    this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString(\"Application Cache\"), \"ApplicationCache\", \"application-cache-storage-tree-item\");\n    this.sidebarTree.appendChild(this.applicationCacheListTreeElement);\n\n    this.storageViews = document.createElement(\"div\");\n    this.storageViews.id = \"storage-views\";\n    this.storageViews.className = \"diff-container\";\n    this.element.appendChild(this.storageViews);\n\n    this.storageViewStatusBarItemsContainer = document.createElement(\"div\");\n    this.storageViewStatusBarItemsContainer.className = \"status-bar-items\";\n\n    this._databases = [];\n    this._domStorage = [];\n    this._cookieViews = {};\n    this._origins = {};\n    this._domains = {};\n\n    this.sidebarElement.addEventListener(\"mousemove\", this._onmousemove.bind(this), false);\n    this.sidebarElement.addEventListener(\"mouseout\", this._onmouseout.bind(this), false);\n\n    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._refreshResource, this);\n}\n\nWebInspector.ResourcesPanel.prototype = {\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Resources\");\n    },\n\n    get statusBarItems()\n    {\n        return [this.storageViewStatusBarItemsContainer];\n    },\n\n    elementsToRestoreScrollPositionsFor: function()\n    {\n        return [this.sidebarElement];\n    },\n\n    show: function()\n    {\n        WebInspector.Panel.prototype.show.call(this);\n\n        if (this.visibleView && this.visibleView.resource)\n            this._showResourceView(this.visibleView.resource);\n\n        this._initDefaultSelection();\n    },\n\n    loadEventFired: function()\n    {\n        this._initDefaultSelection();\n    },\n\n    _initDefaultSelection: function()\n    {\n        if (this._initializedDefaultSelection)\n            return;\n\n        this._initializedDefaultSelection = true;\n        var itemURL = WebInspector.settings.resourcesLastSelectedItem;\n        if (itemURL) {\n            for (var treeElement = this.sidebarTree.children[0]; treeElement; treeElement = treeElement.traverseNextTreeElement(false, this.sidebarTree, true)) {\n                if (treeElement.itemURL === itemURL) {\n                    treeElement.select();\n                    treeElement.reveal();\n                    return;\n                }\n            }\n        }\n\n        if (WebInspector.mainResource && this.resourcesListTreeElement && this.resourcesListTreeElement.expanded)\n            this.showResource(WebInspector.mainResource);\n    },\n\n    reset: function()\n    {\n        delete this._initializedDefaultSelection;\n        this._origins = {};\n        this._domains = {};\n        for (var i = 0; i < this._databases.length; ++i) {\n            var database = this._databases[i];\n            delete database._tableViews;\n            delete database._queryView;\n        }\n        this._databases = [];\n\n        var domStorageLength = this._domStorage.length;\n        for (var i = 0; i < this._domStorage.length; ++i) {\n            var domStorage = this._domStorage[i];\n            delete domStorage._domStorageView;\n        }\n        this._domStorage = [];\n\n        this._cookieViews = {};\n        \n        this._applicationCacheView = null;\n        delete this._cachedApplicationCacheViewStatus;\n\n        this.databasesListTreeElement.removeChildren();\n        this.localStorageListTreeElement.removeChildren();\n        this.sessionStorageListTreeElement.removeChildren();\n        this.cookieListTreeElement.removeChildren();\n        this.applicationCacheListTreeElement.removeChildren();\n        this.storageViews.removeChildren();\n\n        this.storageViewStatusBarItemsContainer.removeChildren();\n\n        if (this.sidebarTree.selectedTreeElement)\n            this.sidebarTree.selectedTreeElement.deselect();\n    },\n\n    clear: function()\n    {\n        this.resourcesListTreeElement.removeChildren();\n        this._treeElementForFrameId = {};\n        this.reset();\n    },\n\n    addOrUpdateFrame: function(parentFrameId, frameId, title, subtitle)\n    {\n        var frameTreeElement = this._treeElementForFrameId[frameId];\n        if (frameTreeElement) {\n            frameTreeElement.setTitles(title, subtitle);\n            return;\n        }\n\n        var parentTreeElement = parentFrameId ? this._treeElementForFrameId[parentFrameId] : this.resourcesListTreeElement;\n        if (!parentTreeElement) {\n            console.warning(\"No frame with id:\" + parentFrameId + \" to route \" + displayName + \" to.\")\n            return;\n        }\n\n        var frameTreeElement = new WebInspector.FrameTreeElement(this, frameId, title, subtitle);\n        this._treeElementForFrameId[frameId] = frameTreeElement;\n\n        // Insert in the alphabetical order, first frames, then resources.\n        var children = parentTreeElement.children;\n        for (var i = 0; i < children.length; ++i) {\n            var child = children[i];\n            if (!(child instanceof WebInspector.FrameTreeElement)) {\n                parentTreeElement.insertChild(frameTreeElement, i);\n                return;\n            }\n            if (child.displayName.localeCompare(frameTreeElement.displayName) > 0) {\n                parentTreeElement.insertChild(frameTreeElement, i);\n                return;\n            }\n        }\n        parentTreeElement.appendChild(frameTreeElement);\n    },\n\n    removeFrame: function(frameId)\n    {\n        var frameTreeElement = this._treeElementForFrameId[frameId];\n        if (!frameTreeElement)\n            return;\n        delete this._treeElementForFrameId[frameId];\n        if (frameTreeElement.parent)\n            frameTreeElement.parent.removeChild(frameTreeElement);\n    },\n\n    addResourceToFrame: function(frameId, resource)\n    {\n        this.addDocumentURL(resource.documentURL);\n\n        if (resource.statusCode >= 301 && resource.statusCode <= 303)\n            return;\n\n        var frameTreeElement = this._treeElementForFrameId[frameId];\n        if (!frameTreeElement) {\n            // This is a frame's main resource, it will be retained\n            // and re-added by the resource manager;\n            return;\n        }\n\n        var resourceTreeElement = new WebInspector.FrameResourceTreeElement(this, resource);\n\n        // Insert in the alphabetical order, first frames, then resources. Document resource goes first.\n        var children = frameTreeElement.children;\n        for (var i = 0; i < children.length; ++i) {\n            var child = children[i];\n            if (!(child instanceof WebInspector.FrameResourceTreeElement))\n                continue;\n\n            if (resource.type === WebInspector.Resource.Type.Document ||\n                    (child._resource.type !== WebInspector.Resource.Type.Document && child._resource.displayName.localeCompare(resource.displayName) > 0)) {\n                frameTreeElement.insertChild(resourceTreeElement, i);\n                return;\n            }\n        }\n        frameTreeElement.appendChild(resourceTreeElement);\n    },\n\n    removeResourcesFromFrame: function(frameId)\n    {\n        var frameTreeElement = this._treeElementForFrameId[frameId];\n        if (frameTreeElement)\n            frameTreeElement.removeChildren();\n    },\n\n    _refreshResource: function(event)\n    {\n        var resource = event.data;\n        // FIXME: do not add XHR in the first place based on the native instrumentation.\n        if (resource.type === WebInspector.Resource.Type.XHR) {\n            var resourceTreeElement = this._findTreeElementForResource(resource);\n            if (resourceTreeElement)\n                resourceTreeElement.parent.removeChild(resourceTreeElement);\n        }\n    },\n\n    addDatabase: function(database)\n    {\n        this._databases.push(database);\n\n        var databaseTreeElement = new WebInspector.DatabaseTreeElement(this, database);\n        database._databasesTreeElement = databaseTreeElement;\n        this.databasesListTreeElement.appendChild(databaseTreeElement);\n    },\n\n    addDocumentURL: function(url)\n    {\n        var parsedURL = url.asParsedURL();\n        if (!parsedURL)\n            return;\n\n        var domain = parsedURL.host;\n        if (!this._domains[domain]) {\n            this._domains[domain] = true;\n\n            var cookieDomainTreeElement = new WebInspector.CookieTreeElement(this, domain);\n            this.cookieListTreeElement.appendChild(cookieDomainTreeElement);\n\n            var applicationCacheTreeElement = new WebInspector.ApplicationCacheTreeElement(this, domain);\n            this.applicationCacheListTreeElement.appendChild(applicationCacheTreeElement);\n        }\n    },\n\n    addDOMStorage: function(domStorage)\n    {\n        this._domStorage.push(domStorage);\n        var domStorageTreeElement = new WebInspector.DOMStorageTreeElement(this, domStorage, (domStorage.isLocalStorage ? \"local-storage\" : \"session-storage\"));\n        domStorage._domStorageTreeElement = domStorageTreeElement;\n        if (domStorage.isLocalStorage)\n            this.localStorageListTreeElement.appendChild(domStorageTreeElement);\n        else\n            this.sessionStorageListTreeElement.appendChild(domStorageTreeElement);\n    },\n\n    selectDatabase: function(databaseId)\n    {\n        var database;\n        for (var i = 0, len = this._databases.length; i < len; ++i) {\n            database = this._databases[i];\n            if (database.id === databaseId) {\n                this.showDatabase(database);\n                database._databasesTreeElement.select();\n                return;\n            }\n        }\n    },\n\n    selectDOMStorage: function(storageId)\n    {\n        var domStorage = this._domStorageForId(storageId);\n        if (domStorage) {\n            this.showDOMStorage(domStorage);\n            domStorage._domStorageTreeElement.select();\n        }\n    },\n\n    canShowSourceLine: function(url, line)\n    {\n        return !!WebInspector.resourceForURL(url);\n    },\n\n    showSourceLine: function(url, line)\n    {\n        var resource = WebInspector.resourceForURL(url);\n        if (resource.type === WebInspector.Resource.Type.XHR) {\n            // Show XHRs in the network panel only.\n            if (WebInspector.panels.network && WebInspector.panels.network.canShowSourceLine(url, line)) {\n                WebInspector.currentPanel = WebInspector.panels.network;\n                WebInspector.panels.network.showSourceLine(url, line);\n            }\n            return;\n        }\n        this.showResource(WebInspector.resourceForURL(url), line);\n    },\n\n    showResource: function(resource, line)\n    {\n        var resourceTreeElement = this._findTreeElementForResource(resource);\n        if (resourceTreeElement) {\n            resourceTreeElement.reveal();\n            resourceTreeElement.select();\n        }\n\n        if (line) {\n            var view = WebInspector.ResourceView.resourceViewForResource(resource);\n            if (view.revealLine)\n                view.revealLine(line);\n            if (view.highlightLine)\n                view.highlightLine(line);\n        }\n        return true;\n    },\n\n    _showResourceView: function(resource)\n    {\n        var view = WebInspector.ResourceView.resourceViewForResource(resource);\n\n        // Consider rendering diff markup here.\n        if (resource.baseRevision && view instanceof WebInspector.SourceFrame) {\n            function callback(baseContent)\n            {\n                if (baseContent)\n                    this._applyDiffMarkup(view, baseContent, resource.content);\n            }\n            resource.baseRevision.requestContent(callback.bind(this));\n        }\n        this._innerShowView(view);\n    },\n\n    _applyDiffMarkup: function(view, baseContent, newContent) {\n        var oldLines = baseContent.split(\"\\n\");\n        var newLines = newContent.split(\"\\n\");\n\n        var diff = Array.diff(oldLines, newLines);\n\n        var diffData = {};\n        diffData.added = [];\n        diffData.removed = [];\n        diffData.changed = [];\n\n        var offset = 0;\n        var right = diff.right;\n        for (var i = 0; i < right.length; ++i) {\n            if (typeof right[i] === \"string\") {\n                if (right.length > i + 1 && right[i + 1].row === i + 1 - offset)\n                    diffData.changed.push(i);\n                else {\n                    diffData.added.push(i);\n                    offset++;\n                }\n            } else\n                offset = i - right[i].row;\n        }\n        view.markDiff(diffData);\n    },\n\n    showDatabase: function(database, tableName)\n    {\n        if (!database)\n            return;\n            \n        var view;\n        if (tableName) {\n            if (!(\"_tableViews\" in database))\n                database._tableViews = {};\n            view = database._tableViews[tableName];\n            if (!view) {\n                view = new WebInspector.DatabaseTableView(database, tableName);\n                database._tableViews[tableName] = view;\n            }\n        } else {\n            view = database._queryView;\n            if (!view) {\n                view = new WebInspector.DatabaseQueryView(database);\n                database._queryView = view;\n            }\n        }\n\n        this._innerShowView(view);\n    },\n\n    showDOMStorage: function(domStorage)\n    {\n        if (!domStorage)\n            return;\n\n        var view;\n        view = domStorage._domStorageView;\n        if (!view) {\n            view = new WebInspector.DOMStorageItemsView(domStorage);\n            domStorage._domStorageView = view;\n        }\n\n        this._innerShowView(view);\n    },\n\n    showCookies: function(treeElement, cookieDomain)\n    {\n        var view = this._cookieViews[cookieDomain];\n        if (!view) {\n            view = new WebInspector.CookieItemsView(treeElement, cookieDomain);\n            this._cookieViews[cookieDomain] = view;\n        }\n\n        this._innerShowView(view);\n    },\n\n    showApplicationCache: function(treeElement, appcacheDomain)\n    {\n        var view = this._applicationCacheView;\n        if (!view) {\n            view = new WebInspector.ApplicationCacheItemsView(treeElement, appcacheDomain);\n            this._applicationCacheView = view;\n        }\n\n        this._innerShowView(view);\n\n        if (\"_cachedApplicationCacheViewStatus\" in this)\n            this._applicationCacheView.updateStatus(this._cachedApplicationCacheViewStatus);\n    },\n\n    showCategoryView: function(categoryName)\n    {\n        if (!this._categoryView)\n            this._categoryView = new WebInspector.StorageCategoryView();\n        this._categoryView.setText(categoryName);\n        this._innerShowView(this._categoryView);\n    },\n\n    _innerShowView: function(view)\n    {\n        if (this.visibleView)\n            this.visibleView.hide();\n\n        view.show(this.storageViews);\n        this.visibleView = view;\n\n        this.storageViewStatusBarItemsContainer.removeChildren();\n        var statusBarItems = view.statusBarItems || [];\n        for (var i = 0; i < statusBarItems.length; ++i)\n            this.storageViewStatusBarItemsContainer.appendChild(statusBarItems[i]);\n    },\n\n    closeVisibleView: function()\n    {\n        if (this.visibleView)\n            this.visibleView.hide();\n        delete this.visibleView;\n    },\n\n    updateDatabaseTables: function(database)\n    {\n        if (!database || !database._databasesTreeElement)\n            return;\n\n        database._databasesTreeElement.shouldRefreshChildren = true;\n\n        if (!(\"_tableViews\" in database))\n            return;\n\n        var tableNamesHash = {};\n        var self = this;\n        function tableNamesCallback(tableNames)\n        {\n            var tableNamesLength = tableNames.length;\n            for (var i = 0; i < tableNamesLength; ++i)\n                tableNamesHash[tableNames[i]] = true;\n\n            for (var tableName in database._tableViews) {\n                if (!(tableName in tableNamesHash)) {\n                    if (self.visibleView === database._tableViews[tableName])\n                        self.closeVisibleView();\n                    delete database._tableViews[tableName];\n                }\n            }\n        }\n        database.getTableNames(tableNamesCallback);\n    },\n\n    dataGridForResult: function(columnNames, values)\n    {\n        var numColumns = columnNames.length;\n        if (!numColumns)\n            return null;\n\n        var columns = {};\n\n        for (var i = 0; i < columnNames.length; ++i) {\n            var column = {};\n            column.width = columnNames[i].length;\n            column.title = columnNames[i];\n            column.sortable = true;\n\n            columns[columnNames[i]] = column;\n        }\n\n        var nodes = [];\n        for (var i = 0; i < values.length / numColumns; ++i) {\n            var data = {};\n            for (var j = 0; j < columnNames.length; ++j)\n                data[columnNames[j]] = values[numColumns * i + j];\n\n            var node = new WebInspector.DataGridNode(data, false);\n            node.selectable = false;\n            nodes.push(node);\n        }\n\n        var dataGrid = new WebInspector.DataGrid(columns);\n        var length = nodes.length;\n        for (var i = 0; i < length; ++i)\n            dataGrid.appendChild(nodes[i]);\n\n        dataGrid.addEventListener(\"sorting changed\", this._sortDataGrid.bind(this, dataGrid), this);\n        return dataGrid;\n    },\n\n    _sortDataGrid: function(dataGrid)\n    {\n        var nodes = dataGrid.children.slice();\n        var sortColumnIdentifier = dataGrid.sortColumnIdentifier;\n        var sortDirection = dataGrid.sortOrder === \"ascending\" ? 1 : -1;\n        var columnIsNumeric = true;\n\n        for (var i = 0; i < nodes.length; i++) {\n            if (isNaN(Number(nodes[i].data[sortColumnIdentifier])))\n                columnIsNumeric = false;\n        }\n\n        function comparator(dataGridNode1, dataGridNode2)\n        {\n            var item1 = dataGridNode1.data[sortColumnIdentifier];\n            var item2 = dataGridNode2.data[sortColumnIdentifier];\n\n            var comparison;\n            if (columnIsNumeric) {\n                // Sort numbers based on comparing their values rather than a lexicographical comparison.\n                var number1 = parseFloat(item1);\n                var number2 = parseFloat(item2);\n                comparison = number1 < number2 ? -1 : (number1 > number2 ? 1 : 0);\n            } else\n                comparison = item1 < item2 ? -1 : (item1 > item2 ? 1 : 0);\n\n            return sortDirection * comparison;\n        }\n\n        nodes.sort(comparator);\n        dataGrid.removeChildren();\n        for (var i = 0; i < nodes.length; i++)\n            dataGrid.appendChild(nodes[i]);\n    },\n\n    updateDOMStorage: function(storageId)\n    {\n        var domStorage = this._domStorageForId(storageId);\n        if (!domStorage)\n            return;\n\n        var view = domStorage._domStorageView;\n        if (this.visibleView && view === this.visibleView)\n            domStorage._domStorageView.update();\n    },\n\n    updateApplicationCacheStatus: function(status)\n    {\n        this._cachedApplicationCacheViewStatus = status;\n        if (this._applicationCacheView && this._applicationCacheView === this.visibleView)\n            this._applicationCacheView.updateStatus(status);\n    },\n\n    updateNetworkState: function(isNowOnline)\n    {\n        if (this._applicationCacheView && this._applicationCacheView === this.visibleView)\n            this._applicationCacheView.updateNetworkState(isNowOnline);\n    },\n\n    updateManifest: function(manifest)\n    {\n        if (this._applicationCacheView && this._applicationCacheView === this.visibleView)\n            this._applicationCacheView.updateManifest(manifest);\n    },\n\n    _domStorageForId: function(storageId)\n    {\n        if (!this._domStorage)\n            return null;\n        var domStorageLength = this._domStorage.length;\n        for (var i = 0; i < domStorageLength; ++i) {\n            var domStorage = this._domStorage[i];\n            if (domStorage.id == storageId)\n                return domStorage;\n        }\n        return null;\n    },\n\n    updateMainViewWidth: function(width)\n    {\n        this.storageViews.style.left = width + \"px\";\n        this.storageViewStatusBarItemsContainer.style.left = width + \"px\";\n        this.resize();\n    },\n\n    get searchableViews()\n    {\n        var views = [];\n\n        var visibleView = this.visibleView;\n        if (visibleView.performSearch)\n            views.push(visibleView);\n\n        function callback(resourceTreeElement)\n        {\n            var resource = resourceTreeElement._resource;\n            var resourceView = WebInspector.ResourceView.resourceViewForResource(resource);\n            if (resourceView.performSearch && resourceView !== visibleView)\n                views.push(resourceView);\n        }\n        this._forAllResourceTreeElements(callback);\n        return views;\n    },\n\n    _forAllResourceTreeElements: function(callback)\n    {\n        var stop = false;\n        for (var treeElement = this.resourcesListTreeElement; !stop && treeElement; treeElement = treeElement.traverseNextTreeElement(false, this.resourcesListTreeElement, true)) {\n            if (treeElement instanceof WebInspector.FrameResourceTreeElement)\n                stop = callback(treeElement);\n        }\n    },\n\n    searchMatchFound: function(view, matches)\n    {\n        if (!view.resource)\n            return;\n        var treeElement = this._findTreeElementForResource(view.resource);\n        if (treeElement)\n            treeElement.searchMatchFound(matches);\n    },\n\n    _findTreeElementForResource: function(resource)\n    {\n        function isAncestor(ancestor, object)\n        {\n            // Redirects, XHRs do not belong to the tree, it is fine to silently return false here.\n            return false;\n        }\n\n        function getParent(object)\n        {\n            // Redirects, XHRs do not belong to the tree, it is fine to silently return false here.\n            return null;\n        }\n\n        return this.sidebarTree.findTreeElement(resource, isAncestor, getParent);\n    },\n\n    searchCanceled: function(startingNewSearch)\n    {\n        WebInspector.Panel.prototype.searchCanceled.call(this, startingNewSearch);\n\n        if (startingNewSearch)\n            return;\n\n        function callback(resourceTreeElement)\n        {\n            resourceTreeElement._errorsWarningsUpdated();\n        }\n        this._forAllResourceTreeElements(callback);\n    },\n\n    performSearch: function(query)\n    {\n        function callback(resourceTreeElement)\n        {\n            resourceTreeElement._resetBubble();\n        }\n        this._forAllResourceTreeElements(callback);\n        WebInspector.Panel.prototype.performSearch.call(this, query);\n    },\n\n    showView: function(view)\n    {\n        if (view)\n            this.showResource(view.resource);\n    },\n\n    _onmousemove: function(event)\n    {\n        var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);\n        if (!nodeUnderMouse)\n            return;\n\n        var listNode = nodeUnderMouse.enclosingNodeOrSelfWithNodeName(\"li\");\n        if (!listNode)\n            return;\n\n        var element = listNode.treeElement;\n        if (this._previousHoveredElement === element)\n            return;\n\n        if (this._previousHoveredElement) {\n            this._previousHoveredElement.hovered = false;\n            delete this._previousHoveredElement;\n        }\n\n        if (element instanceof WebInspector.FrameTreeElement) {\n            this._previousHoveredElement = element;\n            element.hovered = true;\n        }\n    },\n\n    _onmouseout: function(event)\n    {\n        if (this._previousHoveredElement) {\n            this._previousHoveredElement.hovered = false;\n            delete this._previousHoveredElement;\n        }\n    }\n}\n\nWebInspector.ResourcesPanel.prototype.__proto__ = WebInspector.Panel.prototype;\n\nWebInspector.BaseStorageTreeElement = function(storagePanel, representedObject, title, iconClass, hasChildren)\n{\n    TreeElement.call(this, \"\", representedObject, hasChildren);\n    this._storagePanel = storagePanel;\n    this._titleText = title;\n    this._iconClass = iconClass;\n}\n\nWebInspector.BaseStorageTreeElement.prototype = {\n    onattach: function()\n    {\n        this.listItemElement.removeChildren();\n        this.listItemElement.addStyleClass(this._iconClass);\n\n        var selectionElement = document.createElement(\"div\");\n        selectionElement.className = \"selection\";\n        this.listItemElement.appendChild(selectionElement);\n\n        this.imageElement = document.createElement(\"img\");\n        this.imageElement.className = \"icon\";\n        this.listItemElement.appendChild(this.imageElement);\n\n        this.titleElement = document.createElement(\"div\");\n        this.titleElement.className = \"base-storage-tree-element-title\";\n        this.titleElement.textContent = this._titleText;\n        this.listItemElement.appendChild(this.titleElement);\n    },\n\n    onselect: function()\n    {\n        var itemURL = this.itemURL;\n        if (itemURL)\n            WebInspector.settings.resourcesLastSelectedItem = itemURL;\n    },\n\n    onreveal: function()\n    {\n        if (this.listItemElement)\n            this.listItemElement.scrollIntoViewIfNeeded(false);\n    },\n\n    get titleText()\n    {\n        return this._titleText;\n    },\n\n    set titleText(titleText)\n    {\n        this._titleText = titleText;\n        if (this.titleElement)\n            this.titleElement.textContent = this._titleText;\n    },\n\n    isEventWithinDisclosureTriangle: function()\n    {\n        // Override it since we use margin-left in place of treeoutline's text-indent.\n        // Hence we need to take padding into consideration. This all is needed for leading\n        // icons in the tree.\n        var paddingLeft = 14;\n        var left = this.listItemElement.totalOffsetLeft + paddingLeft;\n        return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;\n    }\n}\n\nWebInspector.BaseStorageTreeElement.prototype.__proto__ = TreeElement.prototype;\n\nWebInspector.StorageCategoryTreeElement = function(storagePanel, categoryName, settingsKey, iconClass)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, categoryName, iconClass, true);\n    this._expandedSettingKey = \"resources\" + settingsKey + \"Expanded\";\n    WebInspector.settings.installApplicationSetting(this._expandedSettingKey, settingsKey === \"Frames\");\n    this._categoryName = categoryName;\n}\n\nWebInspector.StorageCategoryTreeElement.prototype = {\n    get itemURL()\n    {\n        return \"category://\" + this._categoryName;\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel.showCategoryView(this._categoryName);\n    },\n\n    onattach: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);\n        if (WebInspector.settings[this._expandedSettingKey])\n            this.expand();\n    },\n\n    onexpand: function()\n    {\n        WebInspector.settings[this._expandedSettingKey] = true;\n    },\n\n    oncollapse: function()\n    {\n        WebInspector.settings[this._expandedSettingKey] = false;\n    }\n}\nWebInspector.StorageCategoryTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.FrameTreeElement = function(storagePanel, frameId, title, subtitle)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, \"\", \"frame-storage-tree-item\");\n    this._frameId = frameId;\n    this.setTitles(title, subtitle);\n}\n\nWebInspector.FrameTreeElement.prototype = {\n    get itemURL()\n    {\n        return \"frame://\" + encodeURI(this._displayName);\n    },\n\n    onattach: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);\n        if (this._titleToSetOnAttach || this._subtitleToSetOnAttach) {\n            this.setTitles(this._titleToSetOnAttach, this._subtitleToSetOnAttach);\n            delete this._titleToSetOnAttach;\n            delete this._subtitleToSetOnAttach;\n        }\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel.showCategoryView(this._displayName);\n\n        this.listItemElement.removeStyleClass(\"hovered\");\n        InspectorBackend.hideFrameHighlight();\n    },\n\n    get displayName()\n    {\n        return this._displayName;\n    },\n\n    setTitles: function(title, subtitle)\n    {\n        this._displayName = \"\";\n        if (this.parent) {\n            if (title) {\n                this.titleElement.textContent = title;\n                this._displayName = title;\n            }\n            if (subtitle) {\n                var subtitleElement = document.createElement(\"span\");\n                subtitleElement.className = \"base-storage-tree-element-subtitle\";\n                subtitleElement.textContent = \"(\" + subtitle + \")\";\n                this._displayName += \" (\" + subtitle + \")\";\n                this.titleElement.appendChild(subtitleElement);\n            }\n        } else {\n            this._titleToSetOnAttach = title;\n            this._subtitleToSetOnAttach = subtitle;\n        }\n    },\n\n    set hovered(hovered)\n    {\n        if (hovered) {\n            this.listItemElement.addStyleClass(\"hovered\");\n            InspectorBackend.highlightFrame(this._frameId);\n        } else {\n            this.listItemElement.removeStyleClass(\"hovered\");\n            InspectorBackend.hideFrameHighlight();\n        }\n    }\n}\nWebInspector.FrameTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.FrameResourceTreeElement = function(storagePanel, resource)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, resource, resource.displayName, \"resource-sidebar-tree-item resources-category-\" + resource.category.name);\n    this._resource = resource;\n    this._resource.addEventListener(\"errors-warnings-updated\", this._errorsWarningsUpdated, this);\n    this._resource.addEventListener(\"content-changed\", this._contentChanged, this);\n    this.tooltip = resource.url;\n}\n\nWebInspector.FrameResourceTreeElement.prototype = {\n    get itemURL()\n    {\n        return this._resource.url;\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel._showResourceView(this._resource);\n    },\n\n    ondblclick: function(event)\n    {\n        InspectorBackend.openInInspectedWindow(this._resource.url);\n    },\n\n    onattach: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);\n\n        if (this._resource.category === WebInspector.resourceCategories.images) {\n            var previewImage = document.createElement(\"img\");\n            previewImage.className = \"image-resource-icon-preview\";\n            this._resource.populateImageSource(previewImage);\n\n            var iconElement = document.createElement(\"div\");\n            iconElement.className = \"icon\";\n            iconElement.appendChild(previewImage);\n            this.listItemElement.replaceChild(iconElement, this.imageElement);\n        }\n\n        this._statusElement = document.createElement(\"div\");\n        this._statusElement.className = \"status\";\n        this.listItemElement.insertBefore(this._statusElement, this.titleElement);\n\n        this.listItemElement.draggable = true;\n        this.listItemElement.addEventListener(\"dragstart\", this._ondragstart.bind(this), false);\n    },\n\n    _ondragstart: function(event)\n    {\n        event.dataTransfer.setData(\"text/plain\", this._resource.content);\n        event.dataTransfer.effectAllowed = \"copy\";\n        return true;\n    },\n\n    _setBubbleText: function(x)\n    {\n        if (!this._bubbleElement) {\n            this._bubbleElement = document.createElement(\"div\");\n            this._bubbleElement.className = \"bubble\";\n            this._statusElement.appendChild(this._bubbleElement);\n        }\n\n        this._bubbleElement.textContent = x;\n    },\n\n    _resetBubble: function()\n    {\n        if (this._bubbleElement) {\n            this._bubbleElement.textContent = \"\";\n            this._bubbleElement.removeStyleClass(\"search-matches\");\n            this._bubbleElement.removeStyleClass(\"warning\");\n            this._bubbleElement.removeStyleClass(\"error\");\n        }\n    },\n\n    searchMatchFound: function(matches)\n    {\n        this._resetBubble();\n\n        this._setBubbleText(matches);\n        this._bubbleElement.addStyleClass(\"search-matches\");\n\n        // Expand, do not scroll into view.\n        var currentAncestor = this.parent;\n        while (currentAncestor && !currentAncestor.root) {\n            if (!currentAncestor.expanded)\n                currentAncestor.expand();\n            currentAncestor = currentAncestor.parent;\n        }\n    },\n\n    _errorsWarningsUpdated: function()\n    {\n        // FIXME: move to the SourceFrame.\n        if (!this._resource.warnings && !this._resource.errors) {\n            var view = WebInspector.ResourceView.existingResourceViewForResource(this._resource);\n            if (view && view.clearMessages)\n                view.clearMessages();\n        }\n\n        if (this._storagePanel.currentQuery)\n            return;\n\n        this._resetBubble();\n\n        if (this._resource.warnings || this._resource.errors)\n            this._setBubbleText(this._resource.warnings + this._resource.errors);\n\n        if (this._resource.warnings)\n            this._bubbleElement.addStyleClass(\"warning\");\n\n        if (this._resource.errors)\n            this._bubbleElement.addStyleClass(\"error\");\n    },\n\n    _contentChanged: function(event)\n    {\n        this.insertChild(new WebInspector.ResourceRevisionTreeElement(this._storagePanel, event.data.revision), 0);\n        var oldView = WebInspector.ResourceView.existingResourceViewForResource(this._resource);\n        if (oldView) {\n            var newView = WebInspector.ResourceView.recreateResourceView(this._resource);\n            if (oldView === this._storagePanel.visibleView)\n                this._storagePanel.visibleView = newView;\n        }\n    }\n}\n\nWebInspector.FrameResourceTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.DatabaseTreeElement = function(storagePanel, database)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, database.name, \"database-storage-tree-item\", true);\n    this._database = database;\n}\n\nWebInspector.DatabaseTreeElement.prototype = {\n    get itemURL()\n    {\n        return \"database://\" + encodeURI(this._database.name);\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel.showDatabase(this._database);\n    },\n\n    oncollapse: function()\n    {\n        // Request a refresh after every collapse so the next\n        // expand will have an updated table list.\n        this.shouldRefreshChildren = true;\n    },\n\n    onpopulate: function()\n    {\n        this.removeChildren();\n\n        function tableNamesCallback(tableNames)\n        {\n            var tableNamesLength = tableNames.length;\n            for (var i = 0; i < tableNamesLength; ++i)\n                this.appendChild(new WebInspector.DatabaseTableTreeElement(this._storagePanel, this._database, tableNames[i]));\n        }\n        this._database.getTableNames(tableNamesCallback.bind(this));\n    }\n\n}\nWebInspector.DatabaseTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.DatabaseTableTreeElement = function(storagePanel, database, tableName)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, tableName, \"database-storage-tree-item\");\n    this._database = database;\n    this._tableName = tableName;\n}\n\nWebInspector.DatabaseTableTreeElement.prototype = {\n    get itemURL()\n    {\n        return \"database://\" + encodeURI(this._database.name) + \"/\" + encodeURI(this._tableName);\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel.showDatabase(this._database, this._tableName);\n    }\n}\nWebInspector.DatabaseTableTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.DOMStorageTreeElement = function(storagePanel, domStorage, className)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, domStorage.domain ? domStorage.domain : WebInspector.UIString(\"Local Files\"), \"domstorage-storage-tree-item \" + className);\n    this._domStorage = domStorage;\n}\n\nWebInspector.DOMStorageTreeElement.prototype = {\n    get itemURL()\n    {\n        return \"storage://\" + this._domStorage.domain + \"/\" + (this._domStorage.isLocalStorage ? \"local\" : \"session\");\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel.showDOMStorage(this._domStorage);\n    }\n}\nWebInspector.DOMStorageTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.CookieTreeElement = function(storagePanel, cookieDomain)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, cookieDomain ? cookieDomain : WebInspector.UIString(\"Local Files\"), \"cookie-storage-tree-item\");\n    this._cookieDomain = cookieDomain;\n}\n\nWebInspector.CookieTreeElement.prototype = {\n    get itemURL()\n    {\n        return \"cookies://\" + this._cookieDomain;\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel.showCookies(this, this._cookieDomain);\n    }\n}\nWebInspector.CookieTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.ApplicationCacheTreeElement = function(storagePanel, appcacheDomain)\n{\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, appcacheDomain ? appcacheDomain : WebInspector.UIString(\"Local Files\"), \"application-cache-storage-tree-item\");\n    this._appcacheDomain = appcacheDomain;\n}\n\nWebInspector.ApplicationCacheTreeElement.prototype = {\n    get itemURL()\n    {\n        return \"appcache://\" + this._appcacheDomain;\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel.showApplicationCache(this, this._appcacheDomain);\n    }\n}\nWebInspector.ApplicationCacheTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.ResourceRevisionTreeElement = function(storagePanel, revision)\n{\n    var title = revision.timestamp ? revision.timestamp.toLocaleTimeString() : WebInspector.UIString(\"(original)\");\n    WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, title, \"resource-sidebar-tree-item resources-category-\" + revision.category.name);\n    if (revision.timestamp)\n        this.tooltip = revision.timestamp.toLocaleString();\n    this._resource = revision;\n}\n\nWebInspector.ResourceRevisionTreeElement.prototype = {\n    onattach: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);\n        this.listItemElement.draggable = true;\n        this.listItemElement.addEventListener(\"dragstart\", this._ondragstart.bind(this), false);\n        this.listItemElement.addEventListener(\"contextmenu\", this._handleContextMenuEvent.bind(this), true);\n    },\n\n    onselect: function()\n    {\n        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);\n        this._storagePanel._showResourceView(this._resource);\n    },\n\n    _ondragstart: function(event)\n    {\n        event.dataTransfer.setData(\"text/plain\", this._resource.content);\n        event.dataTransfer.effectAllowed = \"copy\";\n        return true;\n    },\n\n    _handleContextMenuEvent: function(event)\n    {\n        var contextMenu = new WebInspector.ContextMenu();\n        contextMenu.appendItem(WebInspector.UIString(\"Revert to this revision\"), this._resource.revertToThis.bind(this._resource));\n        contextMenu.show(event);\n    }\n}\n\nWebInspector.ResourceRevisionTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;\n\nWebInspector.StorageCategoryView = function()\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"storage-view\");\n\n    this._emptyMsgElement = document.createElement(\"div\");\n    this._emptyMsgElement.className = \"storage-empty-view\";\n    this.element.appendChild(this._emptyMsgElement);\n}\n\nWebInspector.StorageCategoryView.prototype = {\n    setText: function(text)\n    {\n        this._emptyMsgElement.textContent = text;\n    }\n}\n\nWebInspector.StorageCategoryView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ScopeChainSidebarPane.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ScopeChainSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Scope Variables\"));\n    this._sections = [];\n    this._expandedSections = {};\n    this._expandedProperties = [];\n}\n\nWebInspector.ScopeChainSidebarPane.prototype = {\n    update: function(callFrame)\n    {\n        this.bodyElement.removeChildren();\n\n        if (!callFrame) {\n            var infoElement = document.createElement(\"div\");\n            infoElement.className = \"info\";\n            infoElement.textContent = WebInspector.UIString(\"Not Paused\");\n            this.bodyElement.appendChild(infoElement);\n            return;\n        }\n\n        for (var i = 0; i < this._sections.length; ++i) {\n            var section = this._sections[i];\n            if (!section.title)\n                continue;\n            if (section.expanded)\n                this._expandedSections[section.title] = true;\n            else\n                delete this._expandedSections[section.title];\n        }\n\n        this._sections = [];\n\n        var foundLocalScope = false;\n        var scopeChain = callFrame.scopeChain;\n        for (var i = 0; i < scopeChain.length; ++i) {\n            var scopeObjectProxy = scopeChain[i];\n            var title = null;\n            var subtitle = scopeObjectProxy.description;\n            var emptyPlaceholder = null;\n            var extraProperties = null;\n\n            if (scopeObjectProxy.isLocal) {\n                foundLocalScope = true;\n                title = WebInspector.UIString(\"Local\");\n                emptyPlaceholder = WebInspector.UIString(\"No Variables\");\n                subtitle = null;\n                if (scopeObjectProxy.thisObject)\n                    extraProperties = [ new WebInspector.RemoteObjectProperty(\"this\", WebInspector.RemoteObject.fromPayload(scopeObjectProxy.thisObject)) ];\n            } else if (scopeObjectProxy.isClosure) {\n                title = WebInspector.UIString(\"Closure\");\n                emptyPlaceholder = WebInspector.UIString(\"No Variables\");\n                subtitle = null;\n            } else if (i === (scopeChain.length - 1))\n                title = WebInspector.UIString(\"Global\");\n            else if (scopeObjectProxy.isElement)\n                title = WebInspector.UIString(\"Event Target\");\n            else if (scopeObjectProxy.isDocument)\n                title = WebInspector.UIString(\"Event Document\");\n            else if (scopeObjectProxy.isWithBlock)\n                title = WebInspector.UIString(\"With Block\");\n\n            if (!title || title === subtitle)\n                subtitle = null;\n\n            var section = new WebInspector.ObjectPropertiesSection(WebInspector.RemoteObject.fromPayload(scopeObjectProxy), title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);\n            section.editInSelectedCallFrameWhenPaused = true;\n            section.pane = this;\n\n            if (!foundLocalScope || scopeObjectProxy.isLocal || title in this._expandedSections)\n                section.expanded = true;\n\n            this._sections.push(section);\n            this.bodyElement.appendChild(section.element);\n        }\n    }\n}\n\nWebInspector.ScopeChainSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.ScopeVariableTreeElement = function(property)\n{\n    WebInspector.ObjectPropertyTreeElement.call(this, property);\n}\n\nWebInspector.ScopeVariableTreeElement.prototype = {\n    onattach: function()\n    {\n        WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);\n        if (this.hasChildren && this.propertyIdentifier in this.treeOutline.section.pane._expandedProperties)\n            this.expand();\n    },\n\n    onexpand: function()\n    {\n        this.treeOutline.section.pane._expandedProperties[this.propertyIdentifier] = true;\n    },\n\n    oncollapse: function()\n    {\n        delete this.treeOutline.section.pane._expandedProperties[this.propertyIdentifier];\n    },\n\n    get propertyIdentifier()\n    {\n        if (\"_propertyIdentifier\" in this)\n            return this._propertyIdentifier;\n        var section = this.treeOutline.section;\n        this._propertyIdentifier = section.title + \":\" + (section.subtitle ? section.subtitle + \":\" : \"\") + this.propertyPath;\n        return this._propertyIdentifier;\n    },\n\n    get propertyPath()\n    {\n        if (\"_propertyPath\" in this)\n            return this._propertyPath;\n\n        var current = this;\n        var result;\n\n        do {\n            if (result)\n                result = current.property.name + \".\" + result;\n            else\n                result = current.property.name;\n            current = current.parent;\n        } while (current && !current.root);\n\n        this._propertyPath = result;\n        return result;\n    }\n}\n\nWebInspector.ScopeVariableTreeElement.prototype.__proto__ = WebInspector.ObjectPropertyTreeElement.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Script.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Script = function(sourceID, sourceURL, source, lineOffset, columnOffset, length, errorLine, errorMessage, worldType)\n{\n    this.sourceID = sourceID;\n    this.sourceURL = sourceURL;\n    this._source = source;\n    this.lineOffset = lineOffset;\n    this.columnOffset = columnOffset;\n    this.length = length;\n    this.errorLine = errorLine;\n    this.errorMessage = errorMessage;\n    this.worldType = worldType;\n\n    // if no URL, look for \"//@ sourceURL=\" decorator\n    // note that this sourceURL comment decorator is behavior that FireBug added\n    // in it's 1.1 release as noted in the release notes:\n    // http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt\n    if (!sourceURL) {\n        // use of [ \\t] rather than \\s is to prevent \\n from matching\n        var pattern = /^\\s*\\/\\/[ \\t]*@[ \\t]*sourceURL[ \\t]*=[ \\t]*(\\S+).*$/m;\n        var match = pattern.exec(source);\n\n        if (match)\n            this.sourceURL = match[1];\n    }\n}\n\nWebInspector.Script.WorldType = {\n    MAIN_WORLD: 0,\n    EXTENSIONS_WORLD: 1\n}\n\nWebInspector.Script.WorldType = {\n    MAIN_WORLD: 0,\n    EXTENSIONS_WORLD: 1\n}\n\nWebInspector.Script.prototype = {\n    get startingLine()\n    {\n        return this.lineOffset + 1;\n    },\n\n    get linesCount()\n    {\n        if (!this.source)\n            return 0;\n        if (!this._lineEndings)\n            this._lineEndings = this._source.findAll(\"\\n\");\n        return this._lineEndings.length + 1;\n    },\n\n    sourceLine: function(lineNumber, callback)\n    {\n        function extractSourceLine()\n        {\n            lineNumber -= this.lineOffset;\n            callback(this._source.substring(this._lineEndings[lineNumber - 1], this._lineEndings[lineNumber]));\n        }\n\n        if (this._lineEndings) {\n            extractSourceLine.call(this);\n            return;\n        }\n\n        function didRequestSource()\n        {\n            this._lineEndings = this._source.findAll(\"\\n\");\n            extractSourceLine.call(this);\n        }\n        this.requestSource(didRequestSource.bind(this));\n    },\n\n    get source()\n    {\n        if (!this._source && this.resource)\n            this._source = this.resource.content;\n        return this._source;\n    },\n\n    set source(source)\n    {\n        this._source = source;\n        delete this._lineEndings;\n    },\n\n    requestSource: function(callback)\n    {\n        if (this._source) {\n            callback(this._source);\n            return;\n        }\n\n        function didGetScriptSource(source)\n        {\n            this._source = source;\n            callback(this._source);\n        }\n        InspectorBackend.getScriptSource(this.sourceID, didGetScriptSource.bind(this));\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ScriptFormatter.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ScriptFormatter = function()\n{\n    this._worker = new Worker(\"ScriptFormatterWorker.js\");\n    this._worker.onmessage = this._handleMessage.bind(this);\n    this._worker.onerror = this._handleError.bind(this);\n    this._tasks = [];\n}\n\nWebInspector.ScriptFormatter.locationToPosition = function(lineEndings, lineNumber, columnNumber)\n{\n    var position = lineNumber ? lineEndings[lineNumber - 1] + 1 : 0;\n    return position + columnNumber;\n}\n\nWebInspector.ScriptFormatter.positionToLocation = function(lineEndings, position)\n{\n    var location = {};\n    location.lineNumber = lineEndings.upperBound(position - 1);\n    if (!location.lineNumber)\n        location.columnNumber = position;\n    else\n        location.columnNumber = position - lineEndings[location.lineNumber - 1] - 1;\n    return location;\n}\n\nWebInspector.ScriptFormatter.findScriptRanges = function(lineEndings, scripts)\n{\n    var scriptRanges = [];\n    for (var i = 0; i < scripts.length; ++i) {\n        var start = { lineNumber: scripts[i].lineOffset, columnNumber: scripts[i].columnOffset };\n        start.position = WebInspector.ScriptFormatter.locationToPosition(lineEndings, start.lineNumber, start.columnNumber);\n        var endPosition = start.position + scripts[i].length;\n        var end = WebInspector.ScriptFormatter.positionToLocation(lineEndings, endPosition);\n        end.position = endPosition;\n        scriptRanges.push({ start: start, end: end, sourceID: scripts[i].sourceID });\n    }\n    scriptRanges.sort(function(x, y) { return x.start.position - y.start.position; });\n    return scriptRanges;\n}\n\nWebInspector.ScriptFormatter.prototype = {\n    formatContent: function(content, callback)\n    {\n        var chunks = this._splitContentIntoChunks(content.text, content.scriptRanges);\n\n        function didFormatChunks()\n        {\n            var result = this._buildContentFromChunks(chunks);\n\n            var sourceMapping = new WebInspector.SourceMappingForFormattedScript(content.text.lineEndings(), result.text.lineEndings(), result.mapping);\n            var formattedScriptRanges = [];\n            for (var i = 0; i < content.scriptRanges.length; ++i) {\n                var scriptRange = content.scriptRanges[i];\n                formattedScriptRange = {};\n                formattedScriptRange.start = sourceMapping.originalPositionToFormattedLocation(scriptRange.start.position);\n                formattedScriptRange.end = sourceMapping.originalPositionToFormattedLocation(scriptRange.end.position);\n                formattedScriptRange.sourceID = scriptRange.sourceID;\n                formattedScriptRanges.push(formattedScriptRange);\n            }\n            callback(new WebInspector.SourceFrameContent(result.text, sourceMapping, formattedScriptRanges));\n        }\n        this._formatChunks(chunks, 0, didFormatChunks.bind(this));\n    },\n\n    _splitContentIntoChunks: function(text, scriptRanges)\n    {\n        var chunks = [];\n        function addChunk(start, end, isScript)\n        {\n            var chunk = {};\n            chunk.start = start;\n            chunk.end = end;\n            chunk.isScript = isScript;\n            chunk.text = text.substring(start, end);\n            chunks.push(chunk);\n        }\n        var currentPosition = 0;\n        for (var i = 0; i < scriptRanges.length; ++i) {\n            var start = scriptRanges[i].start.position;\n            var end = scriptRanges[i].end.position;\n            if (currentPosition < start)\n                addChunk(currentPosition, start, false);\n            addChunk(start, end, true);\n            currentPosition = end;\n        }\n        if (currentPosition < text.length)\n            addChunk(currentPosition, text.length, false);\n        return chunks;\n    },\n\n    _formatChunks: function(chunks, index, callback)\n    {\n        while(true) {\n            if (index === chunks.length) {\n                callback();\n                return;\n            }\n            var chunk = chunks[index++];\n            if (chunk.isScript)\n                break;\n        }\n\n        function didFormat(formattedSource, mapping)\n        {\n            chunk.text = formattedSource;\n            chunk.mapping = mapping;\n            this._formatChunks(chunks, index, callback);\n        }\n        this._formatScript(chunk.text, didFormat.bind(this));\n    },\n\n    _buildContentFromChunks: function(chunks)\n    {\n        var text = \"\";\n        var mapping = { original: [], formatted: [] };\n        for (var i = 0; i < chunks.length; ++i) {\n            var chunk = chunks[i];\n            mapping.original.push(chunk.start);\n            mapping.formatted.push(text.length);\n            if (chunk.isScript) {\n                if (text)\n                    text += \"\\n\";\n                for (var j = 0; j < chunk.mapping.original.length; ++j) {\n                    mapping.original.push(chunk.mapping.original[j] + chunk.start);\n                    mapping.formatted.push(chunk.mapping.formatted[j] + text.length);\n                }\n                text += chunk.text;\n            } else {\n                if (text)\n                    text += \"\\n\";\n                text += chunk.text;\n            }\n            mapping.original.push(chunk.end);\n            mapping.formatted.push(text.length);\n        }\n        return { text: text, mapping: mapping };\n    },\n\n    _formatScript: function(source, callback)\n    {\n        this._tasks.push({ source: source, callback: callback });\n        this._worker.postMessage(source);\n    },\n\n    _handleMessage: function(event)\n    {\n        var task = this._tasks.shift();\n        task.callback(event.data.formattedSource, event.data.mapping);\n    },\n\n    _handleError: function(event)\n    {\n        console.warn(\"Error in script formatter worker:\", event);\n        event.preventDefault()\n        var task = this._tasks.shift();\n        task.callback(task.source, { original: [], formatted: [] });\n    }\n}\n\n\nWebInspector.SourceMappingForFormattedScript = function(originalLineEndings, formattedLineEndings, mapping)\n{\n    WebInspector.SourceMapping.call(this);\n    this._originalLineEndings = originalLineEndings;\n    this._formattedLineEndings = formattedLineEndings;\n    this._mapping = mapping;\n}\n\nWebInspector.SourceMappingForFormattedScript.prototype = {\n    actualLocationToSourceLocation: function(lineNumber, columnNumber)\n    {\n        var position = WebInspector.ScriptFormatter.locationToPosition(this._originalLineEndings, lineNumber, columnNumber);\n        return this.originalPositionToFormattedLocation(position);\n    },\n\n    sourceLocationToActualLocation: function(lineNumber, columnNumber)\n    {\n        var formattedPosition = WebInspector.ScriptFormatter.locationToPosition(this._formattedLineEndings, lineNumber, columnNumber);\n        var position = this._convertPosition(this._mapping.formatted, this._mapping.original, formattedPosition);\n        return WebInspector.ScriptFormatter.positionToLocation(this._originalLineEndings, position);\n    },\n\n    originalPositionToFormattedLocation: function(position)\n    {\n        var formattedPosition = this._convertPosition(this._mapping.original, this._mapping.formatted, position);\n        var location = WebInspector.ScriptFormatter.positionToLocation(this._formattedLineEndings, formattedPosition);\n        location.position = formattedPosition;\n        return location;\n    },\n\n    _convertPosition: function(positions1, positions2, position)\n    {\n        var index = positions1.upperBound(position);\n        var range1 = positions1[index] - positions1[index - 1];\n        var range2 = positions2[index] - positions2[index - 1];\n        var position2 = positions2[index - 1];\n        if (range1)\n            position2 += Math.round((position - positions1[index - 1]) * range2 / range1);\n        return position2;\n    }\n}\n\nWebInspector.SourceMappingForFormattedScript.prototype.__proto__ = WebInspector.SourceMapping.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ScriptFormatterWorker.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar parse = loadModule(\"parse-js.js\");\nvar process = loadModule(\"process.js\");\n\nonmessage = function(event) {\n    var source = event.data;\n    var formattedSource = beautify(source);\n    var mapping = buildMapping(source, formattedSource);\n    postMessage({ formattedSource: formattedSource, mapping: mapping });\n};\n\nfunction beautify(source)\n{\n    var ast = parse.parse(source);\n    var beautifyOptions = {\n        indent_level: 4,\n        indent_start: 0,\n        quote_keys: false,\n        space_colon: false\n    };\n    return process.gen_code(ast, beautifyOptions);\n}\n\nfunction buildMapping(source, formattedSource)\n{\n    var mapping = { original: [], formatted: [] };\n    var lastCodePosition = 0;\n    var regexp = /[\\$\\.\\w]+|{|}/g;\n    while (true) {\n        var match = regexp.exec(formattedSource);\n        if (!match)\n            break;\n        var position = source.indexOf(match[0], lastCodePosition);\n        if (position === -1)\n            continue;\n        mapping.original.push(position);\n        mapping.formatted.push(match.index);\n        lastCodePosition = position + match[0].length;\n    }\n    return mapping;\n}\n\nfunction loadModule(src)\n{\n    var request = new XMLHttpRequest();\n    request.open(\"GET\", src, false);\n    request.send();\n\n    var exports = {};\n    eval(request.responseText);\n    return exports;\n}\n\nfunction require()\n{\n    return parse;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ScriptsPanel.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ScriptsPanel = function()\n{\n    WebInspector.Panel.call(this, \"scripts\");\n\n    this.topStatusBar = document.createElement(\"div\");\n    this.topStatusBar.className = \"status-bar\";\n    this.topStatusBar.id = \"scripts-status-bar\";\n    this.element.appendChild(this.topStatusBar);\n\n    this.backButton = document.createElement(\"button\");\n    this.backButton.className = \"status-bar-item\";\n    this.backButton.id = \"scripts-back\";\n    this.backButton.title = WebInspector.UIString(\"Show the previous script resource.\");\n    this.backButton.disabled = true;\n    this.backButton.appendChild(document.createElement(\"img\"));\n    this.backButton.addEventListener(\"click\", this._goBack.bind(this), false);\n    this.topStatusBar.appendChild(this.backButton);\n\n    this.forwardButton = document.createElement(\"button\");\n    this.forwardButton.className = \"status-bar-item\";\n    this.forwardButton.id = \"scripts-forward\";\n    this.forwardButton.title = WebInspector.UIString(\"Show the next script resource.\");\n    this.forwardButton.disabled = true;\n    this.forwardButton.appendChild(document.createElement(\"img\"));\n    this.forwardButton.addEventListener(\"click\", this._goForward.bind(this), false);\n    this.topStatusBar.appendChild(this.forwardButton);\n\n    this.filesSelectElement = document.createElement(\"select\");\n    this.filesSelectElement.className = \"status-bar-item\";\n    this.filesSelectElement.id = \"scripts-files\";\n    this.filesSelectElement.addEventListener(\"change\", this._changeVisibleFile.bind(this), false);\n    this.topStatusBar.appendChild(this.filesSelectElement);\n\n    this.functionsSelectElement = document.createElement(\"select\");\n    this.functionsSelectElement.className = \"status-bar-item\";\n    this.functionsSelectElement.id = \"scripts-functions\";\n\n    // FIXME: append the functions select element to the top status bar when it is implemented.\n    // this.topStatusBar.appendChild(this.functionsSelectElement);\n\n    this.formatButton = document.createElement(\"button\");\n    this.formatButton.className = \"status-bar-item\";\n    this.formatButton.id = \"format-script\";\n    this.formatButton.title = WebInspector.UIString(\"Format script.\");\n    this.formatButton.appendChild(document.createElement(\"img\"));\n    this.formatButton.addEventListener(\"click\", this._formatScript.bind(this), false);\n    if (Preferences.debugMode)\n        this.topStatusBar.appendChild(this.formatButton);\n\n    this.sidebarButtonsElement = document.createElement(\"div\");\n    this.sidebarButtonsElement.id = \"scripts-sidebar-buttons\";\n    this.topStatusBar.appendChild(this.sidebarButtonsElement);\n\n    this.pauseButton = document.createElement(\"button\");\n    this.pauseButton.className = \"status-bar-item\";\n    this.pauseButton.id = \"scripts-pause\";\n    this.pauseButton.title = WebInspector.UIString(\"Pause script execution.\");\n    this.pauseButton.disabled = true;\n    this.pauseButton.appendChild(document.createElement(\"img\"));\n    this.pauseButton.addEventListener(\"click\", this._togglePause.bind(this), false);\n    this.sidebarButtonsElement.appendChild(this.pauseButton);\n\n    this.stepOverButton = document.createElement(\"button\");\n    this.stepOverButton.className = \"status-bar-item\";\n    this.stepOverButton.id = \"scripts-step-over\";\n    this.stepOverButton.title = WebInspector.UIString(\"Step over next function call.\");\n    this.stepOverButton.disabled = true;\n    this.stepOverButton.addEventListener(\"click\", this._stepOverClicked.bind(this), false);\n    this.stepOverButton.appendChild(document.createElement(\"img\"));\n    this.sidebarButtonsElement.appendChild(this.stepOverButton);\n\n    this.stepIntoButton = document.createElement(\"button\");\n    this.stepIntoButton.className = \"status-bar-item\";\n    this.stepIntoButton.id = \"scripts-step-into\";\n    this.stepIntoButton.title = WebInspector.UIString(\"Step into next function call.\");\n    this.stepIntoButton.disabled = true;\n    this.stepIntoButton.addEventListener(\"click\", this._stepIntoClicked.bind(this), false);\n    this.stepIntoButton.appendChild(document.createElement(\"img\"));\n    this.sidebarButtonsElement.appendChild(this.stepIntoButton);\n\n    this.stepOutButton = document.createElement(\"button\");\n    this.stepOutButton.className = \"status-bar-item\";\n    this.stepOutButton.id = \"scripts-step-out\";\n    this.stepOutButton.title = WebInspector.UIString(\"Step out of current function.\");\n    this.stepOutButton.disabled = true;\n    this.stepOutButton.addEventListener(\"click\", this._stepOutClicked.bind(this), false);\n    this.stepOutButton.appendChild(document.createElement(\"img\"));\n    this.sidebarButtonsElement.appendChild(this.stepOutButton);\n\n    this.toggleBreakpointsButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Deactivate all breakpoints.\"), \"toggle-breakpoints\");\n    this.toggleBreakpointsButton.toggled = true;\n    this.toggleBreakpointsButton.addEventListener(\"click\", this.toggleBreakpointsClicked.bind(this), false);\n    this.sidebarButtonsElement.appendChild(this.toggleBreakpointsButton.element);\n\n    this.debuggerStatusElement = document.createElement(\"div\");\n    this.debuggerStatusElement.id = \"scripts-debugger-status\";\n    this.sidebarButtonsElement.appendChild(this.debuggerStatusElement);\n\n    this.viewsContainerElement = document.createElement(\"div\");\n    this.viewsContainerElement.id = \"script-resource-views\";\n\n    this.sidebarElement = document.createElement(\"div\");\n    this.sidebarElement.id = \"scripts-sidebar\";\n\n    this.sidebarResizeElement = document.createElement(\"div\");\n    this.sidebarResizeElement.className = \"sidebar-resizer-vertical\";\n    this.sidebarResizeElement.addEventListener(\"mousedown\", this._startSidebarResizeDrag.bind(this), false);\n\n    this.sidebarResizeWidgetElement = document.createElement(\"div\");\n    this.sidebarResizeWidgetElement.id = \"scripts-sidebar-resizer-widget\";\n    this.sidebarResizeWidgetElement.addEventListener(\"mousedown\", this._startSidebarResizeDrag.bind(this), false);\n    this.topStatusBar.appendChild(this.sidebarResizeWidgetElement);\n\n    this.sidebarPanes = {};\n    this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSidebarPane();\n    this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane();\n    this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();\n    this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane();\n    if (Preferences.nativeInstrumentationEnabled) {\n        this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();\n        this.sidebarPanes.xhrBreakpoints = WebInspector.createXHRBreakpointsSidebarPane();\n        this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane();\n    }\n\n    this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane();\n\n    for (var pane in this.sidebarPanes)\n        this.sidebarElement.appendChild(this.sidebarPanes[pane].element);\n\n    this.sidebarPanes.callstack.expanded = true;\n    this.sidebarPanes.callstack.addEventListener(\"call frame selected\", this._callFrameSelected, this);\n\n    this.sidebarPanes.scopechain.expanded = true;\n    this.sidebarPanes.jsBreakpoints.expanded = true;\n\n    var panelEnablerHeading = WebInspector.UIString(\"You need to enable debugging before you can use the Scripts panel.\");\n    var panelEnablerDisclaimer = WebInspector.UIString(\"Enabling debugging will make scripts run slower.\");\n    var panelEnablerButton = WebInspector.UIString(\"Enable Debugging\");\n\n    this.panelEnablerView = new WebInspector.PanelEnablerView(\"scripts\", panelEnablerHeading, panelEnablerDisclaimer, panelEnablerButton);\n    this.panelEnablerView.addEventListener(\"enable clicked\", this._enableDebugging, this);\n\n    this.element.appendChild(this.panelEnablerView.element);\n    this.element.appendChild(this.viewsContainerElement);\n    this.element.appendChild(this.sidebarElement);\n    this.element.appendChild(this.sidebarResizeElement);\n\n    this.enableToggleButton = new WebInspector.StatusBarButton(\"\", \"enable-toggle-status-bar-item\");\n    this.enableToggleButton.addEventListener(\"click\", this._toggleDebugging.bind(this), false);\n    if (Preferences.debuggerAlwaysEnabled)\n        this.enableToggleButton.element.addStyleClass(\"hidden\");\n\n    this._pauseOnExceptionButton = new WebInspector.StatusBarButton(\"\", \"scripts-pause-on-exceptions-status-bar-item\", 3);\n    this._pauseOnExceptionButton.addEventListener(\"click\", this._togglePauseOnExceptions.bind(this), false);\n\n    this._registerShortcuts();\n\n    this._debuggerEnabled = Preferences.debuggerAlwaysEnabled;\n\n    this.reset();\n\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._failedToParseScriptSource, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ScriptSourceChanged, this._scriptSourceChanged, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);\n    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);\n}\n\n// Keep these in sync with WebCore::ScriptDebugServer\nWebInspector.ScriptsPanel.PauseOnExceptionsState = {\n    DontPauseOnExceptions : 0,\n    PauseOnAllExceptions : 1,\n    PauseOnUncaughtExceptions: 2\n};\n\nWebInspector.ScriptsPanel.prototype = {\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Scripts\");\n    },\n\n    get statusBarItems()\n    {\n        return [this.enableToggleButton.element, this._pauseOnExceptionButton.element];\n    },\n\n    get defaultFocusedElement()\n    {\n        return this.filesSelectElement;\n    },\n\n    get paused()\n    {\n        return this._paused;\n    },\n\n    show: function()\n    {\n        WebInspector.Panel.prototype.show.call(this);\n        this.sidebarResizeElement.style.right = (this.sidebarElement.offsetWidth - 3) + \"px\";\n\n        if (this.visibleView)\n            this.visibleView.show(this.viewsContainerElement);\n    },\n\n    hide: function()\n    {\n        if (this.visibleView)\n            this.visibleView.hide();\n        WebInspector.Panel.prototype.hide.call(this);\n    },\n\n    get breakpointsActivated()\n    {\n        return this.toggleBreakpointsButton.toggled;\n    },\n\n    _parsedScriptSource: function(event)\n    {\n        this._addScript(event.data);\n    },\n\n    _failedToParseScriptSource: function(event)\n    {\n        this._addScript(event.data);\n    },\n\n    _scriptSourceChanged: function(event)\n    {\n        var sourceID = event.data.sourceID;\n        var oldSource = event.data.oldSource;\n\n        var oldView, newView;\n        var script = WebInspector.debuggerModel.scriptForSourceID(sourceID);\n        if (script.resource) {\n            oldView = this._urlToSourceFrame[script.resource.url];\n            delete this._urlToSourceFrame[script.resource.url];\n            newView = this._sourceFrameForResource(script.resource);\n            var revertHandle = WebInspector.debuggerModel.editScriptSource.bind(WebInspector.debuggerModel, sourceID, oldSource);\n            script.resource.setContent(script.source, revertHandle);\n        } else {\n            var oldView = script._sourceFrame;\n            delete script._sourceFrame;\n            newView = this._sourceFrameForScript(script);\n        }\n        newView.scrollTop = oldView.scrollTop;\n\n        if (this.visibleView === oldView)\n            this.visibleView = newView;\n\n        var callFrames = WebInspector.debuggerModel.callFrames;\n        if (callFrames.length)\n            this._debuggerPaused({ data: { callFrames: callFrames } });\n    },\n\n    _addScript: function(script)\n    {\n        var resource = WebInspector.networkManager.inflightResourceForURL(script.sourceURL) || WebInspector.resourceForURL(script.sourceURL);\n        if (resource) {\n            if (resource.finished) {\n                // Resource is finished, bind the script right away.\n                script.resource = resource;\n            } else {\n                // Resource is not finished, bind the script later.\n                if (!resource._scriptsPendingResourceLoad) {\n                    resource._scriptsPendingResourceLoad = [];\n                    resource.addEventListener(\"finished\", this._resourceLoadingFinished, this);\n                }\n                resource._scriptsPendingResourceLoad.push(script);\n            }\n        }\n        this._addScriptToFilesMenu(script);\n    },\n\n    _resourceLoadingFinished: function(e)\n    {\n        var resource = e.target;\n\n        var visible = false;\n        var select = this.filesSelectElement;\n        for (var i = 0; i < resource._scriptsPendingResourceLoad.length; ++i) {\n            // Bind script to resource.\n            var script = resource._scriptsPendingResourceLoad[i];\n            script.resource = resource;\n\n            if (select.options[select.selectedIndex] === script.filesSelectOption)\n                visible = true;\n\n            // Remove script from the files list.\n            script.filesSelectOption.parentElement.removeChild(script.filesSelectOption);\n        }\n        // Adding first script will add resource.\n        this._addScriptToFilesMenu(resource._scriptsPendingResourceLoad[0]);\n        delete resource._scriptsPendingResourceLoad;\n\n        if (visible)\n            this._showScriptOrResource(resource, { initialLoad: true });\n    },\n\n    addConsoleMessage: function(message)\n    {\n        this._messages.push(message);\n        var sourceFrame = this._urlToSourceFrame[message.url];\n        if (sourceFrame)\n            sourceFrame.addMessage(message);\n    },\n\n    clearConsoleMessages: function()\n    {\n        this._messages = [];\n        for (var url in this._urlToSourceFrame)\n            this._urlToSourceFrame[url].clearMessages();\n    },\n\n    selectedCallFrameId: function()\n    {\n        var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame;\n        if (!selectedCallFrame)\n            return null;\n        return selectedCallFrame.id;\n    },\n\n    evaluateInSelectedCallFrame: function(code, updateInterface, objectGroup, includeCommandLineAPI, callback)\n    {\n        var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame;\n        if (!this._paused || !selectedCallFrame)\n            return;\n\n        if (typeof updateInterface === \"undefined\")\n            updateInterface = true;\n\n        function updatingCallbackWrapper(result)\n        {\n            if (result) {\n                callback(WebInspector.RemoteObject.fromPayload(result));\n                if (updateInterface)\n                    this.sidebarPanes.scopechain.update(selectedCallFrame);\n            }\n        }\n        InspectorBackend.evaluateOnCallFrame(selectedCallFrame.id, code, objectGroup, includeCommandLineAPI, updatingCallbackWrapper.bind(this));\n    },\n\n    _debuggerPaused: function(event)\n    {\n        var callFrames = event.data.callFrames;\n\n        this._paused = true;\n        this._waitingToPause = false;\n        this._stepping = false;\n\n        this._updateDebuggerButtons();\n\n        WebInspector.currentPanel = this;\n\n        this.sidebarPanes.callstack.update(event.data);\n        this.sidebarPanes.callstack.selectedCallFrame = callFrames[0];\n\n        window.focus();\n        InspectorFrontendHost.bringToFront();\n    },\n\n    _debuggerResumed: function()\n    {\n        this._paused = false;\n        this._waitingToPause = false;\n        this._stepping = false;\n\n        this._clearInterface();\n    },\n\n    debuggerWasEnabled: function()\n    {\n        this._setPauseOnExceptions(WebInspector.settings.pauseOnExceptionState);\n\n        if (this._debuggerEnabled)\n            return;\n        this._debuggerEnabled = true;\n        this.reset(true);\n    },\n\n    debuggerWasDisabled: function()\n    {\n        if (!this._debuggerEnabled)\n            return;\n\n        this._debuggerEnabled = false;\n        this.reset(true);\n    },\n\n    reset: function(preserveItems)\n    {\n        this.visibleView = null;\n\n        delete this.currentQuery;\n        this.searchCanceled();\n\n        this._debuggerResumed();\n\n        this._backForwardList = [];\n        this._currentBackForwardIndex = -1;\n        this._updateBackAndForwardButtons();\n\n        this._urlToSourceFrame = {};\n        this._messages = [];\n        this._resourceForURLInFilesSelect = {};\n        this.filesSelectElement.removeChildren();\n        this.functionsSelectElement.removeChildren();\n        this.viewsContainerElement.removeChildren();\n\n        this.sidebarPanes.watchExpressions.refreshExpressions();\n        if (!preserveItems)\n            this.sidebarPanes.workers.reset();\n    },\n\n    get visibleView()\n    {\n        return this._visibleView;\n    },\n\n    set visibleView(x)\n    {\n        if (this._visibleView === x)\n            return;\n\n        if (this._visibleView)\n            this._visibleView.hide();\n\n        this._visibleView = x;\n\n        if (x)\n            x.show(this.viewsContainerElement);\n    },\n\n    canShowSourceLine: function(url, line)\n    {\n        if (!this._debuggerEnabled)\n            return false;\n        return !!this._scriptOrResourceForURLAndLine(url, line);\n    },\n\n    showSourceLine: function(url, line)\n    {\n        var scriptOrResource = this._scriptOrResourceForURLAndLine(url, line);\n        this._showScriptOrResource(scriptOrResource, {line: line, shouldHighlightLine: true});\n    },\n\n    _scriptOrResourceForURLAndLine: function(url, line)\n    {\n        var scripts = WebInspector.debuggerModel.scriptsForURL(url);\n        for (var i = 0; i < scripts.length; ++i) {\n            var script = scripts[i];\n            if (script.resource)\n                return script.resource;\n            if (script.startingLine <= line && script.startingLine + script.linesCount > line)\n                return script;\n        }\n        return null;\n    },\n\n    showView: function(view)\n    {\n        if (!view)\n            return;\n        this._showScriptOrResource(view.resource || view.script);\n    },\n\n    handleShortcut: function(event)\n    {\n        var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event);\n        var handler = this._shortcuts[shortcut];\n        if (handler) {\n            handler(event);\n            event.handled = true;\n        } else\n            this.sidebarPanes.callstack.handleShortcut(event);\n    },\n\n    _sourceFrameForScriptOrResource: function(scriptOrResource)\n    {\n        if (scriptOrResource instanceof WebInspector.Resource)\n            return this._sourceFrameForResource(scriptOrResource);\n        return this._sourceFrameForScript(scriptOrResource);\n    },\n\n    _sourceFrameForResource: function(resource)\n    {\n        var sourceFrame = this._urlToSourceFrame[resource.url];\n        if (sourceFrame)\n            return sourceFrame;\n        var contentProvider = new WebInspector.SourceFrameContentProviderForResource(resource);\n        var isScript = resource.type === WebInspector.Resource.Type.Script;\n        sourceFrame = new WebInspector.SourceFrame(contentProvider, resource.url, isScript);\n        for (var i = 0; i < this._messages.length; ++i) {\n            var message = this._messages[i];\n            if (this._messages[i].url === resource.url)\n                sourceFrame.addMessage(message);\n        }\n        this._urlToSourceFrame[resource.url] = sourceFrame;\n        return sourceFrame;\n    },\n\n    _sourceFrameForScript: function(script)\n    {\n        if (script._sourceFrame)\n            return script._sourceFrame;\n        var contentProvider = new WebInspector.SourceFrameContentProviderForScript(script);\n        script._sourceFrame = new WebInspector.SourceFrame(contentProvider, script.sourceURL, true);\n        return script._sourceFrame;\n    },\n\n    _showScriptOrResource: function(scriptOrResource, options)\n    {\n        // options = {line:, shouldHighlightLine:, fromBackForwardAction:, initialLoad:}\n        options = options || {};\n\n        if (!scriptOrResource)\n            return;\n\n        var view = this._sourceFrameForScriptOrResource(scriptOrResource);\n        if (!view)\n            return;\n\n        var url = scriptOrResource.url || scriptOrResource.sourceURL;\n        if (url && !options.initialLoad)\n            WebInspector.settings.lastViewedScriptFile = url;\n\n        if (!options.fromBackForwardAction) {\n            var oldIndex = this._currentBackForwardIndex;\n            if (oldIndex >= 0)\n                this._backForwardList.splice(oldIndex + 1, this._backForwardList.length - oldIndex);\n\n            // Check for a previous entry of the same object in _backForwardList.\n            // If one is found, remove it and update _currentBackForwardIndex to match.\n            var previousEntryIndex = this._backForwardList.indexOf(scriptOrResource);\n            if (previousEntryIndex !== -1) {\n                this._backForwardList.splice(previousEntryIndex, 1);\n                --this._currentBackForwardIndex;\n            }\n\n            this._backForwardList.push(scriptOrResource);\n            ++this._currentBackForwardIndex;\n\n            this._updateBackAndForwardButtons();\n        }\n\n        this.visibleView = view;\n\n        if (options.line) {\n            if (view.revealLine)\n                view.revealLine(options.line);\n            if (view.highlightLine && options.shouldHighlightLine)\n                view.highlightLine(options.line);\n        }\n\n        var option;\n        if (scriptOrResource instanceof WebInspector.Script) {\n            option = scriptOrResource.filesSelectOption;\n\n            // hasn't been added yet - happens for stepping in evals,\n            // so use the force option to force the script into the menu.\n            if (!option) {\n                this._addScriptToFilesMenu(scriptOrResource, true);\n                option = scriptOrResource.filesSelectOption;\n            }\n\n            console.assert(option);\n        } else\n            option = scriptOrResource.filesSelectOption;\n\n        if (option)\n            this.filesSelectElement.selectedIndex = option.index;\n    },\n\n    _addScriptToFilesMenu: function(script, force)\n    {\n        if (!script.sourceURL && !force)\n            return;\n\n        if (script.resource) {\n            if (this._resourceForURLInFilesSelect[script.resource.url])\n                return;\n            this._resourceForURLInFilesSelect[script.resource.url] = script.resource;\n        }\n\n        var displayName = script.sourceURL ? WebInspector.displayNameForURL(script.sourceURL) : WebInspector.UIString(\"(program)\");\n\n        var select = this.filesSelectElement;\n        var option = document.createElement(\"option\");\n        option.representedObject = script.resource || script;\n        option.url = displayName;\n        option.startingLine = script.startingLine;\n        option.text = script.resource || script.startingLine === 1 ? displayName : String.sprintf(\"%s:%d\", displayName, script.startingLine);\n\n        function optionCompare(a, b)\n        {\n            if (a.url < b.url)\n                return -1;\n            else if (a.url > b.url)\n                return 1;\n\n            if (typeof a.startingLine !== \"number\")\n                return -1;\n            if (typeof b.startingLine !== \"number\")\n                return -1;\n            return a.startingLine - b.startingLine;\n        }\n\n        var insertionIndex = insertionIndexForObjectInListSortedByFunction(option, select.childNodes, optionCompare);\n        if (insertionIndex < 0)\n            select.appendChild(option);\n        else\n            select.insertBefore(option, select.childNodes.item(insertionIndex));\n\n        if (script.resource)\n            script.resource.filesSelectOption = option;\n        else\n            script.filesSelectOption = option;\n\n        if (select.options[select.selectedIndex] === option) {\n            // Call _showScriptOrResource if the option we just appended ended up being selected.\n            // This will happen for the first item added to the menu.\n            this._showScriptOrResource(option.representedObject, {initialLoad: true});\n        } else {\n            // If not first item, check to see if this was the last viewed\n            var url = option.representedObject.url || option.representedObject.sourceURL;\n            var lastURL = WebInspector.settings.lastViewedScriptFile;\n            if (url && url === lastURL) {\n                // For resources containing multiple <script> tags, we first report them separately and\n                // then glue them all together. They all share url and there is no need to show them all one\n                // by one.\n                var isResource = !!option.representedObject.url;\n                if (isResource || !this.visibleView || !this.visibleView.script || this.visibleView.script.sourceURL !== url)\n                    this._showScriptOrResource(option.representedObject, {initialLoad: true});\n            }\n        }\n\n        if (script.worldType === WebInspector.Script.WorldType.EXTENSIONS_WORLD)\n            script.filesSelectOption.addStyleClass(\"extension-script\");\n    },\n\n    _clearCurrentExecutionLine: function()\n    {\n        if (this._executionSourceFrame)\n            this._executionSourceFrame.clearExecutionLocation();\n        delete this._executionSourceFrame;\n    },\n\n    _callFrameSelected: function()\n    {\n        this._clearCurrentExecutionLine();\n\n        var callStackPane = this.sidebarPanes.callstack;\n        var currentFrame = callStackPane.selectedCallFrame;\n        if (!currentFrame)\n            return;\n\n        this.sidebarPanes.scopechain.update(currentFrame);\n        this.sidebarPanes.watchExpressions.refreshExpressions();\n\n        var script = WebInspector.debuggerModel.scriptForSourceID(currentFrame.sourceID);\n        var scriptOrResource = script.resource || script;\n        this._showScriptOrResource(scriptOrResource, {line: currentFrame.line});\n\n        this._executionSourceFrame = this._sourceFrameForScriptOrResource(scriptOrResource);\n        if (this._executionSourceFrame)\n            this._executionSourceFrame.setExecutionLocation(currentFrame.line, currentFrame.column);\n    },\n\n    _changeVisibleFile: function(event)\n    {\n        var select = this.filesSelectElement;\n        this._showScriptOrResource(select.options[select.selectedIndex].representedObject);\n    },\n\n    _startSidebarResizeDrag: function(event)\n    {\n        WebInspector.elementDragStart(this.sidebarElement, this._sidebarResizeDrag.bind(this), this._endSidebarResizeDrag.bind(this), event, \"col-resize\");\n\n        if (event.target === this.sidebarResizeWidgetElement)\n            this._dragOffset = (event.target.offsetWidth - (event.pageX - event.target.totalOffsetLeft));\n        else\n            this._dragOffset = 0;\n    },\n\n    _endSidebarResizeDrag: function(event)\n    {\n        WebInspector.elementDragEnd(event);\n        delete this._dragOffset;\n        this.saveSidebarWidth();\n    },\n\n    _sidebarResizeDrag: function(event)\n    {\n        var x = event.pageX + this._dragOffset;\n        var newWidth = Number.constrain(window.innerWidth - x, Preferences.minScriptsSidebarWidth, window.innerWidth * 0.66);\n        this.setSidebarWidth(newWidth);\n        event.preventDefault();\n    },\n\n    setSidebarWidth: function(newWidth)\n    {\n        this.sidebarElement.style.width = newWidth + \"px\";\n        this.sidebarButtonsElement.style.width = newWidth + \"px\";\n        this.viewsContainerElement.style.right = newWidth + \"px\";\n        this.sidebarResizeWidgetElement.style.right = newWidth + \"px\";\n        this.sidebarResizeElement.style.right = (newWidth - 3) + \"px\";\n\n        this.resize();\n    },\n\n    _setPauseOnExceptions: function(pauseOnExceptionsState)\n    {\n        function callback(pauseOnExceptionsState)\n        {\n            if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)\n                this._pauseOnExceptionButton.title = WebInspector.UIString(\"Don't pause on exceptions.\\nClick to Pause on all exceptions.\");\n            else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnAllExceptions)\n                this._pauseOnExceptionButton.title = WebInspector.UIString(\"Pause on all exceptions.\\nClick to Pause on uncaught exceptions.\");\n            else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)\n                this._pauseOnExceptionButton.title = WebInspector.UIString(\"Pause on uncaught exceptions.\\nClick to Not pause on exceptions.\");\n\n            this._pauseOnExceptionButton.state = pauseOnExceptionsState;\n            WebInspector.settings.pauseOnExceptionState = pauseOnExceptionsState;\n        }\n        InspectorBackend.setPauseOnExceptionsState(pauseOnExceptionsState, callback.bind(this));\n    },\n\n    _updateDebuggerButtons: function()\n    {\n        if (this._debuggerEnabled) {\n            this.enableToggleButton.title = WebInspector.UIString(\"Debugging enabled. Click to disable.\");\n            this.enableToggleButton.toggled = true;\n            this._pauseOnExceptionButton.visible = true;\n            this.panelEnablerView.visible = false;\n        } else {\n            this.enableToggleButton.title = WebInspector.UIString(\"Debugging disabled. Click to enable.\");\n            this.enableToggleButton.toggled = false;\n            this._pauseOnExceptionButton.visible = false;\n            this.panelEnablerView.visible = true;\n        }\n\n        if (this._paused) {\n            this.pauseButton.addStyleClass(\"paused\");\n\n            this.pauseButton.disabled = false;\n            this.stepOverButton.disabled = false;\n            this.stepIntoButton.disabled = false;\n            this.stepOutButton.disabled = false;\n\n            this.debuggerStatusElement.textContent = WebInspector.UIString(\"Paused\");\n        } else {\n            this.pauseButton.removeStyleClass(\"paused\");\n\n            this.pauseButton.disabled = this._waitingToPause;\n            this.stepOverButton.disabled = true;\n            this.stepIntoButton.disabled = true;\n            this.stepOutButton.disabled = true;\n\n            if (this._waitingToPause)\n                this.debuggerStatusElement.textContent = WebInspector.UIString(\"Pausing\");\n            else if (this._stepping)\n                this.debuggerStatusElement.textContent = WebInspector.UIString(\"Stepping\");\n            else\n                this.debuggerStatusElement.textContent = \"\";\n        }\n    },\n\n    _updateBackAndForwardButtons: function()\n    {\n        this.backButton.disabled = this._currentBackForwardIndex <= 0;\n        this.forwardButton.disabled = this._currentBackForwardIndex >= (this._backForwardList.length - 1);\n    },\n\n    _clearInterface: function()\n    {\n        this.sidebarPanes.callstack.update(null);\n        this.sidebarPanes.scopechain.update(null);\n\n        this._clearCurrentExecutionLine();\n        this._updateDebuggerButtons();\n    },\n\n    _goBack: function()\n    {\n        if (this._currentBackForwardIndex <= 0) {\n            console.error(\"Can't go back from index \" + this._currentBackForwardIndex);\n            return;\n        }\n\n        this._showScriptOrResource(this._backForwardList[--this._currentBackForwardIndex], {fromBackForwardAction: true});\n        this._updateBackAndForwardButtons();\n    },\n\n    _goForward: function()\n    {\n        if (this._currentBackForwardIndex >= this._backForwardList.length - 1) {\n            console.error(\"Can't go forward from index \" + this._currentBackForwardIndex);\n            return;\n        }\n\n        this._showScriptOrResource(this._backForwardList[++this._currentBackForwardIndex], {fromBackForwardAction: true});\n        this._updateBackAndForwardButtons();\n    },\n\n    _formatScript: function()\n    {\n        if (this.visibleView)\n            this.visibleView.formatSource();\n    },\n\n    _enableDebugging: function()\n    {\n        if (this._debuggerEnabled)\n            return;\n        this._toggleDebugging(this.panelEnablerView.alwaysEnabled);\n    },\n\n    _toggleDebugging: function(optionalAlways)\n    {\n        this._paused = false;\n        this._waitingToPause = false;\n        this._stepping = false;\n\n        if (this._debuggerEnabled) {\n            WebInspector.settings.debuggerEnabled = false;\n            WebInspector.debuggerModel.disableDebugger();\n        } else {\n            WebInspector.settings.debuggerEnabled = !!optionalAlways;\n            WebInspector.debuggerModel.enableDebugger();\n        }\n    },\n\n    _togglePauseOnExceptions: function()\n    {\n        this._setPauseOnExceptions((this._pauseOnExceptionButton.state + 1) % this._pauseOnExceptionButton.states);\n    },\n\n    _togglePause: function()\n    {\n        if (this._paused) {\n            this._paused = false;\n            this._waitingToPause = false;\n            InspectorBackend.resume();\n        } else {\n            this._stepping = false;\n            this._waitingToPause = true;\n            InspectorBackend.pause();\n        }\n\n        this._clearInterface();\n    },\n\n    _stepOverClicked: function()\n    {\n        this._paused = false;\n        this._stepping = true;\n\n        this._clearInterface();\n\n        InspectorBackend.stepOver();\n    },\n\n    _stepIntoClicked: function()\n    {\n        this._paused = false;\n        this._stepping = true;\n\n        this._clearInterface();\n\n        InspectorBackend.stepInto();\n    },\n\n    _stepOutClicked: function()\n    {\n        this._paused = false;\n        this._stepping = true;\n\n        this._clearInterface();\n\n        InspectorBackend.stepOut();\n    },\n\n    toggleBreakpointsClicked: function()\n    {\n        this.toggleBreakpointsButton.toggled = !this.toggleBreakpointsButton.toggled;\n        if (this.toggleBreakpointsButton.toggled) {\n            InspectorBackend.activateBreakpoints();\n            this.toggleBreakpointsButton.title = WebInspector.UIString(\"Deactivate all breakpoints.\");\n            document.getElementById(\"main-panels\").removeStyleClass(\"breakpoints-deactivated\");\n        } else {\n            InspectorBackend.deactivateBreakpoints();\n            this.toggleBreakpointsButton.title = WebInspector.UIString(\"Activate all breakpoints.\");\n            document.getElementById(\"main-panels\").addStyleClass(\"breakpoints-deactivated\");\n        }\n    },\n\n    elementsToRestoreScrollPositionsFor: function()\n    {\n        return [ this.sidebarElement ];\n    },\n\n    _registerShortcuts: function()\n    {\n        var section = WebInspector.shortcutsHelp.section(WebInspector.UIString(\"Scripts Panel\"));\n        var handler, shortcut1, shortcut2;\n        var platformSpecificModifier = WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta;\n\n        this._shortcuts = {};\n\n        // Continue.\n        handler = this.pauseButton.click.bind(this.pauseButton);\n        shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F8);\n        this._shortcuts[shortcut1.key] = handler;\n        shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Slash, platformSpecificModifier);\n        this._shortcuts[shortcut2.key] = handler;\n        section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString(\"Continue\"));\n\n        // Step over.\n        handler = this.stepOverButton.click.bind(this.stepOverButton);\n        shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F10);\n        this._shortcuts[shortcut1.key] = handler;\n        shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.SingleQuote, platformSpecificModifier);\n        this._shortcuts[shortcut2.key] = handler;\n        section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString(\"Step over\"));\n\n        // Step into.\n        handler = this.stepIntoButton.click.bind(this.stepIntoButton);\n        shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11);\n        this._shortcuts[shortcut1.key] = handler;\n        shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, platformSpecificModifier);\n        this._shortcuts[shortcut2.key] = handler;\n        section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString(\"Step into\"));\n\n        // Step out.\n        handler = this.stepOutButton.click.bind(this.stepOutButton);\n        shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11, WebInspector.KeyboardShortcut.Modifiers.Shift);\n        this._shortcuts[shortcut1.key] = handler;\n        shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platformSpecificModifier);\n        this._shortcuts[shortcut2.key] = handler;\n        section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString(\"Step out\"));\n\n        var isMac = WebInspector.isMac();\n        if (isMac)\n            shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(\"l\", WebInspector.KeyboardShortcut.Modifiers.Meta);\n        else\n            shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(\"g\", WebInspector.KeyboardShortcut.Modifiers.Ctrl);\n        this._shortcuts[shortcut1.key] = this.showGoToLineDialog.bind(this);\n        section.addAlternateKeys([ shortcut1.name ], WebInspector.UIString(\"Go to Line\"));\n        this.sidebarPanes.callstack.registerShortcuts(section);\n    },\n\n    searchCanceled: function()\n    {\n        WebInspector.updateSearchMatchesCount(0, this);\n\n        if (this._searchView)\n            this._searchView.searchCanceled();\n\n        delete this._searchView;\n        delete this._searchQuery;\n    },\n\n    performSearch: function(query)\n    {\n        if (!this.visibleView)\n            return;\n\n        // Call searchCanceled since it will reset everything we need before doing a new search.\n        this.searchCanceled();\n\n        this._searchView = this.visibleView;\n        this._searchQuery = query;\n\n        function finishedCallback(view, searchMatches)\n        {\n            if (!searchMatches)\n                return;\n\n            WebInspector.updateSearchMatchesCount(searchMatches, this);\n            view.jumpToFirstSearchResult();\n        }\n\n        this._searchView.performSearch(query, finishedCallback.bind(this));\n    },\n\n    jumpToNextSearchResult: function()\n    {\n        if (!this._searchView)\n            return;\n\n        if (this._searchView !== this.visibleView) {\n            this.performSearch(this._searchQuery);\n            return;\n        }\n\n        if (this._searchView.showingLastSearchResult())\n            this._searchView.jumpToFirstSearchResult();\n        else\n            this._searchView.jumpToNextSearchResult();\n    },\n\n    jumpToPreviousSearchResult: function()\n    {\n        if (!this._searchView)\n            return;\n\n        if (this._searchView !== this.visibleView) {\n            this.performSearch(this._searchQuery);\n            if (this._searchView)\n                this._searchView.jumpToLastSearchResult();\n            return;\n        }\n\n        if (this._searchView.showingFirstSearchResult())\n            this._searchView.jumpToLastSearchResult();\n        else\n            this._searchView.jumpToPreviousSearchResult();\n    },\n\n    showGoToLineDialog: function(e)\n    {\n         var view = this.visibleView;\n         if (view)\n             WebInspector.GoToLineDialog.show(view);\n    }\n}\n\nWebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype;\n\n\nWebInspector.SourceFrameContentProviderForScript = function(script)\n{\n    WebInspector.SourceFrameContentProvider.call(this);\n    this._script = script;\n}\n\nWebInspector.SourceFrameContentProviderForScript.prototype = {\n    requestContent: function(callback)\n    {\n        function didRequestSource(source)\n        {\n            if (source) {\n                var prefix = \"\";\n                for (var i = 0; i < this._script.lineOffset; ++i)\n                    prefix += \"\\n\";\n                source = prefix + source;\n            } else\n                source = WebInspector.UIString(\"<source is not available>\");\n\n            var sourceMapping = new WebInspector.IdenticalSourceMapping();\n            var scriptRanges = WebInspector.ScriptFormatter.findScriptRanges(source.lineEndings(), [this._script]);\n            callback(\"text/javascript\", new WebInspector.SourceFrameContent(source, sourceMapping, scriptRanges));\n        }\n        this._script.requestSource(didRequestSource.bind(this));\n    }\n}\n\nWebInspector.SourceFrameContentProviderForScript.prototype.__proto__ = WebInspector.SourceFrameContentProvider.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Section.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Google Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.Section = function(title, subtitle)\n{\n    this.element = document.createElement(\"div\");\n    this.element.className = \"section\";\n    this.element._section = this;\n\n    this.headerElement = document.createElement(\"div\");\n    this.headerElement.className = \"header\";\n\n    this.titleElement = document.createElement(\"div\");\n    this.titleElement.className = \"title\";\n\n    this.subtitleElement = document.createElement(\"div\");\n    this.subtitleElement.className = \"subtitle\";\n\n    this.headerElement.appendChild(this.subtitleElement);\n    this.headerElement.appendChild(this.titleElement);\n\n    this.headerElement.addEventListener(\"click\", this.toggleExpanded.bind(this), false);\n    this.element.appendChild(this.headerElement);\n\n    this.title = title;\n    this.subtitle = subtitle;\n    this._expanded = false;\n}\n\nWebInspector.Section.prototype = {\n    get title()\n    {\n        return this._title;\n    },\n\n    set title(x)\n    {\n        if (this._title === x)\n            return;\n        this._title = x;\n\n        if (x instanceof Node) {\n            this.titleElement.removeChildren();\n            this.titleElement.appendChild(x);\n        } else\n          this.titleElement.textContent = x;\n    },\n\n    get subtitle()\n    {\n        return this._subtitle;\n    },\n\n    set subtitle(x)\n    {\n        if (this._subtitle === x)\n            return;\n        this._subtitle = x;\n        this.subtitleElement.textContent = x;\n    },\n\n    get subtitleAsTextForTest()\n    {\n        var result = this.subtitleElement.textContent;\n        var child = this.subtitleElement.querySelector(\"[data-uncopyable]\");\n        if (child) {\n            var linkData = child.getAttribute(\"data-uncopyable\");\n            if (linkData)\n                result += linkData;\n        }\n        return result;\n    },\n\n    get expanded()\n    {\n        return this._expanded;\n    },\n\n    set expanded(x)\n    {\n        if (x)\n            this.expand();\n        else\n            this.collapse();\n    },\n\n    get populated()\n    {\n        return this._populated;\n    },\n\n    set populated(x)\n    {\n        this._populated = x;\n        if (!x && this.onpopulate && this._expanded) {\n            this.onpopulate(this);\n            this._populated = true;\n        }\n    },\n\n    get nextSibling()\n    {\n        var curElement = this.element;\n        do {\n            curElement = curElement.nextSibling;\n        } while (curElement && !curElement._section);\n\n        return curElement ? curElement._section : null;\n    },\n\n    get previousSibling()\n    {\n        var curElement = this.element;\n        do {\n            curElement = curElement.previousSibling;\n        } while (curElement && !curElement._section);\n\n        return curElement ? curElement._section : null;\n    },\n\n    expand: function()\n    {\n        if (this._expanded)\n            return;\n        this._expanded = true;\n        this.element.addStyleClass(\"expanded\");\n\n        if (!this._populated && this.onpopulate) {\n            this.onpopulate(this);\n            this._populated = true;\n        }\n    },\n\n    collapse: function()\n    {\n        if (!this._expanded)\n            return;\n        this._expanded = false;\n        this.element.removeStyleClass(\"expanded\");\n    },\n\n    toggleExpanded: function()\n    {\n        this.expanded = !this.expanded;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/Settings.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nvar Preferences = {\n    canEditScriptSource: false,\n    maxInlineTextChildLength: 80,\n    minConsoleHeight: 75,\n    minSidebarWidth: 100,\n    minElementsSidebarWidth: 200,\n    minScriptsSidebarWidth: 200,\n    styleRulesExpandedState: {},\n    showMissingLocalizedStrings: false,\n    samplingCPUProfiler: false,\n    showColorNicknames: true,\n    debuggerAlwaysEnabled: false,\n    profilerAlwaysEnabled: false,\n    onlineDetectionEnabled: true,\n    nativeInstrumentationEnabled: false,\n    resourceExportEnabled: false,\n    useDataURLForResourceImageIcons: true,\n    showTimingTab: false,\n    showCookiesTab: false,\n    debugMode: false,\n    heapProfilerPresent: false,\n    detailedHeapProfiles: false\n}\n\nWebInspector.Settings = function()\n{\n    this.installApplicationSetting(\"colorFormat\", \"hex\");\n    this.installApplicationSetting(\"consoleHistory\", []);\n    this.installApplicationSetting(\"debuggerEnabled\", false);\n    this.installApplicationSetting(\"profilerEnabled\", false);\n    this.installApplicationSetting(\"eventListenersFilter\", \"all\");\n    this.installApplicationSetting(\"lastActivePanel\", \"elements\");\n    this.installApplicationSetting(\"lastViewedScriptFile\", \"application\");\n    this.installApplicationSetting(\"monitoringXHREnabled\", false);\n    this.installApplicationSetting(\"pauseOnExceptionState\", WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);\n    this.installApplicationSetting(\"resourcesLargeRows\", true);\n    this.installApplicationSetting(\"resourcesSortOptions\", {timeOption: \"responseTime\", sizeOption: \"transferSize\"});\n    this.installApplicationSetting(\"resourceViewTab\", \"content\");\n    this.installApplicationSetting(\"showInheritedComputedStyleProperties\", false);\n    this.installApplicationSetting(\"showUserAgentStyles\", true);\n    this.installApplicationSetting(\"watchExpressions\", []);\n    this.installApplicationSetting(\"breakpoints\", []);\n\n    this.installProjectSetting(\"nativeBreakpoints\", []);\n}\n\nWebInspector.Settings.Events = {\n    ProjectChanged: \"project-changed\"\n}\n\nWebInspector.Settings.prototype = {\n    installApplicationSetting: function(key, defaultValue)\n    {\n        if (key in this)\n            return;\n\n        Object.defineProperty(this, key,{\n            get : this._get.bind(this, key, defaultValue),\n            set : this._set.bind(this, key)});\n    },\n\n    installProjectSetting: function(key, defaultValue)\n    {\n        Object.defineProperty(this, key,{\n            get : this._getProjectSetting.bind(this, key, defaultValue),\n            set : this._setProjectSetting.bind(this, key)});\n\n    },\n\n    inspectedURLChanged: function(url)\n    {\n        var fragmentIndex = url.indexOf(\"#\");\n        if (fragmentIndex !== -1)\n            url = url.substring(0, fragmentIndex);\n        this._projectId = url;\n        this.dispatchEventToListeners(WebInspector.Settings.Events.ProjectChanged);\n    },\n\n    get projectId()\n    {\n        return this._projectId;\n    },\n\n    findSettingForAllProjects: function(key)\n    {\n        var result = {};\n        var regexp = \"^\" + key + \":(.*)\";\n        for (var i = 0; i < window.localStorage.length; ++i) {\n            var fullKey =  window.localStorage.key(i);\n            var match = fullKey.match(regexp);\n            if (!match)\n                continue;\n            try {\n                result[match[1]] = JSON.parse(window.localStorage[fullKey]);\n            } catch(e) {\n                window.localStorage.removeItem(fullKey);\n            }\n        }\n        return result;\n    },\n\n    _get: function(key, defaultValue)\n    {\n        if (key in window.localStorage) {\n            try {\n                return JSON.parse(window.localStorage[key]);\n            } catch(e) {\n                window.localStorage.removeItem(key);\n            }\n        }\n        return defaultValue;\n    },\n\n    _set: function(key, value)\n    {\n        window.localStorage[key] = JSON.stringify(value);\n    },\n\n    _getProjectSetting: function(key, defaultValue)\n    {\n        return this._get(this._formatProjectKey(key), defaultValue);\n    },\n\n    _setProjectSetting: function(key, value)\n    {\n        return this._set(this._formatProjectKey(key), value);\n    },\n\n    _formatProjectKey: function(key)\n    {\n        return key + \":\" + this._projectId;\n    }\n}\n\nWebInspector.Settings.prototype.__proto__ = WebInspector.Object.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ShortcutsHelp.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ShortcutsHelp = function()\n{\n    this._sections = {};\n}\n\nWebInspector.ShortcutsHelp.prototype = {\n    section: function(name)\n    {\n        var section = this._sections[name];\n        if (!section)\n            this._sections[name] = section = new WebInspector.ShortcutsSection(name);\n        return section;\n    },\n\n    show: function()\n    {\n        if (!this._helpScreen) {\n            this._helpScreen = new WebInspector.HelpScreen(WebInspector.UIString(\"Keyboard Shortcuts\"));\n            this._buildTable(this._helpScreen.contentElement, 2);\n        }\n        this._helpScreen.show();\n    },\n\n    _buildTable: function(parent, nColumns)\n    {\n        var height = 0;\n        var orderedSections = [];\n        for (var section in this._sections) {\n            height += this._sections[section]._height;\n            orderedSections.push(this._sections[section])\n        }\n        function compareSections(a, b)\n        {\n            return a.order - b.order;\n        }\n        orderedSections = orderedSections.sort(compareSections);\n\n        var wrapAfter = height / nColumns;\n        var table = document.createElement(\"table\");\n        table.className = \"help-table\";\n        var row = table.createChild(\"tr\");\n\n        // This manual layout ugliness should be gone once WebKit implements\n        // pagination hints for CSS columns (break-inside etc).\n        for (var section = 0; section < orderedSections.length;) {\n            var td = row.createChild(\"td\");\n            td.style.width = (100 / nColumns) + \"%\";\n            var column = td.createChild(\"table\");\n            for (var columnHeight = 0;\n                columnHeight < wrapAfter && section < orderedSections.length;\n                columnHeight += orderedSections[section]._height, section++) {\n                orderedSections[section].renderSection(column);\n            }\n        }\n        parent.appendChild(table);\n    }\n};\n\nWebInspector.shortcutsHelp = new WebInspector.ShortcutsHelp();\n\nWebInspector.ShortcutsSection = function(name)\n{\n    this.name = name;\n    this._lines = [];\n    this.order = ++WebInspector.ShortcutsSection._sequenceNumber;\n};\n\nWebInspector.ShortcutsSection._sequenceNumber = 0;\n\nWebInspector.ShortcutsSection.prototype = {\n    addKey: function(key, description)\n    {\n        this.addLine(this._renderKey(key), description);\n    },\n\n    addRelatedKeys: function(keys, description)\n    {\n        this.addLine(this._renderSequence(keys,\"/\"), description);\n    },\n\n    addAlternateKeys: function(keys, description)\n    {\n        this.addLine(this._renderSequence(keys,WebInspector.UIString(\"or\")), description);\n    },\n\n    addLine: function(htmlKey, description)\n    {\n        this._lines.push({ key: htmlKey, text: description })\n    },\n\n    renderSection: function(parent)\n    {\n        this._renderHeader(parent);\n\n        for (var line = 0; line < this._lines.length; ++line) {\n            var tr = parent.createChild(\"tr\");\n            tr.createChild(\"td\", \"help-key-cell\").innerHTML = this._lines[line].key + \" : \";\n            tr.createChild(\"td\").innerText = this._lines[line].text;\n        }\n    },\n\n    _renderHeader: function(parent)\n    {\n        var trHead = parent.createChild(\"tr\");\n \n        trHead.createChild(\"th\");\n        trHead.createChild(\"th\").innerText = this.name;\n    },\n\n    _renderSequence: function(sequence, delimiter)\n    {\n        var delimiterHtml = '<span class=\"help-key-delimiter\">' + delimiter.escapeHTML() + '</span>'\n        return sequence.map(this._renderKey).join(delimiterHtml);\n    },\n\n    _renderKey: function(key)\n    {\n        function renderLabel(label)\n        {\n            return '<span class=\"help-key monospace\">' + label.escapeHTML() + '</span>';\n        }\n        return key.split(\" + \").map(renderLabel).join('<span class=\"help-combine-keys\">+</span>');\n    },\n\n    get _height()\n    {\n        return this._lines.length + 2; // add some space for header\n    }\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/ShowMoreDataGridNode.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.ShowMoreDataGridNode = function(callback, nextCount, allCount)\n{\n    function populate(count)\n    {\n        var index = this.parent.children.indexOf(this);\n        this.parent.removeChild(this);\n        callback(count, index);\n    }\n\n    this.showNext = document.createElement(\"button\");\n    this.showNext.setAttribute(\"type\", \"button\");\n    this.showNext.textContent = WebInspector.UIString(\"Show next %d\", nextCount);\n    this.showNext.addEventListener(\"click\", populate.bind(this, nextCount), false);\n\n    if (allCount) {\n        this.showAll = document.createElement(\"button\");\n        this.showAll.setAttribute(\"type\", \"button\");\n        this.showAll.textContent = WebInspector.UIString(\"Show all %d\", allCount);\n        this.showAll.addEventListener(\"click\", populate.bind(this, allCount), false);\n    }\n\n    WebInspector.DataGridNode.call(this, {summaryRow:true}, false);\n    this.selectable = false;\n}\n\nWebInspector.ShowMoreDataGridNode.prototype = {\n    createCells: function()\n    {\n        var cell = document.createElement(\"td\");\n        if (this.depth)\n            cell.style.setProperty(\"padding-left\", (this.depth * this.dataGrid.indentWidth) + \"px\");\n        cell.appendChild(this.showNext);\n        if (this.showAll)\n            cell.appendChild(this.showAll);\n        this._element.appendChild(cell);\n\n        var columns = this.dataGrid.columns;\n        var count = 0;\n        for (var c in columns)\n            ++count;\n        while (--count > 0) {\n            cell = document.createElement(\"td\");\n            this._element.appendChild(cell);\n        }\n    }\n};\n\nWebInspector.ShowMoreDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SidebarPane.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.SidebarPane = function(title)\n{\n    this.element = document.createElement(\"div\");\n    this.element.className = \"pane\";\n\n    this.titleElement = document.createElement(\"div\");\n    this.titleElement.className = \"title\";\n    this.titleElement.tabIndex = 0;\n    this.titleElement.addEventListener(\"click\", this.toggleExpanded.bind(this), false);\n    this.titleElement.addEventListener(\"keydown\", this._onTitleKeyDown.bind(this), false);\n\n    this.bodyElement = document.createElement(\"div\");\n    this.bodyElement.className = \"body\";\n\n    this.element.appendChild(this.titleElement);\n    this.element.appendChild(this.bodyElement);\n\n    this.title = title;\n    this.growbarVisible = false;\n    this.expanded = false;\n}\n\nWebInspector.SidebarPane.prototype = {\n    get title()\n    {\n        return this._title;\n    },\n\n    set title(x)\n    {\n        if (this._title === x)\n            return;\n        this._title = x;\n        this.titleElement.textContent = x;\n    },\n\n    get growbarVisible()\n    {\n        return this._growbarVisible;\n    },\n\n    set growbarVisible(x)\n    {\n        if (this._growbarVisible === x)\n            return;\n\n        this._growbarVisible = x;\n\n        if (x && !this._growbarElement) {\n            this._growbarElement = document.createElement(\"div\");\n            this._growbarElement.className = \"growbar\";\n            this.element.appendChild(this._growbarElement);\n        } else if (!x && this._growbarElement) {\n            if (this._growbarElement.parentNode)\n                this._growbarElement.parentNode(this._growbarElement);\n            delete this._growbarElement;\n        }\n    },\n\n    get expanded()\n    {\n        return this._expanded;\n    },\n\n    set expanded(x)\n    {\n        if (x)\n            this.expand();\n        else\n            this.collapse();\n    },\n\n    expand: function()\n    {\n        if (this._expanded)\n            return;\n        this._expanded = true;\n        this.element.addStyleClass(\"expanded\");\n        if (this.onexpand)\n            this.onexpand(this);\n    },\n\n    collapse: function()\n    {\n        if (!this._expanded)\n            return;\n        this._expanded = false;\n        this.element.removeStyleClass(\"expanded\");\n        if (this.oncollapse)\n            this.oncollapse(this);\n    },\n\n    toggleExpanded: function()\n    {\n        this.expanded = !this.expanded;\n    },\n\n    _onTitleKeyDown: function(event)\n    {\n        if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut.Keys.Space.code)\n            this.toggleExpanded();\n    }\n}\n\nWebInspector.SidebarPane.prototype.__proto__ = WebInspector.Object.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SidebarTreeElement.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.SidebarSectionTreeElement = function(title, representedObject, hasChildren)\n{\n    TreeElement.call(this, title.escapeHTML(), representedObject || {}, hasChildren);\n}\n\nWebInspector.SidebarSectionTreeElement.prototype = {\n    selectable: false,\n\n    get smallChildren()\n    {\n        return this._smallChildren;\n    },\n\n    set smallChildren(x)\n    {\n        if (this._smallChildren === x)\n            return;\n\n        this._smallChildren = x;\n\n        if (this._smallChildren)\n            this._childrenListNode.addStyleClass(\"small\");\n        else\n            this._childrenListNode.removeStyleClass(\"small\");\n    },\n\n    onattach: function()\n    {\n        this._listItemNode.addStyleClass(\"sidebar-tree-section\");\n    },\n\n    onreveal: function()\n    {\n        if (this.listItemElement)\n            this.listItemElement.scrollIntoViewIfNeeded(false);\n    }\n}\n\nWebInspector.SidebarSectionTreeElement.prototype.__proto__ = TreeElement.prototype;\n\nWebInspector.SidebarTreeElement = function(className, title, subtitle, representedObject, hasChildren)\n{\n    TreeElement.call(this, \"\", representedObject || {}, hasChildren);\n\n    if (hasChildren) {\n        this.disclosureButton = document.createElement(\"button\");\n        this.disclosureButton.className = \"disclosure-button\";\n    }\n\n    if (!this.iconElement) {\n        this.iconElement = document.createElement(\"img\");\n        this.iconElement.className = \"icon\";\n    }\n\n    this.statusElement = document.createElement(\"div\");\n    this.statusElement.className = \"status\";\n\n    this.titlesElement = document.createElement(\"div\");\n    this.titlesElement.className = \"titles\";\n\n    this.titleElement = document.createElement(\"span\");\n    this.titleElement.className = \"title\";\n    this.titlesElement.appendChild(this.titleElement);\n\n    this.subtitleElement = document.createElement(\"span\");\n    this.subtitleElement.className = \"subtitle\";\n    this.titlesElement.appendChild(this.subtitleElement);\n\n    this.className = className;\n    this.mainTitle = title;\n    this.subtitle = subtitle;\n}\n\nWebInspector.SidebarTreeElement.prototype = {\n    get small()\n    {\n        return this._small;\n    },\n\n    set small(x)\n    {\n        this._small = x;\n\n        if (this._listItemNode) {\n            if (this._small)\n                this._listItemNode.addStyleClass(\"small\");\n            else\n                this._listItemNode.removeStyleClass(\"small\");\n        }\n    },\n\n    get mainTitle()\n    {\n        return this._mainTitle;\n    },\n\n    set mainTitle(x)\n    {\n        this._mainTitle = x;\n        this.refreshTitles();\n    },\n\n    get subtitle()\n    {\n        return this._subtitle;\n    },\n\n    set subtitle(x)\n    {\n        this._subtitle = x;\n        this.refreshTitles();\n    },\n\n    get bubbleText()\n    {\n        return this._bubbleText;\n    },\n\n    set bubbleText(x)\n    {\n        if (!this.bubbleElement) {\n            this.bubbleElement = document.createElement(\"div\");\n            this.bubbleElement.className = \"bubble\";\n            this.statusElement.appendChild(this.bubbleElement);\n        }\n\n        this._bubbleText = x;\n        this.bubbleElement.textContent = x;\n    },\n\n    refreshTitles: function()\n    {\n        var mainTitle = this.mainTitle;\n        if (this.titleElement.textContent !== mainTitle)\n            this.titleElement.textContent = mainTitle;\n\n        var subtitle = this.subtitle;\n        if (subtitle) {\n            if (this.subtitleElement.textContent !== subtitle)\n                this.subtitleElement.textContent = subtitle;\n            this.titlesElement.removeStyleClass(\"no-subtitle\");\n        } else {\n            this.subtitleElement.textContent = \"\";\n            this.titlesElement.addStyleClass(\"no-subtitle\");\n        }\n    },\n\n    isEventWithinDisclosureTriangle: function(event)\n    {\n        return event.target === this.disclosureButton;\n    },\n\n    onattach: function()\n    {\n        this._listItemNode.addStyleClass(\"sidebar-tree-item\");\n\n        if (this.className)\n            this._listItemNode.addStyleClass(this.className);\n\n        if (this.small)\n            this._listItemNode.addStyleClass(\"small\");\n\n        if (this.hasChildren && this.disclosureButton)\n            this._listItemNode.appendChild(this.disclosureButton);\n\n        this._listItemNode.appendChild(this.iconElement);\n        this._listItemNode.appendChild(this.statusElement);\n        this._listItemNode.appendChild(this.titlesElement);\n    },\n\n    onreveal: function()\n    {\n        if (this._listItemNode)\n            this._listItemNode.scrollIntoViewIfNeeded(false);\n    }\n}\n\nWebInspector.SidebarTreeElement.prototype.__proto__ = TreeElement.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceCSSTokenizer.js",
    "content": "/* Generated by re2c 0.13.5 on Mon Dec 20 18:44:30 2010 */\n/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Generate js file as follows:\n//\n// re2c -isc WebCore/inspector/front-end/SourceCSSTokenizer.re2js \\\n// | sed 's|^yy\\([^:]*\\)*\\:|case \\1:|' \\\n// | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \\\n// | sed 's|[[*][+][+]cursor|this._charAt(++cursor)|' \\\n// | sed 's|[*]cursor|this._charAt(cursor)|' \\\n// | sed 's|yych = \\*\\([^;]*\\)|yych = this._charAt\\1|' \\\n// | sed 's|{ gotoCase = \\([^; continue; };]*\\)|{ gotoCase = \\1; continue; }|' \\\n// | sed 's|unsigned\\ int|var|' \\\n// | sed 's|var\\ yych|case 1: case 1: var yych|'\n\nWebInspector.SourceCSSTokenizer = function()\n{\n    WebInspector.SourceTokenizer.call(this);\n\n    this._propertyKeywords = WebInspector.cssNameCompletions.keySet();\n\n    this._valueKeywords = [\n        \"above\", \"absolute\", \"activeborder\", \"activecaption\", \"afar\", \"after-white-space\", \"ahead\", \"alias\", \"all\", \"all-scroll\",\n        \"alternate\", \"always\",\"amharic\", \"amharic-abegede\", \"antialiased\", \"appworkspace\", \"aqua\", \"arabic-indic\", \"armenian\", \"asterisks\",\n        \"auto\", \"avoid\", \"background\", \"backwards\", \"baseline\", \"below\", \"bidi-override\", \"binary\", \"bengali\", \"black\", \"blink\",\n        \"block\", \"block-axis\", \"blue\", \"bold\", \"bolder\", \"border\", \"border-box\", \"both\", \"bottom\", \"break-all\", \"break-word\", \"button\",\n        \"button-bevel\", \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"cambodian\", \"capitalize\", \"caps-lock-indicator\",\n        \"caption\", \"captiontext\", \"caret\", \"cell\", \"center\", \"checkbox\", \"circle\", \"cjk-earthly-branch\", \"cjk-heavenly-stem\", \"cjk-ideographic\",\n        \"clear\", \"clip\", \"close-quote\", \"col-resize\", \"collapse\", \"compact\", \"condensed\", \"contain\", \"content\", \"content-box\", \"context-menu\",\n        \"continuous\", \"copy\", \"cover\", \"crop\", \"cross\", \"crosshair\", \"currentcolor\", \"cursive\", \"dashed\", \"decimal\", \"decimal-leading-zero\", \"default\",\n        \"default-button\", \"destination-atop\", \"destination-in\", \"destination-out\", \"destination-over\", \"devanagari\", \"disc\", \"discard\", \"document\",\n        \"dot-dash\", \"dot-dot-dash\", \"dotted\", \"double\", \"down\", \"e-resize\", \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\", \"element\",\n        \"ellipsis\", \"embed\", \"end\", \"ethiopic\", \"ethiopic-abegede\", \"ethiopic-abegede-am-et\", \"ethiopic-abegede-gez\",\n        \"ethiopic-abegede-ti-er\", \"ethiopic-abegede-ti-et\", \"ethiopic-halehame-aa-er\", \"ethiopic-halehame-aa-et\",\n        \"ethiopic-halehame-am-et\", \"ethiopic-halehame-gez\", \"ethiopic-halehame-om-et\", \"ethiopic-halehame-sid-et\",\n        \"ethiopic-halehame-so-et\", \"ethiopic-halehame-ti-er\", \"ethiopic-halehame-ti-et\", \"ethiopic-halehame-tig\", \"ew-resize\", \"expanded\",\n        \"extra-condensed\", \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fixed\", \"flat\", \"footnotes\", \"forwards\", \"from\", \"fuchsia\", \"geometricPrecision\",\n        \"georgian\", \"gray\", \"graytext\", \"green\", \"grey\", \"groove\", \"gujarati\", \"gurmukhi\", \"hand\", \"hangul\", \"hangul-consonant\", \"hebrew\", \"help\",\n        \"hidden\", \"hide\", \"higher\", \"highlight\", \"highlighttext\", \"hiragana\", \"hiragana-iroha\", \"horizontal\", \"hsl\", \"hsla\", \"icon\", \"ignore\",\n        \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\", \"infobackground\", \"infotext\", \"inherit\", \"initial\", \"inline\",\n        \"inline-axis\", \"inline-block\", \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\", \"italic\", \"justify\", \"kannada\", \"katakana\",\n        \"katakana-iroha\", \"khmer\", \"landscape\", \"lao\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lime\", \"line-through\", \"linear\", \"lines\",\n        \"list-button\", \"list-item\", \"listbox\", \"listitem\", \"local\", \"logical\", \"loud\", \"lower\", \"lower-alpha\", \"lower-armenian\", \"lower-greek\",\n        \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\", \"lower-roman\", \"lowercase\", \"ltr\", \"malayalam\", \"maroon\", \"match\", \"media-controls-background\",\n        \"media-current-time-display\", \"media-fullscreen-button\", \"media-mute-button\", \"media-play-button\", \"media-return-to-realtime-button\",\n        \"media-rewind-button\", \"media-seek-back-button\", \"media-seek-forward-button\", \"media-slider\", \"media-sliderthumb\", \"media-time-remaining-display\",\n        \"media-volume-slider\", \"media-volume-slider-container\", \"media-volume-sliderthumb\", \"medium\", \"menu\", \"menulist\", \"menulist-button\",\n        \"menulist-text\", \"menulist-textfield\", \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\", \"mix\", \"mongolian\", \"monospace\", \"move\", \"multiple\",\n        \"myanmar\", \"n-resize\", \"narrower\", \"navy\", \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\", \"no-open-quote\", \"no-repeat\", \"none\",\n        \"normal\", \"not-allowed\", \"nowrap\", \"ns-resize\", \"nw-resize\", \"nwse-resize\", \"oblique\", \"octal\", \"olive\", \"open-quote\", \"optimizeLegibility\",\n        \"optimizeSpeed\", \"orange\", \"oriya\", \"oromo\", \"outset\", \"outside\", \"overlay\", \"overline\", \"padding\", \"padding-box\", \"painted\", \"paused\",\n        \"persian\", \"plus-darker\", \"plus-lighter\", \"pointer\", \"portrait\", \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\", \"progress\", \"purple\",\n        \"push-button\", \"radio\", \"read-only\", \"read-write\", \"read-write-plaintext-only\", \"red\", \"relative\", \"repeat\", \"repeat-x\",\n        \"repeat-y\", \"reset\", \"reverse\", \"rgb\", \"rgba\", \"ridge\", \"right\", \"round\", \"row-resize\", \"rtl\", \"run-in\", \"running\", \"s-resize\", \"sans-serif\",\n        \"scroll\", \"scrollbar\", \"se-resize\", \"searchfield\", \"searchfield-cancel-button\", \"searchfield-decoration\", \"searchfield-results-button\",\n        \"searchfield-results-decoration\", \"semi-condensed\", \"semi-expanded\", \"separate\", \"serif\", \"show\", \"sidama\", \"silver\", \"single\",\n        \"skip-white-space\", \"slide\", \"slider-horizontal\", \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\",\n        \"small\", \"small-caps\", \"small-caption\", \"smaller\", \"solid\", \"somali\", \"source-atop\", \"source-in\", \"source-out\", \"source-over\",\n        \"space\", \"square\", \"square-button\", \"start\", \"static\", \"status-bar\", \"stretch\", \"stroke\", \"sub\", \"subpixel-antialiased\", \"super\",\n        \"sw-resize\", \"table\", \"table-caption\", \"table-cell\", \"table-column\", \"table-column-group\", \"table-footer-group\", \"table-header-group\",\n        \"table-row\", \"table-row-group\", \"teal\", \"telugu\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thai\", \"thick\", \"thin\",\n        \"threeddarkshadow\", \"threedface\", \"threedhighlight\", \"threedlightshadow\", \"threedshadow\", \"tibetan\", \"tigre\", \"tigrinya-er\", \"tigrinya-er-abegede\",\n        \"tigrinya-et\", \"tigrinya-et-abegede\", \"to\", \"top\", \"transparent\", \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"up\", \"upper-alpha\", \"upper-armenian\",\n        \"upper-greek\", \"upper-hexadecimal\", \"upper-latin\", \"upper-norwegian\", \"upper-roman\", \"uppercase\", \"urdu\", \"url\", \"vertical\", \"vertical-text\", \"visible\",\n        \"visibleFill\", \"visiblePainted\", \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"white\", \"wider\", \"window\", \"windowframe\", \"windowtext\",\n        \"x-large\", \"x-small\", \"xor\", \"xx-large\", \"xx-small\", \"yellow\", \"-wap-marquee\", \"-webkit-activelink\", \"-webkit-auto\", \"-webkit-baseline-middle\",\n        \"-webkit-body\", \"-webkit-box\", \"-webkit-center\", \"-webkit-control\", \"-webkit-focus-ring-color\", \"-webkit-grab\", \"-webkit-grabbing\",\n        \"-webkit-gradient\", \"-webkit-inline-box\", \"-webkit-left\", \"-webkit-link\", \"-webkit-marquee\", \"-webkit-mini-control\", \"-webkit-nowrap\", \"-webkit-right\",\n        \"-webkit-small-control\", \"-webkit-text\", \"-webkit-xxx-large\", \"-webkit-zoom-in\", \"-webkit-zoom-out\",\n    ].keySet();\n\n    this._mediaTypes = [\"all\", \"aural\", \"braille\", \"embossed\", \"handheld\", \"import\", \"print\", \"projection\", \"screen\", \"tty\", \"tv\"].keySet();\n\n    this._lexConditions = {\n        INITIAL: 0,\n        COMMENT: 1,\n        DSTRING: 2,\n        SSTRING: 3\n    };\n\n    this._parseConditions = {\n        INITIAL: 0,\n        PROPERTY: 1,\n        PROPERTY_VALUE: 2,\n        AT_RULE: 3\n    };\n\n    this.case_INITIAL = 1000;\n    this.case_COMMENT = 1002;\n    this.case_DSTRING = 1003;\n    this.case_SSTRING = 1004;\n\n    this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL }\n}\n\nWebInspector.SourceCSSTokenizer.prototype = {\n    _stringToken: function(cursor, stringEnds)\n    {\n        if (this._isPropertyValue())\n            this.tokenType = \"css-string\";\n        else\n            this.tokenType = null;\n        return cursor;\n    },\n\n    _isPropertyValue: function()\n    {\n        return this._condition.parseCondition === this._parseConditions.PROPERTY_VALUE || this._condition.parseCondition === this._parseConditions.AT_RULE;\n    },\n\n    nextToken: function(cursor)\n    {\n        var cursorOnEnter = cursor;\n        var gotoCase = 1;\n        while (1) {\n            switch (gotoCase)\n            // Following comment is replaced with generated state machine.\n            \n        {\n            case 1: var yych;\n            var yyaccept = 0;\n            if (this.getLexCondition() < 2) {\n                if (this.getLexCondition() < 1) {\n                    { gotoCase = this.case_INITIAL; continue; };\n                } else {\n                    { gotoCase = this.case_COMMENT; continue; };\n                }\n            } else {\n                if (this.getLexCondition() < 3) {\n                    { gotoCase = this.case_DSTRING; continue; };\n                } else {\n                    { gotoCase = this.case_SSTRING; continue; };\n                }\n            }\n/* *********************************** */\ncase this.case_COMMENT:\n\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 4; continue; };\n                { gotoCase = 3; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 4; continue; };\n                if (yych == '*') { gotoCase = 6; continue; };\n                { gotoCase = 3; continue; };\n            }\ncase 2:\n            { this.tokenType = \"css-comment\"; return cursor; }\ncase 3:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 12; continue; };\ncase 4:\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 6:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '*') { gotoCase = 9; continue; };\n            if (yych != '/') { gotoCase = 11; continue; };\ncase 7:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.INITIAL);\n            { this.tokenType = \"css-comment\"; return cursor; }\ncase 9:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '*') { gotoCase = 9; continue; };\n            if (yych == '/') { gotoCase = 7; continue; };\ncase 11:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 12:\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 2; continue; };\n                { gotoCase = 11; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 2; continue; };\n                if (yych == '*') { gotoCase = 9; continue; };\n                { gotoCase = 11; continue; };\n            }\n/* *********************************** */\ncase this.case_DSTRING:\n            yych = this._charAt(cursor);\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 17; continue; };\n                if (yych <= '\\f') { gotoCase = 16; continue; };\n                { gotoCase = 17; continue; };\n            } else {\n                if (yych <= '\"') {\n                    if (yych <= '!') { gotoCase = 16; continue; };\n                    { gotoCase = 19; continue; };\n                } else {\n                    if (yych == '\\\\') { gotoCase = 21; continue; };\n                    { gotoCase = 16; continue; };\n                }\n            }\ncase 15:\n            { return this._stringToken(cursor); }\ncase 16:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 23; continue; };\ncase 17:\n            ++cursor;\ncase 18:\n            { this.tokenType = null; return cursor; }\ncase 19:\n            ++cursor;\ncase 20:\n            this.setLexCondition(this._lexConditions.INITIAL);\n            { return this._stringToken(cursor, true); }\ncase 21:\n            yych = this._charAt(++cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 22; continue; };\n                    if (yych <= '&') { gotoCase = 18; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych <= '[') { gotoCase = 18; continue; };\n                    } else {\n                        if (yych != 'b') { gotoCase = 18; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych >= 'g') { gotoCase = 18; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 22; continue; };\n                        if (yych <= 'q') { gotoCase = 18; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych <= 's') { gotoCase = 18; continue; };\n                    } else {\n                        if (yych != 'v') { gotoCase = 18; continue; };\n                    }\n                }\n            }\ncase 22:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 23:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 15; continue; };\n                if (yych <= '\\f') { gotoCase = 22; continue; };\n                { gotoCase = 15; continue; };\n            } else {\n                if (yych <= '\"') {\n                    if (yych <= '!') { gotoCase = 22; continue; };\n                    { gotoCase = 26; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 22; continue; };\n                }\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 22; continue; };\n                    if (yych >= '\\'') { gotoCase = 22; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych >= '\\\\') { gotoCase = 22; continue; };\n                    } else {\n                        if (yych == 'b') { gotoCase = 22; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych <= 'f') { gotoCase = 22; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 22; continue; };\n                        if (yych >= 'r') { gotoCase = 22; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych >= 't') { gotoCase = 22; continue; };\n                    } else {\n                        if (yych == 'v') { gotoCase = 22; continue; };\n                    }\n                }\n            }\n            cursor = YYMARKER;\n            { gotoCase = 15; continue; };\ncase 26:\n            ++cursor;\n            yych = this._charAt(cursor);\n            { gotoCase = 20; continue; };\n/* *********************************** */\ncase this.case_INITIAL:\n            yych = this._charAt(cursor);\n            if (yych <= ';') {\n                if (yych <= '\\'') {\n                    if (yych <= '\"') {\n                        if (yych <= ' ') { gotoCase = 29; continue; };\n                        if (yych <= '!') { gotoCase = 31; continue; };\n                        { gotoCase = 33; continue; };\n                    } else {\n                        if (yych == '$') { gotoCase = 31; continue; };\n                        if (yych >= '\\'') { gotoCase = 34; continue; };\n                    }\n                } else {\n                    if (yych <= '.') {\n                        if (yych <= ',') { gotoCase = 29; continue; };\n                        if (yych <= '-') { gotoCase = 35; continue; };\n                        { gotoCase = 36; continue; };\n                    } else {\n                        if (yych <= '/') { gotoCase = 37; continue; };\n                        if (yych <= '9') { gotoCase = 38; continue; };\n                        if (yych <= ':') { gotoCase = 40; continue; };\n                        { gotoCase = 42; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '^') {\n                    if (yych <= '?') {\n                        if (yych == '=') { gotoCase = 31; continue; };\n                    } else {\n                        if (yych == '\\\\') { gotoCase = 29; continue; };\n                        if (yych <= ']') { gotoCase = 31; continue; };\n                    }\n                } else {\n                    if (yych <= 'z') {\n                        if (yych != '`') { gotoCase = 31; continue; };\n                    } else {\n                        if (yych <= '{') { gotoCase = 44; continue; };\n                        if (yych == '}') { gotoCase = 46; continue; };\n                    }\n                }\n            }\ncase 29:\n            ++cursor;\ncase 30:\n            { this.tokenType = null; return cursor; }\ncase 31:\n            ++cursor;\n            yych = this._charAt(cursor);\n            { gotoCase = 49; continue; };\ncase 32:\n            {\n                    var token = this._line.substring(cursorOnEnter, cursor);\n                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {\n                        if (token === \"@import\" || token === \"@media\") {\n                            this.tokenType = \"css-at-rule\";\n                            this._condition.parseCondition = this._parseConditions.AT_RULE;\n                        } else if (token.indexOf(\"@\") === 0)\n                            this.tokenType = \"css-at-rule\";\n                        else\n                            this.tokenType = \"css-selector\";\n                    }\n                    else if (this._condition.parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)\n                        this.tokenType = \"css-keyword\";\n                    else if (this._condition.parseCondition === this._parseConditions.PROPERTY && token in this._propertyKeywords)\n                        this.tokenType = \"css-property\";\n                    else if (this._isPropertyValue() && token in this._valueKeywords)\n                        this.tokenType = \"css-keyword\";\n                    else if (token === \"!important\")\n                        this.tokenType = \"css-important\";\n                    else\n                        this.tokenType = null;\n                    return cursor;\n                }\ncase 33:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '-') {\n                if (yych <= '!') {\n                    if (yych <= '\\f') {\n                        if (yych == '\\n') { gotoCase = 32; continue; };\n                        { gotoCase = 124; continue; };\n                    } else {\n                        if (yych <= '\\r') { gotoCase = 32; continue; };\n                        if (yych <= ' ') { gotoCase = 124; continue; };\n                        { gotoCase = 122; continue; };\n                    }\n                } else {\n                    if (yych <= '$') {\n                        if (yych <= '\"') { gotoCase = 114; continue; };\n                        if (yych <= '#') { gotoCase = 124; continue; };\n                        { gotoCase = 122; continue; };\n                    } else {\n                        if (yych == '\\'') { gotoCase = 122; continue; };\n                        if (yych <= ',') { gotoCase = 124; continue; };\n                        { gotoCase = 122; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych <= '<') {\n                        if (yych <= '.') { gotoCase = 124; continue; };\n                        if (yych <= '9') { gotoCase = 122; continue; };\n                        { gotoCase = 124; continue; };\n                    } else {\n                        if (yych <= '=') { gotoCase = 122; continue; };\n                        if (yych <= '?') { gotoCase = 124; continue; };\n                        { gotoCase = 122; continue; };\n                    }\n                } else {\n                    if (yych <= '^') {\n                        if (yych <= '\\\\') { gotoCase = 126; continue; };\n                        if (yych <= ']') { gotoCase = 122; continue; };\n                        { gotoCase = 124; continue; };\n                    } else {\n                        if (yych == '`') { gotoCase = 124; continue; };\n                        if (yych <= 'z') { gotoCase = 122; continue; };\n                        { gotoCase = 124; continue; };\n                    }\n                }\n            }\ncase 34:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '-') {\n                if (yych <= '\"') {\n                    if (yych <= '\\f') {\n                        if (yych == '\\n') { gotoCase = 32; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych <= '\\r') { gotoCase = 32; continue; };\n                        if (yych <= ' ') { gotoCase = 116; continue; };\n                        { gotoCase = 112; continue; };\n                    }\n                } else {\n                    if (yych <= '&') {\n                        if (yych == '$') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych <= '\\'') { gotoCase = 114; continue; };\n                        if (yych <= ',') { gotoCase = 116; continue; };\n                        { gotoCase = 112; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych <= '<') {\n                        if (yych <= '.') { gotoCase = 116; continue; };\n                        if (yych <= '9') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych <= '=') { gotoCase = 112; continue; };\n                        if (yych <= '?') { gotoCase = 116; continue; };\n                        { gotoCase = 112; continue; };\n                    }\n                } else {\n                    if (yych <= '^') {\n                        if (yych <= '\\\\') { gotoCase = 118; continue; };\n                        if (yych <= ']') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych == '`') { gotoCase = 116; continue; };\n                        if (yych <= 'z') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    }\n                }\n            }\ncase 35:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '.') { gotoCase = 65; continue; };\n            if (yych <= '/') { gotoCase = 49; continue; };\n            if (yych <= '9') { gotoCase = 50; continue; };\n            { gotoCase = 49; continue; };\ncase 36:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 30; continue; };\n            if (yych <= '9') { gotoCase = 68; continue; };\n            { gotoCase = 30; continue; };\ncase 37:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '*') { gotoCase = 104; continue; };\n            { gotoCase = 49; continue; };\ncase 38:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            switch (yych) {\n            case '!':\n            case '\"':\n            case '$':\n            case '\\'':\n            case '-':\n            case '/':\n            case '=':\n            case '@':\n            case 'A':\n            case 'B':\n            case 'C':\n            case 'D':\n            case 'E':\n            case 'F':\n            case 'G':\n            case 'I':\n            case 'J':\n            case 'K':\n            case 'L':\n            case 'M':\n            case 'N':\n            case 'O':\n            case 'P':\n            case 'Q':\n            case 'R':\n            case 'S':\n            case 'T':\n            case 'U':\n            case 'V':\n            case 'W':\n            case 'X':\n            case 'Y':\n            case 'Z':\n            case '[':\n            case ']':\n            case 'a':\n            case 'b':\n            case 'f':\n            case 'h':\n            case 'j':\n            case 'l':\n            case 'n':\n            case 'o':\n            case 'q':\n            case 'u':\n            case 'v':\n            case 'w':\n            case 'x':\n            case 'y':\n            case 'z':    { gotoCase = 48; continue; };\n            case '%':    { gotoCase = 67; continue; };\n            case '.':    { gotoCase = 65; continue; };\n            case '0':\n            case '1':\n            case '2':\n            case '3':\n            case '4':\n            case '5':\n            case '6':\n            case '7':\n            case '8':\n            case '9':    { gotoCase = 50; continue; };\n            case 'H':    { gotoCase = 52; continue; };\n            case '_':    { gotoCase = 53; continue; };\n            case 'c':    { gotoCase = 54; continue; };\n            case 'd':    { gotoCase = 55; continue; };\n            case 'e':    { gotoCase = 56; continue; };\n            case 'g':    { gotoCase = 57; continue; };\n            case 'i':    { gotoCase = 58; continue; };\n            case 'k':    { gotoCase = 59; continue; };\n            case 'm':    { gotoCase = 60; continue; };\n            case 'p':    { gotoCase = 61; continue; };\n            case 'r':    { gotoCase = 62; continue; };\n            case 's':    { gotoCase = 63; continue; };\n            case 't':    { gotoCase = 64; continue; };\n            default:    { gotoCase = 39; continue; };\n            }\ncase 39:\n            {\n                    if (this._isPropertyValue())\n                        this.tokenType = \"css-number\";\n                    else\n                        this.tokenType = null;\n                    return cursor;\n                }\ncase 40:\n            ++cursor;\n            {\n                    this.tokenType = null;\n                    if (this._condition.parseCondition === this._parseConditions.PROPERTY)\n                        this._condition.parseCondition = this._parseConditions.PROPERTY_VALUE;\n                    return cursor;\n                }\ncase 42:\n            ++cursor;\n            {\n                    this.tokenType = null;\n                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)\n                        this._condition.parseCondition = this._parseConditions.INITIAL;\n                    else\n                        this._condition.parseCondition = this._parseConditions.PROPERTY;\n                    return cursor;\n                }\ncase 44:\n            ++cursor;\n            {\n                    this.tokenType = null;\n                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)\n                        this._condition.parseCondition = this._parseConditions.INITIAL;\n                    else\n                        this._condition.parseCondition = this._parseConditions.PROPERTY;\n                    return cursor;\n                }\ncase 46:\n            ++cursor;\n            {\n                    this.tokenType = null;\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\ncase 48:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 49:\n            if (yych <= '9') {\n                if (yych <= '&') {\n                    if (yych <= '\"') {\n                        if (yych <= ' ') { gotoCase = 32; continue; };\n                        { gotoCase = 48; continue; };\n                    } else {\n                        if (yych == '$') { gotoCase = 48; continue; };\n                        { gotoCase = 32; continue; };\n                    }\n                } else {\n                    if (yych <= ',') {\n                        if (yych <= '\\'') { gotoCase = 48; continue; };\n                        { gotoCase = 32; continue; };\n                    } else {\n                        if (yych == '.') { gotoCase = 32; continue; };\n                        { gotoCase = 48; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '\\\\') {\n                    if (yych <= '=') {\n                        if (yych <= '<') { gotoCase = 32; continue; };\n                        { gotoCase = 48; continue; };\n                    } else {\n                        if (yych <= '?') { gotoCase = 32; continue; };\n                        if (yych <= '[') { gotoCase = 48; continue; };\n                        { gotoCase = 32; continue; };\n                    }\n                } else {\n                    if (yych <= '_') {\n                        if (yych == '^') { gotoCase = 32; continue; };\n                        { gotoCase = 48; continue; };\n                    } else {\n                        if (yych <= '`') { gotoCase = 32; continue; };\n                        if (yych <= 'z') { gotoCase = 48; continue; };\n                        { gotoCase = 32; continue; };\n                    }\n                }\n            }\ncase 50:\n            yyaccept = 1;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            switch (yych) {\n            case '!':\n            case '\"':\n            case '$':\n            case '\\'':\n            case '-':\n            case '/':\n            case '=':\n            case '@':\n            case 'A':\n            case 'B':\n            case 'C':\n            case 'D':\n            case 'E':\n            case 'F':\n            case 'G':\n            case 'I':\n            case 'J':\n            case 'K':\n            case 'L':\n            case 'M':\n            case 'N':\n            case 'O':\n            case 'P':\n            case 'Q':\n            case 'R':\n            case 'S':\n            case 'T':\n            case 'U':\n            case 'V':\n            case 'W':\n            case 'X':\n            case 'Y':\n            case 'Z':\n            case '[':\n            case ']':\n            case 'a':\n            case 'b':\n            case 'f':\n            case 'h':\n            case 'j':\n            case 'l':\n            case 'n':\n            case 'o':\n            case 'q':\n            case 'u':\n            case 'v':\n            case 'w':\n            case 'x':\n            case 'y':\n            case 'z':    { gotoCase = 48; continue; };\n            case '%':    { gotoCase = 67; continue; };\n            case '.':    { gotoCase = 65; continue; };\n            case '0':\n            case '1':\n            case '2':\n            case '3':\n            case '4':\n            case '5':\n            case '6':\n            case '7':\n            case '8':\n            case '9':    { gotoCase = 50; continue; };\n            case 'H':    { gotoCase = 52; continue; };\n            case '_':    { gotoCase = 53; continue; };\n            case 'c':    { gotoCase = 54; continue; };\n            case 'd':    { gotoCase = 55; continue; };\n            case 'e':    { gotoCase = 56; continue; };\n            case 'g':    { gotoCase = 57; continue; };\n            case 'i':    { gotoCase = 58; continue; };\n            case 'k':    { gotoCase = 59; continue; };\n            case 'm':    { gotoCase = 60; continue; };\n            case 'p':    { gotoCase = 61; continue; };\n            case 'r':    { gotoCase = 62; continue; };\n            case 's':    { gotoCase = 63; continue; };\n            case 't':    { gotoCase = 64; continue; };\n            default:    { gotoCase = 39; continue; };\n            }\ncase 52:\n            yych = this._charAt(++cursor);\n            if (yych == 'z') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 53:\n            yych = this._charAt(++cursor);\n            if (yych == '_') { gotoCase = 101; continue; };\n            { gotoCase = 49; continue; };\ncase 54:\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 55:\n            yych = this._charAt(++cursor);\n            if (yych == 'e') { gotoCase = 100; continue; };\n            { gotoCase = 49; continue; };\ncase 56:\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 63; continue; };\n            if (yych == 'x') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 57:\n            yych = this._charAt(++cursor);\n            if (yych == 'r') { gotoCase = 98; continue; };\n            { gotoCase = 49; continue; };\ncase 58:\n            yych = this._charAt(++cursor);\n            if (yych == 'n') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 59:\n            yych = this._charAt(++cursor);\n            if (yych == 'H') { gotoCase = 97; continue; };\n            { gotoCase = 49; continue; };\ncase 60:\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 63; continue; };\n            if (yych == 's') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 61:\n            yych = this._charAt(++cursor);\n            if (yych <= 's') {\n                if (yych == 'c') { gotoCase = 63; continue; };\n                { gotoCase = 49; continue; };\n            } else {\n                if (yych <= 't') { gotoCase = 63; continue; };\n                if (yych == 'x') { gotoCase = 63; continue; };\n                { gotoCase = 49; continue; };\n            }\ncase 62:\n            yych = this._charAt(++cursor);\n            if (yych == 'a') { gotoCase = 95; continue; };\n            if (yych == 'e') { gotoCase = 96; continue; };\n            { gotoCase = 49; continue; };\ncase 63:\n            yych = this._charAt(++cursor);\n            if (yych <= '9') {\n                if (yych <= '&') {\n                    if (yych <= '\"') {\n                        if (yych <= ' ') { gotoCase = 39; continue; };\n                        { gotoCase = 48; continue; };\n                    } else {\n                        if (yych == '$') { gotoCase = 48; continue; };\n                        { gotoCase = 39; continue; };\n                    }\n                } else {\n                    if (yych <= ',') {\n                        if (yych <= '\\'') { gotoCase = 48; continue; };\n                        { gotoCase = 39; continue; };\n                    } else {\n                        if (yych == '.') { gotoCase = 39; continue; };\n                        { gotoCase = 48; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '\\\\') {\n                    if (yych <= '=') {\n                        if (yych <= '<') { gotoCase = 39; continue; };\n                        { gotoCase = 48; continue; };\n                    } else {\n                        if (yych <= '?') { gotoCase = 39; continue; };\n                        if (yych <= '[') { gotoCase = 48; continue; };\n                        { gotoCase = 39; continue; };\n                    }\n                } else {\n                    if (yych <= '_') {\n                        if (yych == '^') { gotoCase = 39; continue; };\n                        { gotoCase = 48; continue; };\n                    } else {\n                        if (yych <= '`') { gotoCase = 39; continue; };\n                        if (yych <= 'z') { gotoCase = 48; continue; };\n                        { gotoCase = 39; continue; };\n                    }\n                }\n            }\ncase 64:\n            yych = this._charAt(++cursor);\n            if (yych == 'u') { gotoCase = 93; continue; };\n            { gotoCase = 49; continue; };\ncase 65:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 66; continue; };\n            if (yych <= '9') { gotoCase = 68; continue; };\ncase 66:\n            cursor = YYMARKER;\n            if (yyaccept <= 0) {\n                { gotoCase = 32; continue; };\n            } else {\n                { gotoCase = 39; continue; };\n            }\ncase 67:\n            yych = this._charAt(++cursor);\n            { gotoCase = 39; continue; };\ncase 68:\n            yyaccept = 1;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'f') {\n                if (yych <= 'H') {\n                    if (yych <= '/') {\n                        if (yych == '%') { gotoCase = 67; continue; };\n                        { gotoCase = 39; continue; };\n                    } else {\n                        if (yych <= '9') { gotoCase = 68; continue; };\n                        if (yych <= 'G') { gotoCase = 39; continue; };\n                        { gotoCase = 80; continue; };\n                    }\n                } else {\n                    if (yych <= 'b') {\n                        if (yych == '_') { gotoCase = 72; continue; };\n                        { gotoCase = 39; continue; };\n                    } else {\n                        if (yych <= 'c') { gotoCase = 74; continue; };\n                        if (yych <= 'd') { gotoCase = 77; continue; };\n                        if (yych >= 'f') { gotoCase = 39; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'm') {\n                    if (yych <= 'i') {\n                        if (yych <= 'g') { gotoCase = 78; continue; };\n                        if (yych <= 'h') { gotoCase = 39; continue; };\n                        { gotoCase = 76; continue; };\n                    } else {\n                        if (yych == 'k') { gotoCase = 81; continue; };\n                        if (yych <= 'l') { gotoCase = 39; continue; };\n                        { gotoCase = 75; continue; };\n                    }\n                } else {\n                    if (yych <= 'q') {\n                        if (yych == 'p') { gotoCase = 73; continue; };\n                        { gotoCase = 39; continue; };\n                    } else {\n                        if (yych <= 'r') { gotoCase = 71; continue; };\n                        if (yych <= 's') { gotoCase = 67; continue; };\n                        if (yych <= 't') { gotoCase = 79; continue; };\n                        { gotoCase = 39; continue; };\n                    }\n                }\n            }\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 67; continue; };\n            if (yych == 'x') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 71:\n            yych = this._charAt(++cursor);\n            if (yych == 'a') { gotoCase = 91; continue; };\n            if (yych == 'e') { gotoCase = 92; continue; };\n            { gotoCase = 66; continue; };\ncase 72:\n            yych = this._charAt(++cursor);\n            if (yych == '_') { gotoCase = 88; continue; };\n            { gotoCase = 66; continue; };\ncase 73:\n            yych = this._charAt(++cursor);\n            if (yych <= 's') {\n                if (yych == 'c') { gotoCase = 67; continue; };\n                { gotoCase = 66; continue; };\n            } else {\n                if (yych <= 't') { gotoCase = 67; continue; };\n                if (yych == 'x') { gotoCase = 67; continue; };\n                { gotoCase = 66; continue; };\n            }\ncase 74:\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 75:\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 67; continue; };\n            if (yych == 's') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 76:\n            yych = this._charAt(++cursor);\n            if (yych == 'n') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 77:\n            yych = this._charAt(++cursor);\n            if (yych == 'e') { gotoCase = 87; continue; };\n            { gotoCase = 66; continue; };\ncase 78:\n            yych = this._charAt(++cursor);\n            if (yych == 'r') { gotoCase = 85; continue; };\n            { gotoCase = 66; continue; };\ncase 79:\n            yych = this._charAt(++cursor);\n            if (yych == 'u') { gotoCase = 83; continue; };\n            { gotoCase = 66; continue; };\ncase 80:\n            yych = this._charAt(++cursor);\n            if (yych == 'z') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 81:\n            yych = this._charAt(++cursor);\n            if (yych != 'H') { gotoCase = 66; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == 'z') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 83:\n            yych = this._charAt(++cursor);\n            if (yych != 'r') { gotoCase = 66; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == 'n') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 85:\n            yych = this._charAt(++cursor);\n            if (yych != 'a') { gotoCase = 66; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == 'd') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 87:\n            yych = this._charAt(++cursor);\n            if (yych == 'g') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 88:\n            yych = this._charAt(++cursor);\n            if (yych != 'q') { gotoCase = 66; continue; };\n            yych = this._charAt(++cursor);\n            if (yych != 'e') { gotoCase = 66; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 91:\n            yych = this._charAt(++cursor);\n            if (yych == 'd') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 92:\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 67; continue; };\n            { gotoCase = 66; continue; };\ncase 93:\n            yych = this._charAt(++cursor);\n            if (yych != 'r') { gotoCase = 49; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == 'n') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 95:\n            yych = this._charAt(++cursor);\n            if (yych == 'd') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 96:\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 97:\n            yych = this._charAt(++cursor);\n            if (yych == 'z') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 98:\n            yych = this._charAt(++cursor);\n            if (yych != 'a') { gotoCase = 49; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == 'd') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 100:\n            yych = this._charAt(++cursor);\n            if (yych == 'g') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 101:\n            yych = this._charAt(++cursor);\n            if (yych != 'q') { gotoCase = 49; continue; };\n            yych = this._charAt(++cursor);\n            if (yych != 'e') { gotoCase = 49; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == 'm') { gotoCase = 63; continue; };\n            { gotoCase = 49; continue; };\ncase 104:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 108; continue; };\n                { gotoCase = 104; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 108; continue; };\n                if (yych != '*') { gotoCase = 104; continue; };\n            }\ncase 106:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '*') { gotoCase = 106; continue; };\n            if (yych == '/') { gotoCase = 110; continue; };\n            { gotoCase = 104; continue; };\ncase 108:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.COMMENT);\n            { this.tokenType = \"css-comment\"; return cursor; }\ncase 110:\n            ++cursor;\n            { this.tokenType = \"css-comment\"; return cursor; }\ncase 112:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '-') {\n                if (yych <= '\"') {\n                    if (yych <= '\\f') {\n                        if (yych == '\\n') { gotoCase = 32; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych <= '\\r') { gotoCase = 32; continue; };\n                        if (yych <= ' ') { gotoCase = 116; continue; };\n                        { gotoCase = 112; continue; };\n                    }\n                } else {\n                    if (yych <= '&') {\n                        if (yych == '$') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych <= '\\'') { gotoCase = 114; continue; };\n                        if (yych <= ',') { gotoCase = 116; continue; };\n                        { gotoCase = 112; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych <= '<') {\n                        if (yych <= '.') { gotoCase = 116; continue; };\n                        if (yych <= '9') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych <= '=') { gotoCase = 112; continue; };\n                        if (yych <= '?') { gotoCase = 116; continue; };\n                        { gotoCase = 112; continue; };\n                    }\n                } else {\n                    if (yych <= '^') {\n                        if (yych <= '\\\\') { gotoCase = 118; continue; };\n                        if (yych <= ']') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych == '`') { gotoCase = 116; continue; };\n                        if (yych <= 'z') { gotoCase = 112; continue; };\n                        { gotoCase = 116; continue; };\n                    }\n                }\n            }\ncase 114:\n            ++cursor;\n            if ((yych = this._charAt(cursor)) <= '9') {\n                if (yych <= '&') {\n                    if (yych <= '\"') {\n                        if (yych >= '!') { gotoCase = 48; continue; };\n                    } else {\n                        if (yych == '$') { gotoCase = 48; continue; };\n                    }\n                } else {\n                    if (yych <= ',') {\n                        if (yych <= '\\'') { gotoCase = 48; continue; };\n                    } else {\n                        if (yych != '.') { gotoCase = 48; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '\\\\') {\n                    if (yych <= '=') {\n                        if (yych >= '=') { gotoCase = 48; continue; };\n                    } else {\n                        if (yych <= '?') { gotoCase = 115; continue; };\n                        if (yych <= '[') { gotoCase = 48; continue; };\n                    }\n                } else {\n                    if (yych <= '_') {\n                        if (yych != '^') { gotoCase = 48; continue; };\n                    } else {\n                        if (yych <= '`') { gotoCase = 115; continue; };\n                        if (yych <= 'z') { gotoCase = 48; continue; };\n                    }\n                }\n            }\ncase 115:\n            { return this._stringToken(cursor, true); }\ncase 116:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 66; continue; };\n                if (yych <= '\\f') { gotoCase = 116; continue; };\n                { gotoCase = 66; continue; };\n            } else {\n                if (yych <= '\\'') {\n                    if (yych <= '&') { gotoCase = 116; continue; };\n                    { gotoCase = 121; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 116; continue; };\n                }\n            }\ncase 118:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'a') {\n                if (yych <= '!') {\n                    if (yych <= '\\n') {\n                        if (yych <= '\\t') { gotoCase = 66; continue; };\n                    } else {\n                        if (yych != '\\r') { gotoCase = 66; continue; };\n                    }\n                } else {\n                    if (yych <= '\\'') {\n                        if (yych <= '\"') { gotoCase = 116; continue; };\n                        if (yych <= '&') { gotoCase = 66; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych == '\\\\') { gotoCase = 116; continue; };\n                        { gotoCase = 66; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'q') {\n                    if (yych <= 'f') {\n                        if (yych <= 'b') { gotoCase = 116; continue; };\n                        if (yych <= 'e') { gotoCase = 66; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych == 'n') { gotoCase = 116; continue; };\n                        { gotoCase = 66; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych == 's') { gotoCase = 66; continue; };\n                        { gotoCase = 116; continue; };\n                    } else {\n                        if (yych == 'v') { gotoCase = 116; continue; };\n                        { gotoCase = 66; continue; };\n                    }\n                }\n            }\n            ++cursor;\n            this.setLexCondition(this._lexConditions.SSTRING);\n            { return this._stringToken(cursor); }\ncase 121:\n            yych = this._charAt(++cursor);\n            { gotoCase = 115; continue; };\ncase 122:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '-') {\n                if (yych <= '!') {\n                    if (yych <= '\\f') {\n                        if (yych == '\\n') { gotoCase = 32; continue; };\n                    } else {\n                        if (yych <= '\\r') { gotoCase = 32; continue; };\n                        if (yych >= '!') { gotoCase = 122; continue; };\n                    }\n                } else {\n                    if (yych <= '$') {\n                        if (yych <= '\"') { gotoCase = 114; continue; };\n                        if (yych >= '$') { gotoCase = 122; continue; };\n                    } else {\n                        if (yych == '\\'') { gotoCase = 122; continue; };\n                        if (yych >= '-') { gotoCase = 122; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych <= '<') {\n                        if (yych <= '.') { gotoCase = 124; continue; };\n                        if (yych <= '9') { gotoCase = 122; continue; };\n                    } else {\n                        if (yych <= '=') { gotoCase = 122; continue; };\n                        if (yych >= '@') { gotoCase = 122; continue; };\n                    }\n                } else {\n                    if (yych <= '^') {\n                        if (yych <= '\\\\') { gotoCase = 126; continue; };\n                        if (yych <= ']') { gotoCase = 122; continue; };\n                    } else {\n                        if (yych == '`') { gotoCase = 124; continue; };\n                        if (yych <= 'z') { gotoCase = 122; continue; };\n                    }\n                }\n            }\ncase 124:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 66; continue; };\n                if (yych <= '\\f') { gotoCase = 124; continue; };\n                { gotoCase = 66; continue; };\n            } else {\n                if (yych <= '\"') {\n                    if (yych <= '!') { gotoCase = 124; continue; };\n                    { gotoCase = 121; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 124; continue; };\n                }\n            }\ncase 126:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'a') {\n                if (yych <= '!') {\n                    if (yych <= '\\n') {\n                        if (yych <= '\\t') { gotoCase = 66; continue; };\n                    } else {\n                        if (yych != '\\r') { gotoCase = 66; continue; };\n                    }\n                } else {\n                    if (yych <= '\\'') {\n                        if (yych <= '\"') { gotoCase = 124; continue; };\n                        if (yych <= '&') { gotoCase = 66; continue; };\n                        { gotoCase = 124; continue; };\n                    } else {\n                        if (yych == '\\\\') { gotoCase = 124; continue; };\n                        { gotoCase = 66; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'q') {\n                    if (yych <= 'f') {\n                        if (yych <= 'b') { gotoCase = 124; continue; };\n                        if (yych <= 'e') { gotoCase = 66; continue; };\n                        { gotoCase = 124; continue; };\n                    } else {\n                        if (yych == 'n') { gotoCase = 124; continue; };\n                        { gotoCase = 66; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych == 's') { gotoCase = 66; continue; };\n                        { gotoCase = 124; continue; };\n                    } else {\n                        if (yych == 'v') { gotoCase = 124; continue; };\n                        { gotoCase = 66; continue; };\n                    }\n                }\n            }\n            ++cursor;\n            this.setLexCondition(this._lexConditions.DSTRING);\n            { return this._stringToken(cursor); }\n/* *********************************** */\ncase this.case_SSTRING:\n            yych = this._charAt(cursor);\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 133; continue; };\n                if (yych <= '\\f') { gotoCase = 132; continue; };\n                { gotoCase = 133; continue; };\n            } else {\n                if (yych <= '\\'') {\n                    if (yych <= '&') { gotoCase = 132; continue; };\n                    { gotoCase = 135; continue; };\n                } else {\n                    if (yych == '\\\\') { gotoCase = 137; continue; };\n                    { gotoCase = 132; continue; };\n                }\n            }\ncase 131:\n            { return this._stringToken(cursor); }\ncase 132:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 139; continue; };\ncase 133:\n            ++cursor;\ncase 134:\n            { this.tokenType = null; return cursor; }\ncase 135:\n            ++cursor;\ncase 136:\n            this.setLexCondition(this._lexConditions.INITIAL);\n            { return this._stringToken(cursor, true); }\ncase 137:\n            yych = this._charAt(++cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 138; continue; };\n                    if (yych <= '&') { gotoCase = 134; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych <= '[') { gotoCase = 134; continue; };\n                    } else {\n                        if (yych != 'b') { gotoCase = 134; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych >= 'g') { gotoCase = 134; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 138; continue; };\n                        if (yych <= 'q') { gotoCase = 134; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych <= 's') { gotoCase = 134; continue; };\n                    } else {\n                        if (yych != 'v') { gotoCase = 134; continue; };\n                    }\n                }\n            }\ncase 138:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 139:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 131; continue; };\n                if (yych <= '\\f') { gotoCase = 138; continue; };\n                { gotoCase = 131; continue; };\n            } else {\n                if (yych <= '\\'') {\n                    if (yych <= '&') { gotoCase = 138; continue; };\n                    { gotoCase = 142; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 138; continue; };\n                }\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 138; continue; };\n                    if (yych >= '\\'') { gotoCase = 138; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych >= '\\\\') { gotoCase = 138; continue; };\n                    } else {\n                        if (yych == 'b') { gotoCase = 138; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych <= 'f') { gotoCase = 138; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 138; continue; };\n                        if (yych >= 'r') { gotoCase = 138; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych >= 't') { gotoCase = 138; continue; };\n                    } else {\n                        if (yych == 'v') { gotoCase = 138; continue; };\n                    }\n                }\n            }\n            cursor = YYMARKER;\n            { gotoCase = 131; continue; };\ncase 142:\n            ++cursor;\n            yych = this._charAt(cursor);\n            { gotoCase = 136; continue; };\n        }\n\n        }\n    }\n}\n\nWebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceCSSTokenizer.re2js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Generate js file as follows:\n//\n// re2c -isc WebCore/inspector/front-end/SourceCSSTokenizer.re2js \\\n// | sed 's|^yy\\([^:]*\\)*\\:|case \\1:|' \\\n// | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \\\n// | sed 's|[[*][+][+]cursor|this._charAt(++cursor)|' \\\n// | sed 's|[*]cursor|this._charAt(cursor)|' \\\n// | sed 's|yych = \\*\\([^;]*\\)|yych = this._charAt\\1|' \\\n// | sed 's|goto case \\([^;]*\\)|{ gotoCase = \\1; continue; }|' \\\n// | sed 's|unsigned\\ int|var|' \\\n// | sed 's|var\\ yych|case 1: var yych|'\n\nWebInspector.SourceCSSTokenizer = function()\n{\n    WebInspector.SourceTokenizer.call(this);\n\n    this._propertyKeywords = WebInspector.cssNameCompletions.keySet();\n\n    this._valueKeywords = [\n        \"above\", \"absolute\", \"activeborder\", \"activecaption\", \"afar\", \"after-white-space\", \"ahead\", \"alias\", \"all\", \"all-scroll\",\n        \"alternate\", \"always\",\"amharic\", \"amharic-abegede\", \"antialiased\", \"appworkspace\", \"aqua\", \"arabic-indic\", \"armenian\", \"asterisks\",\n        \"auto\", \"avoid\", \"background\", \"backwards\", \"baseline\", \"below\", \"bidi-override\", \"binary\", \"bengali\", \"black\", \"blink\",\n        \"block\", \"block-axis\", \"blue\", \"bold\", \"bolder\", \"border\", \"border-box\", \"both\", \"bottom\", \"break-all\", \"break-word\", \"button\",\n        \"button-bevel\", \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"cambodian\", \"capitalize\", \"caps-lock-indicator\",\n        \"caption\", \"captiontext\", \"caret\", \"cell\", \"center\", \"checkbox\", \"circle\", \"cjk-earthly-branch\", \"cjk-heavenly-stem\", \"cjk-ideographic\",\n        \"clear\", \"clip\", \"close-quote\", \"col-resize\", \"collapse\", \"compact\", \"condensed\", \"contain\", \"content\", \"content-box\", \"context-menu\",\n        \"continuous\", \"copy\", \"cover\", \"crop\", \"cross\", \"crosshair\", \"currentcolor\", \"cursive\", \"dashed\", \"decimal\", \"decimal-leading-zero\", \"default\",\n        \"default-button\", \"destination-atop\", \"destination-in\", \"destination-out\", \"destination-over\", \"devanagari\", \"disc\", \"discard\", \"document\",\n        \"dot-dash\", \"dot-dot-dash\", \"dotted\", \"double\", \"down\", \"e-resize\", \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\", \"element\",\n        \"ellipsis\", \"embed\", \"end\", \"ethiopic\", \"ethiopic-abegede\", \"ethiopic-abegede-am-et\", \"ethiopic-abegede-gez\",\n        \"ethiopic-abegede-ti-er\", \"ethiopic-abegede-ti-et\", \"ethiopic-halehame-aa-er\", \"ethiopic-halehame-aa-et\",\n        \"ethiopic-halehame-am-et\", \"ethiopic-halehame-gez\", \"ethiopic-halehame-om-et\", \"ethiopic-halehame-sid-et\",\n        \"ethiopic-halehame-so-et\", \"ethiopic-halehame-ti-er\", \"ethiopic-halehame-ti-et\", \"ethiopic-halehame-tig\", \"ew-resize\", \"expanded\",\n        \"extra-condensed\", \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fixed\", \"flat\", \"footnotes\", \"forwards\", \"from\", \"fuchsia\", \"geometricPrecision\",\n        \"georgian\", \"gray\", \"graytext\", \"green\", \"grey\", \"groove\", \"gujarati\", \"gurmukhi\", \"hand\", \"hangul\", \"hangul-consonant\", \"hebrew\", \"help\",\n        \"hidden\", \"hide\", \"higher\", \"highlight\", \"highlighttext\", \"hiragana\", \"hiragana-iroha\", \"horizontal\", \"hsl\", \"hsla\", \"icon\", \"ignore\",\n        \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\", \"infobackground\", \"infotext\", \"inherit\", \"initial\", \"inline\",\n        \"inline-axis\", \"inline-block\", \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\", \"italic\", \"justify\", \"kannada\", \"katakana\",\n        \"katakana-iroha\", \"khmer\", \"landscape\", \"lao\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lime\", \"line-through\", \"linear\", \"lines\",\n        \"list-button\", \"list-item\", \"listbox\", \"listitem\", \"local\", \"logical\", \"loud\", \"lower\", \"lower-alpha\", \"lower-armenian\", \"lower-greek\",\n        \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\", \"lower-roman\", \"lowercase\", \"ltr\", \"malayalam\", \"maroon\", \"match\", \"media-controls-background\",\n        \"media-current-time-display\", \"media-fullscreen-button\", \"media-mute-button\", \"media-play-button\", \"media-return-to-realtime-button\",\n        \"media-rewind-button\", \"media-seek-back-button\", \"media-seek-forward-button\", \"media-slider\", \"media-sliderthumb\", \"media-time-remaining-display\",\n        \"media-volume-slider\", \"media-volume-slider-container\", \"media-volume-sliderthumb\", \"medium\", \"menu\", \"menulist\", \"menulist-button\",\n        \"menulist-text\", \"menulist-textfield\", \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\", \"mix\", \"mongolian\", \"monospace\", \"move\", \"multiple\",\n        \"myanmar\", \"n-resize\", \"narrower\", \"navy\", \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\", \"no-open-quote\", \"no-repeat\", \"none\",\n        \"normal\", \"not-allowed\", \"nowrap\", \"ns-resize\", \"nw-resize\", \"nwse-resize\", \"oblique\", \"octal\", \"olive\", \"open-quote\", \"optimizeLegibility\",\n        \"optimizeSpeed\", \"orange\", \"oriya\", \"oromo\", \"outset\", \"outside\", \"overlay\", \"overline\", \"padding\", \"padding-box\", \"painted\", \"paused\",\n        \"persian\", \"plus-darker\", \"plus-lighter\", \"pointer\", \"portrait\", \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\", \"progress\", \"purple\",\n        \"push-button\", \"radio\", \"read-only\", \"read-write\", \"read-write-plaintext-only\", \"red\", \"relative\", \"repeat\", \"repeat-x\",\n        \"repeat-y\", \"reset\", \"reverse\", \"rgb\", \"rgba\", \"ridge\", \"right\", \"round\", \"row-resize\", \"rtl\", \"run-in\", \"running\", \"s-resize\", \"sans-serif\",\n        \"scroll\", \"scrollbar\", \"se-resize\", \"searchfield\", \"searchfield-cancel-button\", \"searchfield-decoration\", \"searchfield-results-button\",\n        \"searchfield-results-decoration\", \"semi-condensed\", \"semi-expanded\", \"separate\", \"serif\", \"show\", \"sidama\", \"silver\", \"single\",\n        \"skip-white-space\", \"slide\", \"slider-horizontal\", \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\",\n        \"small\", \"small-caps\", \"small-caption\", \"smaller\", \"solid\", \"somali\", \"source-atop\", \"source-in\", \"source-out\", \"source-over\",\n        \"space\", \"square\", \"square-button\", \"start\", \"static\", \"status-bar\", \"stretch\", \"stroke\", \"sub\", \"subpixel-antialiased\", \"super\",\n        \"sw-resize\", \"table\", \"table-caption\", \"table-cell\", \"table-column\", \"table-column-group\", \"table-footer-group\", \"table-header-group\",\n        \"table-row\", \"table-row-group\", \"teal\", \"telugu\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thai\", \"thick\", \"thin\",\n        \"threeddarkshadow\", \"threedface\", \"threedhighlight\", \"threedlightshadow\", \"threedshadow\", \"tibetan\", \"tigre\", \"tigrinya-er\", \"tigrinya-er-abegede\",\n        \"tigrinya-et\", \"tigrinya-et-abegede\", \"to\", \"top\", \"transparent\", \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"up\", \"upper-alpha\", \"upper-armenian\",\n        \"upper-greek\", \"upper-hexadecimal\", \"upper-latin\", \"upper-norwegian\", \"upper-roman\", \"uppercase\", \"urdu\", \"url\", \"vertical\", \"vertical-text\", \"visible\",\n        \"visibleFill\", \"visiblePainted\", \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"white\", \"wider\", \"window\", \"windowframe\", \"windowtext\",\n        \"x-large\", \"x-small\", \"xor\", \"xx-large\", \"xx-small\", \"yellow\", \"-wap-marquee\", \"-webkit-activelink\", \"-webkit-auto\", \"-webkit-baseline-middle\",\n        \"-webkit-body\", \"-webkit-box\", \"-webkit-center\", \"-webkit-control\", \"-webkit-focus-ring-color\", \"-webkit-grab\", \"-webkit-grabbing\",\n        \"-webkit-gradient\", \"-webkit-inline-box\", \"-webkit-left\", \"-webkit-link\", \"-webkit-marquee\", \"-webkit-mini-control\", \"-webkit-nowrap\", \"-webkit-right\",\n        \"-webkit-small-control\", \"-webkit-text\", \"-webkit-xxx-large\", \"-webkit-zoom-in\", \"-webkit-zoom-out\",\n    ].keySet();\n\n    this._mediaTypes = [\"all\", \"aural\", \"braille\", \"embossed\", \"handheld\", \"import\", \"print\", \"projection\", \"screen\", \"tty\", \"tv\"].keySet();\n\n    this._lexConditions = {\n        INITIAL: 0,\n        COMMENT: 1,\n        DSTRING: 2,\n        SSTRING: 3\n    };\n\n    this._parseConditions = {\n        INITIAL: 0,\n        PROPERTY: 1,\n        PROPERTY_VALUE: 2,\n        AT_RULE: 3\n    };\n\n    this.case_INITIAL = 1000;\n    this.case_COMMENT = 1002;\n    this.case_DSTRING = 1003;\n    this.case_SSTRING = 1004;\n\n    this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL }\n}\n\nWebInspector.SourceCSSTokenizer.prototype = {\n    _stringToken: function(cursor, stringEnds)\n    {\n        if (this._isPropertyValue())\n            this.tokenType = \"css-string\";\n        else\n            this.tokenType = null;\n        return cursor;\n    },\n\n    _isPropertyValue: function()\n    {\n        return this._condition.parseCondition === this._parseConditions.PROPERTY_VALUE || this._condition.parseCondition === this._parseConditions.AT_RULE;\n    },\n\n    nextToken: function(cursor)\n    {\n        var cursorOnEnter = cursor;\n        var gotoCase = 1;\n        while (1) {\n            switch (gotoCase)\n            // Following comment is replaced with generated state machine.\n            /*!re2c\n                re2c:define:YYCTYPE  = \"var\";\n                re2c:define:YYCURSOR = cursor;\n                re2c:define:YYGETCONDITION = \"this.getLexCondition\";\n                re2c:define:YYSETCONDITION = \"this.setLexCondition\";\n                re2c:condprefix = \"case this.case_\";\n                re2c:condenumprefix = \"this._lexConditions.\";\n                re2c:yyfill:enable = 0;\n                re2c:labelprefix = \"case \";\n                re2c:indent:top = 2;\n                re2c:indent:string = \"    \";\n\n                CommentContent = ([^*\\r\\n] | (\"*\"+[^/*]))*;\n                Comment = \"/*\" CommentContent \"*\"+ \"/\";\n                CommentStart = \"/*\" CommentContent [\\r\\n];\n                CommentEnd = CommentContent \"*\"+ \"/\";\n\n                OpenCurlyBracket = \"{\";\n                CloseCurlyBracket = \"}\";\n\n                Colon = \":\";\n                Semicolon = \";\";\n\n                NumericLiteral = \"-\"? ([0-9]+ | [0-9]* \".\" [0-9]+)  (\"em\" | \"rem\" | \"__qem\" | \"ex\" | \"px\" | \"cm\" | \n                    \"mm\" | \"in\" | \"pt\" | \"pc\" | \"deg\" | \"rad\" | \"grad\" | \"turn\" | \"ms\" | \"s\" | \"Hz\" | \"kHz\" | \"%\")?;\n\n                Identifier = [@!_\\-$0-9a-zA-Z\\[\\]='\"/]+;\n\n                DoubleStringContent = ([^\\r\\n\\\"\\\\] | \"\\\\\" ['\"\\\\bfnrtv])*;\n                SingleStringContent = ([^\\r\\n\\'\\\\] | \"\\\\\" ['\"\\\\bfnrtv])*;\n                StringLiteral = \"\\\"\" DoubleStringContent \"\\\"\" | \"'\" SingleStringContent \"'\";\n                DoubleStringStart = \"\\\"\" DoubleStringContent \"\\\\\" [\\r\\n];\n                DoubleStringEnd = DoubleStringContent \"\\\"\";\n                SingleStringStart = \"'\" SingleStringContent \"\\\\\" [\\r\\n];\n                SingleStringEnd = SingleStringContent \"'\";\n\n                <INITIAL> Comment { this.tokenType = \"css-comment\"; return cursor; }\n                <INITIAL> CommentStart => COMMENT { this.tokenType = \"css-comment\"; return cursor; }\n                <COMMENT> CommentContent => COMMENT { this.tokenType = \"css-comment\"; return cursor; }\n                <COMMENT> CommentEnd => INITIAL { this.tokenType = \"css-comment\"; return cursor; }\n\n                <INITIAL> StringLiteral { return this._stringToken(cursor, true); }\n                <INITIAL> DoubleStringStart => DSTRING { return this._stringToken(cursor); }\n                <DSTRING> DoubleStringContent => DSTRING { return this._stringToken(cursor); }\n                <DSTRING> DoubleStringEnd => INITIAL { return this._stringToken(cursor, true); }\n                <INITIAL> SingleStringStart => SSTRING { return this._stringToken(cursor); }\n                <SSTRING> SingleStringContent => SSTRING { return this._stringToken(cursor); }\n                <SSTRING> SingleStringEnd => INITIAL { return this._stringToken(cursor, true); }\n\n                <INITIAL> OpenCurlyBracket\n                {\n                    this.tokenType = null;\n                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)\n                        this._condition.parseCondition = this._parseConditions.INITIAL;\n                    else\n                        this._condition.parseCondition = this._parseConditions.PROPERTY;\n                    return cursor;\n                }\n\n                <INITIAL> CloseCurlyBracket\n                {\n                    this.tokenType = null;\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\n\n                <INITIAL> Colon\n                {\n                    this.tokenType = null;\n                    if (this._condition.parseCondition === this._parseConditions.PROPERTY)\n                        this._condition.parseCondition = this._parseConditions.PROPERTY_VALUE;\n                    return cursor;\n                }\n\n                <INITIAL> Semicolon\n                {\n                    this.tokenType = null;\n                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)\n                        this._condition.parseCondition = this._parseConditions.INITIAL;\n                    else\n                        this._condition.parseCondition = this._parseConditions.PROPERTY;\n                    return cursor;\n                }\n\n                <INITIAL> NumericLiteral\n                {\n                    if (this._isPropertyValue())\n                        this.tokenType = \"css-number\";\n                    else\n                        this.tokenType = null;\n                    return cursor;\n                }\n\n                <INITIAL> Identifier\n                {\n                    var token = this._line.substring(cursorOnEnter, cursor);\n                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {\n                        if (token === \"@import\" || token === \"@media\") {\n                            this.tokenType = \"css-at-rule\";\n                            this._condition.parseCondition = this._parseConditions.AT_RULE;\n                        } else if (token.indexOf(\"@\") === 0)\n                            this.tokenType = \"css-at-rule\";\n                        else\n                            this.tokenType = \"css-selector\";\n                    }\n                    else if (this._condition.parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)\n                        this.tokenType = \"css-keyword\";\n                    else if (this._condition.parseCondition === this._parseConditions.PROPERTY && token in this._propertyKeywords)\n                        this.tokenType = \"css-property\";\n                    else if (this._isPropertyValue() && token in this._valueKeywords)\n                        this.tokenType = \"css-keyword\";\n                    else if (token === \"!important\")\n                        this.tokenType = \"css-important\";\n                    else\n                        this.tokenType = null;\n                    return cursor;\n                }\n                <*> [^] { this.tokenType = null; return cursor; }\n            */\n        }\n    }\n}\n\nWebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceFrame.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.SourceFrame = function(contentProvider, url, isScript)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"script-view\");\n\n    this._contentProvider = contentProvider;\n    this._url = url;\n    this._isScript = isScript;\n\n    this._textModel = new WebInspector.TextEditorModel();\n    this._textModel.replaceTabsWithSpaces = true;\n\n    this._currentSearchResultIndex = -1;\n    this._searchResults = [];\n\n    this._messages = [];\n    this._rowMessages = {};\n    this._messageBubbles = {};\n\n    this._popoverObjectGroup = \"popover\";\n}\n\nWebInspector.SourceFrame.prototype = {\n\n    show: function(parentElement)\n    {\n        WebInspector.View.prototype.show.call(this, parentElement);\n\n        if (!this._contentRequested) {\n            this._contentRequested = true;\n            this._contentProvider.requestContent(this._createTextViewer.bind(this));\n        }\n\n        if (this._textViewer) {\n            if (this._scrollTop)\n                this._textViewer.scrollTop = this._scrollTop;\n            if (this._scrollLeft)\n                this._textViewer.scrollLeft = this._scrollLeft;\n            this._textViewer.resize();\n        }\n    },\n\n    hide: function()\n    {\n        if (this._textViewer) {\n            this._scrollTop = this._textViewer.scrollTop;\n            this._scrollLeft = this._textViewer.scrollLeft;\n            this._textViewer.freeCachedElements();\n        }\n\n        WebInspector.View.prototype.hide.call(this);\n\n        this._hidePopup();\n        this._clearLineHighlight();\n    },\n\n    hasContent: function()\n    {\n        return true;\n    },\n\n    markDiff: function(diffData)\n    {\n        if (this._diffLines && this._textViewer)\n            this._removeDiffDecorations();\n\n        this._diffLines = diffData;\n        if (this._textViewer)\n            this._updateDiffDecorations();\n    },\n\n    revealLine: function(lineNumber)\n    {\n        if (this._textViewer)\n            this._textViewer.revealLine(lineNumber - 1, 0);\n        else\n            this._lineNumberToReveal = lineNumber;\n    },\n\n    addMessage: function(msg)\n    {\n        // Don't add the message if there is no message or valid line or if the msg isn't an error or warning.\n        if (!msg.message || msg.line <= 0 || !msg.isErrorOrWarning())\n            return;\n        this._messages.push(msg);\n        if (this._textViewer)\n            this._addMessageToSource(msg);\n    },\n\n    clearMessages: function()\n    {\n        for (var line in this._messageBubbles) {\n            var bubble = this._messageBubbles[line];\n            bubble.parentNode.removeChild(bubble);\n        }\n\n        this._messages = [];\n        this._rowMessages = {};\n        this._messageBubbles = {};\n        if (this._textViewer)\n            this._textViewer.resize();\n    },\n\n    sizeToFitContentHeight: function()\n    {\n        if (this._textViewer)\n            this._textViewer.revalidateDecorationsAndPaint();\n    },\n\n    get textModel()\n    {\n        return this._textModel;\n    },\n\n    get scrollTop()\n    {\n        return this._textViewer ? this._textViewer.scrollTop : this._scrollTop;\n    },\n\n    set scrollTop(scrollTop)\n    {\n        this._scrollTop = scrollTop;\n        if (this._textViewer)\n            this._textViewer.scrollTop = scrollTop;\n    },\n\n    highlightLine: function(line)\n    {\n        if (this._textViewer)\n            this._textViewer.highlightLine(line - 1);\n        else\n            this._lineToHighlight = line;\n    },\n\n    _clearLineHighlight: function()\n    {\n        if (this._textViewer)\n            this._textViewer.clearLineHighlight();\n        else\n            delete this._lineToHighlight;\n    },\n\n    _createTextViewer: function(mimeType, content)\n    {\n        this._content = content;\n        this._textModel.setText(null, content.text);\n\n        this._textViewer = new WebInspector.TextViewer(this._textModel, WebInspector.platform, this._url);\n        var element = this._textViewer.element;\n        element.addEventListener(\"contextmenu\", this._contextMenu.bind(this), true);\n        element.addEventListener(\"mousedown\", this._mouseDown.bind(this), true);\n        element.addEventListener(\"mousemove\", this._mouseMove.bind(this), true);\n        element.addEventListener(\"scroll\", this._scroll.bind(this), true);\n        element.addEventListener(\"dblclick\", this._doubleClick.bind(this), true);\n        this.element.appendChild(element);\n\n        this._textViewer.beginUpdates();\n\n        this._textViewer.mimeType = mimeType;\n        this._setTextViewerDecorations();\n\n        if (this._lineNumberToReveal) {\n            this.revealLine(this._lineNumberToReveal);\n            delete this._lineNumberToReveal;\n        }\n\n        if (this._lineToHighlight) {\n            this.highlightLine(this._lineToHighlight);\n            delete this._lineToHighlight;\n        }\n\n        if (this._delayedFindSearchMatches) {\n            this._delayedFindSearchMatches();\n            delete this._delayedFindSearchMatches;\n        }\n\n        this._textViewer.endUpdates();\n\n        WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointAdded, this._breakpointAdded, this);\n        WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointRemoved, this._breakpointRemoved, this);\n        WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointResolved, this._breakpointResolved, this);\n    },\n\n    _setTextViewerDecorations: function()\n    {\n        this._rowMessages = {};\n        this._messageBubbles = {};\n\n        this._textViewer.beginUpdates();\n\n        this._addExistingMessagesToSource();\n        this._updateDiffDecorations();\n\n        if (this._executionLocation)\n            this._setExecutionLocation();\n\n        this._breakpointIdToTextViewerLineNumber = {};\n        this._textViewerLineNumberToBreakpointId = {};\n        var breakpoints = WebInspector.debuggerModel.breakpoints;\n        for (var id in breakpoints)\n            this._breakpointAdded({ data: breakpoints[id] });\n\n        this._textViewer.resize();\n\n        this._textViewer.endUpdates();\n    },\n\n    _shouldDisplayBreakpoint: function(breakpoint)\n    {\n        if (this._url)\n            return this._url === breakpoint.url;\n        var scripts = this._content.scriptRanges;\n        for (var i = 0; i < scripts.length; ++i) {\n            if (breakpoint.sourceID === scripts[i].sourceID)\n                return true;\n        }\n        return false;\n    },\n\n    performSearch: function(query, callback)\n    {\n        // Call searchCanceled since it will reset everything we need before doing a new search.\n        this.searchCanceled();\n\n        function doFindSearchMatches(query)\n        {\n            this._currentSearchResultIndex = -1;\n            this._searchResults = [];\n\n            // First do case-insensitive search.\n            var regexObject = createSearchRegex(query);\n            this._collectRegexMatches(regexObject, this._searchResults);\n\n            // Then try regex search if user knows the / / hint.\n            try {\n                if (/^\\/.*\\/$/.test(query))\n                    this._collectRegexMatches(new RegExp(query.substring(1, query.length - 1)), this._searchResults);\n            } catch (e) {\n                // Silent catch.\n            }\n\n            callback(this, this._searchResults.length);\n        }\n\n        if (this._textViewer)\n            doFindSearchMatches.call(this, query);\n        else\n            this._delayedFindSearchMatches = doFindSearchMatches.bind(this, query);\n\n    },\n\n    searchCanceled: function()\n    {\n        delete this._delayedFindSearchMatches;\n        if (!this._textViewer)\n            return;\n\n        this._currentSearchResultIndex = -1;\n        this._searchResults = [];\n        this._textViewer.markAndRevealRange(null);\n    },\n\n    jumpToFirstSearchResult: function()\n    {\n        this._jumpToSearchResult(0);\n    },\n\n    jumpToLastSearchResult: function()\n    {\n        this._jumpToSearchResult(this._searchResults.length - 1);\n    },\n\n    jumpToNextSearchResult: function()\n    {\n        this._jumpToSearchResult(this._currentSearchResultIndex + 1);\n    },\n\n    jumpToPreviousSearchResult: function()\n    {\n        this._jumpToSearchResult(this._currentSearchResultIndex - 1);\n    },\n\n    showingFirstSearchResult: function()\n    {\n        return this._searchResults.length &&  this._currentSearchResultIndex === 0;\n    },\n\n    showingLastSearchResult: function()\n    {\n        return this._searchResults.length && this._currentSearchResultIndex === (this._searchResults.length - 1);\n    },\n\n    _jumpToSearchResult: function(index)\n    {\n        if (!this._textViewer || !this._searchResults.length)\n            return;\n        this._currentSearchResultIndex = (index + this._searchResults.length) % this._searchResults.length;\n        this._textViewer.markAndRevealRange(this._searchResults[this._currentSearchResultIndex]);\n    },\n\n    _collectRegexMatches: function(regexObject, ranges)\n    {\n        for (var i = 0; i < this._textModel.linesCount; ++i) {\n            var line = this._textModel.line(i);\n            var offset = 0;\n            do {\n                var match = regexObject.exec(line);\n                if (match) {\n                    ranges.push(new WebInspector.TextRange(i, offset + match.index, i, offset + match.index + match[0].length));\n                    offset += match.index + 1;\n                    line = line.substring(match.index + 1);\n                }\n            } while (match)\n        }\n        return ranges;\n    },\n\n    _incrementMessageRepeatCount: function(msg, repeatDelta)\n    {\n        if (!msg._resourceMessageLineElement)\n            return;\n\n        if (!msg._resourceMessageRepeatCountElement) {\n            var repeatedElement = document.createElement(\"span\");\n            msg._resourceMessageLineElement.appendChild(repeatedElement);\n            msg._resourceMessageRepeatCountElement = repeatedElement;\n        }\n\n        msg.repeatCount += repeatDelta;\n        msg._resourceMessageRepeatCountElement.textContent = WebInspector.UIString(\" (repeated %d times)\", msg.repeatCount);\n    },\n\n    setExecutionLocation: function(lineNumber, columnNumber)\n    {\n        this._executionLocation = { lineNumber: lineNumber, columnNumber: columnNumber };\n        if (this._textViewer)\n            this._setExecutionLocation();\n    },\n\n    clearExecutionLocation: function()\n    {\n        if (this._textViewer) {\n            var textViewerLineNumber = this._content.actualLocationToSourceFrameLineNumber(this._executionLocation.lineNumber, this._executionLocation.columnNumber);\n            this._textViewer.removeDecoration(textViewerLineNumber, \"webkit-execution-line\");\n        }\n        delete this._executionLocation;\n    },\n\n    _setExecutionLocation: function()\n    {\n        var textViewerLineNumber = this._content.actualLocationToSourceFrameLineNumber(this._executionLocation.lineNumber, this._executionLocation.columnNumber);\n        this._textViewer.addDecoration(textViewerLineNumber, \"webkit-execution-line\");\n    },\n\n    _updateDiffDecorations: function()\n    {\n        if (!this._diffLines)\n            return;\n\n        function addDecorations(textViewer, lines, className)\n        {\n            for (var i = 0; i < lines.length; ++i)\n                textViewer.addDecoration(lines[i], className);\n        }\n        addDecorations(this._textViewer, this._diffLines.added, \"webkit-added-line\");\n        addDecorations(this._textViewer, this._diffLines.removed, \"webkit-removed-line\");\n        addDecorations(this._textViewer, this._diffLines.changed, \"webkit-changed-line\");\n    },\n\n    _removeDiffDecorations: function()\n    {\n        function removeDecorations(textViewer, lines, className)\n        {\n            for (var i = 0; i < lines.length; ++i)\n                textViewer.removeDecoration(lines[i], className);\n        }\n        removeDecorations(this._textViewer, this._diffLines.added, \"webkit-added-line\");\n        removeDecorations(this._textViewer, this._diffLines.removed, \"webkit-removed-line\");\n        removeDecorations(this._textViewer, this._diffLines.changed, \"webkit-changed-line\");\n    },\n\n    _addExistingMessagesToSource: function()\n    {\n        var length = this._messages.length;\n        for (var i = 0; i < length; ++i)\n            this._addMessageToSource(this._messages[i]);\n    },\n\n    _addMessageToSource: function(msg)\n    {\n        if (msg.line > this._textModel.linesCount)\n            return;\n\n        var messageBubbleElement = this._messageBubbles[msg.line];\n        if (!messageBubbleElement || messageBubbleElement.nodeType !== Node.ELEMENT_NODE || !messageBubbleElement.hasStyleClass(\"webkit-html-message-bubble\")) {\n            messageBubbleElement = document.createElement(\"div\");\n            messageBubbleElement.className = \"webkit-html-message-bubble\";\n            this._messageBubbles[msg.line] = messageBubbleElement;\n            this._textViewer.addDecoration(msg.line - 1, messageBubbleElement);\n        }\n\n        var rowMessages = this._rowMessages[msg.line];\n        if (!rowMessages) {\n            rowMessages = [];\n            this._rowMessages[msg.line] = rowMessages;\n        }\n\n        for (var i = 0; i < rowMessages.length; ++i) {\n            if (rowMessages[i].isEqual(msg)) {\n                this._incrementMessageRepeatCount(rowMessages[i], msg.repeatDelta);\n                return;\n            }\n        }\n\n        rowMessages.push(msg);\n\n        var imageURL;\n        switch (msg.level) {\n            case WebInspector.ConsoleMessage.MessageLevel.Error:\n                messageBubbleElement.addStyleClass(\"webkit-html-error-message\");\n                imageURL = \"Images/errorIcon.png\";\n                break;\n            case WebInspector.ConsoleMessage.MessageLevel.Warning:\n                messageBubbleElement.addStyleClass(\"webkit-html-warning-message\");\n                imageURL = \"Images/warningIcon.png\";\n                break;\n        }\n\n        var messageLineElement = document.createElement(\"div\");\n        messageLineElement.className = \"webkit-html-message-line\";\n        messageBubbleElement.appendChild(messageLineElement);\n\n        // Create the image element in the Inspector's document so we can use relative image URLs.\n        var image = document.createElement(\"img\");\n        image.src = imageURL;\n        image.className = \"webkit-html-message-icon\";\n        messageLineElement.appendChild(image);\n        messageLineElement.appendChild(document.createTextNode(msg.message));\n\n        msg._resourceMessageLineElement = messageLineElement;\n    },\n\n    _breakpointAdded: function(event)\n    {\n        var breakpoint = event.data;\n\n        if (!this._shouldDisplayBreakpoint(breakpoint))\n            return;\n\n        var resolved = breakpoint.locations.length;\n        var location = resolved ? breakpoint.locations[0] : breakpoint;\n\n        var textViewerLineNumber = this._content.actualLocationToSourceFrameLineNumber(location.lineNumber, location.columnNumber);\n        if (textViewerLineNumber >= this._textModel.linesCount)\n            return;\n\n        var existingBreakpointId = this._textViewerLineNumberToBreakpointId[textViewerLineNumber];\n        if (existingBreakpointId) {\n            WebInspector.debuggerModel.removeBreakpoint(breakpoint.id);\n            return;\n        }\n\n        this._breakpointIdToTextViewerLineNumber[breakpoint.id] = textViewerLineNumber;\n        this._textViewerLineNumberToBreakpointId[textViewerLineNumber] = breakpoint.id;\n        this._setBreakpointDecoration(textViewerLineNumber, resolved, breakpoint.enabled, !!breakpoint.condition);\n    },\n\n    _breakpointRemoved: function(event)\n    {\n        var breakpointId = event.data;\n\n        var textViewerLineNumber = this._breakpointIdToTextViewerLineNumber[breakpointId];\n        if (textViewerLineNumber === undefined)\n            return;\n\n        delete this._breakpointIdToTextViewerLineNumber[breakpointId];\n        delete this._textViewerLineNumberToBreakpointId[textViewerLineNumber];\n        this._removeBreakpointDecoration(textViewerLineNumber);\n    },\n\n    _breakpointResolved: function(event)\n    {\n        var breakpoint = event.data;\n        this._breakpointRemoved({ data: breakpoint.id });\n        this._breakpointAdded({ data: breakpoint });\n    },\n\n    _setBreakpointDecoration: function(lineNumber, resolved, enabled, hasCondition)\n    {\n        this._textViewer.beginUpdates();\n        this._textViewer.addDecoration(lineNumber, \"webkit-breakpoint\");\n        if (!enabled)\n            this._textViewer.addDecoration(lineNumber, \"webkit-breakpoint-disabled\");\n        if (hasCondition)\n            this._textViewer.addDecoration(lineNumber, \"webkit-breakpoint-conditional\");\n        this._textViewer.endUpdates();\n    },\n\n    _removeBreakpointDecoration: function(lineNumber)\n    {\n        this._textViewer.beginUpdates();\n        this._textViewer.removeDecoration(lineNumber, \"webkit-breakpoint\");\n        this._textViewer.removeDecoration(lineNumber, \"webkit-breakpoint-disabled\");\n        this._textViewer.removeDecoration(lineNumber, \"webkit-breakpoint-conditional\");\n        this._textViewer.endUpdates();\n    },\n\n    _contextMenu: function(event)\n    {\n        if (!WebInspector.panels.scripts)\n            return;\n\n        var target = event.target.enclosingNodeOrSelfWithClass(\"webkit-line-number\");\n        if (!target)\n            return;\n        var textViewerLineNumber = target.lineNumber;\n\n        var contextMenu = new WebInspector.ContextMenu();\n\n        contextMenu.appendItem(WebInspector.UIString(\"Continue to Here\"), this._continueToLine.bind(this, textViewerLineNumber));\n\n        var breakpoint = this._findBreakpoint(textViewerLineNumber);\n        if (!breakpoint) {\n            // This row doesn't have a breakpoint: We want to show Add Breakpoint and Add and Edit Breakpoint.\n            contextMenu.appendItem(WebInspector.UIString(\"Add Breakpoint\"), this._setBreakpoint.bind(this, textViewerLineNumber, \"\", true));\n\n            function addConditionalBreakpoint()\n            {\n                this._setBreakpointDecoration(textViewerLineNumber, true, true, true);\n                function didEditBreakpointCondition(committed, condition)\n                {\n                    this._removeBreakpointDecoration(textViewerLineNumber);\n                    if (committed)\n                        this._setBreakpoint(textViewerLineNumber, condition, true);\n                }\n                this._editBreakpointCondition(textViewerLineNumber, \"\", didEditBreakpointCondition.bind(this));\n            }\n            contextMenu.appendItem(WebInspector.UIString(\"Add Conditional Breakpoint…\"), addConditionalBreakpoint.bind(this));\n        } else {\n            // This row has a breakpoint, we want to show edit and remove breakpoint, and either disable or enable.\n            function removeBreakpoint()\n            {\n                WebInspector.debuggerModel.removeBreakpoint(breakpoint.id);\n            }\n            contextMenu.appendItem(WebInspector.UIString(\"Remove Breakpoint\"), removeBreakpoint);\n            function editBreakpointCondition()\n            {\n                function didEditBreakpointCondition(committed, condition)\n                {\n                    if (committed)\n                        WebInspector.debuggerModel.updateBreakpoint(breakpoint.id, condition, breakpoint.enabled);\n                }\n                this._editBreakpointCondition(textViewerLineNumber, breakpoint.condition, didEditBreakpointCondition.bind(this));\n            }\n            contextMenu.appendItem(WebInspector.UIString(\"Edit Breakpoint…\"), editBreakpointCondition.bind(this));\n            function setBreakpointEnabled(enabled)\n            {\n                WebInspector.debuggerModel.updateBreakpoint(breakpoint.id, breakpoint.condition, enabled);\n            }\n            if (breakpoint.enabled)\n                contextMenu.appendItem(WebInspector.UIString(\"Disable Breakpoint\"), setBreakpointEnabled.bind(this, false));\n            else\n                contextMenu.appendItem(WebInspector.UIString(\"Enable Breakpoint\"), setBreakpointEnabled.bind(this, true));\n        }\n        contextMenu.show(event);\n    },\n\n    _scroll: function(event)\n    {\n        this._hidePopup();\n    },\n\n    _mouseDown: function(event)\n    {\n        this._resetHoverTimer();\n        this._hidePopup();\n        if (event.button != 0 || event.altKey || event.ctrlKey || event.metaKey)\n            return;\n        var target = event.target.enclosingNodeOrSelfWithClass(\"webkit-line-number\");\n        if (!target)\n            return;\n        var textViewerLineNumber = target.lineNumber;\n\n        var breakpoint = this._findBreakpoint(textViewerLineNumber);\n        if (breakpoint) {\n            if (event.shiftKey)\n                WebInspector.debuggerModel.updateBreakpoint(breakpoint.id, breakpoint.condition, !breakpoint.enabled);\n            else\n                WebInspector.debuggerModel.removeBreakpoint(breakpoint.id);\n        } else\n            this._setBreakpoint(textViewerLineNumber, \"\", true);\n        event.preventDefault();\n    },\n\n    _mouseMove: function(event)\n    {\n        // Pretend that nothing has happened.\n        if (this._hoverElement === event.target || event.target.hasStyleClass(\"source-frame-eval-expression\"))\n            return;\n\n        this._resetHoverTimer();\n        // User has 500ms to reach the popup.\n        if (this._popup) {\n            var self = this;\n            function doHide()\n            {\n                self._hidePopup();\n                delete self._hidePopupTimer;\n            }\n            if (!(\"_hidePopupTimer\" in this))\n                this._hidePopupTimer = setTimeout(doHide, 500);\n        }\n\n        this._hoverElement = event.target;\n\n        // Now that cleanup routines are set up above, leave this in case we are not on a break.\n        if (!WebInspector.panels.scripts || !WebInspector.panels.scripts.paused)\n            return;\n\n        // We are interested in identifiers and \"this\" keyword.\n        if (this._hoverElement.hasStyleClass(\"webkit-javascript-keyword\")) {\n            if (this._hoverElement.textContent !== \"this\")\n                return;\n        } else if (!this._hoverElement.hasStyleClass(\"webkit-javascript-ident\"))\n            return;\n\n        var toolTipDelay = this._popup ? 600 : 1000;\n        this._hoverTimer = setTimeout(this._mouseHover.bind(this, this._hoverElement), toolTipDelay);\n    },\n\n    _resetHoverTimer: function()\n    {\n        if (this._hoverTimer) {\n            clearTimeout(this._hoverTimer);\n            delete this._hoverTimer;\n        }\n    },\n\n    _hidePopup: function()\n    {\n        if (!this._popup)\n            return;\n\n        // Replace higlight element with its contents inplace.\n        var parentElement = this._popup.highlightElement.parentElement;\n        var child = this._popup.highlightElement.firstChild;\n        while (child) {\n            var nextSibling = child.nextSibling;\n            parentElement.insertBefore(child, this._popup.highlightElement);\n            child = nextSibling;\n        }\n        parentElement.removeChild(this._popup.highlightElement);\n\n        this._popup.hide();\n        delete this._popup;\n        InspectorBackend.releaseWrapperObjectGroup(0, this._popoverObjectGroup);\n    },\n\n    _mouseHover: function(element)\n    {\n        delete this._hoverTimer;\n\n        if (!WebInspector.panels.scripts || !WebInspector.panels.scripts.paused)\n            return;\n\n        var lineRow = element.enclosingNodeOrSelfWithClass(\"webkit-line-content\");\n        if (!lineRow)\n            return;\n\n        // Collect tokens belonging to evaluated exression.\n        var tokens = [ element ];\n        var token = element.previousSibling;\n        while (token && (token.className === \"webkit-javascript-ident\" || token.className === \"webkit-javascript-keyword\" || token.textContent.trim() === \".\")) {\n            tokens.push(token);\n            token = token.previousSibling;\n        }\n        tokens.reverse();\n\n        // Wrap them with highlight element.\n        var parentElement = element.parentElement;\n        var nextElement = element.nextSibling;\n        var container = document.createElement(\"span\");\n        for (var i = 0; i < tokens.length; ++i)\n            container.appendChild(tokens[i]);\n        parentElement.insertBefore(container, nextElement);\n        this._showPopup(container);\n    },\n\n    _showPopup: function(element)\n    {\n        function killHidePopupTimer()\n        {\n            if (this._hidePopupTimer) {\n                clearTimeout(this._hidePopupTimer);\n                delete this._hidePopupTimer;\n\n                // We know that we reached the popup, but we might have moved over other elements.\n                // Discard pending command.\n                this._resetHoverTimer();\n            }\n        }\n\n        function showObjectPopup(result)\n        {\n            if (!WebInspector.panels.scripts.paused)\n                return;\n\n            var popupContentElement = null;\n            if (result.type !== \"object\" && result.type !== \"node\" && result.type !== \"array\") {\n                popupContentElement = document.createElement(\"span\");\n                popupContentElement.className = \"monospace console-formatted-\" + result.type;\n                popupContentElement.style.whiteSpace = \"pre\";\n                popupContentElement.textContent = result.description;\n                if (result.type === \"string\")\n                    popupContentElement.textContent = \"\\\"\" + popupContentElement.textContent + \"\\\"\";\n                this._popup = new WebInspector.Popover(popupContentElement);\n                this._popup.show(element);\n            } else {\n                var popupContentElement = document.createElement(\"div\");\n\n                var titleElement = document.createElement(\"div\");\n                titleElement.className = \"source-frame-popover-title monospace\";\n                titleElement.textContent = result.description;\n                popupContentElement.appendChild(titleElement);\n\n                var section = new WebInspector.ObjectPropertiesSection(result, \"\", null, false);\n                section.expanded = true;\n                section.element.addStyleClass(\"source-frame-popover-tree\");\n                section.headerElement.addStyleClass(\"hidden\");\n                popupContentElement.appendChild(section.element);\n\n                this._popup = new WebInspector.Popover(popupContentElement);\n                var popupWidth = 300;\n                var popupHeight = 250;\n                this._popup.show(element, popupWidth, popupHeight);\n            }\n            this._popup.highlightElement = element;\n            this._popup.highlightElement.addStyleClass(\"source-frame-eval-expression\");\n            popupContentElement.addEventListener(\"mousemove\", killHidePopupTimer.bind(this), true);\n        }\n\n        function evaluateCallback(result)\n        {\n            if (result.isError())\n                return;\n            if (!WebInspector.panels.scripts.paused)\n                return;\n            showObjectPopup.call(this, result);\n        }\n        WebInspector.panels.scripts.evaluateInSelectedCallFrame(element.textContent, false, this._popoverObjectGroup, false, evaluateCallback.bind(this));\n    },\n\n    _editBreakpointCondition: function(lineNumber, condition, callback)\n    {\n        this._conditionElement = this._createConditionElement(lineNumber);\n        this._textViewer.addDecoration(lineNumber, this._conditionElement);\n\n        function finishEditing(committed, element, newText)\n        {\n            this._textViewer.removeDecoration(lineNumber, this._conditionElement);\n            delete this._conditionEditorElement;\n            delete this._conditionElement;\n            callback(committed, newText);\n        }\n\n        WebInspector.startEditing(this._conditionEditorElement, {\n            context: null,\n            commitHandler: finishEditing.bind(this, true),\n            cancelHandler: finishEditing.bind(this, false)\n        });\n        this._conditionEditorElement.value = condition;\n        this._conditionEditorElement.select();\n    },\n\n    _createConditionElement: function(lineNumber)\n    {\n        var conditionElement = document.createElement(\"div\");\n        conditionElement.className = \"source-frame-breakpoint-condition\";\n\n        var labelElement = document.createElement(\"label\");\n        labelElement.className = \"source-frame-breakpoint-message\";\n        labelElement.htmlFor = \"source-frame-breakpoint-condition\";\n        labelElement.appendChild(document.createTextNode(WebInspector.UIString(\"The breakpoint on line %d will stop only if this expression is true:\", lineNumber)));\n        conditionElement.appendChild(labelElement);\n\n        var editorElement = document.createElement(\"input\");\n        editorElement.id = \"source-frame-breakpoint-condition\";\n        editorElement.className = \"monospace\";\n        editorElement.type = \"text\";\n        conditionElement.appendChild(editorElement);\n        this._conditionEditorElement = editorElement;\n\n        return conditionElement;\n    },\n\n    _evalSelectionInCallFrame: function(event)\n    {\n        if (!WebInspector.panels.scripts || !WebInspector.panels.scripts.paused)\n            return;\n\n        var selection = this.element.contentWindow.getSelection();\n        if (!selection.rangeCount)\n            return;\n\n        var expression = selection.getRangeAt(0).toString().trim();\n        WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, \"console\", function(result) {\n            WebInspector.showConsole();\n            var commandMessage = new WebInspector.ConsoleCommand(expression);\n            WebInspector.console.addMessage(commandMessage);\n            WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));\n        });\n    },\n\n    resize: function()\n    {\n        if (this._textViewer)\n            this._textViewer.resize();\n    },\n\n    formatSource: function()\n    {\n        if (!this._content)\n            return;\n\n        function didFormat(formattedContent)\n        {\n            this._content = formattedContent;\n            this._textModel.setText(null, formattedContent.text);\n            this._setTextViewerDecorations();\n        }\n        var formatter = new WebInspector.ScriptFormatter();\n        formatter.formatContent(this._content, didFormat.bind(this))\n    },\n\n    _continueToLine: function(lineNumber)\n    {\n        var location = this._content.sourceFrameLineNumberToActualLocation(lineNumber);\n        if (location.sourceID)\n            WebInspector.debuggerModel.continueToLocation(location.sourceID, location.lineNumber, location.columnNumber);\n    },\n\n    _doubleClick: function(event)\n    {\n        if (!Preferences.canEditScriptSource || !this._isScript)\n            return;\n\n        var lineRow = event.target.enclosingNodeOrSelfWithClass(\"webkit-line-content\");\n        if (!lineRow)\n            return;  // Do not trigger editing from line numbers.\n\n        var lineNumber = lineRow.lineNumber;\n        var location = this._content.sourceFrameLineNumberToActualLocation(lineNumber);\n        if (!location.sourceID)\n            return;\n\n        function didEditLine(newContent)\n        {\n            var lines = [];\n            var oldLines = this._content.text.split('\\n');\n            for (var i = 0; i < oldLines.length; ++i) {\n                if (i === lineNumber)\n                    lines.push(newContent);\n                else\n                    lines.push(oldLines[i]);\n            }\n            WebInspector.debuggerModel.editScriptSource(location.sourceID, lines.join(\"\\n\"));\n        }\n        this._textViewer.editLine(lineRow, didEditLine.bind(this));\n    },\n\n    _setBreakpoint: function(lineNumber, condition, enabled)\n    {\n        var location = this._content.sourceFrameLineNumberToActualLocation(lineNumber);\n        if (this._url)\n            WebInspector.debuggerModel.setBreakpoint(this._url, location.lineNumber, location.columnNumber, condition, enabled);\n        else if (location.sourceID)\n            WebInspector.debuggerModel.setBreakpointBySourceId(location.sourceID, location.lineNumber, location.columnNumber, condition, enabled);\n        else\n            return;\n\n        if (!WebInspector.panels.scripts.breakpointsActivated)\n            WebInspector.panels.scripts.toggleBreakpointsClicked();\n    },\n\n    _findBreakpoint: function(textViewerLineNumber)\n    {\n        var breakpointId = this._textViewerLineNumberToBreakpointId[textViewerLineNumber];\n        return WebInspector.debuggerModel.breakpointForId(breakpointId);\n    }\n}\n\nWebInspector.SourceFrame.prototype.__proto__ = WebInspector.View.prototype;\n\n\nWebInspector.SourceFrameContentProvider = function()\n{\n}\n\nWebInspector.SourceFrameContentProvider.prototype = {\n    requestContent: function(callback)\n    {\n        // Should be implemented by subclasses.\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceFrameContent.js",
    "content": "/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.SourceFrameContent = function(text, mapping, scriptRanges)\n{\n    this._text = text;\n    this._mapping = mapping;\n    this._scriptRanges = scriptRanges;\n}\n\nWebInspector.SourceFrameContent.prototype = {\n    get text()\n    {\n        return this._text;\n    },\n\n    get scriptRanges()\n    {\n        return this._scriptRanges;\n    },\n\n    sourceFrameLineNumberToActualLocation: function(lineNumber)\n    {\n        // Script content may start right after <script> tag without new line (e.g. \"<script>function f()...\").\n        // In that case, column number should be equal to script column offset.\n        var columnNumber = 0;\n        for (var i = 0; i < this._scriptRanges.length; ++i) {\n            var scriptRange = this._scriptRanges[i];\n            if (scriptRange.start.lineNumber < lineNumber)\n                continue;\n            if (scriptRange.start.lineNumber === lineNumber)\n                columnNumber = scriptRange.start.columnNumber;\n            break;\n        }\n        var location = this._mapping.sourceLocationToActualLocation(lineNumber, columnNumber);\n        location.sourceID = this._sourceIDForSourceFrameLineNumber(lineNumber);\n        return location;\n    },\n\n    actualLocationToSourceFrameLineNumber: function(lineNumber, columnNumber)\n    {\n        return this._mapping.actualLocationToSourceLocation(lineNumber, columnNumber).lineNumber;\n    },\n\n    _sourceIDForSourceFrameLineNumber: function(lineNumber)\n    {\n        for (var i = 0; i < this._scriptRanges.length; ++i) {\n            var scriptRange = this._scriptRanges[i];\n            if (lineNumber < scriptRange.start.lineNumber)\n                return;\n            if (lineNumber > scriptRange.end.lineNumber)\n                continue;\n            if (lineNumber === scriptRange.end.lineNumber && !scriptRange.end.columnNumber)\n                continue;\n            return scriptRange.sourceID;\n        }\n    }\n}\n\n\nWebInspector.SourceMapping = function()\n{\n}\n\nWebInspector.SourceMapping.prototype = {\n    actualLocationToSourceLocation: function(lineNumber, columnNumber)\n    {\n        // Should be implemented by subclasses.\n    },\n\n    sourceLocationToActualLocation: function(lineNumber, columnNumber)\n    {\n        // Should be implemented by subclasses.\n    }\n}\n\n\nWebInspector.IdenticalSourceMapping = function()\n{\n    WebInspector.SourceMapping.call(this);\n}\n\nWebInspector.IdenticalSourceMapping.prototype = {\n    actualLocationToSourceLocation: function(lineNumber, columnNumber)\n    {\n        return { lineNumber: lineNumber, columnNumber: columnNumber};\n    },\n\n    sourceLocationToActualLocation: function(lineNumber, columnNumber)\n    {\n        return { lineNumber: lineNumber, columnNumber: columnNumber};\n    }\n}\n\nWebInspector.IdenticalSourceMapping.prototype.__proto__ = WebInspector.SourceMapping.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceHTMLTokenizer.js",
    "content": "/* Generated by re2c 0.13.5 on Fri Jan 28 18:32:27 2011 */\n/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Generate js file as follows:\n//\n// re2c -isc WebCore/inspector/front-end/SourceHTMLTokenizer.re2js \\\n// | sed 's|^yy\\([^:]*\\)*\\:|case \\1:|' \\\n// | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \\\n// | sed 's|[[*][+][+]cursor|this._charAt(++cursor)|' \\\n// | sed 's|[*]cursor|this._charAt(cursor)|' \\\n// | sed 's|yych = \\*\\([^;]*\\)|yych = this._charAt\\1|' \\\n// | sed 's|{ gotoCase = \\([^; continue; };]*\\)|{ gotoCase = \\1; continue; }|' \\\n// | sed 's|unsigned\\ int|var|' \\\n// | sed 's|var\\ yych|case 1: case 1: var yych|'\n\nWebInspector.SourceHTMLTokenizer = function()\n{\n    WebInspector.SourceTokenizer.call(this);\n\n    // The order is determined by the generated code.\n    this._lexConditions = {\n        INITIAL: 0,\n        COMMENT: 1,\n        DOCTYPE: 2,\n        TAG: 3,\n        DSTRING: 4,\n        SSTRING: 5\n    };\n    this.case_INITIAL = 1000;\n    this.case_COMMENT = 1001;\n    this.case_DOCTYPE = 1002;\n    this.case_TAG = 1003;\n    this.case_DSTRING = 1004;\n    this.case_SSTRING = 1005;\n\n    this._parseConditions = {\n        INITIAL: 0,\n        ATTRIBUTE: 1,\n        ATTRIBUTE_VALUE: 2,\n        LINKIFY: 4,\n        A_NODE: 8,\n        SCRIPT: 16,\n        STYLE: 32\n    };\n\n    this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };\n    this.condition = this.initialCondition;\n}\n\nWebInspector.SourceHTMLTokenizer.prototype = {\n    set line(line) {\n        if (this._internalJavaScriptTokenizer) {\n            var match = /<\\/script/i.exec(line);\n            if (match) {\n                this._internalJavaScriptTokenizer.line = line.substring(0, match.index);\n            } else\n                this._internalJavaScriptTokenizer.line = line;\n        } else if (this._internalCSSTokenizer) {\n            var match = /<\\/style/i.exec(line);\n            if (match) {\n                this._internalCSSTokenizer.line = line.substring(0, match.index);\n            } else\n                this._internalCSSTokenizer.line = line;\n        }\n        this._line = line;\n    },\n\n    _isExpectingAttribute: function()\n    {\n        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE;\n    },\n\n    _isExpectingAttributeValue: function()\n    {\n        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE_VALUE;\n    },\n\n    _setExpectingAttribute: function()\n    {\n        if (this._isExpectingAttributeValue())\n            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;\n        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE;\n    },\n\n    _setExpectingAttributeValue: function()\n    {\n        if (this._isExpectingAttribute())\n            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE;\n        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;\n    },\n\n    _stringToken: function(cursor, stringEnds)\n    {\n        if (!this._isExpectingAttributeValue()) {\n            this.tokenType = null;\n            return cursor;\n        }\n        this.tokenType = this._attrValueTokenType();\n        if (stringEnds)\n            this._setExpectingAttribute();\n        return cursor;\n    },\n\n    _attrValueTokenType: function()\n    {\n        if (this._condition.parseCondition & this._parseConditions.LINKIFY) {\n            if (this._condition.parseCondition & this._parseConditions.A_NODE)\n                return \"html-external-link\";\n            return \"html-resource-link\";\n        }\n        return \"html-attribute-value\";\n    },\n\n    nextToken: function(cursor)\n    {\n        if (this._internalJavaScriptTokenizer) {\n            // Re-set line to force </script> detection first.\n            this.line = this._line;\n            if (cursor !== this._internalJavaScriptTokenizer._line.length) {\n                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.\n                this._internalJavaScriptTokenizer.condition = this._condition.internalJavaScriptTokenizerCondition;\n                var result = this._internalJavaScriptTokenizer.nextToken(cursor);\n                this.tokenType = this._internalJavaScriptTokenizer.tokenType;\n                this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.condition;\n                return result;\n            } else if (cursor !== this._line.length)\n                delete this._internalJavaScriptTokenizer;\n        } else if (this._internalCSSTokenizer) {\n            // Re-set line to force </style> detection first.\n            this.line = this._line;\n            if (cursor !== this._internalCSSTokenizer._line.length) {\n                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.\n                this._internalCSSTokenizer.condition = this._condition.internalCSSTokenizerCondition;\n                var result = this._internalCSSTokenizer.nextToken(cursor);\n                this.tokenType = this._internalCSSTokenizer.tokenType;\n                this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.condition;\n                return result;\n            } else if (cursor !== this._line.length)\n                delete this._internalCSSTokenizer;\n        }\n\n        var cursorOnEnter = cursor;\n        var gotoCase = 1;\n        while (1) {\n            switch (gotoCase)\n            // Following comment is replaced with generated state machine.\n            \n        {\n            case 1: var yych;\n            var yyaccept = 0;\n            if (this.getLexCondition() < 3) {\n                if (this.getLexCondition() < 1) {\n                    { gotoCase = this.case_INITIAL; continue; };\n                } else {\n                    if (this.getLexCondition() < 2) {\n                        { gotoCase = this.case_COMMENT; continue; };\n                    } else {\n                        { gotoCase = this.case_DOCTYPE; continue; };\n                    }\n                }\n            } else {\n                if (this.getLexCondition() < 4) {\n                    { gotoCase = this.case_TAG; continue; };\n                } else {\n                    if (this.getLexCondition() < 5) {\n                        { gotoCase = this.case_DSTRING; continue; };\n                    } else {\n                        { gotoCase = this.case_SSTRING; continue; };\n                    }\n                }\n            }\n/* *********************************** */\ncase this.case_COMMENT:\n\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 4; continue; };\n                { gotoCase = 3; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 4; continue; };\n                if (yych == '-') { gotoCase = 6; continue; };\n                { gotoCase = 3; continue; };\n            }\ncase 2:\n            { this.tokenType = \"html-comment\"; return cursor; }\ncase 3:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 9; continue; };\ncase 4:\n            ++cursor;\ncase 5:\n            { this.tokenType = null; return cursor; }\ncase 6:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych != '-') { gotoCase = 5; continue; };\ncase 7:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '>') { gotoCase = 10; continue; };\ncase 8:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 9:\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 2; continue; };\n                { gotoCase = 8; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 2; continue; };\n                if (yych == '-') { gotoCase = 12; continue; };\n                { gotoCase = 8; continue; };\n            }\ncase 10:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.INITIAL);\n            { this.tokenType = \"html-comment\"; return cursor; }\ncase 12:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '-') { gotoCase = 7; continue; };\n            cursor = YYMARKER;\n            if (yyaccept <= 0) {\n                { gotoCase = 2; continue; };\n            } else {\n                { gotoCase = 5; continue; };\n            }\n/* *********************************** */\ncase this.case_DOCTYPE:\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 18; continue; };\n                { gotoCase = 17; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 18; continue; };\n                if (yych == '>') { gotoCase = 20; continue; };\n                { gotoCase = 17; continue; };\n            }\ncase 16:\n            { this.tokenType = \"html-doctype\"; return cursor; }\ncase 17:\n            yych = this._charAt(++cursor);\n            { gotoCase = 23; continue; };\ncase 18:\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 20:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.INITIAL);\n            { this.tokenType = \"html-doctype\"; return cursor; }\ncase 22:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 23:\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 16; continue; };\n                { gotoCase = 22; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 16; continue; };\n                if (yych == '>') { gotoCase = 16; continue; };\n                { gotoCase = 22; continue; };\n            }\n/* *********************************** */\ncase this.case_DSTRING:\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 28; continue; };\n                { gotoCase = 27; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 28; continue; };\n                if (yych == '\"') { gotoCase = 30; continue; };\n                { gotoCase = 27; continue; };\n            }\ncase 26:\n            { return this._stringToken(cursor); }\ncase 27:\n            yych = this._charAt(++cursor);\n            { gotoCase = 34; continue; };\ncase 28:\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 30:\n            ++cursor;\ncase 31:\n            this.setLexCondition(this._lexConditions.TAG);\n            { return this._stringToken(cursor, true); }\ncase 32:\n            yych = this._charAt(++cursor);\n            { gotoCase = 31; continue; };\ncase 33:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 34:\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 26; continue; };\n                { gotoCase = 33; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 26; continue; };\n                if (yych == '\"') { gotoCase = 32; continue; };\n                { gotoCase = 33; continue; };\n            }\n/* *********************************** */\ncase this.case_INITIAL:\n            yych = this._charAt(cursor);\n            if (yych == '<') { gotoCase = 39; continue; };\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 39:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '/') {\n                if (yych == '!') { gotoCase = 44; continue; };\n                if (yych >= '/') { gotoCase = 41; continue; };\n            } else {\n                if (yych <= 'S') {\n                    if (yych >= 'S') { gotoCase = 42; continue; };\n                } else {\n                    if (yych == 's') { gotoCase = 42; continue; };\n                }\n            }\ncase 40:\n            this.setLexCondition(this._lexConditions.TAG);\n            {\n                    if (this._condition.parseCondition & (this._parseConditions.SCRIPT | this._parseConditions.STYLE)) {\n                        // Do not tokenize script and style tag contents, keep lexer state, even though processing \"<\".\n                        this.setLexCondition(this._lexConditions.INITIAL);\n                        this.tokenType = null;\n                        return cursor;\n                    }\n\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    this.tokenType = \"html-tag\";\n                    return cursor;\n                }\ncase 41:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == 'S') { gotoCase = 73; continue; };\n            if (yych == 's') { gotoCase = 73; continue; };\n            { gotoCase = 40; continue; };\ncase 42:\n            yych = this._charAt(++cursor);\n            if (yych <= 'T') {\n                if (yych == 'C') { gotoCase = 62; continue; };\n                if (yych >= 'T') { gotoCase = 63; continue; };\n            } else {\n                if (yych <= 'c') {\n                    if (yych >= 'c') { gotoCase = 62; continue; };\n                } else {\n                    if (yych == 't') { gotoCase = 63; continue; };\n                }\n            }\ncase 43:\n            cursor = YYMARKER;\n            { gotoCase = 40; continue; };\ncase 44:\n            yych = this._charAt(++cursor);\n            if (yych <= 'C') {\n                if (yych != '-') { gotoCase = 43; continue; };\n            } else {\n                if (yych <= 'D') { gotoCase = 46; continue; };\n                if (yych == 'd') { gotoCase = 46; continue; };\n                { gotoCase = 43; continue; };\n            }\n            yych = this._charAt(++cursor);\n            if (yych == '-') { gotoCase = 54; continue; };\n            { gotoCase = 43; continue; };\ncase 46:\n            yych = this._charAt(++cursor);\n            if (yych == 'O') { gotoCase = 47; continue; };\n            if (yych != 'o') { gotoCase = 43; continue; };\ncase 47:\n            yych = this._charAt(++cursor);\n            if (yych == 'C') { gotoCase = 48; continue; };\n            if (yych != 'c') { gotoCase = 43; continue; };\ncase 48:\n            yych = this._charAt(++cursor);\n            if (yych == 'T') { gotoCase = 49; continue; };\n            if (yych != 't') { gotoCase = 43; continue; };\ncase 49:\n            yych = this._charAt(++cursor);\n            if (yych == 'Y') { gotoCase = 50; continue; };\n            if (yych != 'y') { gotoCase = 43; continue; };\ncase 50:\n            yych = this._charAt(++cursor);\n            if (yych == 'P') { gotoCase = 51; continue; };\n            if (yych != 'p') { gotoCase = 43; continue; };\ncase 51:\n            yych = this._charAt(++cursor);\n            if (yych == 'E') { gotoCase = 52; continue; };\n            if (yych != 'e') { gotoCase = 43; continue; };\ncase 52:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.DOCTYPE);\n            { this.tokenType = \"html-doctype\"; return cursor; }\ncase 54:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 57; continue; };\n                { gotoCase = 54; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 57; continue; };\n                if (yych != '-') { gotoCase = 54; continue; };\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '-') { gotoCase = 59; continue; };\n            { gotoCase = 43; continue; };\ncase 57:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.COMMENT);\n            { this.tokenType = \"html-comment\"; return cursor; }\ncase 59:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych != '>') { gotoCase = 54; continue; };\n            ++cursor;\n            { this.tokenType = \"html-comment\"; return cursor; }\ncase 62:\n            yych = this._charAt(++cursor);\n            if (yych == 'R') { gotoCase = 68; continue; };\n            if (yych == 'r') { gotoCase = 68; continue; };\n            { gotoCase = 43; continue; };\ncase 63:\n            yych = this._charAt(++cursor);\n            if (yych == 'Y') { gotoCase = 64; continue; };\n            if (yych != 'y') { gotoCase = 43; continue; };\ncase 64:\n            yych = this._charAt(++cursor);\n            if (yych == 'L') { gotoCase = 65; continue; };\n            if (yych != 'l') { gotoCase = 43; continue; };\ncase 65:\n            yych = this._charAt(++cursor);\n            if (yych == 'E') { gotoCase = 66; continue; };\n            if (yych != 'e') { gotoCase = 43; continue; };\ncase 66:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.TAG);\n            {\n                    if (this._condition.parseCondition & this._parseConditions.STYLE) {\n                        // Do not tokenize style tag contents, keep lexer state, even though processing \"<\".\n                        this.setLexCondition(this._lexConditions.INITIAL);\n                        this.tokenType = null;\n                        return cursor;\n                    }\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.STYLE;\n                    this._setExpectingAttribute();\n                    return cursor;\n                }\ncase 68:\n            yych = this._charAt(++cursor);\n            if (yych == 'I') { gotoCase = 69; continue; };\n            if (yych != 'i') { gotoCase = 43; continue; };\ncase 69:\n            yych = this._charAt(++cursor);\n            if (yych == 'P') { gotoCase = 70; continue; };\n            if (yych != 'p') { gotoCase = 43; continue; };\ncase 70:\n            yych = this._charAt(++cursor);\n            if (yych == 'T') { gotoCase = 71; continue; };\n            if (yych != 't') { gotoCase = 43; continue; };\ncase 71:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.TAG);\n            {\n                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {\n                        // Do not tokenize script tag contents, keep lexer state, even though processing \"<\".\n                        this.setLexCondition(this._lexConditions.INITIAL);\n                        this.tokenType = null;\n                        return cursor;\n                    }\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.SCRIPT;\n                    this._setExpectingAttribute();\n                    return cursor;\n                }\ncase 73:\n            yych = this._charAt(++cursor);\n            if (yych <= 'T') {\n                if (yych == 'C') { gotoCase = 75; continue; };\n                if (yych <= 'S') { gotoCase = 43; continue; };\n            } else {\n                if (yych <= 'c') {\n                    if (yych <= 'b') { gotoCase = 43; continue; };\n                    { gotoCase = 75; continue; };\n                } else {\n                    if (yych != 't') { gotoCase = 43; continue; };\n                }\n            }\n            yych = this._charAt(++cursor);\n            if (yych == 'Y') { gotoCase = 81; continue; };\n            if (yych == 'y') { gotoCase = 81; continue; };\n            { gotoCase = 43; continue; };\ncase 75:\n            yych = this._charAt(++cursor);\n            if (yych == 'R') { gotoCase = 76; continue; };\n            if (yych != 'r') { gotoCase = 43; continue; };\ncase 76:\n            yych = this._charAt(++cursor);\n            if (yych == 'I') { gotoCase = 77; continue; };\n            if (yych != 'i') { gotoCase = 43; continue; };\ncase 77:\n            yych = this._charAt(++cursor);\n            if (yych == 'P') { gotoCase = 78; continue; };\n            if (yych != 'p') { gotoCase = 43; continue; };\ncase 78:\n            yych = this._charAt(++cursor);\n            if (yych == 'T') { gotoCase = 79; continue; };\n            if (yych != 't') { gotoCase = 43; continue; };\ncase 79:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.TAG);\n            {\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\ncase 81:\n            yych = this._charAt(++cursor);\n            if (yych == 'L') { gotoCase = 82; continue; };\n            if (yych != 'l') { gotoCase = 43; continue; };\ncase 82:\n            yych = this._charAt(++cursor);\n            if (yych == 'E') { gotoCase = 83; continue; };\n            if (yych != 'e') { gotoCase = 43; continue; };\ncase 83:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.TAG);\n            {\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\n/* *********************************** */\ncase this.case_SSTRING:\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 89; continue; };\n                { gotoCase = 88; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 89; continue; };\n                if (yych == '\\'') { gotoCase = 91; continue; };\n                { gotoCase = 88; continue; };\n            }\ncase 87:\n            { return this._stringToken(cursor); }\ncase 88:\n            yych = this._charAt(++cursor);\n            { gotoCase = 95; continue; };\ncase 89:\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 91:\n            ++cursor;\ncase 92:\n            this.setLexCondition(this._lexConditions.TAG);\n            { return this._stringToken(cursor, true); }\ncase 93:\n            yych = this._charAt(++cursor);\n            { gotoCase = 92; continue; };\ncase 94:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 95:\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 87; continue; };\n                { gotoCase = 94; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 87; continue; };\n                if (yych == '\\'') { gotoCase = 93; continue; };\n                { gotoCase = 94; continue; };\n            }\n/* *********************************** */\ncase this.case_TAG:\n            yych = this._charAt(cursor);\n            if (yych <= '&') {\n                if (yych <= '\\r') {\n                    if (yych == '\\n') { gotoCase = 100; continue; };\n                    if (yych >= '\\r') { gotoCase = 100; continue; };\n                } else {\n                    if (yych <= ' ') {\n                        if (yych >= ' ') { gotoCase = 100; continue; };\n                    } else {\n                        if (yych == '\"') { gotoCase = 102; continue; };\n                    }\n                }\n            } else {\n                if (yych <= '>') {\n                    if (yych <= ';') {\n                        if (yych <= '\\'') { gotoCase = 103; continue; };\n                    } else {\n                        if (yych <= '<') { gotoCase = 100; continue; };\n                        if (yych <= '=') { gotoCase = 104; continue; };\n                        { gotoCase = 106; continue; };\n                    }\n                } else {\n                    if (yych <= '[') {\n                        if (yych >= '[') { gotoCase = 100; continue; };\n                    } else {\n                        if (yych == ']') { gotoCase = 100; continue; };\n                    }\n                }\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            { gotoCase = 119; continue; };\ncase 99:\n            {\n                    if (this._condition.parseCondition === this._parseConditions.SCRIPT || this._condition.parseCondition === this._parseConditions.STYLE) {\n                        // Fall through if expecting attributes.\n                        this.tokenType = null;\n                        return cursor;\n                    }\n\n                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {\n                        this.tokenType = \"html-tag\";\n                        this._setExpectingAttribute();\n                        var token = this._line.substring(cursorOnEnter, cursor);\n                        if (token === \"a\")\n                            this._condition.parseCondition |= this._parseConditions.A_NODE;\n                        else if (this._condition.parseCondition & this._parseConditions.A_NODE)\n                            this._condition.parseCondition ^= this._parseConditions.A_NODE;\n                    } else if (this._isExpectingAttribute()) {\n                        var token = this._line.substring(cursorOnEnter, cursor);\n                        if (token === \"href\" || token === \"src\")\n                            this._condition.parseCondition |= this._parseConditions.LINKIFY;\n                        else if (this._condition.parseCondition |= this._parseConditions.LINKIFY)\n                            this._condition.parseCondition ^= this._parseConditions.LINKIFY;\n                        this.tokenType = \"html-attribute-name\";\n                    } else if (this._isExpectingAttributeValue())\n                        this.tokenType = this._attrValueTokenType();\n                    else\n                        this.tokenType = null;\n                    return cursor;\n                }\ncase 100:\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 102:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 115; continue; };\ncase 103:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 109; continue; };\ncase 104:\n            ++cursor;\n            {\n                    if (this._isExpectingAttribute())\n                        this._setExpectingAttributeValue();\n                    this.tokenType = null;\n                    return cursor;\n                }\ncase 106:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.INITIAL);\n            {\n                    this.tokenType = \"html-tag\";\n                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {\n                        if (!this._internalJavaScriptTokenizer) {\n                            this._internalJavaScriptTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(\"text/javascript\");\n                            this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.initialCondition;\n                        }\n                        // Do not tokenize script tag contents.\n                        return cursor;\n                    }\n\n                    if (this._condition.parseCondition & this._parseConditions.STYLE) {\n                        if (!this._internalCSSTokenizer) {\n                            this._internalCSSTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(\"text/css\");\n                            this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.initialCondition;\n                        }\n                        // Do not tokenize style tag contents.\n                        return cursor;\n                    }\n\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\ncase 108:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 109:\n            if (yych <= '\\f') {\n                if (yych != '\\n') { gotoCase = 108; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 110; continue; };\n                if (yych == '\\'') { gotoCase = 112; continue; };\n                { gotoCase = 108; continue; };\n            }\ncase 110:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.SSTRING);\n            { return this._stringToken(cursor); }\ncase 112:\n            ++cursor;\n            { return this._stringToken(cursor, true); }\ncase 114:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 115:\n            if (yych <= '\\f') {\n                if (yych != '\\n') { gotoCase = 114; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 116; continue; };\n                if (yych == '\"') { gotoCase = 112; continue; };\n                { gotoCase = 114; continue; };\n            }\ncase 116:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.DSTRING);\n            { return this._stringToken(cursor); }\ncase 118:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 119:\n            if (yych <= '\"') {\n                if (yych <= '\\r') {\n                    if (yych == '\\n') { gotoCase = 99; continue; };\n                    if (yych <= '\\f') { gotoCase = 118; continue; };\n                    { gotoCase = 99; continue; };\n                } else {\n                    if (yych == ' ') { gotoCase = 99; continue; };\n                    if (yych <= '!') { gotoCase = 118; continue; };\n                    { gotoCase = 99; continue; };\n                }\n            } else {\n                if (yych <= '>') {\n                    if (yych == '\\'') { gotoCase = 99; continue; };\n                    if (yych <= ';') { gotoCase = 118; continue; };\n                    { gotoCase = 99; continue; };\n                } else {\n                    if (yych <= '[') {\n                        if (yych <= 'Z') { gotoCase = 118; continue; };\n                        { gotoCase = 99; continue; };\n                    } else {\n                        if (yych == ']') { gotoCase = 99; continue; };\n                        { gotoCase = 118; continue; };\n                    }\n                }\n            }\n        }\n\n        }\n    }\n}\n\nWebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceHTMLTokenizer.re2js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Generate js file as follows:\n//\n// re2c -isc WebCore/inspector/front-end/SourceHTMLTokenizer.re2js \\\n// | sed 's|^yy\\([^:]*\\)*\\:|case \\1:|' \\\n// | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \\\n// | sed 's|[[*][+][+]cursor|this._charAt(++cursor)|' \\\n// | sed 's|[*]cursor|this._charAt(cursor)|' \\\n// | sed 's|yych = \\*\\([^;]*\\)|yych = this._charAt\\1|' \\\n// | sed 's|goto case \\([^;]*\\)|{ gotoCase = \\1; continue; }|' \\\n// | sed 's|unsigned\\ int|var|' \\\n// | sed 's|var\\ yych|case 1: var yych|'\n\nWebInspector.SourceHTMLTokenizer = function()\n{\n    WebInspector.SourceTokenizer.call(this);\n\n    // The order is determined by the generated code.\n    this._lexConditions = {\n        INITIAL: 0,\n        COMMENT: 1,\n        DOCTYPE: 2,\n        TAG: 3,\n        DSTRING: 4,\n        SSTRING: 5\n    };\n    this.case_INITIAL = 1000;\n    this.case_COMMENT = 1001;\n    this.case_DOCTYPE = 1002;\n    this.case_TAG = 1003;\n    this.case_DSTRING = 1004;\n    this.case_SSTRING = 1005;\n\n    this._parseConditions = {\n        INITIAL: 0,\n        ATTRIBUTE: 1,\n        ATTRIBUTE_VALUE: 2,\n        LINKIFY: 4,\n        A_NODE: 8,\n        SCRIPT: 16,\n        STYLE: 32\n    };\n\n    this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };\n    this.condition = this.initialCondition;\n}\n\nWebInspector.SourceHTMLTokenizer.prototype = {\n    set line(line) {\n        if (this._internalJavaScriptTokenizer) {\n            var match = /<\\/script/i.exec(line);\n            if (match) {\n                this._internalJavaScriptTokenizer.line = line.substring(0, match.index);\n            } else\n                this._internalJavaScriptTokenizer.line = line;\n        } else if (this._internalCSSTokenizer) {\n            var match = /<\\/style/i.exec(line);\n            if (match) {\n                this._internalCSSTokenizer.line = line.substring(0, match.index);\n            } else\n                this._internalCSSTokenizer.line = line;\n        }\n        this._line = line;\n    },\n\n    _isExpectingAttribute: function()\n    {\n        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE;\n    },\n\n    _isExpectingAttributeValue: function()\n    {\n        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE_VALUE;\n    },\n\n    _setExpectingAttribute: function()\n    {\n        if (this._isExpectingAttributeValue())\n            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;\n        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE;\n    },\n\n    _setExpectingAttributeValue: function()\n    {\n        if (this._isExpectingAttribute())\n            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE;\n        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;\n    },\n\n    _stringToken: function(cursor, stringEnds)\n    {\n        if (!this._isExpectingAttributeValue()) {\n            this.tokenType = null;\n            return cursor;\n        }\n        this.tokenType = this._attrValueTokenType();\n        if (stringEnds)\n            this._setExpectingAttribute();\n        return cursor;\n    },\n\n    _attrValueTokenType: function()\n    {\n        if (this._condition.parseCondition & this._parseConditions.LINKIFY) {\n            if (this._condition.parseCondition & this._parseConditions.A_NODE)\n                return \"html-external-link\";\n            return \"html-resource-link\";\n        }\n        return \"html-attribute-value\";\n    },\n\n    nextToken: function(cursor)\n    {\n        if (this._internalJavaScriptTokenizer) {\n            // Re-set line to force </script> detection first.\n            this.line = this._line;\n            if (cursor !== this._internalJavaScriptTokenizer._line.length) {\n                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.\n                this._internalJavaScriptTokenizer.condition = this._condition.internalJavaScriptTokenizerCondition;\n                var result = this._internalJavaScriptTokenizer.nextToken(cursor);\n                this.tokenType = this._internalJavaScriptTokenizer.tokenType;\n                this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.condition;\n                return result;\n            } else if (cursor !== this._line.length)\n                delete this._internalJavaScriptTokenizer;\n        } else if (this._internalCSSTokenizer) {\n            // Re-set line to force </style> detection first.\n            this.line = this._line;\n            if (cursor !== this._internalCSSTokenizer._line.length) {\n                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.\n                this._internalCSSTokenizer.condition = this._condition.internalCSSTokenizerCondition;\n                var result = this._internalCSSTokenizer.nextToken(cursor);\n                this.tokenType = this._internalCSSTokenizer.tokenType;\n                this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.condition;\n                return result;\n            } else if (cursor !== this._line.length)\n                delete this._internalCSSTokenizer;\n        }\n\n        var cursorOnEnter = cursor;\n        var gotoCase = 1;\n        while (1) {\n            switch (gotoCase)\n            // Following comment is replaced with generated state machine.\n            /*!re2c\n                re2c:define:YYCTYPE  = \"var\";\n                re2c:define:YYCURSOR = cursor;\n                re2c:define:YYGETCONDITION = \"this.getLexCondition\";\n                re2c:define:YYSETCONDITION = \"this.setLexCondition\";\n                re2c:condprefix = \"case this.case_\";\n                re2c:condenumprefix = \"this._lexConditions.\";\n                re2c:yyfill:enable = 0;\n                re2c:labelprefix = \"case \";\n                re2c:indent:top = 2;\n                re2c:indent:string = \"    \";\n\n                CommentContent = ([^-\\r\\n] | (\"--\" [^>]))*;\n                Comment = \"<!--\" CommentContent \"-->\";\n                CommentStart = \"<!--\" CommentContent [\\r\\n];\n                CommentEnd = CommentContent \"-->\";\n\n                DocTypeStart = \"<!\" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee];\n                DocTypeContent = [^\\r\\n>]*;\n\n                ScriptStart = \"<\" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];\n                ScriptEnd = \"</\" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];\n\n                StyleStart = \"<\" [Ss] [Tt] [Yy] [Ll] [Ee];\n                StyleEnd = \"</\" [Ss] [Tt] [Yy] [Ll] [Ee];\n\n                LT = \"<\" | \"</\";\n                GT = \">\";\n                EqualSign = \"=\";\n\n                DoubleStringContent = [^\\r\\n\\\"]*;\n                SingleStringContent = [^\\r\\n\\']*;\n                StringLiteral = \"\\\"\" DoubleStringContent \"\\\"\" | \"'\" SingleStringContent \"'\";\n                DoubleStringStart = \"\\\"\" DoubleStringContent [\\r\\n];\n                DoubleStringEnd = DoubleStringContent \"\\\"\";\n                SingleStringStart = \"'\" SingleStringContent [\\r\\n];\n                SingleStringEnd = SingleStringContent \"'\";\n\n                Identifier = [^ \\r\\n\"'<>\\[\\]=]+;\n\n                <INITIAL> Comment { this.tokenType = \"html-comment\"; return cursor; }\n                <INITIAL> CommentStart => COMMENT { this.tokenType = \"html-comment\"; return cursor; }\n                <COMMENT> CommentContent => COMMENT { this.tokenType = \"html-comment\"; return cursor; }\n                <COMMENT> CommentEnd => INITIAL { this.tokenType = \"html-comment\"; return cursor; }\n\n                <INITIAL> DocTypeStart => DOCTYPE { this.tokenType = \"html-doctype\"; return cursor; }\n                <DOCTYPE> DocTypeContent => DOCTYPE { this.tokenType = \"html-doctype\"; return cursor; }\n                <DOCTYPE> GT => INITIAL { this.tokenType = \"html-doctype\"; return cursor; }\n\n                <INITIAL> ScriptStart => TAG\n                {\n                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {\n                        // Do not tokenize script tag contents, keep lexer state, even though processing \"<\".\n                        this.setLexCondition(this._lexConditions.INITIAL);\n                        this.tokenType = null;\n                        return cursor;\n                    }\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.SCRIPT;\n                    this._setExpectingAttribute();\n                    return cursor;\n                }\n\n                <INITIAL> ScriptEnd => TAG\n                {\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\n\n                <INITIAL> StyleStart => TAG\n                {\n                    if (this._condition.parseCondition & this._parseConditions.STYLE) {\n                        // Do not tokenize style tag contents, keep lexer state, even though processing \"<\".\n                        this.setLexCondition(this._lexConditions.INITIAL);\n                        this.tokenType = null;\n                        return cursor;\n                    }\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.STYLE;\n                    this._setExpectingAttribute();\n                    return cursor;\n                }\n\n                <INITIAL> StyleEnd => TAG\n                {\n                    this.tokenType = \"html-tag\";\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\n\n                <INITIAL> LT => TAG\n                {\n                    if (this._condition.parseCondition & (this._parseConditions.SCRIPT | this._parseConditions.STYLE)) {\n                        // Do not tokenize script and style tag contents, keep lexer state, even though processing \"<\".\n                        this.setLexCondition(this._lexConditions.INITIAL);\n                        this.tokenType = null;\n                        return cursor;\n                    }\n\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    this.tokenType = \"html-tag\";\n                    return cursor;\n                }\n  \n                <TAG> GT => INITIAL\n                {\n                    this.tokenType = \"html-tag\";\n                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {\n                        if (!this._internalJavaScriptTokenizer) {\n                            this._internalJavaScriptTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(\"text/javascript\");\n                            this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.initialCondition;\n                        }\n                        // Do not tokenize script tag contents.\n                        return cursor;\n                    }\n\n                    if (this._condition.parseCondition & this._parseConditions.STYLE) {\n                        if (!this._internalCSSTokenizer) {\n                            this._internalCSSTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(\"text/css\");\n                            this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.initialCondition;\n                        }\n                        // Do not tokenize style tag contents.\n                        return cursor;\n                    }\n\n                    this._condition.parseCondition = this._parseConditions.INITIAL;\n                    return cursor;\n                }\n\n                <TAG> StringLiteral { return this._stringToken(cursor, true); }\n                <TAG> DoubleStringStart => DSTRING { return this._stringToken(cursor); }\n                <DSTRING> DoubleStringContent => DSTRING { return this._stringToken(cursor); }\n                <DSTRING> DoubleStringEnd => TAG { return this._stringToken(cursor, true); }\n                <TAG> SingleStringStart => SSTRING { return this._stringToken(cursor); }\n                <SSTRING> SingleStringContent => SSTRING { return this._stringToken(cursor); }\n                <SSTRING> SingleStringEnd => TAG { return this._stringToken(cursor, true); }\n\n                <TAG> EqualSign => TAG\n                {\n                    if (this._isExpectingAttribute())\n                        this._setExpectingAttributeValue();\n                    this.tokenType = null;\n                    return cursor;\n                }\n\n                <TAG> Identifier\n                {\n                    if (this._condition.parseCondition === this._parseConditions.SCRIPT || this._condition.parseCondition === this._parseConditions.STYLE) {\n                        // Fall through if expecting attributes.\n                        this.tokenType = null;\n                        return cursor;\n                    }\n\n                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {\n                        this.tokenType = \"html-tag\";\n                        this._setExpectingAttribute();\n                        var token = this._line.substring(cursorOnEnter, cursor);\n                        if (token === \"a\")\n                            this._condition.parseCondition |= this._parseConditions.A_NODE;\n                        else if (this._condition.parseCondition & this._parseConditions.A_NODE)\n                            this._condition.parseCondition ^= this._parseConditions.A_NODE;\n                    } else if (this._isExpectingAttribute()) {\n                        var token = this._line.substring(cursorOnEnter, cursor);\n                        if (token === \"href\" || token === \"src\")\n                            this._condition.parseCondition |= this._parseConditions.LINKIFY;\n                        else if (this._condition.parseCondition |= this._parseConditions.LINKIFY)\n                            this._condition.parseCondition ^= this._parseConditions.LINKIFY;\n                        this.tokenType = \"html-attribute-name\";\n                    } else if (this._isExpectingAttributeValue())\n                        this.tokenType = this._attrValueTokenType();\n                    else\n                        this.tokenType = null;\n                    return cursor;\n                }\n                <*> [^] { this.tokenType = null; return cursor; }\n            */\n        }\n    }\n}\n\nWebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceJavaScriptTokenizer.js",
    "content": "/* Generated by re2c 0.13.5 on Thu Feb 25 21:44:55 2010 */\n/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Generate js file as follows:\n//\n// re2c -isc WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js \\\n// | sed 's|^yy\\([^:]*\\)*\\:|case \\1:|' \\\n// | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \\\n// | sed 's|[[*][+][+]cursor|this._charAt(++cursor)|' \\\n// | sed 's|[*]cursor|this._charAt(cursor)|' \\\n// | sed 's|yych = \\*\\([^;]*\\)|yych = this._charAt\\1|' \\\n// | sed 's|{ gotoCase = \\([^; continue; };]*\\)|{ gotoCase = \\1; continue; }|' \\\n// | sed 's|unsigned\\ int|var|' \\\n// | sed 's|var\\ yych|case 1: case 1: var yych|'\n\nWebInspector.SourceJavaScriptTokenizer = function()\n{\n    WebInspector.SourceTokenizer.call(this);\n\n    this._keywords = [\n        \"null\", \"true\", \"false\", \"break\", \"case\", \"catch\", \"const\", \"default\", \"finally\", \"for\",\n        \"instanceof\", \"new\", \"var\", \"continue\", \"function\", \"return\", \"void\", \"delete\", \"if\",\n        \"this\", \"do\", \"while\", \"else\", \"in\", \"switch\", \"throw\", \"try\", \"typeof\", \"debugger\",\n        \"class\", \"enum\", \"export\", \"extends\", \"import\", \"super\", \"get\", \"set\", \"with\"\n    ].keySet();\n\n    this._lexConditions = {\n        DIV: 0,\n        NODIV: 1,\n        COMMENT: 2,\n        DSTRING: 3,\n        SSTRING: 4,\n        REGEX: 5\n    };\n\n    this.case_DIV = 1000;\n    this.case_NODIV = 1001;\n    this.case_COMMENT = 1002;\n    this.case_DSTRING = 1003;\n    this.case_SSTRING = 1004;\n    this.case_REGEX = 1005;\n\n    this.initialCondition = { lexCondition: this._lexConditions.NODIV }\n    this.condition = this.initialCondition;\n}\n\nWebInspector.SourceJavaScriptTokenizer.prototype = {\n    nextToken: function(cursor)\n    {\n        var cursorOnEnter = cursor;\n        var gotoCase = 1;\n        while (1) {\n            switch (gotoCase)\n            // Following comment is replaced with generated state machine.\n            \n        {\n            case 1: var yych;\n            var yyaccept = 0;\n            if (this.getLexCondition() < 3) {\n                if (this.getLexCondition() < 1) {\n                    { gotoCase = this.case_DIV; continue; };\n                } else {\n                    if (this.getLexCondition() < 2) {\n                        { gotoCase = this.case_NODIV; continue; };\n                    } else {\n                        { gotoCase = this.case_COMMENT; continue; };\n                    }\n                }\n            } else {\n                if (this.getLexCondition() < 4) {\n                    { gotoCase = this.case_DSTRING; continue; };\n                } else {\n                    if (this.getLexCondition() < 5) {\n                        { gotoCase = this.case_SSTRING; continue; };\n                    } else {\n                        { gotoCase = this.case_REGEX; continue; };\n                    }\n                }\n            }\n/* *********************************** */\ncase this.case_COMMENT:\n\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 4; continue; };\n                { gotoCase = 3; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 4; continue; };\n                if (yych == '*') { gotoCase = 6; continue; };\n                { gotoCase = 3; continue; };\n            }\ncase 2:\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 3:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 12; continue; };\ncase 4:\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 6:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '*') { gotoCase = 9; continue; };\n            if (yych != '/') { gotoCase = 11; continue; };\ncase 7:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.NODIV);\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 9:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '*') { gotoCase = 9; continue; };\n            if (yych == '/') { gotoCase = 7; continue; };\ncase 11:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 12:\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 2; continue; };\n                { gotoCase = 11; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 2; continue; };\n                if (yych == '*') { gotoCase = 9; continue; };\n                { gotoCase = 11; continue; };\n            }\n/* *********************************** */\ncase this.case_DIV:\n            yych = this._charAt(cursor);\n            if (yych <= '9') {\n                if (yych <= '(') {\n                    if (yych <= '#') {\n                        if (yych <= ' ') { gotoCase = 15; continue; };\n                        if (yych <= '!') { gotoCase = 17; continue; };\n                        if (yych <= '\"') { gotoCase = 19; continue; };\n                    } else {\n                        if (yych <= '%') {\n                            if (yych <= '$') { gotoCase = 20; continue; };\n                            { gotoCase = 22; continue; };\n                        } else {\n                            if (yych <= '&') { gotoCase = 23; continue; };\n                            if (yych <= '\\'') { gotoCase = 24; continue; };\n                            { gotoCase = 25; continue; };\n                        }\n                    }\n                } else {\n                    if (yych <= ',') {\n                        if (yych <= ')') { gotoCase = 26; continue; };\n                        if (yych <= '*') { gotoCase = 28; continue; };\n                        if (yych <= '+') { gotoCase = 29; continue; };\n                        { gotoCase = 25; continue; };\n                    } else {\n                        if (yych <= '.') {\n                            if (yych <= '-') { gotoCase = 30; continue; };\n                            { gotoCase = 31; continue; };\n                        } else {\n                            if (yych <= '/') { gotoCase = 32; continue; };\n                            if (yych <= '0') { gotoCase = 34; continue; };\n                            { gotoCase = 36; continue; };\n                        }\n                    }\n                }\n            } else {\n                if (yych <= '\\\\') {\n                    if (yych <= '>') {\n                        if (yych <= ';') { gotoCase = 25; continue; };\n                        if (yych <= '<') { gotoCase = 37; continue; };\n                        if (yych <= '=') { gotoCase = 38; continue; };\n                        { gotoCase = 39; continue; };\n                    } else {\n                        if (yych <= '@') {\n                            if (yych <= '?') { gotoCase = 25; continue; };\n                        } else {\n                            if (yych <= 'Z') { gotoCase = 20; continue; };\n                            if (yych <= '[') { gotoCase = 25; continue; };\n                            { gotoCase = 40; continue; };\n                        }\n                    }\n                } else {\n                    if (yych <= 'z') {\n                        if (yych <= '^') {\n                            if (yych <= ']') { gotoCase = 25; continue; };\n                            { gotoCase = 41; continue; };\n                        } else {\n                            if (yych != '`') { gotoCase = 20; continue; };\n                        }\n                    } else {\n                        if (yych <= '|') {\n                            if (yych <= '{') { gotoCase = 25; continue; };\n                            { gotoCase = 42; continue; };\n                        } else {\n                            if (yych <= '~') { gotoCase = 25; continue; };\n                            if (yych >= 0x80) { gotoCase = 20; continue; };\n                        }\n                    }\n                }\n            }\ncase 15:\n            ++cursor;\ncase 16:\n            { this.tokenType = null; return cursor; }\ncase 17:\n            ++cursor;\n            if ((yych = this._charAt(cursor)) == '=') { gotoCase = 115; continue; };\ncase 18:\n            this.setLexCondition(this._lexConditions.NODIV);\n            { this.tokenType = null; return cursor; }\ncase 19:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '\\n') { gotoCase = 16; continue; };\n            if (yych == '\\r') { gotoCase = 16; continue; };\n            { gotoCase = 107; continue; };\ncase 20:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 50; continue; };\ncase 21:\n            {\n                    var token = this._line.substring(cursorOnEnter, cursor);\n                    if (token in this._keywords)\n                        this.tokenType = \"javascript-keyword\";\n                    else\n                        this.tokenType = \"javascript-ident\";\n                    return cursor;\n                }\ncase 22:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 23:\n            yych = this._charAt(++cursor);\n            if (yych == '&') { gotoCase = 43; continue; };\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 24:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '\\n') { gotoCase = 16; continue; };\n            if (yych == '\\r') { gotoCase = 16; continue; };\n            { gotoCase = 96; continue; };\ncase 25:\n            yych = this._charAt(++cursor);\n            { gotoCase = 18; continue; };\ncase 26:\n            ++cursor;\n            { this.tokenType = null; return cursor; }\ncase 28:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 29:\n            yych = this._charAt(++cursor);\n            if (yych == '+') { gotoCase = 43; continue; };\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 30:\n            yych = this._charAt(++cursor);\n            if (yych == '-') { gotoCase = 43; continue; };\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 31:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 18; continue; };\n            if (yych <= '9') { gotoCase = 89; continue; };\n            { gotoCase = 18; continue; };\ncase 32:\n            yyaccept = 2;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '.') {\n                if (yych == '*') { gotoCase = 78; continue; };\n            } else {\n                if (yych <= '/') { gotoCase = 80; continue; };\n                if (yych == '=') { gotoCase = 77; continue; };\n            }\ncase 33:\n            this.setLexCondition(this._lexConditions.NODIV);\n            { this.tokenType = null; return cursor; }\ncase 34:\n            yyaccept = 3;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= 'E') {\n                if (yych <= '/') {\n                    if (yych == '.') { gotoCase = 63; continue; };\n                } else {\n                    if (yych <= '7') { gotoCase = 72; continue; };\n                    if (yych >= 'E') { gotoCase = 62; continue; };\n                }\n            } else {\n                if (yych <= 'd') {\n                    if (yych == 'X') { gotoCase = 74; continue; };\n                } else {\n                    if (yych <= 'e') { gotoCase = 62; continue; };\n                    if (yych == 'x') { gotoCase = 74; continue; };\n                }\n            }\ncase 35:\n            { this.tokenType = \"javascript-number\"; return cursor; }\ncase 36:\n            yyaccept = 3;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '9') {\n                if (yych == '.') { gotoCase = 63; continue; };\n                if (yych <= '/') { gotoCase = 35; continue; };\n                { gotoCase = 60; continue; };\n            } else {\n                if (yych <= 'E') {\n                    if (yych <= 'D') { gotoCase = 35; continue; };\n                    { gotoCase = 62; continue; };\n                } else {\n                    if (yych == 'e') { gotoCase = 62; continue; };\n                    { gotoCase = 35; continue; };\n                }\n            }\ncase 37:\n            yych = this._charAt(++cursor);\n            if (yych <= ';') { gotoCase = 18; continue; };\n            if (yych <= '<') { gotoCase = 59; continue; };\n            if (yych <= '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 38:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 58; continue; };\n            { gotoCase = 18; continue; };\ncase 39:\n            yych = this._charAt(++cursor);\n            if (yych <= '<') { gotoCase = 18; continue; };\n            if (yych <= '=') { gotoCase = 43; continue; };\n            if (yych <= '>') { gotoCase = 56; continue; };\n            { gotoCase = 18; continue; };\ncase 40:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == 'u') { gotoCase = 44; continue; };\n            { gotoCase = 16; continue; };\ncase 41:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 42:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 43; continue; };\n            if (yych != '|') { gotoCase = 18; continue; };\ncase 43:\n            yych = this._charAt(++cursor);\n            { gotoCase = 18; continue; };\ncase 44:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 46; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 46; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych <= 'f') { gotoCase = 46; continue; };\n            }\ncase 45:\n            cursor = YYMARKER;\n            if (yyaccept <= 1) {\n                if (yyaccept <= 0) {\n                    { gotoCase = 16; continue; };\n                } else {\n                    { gotoCase = 21; continue; };\n                }\n            } else {\n                if (yyaccept <= 2) {\n                    { gotoCase = 33; continue; };\n                } else {\n                    { gotoCase = 35; continue; };\n                }\n            }\ncase 46:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 47; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 47:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 48; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 48:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 49; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 49:\n            yyaccept = 1;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 50:\n            if (yych <= '[') {\n                if (yych <= '/') {\n                    if (yych == '$') { gotoCase = 49; continue; };\n                    { gotoCase = 21; continue; };\n                } else {\n                    if (yych <= '9') { gotoCase = 49; continue; };\n                    if (yych <= '@') { gotoCase = 21; continue; };\n                    if (yych <= 'Z') { gotoCase = 49; continue; };\n                    { gotoCase = 21; continue; };\n                }\n            } else {\n                if (yych <= '_') {\n                    if (yych <= '\\\\') { gotoCase = 51; continue; };\n                    if (yych <= '^') { gotoCase = 21; continue; };\n                    { gotoCase = 49; continue; };\n                } else {\n                    if (yych <= '`') { gotoCase = 21; continue; };\n                    if (yych <= 'z') { gotoCase = 49; continue; };\n                    if (yych <= 0x7F) { gotoCase = 21; continue; };\n                    { gotoCase = 49; continue; };\n                }\n            }\ncase 51:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych != 'u') { gotoCase = 45; continue; };\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 53; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 53:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 54; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 54:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 55; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 55:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 49; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 49; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych <= 'f') { gotoCase = 49; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 56:\n            yych = this._charAt(++cursor);\n            if (yych <= '<') { gotoCase = 18; continue; };\n            if (yych <= '=') { gotoCase = 43; continue; };\n            if (yych >= '?') { gotoCase = 18; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 58:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 59:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\ncase 60:\n            yyaccept = 3;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '9') {\n                if (yych == '.') { gotoCase = 63; continue; };\n                if (yych <= '/') { gotoCase = 35; continue; };\n                { gotoCase = 60; continue; };\n            } else {\n                if (yych <= 'E') {\n                    if (yych <= 'D') { gotoCase = 35; continue; };\n                } else {\n                    if (yych != 'e') { gotoCase = 35; continue; };\n                }\n            }\ncase 62:\n            yych = this._charAt(++cursor);\n            if (yych <= ',') {\n                if (yych == '+') { gotoCase = 69; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= '-') { gotoCase = 69; continue; };\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 70; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 63:\n            yyaccept = 3;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'D') {\n                if (yych <= '/') { gotoCase = 35; continue; };\n                if (yych <= '9') { gotoCase = 63; continue; };\n                { gotoCase = 35; continue; };\n            } else {\n                if (yych <= 'E') { gotoCase = 65; continue; };\n                if (yych != 'e') { gotoCase = 35; continue; };\n            }\ncase 65:\n            yych = this._charAt(++cursor);\n            if (yych <= ',') {\n                if (yych != '+') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= '-') { gotoCase = 66; continue; };\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 67; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 66:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 45; continue; };\n            if (yych >= ':') { gotoCase = 45; continue; };\ncase 67:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 35; continue; };\n            if (yych <= '9') { gotoCase = 67; continue; };\n            { gotoCase = 35; continue; };\ncase 69:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 45; continue; };\n            if (yych >= ':') { gotoCase = 45; continue; };\ncase 70:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 35; continue; };\n            if (yych <= '9') { gotoCase = 70; continue; };\n            { gotoCase = 35; continue; };\ncase 72:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 35; continue; };\n            if (yych <= '7') { gotoCase = 72; continue; };\n            { gotoCase = 35; continue; };\ncase 74:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 75; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 75:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 35; continue; };\n                if (yych <= '9') { gotoCase = 75; continue; };\n                { gotoCase = 35; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 75; continue; };\n                if (yych <= '`') { gotoCase = 35; continue; };\n                if (yych <= 'f') { gotoCase = 75; continue; };\n                { gotoCase = 35; continue; };\n            }\ncase 77:\n            yych = this._charAt(++cursor);\n            { gotoCase = 33; continue; };\ncase 78:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 85; continue; };\n                { gotoCase = 78; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 85; continue; };\n                if (yych == '*') { gotoCase = 83; continue; };\n                { gotoCase = 78; continue; };\n            }\ncase 80:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 82; continue; };\n            if (yych != '\\r') { gotoCase = 80; continue; };\ncase 82:\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 83:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '*') { gotoCase = 83; continue; };\n            if (yych == '/') { gotoCase = 87; continue; };\n            { gotoCase = 78; continue; };\ncase 85:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.COMMENT);\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 87:\n            ++cursor;\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 89:\n            yyaccept = 3;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'D') {\n                if (yych <= '/') { gotoCase = 35; continue; };\n                if (yych <= '9') { gotoCase = 89; continue; };\n                { gotoCase = 35; continue; };\n            } else {\n                if (yych <= 'E') { gotoCase = 91; continue; };\n                if (yych != 'e') { gotoCase = 35; continue; };\n            }\ncase 91:\n            yych = this._charAt(++cursor);\n            if (yych <= ',') {\n                if (yych != '+') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= '-') { gotoCase = 92; continue; };\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 93; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 92:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 45; continue; };\n            if (yych >= ':') { gotoCase = 45; continue; };\ncase 93:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 35; continue; };\n            if (yych <= '9') { gotoCase = 93; continue; };\n            { gotoCase = 35; continue; };\ncase 95:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 96:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 45; continue; };\n                if (yych <= '\\f') { gotoCase = 95; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= '\\'') {\n                    if (yych <= '&') { gotoCase = 95; continue; };\n                    { gotoCase = 98; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 95; continue; };\n                }\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'a') {\n                if (yych <= '!') {\n                    if (yych <= '\\n') {\n                        if (yych <= '\\t') { gotoCase = 45; continue; };\n                        { gotoCase = 101; continue; };\n                    } else {\n                        if (yych == '\\r') { gotoCase = 101; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                } else {\n                    if (yych <= '\\'') {\n                        if (yych <= '\"') { gotoCase = 95; continue; };\n                        if (yych <= '&') { gotoCase = 45; continue; };\n                        { gotoCase = 95; continue; };\n                    } else {\n                        if (yych == '\\\\') { gotoCase = 95; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'q') {\n                    if (yych <= 'f') {\n                        if (yych <= 'b') { gotoCase = 95; continue; };\n                        if (yych <= 'e') { gotoCase = 45; continue; };\n                        { gotoCase = 95; continue; };\n                    } else {\n                        if (yych == 'n') { gotoCase = 95; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych == 's') { gotoCase = 45; continue; };\n                        { gotoCase = 95; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 100; continue; };\n                        if (yych <= 'v') { gotoCase = 95; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                }\n            }\ncase 98:\n            ++cursor;\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 100:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 103; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 103; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych <= 'f') { gotoCase = 103; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 101:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.SSTRING);\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 103:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 104; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 104:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 105; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 105:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 95; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 95; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych <= 'f') { gotoCase = 95; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 106:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 107:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 45; continue; };\n                if (yych <= '\\f') { gotoCase = 106; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= '\"') {\n                    if (yych <= '!') { gotoCase = 106; continue; };\n                    { gotoCase = 98; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 106; continue; };\n                }\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'a') {\n                if (yych <= '!') {\n                    if (yych <= '\\n') {\n                        if (yych <= '\\t') { gotoCase = 45; continue; };\n                        { gotoCase = 110; continue; };\n                    } else {\n                        if (yych == '\\r') { gotoCase = 110; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                } else {\n                    if (yych <= '\\'') {\n                        if (yych <= '\"') { gotoCase = 106; continue; };\n                        if (yych <= '&') { gotoCase = 45; continue; };\n                        { gotoCase = 106; continue; };\n                    } else {\n                        if (yych == '\\\\') { gotoCase = 106; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'q') {\n                    if (yych <= 'f') {\n                        if (yych <= 'b') { gotoCase = 106; continue; };\n                        if (yych <= 'e') { gotoCase = 45; continue; };\n                        { gotoCase = 106; continue; };\n                    } else {\n                        if (yych == 'n') { gotoCase = 106; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych == 's') { gotoCase = 45; continue; };\n                        { gotoCase = 106; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 109; continue; };\n                        if (yych <= 'v') { gotoCase = 106; continue; };\n                        { gotoCase = 45; continue; };\n                    }\n                }\n            }\ncase 109:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 112; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 112; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych <= 'f') { gotoCase = 112; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 110:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.DSTRING);\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 112:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 113; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 113:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych >= ':') { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 114; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych >= 'g') { gotoCase = 45; continue; };\n            }\ncase 114:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 45; continue; };\n                if (yych <= '9') { gotoCase = 106; continue; };\n                { gotoCase = 45; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 106; continue; };\n                if (yych <= '`') { gotoCase = 45; continue; };\n                if (yych <= 'f') { gotoCase = 106; continue; };\n                { gotoCase = 45; continue; };\n            }\ncase 115:\n            ++cursor;\n            if ((yych = this._charAt(cursor)) == '=') { gotoCase = 43; continue; };\n            { gotoCase = 18; continue; };\n/* *********************************** */\ncase this.case_DSTRING:\n            yych = this._charAt(cursor);\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 120; continue; };\n                if (yych <= '\\f') { gotoCase = 119; continue; };\n                { gotoCase = 120; continue; };\n            } else {\n                if (yych <= '\"') {\n                    if (yych <= '!') { gotoCase = 119; continue; };\n                    { gotoCase = 122; continue; };\n                } else {\n                    if (yych == '\\\\') { gotoCase = 124; continue; };\n                    { gotoCase = 119; continue; };\n                }\n            }\ncase 118:\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 119:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 126; continue; };\ncase 120:\n            ++cursor;\ncase 121:\n            { this.tokenType = null; return cursor; }\ncase 122:\n            ++cursor;\ncase 123:\n            this.setLexCondition(this._lexConditions.NODIV);\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 124:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 125; continue; };\n                    if (yych <= '&') { gotoCase = 121; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych <= '[') { gotoCase = 121; continue; };\n                    } else {\n                        if (yych != 'b') { gotoCase = 121; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych >= 'g') { gotoCase = 121; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 125; continue; };\n                        if (yych <= 'q') { gotoCase = 121; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych <= 's') { gotoCase = 121; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 127; continue; };\n                        if (yych >= 'w') { gotoCase = 121; continue; };\n                    }\n                }\n            }\ncase 125:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 126:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 118; continue; };\n                if (yych <= '\\f') { gotoCase = 125; continue; };\n                { gotoCase = 118; continue; };\n            } else {\n                if (yych <= '\"') {\n                    if (yych <= '!') { gotoCase = 125; continue; };\n                    { gotoCase = 133; continue; };\n                } else {\n                    if (yych == '\\\\') { gotoCase = 132; continue; };\n                    { gotoCase = 125; continue; };\n                }\n            }\ncase 127:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 128; continue; };\n                if (yych <= '9') { gotoCase = 129; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 129; continue; };\n                if (yych <= '`') { gotoCase = 128; continue; };\n                if (yych <= 'f') { gotoCase = 129; continue; };\n            }\ncase 128:\n            cursor = YYMARKER;\n            if (yyaccept <= 0) {\n                { gotoCase = 118; continue; };\n            } else {\n                { gotoCase = 121; continue; };\n            }\ncase 129:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 128; continue; };\n                if (yych >= ':') { gotoCase = 128; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 130; continue; };\n                if (yych <= '`') { gotoCase = 128; continue; };\n                if (yych >= 'g') { gotoCase = 128; continue; };\n            }\ncase 130:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 128; continue; };\n                if (yych >= ':') { gotoCase = 128; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 131; continue; };\n                if (yych <= '`') { gotoCase = 128; continue; };\n                if (yych >= 'g') { gotoCase = 128; continue; };\n            }\ncase 131:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 128; continue; };\n                if (yych <= '9') { gotoCase = 125; continue; };\n                { gotoCase = 128; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 125; continue; };\n                if (yych <= '`') { gotoCase = 128; continue; };\n                if (yych <= 'f') { gotoCase = 125; continue; };\n                { gotoCase = 128; continue; };\n            }\ncase 132:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 125; continue; };\n                    if (yych <= '&') { gotoCase = 128; continue; };\n                    { gotoCase = 125; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych <= '[') { gotoCase = 128; continue; };\n                        { gotoCase = 125; continue; };\n                    } else {\n                        if (yych == 'b') { gotoCase = 125; continue; };\n                        { gotoCase = 128; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych <= 'f') { gotoCase = 125; continue; };\n                        { gotoCase = 128; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 125; continue; };\n                        if (yych <= 'q') { gotoCase = 128; continue; };\n                        { gotoCase = 125; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych <= 's') { gotoCase = 128; continue; };\n                        { gotoCase = 125; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 127; continue; };\n                        if (yych <= 'v') { gotoCase = 125; continue; };\n                        { gotoCase = 128; continue; };\n                    }\n                }\n            }\ncase 133:\n            ++cursor;\n            yych = this._charAt(cursor);\n            { gotoCase = 123; continue; };\n/* *********************************** */\ncase this.case_NODIV:\n            yych = this._charAt(cursor);\n            if (yych <= '9') {\n                if (yych <= '(') {\n                    if (yych <= '#') {\n                        if (yych <= ' ') { gotoCase = 136; continue; };\n                        if (yych <= '!') { gotoCase = 138; continue; };\n                        if (yych <= '\"') { gotoCase = 140; continue; };\n                    } else {\n                        if (yych <= '%') {\n                            if (yych <= '$') { gotoCase = 141; continue; };\n                            { gotoCase = 143; continue; };\n                        } else {\n                            if (yych <= '&') { gotoCase = 144; continue; };\n                            if (yych <= '\\'') { gotoCase = 145; continue; };\n                            { gotoCase = 146; continue; };\n                        }\n                    }\n                } else {\n                    if (yych <= ',') {\n                        if (yych <= ')') { gotoCase = 147; continue; };\n                        if (yych <= '*') { gotoCase = 149; continue; };\n                        if (yych <= '+') { gotoCase = 150; continue; };\n                        { gotoCase = 146; continue; };\n                    } else {\n                        if (yych <= '.') {\n                            if (yych <= '-') { gotoCase = 151; continue; };\n                            { gotoCase = 152; continue; };\n                        } else {\n                            if (yych <= '/') { gotoCase = 153; continue; };\n                            if (yych <= '0') { gotoCase = 154; continue; };\n                            { gotoCase = 156; continue; };\n                        }\n                    }\n                }\n            } else {\n                if (yych <= '\\\\') {\n                    if (yych <= '>') {\n                        if (yych <= ';') { gotoCase = 146; continue; };\n                        if (yych <= '<') { gotoCase = 157; continue; };\n                        if (yych <= '=') { gotoCase = 158; continue; };\n                        { gotoCase = 159; continue; };\n                    } else {\n                        if (yych <= '@') {\n                            if (yych <= '?') { gotoCase = 146; continue; };\n                        } else {\n                            if (yych <= 'Z') { gotoCase = 141; continue; };\n                            if (yych <= '[') { gotoCase = 146; continue; };\n                            { gotoCase = 160; continue; };\n                        }\n                    }\n                } else {\n                    if (yych <= 'z') {\n                        if (yych <= '^') {\n                            if (yych <= ']') { gotoCase = 146; continue; };\n                            { gotoCase = 161; continue; };\n                        } else {\n                            if (yych != '`') { gotoCase = 141; continue; };\n                        }\n                    } else {\n                        if (yych <= '|') {\n                            if (yych <= '{') { gotoCase = 146; continue; };\n                            { gotoCase = 162; continue; };\n                        } else {\n                            if (yych <= '~') { gotoCase = 146; continue; };\n                            if (yych >= 0x80) { gotoCase = 141; continue; };\n                        }\n                    }\n                }\n            }\ncase 136:\n            ++cursor;\ncase 137:\n            { this.tokenType = null; return cursor; }\ncase 138:\n            ++cursor;\n            if ((yych = this._charAt(cursor)) == '=') { gotoCase = 260; continue; };\ncase 139:\n            { this.tokenType = null; return cursor; }\ncase 140:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '\\n') { gotoCase = 137; continue; };\n            if (yych == '\\r') { gotoCase = 137; continue; };\n            { gotoCase = 252; continue; };\ncase 141:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 170; continue; };\ncase 142:\n            this.setLexCondition(this._lexConditions.DIV);\n            {\n                    var token = this._line.substring(cursorOnEnter, cursor);\n                    if (token in this._keywords)\n                        this.tokenType = \"javascript-keyword\";\n                    else\n                        this.tokenType = \"javascript-ident\";\n                    return cursor;\n                }\ncase 143:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 144:\n            yych = this._charAt(++cursor);\n            if (yych == '&') { gotoCase = 163; continue; };\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 145:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == '\\n') { gotoCase = 137; continue; };\n            if (yych == '\\r') { gotoCase = 137; continue; };\n            { gotoCase = 241; continue; };\ncase 146:\n            yych = this._charAt(++cursor);\n            { gotoCase = 139; continue; };\ncase 147:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.DIV);\n            { this.tokenType = null; return cursor; }\ncase 149:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 150:\n            yych = this._charAt(++cursor);\n            if (yych == '+') { gotoCase = 163; continue; };\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 151:\n            yych = this._charAt(++cursor);\n            if (yych == '-') { gotoCase = 163; continue; };\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 152:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 139; continue; };\n            if (yych <= '9') { gotoCase = 234; continue; };\n            { gotoCase = 139; continue; };\ncase 153:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 137; continue; };\n                    { gotoCase = 197; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 137; continue; };\n                    if (yych <= ')') { gotoCase = 197; continue; };\n                    { gotoCase = 202; continue; };\n                }\n            } else {\n                if (yych <= 'Z') {\n                    if (yych == '/') { gotoCase = 204; continue; };\n                    { gotoCase = 197; continue; };\n                } else {\n                    if (yych <= '[') { gotoCase = 200; continue; };\n                    if (yych <= '\\\\') { gotoCase = 199; continue; };\n                    if (yych <= ']') { gotoCase = 137; continue; };\n                    { gotoCase = 197; continue; };\n                }\n            }\ncase 154:\n            yyaccept = 2;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= 'E') {\n                if (yych <= '/') {\n                    if (yych == '.') { gotoCase = 183; continue; };\n                } else {\n                    if (yych <= '7') { gotoCase = 192; continue; };\n                    if (yych >= 'E') { gotoCase = 182; continue; };\n                }\n            } else {\n                if (yych <= 'd') {\n                    if (yych == 'X') { gotoCase = 194; continue; };\n                } else {\n                    if (yych <= 'e') { gotoCase = 182; continue; };\n                    if (yych == 'x') { gotoCase = 194; continue; };\n                }\n            }\ncase 155:\n            this.setLexCondition(this._lexConditions.DIV);\n            { this.tokenType = \"javascript-number\"; return cursor; }\ncase 156:\n            yyaccept = 2;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '9') {\n                if (yych == '.') { gotoCase = 183; continue; };\n                if (yych <= '/') { gotoCase = 155; continue; };\n                { gotoCase = 180; continue; };\n            } else {\n                if (yych <= 'E') {\n                    if (yych <= 'D') { gotoCase = 155; continue; };\n                    { gotoCase = 182; continue; };\n                } else {\n                    if (yych == 'e') { gotoCase = 182; continue; };\n                    { gotoCase = 155; continue; };\n                }\n            }\ncase 157:\n            yych = this._charAt(++cursor);\n            if (yych <= ';') { gotoCase = 139; continue; };\n            if (yych <= '<') { gotoCase = 179; continue; };\n            if (yych <= '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 158:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 178; continue; };\n            { gotoCase = 139; continue; };\ncase 159:\n            yych = this._charAt(++cursor);\n            if (yych <= '<') { gotoCase = 139; continue; };\n            if (yych <= '=') { gotoCase = 163; continue; };\n            if (yych <= '>') { gotoCase = 176; continue; };\n            { gotoCase = 139; continue; };\ncase 160:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych == 'u') { gotoCase = 164; continue; };\n            { gotoCase = 137; continue; };\ncase 161:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 162:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 163; continue; };\n            if (yych != '|') { gotoCase = 139; continue; };\ncase 163:\n            yych = this._charAt(++cursor);\n            { gotoCase = 139; continue; };\ncase 164:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 166; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 166; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych <= 'f') { gotoCase = 166; continue; };\n            }\ncase 165:\n            cursor = YYMARKER;\n            if (yyaccept <= 1) {\n                if (yyaccept <= 0) {\n                    { gotoCase = 137; continue; };\n                } else {\n                    { gotoCase = 142; continue; };\n                }\n            } else {\n                if (yyaccept <= 2) {\n                    { gotoCase = 155; continue; };\n                } else {\n                    { gotoCase = 217; continue; };\n                }\n            }\ncase 166:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 167; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 167:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 168; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 168:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 169; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 169:\n            yyaccept = 1;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 170:\n            if (yych <= '[') {\n                if (yych <= '/') {\n                    if (yych == '$') { gotoCase = 169; continue; };\n                    { gotoCase = 142; continue; };\n                } else {\n                    if (yych <= '9') { gotoCase = 169; continue; };\n                    if (yych <= '@') { gotoCase = 142; continue; };\n                    if (yych <= 'Z') { gotoCase = 169; continue; };\n                    { gotoCase = 142; continue; };\n                }\n            } else {\n                if (yych <= '_') {\n                    if (yych <= '\\\\') { gotoCase = 171; continue; };\n                    if (yych <= '^') { gotoCase = 142; continue; };\n                    { gotoCase = 169; continue; };\n                } else {\n                    if (yych <= '`') { gotoCase = 142; continue; };\n                    if (yych <= 'z') { gotoCase = 169; continue; };\n                    if (yych <= 0x7F) { gotoCase = 142; continue; };\n                    { gotoCase = 169; continue; };\n                }\n            }\ncase 171:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych != 'u') { gotoCase = 165; continue; };\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 173; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 173:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 174; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 174:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 175; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 175:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 169; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 169; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych <= 'f') { gotoCase = 169; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 176:\n            yych = this._charAt(++cursor);\n            if (yych <= '<') { gotoCase = 139; continue; };\n            if (yych <= '=') { gotoCase = 163; continue; };\n            if (yych >= '?') { gotoCase = 139; continue; };\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 178:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 179:\n            yych = this._charAt(++cursor);\n            if (yych == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\ncase 180:\n            yyaccept = 2;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '9') {\n                if (yych == '.') { gotoCase = 183; continue; };\n                if (yych <= '/') { gotoCase = 155; continue; };\n                { gotoCase = 180; continue; };\n            } else {\n                if (yych <= 'E') {\n                    if (yych <= 'D') { gotoCase = 155; continue; };\n                } else {\n                    if (yych != 'e') { gotoCase = 155; continue; };\n                }\n            }\ncase 182:\n            yych = this._charAt(++cursor);\n            if (yych <= ',') {\n                if (yych == '+') { gotoCase = 189; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= '-') { gotoCase = 189; continue; };\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 190; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 183:\n            yyaccept = 2;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'D') {\n                if (yych <= '/') { gotoCase = 155; continue; };\n                if (yych <= '9') { gotoCase = 183; continue; };\n                { gotoCase = 155; continue; };\n            } else {\n                if (yych <= 'E') { gotoCase = 185; continue; };\n                if (yych != 'e') { gotoCase = 155; continue; };\n            }\ncase 185:\n            yych = this._charAt(++cursor);\n            if (yych <= ',') {\n                if (yych != '+') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= '-') { gotoCase = 186; continue; };\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 187; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 186:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 165; continue; };\n            if (yych >= ':') { gotoCase = 165; continue; };\ncase 187:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 155; continue; };\n            if (yych <= '9') { gotoCase = 187; continue; };\n            { gotoCase = 155; continue; };\ncase 189:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 165; continue; };\n            if (yych >= ':') { gotoCase = 165; continue; };\ncase 190:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 155; continue; };\n            if (yych <= '9') { gotoCase = 190; continue; };\n            { gotoCase = 155; continue; };\ncase 192:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 155; continue; };\n            if (yych <= '7') { gotoCase = 192; continue; };\n            { gotoCase = 155; continue; };\ncase 194:\n            yych = this._charAt(++cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 195; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 195:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 155; continue; };\n                if (yych <= '9') { gotoCase = 195; continue; };\n                { gotoCase = 155; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 195; continue; };\n                if (yych <= '`') { gotoCase = 155; continue; };\n                if (yych <= 'f') { gotoCase = 195; continue; };\n                { gotoCase = 155; continue; };\n            }\ncase 197:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '.') {\n                if (yych <= '\\n') {\n                    if (yych <= '\\t') { gotoCase = 197; continue; };\n                    { gotoCase = 165; continue; };\n                } else {\n                    if (yych == '\\r') { gotoCase = 165; continue; };\n                    { gotoCase = 197; continue; };\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych <= '/') { gotoCase = 220; continue; };\n                    if (yych <= 'Z') { gotoCase = 197; continue; };\n                    { gotoCase = 228; continue; };\n                } else {\n                    if (yych <= '\\\\') { gotoCase = 227; continue; };\n                    if (yych <= ']') { gotoCase = 165; continue; };\n                    { gotoCase = 197; continue; };\n                }\n            }\ncase 199:\n            yych = this._charAt(++cursor);\n            if (yych == '\\n') { gotoCase = 165; continue; };\n            if (yych == '\\r') { gotoCase = 165; continue; };\n            { gotoCase = 197; continue; };\ncase 200:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 165; continue; };\n                    { gotoCase = 200; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 165; continue; };\n                    if (yych <= ')') { gotoCase = 200; continue; };\n                    { gotoCase = 165; continue; };\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych == '/') { gotoCase = 165; continue; };\n                    { gotoCase = 200; continue; };\n                } else {\n                    if (yych <= '\\\\') { gotoCase = 215; continue; };\n                    if (yych <= ']') { gotoCase = 213; continue; };\n                    { gotoCase = 200; continue; };\n                }\n            }\ncase 202:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '\\f') {\n                if (yych == '\\n') { gotoCase = 209; continue; };\n                { gotoCase = 202; continue; };\n            } else {\n                if (yych <= '\\r') { gotoCase = 209; continue; };\n                if (yych == '*') { gotoCase = 207; continue; };\n                { gotoCase = 202; continue; };\n            }\ncase 204:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 206; continue; };\n            if (yych != '\\r') { gotoCase = 204; continue; };\ncase 206:\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 207:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '*') { gotoCase = 207; continue; };\n            if (yych == '/') { gotoCase = 211; continue; };\n            { gotoCase = 202; continue; };\ncase 209:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.COMMENT);\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 211:\n            ++cursor;\n            { this.tokenType = \"javascript-comment\"; return cursor; }\ncase 213:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 165; continue; };\n                    { gotoCase = 213; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 165; continue; };\n                    if (yych <= ')') { gotoCase = 213; continue; };\n                    { gotoCase = 197; continue; };\n                }\n            } else {\n                if (yych <= 'Z') {\n                    if (yych == '/') { gotoCase = 220; continue; };\n                    { gotoCase = 213; continue; };\n                } else {\n                    if (yych <= '[') { gotoCase = 218; continue; };\n                    if (yych <= '\\\\') { gotoCase = 216; continue; };\n                    { gotoCase = 213; continue; };\n                }\n            }\ncase 215:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 165; continue; };\n            if (yych == '\\r') { gotoCase = 165; continue; };\n            { gotoCase = 200; continue; };\ncase 216:\n            yyaccept = 3;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 217; continue; };\n            if (yych != '\\r') { gotoCase = 213; continue; };\ncase 217:\n            this.setLexCondition(this._lexConditions.REGEX);\n            { this.tokenType = \"javascript-regexp\"; return cursor; }\ncase 218:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 165; continue; };\n                    { gotoCase = 218; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 165; continue; };\n                    if (yych <= ')') { gotoCase = 218; continue; };\n                    { gotoCase = 165; continue; };\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych == '/') { gotoCase = 165; continue; };\n                    { gotoCase = 218; continue; };\n                } else {\n                    if (yych <= '\\\\') { gotoCase = 225; continue; };\n                    if (yych <= ']') { gotoCase = 223; continue; };\n                    { gotoCase = 218; continue; };\n                }\n            }\ncase 220:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'h') {\n                if (yych == 'g') { gotoCase = 220; continue; };\n            } else {\n                if (yych <= 'i') { gotoCase = 220; continue; };\n                if (yych == 'm') { gotoCase = 220; continue; };\n            }\n            { this.tokenType = \"javascript-regexp\"; return cursor; }\ncase 223:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 165; continue; };\n                    { gotoCase = 223; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 165; continue; };\n                    if (yych <= ')') { gotoCase = 223; continue; };\n                    { gotoCase = 197; continue; };\n                }\n            } else {\n                if (yych <= 'Z') {\n                    if (yych == '/') { gotoCase = 220; continue; };\n                    { gotoCase = 223; continue; };\n                } else {\n                    if (yych <= '[') { gotoCase = 218; continue; };\n                    if (yych <= '\\\\') { gotoCase = 226; continue; };\n                    { gotoCase = 223; continue; };\n                }\n            }\ncase 225:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 165; continue; };\n            if (yych == '\\r') { gotoCase = 165; continue; };\n            { gotoCase = 218; continue; };\ncase 226:\n            yyaccept = 3;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 217; continue; };\n            if (yych == '\\r') { gotoCase = 217; continue; };\n            { gotoCase = 223; continue; };\ncase 227:\n            yyaccept = 3;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 217; continue; };\n            if (yych == '\\r') { gotoCase = 217; continue; };\n            { gotoCase = 197; continue; };\ncase 228:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 165; continue; };\n                    { gotoCase = 228; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 165; continue; };\n                    if (yych <= ')') { gotoCase = 228; continue; };\n                    { gotoCase = 165; continue; };\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych == '/') { gotoCase = 165; continue; };\n                    { gotoCase = 228; continue; };\n                } else {\n                    if (yych <= '\\\\') { gotoCase = 232; continue; };\n                    if (yych >= '^') { gotoCase = 228; continue; };\n                }\n            }\ncase 230:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 165; continue; };\n                    { gotoCase = 230; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 165; continue; };\n                    if (yych <= ')') { gotoCase = 230; continue; };\n                    { gotoCase = 197; continue; };\n                }\n            } else {\n                if (yych <= 'Z') {\n                    if (yych == '/') { gotoCase = 220; continue; };\n                    { gotoCase = 230; continue; };\n                } else {\n                    if (yych <= '[') { gotoCase = 228; continue; };\n                    if (yych <= '\\\\') { gotoCase = 233; continue; };\n                    { gotoCase = 230; continue; };\n                }\n            }\ncase 232:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 165; continue; };\n            if (yych == '\\r') { gotoCase = 165; continue; };\n            { gotoCase = 228; continue; };\ncase 233:\n            yyaccept = 3;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 217; continue; };\n            if (yych == '\\r') { gotoCase = 217; continue; };\n            { gotoCase = 230; continue; };\ncase 234:\n            yyaccept = 2;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'D') {\n                if (yych <= '/') { gotoCase = 155; continue; };\n                if (yych <= '9') { gotoCase = 234; continue; };\n                { gotoCase = 155; continue; };\n            } else {\n                if (yych <= 'E') { gotoCase = 236; continue; };\n                if (yych != 'e') { gotoCase = 155; continue; };\n            }\ncase 236:\n            yych = this._charAt(++cursor);\n            if (yych <= ',') {\n                if (yych != '+') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= '-') { gotoCase = 237; continue; };\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 238; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 237:\n            yych = this._charAt(++cursor);\n            if (yych <= '/') { gotoCase = 165; continue; };\n            if (yych >= ':') { gotoCase = 165; continue; };\ncase 238:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '/') { gotoCase = 155; continue; };\n            if (yych <= '9') { gotoCase = 238; continue; };\n            { gotoCase = 155; continue; };\ncase 240:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 241:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 165; continue; };\n                if (yych <= '\\f') { gotoCase = 240; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= '\\'') {\n                    if (yych <= '&') { gotoCase = 240; continue; };\n                    { gotoCase = 243; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 240; continue; };\n                }\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'a') {\n                if (yych <= '!') {\n                    if (yych <= '\\n') {\n                        if (yych <= '\\t') { gotoCase = 165; continue; };\n                        { gotoCase = 246; continue; };\n                    } else {\n                        if (yych == '\\r') { gotoCase = 246; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                } else {\n                    if (yych <= '\\'') {\n                        if (yych <= '\"') { gotoCase = 240; continue; };\n                        if (yych <= '&') { gotoCase = 165; continue; };\n                        { gotoCase = 240; continue; };\n                    } else {\n                        if (yych == '\\\\') { gotoCase = 240; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'q') {\n                    if (yych <= 'f') {\n                        if (yych <= 'b') { gotoCase = 240; continue; };\n                        if (yych <= 'e') { gotoCase = 165; continue; };\n                        { gotoCase = 240; continue; };\n                    } else {\n                        if (yych == 'n') { gotoCase = 240; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych == 's') { gotoCase = 165; continue; };\n                        { gotoCase = 240; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 245; continue; };\n                        if (yych <= 'v') { gotoCase = 240; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                }\n            }\ncase 243:\n            ++cursor;\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 245:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 248; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 248; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych <= 'f') { gotoCase = 248; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 246:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.SSTRING);\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 248:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 249; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 249:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 250; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 250:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 240; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 240; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych <= 'f') { gotoCase = 240; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 251:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 252:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 165; continue; };\n                if (yych <= '\\f') { gotoCase = 251; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= '\"') {\n                    if (yych <= '!') { gotoCase = 251; continue; };\n                    { gotoCase = 243; continue; };\n                } else {\n                    if (yych != '\\\\') { gotoCase = 251; continue; };\n                }\n            }\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'a') {\n                if (yych <= '!') {\n                    if (yych <= '\\n') {\n                        if (yych <= '\\t') { gotoCase = 165; continue; };\n                        { gotoCase = 255; continue; };\n                    } else {\n                        if (yych == '\\r') { gotoCase = 255; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                } else {\n                    if (yych <= '\\'') {\n                        if (yych <= '\"') { gotoCase = 251; continue; };\n                        if (yych <= '&') { gotoCase = 165; continue; };\n                        { gotoCase = 251; continue; };\n                    } else {\n                        if (yych == '\\\\') { gotoCase = 251; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'q') {\n                    if (yych <= 'f') {\n                        if (yych <= 'b') { gotoCase = 251; continue; };\n                        if (yych <= 'e') { gotoCase = 165; continue; };\n                        { gotoCase = 251; continue; };\n                    } else {\n                        if (yych == 'n') { gotoCase = 251; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych == 's') { gotoCase = 165; continue; };\n                        { gotoCase = 251; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 254; continue; };\n                        if (yych <= 'v') { gotoCase = 251; continue; };\n                        { gotoCase = 165; continue; };\n                    }\n                }\n            }\ncase 254:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 257; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 257; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych <= 'f') { gotoCase = 257; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 255:\n            ++cursor;\n            this.setLexCondition(this._lexConditions.DSTRING);\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 257:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 258; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 258:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych >= ':') { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 259; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych >= 'g') { gotoCase = 165; continue; };\n            }\ncase 259:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 165; continue; };\n                if (yych <= '9') { gotoCase = 251; continue; };\n                { gotoCase = 165; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 251; continue; };\n                if (yych <= '`') { gotoCase = 165; continue; };\n                if (yych <= 'f') { gotoCase = 251; continue; };\n                { gotoCase = 165; continue; };\n            }\ncase 260:\n            ++cursor;\n            if ((yych = this._charAt(cursor)) == '=') { gotoCase = 163; continue; };\n            { gotoCase = 139; continue; };\n/* *********************************** */\ncase this.case_REGEX:\n            yych = this._charAt(cursor);\n            if (yych <= '.') {\n                if (yych <= '\\n') {\n                    if (yych <= '\\t') { gotoCase = 264; continue; };\n                    { gotoCase = 265; continue; };\n                } else {\n                    if (yych == '\\r') { gotoCase = 265; continue; };\n                    { gotoCase = 264; continue; };\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych <= '/') { gotoCase = 267; continue; };\n                    if (yych <= 'Z') { gotoCase = 264; continue; };\n                    { gotoCase = 269; continue; };\n                } else {\n                    if (yych <= '\\\\') { gotoCase = 270; continue; };\n                    if (yych <= ']') { gotoCase = 265; continue; };\n                    { gotoCase = 264; continue; };\n                }\n            }\ncase 263:\n            { this.tokenType = \"javascript-regexp\"; return cursor; }\ncase 264:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 272; continue; };\ncase 265:\n            ++cursor;\ncase 266:\n            { this.tokenType = null; return cursor; }\ncase 267:\n            ++cursor;\n            yych = this._charAt(cursor);\n            { gotoCase = 278; continue; };\ncase 268:\n            this.setLexCondition(this._lexConditions.NODIV);\n            { this.tokenType = \"javascript-regexp\"; return cursor; }\ncase 269:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 266; continue; };\n                if (yych <= '\\f') { gotoCase = 276; continue; };\n                { gotoCase = 266; continue; };\n            } else {\n                if (yych <= '*') {\n                    if (yych <= ')') { gotoCase = 276; continue; };\n                    { gotoCase = 266; continue; };\n                } else {\n                    if (yych == '/') { gotoCase = 266; continue; };\n                    { gotoCase = 276; continue; };\n                }\n            }\ncase 270:\n            yych = this._charAt(++cursor);\n            if (yych == '\\n') { gotoCase = 266; continue; };\n            if (yych == '\\r') { gotoCase = 266; continue; };\ncase 271:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 272:\n            if (yych <= '.') {\n                if (yych <= '\\n') {\n                    if (yych <= '\\t') { gotoCase = 271; continue; };\n                    { gotoCase = 263; continue; };\n                } else {\n                    if (yych == '\\r') { gotoCase = 263; continue; };\n                    { gotoCase = 271; continue; };\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych <= '/') { gotoCase = 277; continue; };\n                    if (yych <= 'Z') { gotoCase = 271; continue; };\n                    { gotoCase = 275; continue; };\n                } else {\n                    if (yych <= '\\\\') { gotoCase = 273; continue; };\n                    if (yych <= ']') { gotoCase = 263; continue; };\n                    { gotoCase = 271; continue; };\n                }\n            }\ncase 273:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 274; continue; };\n            if (yych != '\\r') { gotoCase = 271; continue; };\ncase 274:\n            cursor = YYMARKER;\n            if (yyaccept <= 0) {\n                { gotoCase = 263; continue; };\n            } else {\n                { gotoCase = 266; continue; };\n            }\ncase 275:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 276:\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 274; continue; };\n                    { gotoCase = 275; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 274; continue; };\n                    if (yych <= ')') { gotoCase = 275; continue; };\n                    { gotoCase = 274; continue; };\n                }\n            } else {\n                if (yych <= '[') {\n                    if (yych == '/') { gotoCase = 274; continue; };\n                    { gotoCase = 275; continue; };\n                } else {\n                    if (yych <= '\\\\') { gotoCase = 281; continue; };\n                    if (yych <= ']') { gotoCase = 279; continue; };\n                    { gotoCase = 275; continue; };\n                }\n            }\ncase 277:\n            ++cursor;\n            yych = this._charAt(cursor);\ncase 278:\n            if (yych <= 'h') {\n                if (yych == 'g') { gotoCase = 277; continue; };\n                { gotoCase = 268; continue; };\n            } else {\n                if (yych <= 'i') { gotoCase = 277; continue; };\n                if (yych == 'm') { gotoCase = 277; continue; };\n                { gotoCase = 268; continue; };\n            }\ncase 279:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '*') {\n                if (yych <= '\\f') {\n                    if (yych == '\\n') { gotoCase = 263; continue; };\n                    { gotoCase = 279; continue; };\n                } else {\n                    if (yych <= '\\r') { gotoCase = 263; continue; };\n                    if (yych <= ')') { gotoCase = 279; continue; };\n                    { gotoCase = 271; continue; };\n                }\n            } else {\n                if (yych <= 'Z') {\n                    if (yych == '/') { gotoCase = 277; continue; };\n                    { gotoCase = 279; continue; };\n                } else {\n                    if (yych <= '[') { gotoCase = 275; continue; };\n                    if (yych <= '\\\\') { gotoCase = 282; continue; };\n                    { gotoCase = 279; continue; };\n                }\n            }\ncase 281:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 274; continue; };\n            if (yych == '\\r') { gotoCase = 274; continue; };\n            { gotoCase = 275; continue; };\ncase 282:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych == '\\n') { gotoCase = 274; continue; };\n            if (yych == '\\r') { gotoCase = 274; continue; };\n            { gotoCase = 279; continue; };\n/* *********************************** */\ncase this.case_SSTRING:\n            yych = this._charAt(cursor);\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 287; continue; };\n                if (yych <= '\\f') { gotoCase = 286; continue; };\n                { gotoCase = 287; continue; };\n            } else {\n                if (yych <= '\\'') {\n                    if (yych <= '&') { gotoCase = 286; continue; };\n                    { gotoCase = 289; continue; };\n                } else {\n                    if (yych == '\\\\') { gotoCase = 291; continue; };\n                    { gotoCase = 286; continue; };\n                }\n            }\ncase 285:\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 286:\n            yyaccept = 0;\n            yych = this._charAt(YYMARKER = ++cursor);\n            { gotoCase = 293; continue; };\ncase 287:\n            ++cursor;\ncase 288:\n            { this.tokenType = null; return cursor; }\ncase 289:\n            ++cursor;\ncase 290:\n            this.setLexCondition(this._lexConditions.NODIV);\n            { this.tokenType = \"javascript-string\"; return cursor; }\ncase 291:\n            yyaccept = 1;\n            yych = this._charAt(YYMARKER = ++cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 292; continue; };\n                    if (yych <= '&') { gotoCase = 288; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych <= '[') { gotoCase = 288; continue; };\n                    } else {\n                        if (yych != 'b') { gotoCase = 288; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych >= 'g') { gotoCase = 288; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 292; continue; };\n                        if (yych <= 'q') { gotoCase = 288; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych <= 's') { gotoCase = 288; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 294; continue; };\n                        if (yych >= 'w') { gotoCase = 288; continue; };\n                    }\n                }\n            }\ncase 292:\n            yyaccept = 0;\n            YYMARKER = ++cursor;\n            yych = this._charAt(cursor);\ncase 293:\n            if (yych <= '\\r') {\n                if (yych == '\\n') { gotoCase = 285; continue; };\n                if (yych <= '\\f') { gotoCase = 292; continue; };\n                { gotoCase = 285; continue; };\n            } else {\n                if (yych <= '\\'') {\n                    if (yych <= '&') { gotoCase = 292; continue; };\n                    { gotoCase = 300; continue; };\n                } else {\n                    if (yych == '\\\\') { gotoCase = 299; continue; };\n                    { gotoCase = 292; continue; };\n                }\n            }\ncase 294:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 295; continue; };\n                if (yych <= '9') { gotoCase = 296; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 296; continue; };\n                if (yych <= '`') { gotoCase = 295; continue; };\n                if (yych <= 'f') { gotoCase = 296; continue; };\n            }\ncase 295:\n            cursor = YYMARKER;\n            if (yyaccept <= 0) {\n                { gotoCase = 285; continue; };\n            } else {\n                { gotoCase = 288; continue; };\n            }\ncase 296:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 295; continue; };\n                if (yych >= ':') { gotoCase = 295; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 297; continue; };\n                if (yych <= '`') { gotoCase = 295; continue; };\n                if (yych >= 'g') { gotoCase = 295; continue; };\n            }\ncase 297:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 295; continue; };\n                if (yych >= ':') { gotoCase = 295; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 298; continue; };\n                if (yych <= '`') { gotoCase = 295; continue; };\n                if (yych >= 'g') { gotoCase = 295; continue; };\n            }\ncase 298:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= '@') {\n                if (yych <= '/') { gotoCase = 295; continue; };\n                if (yych <= '9') { gotoCase = 292; continue; };\n                { gotoCase = 295; continue; };\n            } else {\n                if (yych <= 'F') { gotoCase = 292; continue; };\n                if (yych <= '`') { gotoCase = 295; continue; };\n                if (yych <= 'f') { gotoCase = 292; continue; };\n                { gotoCase = 295; continue; };\n            }\ncase 299:\n            ++cursor;\n            yych = this._charAt(cursor);\n            if (yych <= 'e') {\n                if (yych <= '\\'') {\n                    if (yych == '\"') { gotoCase = 292; continue; };\n                    if (yych <= '&') { gotoCase = 295; continue; };\n                    { gotoCase = 292; continue; };\n                } else {\n                    if (yych <= '\\\\') {\n                        if (yych <= '[') { gotoCase = 295; continue; };\n                        { gotoCase = 292; continue; };\n                    } else {\n                        if (yych == 'b') { gotoCase = 292; continue; };\n                        { gotoCase = 295; continue; };\n                    }\n                }\n            } else {\n                if (yych <= 'r') {\n                    if (yych <= 'm') {\n                        if (yych <= 'f') { gotoCase = 292; continue; };\n                        { gotoCase = 295; continue; };\n                    } else {\n                        if (yych <= 'n') { gotoCase = 292; continue; };\n                        if (yych <= 'q') { gotoCase = 295; continue; };\n                        { gotoCase = 292; continue; };\n                    }\n                } else {\n                    if (yych <= 't') {\n                        if (yych <= 's') { gotoCase = 295; continue; };\n                        { gotoCase = 292; continue; };\n                    } else {\n                        if (yych <= 'u') { gotoCase = 294; continue; };\n                        if (yych <= 'v') { gotoCase = 292; continue; };\n                        { gotoCase = 295; continue; };\n                    }\n                }\n            }\ncase 300:\n            ++cursor;\n            yych = this._charAt(cursor);\n            { gotoCase = 290; continue; };\n        }\n\n        }\n    }\n}\n\nWebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceJavaScriptTokenizer.re2js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Generate js file as follows:\n//\n// re2c -isc WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js \\\n// | sed 's|^yy\\([^:]*\\)*\\:|case \\1:|' \\\n// | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \\\n// | sed 's|[[*][+][+]cursor|this._charAt(++cursor)|' \\\n// | sed 's|[*]cursor|this._charAt(cursor)|' \\\n// | sed 's|yych = \\*\\([^;]*\\)|yych = this._charAt\\1|' \\\n// | sed 's|goto case \\([^;]*\\)|{ gotoCase = \\1; continue; }|' \\\n// | sed 's|unsigned\\ int|var|' \\\n// | sed 's|var\\ yych|case 1: var yych|'\n\nWebInspector.SourceJavaScriptTokenizer = function()\n{\n    WebInspector.SourceTokenizer.call(this);\n\n    this._keywords = [\n        \"null\", \"true\", \"false\", \"break\", \"case\", \"catch\", \"const\", \"default\", \"finally\", \"for\",\n        \"instanceof\", \"new\", \"var\", \"continue\", \"function\", \"return\", \"void\", \"delete\", \"if\",\n        \"this\", \"do\", \"while\", \"else\", \"in\", \"switch\", \"throw\", \"try\", \"typeof\", \"debugger\",\n        \"class\", \"enum\", \"export\", \"extends\", \"import\", \"super\", \"get\", \"set\", \"with\"\n    ].keySet();\n\n    this._lexConditions = {\n        DIV: 0,\n        NODIV: 1,\n        COMMENT: 2,\n        DSTRING: 3,\n        SSTRING: 4,\n        REGEX: 5\n    };\n\n    this.case_DIV = 1000;\n    this.case_NODIV = 1001;\n    this.case_COMMENT = 1002;\n    this.case_DSTRING = 1003;\n    this.case_SSTRING = 1004;\n    this.case_REGEX = 1005;\n\n    this.initialCondition = { lexCondition: this._lexConditions.NODIV }\n    this.condition = this.initialCondition;\n}\n\nWebInspector.SourceJavaScriptTokenizer.prototype = {\n    nextToken: function(cursor)\n    {\n        var cursorOnEnter = cursor;\n        var gotoCase = 1;\n        while (1) {\n            switch (gotoCase)\n            // Following comment is replaced with generated state machine.\n            /*!re2c\n                re2c:define:YYCTYPE  = \"var\";\n                re2c:define:YYCURSOR = cursor;\n                re2c:define:YYGETCONDITION = \"this.getLexCondition\";\n                re2c:define:YYSETCONDITION = \"this.setLexCondition\";\n                re2c:condprefix = \"case this.case_\";\n                re2c:condenumprefix = \"this._lexConditions.\";\n                re2c:yyfill:enable = 0;\n                re2c:labelprefix = \"case \";\n                re2c:indent:top = 2;\n                re2c:indent:string = \"    \";\n\n                LineComment = \"//\" [^\\r\\n]*;\n                CommentContent = ([^*\\r\\n] | (\"*\"+[^/*]))*;\n                Comment = \"/*\" CommentContent \"*\"+ \"/\";\n                CommentStart = \"/*\" CommentContent [\\r\\n];\n                CommentEnd = CommentContent \"*\"+ \"/\";\n\n                DecimalDigit = [0-9];\n                NonZeroDigit = [1-9];\n                OctalDigit = [0-7];\n                HexDigit = [0-9a-fA-F];\n                SignedInteger = (\"+\"|\"-\")? DecimalDigit+;\n                ExponentPart = (\"e\" | \"E\") SignedInteger;\n                DecimalIntegerLiteral = \"0\" | NonZeroDigit DecimalDigit*;\n                DecimalLiteral = DecimalIntegerLiteral \".\" DecimalDigit* ExponentPart? | \".\" DecimalDigit+ ExponentPart? | DecimalIntegerLiteral ExponentPart?;\n                HexIntegerLiteral = \"0\" (\"x\"|\"X\") HexDigit+;\n                OctalIntegerLiteral = \"0\" OctalDigit+;\n                NumericLiteral = DecimalLiteral | HexIntegerLiteral | OctalIntegerLiteral;\n\n                Punctuation = [\\!\\%\\&\\(\\*\\+\\,\\-\\.\\:\\;\\<\\=\\>\\?\\[\\]\\^\\{\\|\\}\\~] | \"!=\" | \"!==\" | \"%=\" | \"&&\" | \"&=\" | \"*=\" | \"++\" | \"+=\" | \"--\" | \"-=\" | \"<<\" | \"<<=\"  | \"<=\" | \"==\" | \"===\" | \">=\" | \">>\" | \">>=\" | \">>>\" | \">>>=\" | \"^=\" | \"|=\" | \"||\";\n                Division = \"/\" | \"/=\";\n                RightParen = \")\";\n\n                Letter = [a-zA-Z\\x80-\\xFF];\n                UnicodeEscapeSequence = \"\\\\u\" HexDigit HexDigit HexDigit HexDigit;\n\n                IdentifierStart = Letter | \"_\" | \"$\" | UnicodeEscapeSequence;\n                IdentifierPart = IdentifierStart | DecimalDigit;\n                Identifier = IdentifierStart IdentifierPart *;\n\n                DoubleStringContent = ([^\\r\\n\\\"\\\\] | UnicodeEscapeSequence | \"\\\\\" ['\"\\\\bfnrtv])*;\n                SingleStringContent = ([^\\r\\n\\'\\\\] | UnicodeEscapeSequence | \"\\\\\" ['\"\\\\bfnrtv])*;\n                StringLiteral = \"\\\"\" DoubleStringContent \"\\\"\" | \"'\" SingleStringContent \"'\";\n                DoubleStringStart = \"\\\"\" DoubleStringContent \"\\\\\" [\\r\\n];\n                DoubleStringEnd = DoubleStringContent \"\\\"\";\n                SingleStringStart = \"'\" SingleStringContent \"\\\\\" [\\r\\n];\n                SingleStringEnd = SingleStringContent \"'\";\n\n                BackslashSequence = \"\\\\\" [^\\r\\n];\n                RegexSet = \"[\" ([^\\r\\n*\\\\/] | BackslashSequence)* \"]\";\n                RegexFirstChar = [^\\r\\n*\\\\/\\[\\]] | BackslashSequence | RegexSet;\n                RegexChar = [^\\r\\n\\\\/\\[\\]] | BackslashSequence | RegexSet;\n                RegexContent = RegexChar*;\n                Regex = \"/\" RegexFirstChar RegexContent \"/\" [igm]*;\n                RegexStart = \"/\" RegexFirstChar RegexContent \"\\\\\";\n                RegexEnd = RegexContent \"/\" [igm]*;\n\n                <DIV,NODIV> LineComment { this.tokenType = \"javascript-comment\"; return cursor; }\n                <DIV,NODIV> Comment { this.tokenType = \"javascript-comment\"; return cursor; }\n                <DIV,NODIV> CommentStart => COMMENT { this.tokenType = \"javascript-comment\"; return cursor; }\n                <COMMENT> CommentContent => COMMENT { this.tokenType = \"javascript-comment\"; return cursor; }\n                <COMMENT> CommentEnd => NODIV { this.tokenType = \"javascript-comment\"; return cursor; }\n\n                <DIV,NODIV> StringLiteral { this.tokenType = \"javascript-string\"; return cursor; }\n                <DIV,NODIV> DoubleStringStart => DSTRING { this.tokenType = \"javascript-string\"; return cursor; }\n                <DSTRING> DoubleStringContent => DSTRING { this.tokenType = \"javascript-string\"; return cursor; }\n                <DSTRING> DoubleStringEnd => NODIV { this.tokenType = \"javascript-string\"; return cursor; }\n                <DIV,NODIV> SingleStringStart => SSTRING { this.tokenType = \"javascript-string\"; return cursor; }\n                <SSTRING> SingleStringContent => SSTRING { this.tokenType = \"javascript-string\"; return cursor; }\n                <SSTRING> SingleStringEnd => NODIV { this.tokenType = \"javascript-string\"; return cursor; }\n\n                <NODIV> Regex { this.tokenType = \"javascript-regexp\"; return cursor; }\n                <NODIV> RegexStart => REGEX { this.tokenType = \"javascript-regexp\"; return cursor; }\n                <REGEX> RegexContent => REGEX { this.tokenType = \"javascript-regexp\"; return cursor; }\n                <REGEX> RegexEnd => NODIV { this.tokenType = \"javascript-regexp\"; return cursor; }\n\n                <DIV,NODIV> NumericLiteral => DIV { this.tokenType = \"javascript-number\"; return cursor; }\n                <DIV,NODIV> Identifier => DIV\n                {\n                    var token = this._line.substring(cursorOnEnter, cursor);\n                    if (token in this._keywords)\n                        this.tokenType = \"javascript-keyword\";\n                    else\n                        this.tokenType = \"javascript-ident\";\n                    return cursor;\n                }\n                <DIV,NODIV> RightParen => DIV { this.tokenType = null; return cursor; }\n                <DIV,NODIV> Punctuation => NODIV { this.tokenType = null; return cursor; }\n                <DIV> Division => NODIV { this.tokenType = null; return cursor; }\n                <*> [^] { this.tokenType = null; return cursor; }\n            */\n        }\n    }\n}\n\nWebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SourceTokenizer.js",
    "content": "/* Generated by re2c 0.13.5 on Tue Jan 26 01:16:33 2010 */\n/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.SourceTokenizer = function()\n{\n}\n\nWebInspector.SourceTokenizer.prototype = {\n    set line(line) {\n        this._line = line;\n    },\n\n    set condition(condition)\n    {\n        this._condition = condition;\n    },\n\n    get condition()\n    {\n        return this._condition;\n    },\n\n    get subTokenizer()\n    {\n        return this._condition.subTokenizer;\n    },\n\n    getLexCondition: function()\n    {\n        return this.condition.lexCondition;\n    },\n\n    setLexCondition: function(lexCondition)\n    {\n        this.condition.lexCondition = lexCondition;\n    },\n\n    _charAt: function(cursor)\n    {\n        return cursor < this._line.length ? this._line.charAt(cursor) : \"\\n\";\n    }\n}\n\n\nWebInspector.SourceTokenizer.Registry = function() {\n    this._tokenizers = {};\n    this._tokenizerConstructors = {\n        \"text/css\": \"SourceCSSTokenizer\",\n        \"text/html\": \"SourceHTMLTokenizer\",\n        \"text/javascript\": \"SourceJavaScriptTokenizer\"\n    };\n}\n\nWebInspector.SourceTokenizer.Registry.getInstance = function()\n{\n    if (!WebInspector.SourceTokenizer.Registry._instance)\n        WebInspector.SourceTokenizer.Registry._instance = new WebInspector.SourceTokenizer.Registry();\n    return WebInspector.SourceTokenizer.Registry._instance;\n}\n\nWebInspector.SourceTokenizer.Registry.prototype = {\n    getTokenizer: function(mimeType)\n    {\n        if (!this._tokenizerConstructors[mimeType])\n            return null;\n        var tokenizerClass = this._tokenizerConstructors[mimeType];\n        var tokenizer = this._tokenizers[tokenizerClass];\n        if (!tokenizer) {\n            tokenizer = new WebInspector[tokenizerClass]();\n            this._tokenizers[mimeType] = tokenizer;\n        }\n        return tokenizer;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/StatusBarButton.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.StatusBarButton = function(title, className, states)\n{\n    this.element = document.createElement(\"button\");\n    this.element.className = className + \" status-bar-item\";\n    this.element.addEventListener(\"click\", this._clicked.bind(this), false);\n\n    this.glyph = document.createElement(\"div\");\n    this.glyph.className = \"glyph\";\n    this.element.appendChild(this.glyph);\n\n    this.glyphShadow = document.createElement(\"div\");\n    this.glyphShadow.className = \"glyph shadow\";\n    this.element.appendChild(this.glyphShadow);\n    \n    this.states = states;\n    if (!states)\n        this.states = 2;\n\n    if (states == 2)\n        this._state = false;\n    else\n        this._state = 0;\n    \n    this.title = title;\n    this.disabled = false;\n    this._visible = true;\n}\n\nWebInspector.StatusBarButton.prototype = {\n    _clicked: function()\n    {\n        this.dispatchEventToListeners(\"click\");\n    },\n\n    get disabled()\n    {\n        return this._disabled;\n    },\n\n    set disabled(x)\n    {\n        if (this._disabled === x)\n            return;\n        this._disabled = x;\n        this.element.disabled = x;\n    },\n\n    get title()\n    {\n        return this._title;\n    },\n\n    set title(x)\n    {\n        if (this._title === x)\n            return;\n        this._title = x;\n        this.element.title = x;\n    },\n    \n    get state()\n    {\n        return this._state;\n    },\n    \n    set state(x)\n    {\n        if (this._state === x)\n            return;\n        \n        if (this.states === 2) {\n            if (x)\n                this.element.addStyleClass(\"toggled-on\");\n            else\n                this.element.removeStyleClass(\"toggled-on\");\n        } else {\n            if (x !== 0) {\n                this.element.removeStyleClass(\"toggled-\" + this._state);\n                this.element.addStyleClass(\"toggled-\" + x);\n            } else \n                this.element.removeStyleClass(\"toggled-\" + this._state);\n        }\n        this._state = x;\n    },\n\n    get toggled()\n    {\n        if (this.states !== 2)\n            throw(\"Only used toggled when there are 2 states, otherwise, use state\");\n        return this.state;\n    },\n\n    set toggled(x)\n    {\n        if (this.states !== 2)\n            throw(\"Only used toggled when there are 2 states, otherwise, use state\");\n        this.state = x;\n    },\n\n    get visible()\n    {\n        return this._visible;\n    },\n\n    set visible(x)\n    {\n        if (this._visible === x)\n            return;\n\n        if (x)\n            this.element.removeStyleClass(\"hidden\");\n        else\n            this.element.addStyleClass(\"hidden\");\n        this._visible = x;\n    }\n}\n\nWebInspector.StatusBarButton.prototype.__proto__ = WebInspector.Object.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/StylesSidebarPane.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.StylesSidebarPane = function(computedStylePane)\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Styles\"));\n\n    this.settingsSelectElement = document.createElement(\"select\");\n\n    var option = document.createElement(\"option\");\n    option.value = \"original\";\n    option.action = this._changeColorFormat.bind(this);\n    option.label = WebInspector.UIString(\"As Authored\");\n    this.settingsSelectElement.appendChild(option);\n\n    var option = document.createElement(\"option\");\n    option.value = \"hex\";\n    option.action = this._changeColorFormat.bind(this);\n    option.label = WebInspector.UIString(\"Hex Colors\");\n    this.settingsSelectElement.appendChild(option);\n\n    option = document.createElement(\"option\");\n    option.value = \"rgb\";\n    option.action = this._changeColorFormat.bind(this);\n    option.label = WebInspector.UIString(\"RGB Colors\");\n    this.settingsSelectElement.appendChild(option);\n\n    option = document.createElement(\"option\");\n    option.value = \"hsl\";\n    option.action = this._changeColorFormat.bind(this);\n    option.label = WebInspector.UIString(\"HSL Colors\");\n    this.settingsSelectElement.appendChild(option);\n\n    this.settingsSelectElement.appendChild(document.createElement(\"hr\"));\n\n    option = document.createElement(\"option\");\n    option.action = this._createNewRule.bind(this);\n    option.label = WebInspector.UIString(\"New Style Rule\");\n    this.settingsSelectElement.appendChild(option);\n\n    this.settingsSelectElement.addEventListener(\"click\", function(event) { event.stopPropagation() }, false);\n    this.settingsSelectElement.addEventListener(\"change\", this._changeSetting.bind(this), false);\n    var format = WebInspector.settings.colorFormat;\n    if (format === \"original\")\n        this.settingsSelectElement[0].selected = true;\n    else if (format === \"hex\")\n        this.settingsSelectElement[1].selected = true;\n    else if (format === \"rgb\")\n        this.settingsSelectElement[2].selected = true;\n    else if (format === \"hsl\")\n        this.settingsSelectElement[3].selected = true;\n\n    this.titleElement.appendChild(this.settingsSelectElement);\n    this._computedStylePane = computedStylePane;\n    this.element.addEventListener(\"contextmenu\", this._contextMenuEventFired.bind(this), true);\n}\n\nWebInspector.StylesSidebarPane.StyleValueDelimiters = \" \\t\\n\\\"':;,/()\";\n\n// Taken from http://www.w3.org/TR/CSS21/propidx.html.\nWebInspector.StylesSidebarPane.InheritedProperties = [\n    \"azimuth\", \"border-collapse\", \"border-spacing\", \"caption-side\", \"color\", \"cursor\", \"direction\", \"elevation\",\n    \"empty-cells\", \"font-family\", \"font-size\", \"font-style\", \"font-variant\", \"font-weight\", \"font\", \"letter-spacing\",\n    \"line-height\", \"list-style-image\", \"list-style-position\", \"list-style-type\", \"list-style\", \"orphans\", \"pitch-range\",\n    \"pitch\", \"quotes\", \"richness\", \"speak-header\", \"speak-numeral\", \"speak-punctuation\", \"speak\", \"speech-rate\", \"stress\",\n    \"text-align\", \"text-indent\", \"text-transform\", \"text-shadow\", \"visibility\", \"voice-family\", \"volume\", \"white-space\", \"widows\", \"word-spacing\"\n].keySet();\n\n// Keep in sync with RenderStyleConstants.h PseudoId enum. Array below contains pseudo id names for corresponding enum indexes.\n// First item is empty due to its artificial NOPSEUDO nature in the enum.\n// FIXME: find a way of generating this mapping or getting it from combination of RenderStyleConstants and CSSSelector.cpp at\n// runtime.\nWebInspector.StylesSidebarPane.PseudoIdNames = [\n    \"\", \"first-line\", \"first-letter\", \"before\", \"after\", \"selection\", \"\", \"-webkit-scrollbar\", \"-webkit-file-upload-button\",\n    \"-webkit-input-placeholder\", \"-webkit-slider-thumb\", \"-webkit-search-cancel-button\", \"-webkit-search-decoration\",\n    \"-webkit-search-results-decoration\", \"-webkit-search-results-button\", \"-webkit-media-controls-panel\",\n    \"-webkit-media-controls-play-button\", \"-webkit-media-controls-mute-button\", \"-webkit-media-controls-timeline\",\n    \"-webkit-media-controls-timeline-container\", \"-webkit-media-controls-volume-slider\",\n    \"-webkit-media-controls-volume-slider-container\", \"-webkit-media-controls-current-time-display\",\n    \"-webkit-media-controls-time-remaining-display\", \"-webkit-media-controls-seek-back-button\", \"-webkit-media-controls-seek-forward-button\",\n    \"-webkit-media-controls-fullscreen-button\", \"-webkit-media-controls-rewind-button\", \"-webkit-media-controls-return-to-realtime-button\",\n    \"-webkit-media-controls-toggle-closed-captions-button\", \"-webkit-media-controls-status-display\", \"-webkit-scrollbar-thumb\",\n    \"-webkit-scrollbar-button\", \"-webkit-scrollbar-track\", \"-webkit-scrollbar-track-piece\", \"-webkit-scrollbar-corner\",\n    \"-webkit-resizer\", \"-webkit-input-list-button\", \"-webkit-inner-spin-button\", \"-webkit-outer-spin-button\"\n];\n\nWebInspector.StylesSidebarPane.prototype = {\n    _contextMenuEventFired: function(event)\n    {\n        var href = event.target.enclosingNodeOrSelfWithClass(\"webkit-html-resource-link\") || event.target.enclosingNodeOrSelfWithClass(\"webkit-html-external-link\");\n        if (href) {\n            var contextMenu = new WebInspector.ContextMenu();\n            var filled = WebInspector.panels.elements.populateHrefContextMenu(contextMenu, event, href);\n            if (filled)\n                contextMenu.show(event);\n        }\n    },\n\n    update: function(node, editedSection, forceUpdate)\n    {\n        var refresh = false;\n\n        if (forceUpdate)\n            delete this.node;\n\n        if (!forceUpdate && (!node || node === this.node))\n            refresh = true;\n\n        if (node && node.nodeType === Node.TEXT_NODE && node.parentNode)\n            node = node.parentNode;\n\n        if (node && node.nodeType !== Node.ELEMENT_NODE)\n            node = null;\n\n        if (node)\n            this.node = node;\n        else\n            node = this.node;\n\n        if (!node) {\n            this.bodyElement.removeChildren();\n            this._computedStylePane.bodyElement.removeChildren();\n            this.sections = {};\n            return;\n        }\n\n        function stylesCallback(styles)\n        {\n            if (styles)\n                this._rebuildUpdate(node, styles);\n        }\n\n        function computedStyleCallback(computedStyle)\n        {\n            if (computedStyle)\n                this._refreshUpdate(node, computedStyle, editedSection);\n        }\n\n        if (refresh)\n            WebInspector.cssModel.getComputedStyleAsync(node.id, computedStyleCallback.bind(this));\n        else\n            WebInspector.cssModel.getStylesAsync(node.id, stylesCallback.bind(this));\n    },\n\n    _refreshUpdate: function(node, computedStyle, editedSection)\n    {\n        for (var pseudoId in this.sections) {\n            var styleRules = this._refreshStyleRules(this.sections[pseudoId], computedStyle);\n            var usedProperties = {};\n            var disabledComputedProperties = {};\n            this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);\n            this._refreshSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, editedSection);\n        }\n        // Trace the computed style.\n        this.sections[0][0].rebuildComputedTrace(this.sections[0]);\n    },\n\n    _rebuildUpdate: function(node, styles)\n    {\n        this.bodyElement.removeChildren();\n        this._computedStylePane.bodyElement.removeChildren();\n\n        var styleRules = this._rebuildStyleRules(node, styles);\n        var usedProperties = {};\n        var disabledComputedProperties = {};\n        this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);\n        this.sections[0] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, 0);\n        var anchorElement = this.sections[0].inheritedPropertiesSeparatorElement;\n        // Trace the computed style.\n        this.sections[0][0].rebuildComputedTrace(this.sections[0]);\n\n        for (var i = 0; i < styles.pseudoElements.length; ++i) {\n            var pseudoElementCSSRules = styles.pseudoElements[i];\n\n            styleRules = [];\n            var pseudoId = pseudoElementCSSRules.pseudoId;\n\n            var entry = { isStyleSeparator: true, pseudoId: pseudoId };\n            styleRules.push(entry);\n\n            // Add rules in reverse order to match the cascade order.\n            for (var j = pseudoElementCSSRules.rules.length - 1; j >= 0; --j) {\n                var rule = pseudoElementCSSRules.rules[j];\n                styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule, editable: !!(rule.style && rule.style.id) });\n            }\n            usedProperties = {};\n            disabledComputedProperties = {};\n            this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);\n            this.sections[pseudoId] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, pseudoId, anchorElement);\n        }\n    },\n\n    _refreshStyleRules: function(sections, computedStyle)\n    {\n        var nodeComputedStyle = computedStyle;\n        var styleRules = [];\n        for (var i = 0; sections && i < sections.length; ++i) {\n            var section = sections[i];\n            if (section instanceof WebInspector.BlankStylePropertiesSection)\n                continue;\n            if (section.computedStyle)\n                section.styleRule.style = nodeComputedStyle;\n            var styleRule = { section: section, style: section.styleRule.style, computedStyle: section.computedStyle, rule: section.rule, editable: !!(section.styleRule.style && section.styleRule.style.id) };\n            styleRules.push(styleRule);\n        }\n        return styleRules;\n    },\n\n    _rebuildStyleRules: function(node, styles)\n    {\n        var nodeComputedStyle = styles.computedStyle;\n        this.sections = {};\n\n        var styleRules = [];\n\n        styleRules.push({ computedStyle: true, selectorText: \"\", style: nodeComputedStyle, editable: false });\n\n        var styleAttributes = {};\n        for (var name in styles.styleAttributes) {\n            var attrStyle = { style: styles.styleAttributes[name], editable: false };\n            attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName) + \"[\" + name;\n            if (node.getAttribute(name))\n                attrStyle.selectorText += \"=\" + node.getAttribute(name);\n            attrStyle.selectorText += \"]\";\n            styleRules.push(attrStyle);\n        }\n\n        // Show element's Style Attributes\n        if (styles.inlineStyle && node.nodeType === Node.ELEMENT_NODE) {\n            var inlineStyle = { selectorText: \"element.style\", style: styles.inlineStyle, isAttribute: true };\n            styleRules.push(inlineStyle);\n        }\n\n        // Add rules in reverse order to match the cascade order.\n        if (styles.matchedCSSRules.length)\n            styleRules.push({ isStyleSeparator: true, text: WebInspector.UIString(\"Matched CSS Rules\") });\n        for (var i = styles.matchedCSSRules.length - 1; i >= 0; --i) {\n            var rule = styles.matchedCSSRules[i];\n            styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule, editable: !!(rule.style && rule.style.id) });\n        }\n\n        // Walk the node structure and identify styles with inherited properties.\n        var parentNode = node.parentNode;\n        function insertInheritedNodeSeparator(node)\n        {\n            var entry = {};\n            entry.isStyleSeparator = true;\n            entry.node = node;\n            styleRules.push(entry);\n        }\n\n        for (var parentOrdinal = 0; parentOrdinal < styles.inherited.length; ++parentOrdinal) {\n            var parentStyles = styles.inherited[parentOrdinal];\n            var separatorInserted = false;\n            if (parentStyles.inlineStyle) {\n                if (this._containsInherited(parentStyles.inlineStyle)) {\n                    var inlineStyle = { selectorText: WebInspector.UIString(\"Style Attribute\"), style: parentStyles.inlineStyle, isAttribute: true, isInherited: true };\n                    if (!separatorInserted) {\n                        insertInheritedNodeSeparator(parentNode);\n                        separatorInserted = true;\n                    }\n                    styleRules.push(inlineStyle);\n                }\n            }\n\n            for (var i = parentStyles.matchedCSSRules.length - 1; i >= 0; --i) {\n                var rulePayload = parentStyles.matchedCSSRules[i];\n                if (!this._containsInherited(rulePayload.style))\n                    continue;\n                var rule = rulePayload;\n                if (!separatorInserted) {\n                    insertInheritedNodeSeparator(parentNode);\n                    separatorInserted = true;\n                }\n                styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule, isInherited: true, editable: !!(rule.style && rule.style.id) });\n            }\n            parentNode = parentNode.parentNode;\n        }\n        return styleRules;\n    },\n\n    _markUsedProperties: function(styleRules, usedProperties, disabledComputedProperties)\n    {\n        var priorityUsed = false;\n\n        // Walk the style rules and make a list of all used and overloaded properties.\n        for (var i = 0; i < styleRules.length; ++i) {\n            var styleRule = styleRules[i];\n            if (styleRule.computedStyle || styleRule.isStyleSeparator)\n                continue;\n            if (styleRule.section && styleRule.section.noAffect)\n                continue;\n\n            styleRule.usedProperties = {};\n\n            var style = styleRule.style;\n            var allProperties = style.allProperties;\n            for (var j = 0; j < allProperties.length; ++j) {\n                var property = allProperties[j];\n                if (!property.isLive)\n                    continue;\n                var name = property.name;\n\n                if (!priorityUsed && property.priority.length)\n                    priorityUsed = true;\n\n                // If the property name is already used by another rule then this rule's\n                // property is overloaded, so don't add it to the rule's usedProperties.\n                if (!(name in usedProperties))\n                    styleRule.usedProperties[name] = true;\n\n                if (name === \"font\") {\n                    // The font property is not reported as a shorthand. Report finding the individual\n                    // properties so they are visible in computed style.\n                    // FIXME: remove this when http://bugs.webkit.org/show_bug.cgi?id=15598 is fixed.\n                    styleRule.usedProperties[\"font-family\"] = true;\n                    styleRule.usedProperties[\"font-size\"] = true;\n                    styleRule.usedProperties[\"font-style\"] = true;\n                    styleRule.usedProperties[\"font-variant\"] = true;\n                    styleRule.usedProperties[\"font-weight\"] = true;\n                    styleRule.usedProperties[\"line-height\"] = true;\n                }\n            }\n\n            // Add all the properties found in this style to the used properties list.\n            // Do this here so only future rules are affect by properties used in this rule.\n            for (var name in styleRules[i].usedProperties)\n                usedProperties[name] = true;\n        }\n\n        if (priorityUsed) {\n            // Walk the properties again and account for !important.\n            var foundPriorityProperties = [];\n\n            // Walk in reverse to match the order !important overrides.\n            for (var i = (styleRules.length - 1); i >= 0; --i) {\n                if (styleRules[i].computedStyle || styleRules[i].isStyleSeparator)\n                    continue;\n\n                var style = styleRules[i].style;\n                var allProperties = style.allProperties;\n                for (var j = 0; j < allProperties.length; ++j) {\n                    var property = allProperties[j];\n                    if (!property.isLive)\n                        continue;\n                    var name = property.name;\n                    if (property.priority.length) {\n                        if (!(name in foundPriorityProperties))\n                            styleRules[i].usedProperties[name] = true;\n                        else\n                            delete styleRules[i].usedProperties[name];\n                        foundPriorityProperties[name] = true;\n                    } else if (name in foundPriorityProperties)\n                        delete styleRules[i].usedProperties[name];\n                }\n            }\n        }\n    },\n\n    _refreshSectionsForStyleRules: function(styleRules, usedProperties, disabledComputedProperties, editedSection)\n    {\n        // Walk the style rules and update the sections with new overloaded and used properties.\n        for (var i = 0; i < styleRules.length; ++i) {\n            var styleRule = styleRules[i];\n            var section = styleRule.section;\n            if (styleRule.computedStyle) {\n                section._disabledComputedProperties = disabledComputedProperties;\n                section._usedProperties = usedProperties;\n                section.update();\n            } else {\n                section._usedProperties = styleRule.usedProperties;\n                section.update(section === editedSection);\n            }\n        }\n    },\n\n    _rebuildSectionsForStyleRules: function(styleRules, usedProperties, disabledComputedProperties, pseudoId, anchorElement)\n    {\n        anchorElement = anchorElement || null;\n        // Make a property section for each style rule.\n        var sections = [];\n        var lastWasSeparator = true;\n        for (var i = 0; i < styleRules.length; ++i) {\n            var styleRule = styleRules[i];\n            if (styleRule.isStyleSeparator) {\n                var separatorElement = document.createElement(\"div\");\n                separatorElement.className = \"styles-sidebar-separator\";\n                if (styleRule.node) {\n                    var link = WebInspector.panels.elements.linkifyNodeReference(styleRule.node);\n                    separatorElement.appendChild(document.createTextNode(WebInspector.UIString(\"Inherited from\") + \" \"));\n                    separatorElement.appendChild(link);\n                    if (!sections.inheritedPropertiesSeparatorElement)\n                        sections.inheritedPropertiesSeparatorElement = separatorElement;\n                } else if (\"pseudoId\" in styleRule) {\n                    var pseudoName = WebInspector.StylesSidebarPane.PseudoIdNames[styleRule.pseudoId];\n                    if (pseudoName)\n                        separatorElement.textContent = WebInspector.UIString(\"Pseudo ::%s element\", pseudoName);\n                    else\n                        separatorElement.textContent = WebInspector.UIString(\"Pseudo element\");\n                } else\n                    separatorElement.textContent = styleRule.text;\n                this.bodyElement.insertBefore(separatorElement, anchorElement);\n                lastWasSeparator = true;\n                continue;\n            }\n            var computedStyle = styleRule.computedStyle;\n\n            // Default editable to true if it was omitted.\n            var editable = styleRule.editable;\n            if (typeof editable === \"undefined\")\n                editable = true;\n\n            if (computedStyle)\n                var section = new WebInspector.ComputedStylePropertiesSection(styleRule, usedProperties, disabledComputedProperties, styleRules);\n            else\n                var section = new WebInspector.StylePropertiesSection(styleRule, editable, styleRule.isInherited, lastWasSeparator);\n            section.pane = this;\n            section.expanded = true;\n\n            if (computedStyle) {\n                this._computedStylePane.bodyElement.appendChild(section.element);\n                lastWasSeparator = true;\n            } else {\n                this.bodyElement.insertBefore(section.element, anchorElement);\n                lastWasSeparator = false;\n            }\n            sections.push(section);\n        }\n        return sections;\n    },\n\n    _containsInherited: function(style)\n    {\n        var properties = style.allProperties;\n        for (var i = 0; i < properties.length; ++i) {\n            var property = properties[i];\n            // Does this style contain non-overridden inherited property?\n            if (property.isLive && property.name in WebInspector.StylesSidebarPane.InheritedProperties)\n                return true;\n        }\n        return false;\n    },\n\n    _changeSetting: function(event)\n    {\n        var options = this.settingsSelectElement.options;\n        var selectedOption = options[this.settingsSelectElement.selectedIndex];\n        selectedOption.action(event);\n\n        // Select the correct color format setting again, since it needs to be selected.\n        var selectedIndex = 0;\n        for (var i = 0; i < options.length; ++i) {\n            if (options[i].value === WebInspector.settings.colorFormat) {\n                selectedIndex = i;\n                break;\n            }\n        }\n\n        this.settingsSelectElement.selectedIndex = selectedIndex;\n    },\n\n    _changeColorFormat: function(event)\n    {\n        var selectedOption = this.settingsSelectElement[this.settingsSelectElement.selectedIndex];\n        WebInspector.settings.colorFormat = selectedOption.value;\n\n        for (var pseudoId in this.sections) {\n            var sections = this.sections[pseudoId];\n            for (var i = 0; i < sections.length; ++i)\n                sections[i].update(true);\n        }\n    },\n\n    _createNewRule: function(event)\n    {\n        this.addBlankSection().startEditingSelector();\n    },\n\n    addBlankSection: function()\n    {\n        var blankSection = new WebInspector.BlankStylePropertiesSection(appropriateSelectorForNode(this.node, true));\n        blankSection.pane = this;\n\n        var elementStyleSection = this.sections[0][1];\n        this.bodyElement.insertBefore(blankSection.element, elementStyleSection.element.nextSibling);\n\n        this.sections[0].splice(2, 0, blankSection);\n\n        return blankSection;\n    },\n\n    removeSection: function(section)\n    {\n        for (var pseudoId in this.sections) {\n            var sections = this.sections[pseudoId];\n            var index = sections.indexOf(section);\n            if (index === -1)\n                continue;\n            sections.splice(index, 1);\n            if (section.element.parentNode)\n                section.element.parentNode.removeChild(section.element);\n        }\n    },\n\n    registerShortcuts: function()\n    {\n        var section = WebInspector.shortcutsHelp.section(WebInspector.UIString(\"Styles Pane\"));\n        var shortcut = WebInspector.KeyboardShortcut;\n        var keys = [\n            shortcut.shortcutToString(shortcut.Keys.Tab),\n            shortcut.shortcutToString(shortcut.Keys.Tab, shortcut.Modifiers.Shift)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Next/previous property\"));\n        keys = [\n            shortcut.shortcutToString(shortcut.Keys.Up),\n            shortcut.shortcutToString(shortcut.Keys.Down)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Increment/decrement value\"));\n        keys = [\n            shortcut.shortcutToString(shortcut.Keys.Up, shortcut.Modifiers.Shift),\n            shortcut.shortcutToString(shortcut.Keys.Down, shortcut.Modifiers.Shift)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Increment/decrement by %f\", 10));\n        keys = [\n            shortcut.shortcutToString(shortcut.Keys.PageUp),\n            shortcut.shortcutToString(shortcut.Keys.PageDown)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Increment/decrement by %f\", 10));\n        keys = [\n            shortcut.shortcutToString(shortcut.Keys.PageUp, shortcut.Modifiers.Shift),\n            shortcut.shortcutToString(shortcut.Keys.PageDown, shortcut.Modifiers.Shift)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Increment/decrement by %f\", 100));\n        keys = [\n            shortcut.shortcutToString(shortcut.Keys.PageUp, shortcut.Modifiers.Alt),\n            shortcut.shortcutToString(shortcut.Keys.PageDown, shortcut.Modifiers.Alt)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Increment/decrement by %f\", 0.1));\n    }\n}\n\nWebInspector.StylesSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.ComputedStyleSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Computed Style\"));\n    var showInheritedCheckbox = new WebInspector.Checkbox(WebInspector.UIString(\"Show inherited\"), \"sidebar-pane-subtitle\");\n    this.titleElement.appendChild(showInheritedCheckbox.element);\n\n    if (WebInspector.settings.showInheritedComputedStyleProperties) {\n        this.bodyElement.addStyleClass(\"show-inherited\");\n        showInheritedCheckbox.checked = true;\n    }\n\n    function showInheritedToggleFunction(event)\n    {\n        WebInspector.settings.showInheritedComputedStyleProperties = showInheritedCheckbox.checked;\n        if (WebInspector.settings.showInheritedComputedStyleProperties)\n            this.bodyElement.addStyleClass(\"show-inherited\");\n        else\n            this.bodyElement.removeStyleClass(\"show-inherited\");\n    }\n\n    showInheritedCheckbox.addEventListener(showInheritedToggleFunction.bind(this));\n}\n\nWebInspector.ComputedStyleSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.StylePropertiesSection = function(styleRule, editable, isInherited, isFirstSection)\n{\n    WebInspector.PropertiesSection.call(this, \"\");\n    this.element.className = \"styles-section monospace\" + (isFirstSection ? \" first-styles-section\" : \"\");\n\n    this._selectorElement = document.createElement(\"span\");\n    this._selectorElement.textContent = styleRule.selectorText;\n    this.titleElement.appendChild(this._selectorElement);\n    if (Preferences.debugMode)\n        this._selectorElement.addEventListener(\"click\", this._debugShowStyle.bind(this), false);\n\n    var openBrace = document.createElement(\"span\");\n    openBrace.textContent = \" {\";\n    this.titleElement.appendChild(openBrace);\n\n    var closeBrace = document.createElement(\"div\");\n    closeBrace.textContent = \"}\";\n    this.element.appendChild(closeBrace);\n\n    this._selectorElement.addEventListener(\"dblclick\", this._handleSelectorDoubleClick.bind(this), false);\n    this.element.addEventListener(\"dblclick\", this._handleEmptySpaceDoubleClick.bind(this), false);\n\n    this.styleRule = styleRule;\n    this.rule = this.styleRule.rule;\n    this.editable = editable;\n    this.isInherited = isInherited;\n\n    // Prevent editing the user agent and user rules.\n    var isUserAgent = this.rule && this.rule.isUserAgent;\n    var isUser = this.rule && this.rule.isUser;\n    var isViaInspector = this.rule && this.rule.isViaInspector;\n\n    if (isUserAgent || isUser)\n        this.editable = false;\n\n    this._usedProperties = styleRule.usedProperties;\n\n    if (this.rule)\n        this.titleElement.addStyleClass(\"styles-selector\");\n\n    function linkifyUncopyable(url, line)\n    {\n        var link = WebInspector.linkifyResourceAsNode(url, \"resources\", line + 1);\n        link.setAttribute(\"data-uncopyable\", link.textContent);\n        link.textContent = \"\";\n        return link;\n    }\n\n    var subtitle = \"\";\n    if (this.styleRule.sourceURL)\n        this.subtitleElement.appendChild(linkifyUncopyable(this.styleRule.sourceURL, this.rule.sourceLine));\n    else if (isUserAgent)\n        subtitle = WebInspector.UIString(\"user agent stylesheet\");\n    else if (isUser)\n        subtitle = WebInspector.UIString(\"user stylesheet\");\n    else if (isViaInspector)\n        subtitle = WebInspector.UIString(\"via inspector\");\n    else if (this.rule && this.rule.sourceURL)\n        this.subtitleElement.appendChild(linkifyUncopyable(this.rule.sourceURL, this.rule.sourceLine));\n\n    if (isInherited)\n        this.element.addStyleClass(\"show-inherited\"); // This one is related to inherited rules, not compted style.\n    if (subtitle)\n        this.subtitle = subtitle;\n\n    this.identifier = styleRule.selectorText;\n    if (this.subtitle)\n        this.identifier += \":\" + this.subtitle;\n\n    if (!this.editable)\n        this.element.addStyleClass(\"read-only\");\n}\n\nWebInspector.StylePropertiesSection.prototype = {\n    collapse: function(dontRememberState)\n    {\n        // Overriding with empty body.\n    },\n\n    isPropertyInherited: function(propertyName)\n    {\n        if (this.isInherited) {\n            // While rendering inherited stylesheet, reverse meaning of this property.\n            // Render truly inherited properties with black, i.e. return them as non-inherited.\n            return !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties);\n        }\n        return false;\n    },\n\n    isPropertyOverloaded: function(propertyName, shorthand)\n    {\n        if (!this._usedProperties || this.noAffect)\n            return false;\n\n        if (this.isInherited && !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties)) {\n            // In the inherited sections, only show overrides for the potentially inherited properties.\n            return false;\n        }\n\n        var used = (propertyName in this._usedProperties);\n        if (used || !shorthand)\n            return !used;\n\n        // Find out if any of the individual longhand properties of the shorthand\n        // are used, if none are then the shorthand is overloaded too.\n        var longhandProperties = this.styleRule.style.getLonghandProperties(propertyName);\n        for (var j = 0; j < longhandProperties.length; ++j) {\n            var individualProperty = longhandProperties[j];\n            if (individualProperty.name in this._usedProperties)\n                return false;\n        }\n\n        return true;\n    },\n\n    nextEditableSibling: function()\n    {\n        var curSection = this;\n        do {\n            curSection = curSection.nextSibling;\n        } while (curSection && !curSection.editable);\n\n        return curSection;\n    },\n\n    previousEditableSibling: function()\n    {\n        var curSection = this;\n        do {\n            curSection = curSection.previousSibling;\n        } while (curSection && !curSection.editable);\n\n        return curSection;\n    },\n\n    update: function(full)\n    {\n        if (full) {\n            this.propertiesTreeOutline.removeChildren();\n            this.populated = false;\n        } else {\n            var child = this.propertiesTreeOutline.children[0];\n            while (child) {\n                child.overloaded = this.isPropertyOverloaded(child.name, child.shorthand);\n                child = child.traverseNextTreeElement(false, null, true);\n            }\n        }\n        this.afterUpdate();\n    },\n\n    afterUpdate: function()\n    {\n        if (this._afterUpdate) {\n            this._afterUpdate(this);\n            delete this._afterUpdate;\n        }\n    },\n\n    onpopulate: function()\n    {\n        var style = this.styleRule.style;\n\n        var handledProperties = {};\n        var shorthandNames = {};\n\n        this.uniqueProperties = [];\n        var allProperties = style.allProperties;\n        for (var i = 0; i < allProperties.length; ++i)\n            this.uniqueProperties.push(allProperties[i]);\n\n        // Collect all shorthand names.\n        for (var i = 0; i < this.uniqueProperties.length; ++i) {\n            var property = this.uniqueProperties[i];\n            if (property.disabled)\n                continue;\n            if (property.shorthand)\n                shorthandNames[property.shorthand] = true;\n        }\n\n        // Collect all shorthand names.\n        for (var i = 0; i < this.uniqueProperties.length; ++i) {\n            var property = this.uniqueProperties[i];\n            var disabled = property.disabled;\n            if (!disabled && this.disabledComputedProperties && !(property.name in this.usedProperties) && property.name in this.disabledComputedProperties)\n                disabled = true;\n\n            var shorthand = !disabled ? property.shorthand : null;\n\n            if (shorthand && shorthand in handledProperties)\n                continue;\n\n            if (shorthand) {\n                property = style.getLiveProperty(shorthand);\n                if (!property)\n                    property = new WebInspector.CSSProperty(style, style.allProperties.length, shorthand, style.getShorthandValue(shorthand), style.getShorthandPriority(shorthand), \"style\", true, true, \"\");\n            }\n\n            var isShorthand = !!(property.isLive && (shorthand || shorthandNames[property.name]));\n            var inherited = this.isPropertyInherited(property.name);\n            var overloaded = this.isPropertyOverloaded(property.name, isShorthand);\n\n            var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, isShorthand, inherited, overloaded);\n            this.propertiesTreeOutline.appendChild(item);\n            handledProperties[property.name] = property;\n        }\n    },\n\n    findTreeElementWithName: function(name)\n    {\n        var treeElement = this.propertiesTreeOutline.children[0];\n        while (treeElement) {\n            if (treeElement.name === name)\n                return treeElement;\n            treeElement = treeElement.traverseNextTreeElement(true, null, true);\n        }\n        return null;\n    },\n\n    addNewBlankProperty: function(optionalIndex)\n    {\n        var style = this.styleRule.style;\n        var property = style.newBlankProperty();\n        var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, false, false, false);\n        this.propertiesTreeOutline.appendChild(item);\n        item.listItemElement.textContent = \"\";\n        item._newProperty = true;\n        item.updateTitle();\n        return item;\n    },\n\n    _debugShowStyle: function(anchor)\n    {\n        var boundHandler;\n        function removeStyleBox(element, event)\n        {\n            if (event.target === element) {\n                event.stopPropagation();\n                return;\n            }\n            document.body.removeChild(element);\n            document.getElementById(\"main\").removeEventListener(\"mousedown\", boundHandler, true);\n        }\n\n        if (!event.shiftKey)\n            return;\n\n        var container = document.createElement(\"div\");\n        var element = document.createElement(\"span\");\n        container.appendChild(element);\n        element.style.background = \"yellow\";\n        element.style.display = \"inline-block\";\n        container.style.cssText = \"z-index: 2000000; position: absolute; top: 50px; left: 50px; white-space: pre; overflow: auto; background: white; font-family: monospace; font-size: 12px; border: 1px solid black; opacity: 0.85; -webkit-user-select: text; padding: 2px;\";\n        container.style.width = (document.body.offsetWidth - 100) + \"px\";\n        container.style.height = (document.body.offsetHeight - 100) + \"px\";\n        document.body.appendChild(container);\n        if (this.rule)\n            element.textContent = this.rule.selectorText + \" {\" + ((this.styleRule.style.cssText !== undefined) ? this.styleRule.style.cssText : \"<no cssText>\") + \"}\";\n        else\n            element.textContent = this.styleRule.style.cssText;\n        boundHandler = removeStyleBox.bind(null, container);\n        document.getElementById(\"main\").addEventListener(\"mousedown\", boundHandler, true);\n    },\n\n    _handleEmptySpaceDoubleClick: function(event)\n    {\n        if (event.target.hasStyleClass(\"header\")) {\n            event.stopPropagation();\n            return;\n        }\n        this.expand();\n        this.addNewBlankProperty().startEditing();\n    },\n\n    _handleSelectorClick: function(event)\n    {\n        event.stopPropagation();\n    },\n\n    _handleSelectorDoubleClick: function(event)\n    {\n        this._startEditingOnMouseEvent();\n        event.stopPropagation();\n    },\n\n    _startEditingOnMouseEvent: function()\n    {\n        if (!this.editable)\n            return;\n\n        if (!this.rule && this.propertiesTreeOutline.children.length === 0) {\n            this.expand();\n            this.addNewBlankProperty().startEditing();\n            return;\n        }\n\n        if (!this.rule)\n            return;\n\n        this.startEditingSelector();\n    },\n\n    startEditingSelector: function()\n    {\n        var element = this._selectorElement;\n        if (WebInspector.isBeingEdited(element))\n            return;\n\n        WebInspector.startEditing(this._selectorElement, {\n            context: null,\n            commitHandler: this.editingSelectorCommitted.bind(this),\n            cancelHandler: this.editingSelectorCancelled.bind(this)\n        });\n        window.getSelection().setBaseAndExtent(element, 0, element, 1);\n    },\n\n    editingSelectorCommitted: function(element, newContent, oldContent, context, moveDirection)\n    {\n        function moveToNextIfNeeded() {\n            if (!moveDirection)\n                return;\n\n            if (moveDirection === \"forward\") {\n                this.expand();\n                if (this.propertiesTreeOutline.children.length === 0)\n                    this.addNewBlankProperty().startEditing();\n                else {\n                    var item = this.propertiesTreeOutline.children[0]\n                    item.startEditing(item.nameElement);\n                }\n            } else {\n                var previousSection = this.previousEditableSibling();\n                if (!previousSection)\n                    return;\n\n                previousSection.expand();\n                previousSection.addNewBlankProperty().startEditing();\n            }\n        }\n\n        if (newContent === oldContent)\n            return moveToNextIfNeeded.call(this);\n\n        var self = this;\n\n        function successCallback(newRule, doesAffectSelectedNode)\n        {\n            if (!doesAffectSelectedNode) {\n                self.noAffect = true;\n                self.element.addStyleClass(\"no-affect\");\n            } else {\n                delete self.noAffect;\n                self.element.removeStyleClass(\"no-affect\");\n            }\n\n            self.rule = newRule;\n            self.styleRule = { section: self, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.sourceURL, rule: newRule };\n\n            var oldIdentifier = this.identifier;\n            self.identifier = newRule.selectorText + \":\" + self.subtitleElement.textContent;\n\n            self.pane.update();\n\n            WebInspector.panels.elements.renameSelector(oldIdentifier, this.identifier, oldContent, newContent);\n\n            moveToNextIfNeeded.call(self);\n        }\n\n        var focusedNode = WebInspector.panels.elements.focusedDOMNode;\n        WebInspector.cssModel.setRuleSelector(this.rule.id, focusedNode ? focusedNode.id : 0, newContent, successCallback, moveToNextIfNeeded.bind(this));\n    },\n\n    editingSelectorCancelled: function()\n    {\n        // Do nothing, this is overridden by BlankStylePropertiesSection.\n    }\n}\n\nWebInspector.StylePropertiesSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype;\n\nWebInspector.ComputedStylePropertiesSection = function(styleRule, usedProperties, disabledComputedProperties)\n{\n    WebInspector.PropertiesSection.call(this, \"\");\n    this.headerElement.addStyleClass(\"hidden\");\n    this.element.className = \"styles-section monospace first-styles-section read-only computed-style\";\n    this.styleRule = styleRule;\n    this._usedProperties = usedProperties;\n    this._disabledComputedProperties = disabledComputedProperties;\n    this._alwaysShowComputedProperties = { \"display\": true, \"height\": true, \"width\": true };\n    this.computedStyle = true;\n    this._propertyTreeElements = {};\n    this._expandedPropertyNames = {};\n}\n\nWebInspector.ComputedStylePropertiesSection.prototype = {\n    collapse: function(dontRememberState)\n    {\n        // Overriding with empty body.\n    },\n\n    _isPropertyInherited: function(propertyName)\n    {\n        return !(propertyName in this._usedProperties) && !(propertyName in this._alwaysShowComputedProperties) && !(propertyName in this._disabledComputedProperties);\n    },\n\n    update: function()\n    {\n        this._expandedPropertyNames = {};\n        for (var name in this._propertyTreeElements) {\n            if (this._propertyTreeElements[name].expanded)\n                this._expandedPropertyNames[name] = true;\n        }\n        this._propertyTreeElements = {};\n        this.propertiesTreeOutline.removeChildren();\n        this.populated = false;\n    },\n\n    onpopulate: function()\n    {\n        function sorter(a, b)\n        {\n            return a.name.localeCompare(b.name);\n        }\n\n        var style = this.styleRule.style;\n        var uniqueProperties = [];\n        var allProperties = style.allProperties;\n        for (var i = 0; i < allProperties.length; ++i)\n            uniqueProperties.push(allProperties[i]);\n        uniqueProperties.sort(sorter);\n\n        this._propertyTreeElements = {};\n        for (var i = 0; i < uniqueProperties.length; ++i) {\n            var property = uniqueProperties[i];\n            var inherited = this._isPropertyInherited(property.name);\n            var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, false, inherited, false);\n            this.propertiesTreeOutline.appendChild(item);\n            this._propertyTreeElements[property.name] = item;\n        }\n    },\n\n    rebuildComputedTrace: function(sections)\n    {\n        for (var i = 0; i < sections.length; ++i) {\n            var section = sections[i];\n            if (section.computedStyle || section instanceof WebInspector.BlankStylePropertiesSection)\n                continue;\n\n            for (var j = 0; j < section.uniqueProperties.length; ++j) {\n                var property = section.uniqueProperties[j];\n                if (property.disabled)\n                    continue;\n                if (section.isInherited && !(property.name in WebInspector.StylesSidebarPane.InheritedProperties))\n                    continue;\n\n                var treeElement = this._propertyTreeElements[property.name];\n                if (treeElement) {\n                    var selectorText = section.styleRule.selectorText;\n                    var value = property.value;\n                    var title = \"<span style='color: gray'>\" + selectorText + \"</span> - \" + value;\n                    var subtitle = \" <span style='float:right'>\" + section.subtitleElement.innerHTML + \"</span>\";\n                    var childElement = new TreeElement(null, null, false);\n                    childElement.titleHTML = title + subtitle;\n                    treeElement.appendChild(childElement);\n                    if (section.isPropertyOverloaded(property.name))\n                        childElement.listItemElement.addStyleClass(\"overloaded\");\n                }\n            }\n        }\n\n        // Restore expanded state after update.\n        for (var name in this._expandedPropertyNames) {\n            if (name in this._propertyTreeElements)\n                this._propertyTreeElements[name].expand();\n        }\n    }\n}\n\nWebInspector.ComputedStylePropertiesSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype;\n\nWebInspector.BlankStylePropertiesSection = function(defaultSelectorText)\n{\n    WebInspector.StylePropertiesSection.call(this, {selectorText: defaultSelectorText, rule: {isViaInspector: true}}, true, false, false);\n    this.element.addStyleClass(\"blank-section\");\n}\n\nWebInspector.BlankStylePropertiesSection.prototype = {\n    expand: function()\n    {\n        // Do nothing, blank sections are not expandable.\n    },\n\n    editingSelectorCommitted: function(element, newContent, oldContent, context)\n    {\n        var self = this;\n        function successCallback(newRule, doesSelectorAffectSelectedNode)\n        {\n            var styleRule = { section: self, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.sourceURL, rule: newRule };\n            self.makeNormal(styleRule);\n\n            if (!doesSelectorAffectSelectedNode) {\n                self.noAffect = true;\n                self.element.addStyleClass(\"no-affect\");\n            }\n\n            self.subtitleElement.textContent = WebInspector.UIString(\"via inspector\");\n            self.expand();\n\n            self.addNewBlankProperty().startEditing();\n        }\n\n        WebInspector.cssModel.addRule(this.pane.node.id, newContent, successCallback, this.editingSelectorCancelled.bind(this));\n    },\n\n    editingSelectorCancelled: function()\n    {\n        this.pane.removeSection(this);\n    },\n\n    makeNormal: function(styleRule)\n    {\n        this.element.removeStyleClass(\"blank-section\");\n        this.styleRule = styleRule;\n        this.rule = styleRule.rule;\n        this.identifier = styleRule.selectorText + \":via inspector\";\n        this.__proto__ = WebInspector.StylePropertiesSection.prototype;\n    }\n}\n\nWebInspector.BlankStylePropertiesSection.prototype.__proto__ = WebInspector.StylePropertiesSection.prototype;\n\nWebInspector.StylePropertyTreeElement = function(styleRule, style, property, shorthand, inherited, overloaded)\n{\n    this._styleRule = styleRule;\n    this.style = style;\n    this.property = property;\n    this.shorthand = shorthand;\n    this._inherited = inherited;\n    this._overloaded = overloaded;\n\n    // Pass an empty title, the title gets made later in onattach.\n    TreeElement.call(this, \"\", null, shorthand);\n}\n\nWebInspector.StylePropertyTreeElement.prototype = {\n    get inherited()\n    {\n        return this._inherited;\n    },\n\n    set inherited(x)\n    {\n        if (x === this._inherited)\n            return;\n        this._inherited = x;\n        this.updateState();\n    },\n\n    get overloaded()\n    {\n        return this._overloaded;\n    },\n\n    set overloaded(x)\n    {\n        if (x === this._overloaded)\n            return;\n        this._overloaded = x;\n        this.updateState();\n    },\n\n    get disabled()\n    {\n        return this.property.disabled;\n    },\n\n    get name()\n    {\n        if (!this.disabled || !this.property.text)\n            return this.property.name;\n\n        var text = this.property.text;\n        var index = text.indexOf(\":\");\n        if (index < 1)\n            return this.property.name;\n\n        return text.substring(0, index).trim();\n    },\n\n    get priority()\n    {\n        if (this.disabled)\n            return \"\"; // rely upon raw text to render it in the value field\n        return this.property.priority;\n    },\n\n    get value()\n    {\n        if (!this.disabled || !this.property.text)\n            return this.property.value;\n\n        var match = this.property.text.match(/(.*);\\s*/);\n        if (!match || !match[1])\n            return this.property.value;\n\n        var text = match[1];\n        var index = text.indexOf(\":\");\n        if (index < 1)\n            return this.property.value;\n\n        return text.substring(index + 1).trim();\n    },\n\n    get parsedOk()\n    {\n        return this.property.parsedOk;\n    },\n\n    onattach: function()\n    {\n        this.updateTitle();\n    },\n\n    updateTitle: function()\n    {\n        var value = this.value;\n\n        this.updateState();\n\n        var enabledCheckboxElement;\n        if (this.parsedOk) {\n            enabledCheckboxElement = document.createElement(\"input\");\n            enabledCheckboxElement.className = \"enabled-button\";\n            enabledCheckboxElement.type = \"checkbox\";\n            enabledCheckboxElement.checked = !this.disabled;\n            enabledCheckboxElement.addEventListener(\"change\", this.toggleEnabled.bind(this), false);\n        }\n\n        var nameElement = document.createElement(\"span\");\n        nameElement.className = \"webkit-css-property\";\n        nameElement.textContent = this.name;\n        this.nameElement = nameElement;\n\n        var valueElement = document.createElement(\"span\");\n        valueElement.className = \"value\";\n        this.valueElement = valueElement;\n\n        if (value) {\n            var self = this;\n\n            function processValue(regex, processor, nextProcessor, valueText)\n            {\n                var container = document.createDocumentFragment();\n\n                var items = valueText.replace(regex, \"\\0$1\\0\").split(\"\\0\");\n                for (var i = 0; i < items.length; ++i) {\n                    if ((i % 2) === 0) {\n                        if (nextProcessor)\n                            container.appendChild(nextProcessor(items[i]));\n                        else\n                            container.appendChild(document.createTextNode(items[i]));\n                    } else {\n                        var processedNode = processor(items[i]);\n                        if (processedNode)\n                            container.appendChild(processedNode);\n                    }\n                }\n\n                return container;\n            }\n\n            function linkifyURL(url)\n            {\n                var hrefUrl = url;\n                var match = hrefUrl.match(/['\"]?([^'\"]+)/);\n                if (match)\n                    hrefUrl = match[1];\n                var container = document.createDocumentFragment();\n                container.appendChild(document.createTextNode(\"url(\"));\n                if (self._styleRule.sourceURL)\n                    hrefUrl = WebInspector.completeURL(self._styleRule.sourceURL, hrefUrl);\n                else if (WebInspector.panels.elements.focusedDOMNode)\n                    hrefUrl = WebInspector.resourceURLForRelatedNode(WebInspector.panels.elements.focusedDOMNode, hrefUrl);\n                var hasResource = !!WebInspector.resourceForURL(hrefUrl);\n                // FIXME: WebInspector.linkifyURLAsNode() should really use baseURI.\n                container.appendChild(WebInspector.linkifyURLAsNode(hrefUrl, url, null, hasResource));\n                container.appendChild(document.createTextNode(\")\"));\n                return container;\n            }\n\n            function processColor(text)\n            {\n                try {\n                    var color = new WebInspector.Color(text);\n                } catch (e) {\n                    return document.createTextNode(text);\n                }\n\n                var swatchElement = document.createElement(\"span\");\n                swatchElement.title = WebInspector.UIString(\"Click to change color format\");\n                swatchElement.className = \"swatch\";\n                swatchElement.style.setProperty(\"background-color\", text);\n\n                swatchElement.addEventListener(\"click\", changeColorDisplay, false);\n                swatchElement.addEventListener(\"dblclick\", function(event) { event.stopPropagation() }, false);\n\n                var format;\n                if (WebInspector.settings.colorFormat === \"original\")\n                    format = \"original\";\n                else if (Preferences.showColorNicknames && color.nickname)\n                    format = \"nickname\";\n                else if (WebInspector.settings.colorFormat === \"rgb\")\n                    format = (color.simple ? \"rgb\" : \"rgba\");\n                else if (WebInspector.settings.colorFormat === \"hsl\")\n                    format = (color.simple ? \"hsl\" : \"hsla\");\n                else if (color.simple)\n                    format = (color.hasShortHex() ? \"shorthex\" : \"hex\");\n                else\n                    format = \"rgba\";\n\n                var colorValueElement = document.createElement(\"span\");\n                colorValueElement.textContent = color.toString(format);\n\n                function nextFormat(curFormat)\n                {\n                    // The format loop is as follows:\n                    // * original\n                    // * rgb(a)\n                    // * hsl(a)\n                    // * nickname (if the color has a nickname)\n                    // * if the color is simple:\n                    //   - shorthex (if has short hex)\n                    //   - hex\n                    switch (curFormat) {\n                        case \"original\":\n                            return color.simple ? \"rgb\" : \"rgba\";\n\n                        case \"rgb\":\n                        case \"rgba\":\n                            return color.simple ? \"hsl\" : \"hsla\";\n\n                        case \"hsl\":\n                        case \"hsla\":\n                            if (color.nickname)\n                                return \"nickname\";\n                            if (color.simple)\n                                return color.hasShortHex() ? \"shorthex\" : \"hex\";\n                            else\n                                return \"original\";\n\n                        case \"shorthex\":\n                            return \"hex\";\n\n                        case \"hex\":\n                            return \"original\";\n\n                        case \"nickname\":\n                            if (color.simple)\n                                return color.hasShortHex() ? \"shorthex\" : \"hex\";\n                            else\n                                return \"original\";\n\n                        default:\n                            return null;\n                    }\n                }\n\n                function changeColorDisplay(event)\n                {\n                    do {\n                        format = nextFormat(format);\n                        var currentValue = color.toString(format || \"\");\n                    } while (format && currentValue === color.value && format !== \"original\");\n\n                    if (format)\n                        colorValueElement.textContent = currentValue;\n                }\n\n                var container = document.createDocumentFragment();\n                container.appendChild(swatchElement);\n                container.appendChild(colorValueElement);\n                return container;\n            }\n\n            var colorRegex = /((?:rgb|hsl)a?\\([^)]+\\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\\b\\w+\\b(?!-))/g;\n            var colorProcessor = processValue.bind(window, colorRegex, processColor, null);\n\n            valueElement.appendChild(processValue(/url\\(\\s*([^)\\s]+)\\s*\\)/g, linkifyURL, colorProcessor, value));\n        }\n\n        this.listItemElement.removeChildren();\n        nameElement.normalize();\n        valueElement.normalize();\n\n        if (!this.treeOutline)\n            return;\n\n        // Append the checkbox for root elements of an editable section.\n        if (enabledCheckboxElement && this.treeOutline.section && this.treeOutline.section.editable && this.parent.root)\n            this.listItemElement.appendChild(enabledCheckboxElement);\n        this.listItemElement.appendChild(nameElement);\n        this.listItemElement.appendChild(document.createTextNode(\": \"));\n        this.listItemElement.appendChild(valueElement);\n        this.listItemElement.appendChild(document.createTextNode(\";\"));\n\n        if (!this.parsedOk) {\n            // Avoid having longhands under an invalid shorthand.\n            this.hasChildren = false;\n            this.listItemElement.addStyleClass(\"not-parsed-ok\");\n        }\n        if (this.property.inactive)\n            this.listItemElement.addStyleClass(\"inactive\");\n\n        this.tooltip = this.property.propertyText;\n    },\n\n    updateAll: function(updateAllRules)\n    {\n        if (!this.treeOutline)\n            return;\n        if (updateAllRules && this.treeOutline.section && this.treeOutline.section.pane)\n            this.treeOutline.section.pane.update(null, this.treeOutline.section);\n        else if (this.treeOutline.section)\n            this.treeOutline.section.update(true);\n        else\n            this.updateTitle(); // FIXME: this will not show new properties. But we don't hit this case yet.\n    },\n\n    toggleEnabled: function(event)\n    {\n        var disabled = !event.target.checked;\n\n        function callback(newStyle)\n        {\n            if (!newStyle)\n                return;\n\n            this.style = newStyle;\n            this._styleRule.style = newStyle;\n\n            if (this.treeOutline.section && this.treeOutline.section.pane)\n                this.treeOutline.section.pane.dispatchEventToListeners(\"style property toggled\");\n\n            this.updateAll(true);\n        }\n\n        this.property.setDisabled(disabled, callback.bind(this));\n    },\n\n    updateState: function()\n    {\n        if (!this.listItemElement)\n            return;\n\n        if (this.style.isPropertyImplicit(this.name) || this.value === \"initial\")\n            this.listItemElement.addStyleClass(\"implicit\");\n        else\n            this.listItemElement.removeStyleClass(\"implicit\");\n\n        this.selectable = !this.inherited;\n        if (this.inherited)\n            this.listItemElement.addStyleClass(\"inherited\");\n        else\n            this.listItemElement.removeStyleClass(\"inherited\");\n\n        if (this.overloaded)\n            this.listItemElement.addStyleClass(\"overloaded\");\n        else\n            this.listItemElement.removeStyleClass(\"overloaded\");\n\n        if (this.disabled)\n            this.listItemElement.addStyleClass(\"disabled\");\n        else\n            this.listItemElement.removeStyleClass(\"disabled\");\n    },\n\n    onpopulate: function()\n    {\n        // Only populate once and if this property is a shorthand.\n        if (this.children.length || !this.shorthand)\n            return;\n\n        var longhandProperties = this.style.getLonghandProperties(this.name);\n        for (var i = 0; i < longhandProperties.length; ++i) {\n            var name = longhandProperties[i].name;\n\n\n            if (this.treeOutline.section) {\n                var inherited = this.treeOutline.section.isPropertyInherited(name);\n                var overloaded = this.treeOutline.section.isPropertyOverloaded(name);\n            }\n\n            var liveProperty = this.style.getLiveProperty(name);\n            var item = new WebInspector.StylePropertyTreeElement(this._styleRule, this.style, liveProperty, false, inherited, overloaded);\n            this.appendChild(item);\n        }\n    },\n\n    ondblclick: function(event)\n    {\n        this.startEditing(event.target);\n        event.stopPropagation();\n    },\n\n    restoreNameElement: function()\n    {\n        // Restore <span class=\"webkit-css-property\"> if it doesn't yet exist or was accidentally deleted.\n        if (this.nameElement === this.listItemElement.querySelector(\".webkit-css-property\"))\n            return;\n\n        this.nameElement = document.createElement(\"span\");\n        this.nameElement.className = \"webkit-css-property\";\n        this.nameElement.textContent = \"\";\n        this.listItemElement.insertBefore(this.nameElement, this.listItemElement.firstChild);\n    },\n\n    startEditing: function(selectElement)\n    {\n        // FIXME: we don't allow editing of longhand properties under a shorthand right now.\n        if (this.parent.shorthand)\n            return;\n\n        if (this.treeOutline.section && !this.treeOutline.section.editable)\n            return;\n\n        if (!selectElement)\n            selectElement = this.nameElement; // No arguments passed in - edit the name element by default.\n        else\n            selectElement = selectElement.enclosingNodeOrSelfWithClass(\"webkit-css-property\") || selectElement.enclosingNodeOrSelfWithClass(\"value\");\n\n        var isEditingName = selectElement === this.nameElement;\n        if (!isEditingName && selectElement !== this.valueElement) {\n            // Double-click in the LI - start editing value.\n            isEditingName = false;\n            selectElement = this.valueElement;\n        }\n\n        if (WebInspector.isBeingEdited(selectElement))\n            return;\n\n        var context = {\n            expanded: this.expanded,\n            hasChildren: this.hasChildren,\n            keyDownListener: isEditingName ? null : this.editingValueKeyDown.bind(this),\n            isEditingName: isEditingName\n        };\n\n        // Lie about our children to prevent expanding on double click and to collapse shorthands.\n        this.hasChildren = false;\n\n        if (!isEditingName)\n            selectElement.addEventListener(\"keydown\", context.keyDownListener, false);\n        if (selectElement.parentElement)\n            selectElement.parentElement.addStyleClass(\"child-editing\");\n        selectElement.textContent = selectElement.textContent; // remove color swatch and the like\n\n        function shouldCommitValueSemicolon(text, cursorPosition)\n        {\n            // FIXME: should this account for semicolons inside comments?\n            var openQuote = \"\";\n            for (var i = 0; i < cursorPosition; ++i) {\n                var ch = text[i];\n                if (ch === \"\\\\\" && openQuote !== \"\")\n                    ++i; // skip next character inside string\n                else if (!openQuote && (ch === \"\\\"\" || ch === \"'\"))\n                    openQuote = ch;\n                else if (openQuote === ch)\n                    openQuote = \"\";\n            }\n            return !openQuote;\n        }\n\n        function nameValueFinishHandler(context, isEditingName, event)\n        {\n            // FIXME: the \":\"/\";\" detection does not work for non-US layouts due to the event being keydown rather than keypress.\n            var isFieldInputTerminated = (event.keyCode === WebInspector.KeyboardShortcut.Keys.Semicolon.code) &&\n                (isEditingName ? event.shiftKey : (!event.shiftKey && shouldCommitValueSemicolon(event.target.textContent, event.target.selectionLeftOffset)));\n            if (isEnterKey(event) || isFieldInputTerminated) {\n                // Enter or colon (for name)/semicolon outside of string (for value).\n                event.preventDefault();\n                return \"move-forward\";\n            } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code)\n                return \"cancel\";\n            else if (!isEditingName && this._newProperty && event.keyCode === WebInspector.KeyboardShortcut.Keys.Backspace.code) {\n                // For a new property, when Backspace is pressed at the beginning of new property value, move back to the property name.\n                var selection = window.getSelection();\n                if (selection.isCollapsed && !selection.focusOffset) {\n                    event.preventDefault();\n                    return \"move-backward\";\n                }\n            } else if (event.keyIdentifier === \"U+0009\") // Tab key.\n                return \"move-\" + (event.shiftKey ? \"backward\" : \"forward\");\n        }\n\n        function pasteHandler(context, event)\n        {\n            var data = event.clipboardData.getData(\"Text\");\n            if (!data)\n                return;\n            var colonIdx = data.indexOf(\":\");\n            if (colonIdx < 0)\n                return;\n            var name = data.substring(0, colonIdx).trim();\n            var value = data.substring(colonIdx + 1).trim();\n\n            event.preventDefault();\n\n            if (!(\"originalName\" in context)) {\n                context.originalName = this.nameElement.textContent;\n                context.originalValue = this.valueElement.textContent;\n            }\n            this.nameElement.textContent = name;\n            this.valueElement.textContent = value;\n            this.nameElement.normalize();\n            this.valueElement.normalize();\n\n            return \"move-forward\";\n        }\n\n        WebInspector.startEditing(selectElement, {\n            context: context,\n            commitHandler: this.editingCommitted.bind(this),\n            cancelHandler: this.editingCancelled.bind(this),\n            customFinishHandler: nameValueFinishHandler.bind(this, context, isEditingName),\n            pasteHandler: isEditingName ? pasteHandler.bind(this, context) : null\n        });\n\n        this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(selectElement, isEditingName ? WebInspector.cssNameCompletions : WebInspector.CSSKeywordCompletions.forProperty(this.nameElement.textContent));\n        window.getSelection().setBaseAndExtent(selectElement, 0, selectElement, 1);\n    },\n\n    editingValueKeyDown: function(event)\n    {\n        if (event.handled)\n            return;\n        var key = event.keyIdentifier || event.key;\n        var arrowKeyPressed = (key === \"Up\" || key === \"Down\");\n        var pageKeyPressed = (key === \"PageUp\" || key === \"PageDown\");\n        if (!arrowKeyPressed && !pageKeyPressed)\n            return;\n\n        var selection = window.getSelection();\n        if (!selection.rangeCount)\n            return;\n\n        var selectionRange = selection.getRangeAt(0);\n        if (selectionRange.commonAncestorContainer !== this.valueElement && !selectionRange.commonAncestorContainer.isDescendant(this.valueElement))\n            return;\n\n        var wordRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this.valueElement);\n        var wordString = wordRange.toString();\n        var replacementString = wordString;\n\n        var matches = /(.*?)(-?\\d+(?:\\.\\d+)?)(.*)/.exec(wordString);\n        if (matches && matches.length) {\n            var prefix = matches[1];\n            var number = parseFloat(matches[2]);\n            var suffix = matches[3];\n\n            // If the number is near zero or the number is one and the direction will take it near zero.\n            var numberNearZero = (number < 1 && number > -1);\n            if (number === 1 && key === \"Down\")\n                numberNearZero = true;\n            else if (number === -1 && key === \"Up\")\n                numberNearZero = true;\n\n            if (numberNearZero && event.altKey && arrowKeyPressed) {\n                if (key === \"Down\")\n                    number = Math.ceil(number - 1);\n                else\n                    number = Math.floor(number + 1);\n            } else {\n                // Jump by 10 when shift is down or jump by 0.1 when near zero or Alt/Option is down.\n                // Also jump by 10 for page up and down, or by 100 if shift is held with a page key.\n                var changeAmount = 1;\n                if (event.shiftKey && pageKeyPressed)\n                    changeAmount = 100;\n                else if (event.shiftKey || pageKeyPressed)\n                    changeAmount = 10;\n                else if (event.altKey || numberNearZero)\n                    changeAmount = 0.1;\n\n                if (key === \"Down\" || key === \"PageDown\")\n                    changeAmount *= -1;\n\n                // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.\n                // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1.\n                number = Number((number + changeAmount).toFixed(6));\n            }\n\n            replacementString = prefix + number + suffix;\n\n            var replacementTextNode = document.createTextNode(replacementString);\n\n            wordRange.deleteContents();\n            wordRange.insertNode(replacementTextNode);\n\n            var finalSelectionRange = document.createRange();\n            finalSelectionRange.setStart(replacementTextNode, 0);\n            finalSelectionRange.setEnd(replacementTextNode, replacementString.length);\n\n            selection.removeAllRanges();\n            selection.addRange(finalSelectionRange);\n\n            event.handled = true;\n            event.preventDefault();\n\n            if (!(\"originalPropertyText\" in this)) {\n                // Remember the rule's original CSS text on [Page](Up|Down), so it can be restored\n                // if the editing is canceled.\n                this.originalPropertyText = this.property.propertyText;\n            }\n\n            // Synthesize property text disregarding any comments, custom whitespace etc.\n            this.applyStyleText(this.nameElement.textContent + \": \" + this.valueElement.textContent);\n        }\n    },\n\n    editingEnded: function(context)\n    {\n        this.hasChildren = context.hasChildren;\n        if (context.expanded)\n            this.expand();\n        var editedElement = context.isEditingName ? this.nameElement : this.valueElement;\n        if (!context.isEditingName)\n            editedElement.removeEventListener(\"keydown\", context.keyDownListener, false);\n        if (editedElement.parentElement)\n            editedElement.parentElement.removeStyleClass(\"child-editing\");\n\n        delete this.originalPropertyText;\n    },\n\n    editingCancelled: function(element, context)\n    {\n        this._removePrompt();\n        if (\"originalPropertyText\" in this)\n            this.applyStyleText(this.originalPropertyText, true);\n        else {\n            if (this._newProperty)\n                this.treeOutline.removeChild(this);\n            else\n                this.updateTitle();\n        }\n\n        // This should happen last, as it clears the info necessary to restore the property value after [Page]Up/Down changes.\n        this.editingEnded(context);\n    },\n\n    editingCommitted: function(element, userInput, previousContent, context, moveDirection)\n    {\n        this._removePrompt();\n        this.editingEnded(context);\n        var isEditingName = context.isEditingName;\n\n        // Determine where to move to before making changes\n        var createNewProperty, moveToPropertyName, moveToSelector;\n        var moveTo = this;\n        var moveToOther = (isEditingName ^ (moveDirection === \"forward\"));\n        var abandonNewProperty = this._newProperty && !userInput && (moveToOther || isEditingName);\n        if (moveDirection === \"forward\" && !isEditingName || moveDirection === \"backward\" && isEditingName) {\n            do {\n                moveTo = (moveDirection === \"forward\" ? moveTo.nextSibling : moveTo.previousSibling);\n            } while(moveTo && !moveTo.selectable);\n\n           if (moveTo)\n                moveToPropertyName = moveTo.name;\n            else if (moveDirection === \"forward\" && (!this._newProperty || userInput))\n                createNewProperty = true;\n            else if (moveDirection === \"backward\" && this.treeOutline.section.rule)\n                moveToSelector = true;\n        }\n\n        // Make the Changes and trigger the moveToNextCallback after updating.\n        var blankInput = /^\\s*$/.test(userInput);\n        var isDataPasted = \"originalName\" in context;\n        var isDirtyViaPaste = isDataPasted && (this.nameElement.textContent !== context.originalName || this.valueElement.textContent !== context.originalValue);\n        var shouldCommitNewProperty = this._newProperty && (moveToOther || (!moveDirection && !isEditingName) || (isEditingName && blankInput));\n        if (((userInput !== previousContent || isDirtyViaPaste) && !this._newProperty) || shouldCommitNewProperty) {\n            this.treeOutline.section._afterUpdate = moveToNextCallback.bind(this, this._newProperty, !blankInput, this.treeOutline.section);\n            var propertyText;\n            if (blankInput || (this._newProperty && /^\\s*$/.test(this.valueElement.textContent)))\n                propertyText = \"\";\n            else {\n                if (isEditingName)\n                    propertyText = userInput + \": \" + this.valueElement.textContent;\n                else\n                    propertyText = this.nameElement.textContent + \": \" + userInput;\n            }\n            this.applyStyleText(propertyText, true);\n        } else {\n            if (!isDataPasted && !this._newProperty)\n                this.updateTitle();\n            moveToNextCallback(this._newProperty, false, this.treeOutline.section);\n        }\n\n        var moveToIndex = moveTo && this.treeOutline ? this.treeOutline.children.indexOf(moveTo) : -1;\n\n        // The Callback to start editing the next/previous property/selector.\n        function moveToNextCallback(alreadyNew, valueChanged, section)\n        {\n            if (!moveDirection)\n                return;\n\n            // User just tabbed through without changes.\n            if (moveTo && moveTo.parent) {\n                moveTo.startEditing(!isEditingName ? moveTo.nameElement : moveTo.valueElement);\n                return;\n            }\n\n            // User has made a change then tabbed, wiping all the original treeElements.\n            // Recalculate the new treeElement for the same property we were going to edit next.\n            if (moveTo && !moveTo.parent) {\n                var propertyElements = section.propertiesTreeOutline.children;\n                if (moveDirection === \"forward\" && blankInput && !isEditingName)\n                    --moveToIndex;\n                if (moveToIndex >= propertyElements.length && !this._newProperty)\n                    createNewProperty = true;\n                else {\n                    var treeElement = moveToIndex >= 0 ? propertyElements[moveToIndex] : null;\n                    if (treeElement) {\n                        treeElement.startEditing(!isEditingName ? treeElement.nameElement : treeElement.valueElement);\n                        return;\n                    } else if (!alreadyNew)\n                        moveToSelector = true;\n                }\n            }\n\n            // Create a new attribute in this section (or move to next editable selector if possible).\n            if (createNewProperty) {\n                if (alreadyNew && !valueChanged && (isEditingName ^ (moveDirection === \"backward\")))\n                    return;\n\n                section.addNewBlankProperty().startEditing();\n                return;\n            }\n\n            if (abandonNewProperty) {\n                var sectionToEdit = moveDirection === \"backward\" ? section : section.nextEditableSibling();\n                if (sectionToEdit && sectionToEdit.rule)\n                    sectionToEdit.startEditingSelector();\n                return;\n            }\n\n            if (moveToSelector)\n                section.startEditingSelector();\n        }\n    },\n\n    _removePrompt: function()\n    {\n        // BUG 53242. This cannot go into editingEnded(), as it should always happen first for any editing outcome.\n        if (this._prompt) {\n            this._prompt.removeFromElement();\n            delete this._prompt;\n        }\n    },\n\n    _hasBeenAppliedToPageViaUpDown: function()\n    {\n        // New properties applied via up/down have an originalPropertyText and will be deleted later\n        // on, if cancelled, when the empty string gets applied as their style text.\n        return (\"originalPropertyText\" in this);\n    },\n\n    applyStyleText: function(styleText, updateInterface)\n    {\n        var section = this.treeOutline.section;\n        var elementsPanel = WebInspector.panels.elements;\n        styleText = styleText.replace(/\\s/g, \" \").trim(); // Replace &nbsp; with whitespace.\n        var styleTextLength = styleText.length;\n        if (!styleTextLength && updateInterface && this._newProperty && !this._hasBeenAppliedToPageViaUpDown()) {\n            // The user deleted everything and never applied a new property value via Up/Down scrolling, so remove the tree element and update.\n            this.parent.removeChild(this);\n            section.afterUpdate();\n            return;\n        }\n\n        function callback(newStyle)\n        {\n            if (!newStyle) {\n                // The user typed something, but it didn't parse. Just abort and restore\n                // the original title for this property.  If this was a new attribute and\n                // we couldn't parse, then just remove it.\n                if (this._newProperty) {\n                    this.parent.removeChild(this);\n                    return;\n                }\n                if (updateInterface)\n                    this.updateTitle();\n                return;\n            }\n\n            this.style = newStyle;\n            this.property = newStyle.propertyAt(this.property.index);\n            this._styleRule.style = this.style;\n\n            if (section && section.pane)\n                section.pane.dispatchEventToListeners(\"style edited\");\n\n            if (updateInterface)\n                this.updateAll(true);\n        }\n\n        // Append a \";\" if the new text does not end in \";\".\n        // FIXME: this does not handle trailing comments.\n        if (styleText.length && !/;\\s*$/.test(styleText))\n            styleText += \";\";\n        this.property.setText(styleText, updateInterface, callback.bind(this));\n    }\n}\n\nWebInspector.StylePropertyTreeElement.prototype.__proto__ = TreeElement.prototype;\n\nWebInspector.StylesSidebarPane.CSSPropertyPrompt = function(element, cssCompletions)\n{\n    WebInspector.TextPrompt.call(this, element, this._buildPropertyCompletions.bind(this), WebInspector.StylesSidebarPane.StyleValueDelimiters, true);\n    this._cssCompletions = cssCompletions;\n}\n\nWebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {\n    upKeyPressed: function(event)\n    {\n        this._handleNameOrValueUpDown(event);\n    },\n\n    downKeyPressed: function(event)\n    {\n        this._handleNameOrValueUpDown(event);\n    },\n\n    tabKeyPressed: function(event)\n    {\n        this.acceptAutoComplete();\n    },\n\n    _handleNameOrValueUpDown: function(event)\n    {\n        var reverse = (event.keyIdentifier || event.key) === \"Up\";\n        if (this.autoCompleteElement)\n            this.complete(false, reverse); // Accept the current suggestion, if any.\n        else {\n            // Select the word suffix to affect it when computing the subsequent suggestion.\n            this._selectCurrentWordSuffix();\n        }\n\n        this.complete(false, reverse); // Actually increment/decrement the suggestion.\n        event.handled = true;\n    },\n\n    _selectCurrentWordSuffix: function()\n    {\n        var selection = window.getSelection();\n        if (!selection.rangeCount)\n            return;\n\n        var selectionRange = selection.getRangeAt(0);\n        if (!selectionRange.commonAncestorContainer.isDescendant(this.element))\n            return;\n        var wordSuffixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this.element, \"forward\");\n        if (!wordSuffixRange.toString())\n            return;\n        selection.removeAllRanges();\n        selection.addRange(wordSuffixRange);\n    },\n\n    _buildPropertyCompletions: function(wordRange, bestMatchOnly, completionsReadyCallback)\n    {\n        if (!this._cssCompletions) return;\n\n        var prefix = wordRange.toString().toLowerCase();\n        var results;\n        if (bestMatchOnly) {\n            results = [];\n            var firstMatch = this._cssCompletions.firstStartsWith(prefix);\n            if (firstMatch)\n                results.push(firstMatch);\n            return completionsReadyCallback(results);\n        }\n\n        results = this._cssCompletions.startsWith(prefix);\n        if (results)\n            completionsReadyCallback(results);\n    }\n}\n\nWebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype.__proto__ = WebInspector.TextPrompt.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/SummaryBar.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.SummaryBar = function(categories)\n{\n    this.categories = categories;\n\n    this.element = document.createElement(\"div\");\n    this.element.className = \"summary-bar\";\n\n    this.graphElement = document.createElement(\"canvas\");\n    this.graphElement.setAttribute(\"width\", \"450\");\n    this.graphElement.setAttribute(\"height\", \"38\");\n    this.graphElement.className = \"summary-graph\";\n    this.element.appendChild(this.graphElement);\n\n    this.legendElement = document.createElement(\"div\");\n    this.legendElement.className = \"summary-graph-legend\";\n    this.element.appendChild(this.legendElement);\n}\n\nWebInspector.SummaryBar.prototype = {\n\n    get calculator() {\n        return this._calculator;\n    },\n\n    set calculator(x) {\n        this._calculator = x;\n    },\n\n    reset: function()\n    {\n        this.legendElement.removeChildren();\n        this._drawSummaryGraph();\n    },\n\n    update: function(data)\n    {\n        var graphInfo = this.calculator.computeSummaryValues(data);\n\n        var fillSegments = [];\n\n        this.legendElement.removeChildren();\n\n        for (var category in this.categories) {\n            var size = graphInfo.categoryValues[category];\n            if (!size)\n                continue;\n\n            var colorString = this.categories[category].color;\n\n            var fillSegment = {color: colorString, value: size};\n            fillSegments.push(fillSegment);\n\n            var legendLabel = this._makeLegendElement(this.categories[category].title, this.calculator.formatValue(size), colorString);\n            this.legendElement.appendChild(legendLabel);\n        }\n\n        if (graphInfo.total) {\n            var totalLegendLabel = this._makeLegendElement(WebInspector.UIString(\"Total\"), this.calculator.formatValue(graphInfo.total));\n            totalLegendLabel.addStyleClass(\"total\");\n            this.legendElement.appendChild(totalLegendLabel);\n        }\n\n        this._drawSummaryGraph(fillSegments);\n    },\n\n    _drawSwatch: function(canvas, color)\n    {\n        var ctx = canvas.getContext(\"2d\");\n\n        function drawSwatchSquare() {\n            ctx.fillStyle = color;\n            ctx.fillRect(0, 0, 13, 13);\n\n            var gradient = ctx.createLinearGradient(0, 0, 13, 13);\n            gradient.addColorStop(0.0, \"rgba(255, 255, 255, 0.2)\");\n            gradient.addColorStop(1.0, \"rgba(255, 255, 255, 0.0)\");\n\n            ctx.fillStyle = gradient;\n            ctx.fillRect(0, 0, 13, 13);\n\n            gradient = ctx.createLinearGradient(13, 13, 0, 0);\n            gradient.addColorStop(0.0, \"rgba(0, 0, 0, 0.2)\");\n            gradient.addColorStop(1.0, \"rgba(0, 0, 0, 0.0)\");\n\n            ctx.fillStyle = gradient;\n            ctx.fillRect(0, 0, 13, 13);\n\n            ctx.strokeStyle = \"rgba(0, 0, 0, 0.6)\";\n            ctx.strokeRect(0.5, 0.5, 12, 12);\n        }\n\n        ctx.clearRect(0, 0, 13, 24);\n\n        drawSwatchSquare();\n\n        ctx.save();\n\n        ctx.translate(0, 25);\n        ctx.scale(1, -1);\n\n        drawSwatchSquare();\n\n        ctx.restore();\n\n        this._fadeOutRect(ctx, 0, 13, 13, 13, 0.5, 0.0);\n    },\n\n    _drawSummaryGraph: function(segments)\n    {\n        if (!segments || !segments.length) {\n            segments = [{color: \"white\", value: 1}];\n            this._showingEmptySummaryGraph = true;\n        } else\n            delete this._showingEmptySummaryGraph;\n\n        // Calculate the total of all segments.\n        var total = 0;\n        for (var i = 0; i < segments.length; ++i)\n            total += segments[i].value;\n\n        // Calculate the percentage of each segment, rounded to the nearest percent.\n        var percents = segments.map(function(s) { return Math.max(Math.round(100 * s.value / total), 1) });\n\n        // Calculate the total percentage.\n        var percentTotal = 0;\n        for (var i = 0; i < percents.length; ++i)\n            percentTotal += percents[i];\n\n        // Make sure our percentage total is not greater-than 100, it can be greater\n        // if we rounded up for a few segments.\n        while (percentTotal > 100) {\n            for (var i = 0; i < percents.length && percentTotal > 100; ++i) {\n                if (percents[i] > 1) {\n                    --percents[i];\n                    --percentTotal;\n                }\n            }\n        }\n\n        // Make sure our percentage total is not less-than 100, it can be less\n        // if we rounded down for a few segments.\n        while (percentTotal < 100) {\n            for (var i = 0; i < percents.length && percentTotal < 100; ++i) {\n                ++percents[i];\n                ++percentTotal;\n            }\n        }\n\n        var ctx = this.graphElement.getContext(\"2d\");\n\n        var x = 0;\n        var y = 0;\n        var w = 450;\n        var h = 19;\n        var r = (h / 2);\n\n        function drawPillShadow()\n        {\n            // This draws a line with a shadow that is offset away from the line. The line is stroked\n            // twice with different X shadow offsets to give more feathered edges. Later we erase the\n            // line with destination-out 100% transparent black, leaving only the shadow. This only\n            // works if nothing has been drawn into the canvas yet.\n\n            ctx.beginPath();\n            ctx.moveTo(x + 4, y + h - 3 - 0.5);\n            ctx.lineTo(x + w - 4, y + h - 3 - 0.5);\n            ctx.closePath();\n\n            ctx.save();\n\n            ctx.shadowBlur = 2;\n            ctx.shadowColor = \"rgba(0, 0, 0, 0.5)\";\n            ctx.shadowOffsetX = 3;\n            ctx.shadowOffsetY = 5;\n\n            ctx.strokeStyle = \"white\";\n            ctx.lineWidth = 1;\n\n            ctx.stroke();\n\n            ctx.shadowOffsetX = -3;\n\n            ctx.stroke();\n\n            ctx.restore();\n\n            ctx.save();\n\n            ctx.globalCompositeOperation = \"destination-out\";\n            ctx.strokeStyle = \"rgba(0, 0, 0, 1)\";\n            ctx.lineWidth = 1;\n\n            ctx.stroke();\n\n            ctx.restore();\n        }\n\n        function drawPill()\n        {\n            // Make a rounded rect path.\n            ctx.beginPath();\n            ctx.moveTo(x, y + r);\n            ctx.lineTo(x, y + h - r);\n            ctx.arc(x + r, y + h - r, r, Math.PI, Math.PI / 2, true);\n            ctx.lineTo(x + w - r, y + h);\n            ctx.arc(x + w - r, y + h - r, r, Math.PI / 2, 0, true);\n            ctx.lineTo(x + w, y + r);\n            ctx.arc(x + w - r, y + r, r, 0, 3 * Math.PI / 2, true);\n            ctx.lineTo(x + r, y);\n            ctx.arc(x + r, y + r, r, Math.PI / 2, Math.PI, true);\n            ctx.closePath();\n\n            // Clip to the rounded rect path.\n            ctx.save();\n            ctx.clip();\n\n            // Fill the segments with the associated color.\n            var previousSegmentsWidth = 0;\n            for (var i = 0; i < segments.length; ++i) {\n                var segmentWidth = Math.round(w * percents[i] / 100);\n                ctx.fillStyle = segments[i].color;\n                ctx.fillRect(x + previousSegmentsWidth, y, segmentWidth, h);\n                previousSegmentsWidth += segmentWidth;\n            }\n\n            // Draw the segment divider lines.\n            ctx.lineWidth = 1;\n            for (var i = 1; i < 20; ++i) {\n                ctx.beginPath();\n                ctx.moveTo(x + (i * Math.round(w / 20)) + 0.5, y);\n                ctx.lineTo(x + (i * Math.round(w / 20)) + 0.5, y + h);\n                ctx.closePath();\n\n                ctx.strokeStyle = \"rgba(0, 0, 0, 0.2)\";\n                ctx.stroke();\n\n                ctx.beginPath();\n                ctx.moveTo(x + (i * Math.round(w / 20)) + 1.5, y);\n                ctx.lineTo(x + (i * Math.round(w / 20)) + 1.5, y + h);\n                ctx.closePath();\n\n                ctx.strokeStyle = \"rgba(255, 255, 255, 0.2)\";\n                ctx.stroke();\n            }\n\n            // Draw the pill shading.\n            var lightGradient = ctx.createLinearGradient(x, y, x, y + (h / 1.5));\n            lightGradient.addColorStop(0.0, \"rgba(220, 220, 220, 0.6)\");\n            lightGradient.addColorStop(0.4, \"rgba(220, 220, 220, 0.2)\");\n            lightGradient.addColorStop(1.0, \"rgba(255, 255, 255, 0.0)\");\n\n            var darkGradient = ctx.createLinearGradient(x, y + (h / 3), x, y + h);\n            darkGradient.addColorStop(0.0, \"rgba(0, 0, 0, 0.0)\");\n            darkGradient.addColorStop(0.8, \"rgba(0, 0, 0, 0.2)\");\n            darkGradient.addColorStop(1.0, \"rgba(0, 0, 0, 0.5)\");\n\n            ctx.fillStyle = darkGradient;\n            ctx.fillRect(x, y, w, h);\n\n            ctx.fillStyle = lightGradient;\n            ctx.fillRect(x, y, w, h);\n\n            ctx.restore();\n        }\n\n        ctx.clearRect(x, y, w, (h * 2));\n\n        drawPillShadow();\n        drawPill();\n\n        ctx.save();\n\n        ctx.translate(0, (h * 2) + 1);\n        ctx.scale(1, -1);\n\n        drawPill();\n\n        ctx.restore();\n\n        this._fadeOutRect(ctx, x, y + h + 1, w, h, 0.5, 0.0);\n    },\n\n    _fadeOutRect: function(ctx, x, y, w, h, a1, a2)\n    {\n        ctx.save();\n\n        var gradient = ctx.createLinearGradient(x, y, x, y + h);\n        gradient.addColorStop(0.0, \"rgba(0, 0, 0, \" + (1.0 - a1) + \")\");\n        gradient.addColorStop(0.8, \"rgba(0, 0, 0, \" + (1.0 - a2) + \")\");\n        gradient.addColorStop(1.0, \"rgba(0, 0, 0, 1.0)\");\n\n        ctx.globalCompositeOperation = \"destination-out\";\n\n        ctx.fillStyle = gradient;\n        ctx.fillRect(x, y, w, h);\n\n        ctx.restore();\n    },\n\n    _makeLegendElement: function(label, value, color)\n    {\n        var legendElement = document.createElement(\"label\");\n        legendElement.className = \"summary-graph-legend-item\";\n\n        if (color) {\n            var swatch = document.createElement(\"canvas\");\n            swatch.className = \"summary-graph-legend-swatch\";\n            swatch.setAttribute(\"width\", \"13\");\n            swatch.setAttribute(\"height\", \"24\");\n\n            legendElement.appendChild(swatch);\n\n            this._drawSwatch(swatch, color);\n        }\n\n        var labelElement = document.createElement(\"div\");\n        labelElement.className = \"summary-graph-legend-label\";\n        legendElement.appendChild(labelElement);\n\n        var headerElement = document.createElement(\"div\");\n        headerElement.className = \"summary-graph-legend-header\";\n        headerElement.textContent = label;\n        labelElement.appendChild(headerElement);\n\n        var valueElement = document.createElement(\"div\");\n        valueElement.className = \"summary-graph-legend-value\";\n        valueElement.textContent = value;\n        labelElement.appendChild(valueElement);\n\n        return legendElement;\n    }\n}\n\nWebInspector.SummaryBar.prototype.__proto__ = WebInspector.Object.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TabbedPane.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TabbedPane = function(element)\n{\n    this.element = element || document.createElement(\"div\");\n    this.element.addStyleClass(\"tabbed-pane\");\n    this._tabsElement = this.element.createChild(\"div\", \"tabbed-pane-header\");\n    this._contentElement = this.element.createChild(\"div\", \"tabbed-pane-content\");\n    this._tabs = {};\n}\n\nWebInspector.TabbedPane.prototype = {\n    appendTab: function(id, tabTitle, view)\n    {\n        var tabElement = document.createElement(\"li\");\n        tabElement.textContent = tabTitle;\n        tabElement.addEventListener(\"click\", this.selectTab.bind(this, id, true), false);\n\n        this._tabsElement.appendChild(tabElement);\n        this._contentElement.appendChild(view.element);\n\n        this._tabs[id] = { tabElement: tabElement, view: view }\n    },\n\n    selectTab: function(id, userGesture)\n    {\n        if (!(id in this._tabs))\n            return false;\n\n        if (this._currentTab) {\n            this._hideTab(this._currentTab)\n            delete this._currentTab;\n        }\n\n        var tab = this._tabs[id];\n        this._showTab(tab);\n        this._currentTab = tab;\n        if (userGesture) {\n            var event = {tabId: id};\n            this.dispatchEventToListeners(\"tab-selected\", event);\n        }\n        return true;\n    },\n\n    _showTab: function(tab)\n    {\n        tab.tabElement.addStyleClass(\"selected\");\n        tab.view.show(this._contentElement);\n    },\n\n    _hideTab: function(tab)\n    {\n        tab.tabElement.removeStyleClass(\"selected\");\n        tab.view.visible = false;\n    }\n}\n\nWebInspector.TabbedPane.prototype.__proto__ = WebInspector.Object.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TestController.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TestController = function(callId)\n{\n    this._callId = callId;\n    this._waitUntilDone = false;\n    this.results = [];\n}\n\nWebInspector.TestController.prototype = {\n    waitUntilDone: function()\n    {\n        this._waitUntilDone = true;\n    },\n\n    notifyDone: function(result)\n    {\n        if (typeof result === \"undefined\" && this.results.length)\n            result = this.results;\n        var message = typeof result === \"undefined\" ? \"\\\"<undefined>\\\"\" : JSON.stringify(result);\n        InspectorBackend.didEvaluateForTestInFrontend(this._callId, message);\n    },\n\n    runAfterPendingDispatches: function(callback)\n    {\n        if (WebInspector.pendingDispatches === 0) {\n            callback();\n            return;\n        }\n        setTimeout(this.runAfterPendingDispatches.bind(this), 0, callback);\n    }\n}\n\nWebInspector.evaluateForTestInFrontend = function(callId, script)\n{\n    var controller = new WebInspector.TestController(callId);\n    function invokeMethod()\n    {\n        try {\n            var result;\n            if (window[script] && typeof window[script] === \"function\")\n                result = window[script].call(WebInspector, controller);\n            else\n                result = window.eval(script);\n\n            if (!controller._waitUntilDone)\n                controller.notifyDone(result);\n        } catch (e) {\n            controller.notifyDone(e.toString());\n        }\n    }\n    controller.runAfterPendingDispatches(invokeMethod);\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TextEditorHighlighter.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n * Copyright (C) 2009 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TextEditorHighlighter = function(textModel, damageCallback)\n{\n    this._textModel = textModel;\n    this._tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(\"text/html\");\n    this._damageCallback = damageCallback;\n    this.reset();\n}\n\nWebInspector.TextEditorHighlighter.prototype = {\n    set mimeType(mimeType)\n    {\n        var tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(mimeType);\n        if (tokenizer) {\n            this._tokenizer = tokenizer;\n            this._tokenizerCondition = this._tokenizer.initialCondition;\n        }\n    },\n\n    reset: function()\n    {\n        this._lastHighlightedLine = 0;\n        this._lastHighlightedColumn = 0;\n        this._tokenizerCondition = this._tokenizer.initialCondition;\n    },\n\n    highlight: function(endLine)\n    {\n        // First check if we have work to do.\n        if (endLine <= this._lastHighlightedLine)\n            return;\n\n        this._requestedEndLine = endLine;\n\n        if (this._highlightTimer) {\n            // There is a timer scheduled, it will catch the new job based on the new endLine set.\n            return;\n        }\n\n        // Do small highlight synchronously. This will provide instant highlight on PageUp / PageDown, gentle scrolling.\n        this._highlightInChunks(endLine);\n\n        // Schedule tail highlight if necessary.\n        if (this._lastHighlightedLine < endLine)\n            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, endLine), 100);\n    },\n\n    _highlightInChunks: function(endLine)\n    {\n        delete this._highlightTimer;\n\n        // First we always check if we have work to do. Could be that user scrolled back and we can quit.\n        if (this._requestedEndLine <= this._lastHighlightedLine)\n            return;\n\n        if (this._requestedEndLine !== endLine) {\n            // User keeps updating the job in between of our timer ticks. Just reschedule self, don't eat CPU (they must be scrolling).\n            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, this._requestedEndLine), 100);\n            return;\n        }\n\n        this._highlightLines(this._requestedEndLine);\n\n        // Schedule tail highlight if necessary.\n        if (this._lastHighlightedLine < this._requestedEndLine)\n            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, this._requestedEndLine), 10);\n    },\n\n    _highlightLines: function(endLine)\n    {\n        // Tokenizer is stateless and reused accross viewers, restore its condition before highlight and save it after.\n        this._tokenizer.condition = this._tokenizerCondition;\n        var tokensCount = 0;\n        for (var lineNumber = this._lastHighlightedLine; lineNumber < endLine; ++lineNumber) {\n            var line = this._textModel.line(lineNumber);\n            this._tokenizer.line = line;\n            var attributes = this._textModel.getAttribute(lineNumber, \"highlight\") || {};\n\n            // Highlight line.\n            do {\n                var newColumn = this._tokenizer.nextToken(this._lastHighlightedColumn);\n                var tokenType = this._tokenizer.tokenType;\n                if (tokenType)\n                    attributes[this._lastHighlightedColumn] = { length: newColumn - this._lastHighlightedColumn, tokenType: tokenType, subTokenizer: this._tokenizer.subTokenizer };\n                this._lastHighlightedColumn = newColumn;\n                if (++tokensCount > 1000)\n                    break;\n            } while (this._lastHighlightedColumn < line.length)\n\n            this._textModel.setAttribute(lineNumber, \"highlight\", attributes);\n            if (this._lastHighlightedColumn < line.length) {\n                // Too much work for single chunk - exit.\n                break;\n            } else\n                this._lastHighlightedColumn = 0;\n        }\n\n        this._damageCallback(this._lastHighlightedLine, lineNumber);\n        this._tokenizerCondition = this._tokenizer.condition;\n        this._lastHighlightedLine = lineNumber;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TextEditorModel.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TextRange = function(startLine, startColumn, endLine, endColumn)\n{\n    this.startLine = startLine;\n    this.startColumn = startColumn;\n    this.endLine = endLine;\n    this.endColumn = endColumn;\n}\n\nWebInspector.TextRange.prototype = {\n    isEmpty: function()\n    {\n        return this.startLine === this.endLine && this.startColumn === this.endColumn;\n    },\n\n    get linesCount()\n    {\n        return this.endLine - this.startLine;\n    },\n\n    clone: function()\n    {\n        return new WebInspector.TextRange(this.startLine, this.startColumn, this.endLine, this.endColumn); \n    }\n}\n\nWebInspector.TextEditorModel = function()\n{\n    this._lines = [\"\"];\n    this._attributes = [];\n    this._undoStack = [];\n    this._noPunctuationRegex = /[^ !%&()*+,-.:;<=>?\\[\\]\\^{|}~]+/;\n}\n\nWebInspector.TextEditorModel.prototype = {\n    set changeListener(changeListener)\n    {\n        this._changeListener = changeListener;\n    },\n\n    get linesCount()\n    {\n        return this._lines.length;\n    },\n\n    line: function(lineNumber)\n    {\n        if (lineNumber >= this._lines.length)\n            throw \"Out of bounds:\" + lineNumber;\n        return this._lines[lineNumber];\n    },\n\n    lineLength: function(lineNumber)\n    {\n        return this._lines[lineNumber].length;\n    },\n\n    setText: function(range, text)\n    {\n        if (!range)\n            range = new WebInspector.TextRange(0, 0, this._lines.length - 1, this._lines[this._lines.length - 1].length);\n        var command = this._pushUndoableCommand(range, text);\n        var newRange = this._innerSetText(range, text);\n        command.range = newRange.clone();\n\n        if (this._changeListener)\n            this._changeListener(range, newRange, command.text, text);\n        return newRange;\n    },\n\n    set replaceTabsWithSpaces(replaceTabsWithSpaces)\n    {\n        this._replaceTabsWithSpaces = replaceTabsWithSpaces;\n    },\n\n    _innerSetText: function(range, text)\n    {\n        this._eraseRange(range);\n        if (text === \"\")\n            return new WebInspector.TextRange(range.startLine, range.startColumn, range.startLine, range.startColumn);\n\n        var newLines = text.split(\"\\n\");\n        this._replaceTabsIfNeeded(newLines);\n\n        var prefix = this._lines[range.startLine].substring(0, range.startColumn);\n        var prefixArguments = this._arguments\n        var suffix = this._lines[range.startLine].substring(range.startColumn);\n\n        var postCaret = prefix.length;\n        // Insert text.\n        if (newLines.length === 1) {\n            this._setLine(range.startLine, prefix + newLines[0] + suffix);\n            postCaret += newLines[0].length;\n        } else {\n            this._setLine(range.startLine, prefix + newLines[0]);\n            for (var i = 1; i < newLines.length; ++i)\n                this._insertLine(range.startLine + i, newLines[i]);\n            this._setLine(range.startLine + newLines.length - 1, newLines[newLines.length - 1] + suffix);\n            postCaret = newLines[newLines.length - 1].length;\n        }\n        return new WebInspector.TextRange(range.startLine, range.startColumn,\n                                          range.startLine + newLines.length - 1, postCaret);\n    },\n\n    _replaceTabsIfNeeded: function(lines)\n    {\n        if (!this._replaceTabsWithSpaces)\n            return;\n        var spaces = [ \"    \", \"   \", \"  \", \" \"];\n        for (var i = 0; i < lines.length; ++i) {\n            var line = lines[i];\n            var index = line.indexOf(\"\\t\");\n            while (index !== -1) {\n                line = line.substring(0, index) + spaces[index % 4] + line.substring(index + 1);\n                index = line.indexOf(\"\\t\", index + 1);\n            }\n            lines[i] = line;\n        }\n    },\n\n    _eraseRange: function(range)\n    {\n        if (range.isEmpty())\n            return;\n\n        var prefix = this._lines[range.startLine].substring(0, range.startColumn);\n        var suffix = this._lines[range.endLine].substring(range.endColumn);\n\n        if (range.endLine > range.startLine)\n            this._removeLines(range.startLine + 1, range.endLine - range.startLine);\n        this._setLine(range.startLine, prefix + suffix);\n    },\n\n    _setLine: function(lineNumber, text)\n    {\n        this._lines[lineNumber] = text;\n    },\n\n    _removeLines: function(fromLine, count)\n    {\n        this._lines.splice(fromLine, count);\n        this._attributes.splice(fromLine, count);\n    },\n\n    _insertLine: function(lineNumber, text)\n    {\n        this._lines.splice(lineNumber, 0, text);\n        this._attributes.splice(lineNumber, 0, {});\n    },\n\n    wordRange: function(lineNumber, column)\n    {\n        return new WebInspector.TextRange(lineNumber, this.wordStart(lineNumber, column, true), lineNumber, this.wordEnd(lineNumber, column, true));\n    },\n\n    wordStart: function(lineNumber, column, gapless)\n    {\n        var line = this._lines[lineNumber];\n        var prefix = line.substring(0, column).split(\"\").reverse().join(\"\");\n        var prefixMatch = this._noPunctuationRegex.exec(prefix);\n        return prefixMatch && (!gapless || prefixMatch.index === 0) ? column - prefixMatch.index - prefixMatch[0].length : column;\n    },\n\n    wordEnd: function(lineNumber, column, gapless)\n    {\n        var line = this._lines[lineNumber];\n        var suffix = line.substring(column);\n        var suffixMatch = this._noPunctuationRegex.exec(suffix);\n        return suffixMatch && (!gapless || suffixMatch.index === 0) ? column + suffixMatch.index + suffixMatch[0].length : column;\n    },\n\n    copyRange: function(range)\n    {\n        if (!range)\n            range = new WebInspector.TextRange(0, 0, this._lines.length - 1, this._lines[this._lines.length - 1].length);\n\n        var clip = [];\n        if (range.startLine === range.endLine) {\n            clip.push(this._lines[range.startLine].substring(range.startColumn, range.endColumn));\n            return clip.join(\"\\n\");\n        }\n        clip.push(this._lines[range.startLine].substring(range.startColumn));\n        for (var i = range.startLine + 1; i < range.endLine; ++i)\n            clip.push(this._lines[i]);\n        clip.push(this._lines[range.endLine].substring(0, range.endColumn));\n        return clip.join(\"\\n\");\n    },\n\n    setAttribute: function(line, name, value)\n    {\n        var attrs = this._attributes[line];\n        if (!attrs) {\n            attrs = {};\n            this._attributes[line] = attrs;\n        }\n        attrs[name] = value;\n    },\n\n    getAttribute: function(line, name)\n    {\n        var attrs = this._attributes[line];\n        return attrs ? attrs[name] : null;\n    },\n\n    removeAttribute: function(line, name)\n    {\n        var attrs = this._attributes[line];\n        if (attrs)\n            delete attrs[name];\n    },\n\n    _pushUndoableCommand: function(range, text)\n    {\n        var command = {\n            text: this.copyRange(range),\n            startLine: range.startLine,\n            startColumn: range.startColumn,\n            endLine: range.startLine,\n            endColumn: range.startColumn\n        };\n        if (this._inUndo)\n            this._redoStack.push(command);\n        else {\n            if (!this._inRedo)\n                this._redoStack = [];\n            this._undoStack.push(command);\n        }\n        return command;\n    },\n\n    undo: function()\n    {\n        this._markRedoableState();\n\n        this._inUndo = true;\n        var range = this._doUndo(this._undoStack);\n        delete this._inUndo;\n\n        return range;\n    },\n\n    redo: function()\n    {\n        this.markUndoableState();\n\n        this._inRedo = true;\n        var range = this._doUndo(this._redoStack);\n        delete this._inRedo;\n\n        return range;\n    },\n\n    _doUndo: function(stack)\n    {\n        var range = null;\n        for (var i = stack.length - 1; i >= 0; --i) {\n            var command = stack[i];\n            stack.length = i;\n\n            range = this.setText(command.range, command.text);\n            if (i > 0 && stack[i - 1].explicit)\n                return range;\n        }\n        return range;\n    },\n\n    markUndoableState: function()\n    {\n        if (this._undoStack.length)\n            this._undoStack[this._undoStack.length - 1].explicit = true;\n    },\n\n    _markRedoableState: function()\n    {\n        if (this._redoStack.length)\n            this._redoStack[this._redoStack.length - 1].explicit = true;\n    },\n\n    resetUndoStack: function()\n    {\n        this._undoStack = [];\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TextPrompt.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n /**\n  * fixed chrome bug, add ArrowUp, ArrowDown, ArrowRight\n  * by wuchangming\n  */\n\n\nWebInspector.TextPrompt = function(element, completions, stopCharacters, omitHistory)\n{\n    this.element = element;\n    this.element.addStyleClass(\"text-prompt\");\n    this.completions = completions;\n    this.completionStopCharacters = stopCharacters;\n    if (!omitHistory) {\n        this.history = [];\n        this.historyOffset = 0;\n    }\n    this._boundOnKeyDown = this._onKeyDown.bind(this);\n    this.element.addEventListener(\"keydown\", this._boundOnKeyDown, true);\n}\n\nWebInspector.TextPrompt.prototype = {\n    get text()\n    {\n        return this.element.textContent;\n    },\n\n    set text(x)\n    {\n        if (!x) {\n            // Append a break element instead of setting textContent to make sure the selection is inside the prompt.\n            this.element.removeChildren();\n\n            // For IE  we don't need a <br> to correctly set console caret; otherwise there will be two lines (incorrect) instead of one\n            if (!navigator.userAgent.match(/MSIE/i)) {\n\n                this.element.appendChild(document.createElement(\"br\"));\n            }\n        } else\n            this.element.textContent = x;\n\n        this.moveCaretToEndOfPrompt();\n    },\n\n    removeFromElement: function()\n    {\n        this.clearAutoComplete(true);\n        this.element.removeEventListener(\"keydown\", this._boundOnKeyDown, true);\n    },\n\n    _onKeyDown: function(event)\n    {\n        function defaultAction()\n        {\n            this.clearAutoComplete();\n            this.autoCompleteSoon();\n        }\n\n        if (event.handled)\n            return;\n\n        var handled = false,\n            key = event.keyIdentifier || event.key;\n\n        switch (key) {\n            case \"Up\":\n            case \"ArrowUp\":\n                this.upKeyPressed(event);\n                break;\n            case \"Down\":\n            case \"ArrowDown\":\n                this.downKeyPressed(event);\n                break;\n            case \"U+0009\": // Tab\n                this.tabKeyPressed(event);\n                break;\n            case \"Right\":\n            case \"ArrowRight\":\n            case \"End\":\n                if (!this.acceptAutoComplete())\n                    this.autoCompleteSoon();\n                break;\n            case \"Alt\":\n            case \"Meta\":\n            case \"Shift\":\n            case \"Control\":\n                break;\n            case \"U+0050\": // Ctrl+P = Previous\n                if (this.history && WebInspector.isMac() && event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {\n                    handled = true;\n                    this._moveBackInHistory();\n                    break;\n                }\n                defaultAction.call(this);\n                break;\n            case \"U+004E\": // Ctrl+N = Next\n                if (this.history && WebInspector.isMac() && event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {\n                    handled = true;\n                    this._moveForwardInHistory();\n                    break;\n                }\n                defaultAction.call(this);\n                break;\n            default:\n                defaultAction.call(this);\n                break;\n        }\n\n        if (event.keyCode == 13 || event.charCode == 13) {\n            handled = true;\n            event.target.blur();\n        }\n\n        handled |= event.handled;\n        if (handled) {\n            event.handled = true;\n            event.preventDefault();\n            event.stopPropagation();\n        }\n    },\n\n    acceptAutoComplete: function()\n    {\n        if (!this.autoCompleteElement || !this.autoCompleteElement.parentNode)\n            return false;\n\n        var text = this.autoCompleteElement.textContent;\n        var textNode = document.createTextNode(text);\n        this.autoCompleteElement.parentNode.replaceChild(textNode, this.autoCompleteElement);\n        delete this.autoCompleteElement;\n\n        var finalSelectionRange = document.createRange();\n        finalSelectionRange.setStart(textNode, text.length);\n        finalSelectionRange.setEnd(textNode, text.length);\n\n        var selection = window.getSelection();\n        selection.removeAllRanges();\n        selection.addRange(finalSelectionRange);\n\n        return true;\n    },\n\n    clearAutoComplete: function(includeTimeout)\n    {\n        if (includeTimeout && \"_completeTimeout\" in this) {\n            clearTimeout(this._completeTimeout);\n            delete this._completeTimeout;\n        }\n\n        if (!this.autoCompleteElement)\n            return;\n\n        if (this.autoCompleteElement.parentNode)\n            this.autoCompleteElement.parentNode.removeChild(this.autoCompleteElement);\n        delete this.autoCompleteElement;\n\n        if (!this._userEnteredRange || !this._userEnteredText)\n            return;\n\n        this._userEnteredRange.deleteContents();\n        this.element.pruneEmptyTextNodes();\n\n        var userTextNode = document.createTextNode(this._userEnteredText);\n        this._userEnteredRange.insertNode(userTextNode);\n\n        var selectionRange = document.createRange();\n        selectionRange.setStart(userTextNode, this._userEnteredText.length);\n        selectionRange.setEnd(userTextNode, this._userEnteredText.length);\n\n        var selection = window.getSelection();\n        selection.removeAllRanges();\n        selection.addRange(selectionRange);\n\n        delete this._userEnteredRange;\n        delete this._userEnteredText;\n    },\n\n    autoCompleteSoon: function()\n    {\n        if (!(\"_completeTimeout\" in this))\n            this._completeTimeout = setTimeout(this.complete.bind(this, true), 250);\n    },\n\n    complete: function(auto, reverse)\n    {\n        this.clearAutoComplete(true);\n        var selection = window.getSelection();\n        if (!selection.rangeCount)\n            return;\n\n        var selectionRange = selection.getRangeAt(0);\n        var isEmptyInput = selectionRange.commonAncestorContainer === this.element; // this.element has no child Text nodes.\n\n        // Do not attempt to auto-complete an empty input in the auto mode (only on demand).\n        if (auto && isEmptyInput)\n            return;\n        if (!auto && !isEmptyInput && !selectionRange.commonAncestorContainer.isDescendant(this.element))\n            return;\n        if (auto && !this.isCaretAtEndOfPrompt())\n            return;\n        var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this.completionStopCharacters, this.element, \"backward\");\n        this.completions(wordPrefixRange, auto, this._completionsReady.bind(this, selection, auto, wordPrefixRange, reverse));\n    },\n\n    _completionsReady: function(selection, auto, originalWordPrefixRange, reverse, completions)\n    {\n        if (!completions || !completions.length)\n            return;\n\n        var selectionRange = selection.getRangeAt(0);\n\n        var fullWordRange = document.createRange();\n        fullWordRange.setStart(originalWordPrefixRange.startContainer, originalWordPrefixRange.startOffset);\n        fullWordRange.setEnd(selectionRange.endContainer, selectionRange.endOffset);\n\n        if (originalWordPrefixRange.toString() + selectionRange.toString() != fullWordRange.toString())\n            return;\n\n        var wordPrefixLength = originalWordPrefixRange.toString().length;\n\n        if (auto)\n            var completionText = completions[0];\n        else {\n            if (completions.length === 1) {\n                var completionText = completions[0];\n                wordPrefixLength = completionText.length;\n            } else {\n                var commonPrefix = completions[0];\n                for (var i = 0; i < completions.length; ++i) {\n                    var completion = completions[i];\n                    var lastIndex = Math.min(commonPrefix.length, completion.length);\n                    for (var j = wordPrefixLength; j < lastIndex; ++j) {\n                        if (commonPrefix[j] !== completion[j]) {\n                            commonPrefix = commonPrefix.substr(0, j);\n                            break;\n                        }\n                    }\n                }\n                wordPrefixLength = commonPrefix.length;\n\n                if (selection.isCollapsed)\n                    var completionText = completions[0];\n                else {\n                    var currentText = fullWordRange.toString();\n\n                    var foundIndex = null;\n                    for (var i = 0; i < completions.length; ++i) {\n                        if (completions[i] === currentText)\n                            foundIndex = i;\n                    }\n\n                    var nextIndex = foundIndex + (reverse ? -1 : 1);\n                    if (foundIndex === null || nextIndex >= completions.length)\n                        var completionText = completions[0];\n                    else if (nextIndex < 0)\n                        var completionText = completions[completions.length - 1];\n                    else\n                        var completionText = completions[nextIndex];\n                }\n            }\n        }\n\n        this._userEnteredRange = fullWordRange;\n        this._userEnteredText = fullWordRange.toString();\n\n        fullWordRange.deleteContents();\n        this.element.pruneEmptyTextNodes();\n\n        var finalSelectionRange = document.createRange();\n\n        if (auto) {\n            var prefixText = completionText.substring(0, wordPrefixLength);\n            var suffixText = completionText.substring(wordPrefixLength);\n\n            var prefixTextNode = document.createTextNode(prefixText);\n            fullWordRange.insertNode(prefixTextNode);\n\n            this.autoCompleteElement = document.createElement(\"span\");\n            this.autoCompleteElement.className = \"auto-complete-text\";\n            this.autoCompleteElement.textContent = suffixText;\n\n            prefixTextNode.parentNode.insertBefore(this.autoCompleteElement, prefixTextNode.nextSibling);\n\n            finalSelectionRange.setStart(prefixTextNode, wordPrefixLength);\n            finalSelectionRange.setEnd(prefixTextNode, wordPrefixLength);\n        } else {\n            var completionTextNode = document.createTextNode(completionText);\n            fullWordRange.insertNode(completionTextNode);\n\n            if (completions.length > 1)\n                finalSelectionRange.setStart(completionTextNode, wordPrefixLength);\n            else\n                finalSelectionRange.setStart(completionTextNode, completionText.length);\n\n            finalSelectionRange.setEnd(completionTextNode, completionText.length);\n        }\n\n        selection.removeAllRanges();\n        selection.addRange(finalSelectionRange);\n    },\n\n    isCaretInsidePrompt: function()\n    {\n        return this.element.isInsertionCaretInside();\n    },\n\n    isCaretAtEndOfPrompt: function()\n    {\n        var selection = window.getSelection();\n        if (!selection.rangeCount || !selection.isCollapsed)\n            return false;\n\n        var selectionRange = selection.getRangeAt(0);\n        var node = selectionRange.startContainer;\n        if (node !== this.element && !node.isDescendant(this.element))\n            return false;\n\n        if (node.nodeType === Node.TEXT_NODE && selectionRange.startOffset < node.nodeValue.length)\n            return false;\n\n        var foundNextText = false;\n        while (node) {\n            if (node.nodeType === Node.TEXT_NODE && node.nodeValue.length) {\n                if (foundNextText)\n                    return false;\n                foundNextText = true;\n            }\n\n            node = node.traverseNextNode(this.element);\n        }\n\n        return true;\n    },\n\n    isCaretOnFirstLine: function()\n    {\n        var selection = window.getSelection();\n        var focusNode = selection.focusNode;\n        if (!focusNode || focusNode.nodeType !== Node.TEXT_NODE || focusNode.parentNode !== this.element)\n            return true;\n\n        if (focusNode.textContent.substring(0, selection.focusOffset).indexOf(\"\\n\") !== -1)\n            return false;\n        focusNode = focusNode.previousSibling;\n\n        while (focusNode) {\n            if (focusNode.nodeType !== Node.TEXT_NODE)\n                return true;\n            if (focusNode.textContent.indexOf(\"\\n\") !== -1)\n                return false;\n            focusNode = focusNode.previousSibling;\n        }\n\n        return true;\n    },\n\n    isCaretOnLastLine: function()\n    {\n        var selection = window.getSelection();\n        var focusNode = selection.focusNode;\n        if (!focusNode || focusNode.nodeType !== Node.TEXT_NODE || focusNode.parentNode !== this.element)\n            return true;\n\n        if (focusNode.textContent.substring(selection.focusOffset).indexOf(\"\\n\") !== -1)\n            return false;\n        focusNode = focusNode.nextSibling;\n\n        while (focusNode) {\n            if (focusNode.nodeType !== Node.TEXT_NODE)\n                return true;\n            if (focusNode.textContent.indexOf(\"\\n\") !== -1)\n                return false;\n            focusNode = focusNode.nextSibling;\n        }\n\n        return true;\n    },\n\n    moveCaretToEndOfPrompt: function()\n    {\n        var selection = window.getSelection();\n        var selectionRange = document.createRange();\n\n        var offset = this.element.childNodes.length;\n        selectionRange.setStart(this.element, offset);\n        selectionRange.setEnd(this.element, offset);\n\n        selection.removeAllRanges();\n        selection.addRange(selectionRange);\n    },\n\n    tabKeyPressed: function(event)\n    {\n        event.handled = true;\n        this.complete(false, event.shiftKey);\n    },\n\n    upKeyPressed: function(event)\n    {\n        if (!this.isCaretOnFirstLine())\n            return;\n\n        event.handled = true;\n        this._moveBackInHistory();\n    },\n\n    downKeyPressed: function(event)\n    {\n        if (!this.isCaretOnLastLine())\n            return;\n\n        event.handled = true;\n        this._moveForwardInHistory();\n    },\n\n    _moveBackInHistory: function()\n    {\n        if (!this.history || this.historyOffset == this.history.length)\n            return;\n\n        this.clearAutoComplete(true);\n\n        if (this.historyOffset === 0)\n            this.tempSavedCommand = this.text;\n\n        ++this.historyOffset;\n        this.text = this.history[this.history.length - this.historyOffset];\n\n        this.element.scrollIntoView(true);\n        var firstNewlineIndex = this.text.indexOf(\"\\n\");\n        if (firstNewlineIndex === -1)\n            this.moveCaretToEndOfPrompt();\n        else {\n            var selection = window.getSelection();\n            var selectionRange = document.createRange();\n\n            selectionRange.setStart(this.element.firstChild, firstNewlineIndex);\n            selectionRange.setEnd(this.element.firstChild, firstNewlineIndex);\n\n            selection.removeAllRanges();\n            selection.addRange(selectionRange);\n        }\n    },\n\n    _moveForwardInHistory: function()\n    {\n        if (!this.history || this.historyOffset === 0)\n            return;\n\n        this.clearAutoComplete(true);\n\n        --this.historyOffset;\n\n        if (this.historyOffset === 0) {\n            this.text = this.tempSavedCommand;\n            delete this.tempSavedCommand;\n            return;\n        }\n\n        this.text = this.history[this.history.length - this.historyOffset];\n        this.element.scrollIntoView();\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TextViewer.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n * Copyright (C) 2010 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TextViewer = function(textModel, platform, url)\n{\n    this._textModel = textModel;\n    this._textModel.changeListener = this._textChanged.bind(this);\n\n    this.element = document.createElement(\"div\");\n    this.element.className = \"text-editor monospace\";\n\n    var syncScrollListener = this._syncScroll.bind(this);\n    var syncDecorationsForLineListener = this._syncDecorationsForLine.bind(this);\n    this._mainPanel = new WebInspector.TextEditorMainPanel(this._textModel, url, syncScrollListener, syncDecorationsForLineListener);\n    this._gutterPanel = new WebInspector.TextEditorGutterPanel(this._textModel, syncDecorationsForLineListener);\n    this.element.appendChild(this._mainPanel.element);\n    this.element.appendChild(this._gutterPanel.element);\n}\n\nWebInspector.TextViewer.prototype = {\n    set mimeType(mimeType)\n    {\n        this._mainPanel.mimeType = mimeType;\n    },\n\n    set readOnly(readOnly)\n    {\n        this._mainPanel.readOnly = readOnly;\n    },\n\n    get textModel()\n    {\n        return this._textModel;\n    },\n\n    revealLine: function(lineNumber)\n    {\n        this._mainPanel.revealLine(lineNumber);\n    },\n\n    addDecoration: function(lineNumber, decoration)\n    {\n        this._mainPanel.addDecoration(lineNumber, decoration);\n        this._gutterPanel.addDecoration(lineNumber, decoration);\n    },\n\n    removeDecoration: function(lineNumber, decoration)\n    {\n        this._mainPanel.removeDecoration(lineNumber, decoration);\n        this._gutterPanel.removeDecoration(lineNumber, decoration);\n    },\n\n    markAndRevealRange: function(range)\n    {\n        this._mainPanel.markAndRevealRange(range);\n    },\n\n    highlightLine: function(lineNumber)\n    {\n        this._mainPanel.highlightLine(lineNumber);\n    },\n\n    clearLineHighlight: function()\n    {\n        this._mainPanel.clearLineHighlight();\n    },\n\n    freeCachedElements: function()\n    {\n        this._mainPanel.freeCachedElements();\n        this._gutterPanel.freeCachedElements();\n    },\n\n    editLine: function(lineRow, callback)\n    {\n        this._mainPanel.editLine(lineRow, callback);\n    },\n\n    get scrollTop()\n    {\n        return this._mainPanel.element.scrollTop;\n    },\n\n    set scrollTop(scrollTop)\n    {\n        this._mainPanel.element.scrollTop = scrollTop;\n    },\n\n    get scrollLeft()\n    {\n        return this._mainPanel.element.scrollLeft;\n    },\n\n    set scrollLeft(scrollLeft)\n    {\n        this._mainPanel.element.scrollLeft = scrollLeft;\n    },\n\n    beginUpdates: function()\n    {\n        this._mainPanel.beginUpdates();\n        this._gutterPanel.beginUpdates();\n    },\n\n    endUpdates: function()\n    {\n        this._mainPanel.endUpdates();\n        this._gutterPanel.endUpdates();\n    },\n\n    resize: function()\n    {\n        this._mainPanel.resize();\n        this._gutterPanel.resize();\n        this._updatePanelOffsets();\n    },\n\n    // WebInspector.TextModel listener\n    _textChanged: function(oldRange, newRange, oldText, newText)\n    {\n        this._mainPanel.textChanged();\n        this._gutterPanel.textChanged();\n        this._updatePanelOffsets();\n    },\n\n    _updatePanelOffsets: function()\n    {\n        var lineNumbersWidth = this._gutterPanel.element.offsetWidth;\n        if (lineNumbersWidth)\n            this._mainPanel.element.style.setProperty(\"left\", lineNumbersWidth + \"px\");\n        else\n            this._mainPanel.element.style.removeProperty(\"left\"); // Use default value set in CSS.\n    },\n\n    _syncScroll: function()\n    {\n        // Async call due to performance reasons.\n        setTimeout(function() {\n            var mainElement = this._mainPanel.element;\n            var gutterElement = this._gutterPanel.element;\n\n            // Handle horizontal scroll bar at the bottom of the main panel.\n            if (gutterElement.offsetHeight > mainElement.clientHeight)\n                gutterElement.style.setProperty(\"padding-bottom\", (gutterElement.offsetHeight - mainElement.clientHeight) + \"px\");\n            else\n                gutterElement.style.removeProperty(\"padding-bottom\");\n\n            gutterElement.scrollTop = mainElement.scrollTop;\n        }.bind(this), 0);\n    },\n\n    _syncDecorationsForLine: function(lineNumber)\n    {\n        if (lineNumber >= this._textModel.linesCount)\n            return;\n\n        var mainChunk = this._mainPanel.makeLineAChunk(lineNumber);\n        var gutterChunk = this._gutterPanel.makeLineAChunk(lineNumber);\n        var height = mainChunk.height;\n        if (height)\n            gutterChunk.element.style.setProperty(\"height\", height + \"px\");\n        else\n            gutterChunk.element.style.removeProperty(\"height\");\n    }\n}\n\nWebInspector.TextEditorChunkedPanel = function(textModel)\n{\n    this._textModel = textModel;\n\n    this._defaultChunkSize = 50;\n    this._paintCoalescingLevel = 0;\n    this._domUpdateCoalescingLevel = 0;\n}\n\nWebInspector.TextEditorChunkedPanel.prototype = {\n    get textModel()\n    {\n        return this._textModel;\n    },\n\n    revealLine: function(lineNumber)\n    {\n        if (lineNumber >= this._textModel.linesCount)\n            return;\n\n        var chunk = this.makeLineAChunk(lineNumber);\n        chunk.element.scrollIntoViewIfNeeded();\n    },\n\n    addDecoration: function(lineNumber, decoration)\n    {\n        var chunk = this.makeLineAChunk(lineNumber);\n        chunk.addDecoration(decoration);\n    },\n\n    removeDecoration: function(lineNumber, decoration)\n    {\n        var chunk = this.makeLineAChunk(lineNumber);\n        chunk.removeDecoration(decoration);\n    },\n\n    textChanged: function(oldRange, newRange, oldText, newText)\n    {\n        this._buildChunks();\n    },\n\n    _buildChunks: function()\n    {\n        this.beginDomUpdates();\n\n        this.element.removeChildren();\n\n        this._textChunks = [];\n        for (var i = 0; i < this._textModel.linesCount; i += this._defaultChunkSize) {\n            var chunk = this._createNewChunk(i, i + this._defaultChunkSize);\n            this._textChunks.push(chunk);\n            this.element.appendChild(chunk.element);\n        }\n\n        this._repaintAll();\n\n        this.endDomUpdates();\n    },\n\n    makeLineAChunk: function(lineNumber)\n    {\n        if (!this._textChunks)\n            this._buildChunks();\n\n        var chunkNumber = this._chunkNumberForLine(lineNumber);\n        var oldChunk = this._textChunks[chunkNumber];\n        if (oldChunk.linesCount === 1)\n            return oldChunk;\n\n        this.beginDomUpdates();\n\n        var wasExpanded = oldChunk.expanded;\n        oldChunk.expanded = false;\n\n        var insertIndex = chunkNumber + 1;\n\n        // Prefix chunk.\n        if (lineNumber > oldChunk.startLine) {\n            var prefixChunk = this._createNewChunk(oldChunk.startLine, lineNumber);\n            this._textChunks.splice(insertIndex++, 0, prefixChunk);\n            this.element.insertBefore(prefixChunk.element, oldChunk.element);\n        }\n\n        // Line chunk.\n        var lineChunk = this._createNewChunk(lineNumber, lineNumber + 1);\n        this._textChunks.splice(insertIndex++, 0, lineChunk);\n        this.element.insertBefore(lineChunk.element, oldChunk.element);\n\n        // Suffix chunk.\n        if (oldChunk.startLine + oldChunk.linesCount > lineNumber + 1) {\n            var suffixChunk = this._createNewChunk(lineNumber + 1, oldChunk.startLine + oldChunk.linesCount);\n            this._textChunks.splice(insertIndex, 0, suffixChunk);\n            this.element.insertBefore(suffixChunk.element, oldChunk.element);\n        }\n\n        // Remove enclosing chunk.\n        this._textChunks.splice(chunkNumber, 1);\n        this.element.removeChild(oldChunk.element);\n\n        if (wasExpanded) {\n            if (prefixChunk)\n                prefixChunk.expanded = true;\n            lineChunk.expanded = true;\n            if (suffixChunk)\n                suffixChunk.expanded = true;\n        }\n\n        this.endDomUpdates();\n\n        return lineChunk;\n    },\n\n    _scroll: function()\n    {\n        this._scheduleRepaintAll();\n        if (this._syncScrollListener)\n            this._syncScrollListener();\n    },\n\n    _scheduleRepaintAll: function()\n    {\n        if (this._repaintAllTimer)\n            clearTimeout(this._repaintAllTimer);\n        this._repaintAllTimer = setTimeout(this._repaintAll.bind(this), 50);\n    },\n\n    beginUpdates: function()\n    {\n        this._paintCoalescingLevel++;\n    },\n\n    endUpdates: function()\n    {\n        this._paintCoalescingLevel--;\n        if (!this._paintCoalescingLevel)\n            this._repaintAll();\n    },\n\n    beginDomUpdates: function()\n    {\n        this._domUpdateCoalescingLevel++;\n    },\n\n    endDomUpdates: function()\n    {\n        this._domUpdateCoalescingLevel--;\n    },\n\n    _chunkNumberForLine: function(lineNumber)\n    {\n        for (var i = 0; i < this._textChunks.length; ++i) {\n            var line = this._textChunks[i].startLine;\n            if (lineNumber >= line && lineNumber < line + this._textChunks[i].linesCount)\n                return i;\n        }\n        return this._textChunks.length - 1;\n    },\n\n    _chunkForLine: function(lineNumber)\n    {\n        return this._textChunks[this._chunkNumberForLine(lineNumber)];\n    },\n\n    _repaintAll: function()\n    {\n        delete this._repaintAllTimer;\n\n        if (this._paintCoalescingLevel || this._dirtyLines)\n            return;\n\n        if (!this._textChunks)\n            this._buildChunks();\n\n        var visibleFrom = this.element.scrollTop;\n        var visibleTo = this.element.scrollTop + this.element.clientHeight;\n\n        var offset = 0;\n        var fromIndex = -1;\n        var toIndex = 0;\n        for (var i = 0; i < this._textChunks.length; ++i) {\n            var chunk = this._textChunks[i];\n            var chunkHeight = chunk.height;\n            if (offset + chunkHeight > visibleFrom && offset < visibleTo) {\n                if (fromIndex === -1)\n                    fromIndex = i;\n                toIndex = i + 1;\n            } else {\n                if (offset >= visibleTo)\n                    break;\n            }\n            offset += chunkHeight;\n        }\n\n        if (toIndex)\n            this._expandChunks(fromIndex, toIndex);\n    },\n\n    _totalHeight: function(firstElement, lastElement)\n    {\n        lastElement = (lastElement || firstElement).nextElementSibling;\n        if (lastElement)\n            return lastElement.offsetTop - firstElement.offsetTop;\n        else if (firstElement.offsetParent)\n            return firstElement.offsetParent.scrollHeight - firstElement.offsetTop;\n        return firstElement.offsetHeight;\n    },\n    \n    resize: function()\n    {\n        this._repaintAll();\n    }\n}\n\nWebInspector.TextEditorGutterPanel = function(textModel, syncDecorationsForLineListener)\n{\n    WebInspector.TextEditorChunkedPanel.call(this, textModel);\n\n    this._syncDecorationsForLineListener = syncDecorationsForLineListener;\n\n    this.element = document.createElement(\"div\");\n    this.element.className = \"text-editor-lines\";\n\n    this.element.addEventListener(\"scroll\", this._scroll.bind(this), false);\n\n    this.freeCachedElements();\n    this._buildChunks();\n}\n\nWebInspector.TextEditorGutterPanel.prototype = {\n    freeCachedElements: function()\n    {\n        this._cachedRows = [];\n    },\n\n    _createNewChunk: function(startLine, endLine)\n    {\n        return new WebInspector.TextEditorGutterChunk(this, startLine, endLine);\n    },\n\n    _expandChunks: function(fromIndex, toIndex)\n    {\n        for (var i = 0; i < this._textChunks.length; ++i) {\n            this._textChunks[i].expanded = (fromIndex <= i && i < toIndex);\n        }\n    }\n}\n\nWebInspector.TextEditorGutterPanel.prototype.__proto__ = WebInspector.TextEditorChunkedPanel.prototype;\n\nWebInspector.TextEditorGutterChunk = function(textViewer, startLine, endLine)\n{\n    this._textViewer = textViewer;\n    this._textModel = textViewer._textModel;\n\n    this.startLine = startLine;\n    endLine = Math.min(this._textModel.linesCount, endLine);\n    this.linesCount = endLine - startLine;\n\n    this._expanded = false;\n\n    this.element = document.createElement(\"div\");\n    this.element.lineNumber = startLine;\n    this.element.className = \"webkit-line-number\";\n\n    if (this.linesCount === 1) {\n        // Single line chunks are typically created for decorations. Host line number in\n        // the sub-element in order to allow flexible border / margin management.\n        var innerSpan = document.createElement(\"span\");\n        innerSpan.className = \"webkit-line-number-inner\";\n        innerSpan.textContent = startLine + 1;\n        var outerSpan = document.createElement(\"div\");\n        outerSpan.className = \"webkit-line-number-outer\";\n        outerSpan.appendChild(innerSpan);\n        this.element.appendChild(outerSpan);\n    } else {\n        var lineNumbers = [];\n        for (var i = startLine; i < endLine; ++i) {\n            lineNumbers.push(i + 1);\n        }\n        this.element.textContent = lineNumbers.join(\"\\n\");\n    }\n}\n\nWebInspector.TextEditorGutterChunk.prototype = {\n    addDecoration: function(decoration)\n    {\n        if (typeof decoration === \"string\") {\n            this.element.addStyleClass(decoration);\n        }\n    },\n\n    removeDecoration: function(decoration)\n    {\n        if (typeof decoration === \"string\") {\n            this.element.removeStyleClass(decoration);\n        }\n    },\n\n    get expanded()\n    {\n        return this._expanded;\n    },\n\n    set expanded(expanded)\n    {\n        if (this.linesCount === 1)\n            this._textViewer._syncDecorationsForLineListener(this.startLine);\n\n        if (this._expanded === expanded)\n            return;\n\n        this._expanded = expanded;\n\n        if (this.linesCount === 1)\n            return;\n\n        this._textViewer.beginDomUpdates();\n\n        if (expanded) {\n            this._expandedLineRows = [];\n            var parentElement = this.element.parentElement;\n            for (var i = this.startLine; i < this.startLine + this.linesCount; ++i) {\n                var lineRow = this._createRow(i);\n                parentElement.insertBefore(lineRow, this.element);\n                this._expandedLineRows.push(lineRow);\n            }\n            parentElement.removeChild(this.element);\n        } else {\n            var elementInserted = false;\n            for (var i = 0; i < this._expandedLineRows.length; ++i) {\n                var lineRow = this._expandedLineRows[i];\n                var parentElement = lineRow.parentElement;\n                if (parentElement) {\n                    if (!elementInserted) {\n                        elementInserted = true;\n                        parentElement.insertBefore(this.element, lineRow);\n                    }\n                    parentElement.removeChild(lineRow);\n                }\n                this._textViewer._cachedRows.push(lineRow);\n            }\n            delete this._expandedLineRows;\n        }\n\n        this._textViewer.endDomUpdates();\n    },\n\n    get height()\n    {\n        if (!this._expandedLineRows)\n            return this._textViewer._totalHeight(this.element);\n        return this._textViewer._totalHeight(this._expandedLineRows[0], this._expandedLineRows[this._expandedLineRows.length - 1]);\n    },\n\n    _createRow: function(lineNumber)\n    {\n        var lineRow = this._textViewer._cachedRows.pop() || document.createElement(\"div\");\n        lineRow.lineNumber = lineNumber;\n        lineRow.className = \"webkit-line-number\";\n        lineRow.textContent = lineNumber + 1;\n        return lineRow;\n    }\n}\n\nWebInspector.TextEditorMainPanel = function(textModel, url, syncScrollListener, syncDecorationsForLineListener)\n{\n    WebInspector.TextEditorChunkedPanel.call(this, textModel);\n\n    this._syncScrollListener = syncScrollListener;\n    this._syncDecorationsForLineListener = syncDecorationsForLineListener;\n\n    this._url = url;\n    this._highlighter = new WebInspector.TextEditorHighlighter(textModel, this._highlightDataReady.bind(this));\n    this._readOnly = true;\n\n    this.element = document.createElement(\"div\");\n    this.element.className = \"text-editor-contents\";\n    this.element.tabIndex = 0;\n\n    this.element.addEventListener(\"scroll\", this._scroll.bind(this), false);\n\n    // FIXME: Remove old live editing functionality and Preferences.sourceEditorEnabled flag.\n    if (!Preferences.sourceEditorEnabled)\n        this.element.addEventListener(\"keydown\", this._handleKeyDown.bind(this), false);\n\n    var handleDOMUpdates = this._handleDOMUpdates.bind(this);\n    this.element.addEventListener(\"DOMCharacterDataModified\", handleDOMUpdates, false);\n    this.element.addEventListener(\"DOMNodeInserted\", handleDOMUpdates, false);\n    this.element.addEventListener(\"DOMNodeRemoved\", handleDOMUpdates, false);\n    // For some reasons, in a few corner cases the events above are not able to catch the editings.\n    // To workaround that we also listen to a more general event as a backup.\n    this.element.addEventListener(\"DOMSubtreeModified\", this._handleDOMSubtreeModified.bind(this), false);\n\n    this.freeCachedElements();\n    this._buildChunks();\n}\n\nWebInspector.TextEditorMainPanel.prototype = {\n    set mimeType(mimeType)\n    {\n        this._highlighter.mimeType = mimeType;\n    },\n\n    set readOnly(readOnly)\n    {\n        // FIXME: Remove the Preferences.sourceEditorEnabled flag.\n        if (!Preferences.sourceEditorEnabled)\n            return;\n\n        this._readOnly = readOnly;\n        if (this._readOnly)\n            this.element.removeStyleClass(\"text-editor-editable\");\n        else\n            this.element.addStyleClass(\"text-editor-editable\");\n    },\n\n    markAndRevealRange: function(range)\n    {\n        if (this._rangeToMark) {\n            var markedLine = this._rangeToMark.startLine;\n            this._rangeToMark = null;\n            this._paintLines(markedLine, markedLine + 1);\n        }\n\n        if (range) {\n            this._rangeToMark = range;\n            this.revealLine(range.startLine);\n            this._paintLines(range.startLine, range.startLine + 1);\n            if (this._markedRangeElement)\n                this._markedRangeElement.scrollIntoViewIfNeeded();\n        }\n        delete this._markedRangeElement;\n    },\n\n    highlightLine: function(lineNumber)\n    {\n        this.clearLineHighlight();\n        this._highlightedLine = lineNumber;\n        this.revealLine(lineNumber);\n        this.addDecoration(lineNumber, \"webkit-highlighted-line\");\n    },\n\n    clearLineHighlight: function()\n    {\n        if (typeof this._highlightedLine === \"number\") {\n            this.removeDecoration(this._highlightedLine, \"webkit-highlighted-line\");\n            delete this._highlightedLine;\n        }\n    },\n\n    freeCachedElements: function()\n    {\n        this._cachedSpans = [];\n        this._cachedTextNodes = [];\n        this._cachedRows = [];\n    },\n\n    _handleKeyDown: function()\n    {\n        if (this._editingLine || event.metaKey || event.shiftKey || event.ctrlKey || event.altKey)\n            return;\n\n        var scrollValue = 0;\n        if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Up.code)\n            scrollValue = -1;\n        else if (event.keyCode == WebInspector.KeyboardShortcut.Keys.Down.code)\n            scrollValue = 1;\n\n        if (scrollValue) {\n            event.preventDefault();\n            event.stopPropagation();\n            this.element.scrollByLines(scrollValue);\n            return;\n        }\n\n        scrollValue = 0;\n        if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Left.code)\n            scrollValue = -40;\n        else if (event.keyCode == WebInspector.KeyboardShortcut.Keys.Right.code)\n            scrollValue = 40;\n\n        if (scrollValue) {\n            event.preventDefault();\n            event.stopPropagation();\n            this.element.scrollLeft += scrollValue;\n        }\n    },\n\n    editLine: function(lineRow, callback)\n    {\n        var oldContent = lineRow.innerHTML;\n        function finishEditing(committed, e, newContent)\n        {\n            if (committed)\n                callback(newContent);\n            lineRow.innerHTML = oldContent;\n            delete this._editingLine;\n        }\n        this._editingLine = WebInspector.startEditing(lineRow, {\n            context: null,\n            commitHandler: finishEditing.bind(this, true),\n            cancelHandler: finishEditing.bind(this, false),\n            multiline: true\n        });\n    },\n\n    _buildChunks: function()\n    {\n        this._highlighter.reset();\n        for (var i = 0; i < this._textModel.linesCount; ++i)\n            this._textModel.removeAttribute(i, \"highlight\");\n\n        WebInspector.TextEditorChunkedPanel.prototype._buildChunks.call(this);\n    },\n\n    _createNewChunk: function(startLine, endLine)\n    {\n        return new WebInspector.TextEditorMainChunk(this, startLine, endLine);\n    },\n\n    _expandChunks: function(fromIndex, toIndex)\n    {\n        var lastChunk = this._textChunks[toIndex - 1];\n        var lastVisibleLine = lastChunk.startLine + lastChunk.linesCount;\n\n        var selection = this._getSelection();\n\n        this._muteHighlightListener = true;\n        this._highlighter.highlight(lastVisibleLine);\n        delete this._muteHighlightListener;\n\n        for (var i = 0; i < this._textChunks.length; ++i) {\n            this._textChunks[i].expanded = (fromIndex <= i && i < toIndex);\n        }\n\n        this._restoreSelection(selection);\n    },\n\n    _highlightDataReady: function(fromLine, toLine)\n    {\n        if (this._muteHighlightListener || this._dirtyLines)\n            return;\n        this._paintLines(fromLine, toLine, true /*restoreSelection*/);\n    },\n\n    _paintLines: function(fromLine, toLine, restoreSelection)\n    {\n        var selection;\n        var chunk = this._chunkForLine(fromLine);\n        for (var i = fromLine; i < toLine; ++i) {\n            if (i >= chunk.startLine + chunk.linesCount)\n                chunk = this._chunkForLine(i);\n            var lineRow = chunk.getExpandedLineRow(i);\n            if (!lineRow)\n                continue;\n            if (restoreSelection && !selection)\n                selection = this._getSelection();\n            this._paintLine(lineRow, i);\n        }\n        if (restoreSelection)\n            this._restoreSelection(selection);\n    },\n\n    _paintLine: function(lineRow, lineNumber)\n    {\n        this.beginDomUpdates();\n        try {\n            var highlight = this._textModel.getAttribute(lineNumber, \"highlight\");\n            if (!highlight) {\n                if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)\n                    this._markedRangeElement = highlightSearchResult(lineRow, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);\n                return;\n            }\n\n            lineRow.removeChildren();\n            var line = this._textModel.line(lineNumber);\n            if (!line)\n                lineRow.appendChild(document.createElement(\"br\"));\n\n            var plainTextStart = -1;\n            for (var j = 0; j < line.length;) {\n                if (j > 1000) {\n                    // This line is too long - do not waste cycles on minified js highlighting.\n                    if (plainTextStart === -1)\n                        plainTextStart = j;\n                    break;\n                }\n                var attribute = highlight[j];\n                if (!attribute || !attribute.tokenType) {\n                    if (plainTextStart === -1)\n                        plainTextStart = j;\n                    j++;\n                } else {\n                    if (plainTextStart !== -1) {\n                        this._appendTextNode(lineRow, line.substring(plainTextStart, j));\n                        plainTextStart = -1;\n                    }\n                    this._appendSpan(lineRow, line.substring(j, j + attribute.length), attribute.tokenType);\n                    j += attribute.length;\n                }\n            }\n            if (plainTextStart !== -1)\n                this._appendTextNode(lineRow, line.substring(plainTextStart, line.length));\n            if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)\n                this._markedRangeElement = highlightSearchResult(lineRow, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);\n            if (lineRow.decorationsElement)\n                lineRow.appendChild(lineRow.decorationsElement);\n        } finally {\n            this.endDomUpdates();\n        }\n    },\n\n    _releaseLinesHighlight: function(lineRow)\n    {\n        if (!lineRow)\n            return;\n        if (\"spans\" in lineRow) {\n            var spans = lineRow.spans;\n            for (var j = 0; j < spans.length; ++j)\n                this._cachedSpans.push(spans[j]);\n            delete lineRow.spans;\n        }\n        if (\"textNodes\" in lineRow) {\n            var textNodes = lineRow.textNodes;\n            for (var j = 0; j < textNodes.length; ++j)\n                this._cachedTextNodes.push(textNodes[j]);\n            delete lineRow.textNodes;\n        }\n        this._cachedRows.push(lineRow);\n    },\n\n    _getSelection: function()\n    {\n        var selection = window.getSelection();\n        if (!selection.rangeCount)\n            return null;\n        var selectionRange = selection.getRangeAt(0);\n        // Selection may be outside of the viewer.\n        if (!this.element.isAncestor(selectionRange.startContainer) || !this.element.isAncestor(selectionRange.endContainer))\n            return null;\n        var start = this._selectionToPosition(selectionRange.startContainer, selectionRange.startOffset);\n        var end = selectionRange.collapsed ? start : this._selectionToPosition(selectionRange.endContainer, selectionRange.endOffset);\n        if (selection.anchorNode === selectionRange.startContainer && selection.anchorOffset === selectionRange.startOffset)\n            return new WebInspector.TextRange(start.line, start.column, end.line, end.column);\n        else\n            return new WebInspector.TextRange(end.line, end.column, start.line, start.column);\n    },\n\n    _restoreSelection: function(range)\n    {\n        if (!range)\n            return;\n        var start = this._positionToSelection(range.startLine, range.startColumn);\n        var end = range.isEmpty() ? start : this._positionToSelection(range.endLine, range.endColumn);\n        window.getSelection().setBaseAndExtent(start.container, start.offset, end.container, end.offset);\n    },\n\n    _selectionToPosition: function(container, offset)\n    {\n        if (container === this.element && offset === 0)\n            return { line: 0, column: 0 };\n        if (container === this.element && offset === 1)\n            return { line: this._textModel.linesCount - 1, column: this._textModel.lineLength(this._textModel.linesCount - 1) };\n\n        var lineRow = container.enclosingNodeOrSelfWithNodeName(\"DIV\");\n        var lineNumber = lineRow.lineNumber;\n        if (container === lineRow && offset === 0)\n            return { line: lineNumber, column: 0 };\n\n        // This may be chunk and chunks may contain \\n.\n        var column = 0;\n        var node = lineRow.traverseNextTextNode(lineRow);\n        while (node && node !== container) {\n            var text = node.textContent;\n            for (var i = 0; i < text.length; ++i) {\n                if (text.charAt(i) === \"\\n\") {\n                    lineNumber++;\n                    column = 0;\n                } else\n                    column++;\n            }\n            node = node.traverseNextTextNode(lineRow);\n        }\n\n        if (node === container && offset) {\n            var text = node.textContent;\n            for (var i = 0; i < offset; ++i) {\n                if (text.charAt(i) === \"\\n\") {\n                    lineNumber++;\n                    column = 0;\n                } else\n                    column++;\n            }\n        }\n        return { line: lineNumber, column: column };\n    },\n\n    _positionToSelection: function(line, column)\n    {\n        var chunk = this._chunkForLine(line);\n        var lineRow = chunk.getExpandedLineRow(line);\n        if (lineRow)\n            var rangeBoundary = lineRow.rangeBoundaryForOffset(column);\n        else {\n            var offset = column;\n            for (var i = chunk.startLine; i < line; ++i)\n                offset += this._textModel.lineLength(i) + 1; // \\n\n            lineRow = chunk.element;\n            if (lineRow.firstChild)\n                var rangeBoundary = { container: lineRow.firstChild, offset: offset };\n            else\n                var rangeBoundary = { container: lineRow, offset: 0 };\n        }\n        return rangeBoundary;\n    },\n\n    _appendSpan: function(element, content, className)\n    {\n        if (className === \"html-resource-link\" || className === \"html-external-link\") {\n            element.appendChild(this._createLink(content, className === \"html-external-link\"));\n            return;\n        }\n\n        var span = this._cachedSpans.pop() || document.createElement(\"span\");\n        span.className = \"webkit-\" + className;\n        span.textContent = content;\n        element.appendChild(span);\n        if (!(\"spans\" in element))\n            element.spans = [];\n        element.spans.push(span);\n    },\n\n    _appendTextNode: function(element, text)\n    {\n        var textNode = this._cachedTextNodes.pop();\n        if (textNode)\n            textNode.nodeValue = text;\n        else\n            textNode = document.createTextNode(text);\n        element.appendChild(textNode);\n        if (!(\"textNodes\" in element))\n            element.textNodes = [];\n        element.textNodes.push(textNode);\n    },\n\n    _createLink: function(content, isExternal)\n    {\n        var quote = content.charAt(0);\n        if (content.length > 1 && (quote === \"\\\"\" ||   quote === \"'\"))\n            content = content.substring(1, content.length - 1);\n        else\n            quote = null;\n\n        var a = WebInspector.linkifyURLAsNode(this._rewriteHref(content), content, null, isExternal);\n        var span = document.createElement(\"span\");\n        span.className = \"webkit-html-attribute-value\";\n        if (quote)\n            span.appendChild(document.createTextNode(quote));\n        span.appendChild(a);\n        if (quote)\n            span.appendChild(document.createTextNode(quote));\n        return span;\n    },\n\n    _rewriteHref: function(hrefValue, isExternal)\n    {\n        if (!this._url || !hrefValue || hrefValue.indexOf(\"://\") > 0)\n            return hrefValue;\n        return WebInspector.completeURL(this._url, hrefValue);\n    },\n\n    textChanged: function(oldRange, newRange, oldText, newText)\n    {\n        // FIXME: Update only that part of the editor that has just been changed.\n        this._buildChunks();\n    },\n\n    _handleDOMUpdates: function(e)\n    {\n        if (this._domUpdateCoalescingLevel)\n            return;\n\n        var target = e.target;\n        if (target === this.element)\n            return;\n\n        var lineRow = target.enclosingNodeOrSelfWithClass(\"webkit-line-content\");\n        if (!lineRow)\n            return;\n\n        if (lineRow.decorationsElement && lineRow.decorationsElement.isAncestor(target)) {\n            if (this._syncDecorationsForLineListener) {\n                // Wait until this event is processed and only then sync the sizes. This is necessary in\n                // case of the DOMNodeRemoved event, because it is dispatched before the removal takes place.\n                setTimeout(function() {\n                    this._syncDecorationsForLineListener(lineRow.lineNumber);\n                }.bind(this), 0);\n            }\n            return;\n        }\n\n        if (this._readOnly)\n            return;\n\n        if (target === lineRow && (e.type === \"DOMNodeInserted\" || e.type === \"DOMNodeRemoved\")) {\n            // The \"lineNumber\" (if any) is no longer valid for a line being removed or inserted.\n            delete lineRow.lineNumber;\n        }\n\n        var startLine = 0;\n        for (var row = lineRow; row; row = row.previousSibling) {\n            if (typeof row.lineNumber === \"number\") {\n                startLine = row.lineNumber;\n                break;\n            }\n        }\n\n        var endLine = this._textModel.linesCount;\n        for (var row = lineRow.nextSibling; row; row = row.nextSibling) {\n            if (typeof row.lineNumber === \"number\") {\n                endLine = row.lineNumber;\n                break;\n            }\n        }\n\n        if (this._dirtyLines) {\n            this._dirtyLines.start = Math.min(this._dirtyLines.start, startLine);\n            this._dirtyLines.end = Math.max(this._dirtyLines.end, endLine);\n        } else {\n            this._dirtyLines = { start: startLine, end: endLine };\n            setTimeout(this._applyDomUpdates.bind(this), 0);\n        }\n    },\n\n    _handleDOMSubtreeModified: function(e)\n    {\n        if (this._domUpdateCoalescingLevel || this._readOnly || e.target !== this.element)\n            return;\n\n        // Proceed only when other events failed to catch the DOM updates, otherwise it is not necessary.\n        if (this._dirtyLines)\n            return;\n\n        var selection = this._getSelection();\n        if (!selection)\n            return;\n\n        var startLine = Math.min(selection.startLine, selection.endLine);\n        var endLine = Math.max(selection.startLine, selection.endLine) + 1;\n        endLine = Math.min(this._textModel.linesCount, endLine);\n\n        this._dirtyLines = { start: startLine, end: endLine };\n        setTimeout(this._applyDomUpdates.bind(this), 0);\n    },\n\n    _applyDomUpdates: function()\n    {\n        if (!this._dirtyLines)\n            return;\n\n        var dirtyLines = this._dirtyLines;\n        delete this._dirtyLines;\n\n        // Check if the editor had been set readOnly by the moment when this async callback got executed.\n        if (this._readOnly)\n            return;\n\n        // FIXME: DELETE DECORATIONS IN THE INVOLVED CHUNKS IF ANY! SYNC THE GUTTER ALSO.\n\n        // FIXME: DELETE MARKED AND HIGHLIGHTED LINES (INVALIDATE SEARCH RESULTS)! this._markedRangeElement\n        \n        var firstChunkNumber = this._chunkNumberForLine(dirtyLines.start);\n        var startLine = this._textChunks[firstChunkNumber].startLine;\n        var endLine = this._textModel.linesCount;\n\n        // Collect lines.\n        var firstLineRow;\n        if (firstChunkNumber) {\n            var chunk = this._textChunks[firstChunkNumber - 1];\n            firstLineRow = chunk.expanded ? chunk.getExpandedLineRow(chunk.startLine + chunk.linesCount - 1) : chunk.element;\n            firstLineRow = firstLineRow.nextSibling;\n        } else {\n            firstLineRow = this.element.firstChild;\n        }\n\n        var lines = [];\n        for (var lineRow = firstLineRow; lineRow; lineRow = lineRow.nextSibling) {\n            if (typeof lineRow.lineNumber === \"number\" && lineRow.lineNumber >= dirtyLines.end) {\n                endLine = lineRow.lineNumber;\n                break;\n            }\n            // Update with the newest lineNumber, so that the call to the _getSelection method below should work.\n            lineRow.lineNumber = startLine + lines.length;\n            this._collectLinesFromDiv(lines, lineRow);\n        }\n\n        // Try to decrease the range being replaced if possible.\n        var startOffset = 0;\n        while (startLine < dirtyLines.start && startOffset < lines.length) {\n            if (this._textModel.line(startLine) !== lines[startOffset])\n                break;\n            ++startOffset;\n            ++startLine;\n        }\n\n        var endOffset = lines.length;\n        while (endLine > dirtyLines.end && endOffset > startOffset) {\n            if (this._textModel.line(endLine - 1) !== lines[endOffset - 1])\n                break;\n            --endOffset;\n            --endLine;\n        }\n\n        lines = lines.slice(startOffset, endOffset);\n\n        var selection = this._getSelection();\n        this.beginUpdates();\n\n        if (lines.length === 0 && endLine < this._textModel.linesCount) {\n            var range = new WebInspector.TextRange(startLine, 0, endLine, 0);\n            var newRange = this._textModel.setText(range, '');\n        } else {\n            var range = new WebInspector.TextRange(startLine, 0, endLine - 1, this._textModel.lineLength(endLine - 1));\n            var newRange = this._textModel.setText(range, lines.join(\"\\n\"));\n        }\n\n        this.endUpdates();\n        this._restoreSelection(selection);\n    },\n\n    _collectLinesFromDiv: function(lines, element)\n    {\n        var textContents = [];\n        var node = element.traverseNextNode(element);\n        while (node) {\n            if (node.nodeName.toLowerCase() === \"br\")\n                textContents.push(\"\\n\");\n            else if (node.nodeType === Node.TEXT_NODE)\n                textContents.push(node.textContent);\n            node = node.traverseNextNode(element);\n        }\n\n        var textContent = textContents.join('');\n        // The last \\n (if any) does not \"count\" in a DIV.\n        textContent = textContent.replace(/\\n$/, '');\n\n        textContents = textContent.split(\"\\n\");\n        for (var i = 0; i < textContents.length; ++i)\n            lines.push(textContents[i]);\n    }\n}\n\nWebInspector.TextEditorMainPanel.prototype.__proto__ = WebInspector.TextEditorChunkedPanel.prototype;\n\nWebInspector.TextEditorMainChunk = function(textViewer, startLine, endLine)\n{\n    this._textViewer = textViewer;\n    this._textModel = textViewer._textModel;\n\n    this.element = document.createElement(\"div\");\n    this.element.lineNumber = startLine;\n    this.element.className = \"webkit-line-content\";\n\n    this.startLine = startLine;\n    endLine = Math.min(this._textModel.linesCount, endLine);\n    this.linesCount = endLine - startLine;\n\n    this._expanded = false;\n\n    var lines = [];\n    for (var i = startLine; i < endLine; ++i) {\n        lines.push(this._textModel.line(i));\n    }\n\n    this.element.textContent = lines.join(\"\\n\");\n\n    // The last empty line will get swallowed otherwise.\n    if (!lines[lines.length - 1])\n        this.element.appendChild(document.createElement(\"br\"));\n}\n\nWebInspector.TextEditorMainChunk.prototype = {\n    addDecoration: function(decoration)\n    {\n        if (typeof decoration === \"string\") {\n            this.element.addStyleClass(decoration);\n            return;\n        }\n        this._textViewer.beginDomUpdates();\n        if (!this.element.decorationsElement) {\n            this.element.decorationsElement = document.createElement(\"div\");\n            this.element.decorationsElement.className = \"webkit-line-decorations\";\n            this.element.appendChild(this.element.decorationsElement);\n        }\n        this.element.decorationsElement.appendChild(decoration);\n        this._textViewer.endDomUpdates();\n    },\n\n    removeDecoration: function(decoration)\n    {\n        if (typeof decoration === \"string\") {\n            this.element.removeStyleClass(decoration);\n            return;\n        }\n        if (!this.element.decorationsElement)\n            return;\n        this._textViewer.beginDomUpdates();\n        this.element.decorationsElement.removeChild(decoration);\n        this._textViewer.endDomUpdates();\n    },\n\n    get expanded()\n    {\n        return this._expanded;\n    },\n\n    set expanded(expanded)\n    {\n        if (this._expanded === expanded)\n            return;\n\n        this._expanded = expanded;\n\n        if (this.linesCount === 1) {\n            if (expanded)\n                this._textViewer._paintLine(this.element, this.startLine);\n            return;\n        }\n\n        this._textViewer.beginDomUpdates();\n\n        if (expanded) {\n            this._expandedLineRows = [];\n            var parentElement = this.element.parentElement;\n            for (var i = this.startLine; i < this.startLine + this.linesCount; ++i) {\n                var lineRow = this._createRow(i);\n                parentElement.insertBefore(lineRow, this.element);\n                this._expandedLineRows.push(lineRow);\n                this._textViewer._paintLine(lineRow, i);\n            }\n            parentElement.removeChild(this.element);\n        } else {\n            var elementInserted = false;\n            for (var i = 0; i < this._expandedLineRows.length; ++i) {\n                var lineRow = this._expandedLineRows[i];\n                var parentElement = lineRow.parentElement;\n                if (parentElement) {\n                    if (!elementInserted) {\n                        elementInserted = true;\n                        parentElement.insertBefore(this.element, lineRow);\n                    }\n                    parentElement.removeChild(lineRow);\n                }\n                this._textViewer._releaseLinesHighlight(lineRow);\n            }\n            delete this._expandedLineRows;\n        }\n\n        this._textViewer.endDomUpdates();\n    },\n\n    get height()\n    {\n        if (!this._expandedLineRows)\n            return this._textViewer._totalHeight(this.element);\n        return this._textViewer._totalHeight(this._expandedLineRows[0], this._expandedLineRows[this._expandedLineRows.length - 1]);\n    },\n\n    _createRow: function(lineNumber)\n    {\n        var lineRow = this._textViewer._cachedRows.pop() || document.createElement(\"div\");\n        lineRow.lineNumber = lineNumber;\n        lineRow.className = \"webkit-line-content\";\n        lineRow.textContent = this._textModel.line(lineNumber);\n        if (!lineRow.textContent)\n            lineRow.appendChild(document.createElement(\"br\"));\n        return lineRow;\n    },\n\n    getExpandedLineRow: function(lineNumber)\n    {\n        if (!this._expanded || lineNumber < this.startLine || lineNumber >= this.startLine + this.linesCount)\n            return null;\n        if (!this._expandedLineRows)\n            return this.element;\n        return this._expandedLineRows[lineNumber - this.startLine];\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TimelineAgent.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TimelineAgent = function() {\n    // Not implemented.\n}\n\n// Must be kept in sync with TimelineItem.h\nWebInspector.TimelineAgent.RecordType = {\n    EventDispatch : 0,\n    Layout : 1,\n    RecalculateStyles : 2,\n    Paint : 3,\n    ParseHTML : 4,\n    TimerInstall : 5,\n    TimerRemove : 6,\n    TimerFire : 7,\n    XHRReadyStateChange : 8,\n    XHRLoad : 9,\n    EvaluateScript : 10,\n    MarkTimeline : 11,\n    ResourceSendRequest : 12,\n    ResourceReceiveResponse : 13,\n    ResourceFinish : 14,\n    FunctionCall : 15,\n    ResourceReceiveData: 16,\n    GCEvent : 17,\n    MarkDOMContentEventType : 18,\n    MarkLoadEventType : 19,\n    ScheduleResourceRequest : 20\n};\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TimelineGrid.js",
    "content": "/*\n * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TimelineGrid = function()\n{\n    this.element = document.createElement(\"div\");\n\n    this._itemsGraphsElement = document.createElement(\"div\");\n    this._itemsGraphsElement.id = \"resources-graphs\";\n    this.element.appendChild(this._itemsGraphsElement);\n\n    this._dividersElement = document.createElement(\"div\");\n    this._dividersElement.className = \"resources-dividers\";\n    this.element.appendChild(this._dividersElement);\n\n    this._eventDividersElement = document.createElement(\"div\");\n    this._eventDividersElement.className = \"resources-event-dividers\";\n    this.element.appendChild(this._eventDividersElement);\n\n    this._dividersLabelBarElement = document.createElement(\"div\");\n    this._dividersLabelBarElement.className = \"resources-dividers-label-bar\";\n    this.element.appendChild(this._dividersLabelBarElement);\n}\n\nWebInspector.TimelineGrid.prototype = {\n    get itemsGraphsElement()\n    {\n        return this._itemsGraphsElement;\n    },\n\n    \n    updateDividers: function(force, calculator, paddingLeft)\n    {\n        var dividerCount = Math.round(this._dividersElement.offsetWidth / 64);\n        var slice = calculator.boundarySpan / dividerCount;\n        if (!force && this._currentDividerSlice === slice)\n            return false;\n\n        if (typeof paddingLeft !== \"number\")\n            paddingLeft = 0;\n        this._currentDividerSlice = slice;\n\n        // Reuse divider elements and labels.\n        var divider = this._dividersElement.firstChild;\n        var dividerLabelBar = this._dividersLabelBarElement.firstChild;\n\n        var dividersLabelBarElementClientWidth = this._dividersLabelBarElement.clientWidth;\n        var clientWidth = dividersLabelBarElementClientWidth - paddingLeft;\n        for (var i = paddingLeft ? 0 : 1; i <= dividerCount; ++i) {\n            if (!divider) {\n                divider = document.createElement(\"div\");\n                divider.className = \"resources-divider\";\n                this._dividersElement.appendChild(divider);\n\n                dividerLabelBar = document.createElement(\"div\");\n                dividerLabelBar.className = \"resources-divider\";\n                var label = document.createElement(\"div\");\n                label.className = \"resources-divider-label\";\n                dividerLabelBar._labelElement = label;\n                dividerLabelBar.appendChild(label);\n                this._dividersLabelBarElement.appendChild(dividerLabelBar);\n                dividersLabelBarElementClientWidth = this._dividersLabelBarElement.clientWidth;\n            }\n\n            if (i === (paddingLeft ? 0 : 1)) {\n                divider.addStyleClass(\"first\");\n                dividerLabelBar.addStyleClass(\"first\");\n            } else {\n                divider.removeStyleClass(\"first\");\n                dividerLabelBar.removeStyleClass(\"first\");\n            }\n\n            if (i === dividerCount) {\n                divider.addStyleClass(\"last\");\n                dividerLabelBar.addStyleClass(\"last\");\n            } else {\n                divider.removeStyleClass(\"last\");\n                dividerLabelBar.removeStyleClass(\"last\");\n            }\n\n            var left = paddingLeft + clientWidth * (i / dividerCount);\n            var percentLeft = 100 * left / dividersLabelBarElementClientWidth;\n            this._setDividerAndBarLeft(divider, dividerLabelBar, percentLeft);\n\n            if (!isNaN(slice))\n                dividerLabelBar._labelElement.textContent = calculator.formatValue(slice * i);\n            else\n                dividerLabelBar._labelElement.textContent = \"\";\n\n            divider = divider.nextSibling;\n            dividerLabelBar = dividerLabelBar.nextSibling;\n        }\n\n        // Remove extras.\n        while (divider) {\n            var nextDivider = divider.nextSibling;\n            this._dividersElement.removeChild(divider);\n            divider = nextDivider;\n        }\n        while (dividerLabelBar) {\n            var nextDivider = dividerLabelBar.nextSibling;\n            this._dividersLabelBarElement.removeChild(dividerLabelBar);\n            dividerLabelBar = nextDivider;\n        }\n        return true;\n    },\n\n    _setDividerAndBarLeft: function(divider, dividerLabelBar, percentLeft)\n    {\n        var percentStyleLeft = parseFloat(divider.style.left);\n        if (!isNaN(percentStyleLeft) && Math.abs(percentStyleLeft - percentLeft) < 0.1)\n            return;\n        divider.style.left = percentLeft + \"%\";\n        dividerLabelBar.style.left = percentLeft + \"%\";\n    },\n\n    addEventDivider: function(divider)\n    {\n        this._eventDividersElement.appendChild(divider);\n    },\n\n    addEventDividers: function(dividers)\n    {\n        this.element.removeChild(this._eventDividersElement);\n        for (var i = 0; i < dividers.length; ++i)\n            if (dividers[i])\n                this._eventDividersElement.appendChild(dividers[i]);\n        this.element.appendChild(this._eventDividersElement);\n    },\n\n    removeEventDividers: function()\n    {\n        this._eventDividersElement.removeChildren();\n    },\n\n    hideEventDividers: function()\n    {\n        this._eventDividersElement.addStyleClass(\"hidden\");\n    },\n\n    showEventDividers: function()\n    {\n        this._eventDividersElement.removeStyleClass(\"hidden\");\n    },\n\n    setScrollAndDividerTop: function(scrollTop, dividersTop)\n    {\n        this._dividersElement.style.top = scrollTop + \"px\";\n        this._eventDividersElement.style.top = scrollTop + \"px\";\n        this._dividersLabelBarElement.style.top = dividersTop + \"px\";\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TimelineOverviewPane.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TimelineOverviewPane = function(categories)\n{\n    this._categories = categories;\n\n    this.statusBarFilters = document.createElement(\"div\");\n    this.statusBarFilters.className = \"status-bar-items\";\n    for (var categoryName in this._categories) {\n        var category = this._categories[categoryName];\n        this.statusBarFilters.appendChild(this._createTimelineCategoryStatusBarCheckbox(category, this._onCheckboxClicked.bind(this, category)));\n    }\n\n    this._overviewGrid = new WebInspector.TimelineGrid();\n    this._overviewGrid.element.id = \"timeline-overview-grid\";\n    this._overviewGrid.itemsGraphsElement.id = \"timeline-overview-timelines\";\n    this._overviewGrid.element.addEventListener(\"mousedown\", this._dragWindow.bind(this), true);\n\n    this._heapGraph = new WebInspector.HeapGraph();\n    this._heapGraph.element.id = \"timeline-overview-memory\";\n    this._overviewGrid.element.insertBefore(this._heapGraph.element, this._overviewGrid.itemsGraphsElement);\n\n    this.element = this._overviewGrid.element;\n\n    this._categoryGraphs = {};\n    var i = 0;\n    for (var category in this._categories) {\n        var categoryGraph = new WebInspector.TimelineCategoryGraph(this._categories[category], i++ % 2);\n        this._categoryGraphs[category] = categoryGraph;\n        this._overviewGrid.itemsGraphsElement.appendChild(categoryGraph.graphElement);\n    }\n    this._overviewGrid.setScrollAndDividerTop(0, 0);\n\n    this._overviewWindowElement = document.createElement(\"div\");\n    this._overviewWindowElement.id = \"timeline-overview-window\";\n    this._overviewGrid.element.appendChild(this._overviewWindowElement);\n\n    this._overviewWindowBordersElement = document.createElement(\"div\");\n    this._overviewWindowBordersElement.className = \"timeline-overview-window-rulers\";\n    this._overviewGrid.element.appendChild(this._overviewWindowBordersElement);\n\n    var overviewDividersBackground = document.createElement(\"div\");\n    overviewDividersBackground.className = \"timeline-overview-dividers-background\";\n    this._overviewGrid.element.appendChild(overviewDividersBackground);\n\n    this._leftResizeElement = document.createElement(\"div\");\n    this._leftResizeElement.className = \"timeline-window-resizer\";\n    this._leftResizeElement.style.left = 0;\n    this._overviewGrid.element.appendChild(this._leftResizeElement);\n\n    this._rightResizeElement = document.createElement(\"div\");\n    this._rightResizeElement.className = \"timeline-window-resizer timeline-window-resizer-right\";\n    this._rightResizeElement.style.right = 0;\n    this._overviewGrid.element.appendChild(this._rightResizeElement);\n\n    this._overviewCalculator = new WebInspector.TimelineOverviewCalculator();\n\n    this.windowLeft = 0.0;\n    this.windowRight = 1.0;\n}\n\nWebInspector.TimelineOverviewPane.minSelectableSize = 12;\n\nWebInspector.TimelineOverviewPane.prototype = {\n    showTimelines: function(event) {\n        this._heapGraph.hide();\n        this._overviewGrid.itemsGraphsElement.removeStyleClass(\"hidden\");\n    },\n\n    showMemoryGraph: function(records) {\n        this._heapGraph.show();\n        this._heapGraph.update(records);\n        this._overviewGrid.itemsGraphsElement.addStyleClass(\"hidden\");\n    },\n\n    _onCheckboxClicked: function (category, event) {\n        if (event.target.checked)\n            category.hidden = false;\n        else\n            category.hidden = true;\n        this._categoryGraphs[category.name].dimmed = !event.target.checked;\n        this.dispatchEventToListeners(\"filter changed\");\n    },\n\n    _forAllRecords: function(recordsArray, callback)\n    {\n        if (!recordsArray)\n            return;\n        for (var i = 0; i < recordsArray.length; ++i) {\n            callback(recordsArray[i]);\n            this._forAllRecords(recordsArray[i].children, callback);\n        }\n    },\n\n    update: function(records, showShortEvents)\n    {\n        this._showShortEvents = showShortEvents;\n        // Clear summary bars.\n        var timelines = {};\n        for (var category in this._categories) {\n            timelines[category] = [];\n            this._categoryGraphs[category].clearChunks();\n        }\n\n        // Create sparse arrays with 101 cells each to fill with chunks for a given category.\n        this._overviewCalculator.reset();\n        this._forAllRecords(records, this._overviewCalculator.updateBoundaries.bind(this._overviewCalculator));\n\n        function markTimeline(record)\n        {\n            if (!(this._showShortEvents || record.isLong()))\n                return;\n            var percentages = this._overviewCalculator.computeBarGraphPercentages(record);\n\n            var end = Math.round(percentages.end);\n            var categoryName = record.category.name;\n            for (var j = Math.round(percentages.start); j <= end; ++j)\n                timelines[categoryName][j] = true;\n        }\n        this._forAllRecords(records, markTimeline.bind(this));\n\n        // Convert sparse arrays to continuous segments, render graphs for each.\n        for (var category in this._categories) {\n            var timeline = timelines[category];\n            window.timelineSaved = timeline;\n            var chunkStart = -1;\n            for (var j = 0; j < 101; ++j) {\n                if (timeline[j]) {\n                    if (chunkStart === -1)\n                        chunkStart = j;\n                } else {\n                    if (chunkStart !== -1) {\n                        this._categoryGraphs[category].addChunk(chunkStart, j);\n                        chunkStart = -1;\n                    }\n                }\n            }\n            if (chunkStart !== -1) {\n                this._categoryGraphs[category].addChunk(chunkStart, 100);\n                chunkStart = -1;\n            }\n        }\n\n        this._heapGraph.setSize(this._overviewGrid.element.offsetWidth, 60);\n        if (this._heapGraph.visible)\n            this._heapGraph.update(records);\n\n        this._overviewGrid.updateDividers(true, this._overviewCalculator);\n    },\n\n    updateEventDividers: function(records, dividerConstructor)\n    {\n        this._overviewGrid.removeEventDividers();\n        var dividers = [];\n        for (var i = 0; i < records.length; ++i) {\n            var record = records[i];\n            var positions = this._overviewCalculator.computeBarGraphPercentages(record);\n            var dividerPosition = Math.round(positions.start * 10);\n            if (dividers[dividerPosition])\n                continue;\n            var divider = dividerConstructor(record);\n            divider.style.left = positions.start + \"%\";\n            dividers[dividerPosition] = divider;\n        }\n        this._overviewGrid.addEventDividers(dividers);\n    },\n\n    updateMainViewWidth: function(width, records)\n    {\n        this._overviewGrid.element.style.left = width + \"px\";\n        this.statusBarFilters.style.left = Math.max(155, width) + \"px\";\n    },\n\n    reset: function()\n    {\n        this.windowLeft = 0.0;\n        this.windowRight = 1.0;\n        this._overviewWindowElement.style.left = \"0%\";\n        this._overviewWindowElement.style.width = \"100%\";\n        this._overviewWindowBordersElement.style.left = \"0%\";\n        this._overviewWindowBordersElement.style.right = \"0%\";\n        this._leftResizeElement.style.left = \"0%\";\n        this._rightResizeElement.style.left = \"100%\";\n        this._overviewCalculator.reset();\n        this._overviewGrid.updateDividers(true, this._overviewCalculator);\n    },\n\n    _resizeWindow: function(resizeElement, event)\n    {\n        WebInspector.elementDragStart(resizeElement, this._windowResizeDragging.bind(this, resizeElement), this._endWindowDragging.bind(this), event, \"col-resize\");\n    },\n\n    _windowResizeDragging: function(resizeElement, event)\n    {\n        if (resizeElement === this._leftResizeElement)\n            this._resizeWindowLeft(event.pageX - this._overviewGrid.element.offsetLeft);\n        else\n            this._resizeWindowRight(event.pageX - this._overviewGrid.element.offsetLeft);\n        event.preventDefault();\n    },\n\n    _dragWindow: function(event)\n    {\n        var node = event.target;\n        while (node) {\n            if (node === this._overviewGrid._dividersLabelBarElement) {\n                WebInspector.elementDragStart(this._overviewWindowElement, this._windowDragging.bind(this, event.pageX,\n                    this._leftResizeElement.offsetLeft, this._rightResizeElement.offsetLeft), this._endWindowDragging.bind(this), event, \"ew-resize\");\n                break;\n            } else if (node === this._overviewGrid.element) {\n                var position = event.pageX - this._overviewGrid.element.offsetLeft;\n                this._overviewWindowSelector = new WebInspector.TimelinePanel.WindowSelector(this._overviewGrid.element, position, event);\n                WebInspector.elementDragStart(null, this._windowSelectorDragging.bind(this), this._endWindowSelectorDragging.bind(this), event, \"col-resize\");\n                break;\n            } else if (node === this._leftResizeElement || node === this._rightResizeElement) {\n                this._resizeWindow(node, event);\n                break;\n            }\n            node = node.parentNode;\n        }\n    },\n\n    _windowSelectorDragging: function(event)\n    {\n        this._overviewWindowSelector._updatePosition(event.pageX - this._overviewGrid.element.offsetLeft);\n        event.preventDefault();\n    },\n\n    _endWindowSelectorDragging: function(event)\n    {\n        WebInspector.elementDragEnd(event);\n        var window = this._overviewWindowSelector._close(event.pageX - this._overviewGrid.element.offsetLeft);\n        delete this._overviewWindowSelector;\n        if (window.end - window.start < WebInspector.TimelineOverviewPane.minSelectableSize)\n            if (this._overviewGrid.itemsGraphsElement.offsetWidth - window.end > WebInspector.TimelineOverviewPane.minSelectableSize)\n                window.end = window.start + WebInspector.TimelineOverviewPane.minSelectableSize;\n            else\n                window.start = window.end - WebInspector.TimelineOverviewPane.minSelectableSize;\n        this._setWindowPosition(window.start, window.end);\n    },\n\n    _windowDragging: function(startX, windowLeft, windowRight, event)\n    {\n        var delta = event.pageX - startX;\n        var start = windowLeft + delta;\n        var end = windowRight + delta;\n        var windowSize = windowRight - windowLeft;\n\n        if (start < 0) {\n            start = 0;\n            end = windowSize;\n        }\n\n        if (end > this._overviewGrid.element.clientWidth) {\n            end = this._overviewGrid.element.clientWidth;\n            start = end - windowSize;\n        }\n        this._setWindowPosition(start, end);\n\n        event.preventDefault();\n    },\n\n    _resizeWindowLeft: function(start)\n    {\n        // Glue to edge.\n        if (start < 10)\n            start = 0;\n        else if (start > this._rightResizeElement.offsetLeft -  4)\n            start = this._rightResizeElement.offsetLeft - 4;\n        this._setWindowPosition(start, null);\n    },\n\n    _resizeWindowRight: function(end)\n    {\n        // Glue to edge.\n        if (end > this._overviewGrid.element.clientWidth - 10)\n            end = this._overviewGrid.element.clientWidth;\n        else if (end < this._leftResizeElement.offsetLeft + WebInspector.TimelineOverviewPane.minSelectableSize)\n            end = this._leftResizeElement.offsetLeft + WebInspector.TimelineOverviewPane.minSelectableSize;\n        this._setWindowPosition(null, end);\n    },\n\n    _setWindowPosition: function(start, end)\n    {\n        var rulerAdjustment = 1 / this._overviewGrid.element.clientWidth;\n        if (typeof start === \"number\") {\n            this.windowLeft = start / this._overviewGrid.element.clientWidth;\n            this._leftResizeElement.style.left = this.windowLeft * 100 + \"%\";\n            this._overviewWindowElement.style.left = this.windowLeft * 100 + \"%\";\n            this._overviewWindowBordersElement.style.left = (this.windowLeft - rulerAdjustment) * 100 + \"%\";\n        }\n        if (typeof end === \"number\") {\n            this.windowRight = end / this._overviewGrid.element.clientWidth;\n            this._rightResizeElement.style.left = this.windowRight * 100 + \"%\";\n        }\n        this._overviewWindowElement.style.width = (this.windowRight - this.windowLeft) * 100 + \"%\";\n        this._overviewWindowBordersElement.style.right = (1 - this.windowRight + 2 * rulerAdjustment) * 100 + \"%\";\n        this.dispatchEventToListeners(\"window changed\");\n    },\n\n    _endWindowDragging: function(event)\n    {\n        WebInspector.elementDragEnd(event);\n    },\n\n    _createTimelineCategoryStatusBarCheckbox: function(category, onCheckboxClicked)\n    {\n        var labelContainer = document.createElement(\"div\");\n        labelContainer.addStyleClass(\"timeline-category-statusbar-item\");\n        labelContainer.addStyleClass(\"timeline-category-\" + category.name);\n        labelContainer.addStyleClass(\"status-bar-item\");\n\n        var label = document.createElement(\"label\");\n        var checkElement = document.createElement(\"input\");\n        checkElement.type = \"checkbox\";\n        checkElement.className = \"timeline-category-checkbox\";\n        checkElement.checked = true;\n        checkElement.addEventListener(\"click\", onCheckboxClicked);\n        label.appendChild(checkElement);\n\n        var typeElement = document.createElement(\"span\");\n        typeElement.className = \"type\";\n        typeElement.textContent = category.title;\n        label.appendChild(typeElement);\n\n        labelContainer.appendChild(label);\n        return labelContainer;\n    }\n\n}\n\nWebInspector.TimelineOverviewPane.prototype.__proto__ = WebInspector.Object.prototype;\n\n\nWebInspector.TimelineOverviewCalculator = function()\n{\n}\n\nWebInspector.TimelineOverviewCalculator.prototype = {\n    computeBarGraphPercentages: function(record)\n    {\n        var start = (record.startTime - this.minimumBoundary) / this.boundarySpan * 100;\n        var end = (record.endTime - this.minimumBoundary) / this.boundarySpan * 100;\n        return {start: start, end: end};\n    },\n\n    reset: function()\n    {\n        delete this.minimumBoundary;\n        delete this.maximumBoundary;\n    },\n\n    updateBoundaries: function(record)\n    {\n        if (typeof this.minimumBoundary === \"undefined\" || record.startTime < this.minimumBoundary) {\n            this.minimumBoundary = record.startTime;\n            return true;\n        }\n        if (typeof this.maximumBoundary === \"undefined\" || record.endTime > this.maximumBoundary) {\n            this.maximumBoundary = record.endTime;\n            return true;\n        }\n        return false;\n    },\n\n    get boundarySpan()\n    {\n        return this.maximumBoundary - this.minimumBoundary;\n    },\n\n    formatValue: function(value)\n    {\n        return Number.secondsToString(value);\n    }\n}\n\n\nWebInspector.TimelineCategoryGraph = function(category, isEven)\n{\n    this._category = category;\n\n    this._graphElement = document.createElement(\"div\");\n    this._graphElement.className = \"timeline-graph-side timeline-overview-graph-side\" + (isEven ? \" even\" : \"\");\n\n    this._barAreaElement = document.createElement(\"div\");\n    this._barAreaElement.className = \"timeline-graph-bar-area timeline-category-\" + category.name;\n    this._graphElement.appendChild(this._barAreaElement);\n}\n\nWebInspector.TimelineCategoryGraph.prototype = {\n    get graphElement()\n    {\n        return this._graphElement;\n    },\n\n    addChunk: function(start, end)\n    {\n        var chunk = document.createElement(\"div\");\n        chunk.className = \"timeline-graph-bar\";\n        this._barAreaElement.appendChild(chunk);\n        chunk.style.setProperty(\"left\", start + \"%\");\n        chunk.style.setProperty(\"width\", (end - start) + \"%\");\n    },\n\n    clearChunks: function()\n    {\n        this._barAreaElement.removeChildren();\n    },\n\n    set dimmed(dimmed)\n    {\n        if (dimmed)\n            this._barAreaElement.removeStyleClass(\"timeline-category-\" + this._category.name);\n        else\n            this._barAreaElement.addStyleClass(\"timeline-category-\" + this._category.name);\n    }\n}\n\nWebInspector.TimelinePanel.WindowSelector = function(parent, position, event)\n{\n    this._startPosition = position;\n    this._width = parent.offsetWidth;\n    this._windowSelector = document.createElement(\"div\");\n    this._windowSelector.className = \"timeline-window-selector\";\n    this._windowSelector.style.left = this._startPosition + \"px\";\n    this._windowSelector.style.right = this._width - this._startPosition +  + \"px\";\n    parent.appendChild(this._windowSelector);\n}\n\nWebInspector.TimelinePanel.WindowSelector.prototype = {\n    _createSelectorElement: function(parent, left, width, height)\n    {\n        var selectorElement = document.createElement(\"div\");\n        selectorElement.className = \"timeline-window-selector\";\n        selectorElement.style.left = left + \"px\";\n        selectorElement.style.width = width + \"px\";\n        selectorElement.style.top = \"0px\";\n        selectorElement.style.height = height + \"px\";\n        parent.appendChild(selectorElement);\n        return selectorElement;\n    },\n\n    _close: function(position)\n    {\n        position = Math.max(0, Math.min(position, this._width));\n        this._windowSelector.parentNode.removeChild(this._windowSelector);\n        return this._startPosition < position ? {start: this._startPosition, end: position} : {start: position, end: this._startPosition};\n    },\n\n    _updatePosition: function(position)\n    {\n        position = Math.max(0, Math.min(position, this._width));\n        if (position < this._startPosition) {\n            this._windowSelector.style.left = position + \"px\";\n            this._windowSelector.style.right = this._width - this._startPosition + \"px\";\n        } else {\n            this._windowSelector.style.left = this._startPosition + \"px\";\n            this._windowSelector.style.right = this._width - position + \"px\";\n        }\n    }\n}\n\nWebInspector.HeapGraph = function() {\n    this._canvas = document.createElement(\"canvas\");\n\n    this._maxHeapSizeLabel = document.createElement(\"div\");\n    this._maxHeapSizeLabel.addStyleClass(\"memory-graph-label\");\n\n    this._element = document.createElement(\"div\");\n    this._element.addStyleClass(\"hidden\");\n    this._element.appendChild(this._canvas);\n    this._element.appendChild(this._maxHeapSizeLabel);\n}\n\nWebInspector.HeapGraph.prototype = {\n    get element() {\n    //    return this._canvas;\n        return this._element;\n    },\n\n    get visible() {\n        return !this.element.hasStyleClass(\"hidden\");\n    },\n\n    show: function() {\n        this.element.removeStyleClass(\"hidden\");\n    },\n\n    hide: function() {\n        this.element.addStyleClass(\"hidden\");\n    },\n\n    setSize: function(w, h) {\n        this._canvas.width = w;\n        this._canvas.height = h - 5;\n    },\n\n    update: function(records)\n    {\n        if (!records.length)\n            return;\n\n        var maxTotalHeapSize = 0;\n        var minTime;\n        var maxTime;\n        this._forAllRecords(records, function(r) {\n            if (r.totalHeapSize && r.totalHeapSize > maxTotalHeapSize)\n                maxTotalHeapSize = r.totalHeapSize;\n\n            if (typeof minTime === \"undefined\" || r.startTime < minTime)\n                minTime = r.startTime;\n            if (typeof maxTime === \"undefined\" || r.endTime > maxTime)\n                maxTime = r.endTime;\n        });\n\n        var width = this._canvas.width;\n        var height = this._canvas.height;\n        var xFactor = width / (maxTime - minTime);\n        var yFactor = height / maxTotalHeapSize;\n\n        var histogram = new Array(width);\n        this._forAllRecords(records, function(r) {\n            if (!r.usedHeapSize)\n                return;\n             var x = Math.round((r.endTime - minTime) * xFactor);\n             var y = Math.round(r.usedHeapSize * yFactor);\n             histogram[x] = Math.max(histogram[x] || 0, y);\n        });\n\n        var ctx = this._canvas.getContext(\"2d\");\n        this._clear(ctx);\n\n        // +1 so that the border always fit into the canvas area.\n        height = height + 1;\n\n        ctx.beginPath();\n        var initialY = 0;\n        for (var k = 0; k < histogram.length; k++) {\n            if (histogram[k]) {\n                initialY = histogram[k];\n                break;\n            }\n        }\n        ctx.moveTo(0, height - initialY);\n\n        for (var x = 0; x < histogram.length; x++) {\n             if (!histogram[x])\n                 continue;\n             ctx.lineTo(x, height - histogram[x]);\n        }\n\n        ctx.lineWidth = 0.5;\n        ctx.strokeStyle = \"rgba(20,0,0,0.8)\";\n        ctx.stroke();\n\n        ctx.fillStyle = \"rgba(214,225,254, 0.8);\";\n        ctx.lineTo(width, 60);\n        ctx.lineTo(0, 60);\n        ctx.lineTo(0, height - initialY);\n        ctx.fill();\n        ctx.closePath();\n\n        this._maxHeapSizeLabel.textContent = Number.bytesToString(maxTotalHeapSize);\n    },\n\n    _clear: function(ctx) {\n        ctx.fillStyle = \"rgba(255,255,255,0.8)\";\n        ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n    },\n\n    _forAllRecords: WebInspector.TimelineOverviewPane.prototype._forAllRecords\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TimelinePanel.js",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TimelinePanel = function()\n{\n    WebInspector.Panel.call(this, \"timeline\");\n\n    this.element.appendChild(this._createTopPane());\n    this.element.tabIndex = 0;\n\n    this._sidebarBackgroundElement = document.createElement(\"div\");\n    this._sidebarBackgroundElement.className = \"sidebar timeline-sidebar-background\";\n    this.element.appendChild(this._sidebarBackgroundElement);\n\n    this._containerElement = document.createElement(\"div\");\n    this._containerElement.id = \"timeline-container\";\n    this._containerElement.addEventListener(\"scroll\", this._onScroll.bind(this), false);\n    this.element.appendChild(this._containerElement);\n\n    this.createSidebar(this._containerElement, this._containerElement);\n    var itemsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString(\"RECORDS\"), {}, true);\n    itemsTreeElement.expanded = true;\n    this.sidebarTree.appendChild(itemsTreeElement);\n\n    this._sidebarListElement = document.createElement(\"div\");\n    this.sidebarElement.appendChild(this._sidebarListElement);\n\n    this._containerContentElement = document.createElement(\"div\");\n    this._containerContentElement.id = \"resources-container-content\";\n    this._containerElement.appendChild(this._containerContentElement);\n\n    this._timelineGrid = new WebInspector.TimelineGrid();\n    this._itemsGraphsElement = this._timelineGrid.itemsGraphsElement;\n    this._itemsGraphsElement.id = \"timeline-graphs\";\n    this._containerContentElement.appendChild(this._timelineGrid.element);\n\n    this._topGapElement = document.createElement(\"div\");\n    this._topGapElement.className = \"timeline-gap\";\n    this._itemsGraphsElement.appendChild(this._topGapElement);\n\n    this._graphRowsElement = document.createElement(\"div\");\n    this._itemsGraphsElement.appendChild(this._graphRowsElement);\n\n    this._bottomGapElement = document.createElement(\"div\");\n    this._bottomGapElement.className = \"timeline-gap\";\n    this._itemsGraphsElement.appendChild(this._bottomGapElement);\n\n    this._expandElements = document.createElement(\"div\");\n    this._expandElements.id = \"orphan-expand-elements\";\n    this._itemsGraphsElement.appendChild(this._expandElements);\n\n    this._rootRecord = this._createRootRecord();\n    this._sendRequestRecords = {};\n    this._scheduledResourceRequests = {};\n    this._timerRecords = {};\n\n    this._calculator = new WebInspector.TimelineCalculator();\n    this._calculator._showShortEvents = false;\n    var shortRecordThresholdTitle = Number.secondsToString(WebInspector.TimelinePanel.shortRecordThreshold);\n    this._showShortRecordsTitleText = WebInspector.UIString(\"Show the records that are shorter than %s\", shortRecordThresholdTitle);\n    this._hideShortRecordsTitleText = WebInspector.UIString(\"Hide the records that are shorter than %s\", shortRecordThresholdTitle);\n    this._createStatusbarButtons();\n\n    this._boundariesAreValid = true;\n    this._scrollTop = 0;\n\n    this._popoverHelper = new WebInspector.PopoverHelper(this._containerElement, this._getPopoverAnchor.bind(this), this._showPopover.bind(this), true);\n\n    // Disable short events filter by default.\n    this.toggleFilterButton.toggled = true;\n    this._calculator._showShortEvents = this.toggleFilterButton.toggled;\n    this._markTimelineRecords = [];\n    this._expandOffset = 15;\n\n    InspectorBackend.registerDomainDispatcher(\"Timeline\", new WebInspector.TimelineDispatcher(this));\n}\n\n// Define row height, should be in sync with styles for timeline graphs.\nWebInspector.TimelinePanel.rowHeight = 18;\nWebInspector.TimelinePanel.shortRecordThreshold = 0.015;\n\nWebInspector.TimelinePanel.prototype = {\n    _createTopPane: function() {\n        var topPaneElement = document.createElement(\"div\");\n        topPaneElement.id = \"timeline-overview-panel\";\n\n        this._topPaneSidebarElement = document.createElement(\"div\");\n        this._topPaneSidebarElement.id = \"timeline-overview-sidebar\";\n\n        var overviewTreeElement = document.createElement(\"ol\");\n        overviewTreeElement.className = \"sidebar-tree\";\n        this._topPaneSidebarElement.appendChild(overviewTreeElement);\n        topPaneElement.appendChild(this._topPaneSidebarElement);\n\n        var topPaneSidebarTree = new TreeOutline(overviewTreeElement);\n        var timelinesOverviewItem = new WebInspector.SidebarTreeElement(\"resources-time-graph-sidebar-item\", WebInspector.UIString(\"Timelines\"));\n        topPaneSidebarTree.appendChild(timelinesOverviewItem);\n        timelinesOverviewItem.onselect = this._timelinesOverviewItemSelected.bind(this);\n        timelinesOverviewItem.select(true);\n\n        var memoryOverviewItem = new WebInspector.SidebarTreeElement(\"resources-size-graph-sidebar-item\", WebInspector.UIString(\"Memory\"));\n        topPaneSidebarTree.appendChild(memoryOverviewItem);\n        memoryOverviewItem.onselect = this._memoryOverviewItemSelected.bind(this);\n\n        this._overviewPane = new WebInspector.TimelineOverviewPane(this.categories);\n        this._overviewPane.addEventListener(\"window changed\", this._windowChanged, this);\n        this._overviewPane.addEventListener(\"filter changed\", this._refresh, this);\n        topPaneElement.appendChild(this._overviewPane.element);\n\n        var separatorElement = document.createElement(\"div\");\n        separatorElement.id = \"timeline-overview-separator\";\n        topPaneElement.appendChild(separatorElement);\n        return topPaneElement;\n    },\n\n    get toolbarItemLabel()\n    {\n        return WebInspector.UIString(\"Timeline\");\n    },\n\n    get statusBarItems()\n    {\n        return [this.toggleFilterButton.element, this.toggleTimelineButton.element, this.clearButton.element, this._overviewPane.statusBarFilters];\n    },\n\n    get categories()\n    {\n        if (!this._categories) {\n            this._categories = {\n                loading: new WebInspector.TimelineCategory(\"loading\", WebInspector.UIString(\"Loading\"), \"rgb(47,102,236)\"),\n                scripting: new WebInspector.TimelineCategory(\"scripting\", WebInspector.UIString(\"Scripting\"), \"rgb(157,231,119)\"),\n                rendering: new WebInspector.TimelineCategory(\"rendering\", WebInspector.UIString(\"Rendering\"), \"rgb(164,60,255)\")\n            };\n        }\n        return this._categories;\n    },\n\n    get defaultFocusedElement()\n    {\n        return this.element;\n    },\n\n    get _recordStyles()\n    {\n        if (!this._recordStylesArray) {\n            var recordTypes = WebInspector.TimelineAgent.RecordType;\n            var recordStyles = {};\n            recordStyles[recordTypes.EventDispatch] = { title: WebInspector.UIString(\"Event\"), category: this.categories.scripting };\n            recordStyles[recordTypes.Layout] = { title: WebInspector.UIString(\"Layout\"), category: this.categories.rendering };\n            recordStyles[recordTypes.RecalculateStyles] = { title: WebInspector.UIString(\"Recalculate Style\"), category: this.categories.rendering };\n            recordStyles[recordTypes.Paint] = { title: WebInspector.UIString(\"Paint\"), category: this.categories.rendering };\n            recordStyles[recordTypes.ParseHTML] = { title: WebInspector.UIString(\"Parse\"), category: this.categories.loading };\n            recordStyles[recordTypes.TimerInstall] = { title: WebInspector.UIString(\"Install Timer\"), category: this.categories.scripting };\n            recordStyles[recordTypes.TimerRemove] = { title: WebInspector.UIString(\"Remove Timer\"), category: this.categories.scripting };\n            recordStyles[recordTypes.TimerFire] = { title: WebInspector.UIString(\"Timer Fired\"), category: this.categories.scripting };\n            recordStyles[recordTypes.XHRReadyStateChange] = { title: WebInspector.UIString(\"XHR Ready State Change\"), category: this.categories.scripting };\n            recordStyles[recordTypes.XHRLoad] = { title: WebInspector.UIString(\"XHR Load\"), category: this.categories.scripting };\n            recordStyles[recordTypes.EvaluateScript] = { title: WebInspector.UIString(\"Evaluate Script\"), category: this.categories.scripting };\n            recordStyles[recordTypes.MarkTimeline] = { title: WebInspector.UIString(\"Mark\"), category: this.categories.scripting };\n            recordStyles[recordTypes.ResourceSendRequest] = { title: WebInspector.UIString(\"Send Request\"), category: this.categories.loading };\n            recordStyles[recordTypes.ResourceReceiveResponse] = { title: WebInspector.UIString(\"Receive Response\"), category: this.categories.loading };\n            recordStyles[recordTypes.ResourceFinish] = { title: WebInspector.UIString(\"Finish Loading\"), category: this.categories.loading };\n            recordStyles[recordTypes.FunctionCall] = { title: WebInspector.UIString(\"Function Call\"), category: this.categories.scripting };\n            recordStyles[recordTypes.ResourceReceiveData] = { title: WebInspector.UIString(\"Receive Data\"), category: this.categories.loading };\n            recordStyles[recordTypes.GCEvent] = { title: WebInspector.UIString(\"GC Event\"), category: this.categories.scripting };\n            recordStyles[recordTypes.MarkDOMContentEventType] = { title: WebInspector.UIString(\"DOMContent event\"), category: this.categories.scripting };\n            recordStyles[recordTypes.MarkLoadEventType] = { title: WebInspector.UIString(\"Load event\"), category: this.categories.scripting };\n            recordStyles[recordTypes.ScheduleResourceRequest] = { title: WebInspector.UIString(\"Schedule Request\"), category: this.categories.loading };\n            this._recordStylesArray = recordStyles;\n        }\n        return this._recordStylesArray;\n    },\n\n    _createStatusbarButtons: function()\n    {\n        this.toggleTimelineButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Record\"), \"record-profile-status-bar-item\");\n        this.toggleTimelineButton.addEventListener(\"click\", this._toggleTimelineButtonClicked.bind(this), false);\n\n        this.clearButton = new WebInspector.StatusBarButton(WebInspector.UIString(\"Clear\"), \"clear-status-bar-item\");\n        this.clearButton.addEventListener(\"click\", this._clearPanel.bind(this), false);\n\n        this.toggleFilterButton = new WebInspector.StatusBarButton(this._hideShortRecordsTitleText, \"timeline-filter-status-bar-item\");\n        this.toggleFilterButton.addEventListener(\"click\", this._toggleFilterButtonClicked.bind(this), false);\n\n        this.recordsCounter = document.createElement(\"span\");\n        this.recordsCounter.className = \"timeline-records-counter\";\n    },\n\n    _updateRecordsCounter: function()\n    {\n        this.recordsCounter.textContent = WebInspector.UIString(\"%d of %d captured records are visible\", this._rootRecord._visibleRecordsCount, this._rootRecord._allRecordsCount);\n    },\n\n    _updateEventDividers: function()\n    {\n        this._timelineGrid.removeEventDividers();\n        var clientWidth = this._graphRowsElement.offsetWidth - this._expandOffset;\n        var dividers = [];\n        for (var i = 0; i < this._markTimelineRecords.length; ++i) {\n            var record = this._markTimelineRecords[i];\n            var positions = this._calculator.computeBarGraphWindowPosition(record, clientWidth);\n            var dividerPosition = Math.round(positions.left);\n            if (dividerPosition < 0 || dividerPosition >= clientWidth || dividers[dividerPosition])\n                continue;\n            var divider = this._createEventDivider(record);\n            divider.style.left = (dividerPosition + this._expandOffset) + \"px\";\n            dividers[dividerPosition] = divider;\n        }\n        this._timelineGrid.addEventDividers(dividers);\n        this._overviewPane.updateEventDividers(this._markTimelineRecords, this._createEventDivider.bind(this));\n    },\n\n    _createEventDivider: function(record)\n    {\n        var eventDivider = document.createElement(\"div\");\n        eventDivider.className = \"resources-event-divider\";\n        var recordTypes = WebInspector.TimelineAgent.RecordType;\n\n        var eventDividerPadding = document.createElement(\"div\");\n        eventDividerPadding.className = \"resources-event-divider-padding\";\n        eventDividerPadding.title = record.title;\n\n        if (record.type === recordTypes.MarkDOMContentEventType)\n            eventDivider.className += \" resources-blue-divider\";\n        else if (record.type === recordTypes.MarkLoadEventType)\n            eventDivider.className += \" resources-red-divider\";\n        else if (record.type === recordTypes.MarkTimeline) {\n            eventDivider.className += \" resources-orange-divider\";\n            eventDividerPadding.title = record.data.message;\n        }\n        eventDividerPadding.appendChild(eventDivider);\n        return eventDividerPadding;\n    },\n\n    _timelinesOverviewItemSelected: function(event) {\n        this._overviewPane.showTimelines();\n    },\n\n    _memoryOverviewItemSelected: function(event) {\n        this._overviewPane.showMemoryGraph(this._rootRecord.children);\n    },\n\n    _toggleTimelineButtonClicked: function()\n    {\n        if (this.toggleTimelineButton.toggled)\n            InspectorBackend.stopTimelineProfiler();\n        else {\n            this._clearPanel();\n            InspectorBackend.startTimelineProfiler();\n        }\n    },\n\n    _toggleFilterButtonClicked: function()\n    {\n        this.toggleFilterButton.toggled = !this.toggleFilterButton.toggled;\n        this._calculator._showShortEvents = this.toggleFilterButton.toggled;\n        this.toggleFilterButton.element.title = this._calculator._showShortEvents ? this._hideShortRecordsTitleText : this._showShortRecordsTitleText;\n        this._scheduleRefresh(true);\n    },\n\n    _timelineProfilerWasStarted: function()\n    {\n        this.toggleTimelineButton.toggled = true;\n    },\n\n    _timelineProfilerWasStopped: function()\n    {\n        this.toggleTimelineButton.toggled = false;\n    },\n\n    _addRecordToTimeline: function(record)\n    {\n        if (record.type == WebInspector.TimelineAgent.RecordType.ResourceSendRequest) {\n            var isMainResource = (record.data.identifier === WebInspector.mainResource.identifier);\n            if (isMainResource && this._mainResourceIdentifier !== record.data.identifier) {\n                // We are loading new main resource -> clear the panel. Check above is necessary since\n                // there may be several resource loads with main resource marker upon redirects, redirects are reported with\n                // the original identifier.\n                this._mainResourceIdentifier = record.data.identifier;\n                this._clearPanel();\n            }\n        }\n        this._innerAddRecordToTimeline(record, this._rootRecord);\n        this._scheduleRefresh();\n    },\n\n    _findParentRecord: function(record)\n    {\n        var recordTypes = WebInspector.TimelineAgent.RecordType;\n        var parentRecord;\n        if (record.type === recordTypes.ResourceReceiveResponse ||\n            record.type === recordTypes.ResourceFinish ||\n            record.type === recordTypes.ResourceReceiveData)\n            parentRecord = this._sendRequestRecords[record.data.identifier];\n        else if (record.type === recordTypes.TimerFire)\n            parentRecord = this._timerRecords[record.data.timerId];\n        else if (record.type === recordTypes.ResourceSendRequest)\n            parentRecord = this._scheduledResourceRequests[record.data.url];\n        return parentRecord;\n    },\n\n    _innerAddRecordToTimeline: function(record, parentRecord)\n    {\n        var connectedToOldRecord = false;\n        var recordTypes = WebInspector.TimelineAgent.RecordType;\n        if (record.type === recordTypes.MarkDOMContentEventType || record.type === recordTypes.MarkLoadEventType)\n            parentRecord = null; // No bar entry for load events.\n        else if (parentRecord === this._rootRecord) {\n            var newParentRecord = this._findParentRecord(record);\n            if (newParentRecord) {\n                parentRecord = newParentRecord;\n                connectedToOldRecord = true;\n            }\n        }\n\n        if (record.type == recordTypes.TimerFire && record.children && record.children.length) {\n            var childRecord = record.children[0];\n            if (childRecord.type === recordTypes.FunctionCall) {\n                record.data.scriptName = childRecord.data.scriptName;\n                record.data.scriptLine = childRecord.data.scriptLine;\n                record.children.shift();\n                record.children = childRecord.children.concat(record.children);\n            }\n        }\n\n        var formattedRecord = new WebInspector.TimelinePanel.FormattedRecord(record, parentRecord, this);\n\n        if (record.type === recordTypes.MarkDOMContentEventType || record.type === recordTypes.MarkLoadEventType) {\n            this._markTimelineRecords.push(formattedRecord);\n            return;\n        }\n\n        ++this._rootRecord._allRecordsCount;\n        formattedRecord.collapsed = (parentRecord === this._rootRecord);\n\n        var childrenCount = record.children ? record.children.length : 0;\n        for (var i = 0; i < childrenCount; ++i)\n            this._innerAddRecordToTimeline(record.children[i], formattedRecord);\n\n        formattedRecord._calculateAggregatedStats(this.categories);\n\n        if (connectedToOldRecord) {\n            var record = formattedRecord;\n            do {\n                var parent = record.parent;\n                parent._cpuTime += formattedRecord._cpuTime;\n                if (parent._lastChildEndTime < record._lastChildEndTime)\n                    parent._lastChildEndTime = record._lastChildEndTime;\n                for (var category in formattedRecord._aggregatedStats)\n                    parent._aggregatedStats[category] += formattedRecord._aggregatedStats[category];\n                record = parent;\n            } while (record.parent);\n        } else\n            if (parentRecord !== this._rootRecord)\n                parentRecord._selfTime -= formattedRecord.endTime - formattedRecord.startTime;\n\n        // Keep bar entry for mark timeline since nesting might be interesting to the user.\n        if (record.type === recordTypes.MarkTimeline)\n            this._markTimelineRecords.push(formattedRecord);\n    },\n\n    setSidebarWidth: function(width)\n    {\n        WebInspector.Panel.prototype.setSidebarWidth.call(this, width);\n        this._sidebarBackgroundElement.style.width = width + \"px\";\n        this._topPaneSidebarElement.style.width = width + \"px\";\n    },\n\n    updateMainViewWidth: function(width)\n    {\n        this._containerContentElement.style.left = width + \"px\";\n        this._scheduleRefresh();\n        this._overviewPane.updateMainViewWidth(width);\n    },\n\n    resize: function()\n    {\n        this._closeRecordDetails();\n        this._scheduleRefresh();\n    },\n\n    _createRootRecord: function()\n    {\n        var rootRecord = {};\n        rootRecord.children = [];\n        rootRecord._visibleRecordsCount = 0;\n        rootRecord._allRecordsCount = 0;\n        rootRecord._aggregatedStats = {};\n        return rootRecord;\n    },\n\n    _clearPanel: function()\n    {\n        this._markTimelineRecords = [];\n        this._sendRequestRecords = {};\n        this._scheduledResourceRequests = {};\n        this._timerRecords = {};\n        this._rootRecord = this._createRootRecord();\n        this._boundariesAreValid = false;\n        this._overviewPane.reset();\n        this._adjustScrollPosition(0);\n        this._refresh();\n        this._closeRecordDetails();\n    },\n\n    show: function()\n    {\n        WebInspector.Panel.prototype.show.call(this);\n        if (typeof this._scrollTop === \"number\")\n            this._containerElement.scrollTop = this._scrollTop;\n        this._refresh();\n        WebInspector.drawer.currentPanelCounters = this.recordsCounter;\n    },\n\n    hide: function()\n    {\n        WebInspector.Panel.prototype.hide.call(this);\n        this._closeRecordDetails();\n        WebInspector.drawer.currentPanelCounters = null;\n    },\n\n    _onScroll: function(event)\n    {\n        this._closeRecordDetails();\n        var scrollTop = this._containerElement.scrollTop;\n        var dividersTop = Math.max(0, scrollTop);\n        this._timelineGrid.setScrollAndDividerTop(scrollTop, dividersTop);\n        this._scheduleRefresh(true);\n    },\n\n    _windowChanged: function()\n    {\n        this._closeRecordDetails();\n        this._scheduleRefresh();\n    },\n\n    _scheduleRefresh: function(preserveBoundaries)\n    {\n        this._closeRecordDetails();\n        this._boundariesAreValid &= preserveBoundaries;\n\n        if (!this.visible)\n            return;\n\n        if (preserveBoundaries)\n            this._refresh();\n        else\n            if (!this._refreshTimeout)\n                this._refreshTimeout = setTimeout(this._refresh.bind(this), 100);\n    },\n\n    _refresh: function()\n    {\n        if (this._refreshTimeout) {\n            clearTimeout(this._refreshTimeout);\n            delete this._refreshTimeout;\n        }\n\n        this._overviewPane.update(this._rootRecord.children, this._calculator._showShortEvents);\n        this._refreshRecords(!this._boundariesAreValid);\n        this._updateRecordsCounter();\n        if(!this._boundariesAreValid)\n            this._updateEventDividers();\n        this._boundariesAreValid = true;\n    },\n\n    _updateBoundaries: function()\n    {\n        this._calculator.reset();\n        this._calculator.windowLeft = this._overviewPane.windowLeft;\n        this._calculator.windowRight = this._overviewPane.windowRight;\n\n        for (var i = 0; i < this._rootRecord.children.length; ++i)\n            this._calculator.updateBoundaries(this._rootRecord.children[i]);\n\n        this._calculator.calculateWindow();\n    },\n\n    _addToRecordsWindow: function(record, recordsWindow, parentIsCollapsed)\n    {\n        if (!this._calculator._showShortEvents && !record.isLong())\n            return;\n        var percentages = this._calculator.computeBarGraphPercentages(record);\n        if (percentages.start < 100 && percentages.endWithChildren >= 0 && !record.category.hidden) {\n            ++this._rootRecord._visibleRecordsCount;\n            ++record.parent._invisibleChildrenCount;\n            if (!parentIsCollapsed)\n                recordsWindow.push(record);\n        }\n\n        var index = recordsWindow.length;\n        record._invisibleChildrenCount = 0;\n        for (var i = 0; i < record.children.length; ++i)\n            this._addToRecordsWindow(record.children[i], recordsWindow, parentIsCollapsed || record.collapsed);\n        record._visibleChildrenCount = recordsWindow.length - index;\n    },\n\n    _filterRecords: function()\n    {\n        var recordsInWindow = [];\n        this._rootRecord._visibleRecordsCount = 0;\n        for (var i = 0; i < this._rootRecord.children.length; ++i)\n            this._addToRecordsWindow(this._rootRecord.children[i], recordsInWindow);\n        return recordsInWindow;\n    },\n\n    _refreshRecords: function(updateBoundaries)\n    {\n        if (updateBoundaries)\n            this._updateBoundaries();\n\n        var recordsInWindow = this._filterRecords();\n\n        // Calculate the visible area.\n        this._scrollTop = this._containerElement.scrollTop;\n        var visibleTop = this._scrollTop;\n        var visibleBottom = visibleTop + this._containerElement.clientHeight;\n\n        var rowHeight = WebInspector.TimelinePanel.rowHeight;\n\n        // Convert visible area to visible indexes. Always include top-level record for a visible nested record.\n        var startIndex = Math.max(0, Math.min(Math.floor(visibleTop / rowHeight) - 1, recordsInWindow.length - 1));\n        var endIndex = Math.min(recordsInWindow.length, Math.ceil(visibleBottom / rowHeight));\n\n        // Resize gaps first.\n        var top = (startIndex * rowHeight) + \"px\";\n        this._topGapElement.style.height = top;\n        this.sidebarElement.style.top = top;\n        this.sidebarResizeElement.style.top = top;\n        this._bottomGapElement.style.height = (recordsInWindow.length - endIndex) * rowHeight + \"px\";\n\n        // Update visible rows.\n        var listRowElement = this._sidebarListElement.firstChild;\n        var width = this._graphRowsElement.offsetWidth;\n        this._itemsGraphsElement.removeChild(this._graphRowsElement);\n        var graphRowElement = this._graphRowsElement.firstChild;\n        var scheduleRefreshCallback = this._scheduleRefresh.bind(this, true);\n        this._itemsGraphsElement.removeChild(this._expandElements);\n        this._expandElements.removeChildren();\n\n        for (var i = 0; i < endIndex; ++i) {\n            var record = recordsInWindow[i];\n            var isEven = !(i % 2);\n\n            if (i < startIndex) {\n                var lastChildIndex = i + record._visibleChildrenCount;\n                if (lastChildIndex >= startIndex && lastChildIndex < endIndex) {\n                    var expandElement = new WebInspector.TimelineExpandableElement(this._expandElements);\n                    expandElement._update(record, i, this._calculator.computeBarGraphWindowPosition(record, width - this._expandOffset));\n                }\n            } else {\n                if (!listRowElement) {\n                    listRowElement = new WebInspector.TimelineRecordListRow().element;\n                    this._sidebarListElement.appendChild(listRowElement);\n                }\n                if (!graphRowElement) {\n                    graphRowElement = new WebInspector.TimelineRecordGraphRow(this._itemsGraphsElement, scheduleRefreshCallback, rowHeight).element;\n                    this._graphRowsElement.appendChild(graphRowElement);\n                }\n\n                listRowElement.row.update(record, isEven, this._calculator, visibleTop);\n                graphRowElement.row.update(record, isEven, this._calculator, width, this._expandOffset, i);\n\n                listRowElement = listRowElement.nextSibling;\n                graphRowElement = graphRowElement.nextSibling;\n            }\n        }\n\n        // Remove extra rows.\n        while (listRowElement) {\n            var nextElement = listRowElement.nextSibling;\n            listRowElement.row.dispose();\n            listRowElement = nextElement;\n        }\n        while (graphRowElement) {\n            var nextElement = graphRowElement.nextSibling;\n            graphRowElement.row.dispose();\n            graphRowElement = nextElement;\n        }\n\n        this._itemsGraphsElement.insertBefore(this._graphRowsElement, this._bottomGapElement);\n        this._itemsGraphsElement.appendChild(this._expandElements);\n        this.sidebarResizeElement.style.height = this.sidebarElement.clientHeight + \"px\";\n        // Reserve some room for expand / collapse controls to the left for records that start at 0ms.\n        var timelinePaddingLeft = this._calculator.windowLeft === 0 ? this._expandOffset : 0;\n        if (updateBoundaries)\n            this._timelineGrid.updateDividers(true, this._calculator, timelinePaddingLeft);\n        this._adjustScrollPosition((recordsInWindow.length + 1) * rowHeight);\n    },\n\n    _adjustScrollPosition: function(totalHeight)\n    {\n        // Prevent the container from being scrolled off the end.\n        if ((this._containerElement.scrollTop + this._containerElement.offsetHeight) > totalHeight + 1)\n            this._containerElement.scrollTop = (totalHeight - this._containerElement.offsetHeight);\n    },\n\n    _getPopoverAnchor: function(element)\n    {\n        return element.enclosingNodeOrSelfWithClass(\"timeline-graph-bar\") || element.enclosingNodeOrSelfWithClass(\"timeline-tree-item\");\n    },\n\n    _showPopover: function(anchor)\n    {\n        var record = anchor.row._record;\n        var popover = new WebInspector.Popover(record._generatePopupContent(this._calculator, this.categories));\n        popover.show(anchor);\n        return popover;\n    },\n\n    _closeRecordDetails: function()\n    {\n        this._popoverHelper.hidePopup();\n    }\n}\n\nWebInspector.TimelinePanel.prototype.__proto__ = WebInspector.Panel.prototype;\n\nWebInspector.TimelineDispatcher = function(timelinePanel)\n{\n    this._timelinePanel = timelinePanel;\n}\n\nWebInspector.TimelineDispatcher.prototype = {\n    timelineProfilerWasStarted: function()\n    {\n        this._timelinePanel._timelineProfilerWasStarted();\n    },\n\n    timelineProfilerWasStopped: function()\n    {\n        this._timelinePanel._timelineProfilerWasStopped();\n    },\n\n    addRecordToTimeline: function(record)\n    {\n        this._timelinePanel._addRecordToTimeline(record);\n    }\n}\n\nWebInspector.TimelineCategory = function(name, title, color)\n{\n    this.name = name;\n    this.title = title;\n    this.color = color;\n}\n\nWebInspector.TimelineCalculator = function()\n{\n    this.reset();\n    this.windowLeft = 0.0;\n    this.windowRight = 1.0;\n}\n\nWebInspector.TimelineCalculator.prototype = {\n    computeBarGraphPercentages: function(record)\n    {\n        var start = (record.startTime - this.minimumBoundary) / this.boundarySpan * 100;\n        var end = (record.startTime + record._selfTime - this.minimumBoundary) / this.boundarySpan * 100;\n        var endWithChildren = (record._lastChildEndTime - this.minimumBoundary) / this.boundarySpan * 100;\n        var cpuWidth = record._cpuTime / this.boundarySpan * 100;\n        return {start: start, end: end, endWithChildren: endWithChildren, cpuWidth: cpuWidth};\n    },\n\n    computeBarGraphWindowPosition: function(record, clientWidth)\n    {\n        var minWidth = 5;\n        var borderWidth = 4;\n        var workingArea = clientWidth - minWidth - borderWidth;\n        var percentages = this.computeBarGraphPercentages(record);\n        var left = percentages.start / 100 * workingArea;\n        var width = (percentages.end - percentages.start) / 100 * workingArea + minWidth;\n        var widthWithChildren =  (percentages.endWithChildren - percentages.start) / 100 * workingArea;\n        var cpuWidth = percentages.cpuWidth / 100 * workingArea + minWidth;\n        if (percentages.endWithChildren > percentages.end)\n            widthWithChildren += borderWidth + minWidth;\n        return {left: left, width: width, widthWithChildren: widthWithChildren, cpuWidth: cpuWidth};\n    },\n\n    calculateWindow: function()\n    {\n        this.minimumBoundary = this._absoluteMinimumBoundary + this.windowLeft * (this._absoluteMaximumBoundary - this._absoluteMinimumBoundary);\n        this.maximumBoundary = this._absoluteMinimumBoundary + this.windowRight * (this._absoluteMaximumBoundary - this._absoluteMinimumBoundary);\n        this.boundarySpan = this.maximumBoundary - this.minimumBoundary;\n    },\n\n    reset: function()\n    {\n        this._absoluteMinimumBoundary = -1;\n        this._absoluteMaximumBoundary = -1;\n    },\n\n    updateBoundaries: function(record)\n    {\n        var lowerBound = record.startTime;\n        if (this._absoluteMinimumBoundary === -1 || lowerBound < this._absoluteMinimumBoundary)\n            this._absoluteMinimumBoundary = lowerBound;\n\n        var minimumTimeFrame = 0.1;\n        var minimumDeltaForZeroSizeEvents = 0.01;\n        var upperBound = Math.max(record._lastChildEndTime + minimumDeltaForZeroSizeEvents, lowerBound + minimumTimeFrame);\n        if (this._absoluteMaximumBoundary === -1 || upperBound > this._absoluteMaximumBoundary)\n            this._absoluteMaximumBoundary = upperBound;\n    },\n\n    formatValue: function(value)\n    {\n        return Number.secondsToString(value + this.minimumBoundary - this._absoluteMinimumBoundary);\n    }\n}\n\n\nWebInspector.TimelineRecordListRow = function()\n{\n    this.element = document.createElement(\"div\");\n    this.element.row = this;\n    this.element.style.cursor = \"pointer\";\n    var iconElement = document.createElement(\"span\");\n    iconElement.className = \"timeline-tree-icon\";\n    this.element.appendChild(iconElement);\n\n    this._typeElement = document.createElement(\"span\");\n    this._typeElement.className = \"type\";\n    this.element.appendChild(this._typeElement);\n\n    var separatorElement = document.createElement(\"span\");\n    separatorElement.className = \"separator\";\n    separatorElement.textContent = \" \";\n\n    this._dataElement = document.createElement(\"span\");\n    this._dataElement.className = \"data dimmed\";\n\n    this.element.appendChild(separatorElement);\n    this.element.appendChild(this._dataElement);\n}\n\nWebInspector.TimelineRecordListRow.prototype = {\n    update: function(record, isEven, calculator, offset)\n    {\n        this._record = record;\n        this._calculator = calculator;\n        this._offset = offset;\n\n        this.element.className = \"timeline-tree-item timeline-category-\" + record.category.name + (isEven ? \" even\" : \"\");\n        this._typeElement.textContent = record.title;\n\n        if (this._dataElement.firstChild)\n            this._dataElement.removeChildren();\n        if (record.details) {\n            var detailsContainer = document.createElement(\"span\");\n            if (typeof record.details === \"object\") {\n                detailsContainer.appendChild(document.createTextNode(\"(\"));\n                detailsContainer.appendChild(record.details);\n                detailsContainer.appendChild(document.createTextNode(\")\"));\n            } else\n                detailsContainer.textContent = \"(\" + record.details + \")\";\n            this._dataElement.appendChild(detailsContainer);\n        }\n    },\n\n    dispose: function()\n    {\n        this.element.parentElement.removeChild(this.element);\n    }\n}\n\nWebInspector.TimelineRecordGraphRow = function(graphContainer, scheduleRefresh)\n{\n    this.element = document.createElement(\"div\");\n    this.element.row = this;\n\n    this._barAreaElement = document.createElement(\"div\");\n    this._barAreaElement.className = \"timeline-graph-bar-area\";\n    this.element.appendChild(this._barAreaElement);\n\n    this._barWithChildrenElement = document.createElement(\"div\");\n    this._barWithChildrenElement.className = \"timeline-graph-bar with-children\";\n    this._barWithChildrenElement.row = this;\n    this._barAreaElement.appendChild(this._barWithChildrenElement);\n\n    this._barCpuElement = document.createElement(\"div\");\n    this._barCpuElement.className = \"timeline-graph-bar cpu\"\n    this._barCpuElement.row = this;\n    this._barAreaElement.appendChild(this._barCpuElement);\n\n    this._barElement = document.createElement(\"div\");\n    this._barElement.className = \"timeline-graph-bar\";\n    this._barElement.row = this;\n    this._barAreaElement.appendChild(this._barElement);\n\n    this._expandElement = new WebInspector.TimelineExpandableElement(graphContainer);\n    this._expandElement._element.addEventListener(\"click\", this._onClick.bind(this));\n\n    this._scheduleRefresh = scheduleRefresh;\n}\n\nWebInspector.TimelineRecordGraphRow.prototype = {\n    update: function(record, isEven, calculator, clientWidth, expandOffset, index)\n    {\n        this._record = record;\n        this.element.className = \"timeline-graph-side timeline-category-\" + record.category.name + (isEven ? \" even\" : \"\");\n        var barPosition = calculator.computeBarGraphWindowPosition(record, clientWidth - expandOffset);\n        this._barWithChildrenElement.style.left = barPosition.left + expandOffset + \"px\";\n        this._barWithChildrenElement.style.width = barPosition.widthWithChildren + \"px\";\n        this._barElement.style.left = barPosition.left + expandOffset + \"px\";\n        this._barElement.style.width =  barPosition.width + \"px\";\n        this._barCpuElement.style.left = barPosition.left + expandOffset + \"px\";\n        this._barCpuElement.style.width = barPosition.cpuWidth + \"px\";\n        this._expandElement._update(record, index, barPosition);\n    },\n\n    _onClick: function(event)\n    {\n        this._record.collapsed = !this._record.collapsed;\n        this._scheduleRefresh();\n    },\n\n    dispose: function()\n    {\n        this.element.parentElement.removeChild(this.element);\n        this._expandElement._dispose();\n    }\n}\n\nWebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, panel)\n{\n    var recordTypes = WebInspector.TimelineAgent.RecordType;\n    var style = panel._recordStyles[record.type];\n\n    this.parent = parentRecord;\n    if (parentRecord)\n        parentRecord.children.push(this);\n    this.category = style.category;\n    this.title = style.title;\n    this.startTime = record.startTime / 1000;\n    this.data = record.data;\n    this.type = record.type;\n    this.endTime = (typeof record.endTime !== \"undefined\") ? record.endTime / 1000 : this.startTime;\n    this._selfTime = this.endTime - this.startTime;\n    this._lastChildEndTime = this.endTime;\n    this.originalRecordForTests = record;\n    if (record.stackTrace && record.stackTrace.length)\n        this.stackTrace = record.stackTrace;\n    this.totalHeapSize = record.totalHeapSize;\n    this.usedHeapSize = record.usedHeapSize;\n\n    // Make resource receive record last since request was sent; make finish record last since response received.\n    if (record.type === recordTypes.ResourceSendRequest) {\n        panel._sendRequestRecords[record.data.identifier] = this;\n    } else if (record.type === recordTypes.ScheduleResourceRequest) {\n        panel._scheduledResourceRequests[record.data.url] = this;\n    } else if (record.type === recordTypes.ResourceReceiveResponse) {\n        var sendRequestRecord = panel._sendRequestRecords[record.data.identifier];\n        if (sendRequestRecord) { // False if we started instrumentation in the middle of request.\n            record.data.url = sendRequestRecord.data.url;\n            // Now that we have resource in the collection, recalculate details in order to display short url.\n            sendRequestRecord.details = this._getRecordDetails(sendRequestRecord, panel._sendRequestRecords);\n            if (sendRequestRecord.parent !== panel._rootRecord && sendRequestRecord.parent.type === recordTypes.ScheduleResourceRequest)\n                sendRequestRecord.parent.details = this._getRecordDetails(sendRequestRecord, panel._sendRequestRecords);\n        }\n    } else if (record.type === recordTypes.ResourceReceiveData) {\n        var sendRequestRecord = panel._sendRequestRecords[record.data.identifier];\n        if (sendRequestRecord) // False for main resource.\n            record.data.url = sendRequestRecord.data.url;\n    } else if (record.type === recordTypes.ResourceFinish) {\n        var sendRequestRecord = panel._sendRequestRecords[record.data.identifier];\n        if (sendRequestRecord) // False for main resource.\n            record.data.url = sendRequestRecord.data.url;\n    } else if (record.type === recordTypes.TimerInstall) {\n        this.timeout = record.data.timeout;\n        this.singleShot = record.data.singleShot;\n        panel._timerRecords[record.data.timerId] = this;\n    } else if (record.type === recordTypes.TimerFire) {\n        var timerInstalledRecord = panel._timerRecords[record.data.timerId];\n        if (timerInstalledRecord) {\n            this.callSiteStackTrace = timerInstalledRecord.stackTrace;\n            this.timeout = timerInstalledRecord.timeout;\n            this.singleShot = timerInstalledRecord.singleShot;\n        }\n    }\n    this.details = this._getRecordDetails(record, panel._sendRequestRecords);\n}\n\nWebInspector.TimelinePanel.FormattedRecord.prototype = {\n    isLong: function()\n    {\n        return (this._lastChildEndTime - this.startTime) > WebInspector.TimelinePanel.shortRecordThreshold;\n    },\n\n    get children()\n    {\n        if (!this._children)\n            this._children = [];\n        return this._children;\n    },\n\n    _generateAggregatedInfo: function()\n    {\n        var cell = document.createElement(\"span\");\n        cell.className = \"timeline-aggregated-info\";\n        for (var index in this._aggregatedStats) {\n            var label = document.createElement(\"div\");\n            label.className = \"timeline-aggregated-category timeline-\" + index;\n            cell.appendChild(label);\n            var text = document.createElement(\"span\");\n            text.textContent = Number.secondsToString(this._aggregatedStats[index] + 0.0001);\n            cell.appendChild(text);\n        }\n        return cell;\n    },\n\n    _generatePopupContent: function(calculator, categories)\n    {\n        var contentHelper = new WebInspector.TimelinePanel.PopupContentHelper(this.title);\n\n        if (this._children && this._children.length) {\n            contentHelper._appendTextRow(WebInspector.UIString(\"Self Time\"), Number.secondsToString(this._selfTime + 0.0001));\n            contentHelper._appendElementRow(WebInspector.UIString(\"Aggregated Time\"), this._generateAggregatedInfo());\n        }\n        var text = WebInspector.UIString(\"%s (at %s)\", Number.secondsToString(this._lastChildEndTime - this.startTime),\n            calculator.formatValue(this.startTime - calculator.minimumBoundary));\n        contentHelper._appendTextRow(WebInspector.UIString(\"Duration\"), text);\n\n        var recordTypes = WebInspector.TimelineAgent.RecordType;\n\n        switch (this.type) {\n            case recordTypes.GCEvent:\n                contentHelper._appendTextRow(WebInspector.UIString(\"Collected\"), Number.bytesToString(this.data.usedHeapSizeDelta));\n                break;\n            case recordTypes.TimerInstall:\n            case recordTypes.TimerFire:\n            case recordTypes.TimerRemove:\n                contentHelper._appendTextRow(WebInspector.UIString(\"Timer ID\"), this.data.timerId);\n                if (typeof this.timeout === \"number\") {\n                    contentHelper._appendTextRow(WebInspector.UIString(\"Timeout\"), Number.secondsToString(this.timeout / 1000));\n                    contentHelper._appendTextRow(WebInspector.UIString(\"Repeats\"), !this.singleShot);\n                }\n                break;\n            case recordTypes.FunctionCall:\n                contentHelper._appendLinkRow(WebInspector.UIString(\"Location\"), this.data.scriptName, this.data.scriptLine);\n                break;\n            case recordTypes.ScheduleResourceRequest:\n            case recordTypes.ResourceSendRequest:\n            case recordTypes.ResourceReceiveResponse:\n            case recordTypes.ResourceReceiveData:\n            case recordTypes.ResourceFinish:\n                contentHelper._appendLinkRow(WebInspector.UIString(\"Resource\"), this.data.url);\n                if (this.data.requestMethod)\n                    contentHelper._appendTextRow(WebInspector.UIString(\"Request Method\"), this.data.requestMethod);\n                if (typeof this.data.statusCode === \"number\")\n                    contentHelper._appendTextRow(WebInspector.UIString(\"Status Code\"), this.data.statusCode);\n                if (this.data.mimeType)\n                    contentHelper._appendTextRow(WebInspector.UIString(\"MIME Type\"), this.data.mimeType);\n                if (typeof this.data.expectedContentLength === \"number\" && this.data.expectedContentLength !== -1)\n                    contentHelper._appendTextRow(WebInspector.UIString(\"Expected Content Length\"), this.data.expectedContentLength);\n                break;\n            case recordTypes.EvaluateScript:\n                if (this.data && this.data.url)\n                    contentHelper._appendLinkRow(WebInspector.UIString(\"Script\"), this.data.url, this.data.lineNumber);\n                break;\n            case recordTypes.Paint:\n                contentHelper._appendTextRow(WebInspector.UIString(\"Location\"), WebInspector.UIString(\"(%d, %d)\", this.data.x, this.data.y));\n                contentHelper._appendTextRow(WebInspector.UIString(\"Dimensions\"), WebInspector.UIString(\"%d × %d\", this.data.width, this.data.height));\n            case recordTypes.RecalculateStyles: // We don't want to see default details.\n                break;\n            default:\n                if (this.details)\n                    contentHelper._appendTextRow(WebInspector.UIString(\"Details\"), this.details);\n                break;\n        }\n\n        if (this.data.scriptName && this.type !== recordTypes.FunctionCall)\n            contentHelper._appendLinkRow(WebInspector.UIString(\"Function Call\"), this.data.scriptName, this.data.scriptLine);\n\n        if (this.usedHeapSize)\n            contentHelper._appendTextRow(WebInspector.UIString(\"Used Heap Size\"), WebInspector.UIString(\"%s of %s\", Number.bytesToString(this.usedHeapSize), Number.bytesToString(this.totalHeapSize)));\n\n        if (this.callSiteStackTrace && this.callSiteStackTrace.length)\n            contentHelper._appendStackTrace(WebInspector.UIString(\"Call Site stack\"), this.callSiteStackTrace);\n\n        if (this.stackTrace)\n            contentHelper._appendStackTrace(WebInspector.UIString(\"Call Stack\"), this.stackTrace);\n\n        return contentHelper._contentTable;\n    },\n\n    _getRecordDetails: function(record, sendRequestRecords)\n    {\n        switch (record.type) {\n            case WebInspector.TimelineAgent.RecordType.GCEvent:\n                return WebInspector.UIString(\"%s collected\", Number.bytesToString(record.data.usedHeapSizeDelta));\n            case WebInspector.TimelineAgent.RecordType.TimerFire:\n                return record.data.scriptName ? WebInspector.linkifyResourceAsNode(record.data.scriptName, \"scripts\", record.data.scriptLine, \"\", \"\") : record.data.timerId;\n            case WebInspector.TimelineAgent.RecordType.FunctionCall:\n                return record.data.scriptName ? WebInspector.linkifyResourceAsNode(record.data.scriptName, \"scripts\", record.data.scriptLine, \"\", \"\") : null;\n            case WebInspector.TimelineAgent.RecordType.EventDispatch:\n                return record.data ? record.data.type : null;\n            case WebInspector.TimelineAgent.RecordType.Paint:\n                return record.data.width + \"\\u2009\\u00d7\\u2009\" + record.data.height;\n            case WebInspector.TimelineAgent.RecordType.TimerInstall:\n            case WebInspector.TimelineAgent.RecordType.TimerRemove:\n                return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].scriptName, \"scripts\", this.stackTrace[0].lineNumber, \"\", \"\") : record.data.timerId;\n            case WebInspector.TimelineAgent.RecordType.ParseHTML:\n            case WebInspector.TimelineAgent.RecordType.RecalculateStyles:\n                return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].scriptName, \"scripts\", this.stackTrace[0].lineNumber, \"\", \"\") : null;\n            case WebInspector.TimelineAgent.RecordType.EvaluateScript:\n                return record.data.url ? WebInspector.linkifyResourceAsNode(record.data.url, \"scripts\", record.data.lineNumber, \"\", \"\") : null;\n            case WebInspector.TimelineAgent.RecordType.XHRReadyStateChange:\n            case WebInspector.TimelineAgent.RecordType.XHRLoad:\n            case WebInspector.TimelineAgent.RecordType.ScheduleResourceRequest:\n            case WebInspector.TimelineAgent.RecordType.ResourceSendRequest:\n            case WebInspector.TimelineAgent.RecordType.ResourceReceiveData:\n            case WebInspector.TimelineAgent.RecordType.ResourceReceiveResponse:\n            case WebInspector.TimelineAgent.RecordType.ResourceFinish:\n                return WebInspector.displayNameForURL(record.data.url);\n            case WebInspector.TimelineAgent.RecordType.MarkTimeline:\n                return record.data.message;\n            default:\n                return null;\n        }\n    },\n\n    _calculateAggregatedStats: function(categories)\n    {\n        this._aggregatedStats = {};\n        for (var category in categories)\n            this._aggregatedStats[category] = 0;\n        this._cpuTime = this._selfTime;\n\n        if (this._children) {\n            for (var index = this._children.length; index; --index) {\n                var child = this._children[index - 1];\n                this._aggregatedStats[child.category.name] += child._selfTime;\n                for (var category in categories)\n                    this._aggregatedStats[category] += child._aggregatedStats[category];\n            }\n            for (var category in this._aggregatedStats)\n                this._cpuTime += this._aggregatedStats[category];\n        }\n    }\n}\n\nWebInspector.TimelinePanel.PopupContentHelper = function(title)\n{\n    this._contentTable = document.createElement(\"table\");;\n    var titleCell = this._createCell(WebInspector.UIString(\"%s - Details\", title), \"timeline-details-title\");\n    titleCell.colSpan = 2;\n    var titleRow = document.createElement(\"tr\");\n    titleRow.appendChild(titleCell);\n    this._contentTable.appendChild(titleRow);\n}\n\nWebInspector.TimelinePanel.PopupContentHelper.prototype = {\n    _createCell: function(content, styleName)\n    {\n        var text = document.createElement(\"label\");\n        text.appendChild(document.createTextNode(content));\n        var cell = document.createElement(\"td\");\n        cell.className = \"timeline-details\";\n        if (styleName)\n            cell.className += \" \" + styleName;\n        cell.textContent = content;\n        return cell;\n    },\n\n    _appendTextRow: function(title, content)\n    {\n        var row = document.createElement(\"tr\");\n        row.appendChild(this._createCell(title, \"timeline-details-row-title\"));\n        row.appendChild(this._createCell(content, \"timeline-details-row-data\"));\n        this._contentTable.appendChild(row);\n    },\n\n    _appendElementRow: function(title, content, titleStyle)\n    {\n        var row = document.createElement(\"tr\");\n        var titleCell = this._createCell(title, \"timeline-details-row-title\");\n        if (titleStyle)\n            titleCell.addStyleClass(titleStyle);\n        row.appendChild(titleCell);\n        var cell = document.createElement(\"td\");\n        cell.className = \"timeline-details\";\n        cell.appendChild(content);\n        row.appendChild(cell);\n        this._contentTable.appendChild(row);\n    },\n\n    _appendLinkRow: function(title, scriptName, scriptLine)\n    {\n        var link = WebInspector.linkifyResourceAsNode(scriptName, \"scripts\", scriptLine, \"timeline-details\");\n        this._appendElementRow(title, link);\n    },\n\n    _appendStackTrace: function(title, stackTrace)\n    {\n        this._appendTextRow(\"\", \"\");\n        var framesTable = document.createElement(\"table\");\n        for (var i = 0; i < stackTrace.length; ++i) {\n            var stackFrame = stackTrace[i];\n            var row = document.createElement(\"tr\");\n            row.className = \"timeline-details\";\n            row.appendChild(this._createCell(stackFrame.functionName ? stackFrame.functionName : WebInspector.UIString(\"(anonymous function)\"), \"timeline-function-name\"));\n            row.appendChild(this._createCell(\" @ \"));\n            var linkCell = document.createElement(\"td\");\n            linkCell.appendChild(WebInspector.linkifyResourceAsNode(stackFrame.scriptName, \"scripts\", stackFrame.lineNumber, \"timeline-details\"));\n            row.appendChild(linkCell);\n            framesTable.appendChild(row);\n        }\n        this._appendElementRow(title, framesTable, \"timeline-stacktrace-title\");\n    }\n}\n\nWebInspector.TimelineExpandableElement = function(container)\n{\n    this._element = document.createElement(\"div\");\n    this._element.className = \"timeline-expandable\";\n\n    var leftBorder = document.createElement(\"div\");\n    leftBorder.className = \"timeline-expandable-left\";\n    this._element.appendChild(leftBorder);\n\n    container.appendChild(this._element);\n}\n\nWebInspector.TimelineExpandableElement.prototype = {\n    _update: function(record, index, barPosition)\n    {\n        var rowHeight = WebInspector.TimelinePanel.rowHeight;\n        if (record._visibleChildrenCount || record._invisibleChildrenCount) {\n            this._element.style.top = index * rowHeight + \"px\";\n            this._element.style.left = barPosition.left + \"px\";\n            this._element.style.width = Math.max(12, barPosition.width + 25) + \"px\";\n            if (!record.collapsed) {\n                this._element.style.height = (record._visibleChildrenCount + 1) * rowHeight + \"px\";\n                this._element.addStyleClass(\"timeline-expandable-expanded\");\n                this._element.removeStyleClass(\"timeline-expandable-collapsed\");\n            } else {\n                this._element.style.height = rowHeight + \"px\";\n                this._element.addStyleClass(\"timeline-expandable-collapsed\");\n                this._element.removeStyleClass(\"timeline-expandable-expanded\");\n            }\n            this._element.removeStyleClass(\"hidden\");\n        } else\n            this._element.addStyleClass(\"hidden\");\n    },\n\n    _dispose: function()\n    {\n        this._element.parentElement.removeChild(this._element);\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/TopDownProfileDataGridTree.js",
    "content": "/*\n * Copyright (C) 2009 280 North Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.TopDownProfileDataGridNode = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode, /*TopDownProfileDataGridTree*/ owningTree)\n{\n    var hasChildren = (profileNode.children && profileNode.children.length);\n\n    WebInspector.ProfileDataGridNode.call(this, profileView, profileNode, owningTree, hasChildren);\n\n    this._remainingChildren = profileNode.children;\n}\n\nWebInspector.TopDownProfileDataGridNode.prototype = {\n    _sharedPopulate: function()\n    {\n        var children = this._remainingChildren;\n        var childrenLength = children.length;\n\n        for (var i = 0; i < childrenLength; ++i)\n            this.appendChild(new WebInspector.TopDownProfileDataGridNode(this.profileView, children[i], this.tree));\n\n        this._remainingChildren = null;\n    },\n\n    _exclude: function(aCallUID)\n    {\n        if (this._remainingChildren)\n            this._populate();\n\n        this._save();\n\n        var children = this.children;\n        var index = this.children.length;\n\n        while (index--)\n            children[index]._exclude(aCallUID);\n\n        var child = this.childrenByCallUID[aCallUID];\n\n        if (child)\n            this._merge(child, true);\n    }\n}\n\nWebInspector.TopDownProfileDataGridNode.prototype.__proto__ = WebInspector.ProfileDataGridNode.prototype;\n\nWebInspector.TopDownProfileDataGridTree = function(/*ProfileView*/ profileView, /*ProfileNode*/ profileNode)\n{\n    WebInspector.ProfileDataGridTree.call(this, profileView, profileNode);\n\n    this._remainingChildren = profileNode.children;\n\n    WebInspector.TopDownProfileDataGridNode.prototype._populate.call(this);\n}\n\nWebInspector.TopDownProfileDataGridTree.prototype = {\n    focus: function(/*ProfileDataGridNode*/ profileDataGrideNode)\n    {\n        if (!profileDataGrideNode)\n            return;\n\n        this._save();\n        profileDataGrideNode.savePosition();\n\n        this.children = [profileDataGrideNode];\n        this.totalTime = profileDataGrideNode.totalTime;\n    },\n\n    exclude: function(/*ProfileDataGridNode*/ profileDataGrideNode)\n    {\n        if (!profileDataGrideNode)\n            return;\n\n        this._save();\n\n        var excludedCallUID = profileDataGrideNode.callUID;\n\n        WebInspector.TopDownProfileDataGridNode.prototype._exclude.call(this, excludedCallUID);\n\n        if (this.lastComparator)\n            this.sort(this.lastComparator, true);\n    },\n\n    restore: function()\n    {\n        if (!this._savedChildren)\n            return;\n\n        this.children[0].restorePosition();\n\n        WebInspector.ProfileDataGridTree.prototype.restore.call(this);\n    },\n\n    _merge: WebInspector.TopDownProfileDataGridNode.prototype._merge,\n\n    _sharedPopulate: WebInspector.TopDownProfileDataGridNode.prototype._sharedPopulate\n}\n\nWebInspector.TopDownProfileDataGridTree.prototype.__proto__ = WebInspector.ProfileDataGridTree.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/UglifyJS/parse-js.js",
    "content": "/***********************************************************************\n\n  A JavaScript tokenizer / parser / beautifier / compressor.\n\n  This version is suitable for Node.js.  With minimal changes (the\n  exports stuff) it should work on any JS platform.\n\n  This file contains the tokenizer/parser.  It is a port to JavaScript\n  of parse-js [1], a JavaScript parser library written in Common Lisp\n  by Marijn Haverbeke.  Thank you Marijn!\n\n  [1] http://marijn.haverbeke.nl/parse-js/\n\n  Exported functions:\n\n    - tokenizer(code) -- returns a function.  Call the returned\n      function to fetch the next token.\n\n    - parse(code) -- returns an AST of the given JavaScript code.\n\n  -------------------------------- (C) ---------------------------------\n\n                           Author: Mihai Bazon\n                         <mihai.bazon@gmail.com>\n                       http://mihai.bazon.net/blog\n\n  Distributed under the BSD license:\n\n    Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\n    Based on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\n    Redistribution and use in source and binary forms, with or without\n    modification, are permitted provided that the following conditions\n    are met:\n\n        * Redistributions of source code must retain the above\n          copyright notice, this list of conditions and the following\n          disclaimer.\n\n        * Redistributions in binary form must reproduce the above\n          copyright notice, this list of conditions and the following\n          disclaimer in the documentation and/or other materials\n          provided with the distribution.\n\n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n    SUCH DAMAGE.\n\n ***********************************************************************/\n\n/* -----[ Tokenizer (constants) ]----- */\n\nvar KEYWORDS = array_to_hash([\n        \"break\",\n        \"case\",\n        \"catch\",\n        \"const\",\n        \"continue\",\n        \"default\",\n        \"delete\",\n        \"do\",\n        \"else\",\n        \"finally\",\n        \"for\",\n        \"function\",\n        \"if\",\n        \"in\",\n        \"instanceof\",\n        \"new\",\n        \"return\",\n        \"switch\",\n        \"throw\",\n        \"try\",\n        \"typeof\",\n        \"var\",\n        \"void\",\n        \"while\",\n        \"with\"\n]);\n\nvar RESERVED_WORDS = array_to_hash([\n        \"abstract\",\n        \"boolean\",\n        \"byte\",\n        \"char\",\n        \"class\",\n        \"debugger\",\n        \"double\",\n        \"enum\",\n        \"export\",\n        \"extends\",\n        \"final\",\n        \"float\",\n        \"goto\",\n        \"implements\",\n        \"import\",\n        \"int\",\n        \"interface\",\n        \"long\",\n        \"native\",\n        \"package\",\n        \"private\",\n        \"protected\",\n        \"public\",\n        \"short\",\n        \"static\",\n        \"super\",\n        \"synchronized\",\n        \"throws\",\n        \"transient\",\n        \"volatile\"\n]);\n\nvar KEYWORDS_BEFORE_EXPRESSION = array_to_hash([\n        \"return\",\n        \"new\",\n        \"delete\",\n        \"throw\",\n        \"else\",\n        \"case\"\n]);\n\nvar KEYWORDS_ATOM = array_to_hash([\n        \"false\",\n        \"null\",\n        \"true\",\n        \"undefined\"\n]);\n\nvar OPERATOR_CHARS = array_to_hash(characters(\"+-*&%=<>!?|~^\"));\n\nvar RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;\nvar RE_OCT_NUMBER = /^0[0-7]+$/;\nvar RE_DEC_NUMBER = /^\\d*\\.?\\d*(?:e[+-]?\\d*(?:\\d\\.?|\\.?\\d)\\d*)?$/i;\n\nvar OPERATORS = array_to_hash([\n        \"in\",\n        \"instanceof\",\n        \"typeof\",\n        \"new\",\n        \"void\",\n        \"delete\",\n        \"++\",\n        \"--\",\n        \"+\",\n        \"-\",\n        \"!\",\n        \"~\",\n        \"&\",\n        \"|\",\n        \"^\",\n        \"*\",\n        \"/\",\n        \"%\",\n        \">>\",\n        \"<<\",\n        \">>>\",\n        \"<\",\n        \">\",\n        \"<=\",\n        \">=\",\n        \"==\",\n        \"===\",\n        \"!=\",\n        \"!==\",\n        \"?\",\n        \"=\",\n        \"+=\",\n        \"-=\",\n        \"/=\",\n        \"*=\",\n        \"%=\",\n        \">>=\",\n        \"<<=\",\n        \">>>=\",\n        \"%=\",\n        \"|=\",\n        \"^=\",\n        \"&=\",\n        \"&&\",\n        \"||\"\n]);\n\nvar WHITESPACE_CHARS = array_to_hash(characters(\" \\n\\r\\t\"));\n\nvar PUNC_BEFORE_EXPRESSION = array_to_hash(characters(\"[{}(,.;:\"));\n\nvar PUNC_CHARS = array_to_hash(characters(\"[]{}(),;:\"));\n\nvar REGEXP_MODIFIERS = array_to_hash(characters(\"gmsiy\"));\n\n/* -----[ Tokenizer ]----- */\n\nfunction is_alphanumeric_char(ch) {\n        ch = ch.charCodeAt(0);\n        return (ch >= 48 && ch <= 57) ||\n                (ch >= 65 && ch <= 90) ||\n                (ch >= 97 && ch <= 122);\n};\n\nfunction is_identifier_char(ch) {\n        return is_alphanumeric_char(ch) || ch == \"$\" || ch == \"_\";\n};\n\nfunction is_digit(ch) {\n        ch = ch.charCodeAt(0);\n        return ch >= 48 && ch <= 57;\n};\n\nfunction parse_js_number(num) {\n        if (RE_HEX_NUMBER.test(num)) {\n                return parseInt(num.substr(2), 16);\n        } else if (RE_OCT_NUMBER.test(num)) {\n                return parseInt(num.substr(1), 8);\n        } else if (RE_DEC_NUMBER.test(num)) {\n                return parseFloat(num);\n        }\n};\n\nfunction JS_Parse_Error(message, line, col, pos) {\n        this.message = message;\n        this.line = line;\n        this.col = col;\n        this.pos = pos;\n        try {\n                ({})();\n        } catch(ex) {\n                this.stack = ex.stack;\n        };\n};\n\nJS_Parse_Error.prototype.toString = function() {\n        return this.message + \" (line: \" + this.line + \", col: \" + this.col + \", pos: \" + this.pos + \")\" + \"\\n\\n\" + this.stack;\n};\n\nfunction js_error(message, line, col, pos) {\n        throw new JS_Parse_Error(message, line, col, pos);\n};\n\nfunction is_token(token, type, val) {\n        return token.type == type && (val == null || token.value == val);\n};\n\nvar EX_EOF = {};\n\nfunction tokenizer($TEXT) {\n\n        var S = {\n                text            : $TEXT.replace(/\\r\\n?|[\\n\\u2028\\u2029]/g, \"\\n\").replace(/^\\uFEFF/, ''),\n                pos             : 0,\n                tokpos          : 0,\n                line            : 0,\n                tokline         : 0,\n                col             : 0,\n                tokcol          : 0,\n                newline_before  : false,\n                regex_allowed   : false,\n                comments_before : []\n        };\n\n        function peek() { return S.text.charAt(S.pos); };\n\n        function next(signal_eof) {\n                var ch = S.text.charAt(S.pos++);\n                if (signal_eof && !ch)\n                        throw EX_EOF;\n                if (ch == \"\\n\") {\n                        S.newline_before = true;\n                        ++S.line;\n                        S.col = 0;\n                } else {\n                        ++S.col;\n                }\n                return ch;\n        };\n\n        function eof() {\n                return !S.peek();\n        };\n\n        function find(what, signal_eof) {\n                var pos = S.text.indexOf(what, S.pos);\n                if (signal_eof && pos == -1) throw EX_EOF;\n                return pos;\n        };\n\n        function start_token() {\n                S.tokline = S.line;\n                S.tokcol = S.col;\n                S.tokpos = S.pos;\n        };\n\n        function token(type, value, is_comment) {\n                S.regex_allowed = ((type == \"operator\" && !HOP(UNARY_POSTFIX, value)) ||\n                                   (type == \"keyword\" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) ||\n                                   (type == \"punc\" && HOP(PUNC_BEFORE_EXPRESSION, value)));\n                var ret = {\n                        type  : type,\n                        value : value,\n                        line  : S.tokline,\n                        col   : S.tokcol,\n                        pos   : S.tokpos,\n                        nlb   : S.newline_before\n                };\n                if (!is_comment) {\n                        ret.comments_before = S.comments_before;\n                        S.comments_before = [];\n                }\n                S.newline_before = false;\n                return ret;\n        };\n\n        function skip_whitespace() {\n                while (HOP(WHITESPACE_CHARS, peek()))\n                        next();\n        };\n\n        function read_while(pred) {\n                var ret = \"\", ch = peek(), i = 0;\n                while (ch && pred(ch, i++)) {\n                        ret += next();\n                        ch = peek();\n                }\n                return ret;\n        };\n\n        function parse_error(err) {\n                js_error(err, S.tokline, S.tokcol, S.tokpos);\n        };\n\n        function read_num(prefix) {\n                var has_e = false, after_e = false, has_x = false, has_dot = prefix == \".\";\n                var num = read_while(function(ch, i){\n                        if (ch == \"x\" || ch == \"X\") {\n                                if (has_x) return false;\n                                return has_x = true;\n                        }\n                        if (!has_x && (ch == \"E\" || ch == \"e\")) {\n                                if (has_e) return false;\n                                return has_e = after_e = true;\n                        }\n                        if (ch == \"-\") {\n                                if (after_e || (i == 0 && !prefix)) return true;\n                                return false;\n                        }\n                        if (ch == \"+\") return after_e;\n                        after_e = false;\n                        if (ch == \".\") {\n                                if (!has_dot)\n                                        return has_dot = true;\n                                return false;\n                        }\n                        return is_alphanumeric_char(ch);\n                });\n                if (prefix)\n                        num = prefix + num;\n                var valid = parse_js_number(num);\n                if (!isNaN(valid)) {\n                        return token(\"num\", valid);\n                } else {\n                        parse_error(\"Invalid syntax: \" + num);\n                }\n        };\n\n        function read_escaped_char() {\n                var ch = next(true);\n                switch (ch) {\n                    case \"n\" : return \"\\n\";\n                    case \"r\" : return \"\\r\";\n                    case \"t\" : return \"\\t\";\n                    case \"b\" : return \"\\b\";\n                    case \"v\" : return \"\\v\";\n                    case \"f\" : return \"\\f\";\n                    case \"0\" : return \"\\0\";\n                    case \"x\" : return String.fromCharCode(hex_bytes(2));\n                    case \"u\" : return String.fromCharCode(hex_bytes(4));\n                    default  : return ch;\n                }\n        };\n\n        function hex_bytes(n) {\n                var num = 0;\n                for (; n > 0; --n) {\n                        var digit = parseInt(next(true), 16);\n                        if (isNaN(digit))\n                                parse_error(\"Invalid hex-character pattern in string\");\n                        num = (num << 4) | digit;\n                }\n                return num;\n        };\n\n        function read_string() {\n                return with_eof_error(\"Unterminated string constant\", function(){\n                        var quote = next(), ret = \"\";\n                        for (;;) {\n                                var ch = next(true);\n                                if (ch == \"\\\\\") ch = read_escaped_char();\n                                else if (ch == quote) break;\n                                ret += ch;\n                        }\n                        return token(\"string\", ret);\n                });\n        };\n\n        function read_line_comment() {\n                next();\n                var i = find(\"\\n\"), ret;\n                if (i == -1) {\n                        ret = S.text.substr(S.pos);\n                        S.pos = S.text.length;\n                } else {\n                        ret = S.text.substring(S.pos, i);\n                        S.pos = i;\n                }\n                return token(\"comment1\", ret, true);\n        };\n\n        function read_multiline_comment() {\n                next();\n                return with_eof_error(\"Unterminated multiline comment\", function(){\n                        var i = find(\"*/\", true),\n                            text = S.text.substring(S.pos, i),\n                            tok = token(\"comment2\", text, true);\n                        S.pos = i + 2;\n                        S.line += text.split(\"\\n\").length - 1;\n                        S.newline_before = text.indexOf(\"\\n\") >= 0;\n                        return tok;\n                });\n        };\n\n        function read_regexp() {\n                return with_eof_error(\"Unterminated regular expression\", function(){\n                        var prev_backslash = false, regexp = \"\", ch, in_class = false;\n                        while ((ch = next(true))) if (prev_backslash) {\n                                regexp += \"\\\\\" + ch;\n                                prev_backslash = false;\n                        } else if (ch == \"[\") {\n                                in_class = true;\n                                regexp += ch;\n                        } else if (ch == \"]\" && in_class) {\n                                in_class = false;\n                                regexp += ch;\n                        } else if (ch == \"/\" && !in_class) {\n                                break;\n                        } else if (ch == \"\\\\\") {\n                                prev_backslash = true;\n                        } else {\n                                regexp += ch;\n                        }\n                        var mods = read_while(function(ch){\n                                return HOP(REGEXP_MODIFIERS, ch);\n                        });\n                        return token(\"regexp\", [ regexp, mods ]);\n                });\n        };\n\n        function read_operator(prefix) {\n                function grow(op) {\n                        if (!peek()) return op;\n                        var bigger = op + peek();\n                        if (HOP(OPERATORS, bigger)) {\n                                next();\n                                return grow(bigger);\n                        } else {\n                                return op;\n                        }\n                };\n                return token(\"operator\", grow(prefix || next()));\n        };\n\n        function handle_slash() {\n                next();\n                var regex_allowed = S.regex_allowed;\n                switch (peek()) {\n                    case \"/\":\n                        S.comments_before.push(read_line_comment());\n                        S.regex_allowed = regex_allowed;\n                        return next_token();\n                    case \"*\":\n                        S.comments_before.push(read_multiline_comment());\n                        S.regex_allowed = regex_allowed;\n                        return next_token();\n                }\n                return S.regex_allowed ? read_regexp() : read_operator(\"/\");\n        };\n\n        function handle_dot() {\n                next();\n                return is_digit(peek())\n                        ? read_num(\".\")\n                        : token(\"punc\", \".\");\n        };\n\n        function read_word() {\n                var word = read_while(is_identifier_char);\n                return !HOP(KEYWORDS, word)\n                        ? token(\"name\", word)\n                        : HOP(OPERATORS, word)\n                        ? token(\"operator\", word)\n                        : HOP(KEYWORDS_ATOM, word)\n                        ? token(\"atom\", word)\n                        : token(\"keyword\", word);\n        };\n\n        function with_eof_error(eof_error, cont) {\n                try {\n                        return cont();\n                } catch(ex) {\n                        if (ex === EX_EOF) parse_error(eof_error);\n                        else throw ex;\n                }\n        };\n\n        function next_token(force_regexp) {\n                if (force_regexp)\n                        return read_regexp();\n                skip_whitespace();\n                start_token();\n                var ch = peek();\n                if (!ch) return token(\"eof\");\n                if (is_digit(ch)) return read_num();\n                if (ch == '\"' || ch == \"'\") return read_string();\n                if (HOP(PUNC_CHARS, ch)) return token(\"punc\", next());\n                if (ch == \".\") return handle_dot();\n                if (ch == \"/\") return handle_slash();\n                if (HOP(OPERATOR_CHARS, ch)) return read_operator();\n                if (is_identifier_char(ch)) return read_word();\n                parse_error(\"Unexpected character '\" + ch + \"'\");\n        };\n\n        next_token.context = function(nc) {\n                if (nc) S = nc;\n                return S;\n        };\n\n        return next_token;\n\n};\n\n/* -----[ Parser (constants) ]----- */\n\nvar UNARY_PREFIX = array_to_hash([\n        \"typeof\",\n        \"void\",\n        \"delete\",\n        \"--\",\n        \"++\",\n        \"!\",\n        \"~\",\n        \"-\",\n        \"+\"\n]);\n\nvar UNARY_POSTFIX = array_to_hash([ \"--\", \"++\" ]);\n\nvar ASSIGNMENT = (function(a, ret, i){\n        while (i < a.length) {\n                ret[a[i]] = a[i].substr(0, a[i].length - 1);\n                i++;\n        }\n        return ret;\n})(\n        [\"+=\", \"-=\", \"/=\", \"*=\", \"%=\", \">>=\", \"<<=\", \">>>=\", \"|=\", \"^=\", \"&=\"],\n        { \"=\": true },\n        0\n);\n\nvar PRECEDENCE = (function(a, ret){\n        for (var i = 0, n = 1; i < a.length; ++i, ++n) {\n                var b = a[i];\n                for (var j = 0; j < b.length; ++j) {\n                        ret[b[j]] = n;\n                }\n        }\n        return ret;\n})(\n        [\n                [\"||\"],\n                [\"&&\"],\n                [\"|\"],\n                [\"^\"],\n                [\"&\"],\n                [\"==\", \"===\", \"!=\", \"!==\"],\n                [\"<\", \">\", \"<=\", \">=\", \"in\", \"instanceof\"],\n                [\">>\", \"<<\", \">>>\"],\n                [\"+\", \"-\"],\n                [\"*\", \"/\", \"%\"]\n        ],\n        {}\n);\n\nvar STATEMENTS_WITH_LABELS = array_to_hash([ \"for\", \"do\", \"while\", \"switch\" ]);\n\nvar ATOMIC_START_TOKEN = array_to_hash([ \"atom\", \"num\", \"string\", \"regexp\", \"name\" ]);\n\n/* -----[ Parser ]----- */\n\nfunction NodeWithToken(str, start, end) {\n        this.name = str;\n        this.start = start;\n        this.end = end;\n};\n\nNodeWithToken.prototype.toString = function() { return this.name; };\n\nfunction parse($TEXT, strict_mode, embed_tokens) {\n\n        var S = {\n                input       : typeof $TEXT == \"string\" ? tokenizer($TEXT, true) : $TEXT,\n                token       : null,\n                prev        : null,\n                peeked      : null,\n                in_function : 0,\n                in_loop     : 0,\n                labels      : []\n        };\n\n        S.token = next();\n\n        function is(type, value) {\n                return is_token(S.token, type, value);\n        };\n\n        function peek() { return S.peeked || (S.peeked = S.input()); };\n\n        function next() {\n                S.prev = S.token;\n                if (S.peeked) {\n                        S.token = S.peeked;\n                        S.peeked = null;\n                } else {\n                        S.token = S.input();\n                }\n                return S.token;\n        };\n\n        function prev() {\n                return S.prev;\n        };\n\n        function croak(msg, line, col, pos) {\n                var ctx = S.input.context();\n                js_error(msg,\n                         line != null ? line : ctx.tokline,\n                         col != null ? col : ctx.tokcol,\n                         pos != null ? pos : ctx.tokpos);\n        };\n\n        function token_error(token, msg) {\n                croak(msg, token.line, token.col);\n        };\n\n        function unexpected(token) {\n                if (token == null)\n                        token = S.token;\n                token_error(token, \"Unexpected token: \" + token.type + \" (\" + token.value + \")\");\n        };\n\n        function expect_token(type, val) {\n                if (is(type, val)) {\n                        return next();\n                }\n                token_error(S.token, \"Unexpected token \" + S.token.type + \", expected \" + type);\n        };\n\n        function expect(punc) { return expect_token(\"punc\", punc); };\n\n        function can_insert_semicolon() {\n                return !strict_mode && (\n                        S.token.nlb || is(\"eof\") || is(\"punc\", \"}\")\n                );\n        };\n\n        function semicolon() {\n                if (is(\"punc\", \";\")) next();\n                else if (!can_insert_semicolon()) unexpected();\n        };\n\n        function as() {\n                return slice(arguments);\n        };\n\n        function parenthesised() {\n                expect(\"(\");\n                var ex = expression();\n                expect(\")\");\n                return ex;\n        };\n\n        function add_tokens(str, start, end) {\n                return new NodeWithToken(str, start, end);\n        };\n\n        var statement = embed_tokens ? function() {\n                var start = S.token;\n                var stmt = $statement();\n                stmt[0] = add_tokens(stmt[0], start, prev());\n                return stmt;\n        } : $statement;\n\n        function $statement() {\n                if (is(\"operator\", \"/\")) {\n                        S.peeked = null;\n                        S.token = S.input(true); // force regexp\n                }\n                switch (S.token.type) {\n                    case \"num\":\n                    case \"string\":\n                    case \"regexp\":\n                    case \"operator\":\n                    case \"atom\":\n                        return simple_statement();\n\n                    case \"name\":\n                        return is_token(peek(), \"punc\", \":\")\n                                ? labeled_statement(prog1(S.token.value, next, next))\n                                : simple_statement();\n\n                    case \"punc\":\n                        switch (S.token.value) {\n                            case \"{\":\n                                return as(\"block\", block_());\n                            case \"[\":\n                            case \"(\":\n                                return simple_statement();\n                            case \";\":\n                                next();\n                                return as(\"block\");\n                            default:\n                                unexpected();\n                        }\n\n                    case \"keyword\":\n                        switch (prog1(S.token.value, next)) {\n                            case \"break\":\n                                return break_cont(\"break\");\n\n                            case \"continue\":\n                                return break_cont(\"continue\");\n\n                            case \"debugger\":\n                                semicolon();\n                                return as(\"debugger\");\n\n                            case \"do\":\n                                return (function(body){\n                                        expect_token(\"keyword\", \"while\");\n                                        return as(\"do\", prog1(parenthesised, semicolon), body);\n                                })(in_loop(statement));\n\n                            case \"for\":\n                                return for_();\n\n                            case \"function\":\n                                return function_(true);\n\n                            case \"if\":\n                                return if_();\n\n                            case \"return\":\n                                if (S.in_function == 0)\n                                        croak(\"'return' outside of function\");\n                                return as(\"return\",\n                                          is(\"punc\", \";\")\n                                          ? (next(), null)\n                                          : can_insert_semicolon()\n                                          ? null\n                                          : prog1(expression, semicolon));\n\n                            case \"switch\":\n                                return as(\"switch\", parenthesised(), switch_block_());\n\n                            case \"throw\":\n                                return as(\"throw\", prog1(expression, semicolon));\n\n                            case \"try\":\n                                return try_();\n\n                            case \"var\":\n                                return prog1(var_, semicolon);\n\n                            case \"const\":\n                                return prog1(const_, semicolon);\n\n                            case \"while\":\n                                return as(\"while\", parenthesised(), in_loop(statement));\n\n                            case \"with\":\n                                return as(\"with\", parenthesised(), statement());\n\n                            default:\n                                unexpected();\n                        }\n                }\n        };\n\n        function labeled_statement(label) {\n                S.labels.push(label);\n                var start = S.token, stat = statement();\n                if (strict_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0]))\n                        unexpected(start);\n                S.labels.pop();\n                return as(\"label\", label, stat);\n        };\n\n        function simple_statement() {\n                return as(\"stat\", prog1(expression, semicolon));\n        };\n\n        function break_cont(type) {\n                var name = is(\"name\") ? S.token.value : null;\n                if (name != null) {\n                        next();\n                        if (!member(name, S.labels))\n                                croak(\"Label \" + name + \" without matching loop or statement\");\n                }\n                else if (S.in_loop == 0)\n                        croak(type + \" not inside a loop or switch\");\n                semicolon();\n                return as(type, name);\n        };\n\n        function for_() {\n                expect(\"(\");\n                var has_var = is(\"keyword\", \"var\");\n                if (has_var)\n                        next();\n                if (is(\"name\") && is_token(peek(), \"operator\", \"in\")) {\n                        // for (i in foo)\n                        var name = S.token.value;\n                        next(); next();\n                        var obj = expression();\n                        expect(\")\");\n                        return as(\"for-in\", has_var, name, obj, in_loop(statement));\n                } else {\n                        // classic for\n                        var init = is(\"punc\", \";\") ? null : has_var ? var_() : expression();\n                        expect(\";\");\n                        var test = is(\"punc\", \";\") ? null : expression();\n                        expect(\";\");\n                        var step = is(\"punc\", \")\") ? null : expression();\n                        expect(\")\");\n                        return as(\"for\", init, test, step, in_loop(statement));\n                }\n        };\n\n        function function_(in_statement) {\n                var name = is(\"name\") ? prog1(S.token.value, next) : null;\n                if (in_statement && !name)\n                        unexpected();\n                expect(\"(\");\n                return as(in_statement ? \"defun\" : \"function\",\n                          name,\n                          // arguments\n                          (function(first, a){\n                                  while (!is(\"punc\", \")\")) {\n                                          if (first) first = false; else expect(\",\");\n                                          if (!is(\"name\")) unexpected();\n                                          a.push(S.token.value);\n                                          next();\n                                  }\n                                  next();\n                                  return a;\n                          })(true, []),\n                          // body\n                          (function(){\n                                  ++S.in_function;\n                                  var loop = S.in_loop;\n                                  S.in_loop = 0;\n                                  var a = block_();\n                                  --S.in_function;\n                                  S.in_loop = loop;\n                                  return a;\n                          })());\n        };\n\n        function if_() {\n                var cond = parenthesised(), body = statement(), belse;\n                if (is(\"keyword\", \"else\")) {\n                        next();\n                        belse = statement();\n                }\n                return as(\"if\", cond, body, belse);\n        };\n\n        function block_() {\n                expect(\"{\");\n                var a = [];\n                while (!is(\"punc\", \"}\")) {\n                        if (is(\"eof\")) unexpected();\n                        a.push(statement());\n                }\n                next();\n                return a;\n        };\n\n        var switch_block_ = curry(in_loop, function(){\n                expect(\"{\");\n                var a = [], cur = null;\n                while (!is(\"punc\", \"}\")) {\n                        if (is(\"eof\")) unexpected();\n                        if (is(\"keyword\", \"case\")) {\n                                next();\n                                cur = [];\n                                a.push([ expression(), cur ]);\n                                expect(\":\");\n                        }\n                        else if (is(\"keyword\", \"default\")) {\n                                next();\n                                expect(\":\");\n                                cur = [];\n                                a.push([ null, cur ]);\n                        }\n                        else {\n                                if (!cur) unexpected();\n                                cur.push(statement());\n                        }\n                }\n                next();\n                return a;\n        });\n\n        function try_() {\n                var body = block_(), bcatch, bfinally;\n                if (is(\"keyword\", \"catch\")) {\n                        next();\n                        expect(\"(\");\n                        if (!is(\"name\"))\n                                croak(\"Name expected\");\n                        var name = S.token.value;\n                        next();\n                        expect(\")\");\n                        bcatch = [ name, block_() ];\n                }\n                if (is(\"keyword\", \"finally\")) {\n                        next();\n                        bfinally = block_();\n                }\n                if (!bcatch && !bfinally)\n                        croak(\"Missing catch/finally blocks\");\n                return as(\"try\", body, bcatch, bfinally);\n        };\n\n        function vardefs() {\n                var a = [];\n                for (;;) {\n                        if (!is(\"name\"))\n                                unexpected();\n                        var name = S.token.value;\n                        next();\n                        if (is(\"operator\", \"=\")) {\n                                next();\n                                a.push([ name, expression(false) ]);\n                        } else {\n                                a.push([ name ]);\n                        }\n                        if (!is(\"punc\", \",\"))\n                                break;\n                        next();\n                }\n                return a;\n        };\n\n        function var_() {\n                return as(\"var\", vardefs());\n        };\n\n        function const_() {\n                return as(\"const\", vardefs());\n        };\n\n        function new_() {\n                var newexp = expr_atom(false), args;\n                if (is(\"punc\", \"(\")) {\n                        next();\n                        args = expr_list(\")\");\n                } else {\n                        args = [];\n                }\n                return subscripts(as(\"new\", newexp, args), true);\n        };\n\n        function expr_atom(allow_calls) {\n                if (is(\"operator\", \"new\")) {\n                        next();\n                        return new_();\n                }\n                if (is(\"operator\") && HOP(UNARY_PREFIX, S.token.value)) {\n                        return make_unary(\"unary-prefix\",\n                                          prog1(S.token.value, next),\n                                          expr_atom(allow_calls));\n                }\n                if (is(\"punc\")) {\n                        switch (S.token.value) {\n                            case \"(\":\n                                next();\n                                return subscripts(prog1(expression, curry(expect, \")\")), allow_calls);\n                            case \"[\":\n                                next();\n                                return subscripts(array_(), allow_calls);\n                            case \"{\":\n                                next();\n                                return subscripts(object_(), allow_calls);\n                        }\n                        unexpected();\n                }\n                if (is(\"keyword\", \"function\")) {\n                        next();\n                        return subscripts(function_(false), allow_calls);\n                }\n                if (HOP(ATOMIC_START_TOKEN, S.token.type)) {\n                        var atom = S.token.type == \"regexp\"\n                                ? as(\"regexp\", S.token.value[0], S.token.value[1])\n                                : as(S.token.type, S.token.value);\n                        return subscripts(prog1(atom, next), allow_calls);\n                }\n                unexpected();\n        };\n\n        function expr_list(closing, allow_trailing_comma, allow_empty) {\n                var first = true, a = [];\n                while (!is(\"punc\", closing)) {\n                        if (first) first = false; else expect(\",\");\n                        if (allow_trailing_comma && is(\"punc\", closing)) break;\n                        if (is(\"punc\", \",\") && allow_empty) {\n                                a.push([ \"atom\", \"undefined\" ]);\n                        } else {\n                                a.push(expression(false));\n                        }\n                }\n                next();\n                return a;\n        };\n\n        function array_() {\n                return as(\"array\", expr_list(\"]\", !strict_mode, true));\n        };\n\n        function object_() {\n                var first = true, a = [];\n                while (!is(\"punc\", \"}\")) {\n                        if (first) first = false; else expect(\",\");\n                        if (!strict_mode && is(\"punc\", \"}\"))\n                                // allow trailing comma\n                                break;\n                        var type = S.token.type;\n                        var name = as_property_name();\n                        if (type == \"name\" && (name == \"get\" || name == \"set\") && !is(\"punc\", \":\")) {\n                                a.push([ as_name(), function_(false), name ]);\n                        } else {\n                                expect(\":\");\n                                a.push([ name, expression(false) ]);\n                        }\n                }\n                next();\n                return as(\"object\", a);\n        };\n\n        function as_property_name() {\n                switch (S.token.type) {\n                    case \"num\":\n                    case \"string\":\n                        return prog1(S.token.value, next);\n                }\n                return as_name();\n        };\n\n        function as_name() {\n                switch (S.token.type) {\n                    case \"name\":\n                    case \"operator\":\n                    case \"keyword\":\n                    case \"atom\":\n                        return prog1(S.token.value, next);\n                    default:\n                        unexpected();\n                }\n        };\n\n        function subscripts(expr, allow_calls) {\n                if (is(\"punc\", \".\")) {\n                        next();\n                        return subscripts(as(\"dot\", expr, as_name()), allow_calls);\n                }\n                if (is(\"punc\", \"[\")) {\n                        next();\n                        return subscripts(as(\"sub\", expr, prog1(expression, curry(expect, \"]\"))), allow_calls);\n                }\n                if (allow_calls && is(\"punc\", \"(\")) {\n                        next();\n                        return subscripts(as(\"call\", expr, expr_list(\")\")), true);\n                }\n                if (allow_calls && is(\"operator\") && HOP(UNARY_POSTFIX, S.token.value)) {\n                        return prog1(curry(make_unary, \"unary-postfix\", S.token.value, expr),\n                                     next);\n                }\n                return expr;\n        };\n\n        function make_unary(tag, op, expr) {\n                if ((op == \"++\" || op == \"--\") && !is_assignable(expr))\n                        croak(\"Invalid use of \" + op + \" operator\");\n                return as(tag, op, expr);\n        };\n\n        function expr_op(left, min_prec) {\n                var op = is(\"operator\") ? S.token.value : null;\n                var prec = op != null ? PRECEDENCE[op] : null;\n                if (prec != null && prec > min_prec) {\n                        next();\n                        var right = expr_op(expr_atom(true), prec);\n                        return expr_op(as(\"binary\", op, left, right), min_prec);\n                }\n                return left;\n        };\n\n        function expr_ops() {\n                return expr_op(expr_atom(true), 0);\n        };\n\n        function maybe_conditional() {\n                var expr = expr_ops();\n                if (is(\"operator\", \"?\")) {\n                        next();\n                        var yes = expression(false);\n                        expect(\":\");\n                        return as(\"conditional\", expr, yes, expression(false));\n                }\n                return expr;\n        };\n\n        function is_assignable(expr) {\n                switch (expr[0]) {\n                    case \"dot\":\n                    case \"sub\":\n                        return true;\n                    case \"name\":\n                        return expr[1] != \"this\";\n                }\n        };\n\n        function maybe_assign() {\n                var left = maybe_conditional(), val = S.token.value;\n                if (is(\"operator\") && HOP(ASSIGNMENT, val)) {\n                        if (is_assignable(left)) {\n                                next();\n                                return as(\"assign\", ASSIGNMENT[val], left, maybe_assign());\n                        }\n                        croak(\"Invalid assignment\");\n                }\n                return left;\n        };\n\n        function expression(commas) {\n                if (arguments.length == 0)\n                        commas = true;\n                var expr = maybe_assign();\n                if (commas && is(\"punc\", \",\")) {\n                        next();\n                        return as(\"seq\", expr, expression());\n                }\n                return expr;\n        };\n\n        function in_loop(cont) {\n                try {\n                        ++S.in_loop;\n                        return cont();\n                } finally {\n                        --S.in_loop;\n                }\n        };\n\n        return as(\"toplevel\", (function(a){\n                while (!is(\"eof\"))\n                        a.push(statement());\n                return a;\n        })([]));\n\n};\n\n/* -----[ Utilities ]----- */\n\nfunction curry(f) {\n        var args = slice(arguments, 1);\n        return function() { return f.apply(this, args.concat(slice(arguments))); };\n};\n\nfunction prog1(ret) {\n        if (ret instanceof Function)\n                ret = ret();\n        for (var i = 1, n = arguments.length; --n > 0; ++i)\n                arguments[i]();\n        return ret;\n};\n\nfunction array_to_hash(a) {\n        var ret = {};\n        for (var i = 0; i < a.length; ++i)\n                ret[a[i]] = true;\n        return ret;\n};\n\nfunction slice(a, start) {\n        return Array.prototype.slice.call(a, start == null ? 0 : start);\n};\n\nfunction characters(str) {\n        return str.split(\"\");\n};\n\nfunction member(name, array) {\n        for (var i = array.length; --i >= 0;)\n                if (array[i] === name)\n                        return true;\n        return false;\n};\n\nfunction HOP(obj, prop) {\n        return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n\n/* -----[ Exports ]----- */\n\nexports.tokenizer = tokenizer;\nexports.parse = parse;\nexports.slice = slice;\nexports.curry = curry;\nexports.member = member;\nexports.array_to_hash = array_to_hash;\nexports.PRECEDENCE = PRECEDENCE;\nexports.KEYWORDS_ATOM = KEYWORDS_ATOM;\nexports.RESERVED_WORDS = RESERVED_WORDS;\nexports.KEYWORDS = KEYWORDS;\nexports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;\nexports.OPERATORS = OPERATORS;\nexports.is_alphanumeric_char = is_alphanumeric_char;\nexports.is_identifier_char = is_identifier_char;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/UglifyJS/process.js",
    "content": "/***********************************************************************\n\n  A JavaScript tokenizer / parser / beautifier / compressor.\n\n  This version is suitable for Node.js.  With minimal changes (the\n  exports stuff) it should work on any JS platform.\n\n  This file implements some AST processors.  They work on data built\n  by parse-js.\n\n  Exported functions:\n\n    - ast_mangle(ast, include_toplevel) -- mangles the\n      variable/function names in the AST.  Returns an AST.  Pass true\n      as second argument to mangle toplevel names too.\n\n    - ast_squeeze(ast) -- employs various optimizations to make the\n      final generated code even smaller.  Returns an AST.\n\n    - gen_code(ast, beautify) -- generates JS code from the AST.  Pass\n      true (or an object, see the code for some options) as second\n      argument to get \"pretty\" (indented) code.\n\n  -------------------------------- (C) ---------------------------------\n\n                           Author: Mihai Bazon\n                         <mihai.bazon@gmail.com>\n                       http://mihai.bazon.net/blog\n\n  Distributed under the BSD license:\n\n    Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\n\n    Redistribution and use in source and binary forms, with or without\n    modification, are permitted provided that the following conditions\n    are met:\n\n        * Redistributions of source code must retain the above\n          copyright notice, this list of conditions and the following\n          disclaimer.\n\n        * Redistributions in binary form must reproduce the above\n          copyright notice, this list of conditions and the following\n          disclaimer in the documentation and/or other materials\n          provided with the distribution.\n\n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n    SUCH DAMAGE.\n\n ***********************************************************************/\n\nvar jsp = require(\"./parse-js\"),\n    slice = jsp.slice,\n    member = jsp.member,\n    PRECEDENCE = jsp.PRECEDENCE,\n    OPERATORS = jsp.OPERATORS;\n\n/* -----[ helper for AST traversal ]----- */\n\nfunction ast_walker(ast) {\n        function _vardefs(defs) {\n                return [ this[0], MAP(defs, function(def){\n                        var a = [ def[0] ];\n                        if (def.length > 1)\n                                a[1] = walk(def[1]);\n                        return a;\n                }) ];\n        };\n        var walkers = {\n                \"string\": function(str) {\n                        return [ this[0], str ];\n                },\n                \"num\": function(num) {\n                        return [ this[0], num ];\n                },\n                \"name\": function(name) {\n                        return [ this[0], name ];\n                },\n                \"toplevel\": function(statements) {\n                        return [ this[0], MAP(statements, walk) ];\n                },\n                \"block\": function(statements) {\n                        var out = [ this[0] ];\n                        if (statements != null)\n                                out.push(MAP(statements, walk));\n                        return out;\n                },\n                \"var\": _vardefs,\n                \"const\": _vardefs,\n                \"try\": function(t, c, f) {\n                        return [\n                                this[0],\n                                MAP(t, walk),\n                                c != null ? [ c[0], MAP(c[1], walk) ] : null,\n                                f != null ? MAP(f, walk) : null\n                        ];\n                },\n                \"throw\": function(expr) {\n                        return [ this[0], walk(expr) ];\n                },\n                \"new\": function(ctor, args) {\n                        return [ this[0], walk(ctor), MAP(args, walk) ];\n                },\n                \"switch\": function(expr, body) {\n                        return [ this[0], walk(expr), MAP(body, function(branch){\n                                return [ branch[0] ? walk(branch[0]) : null,\n                                         MAP(branch[1], walk) ];\n                        }) ];\n                },\n                \"break\": function(label) {\n                        return [ this[0], label ];\n                },\n                \"continue\": function(label) {\n                        return [ this[0], label ];\n                },\n                \"conditional\": function(cond, t, e) {\n                        return [ this[0], walk(cond), walk(t), walk(e) ];\n                },\n                \"assign\": function(op, lvalue, rvalue) {\n                        return [ this[0], op, walk(lvalue), walk(rvalue) ];\n                },\n                \"dot\": function(expr) {\n                        return [ this[0], walk(expr) ].concat(slice(arguments, 1));\n                },\n                \"call\": function(expr, args) {\n                        return [ this[0], walk(expr), MAP(args, walk) ];\n                },\n                \"function\": function(name, args, body) {\n                        return [ this[0], name, args.slice(), MAP(body, walk) ];\n                },\n                \"defun\": function(name, args, body) {\n                        return [ this[0], name, args.slice(), MAP(body, walk) ];\n                },\n                \"if\": function(conditional, t, e) {\n                        return [ this[0], walk(conditional), walk(t), walk(e) ];\n                },\n                \"for\": function(init, cond, step, block) {\n                        return [ this[0], walk(init), walk(cond), walk(step), walk(block) ];\n                },\n                \"for-in\": function(has_var, key, hash, block) {\n                        return [ this[0], has_var, key, walk(hash), walk(block) ];\n                },\n                \"while\": function(cond, block) {\n                        return [ this[0], walk(cond), walk(block) ];\n                },\n                \"do\": function(cond, block) {\n                        return [ this[0], walk(cond), walk(block) ];\n                },\n                \"return\": function(expr) {\n                        return [ this[0], walk(expr) ];\n                },\n                \"binary\": function(op, left, right) {\n                        return [ this[0], op, walk(left), walk(right) ];\n                },\n                \"unary-prefix\": function(op, expr) {\n                        return [ this[0], op, walk(expr) ];\n                },\n                \"unary-postfix\": function(op, expr) {\n                        return [ this[0], op, walk(expr) ];\n                },\n                \"sub\": function(expr, subscript) {\n                        return [ this[0], walk(expr), walk(subscript) ];\n                },\n                \"object\": function(props) {\n                        return [ this[0], MAP(props, function(p){\n                                return p.length == 2\n                                        ? [ p[0], walk(p[1]) ]\n                                        : [ p[0], walk(p[1]), p[2] ]; // get/set-ter\n                        }) ];\n                },\n                \"regexp\": function(rx, mods) {\n                        return [ this[0], rx, mods ];\n                },\n                \"array\": function(elements) {\n                        return [ this[0], MAP(elements, walk) ];\n                },\n                \"stat\": function(stat) {\n                        return [ this[0], walk(stat) ];\n                },\n                \"seq\": function() {\n                        return [ this[0] ].concat(MAP(slice(arguments), walk));\n                },\n                \"label\": function(name, block) {\n                        return [ this[0], name, walk(block) ];\n                },\n                \"with\": function(expr, block) {\n                        return [ this[0], walk(expr), walk(block) ];\n                },\n                \"atom\": function(name) {\n                        return [ this[0], name ];\n                }\n        };\n\n        var user = {};\n        var stack = [];\n        function walk(ast) {\n                if (ast == null)\n                        return null;\n                try {\n                        stack.push(ast);\n                        var type = ast[0];\n                        var gen = user[type];\n                        if (gen) {\n                                var ret = gen.apply(ast, ast.slice(1));\n                                if (ret != null)\n                                        return ret;\n                        }\n                        gen = walkers[type];\n                        return gen.apply(ast, ast.slice(1));\n                } finally {\n                        stack.pop();\n                }\n        };\n\n        function with_walkers(walkers, cont){\n                var save = {}, i;\n                for (i in walkers) if (HOP(walkers, i)) {\n                        save[i] = user[i];\n                        user[i] = walkers[i];\n                }\n                var ret = cont();\n                for (i in save) if (HOP(save, i)) {\n                        if (!save[i]) delete user[i];\n                        else user[i] = save[i];\n                }\n                return ret;\n        };\n\n        return {\n                walk: walk,\n                with_walkers: with_walkers,\n                parent: function() {\n                        return stack[stack.length - 2]; // last one is current node\n                },\n                stack: function() {\n                        return stack;\n                }\n        };\n};\n\n/* -----[ Scope and mangling ]----- */\n\nfunction Scope(parent) {\n        this.names = {};        // names defined in this scope\n        this.mangled = {};      // mangled names (orig.name => mangled)\n        this.rev_mangled = {};  // reverse lookup (mangled => orig.name)\n        this.cname = -1;        // current mangled name\n        this.refs = {};         // names referenced from this scope\n        this.uses_with = false; // will become TRUE if eval() is detected in this or any subscopes\n        this.uses_eval = false; // will become TRUE if with() is detected in this or any subscopes\n        this.parent = parent;   // parent scope\n        this.children = [];     // sub-scopes\n        if (parent) {\n                this.level = parent.level + 1;\n                parent.children.push(this);\n        } else {\n                this.level = 0;\n        }\n};\n\nvar base54 = (function(){\n        var DIGITS = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_\";\n        return function(num) {\n                var ret = \"\";\n                do {\n                        ret = DIGITS.charAt(num % 54) + ret;\n                        num = Math.floor(num / 54);\n                } while (num > 0);\n                return ret;\n        };\n})();\n\nScope.prototype = {\n        has: function(name) {\n                for (var s = this; s; s = s.parent)\n                        if (HOP(s.names, name))\n                                return s;\n        },\n        has_mangled: function(mname) {\n                for (var s = this; s; s = s.parent)\n                        if (HOP(s.rev_mangled, mname))\n                                return s;\n        },\n        toJSON: function() {\n                return {\n                        names: this.names,\n                        uses_eval: this.uses_eval,\n                        uses_with: this.uses_with\n                };\n        },\n\n        next_mangled: function() {\n                // we must be careful that the new mangled name:\n                //\n                // 1. doesn't shadow a mangled name from a parent\n                //    scope, unless we don't reference the original\n                //    name from this scope OR from any sub-scopes!\n                //    This will get slow.\n                //\n                // 2. doesn't shadow an original name from a parent\n                //    scope, in the event that the name is not mangled\n                //    in the parent scope and we reference that name\n                //    here OR IN ANY SUBSCOPES!\n                //\n                // 3. doesn't shadow a name that is referenced but not\n                //    defined (possibly global defined elsewhere).\n                for (;;) {\n                        var m = base54(++this.cname), prior;\n\n                        // case 1.\n                        prior = this.has_mangled(m);\n                        if (prior && this.refs[prior.rev_mangled[m]] === prior)\n                                continue;\n\n                        // case 2.\n                        prior = this.has(m);\n                        if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m))\n                                continue;\n\n                        // case 3.\n                        if (HOP(this.refs, m) && this.refs[m] == null)\n                                continue;\n\n                        // I got \"do\" once. :-/\n                        if (!is_identifier(m))\n                                continue;\n\n                        return m;\n                }\n        },\n        get_mangled: function(name, newMangle) {\n                if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use\n                var s = this.has(name);\n                if (!s) return name; // not in visible scope, no mangle\n                if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope\n                if (!newMangle) return name;                      // not found and no mangling requested\n\n                var m = s.next_mangled();\n                s.rev_mangled[m] = name;\n                return s.mangled[name] = m;\n        },\n        define: function(name) {\n                if (name != null)\n                        return this.names[name] = name;\n        }\n};\n\nfunction ast_add_scope(ast) {\n\n        var current_scope = null;\n        var w = ast_walker(), walk = w.walk;\n        var having_eval = [];\n\n        function with_new_scope(cont) {\n                current_scope = new Scope(current_scope);\n                var ret = current_scope.body = cont();\n                ret.scope = current_scope;\n                current_scope = current_scope.parent;\n                return ret;\n        };\n\n        function define(name) {\n                return current_scope.define(name);\n        };\n\n        function reference(name) {\n                current_scope.refs[name] = true;\n        };\n\n        function _lambda(name, args, body) {\n                return [ this[0], define(name), args, with_new_scope(function(){\n                        MAP(args, define);\n                        return MAP(body, walk);\n                })];\n        };\n\n        return with_new_scope(function(){\n                // process AST\n                var ret = w.with_walkers({\n                        \"function\": _lambda,\n                        \"defun\": _lambda,\n                        \"with\": function(expr, block) {\n                                for (var s = current_scope; s; s = s.parent)\n                                        s.uses_with = true;\n                        },\n                        \"var\": function(defs) {\n                                MAP(defs, function(d){ define(d[0]) });\n                        },\n                        \"const\": function(defs) {\n                                MAP(defs, function(d){ define(d[0]) });\n                        },\n                        \"try\": function(t, c, f) {\n                                if (c != null) return [\n                                        this[0],\n                                        MAP(t, walk),\n                                        [ define(c[0]), MAP(c[1], walk) ],\n                                        f != null ? MAP(f, walk) : null\n                                ];\n                        },\n                        \"name\": function(name) {\n                                if (name == \"eval\")\n                                        having_eval.push(current_scope);\n                                reference(name);\n                        },\n                        \"for-in\": function(has_var, name) {\n                                if (has_var) define(name);\n                                else reference(name);\n                        }\n                }, function(){\n                        return walk(ast);\n                });\n\n                // the reason why we need an additional pass here is\n                // that names can be used prior to their definition.\n\n                // scopes where eval was detected and their parents\n                // are marked with uses_eval, unless they define the\n                // \"eval\" name.\n                MAP(having_eval, function(scope){\n                        if (!scope.has(\"eval\")) while (scope) {\n                                scope.uses_eval = true;\n                                scope = scope.parent;\n                        }\n                });\n\n                // for referenced names it might be useful to know\n                // their origin scope.  current_scope here is the\n                // toplevel one.\n                function fixrefs(scope, i) {\n                        // do children first; order shouldn't matter\n                        for (i = scope.children.length; --i >= 0;)\n                                fixrefs(scope.children[i]);\n                        for (i in scope.refs) if (HOP(scope.refs, i)) {\n                                // find origin scope and propagate the reference to origin\n                                for (var origin = scope.has(i), s = scope; s; s = s.parent) {\n                                        s.refs[i] = origin;\n                                        if (s === origin) break;\n                                }\n                        }\n                };\n                fixrefs(current_scope);\n\n                return ret;\n        });\n\n};\n\n/* -----[ mangle names ]----- */\n\nfunction ast_mangle(ast, do_toplevel) {\n        var w = ast_walker(), walk = w.walk, scope;\n\n        function get_mangled(name, newMangle) {\n                if (!do_toplevel && !scope.parent) return name; // don't mangle toplevel\n                return scope.get_mangled(name, newMangle);\n        };\n\n        function _lambda(name, args, body) {\n                if (name) name = get_mangled(name);\n                body = with_scope(body.scope, function(){\n                        args = MAP(args, function(name){ return get_mangled(name) });\n                        return MAP(body, walk);\n                });\n                return [ this[0], name, args, body ];\n        };\n\n        function with_scope(s, cont) {\n                var _scope = scope;\n                scope = s;\n                for (var i in s.names) if (HOP(s.names, i)) {\n                        get_mangled(i, true);\n                }\n                var ret = cont();\n                ret.scope = s;\n                scope = _scope;\n                return ret;\n        };\n\n        function _vardefs(defs) {\n                return [ this[0], MAP(defs, function(d){\n                        return [ get_mangled(d[0]), walk(d[1]) ];\n                }) ];\n        };\n\n        return w.with_walkers({\n                \"function\": _lambda,\n                \"defun\": function() {\n                        // move function declarations to the top when\n                        // they are not in some block.\n                        var ast = _lambda.apply(this, arguments);\n                        switch (w.parent()[0]) {\n                            case \"toplevel\":\n                            case \"function\":\n                            case \"defun\":\n                                return MAP.at_top(ast);\n                        }\n                        return ast;\n                },\n                \"var\": _vardefs,\n                \"const\": _vardefs,\n                \"name\": function(name) {\n                        return [ this[0], get_mangled(name) ];\n                },\n                \"try\": function(t, c, f) {\n                        return [ this[0],\n                                 MAP(t, walk),\n                                 c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null,\n                                 f != null ? MAP(f, walk) : null ];\n                },\n                \"toplevel\": function(body) {\n                        var self = this;\n                        return with_scope(self.scope, function(){\n                                return [ self[0], MAP(body, walk) ];\n                        });\n                },\n                \"for-in\": function(has_var, name, obj, stat) {\n                        return [ this[0], has_var, get_mangled(name), walk(obj), walk(stat) ];\n                }\n        }, function() {\n                return walk(ast_add_scope(ast));\n        });\n};\n\n/* -----[\n   - compress foo[\"bar\"] into foo.bar,\n   - remove block brackets {} where possible\n   - join consecutive var declarations\n   - various optimizations for IFs:\n     - if (cond) foo(); else bar();  ==>  cond?foo():bar();\n     - if (cond) foo();  ==>  cond&&foo();\n     - if (foo) return bar(); else return baz();  ==> return foo?bar():baz(); // also for throw\n     - if (foo) return bar(); else something();  ==> {if(foo)return bar();something()}\n   ]----- */\n\nvar warn = function(){};\n\nfunction best_of(ast1, ast2) {\n        return gen_code(ast1).length > gen_code(ast2[0] == \"stat\" ? ast2[1] : ast2).length ? ast2 : ast1;\n};\n\nfunction last_stat(b) {\n        if (b[0] == \"block\" && b[1] && b[1].length > 0)\n                return b[1][b[1].length - 1];\n        return b;\n}\n\nfunction aborts(t) {\n        if (t) {\n                t = last_stat(t);\n                if (t[0] == \"return\" || t[0] == \"break\" || t[0] == \"continue\" || t[0] == \"throw\")\n                        return true;\n        }\n};\n\nfunction boolean_expr(expr) {\n        return ( (expr[0] == \"unary-prefix\"\n                  && member(expr[1], [ \"!\", \"delete\" ])) ||\n\n                 (expr[0] == \"binary\"\n                  && member(expr[1], [ \"in\", \"instanceof\", \"==\", \"!=\", \"===\", \"!==\", \"<\", \"<=\", \">=\", \">\" ])) ||\n\n                 (expr[0] == \"binary\"\n                  && member(expr[1], [ \"&&\", \"||\" ])\n                  && boolean_expr(expr[2])\n                  && boolean_expr(expr[3])) ||\n\n                 (expr[0] == \"conditional\"\n                  && boolean_expr(expr[2])\n                  && boolean_expr(expr[3])) ||\n\n                 (expr[0] == \"assign\"\n                  && expr[1] === true\n                  && boolean_expr(expr[3])) ||\n\n                 (expr[0] == \"seq\"\n                  && boolean_expr(expr[expr.length - 1]))\n               );\n};\n\nfunction make_conditional(c, t, e) {\n        if (c[0] == \"unary-prefix\" && c[1] == \"!\") {\n                return e ? [ \"conditional\", c[2], e, t ] : [ \"binary\", \"||\", c[2], t ];\n        } else {\n                return e ? [ \"conditional\", c, t, e ] : [ \"binary\", \"&&\", c, t ];\n        }\n};\n\nfunction empty(b) {\n        return !b || (b[0] == \"block\" && (!b[1] || b[1].length == 0));\n};\n\nfunction ast_squeeze(ast, options) {\n        options = defaults(options, {\n                make_seqs   : true,\n                dead_code   : true,\n                keep_comps  : true,\n                no_warnings : false\n        });\n\n        var w = ast_walker(), walk = w.walk, scope;\n\n        function negate(c) {\n                    var not_c = [ \"unary-prefix\", \"!\", c ];\n                switch (c[0]) {\n                    case \"unary-prefix\":\n                        return c[1] == \"!\" && boolean_expr(c[2]) ? c[2] : not_c;\n                    case \"seq\":\n                        c = slice(c);\n                        c[c.length - 1] = negate(c[c.length - 1]);\n                        return c;\n                    case \"conditional\":\n                        return best_of(not_c, [ \"conditional\", c[1], negate(c[2]), negate(c[3]) ]);\n                    case \"binary\":\n                        var op = c[1], left = c[2], right = c[3];\n                        if (!options.keep_comps) switch (op) {\n                            case \"<=\"  : return [ \"binary\", \">\", left, right ];\n                            case \"<\"   : return [ \"binary\", \">=\", left, right ];\n                            case \">=\"  : return [ \"binary\", \"<\", left, right ];\n                            case \">\"   : return [ \"binary\", \"<=\", left, right ];\n                        }\n                        switch (op) {\n                            case \"==\"  : return [ \"binary\", \"!=\", left, right ];\n                            case \"!=\"  : return [ \"binary\", \"==\", left, right ];\n                            case \"===\" : return [ \"binary\", \"!==\", left, right ];\n                            case \"!==\" : return [ \"binary\", \"===\", left, right ];\n                            case \"&&\"  : return best_of(not_c, [ \"binary\", \"||\", negate(left), negate(right) ]);\n                            case \"||\"  : return best_of(not_c, [ \"binary\", \"&&\", negate(left), negate(right) ]);\n                        }\n                        break;\n                }\n                return not_c;\n        };\n\n        function with_scope(s, cont) {\n                var _scope = scope;\n                scope = s;\n                var ret = cont();\n                ret.scope = s;\n                scope = _scope;\n                return ret;\n        };\n\n        function is_constant(node) {\n                return node[0] == \"string\" || node[0] == \"num\";\n        };\n\n        function rmblock(block) {\n                if (block != null && block[0] == \"block\" && block[1] && block[1].length == 1)\n                        block = block[1][0];\n                return block;\n        };\n\n        function _lambda(name, args, body) {\n                return [ this[0], name, args, with_scope(body.scope, function(){\n                        return tighten(MAP(body, walk), \"lambda\");\n                }) ];\n        };\n\n        // we get here for blocks that have been already transformed.\n        // this function does a few things:\n        // 1. discard useless blocks\n        // 2. join consecutive var declarations\n        // 3. remove obviously dead code\n        // 4. transform consecutive statements using the comma operator\n        // 5. if block_type == \"lambda\" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... }\n        function tighten(statements, block_type) {\n                statements = statements.reduce(function(a, stat){\n                        if (stat[0] == \"block\") {\n                                if (stat[1]) {\n                                        a.push.apply(a, stat[1]);\n                                }\n                        } else {\n                                a.push(stat);\n                        }\n                        return a;\n                }, []);\n\n                statements = (function(a, prev){\n                        statements.forEach(function(cur){\n                                if (prev && ((cur[0] == \"var\" && prev[0] == \"var\") ||\n                                             (cur[0] == \"const\" && prev[0] == \"const\"))) {\n                                        prev[1] = prev[1].concat(cur[1]);\n                                } else {\n                                        a.push(cur);\n                                        prev = cur;\n                                }\n                        });\n                        return a;\n                })([]);\n\n                if (options.dead_code) statements = (function(a, has_quit){\n                        statements.forEach(function(st){\n                                if (has_quit) {\n                                        if (member(st[0], [ \"function\", \"defun\" , \"var\", \"const\" ])) {\n                                                a.push(st);\n                                        }\n                                        else if (!options.no_warnings)\n                                                warn(\"Removing unreachable code: \" + gen_code(st, true));\n                                }\n                                else {\n                                        a.push(st);\n                                        if (member(st[0], [ \"return\", \"throw\", \"break\", \"continue\" ]))\n                                                has_quit = true;\n                                }\n                        });\n                        return a;\n                })([]);\n\n                if (options.make_seqs) statements = (function(a, prev) {\n                        statements.forEach(function(cur){\n                                if (prev && prev[0] == \"stat\" && cur[0] == \"stat\") {\n                                        prev[1] = [ \"seq\", prev[1], cur[1] ];\n                                } else {\n                                        a.push(cur);\n                                        prev = cur;\n                                }\n                        });\n                        return a;\n                })([]);\n\n                if (block_type == \"lambda\") statements = (function(i, a, stat){\n                        while (i < statements.length) {\n                                stat = statements[i++];\n                                if (stat[0] == \"if\" && !stat[3]) {\n                                        if (stat[2][0] == \"return\" && stat[2][1] == null) {\n                                                a.push(make_if(negate(stat[1]), [ \"block\", statements.slice(i) ]));\n                                                break;\n                                        }\n                                        var last = last_stat(stat[2]);\n                                        if (last[0] == \"return\" && last[1] == null) {\n                                                a.push(make_if(stat[1], [ \"block\", stat[2][1].slice(0, -1) ], [ \"block\", statements.slice(i) ]));\n                                                break;\n                                        }\n                                }\n                                a.push(stat);\n                        }\n                        return a;\n                })(0, []);\n\n                return statements;\n        };\n\n        function make_if(c, t, e) {\n                c = walk(c);\n                t = walk(t);\n                e = walk(e);\n\n                if (empty(t)) {\n                        c = negate(c);\n                        t = e;\n                        e = null;\n                } else if (empty(e)) {\n                        e = null;\n                } else {\n                        // if we have both else and then, maybe it makes sense to switch them?\n                        (function(){\n                                var a = gen_code(c);\n                                var n = negate(c);\n                                var b = gen_code(n);\n                                if (b.length < a.length) {\n                                        var tmp = t;\n                                        t = e;\n                                        e = tmp;\n                                        c = n;\n                                }\n                        })();\n                }\n                if (empty(e) && empty(t))\n                        return [ \"stat\", c ];\n                var ret = [ \"if\", c, t, e ];\n                if (t[0] == \"if\" && empty(t[3]) && empty(e)) {\n                        ret = best_of(ret, walk([ \"if\", [ \"binary\", \"&&\", c, t[1] ], t[2] ]));\n                }\n                else if (t[0] == \"stat\") {\n                        if (e) {\n                                if (e[0] == \"stat\") {\n                                        ret = best_of(ret, [ \"stat\", make_conditional(c, t[1], e[1]) ]);\n                                }\n                        }\n                        else {\n                                ret = best_of(ret, [ \"stat\", make_conditional(c, t[1]) ]);\n                        }\n                }\n                else if (e && t[0] == e[0] && (t[0] == \"return\" || t[0] == \"throw\")) {\n                        ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]);\n                }\n                else if (e && aborts(t)) {\n                        ret = [ [ \"if\", c, t ] ];\n                        if (e[0] == \"block\") {\n                                if (e[1]) ret = ret.concat(e[1]);\n                        }\n                        else {\n                                ret.push(e);\n                        }\n                        ret = walk([ \"block\", ret ]);\n                }\n                else if (t && aborts(e)) {\n                        ret = [ [ \"if\", negate(c), e ] ];\n                        if (t[0] == \"block\") {\n                                if (t[1]) ret = ret.concat(t[1]);\n                        } else {\n                                ret.push(t);\n                        }\n                        ret = walk([ \"block\", ret ]);\n                }\n                return ret;\n        };\n\n        return w.with_walkers({\n                \"sub\": function(expr, subscript) {\n                        if (subscript[0] == \"string\") {\n                                var name = subscript[1];\n                                if (is_identifier(name)) {\n                                        return [ \"dot\", walk(expr), name ];\n                                }\n                        }\n                },\n                \"if\": make_if,\n                \"toplevel\": function(body) {\n                        return [ \"toplevel\", with_scope(this.scope, function(){\n                                return tighten(MAP(body, walk));\n                        }) ];\n                },\n                \"switch\": function(expr, body) {\n                        var last = body.length - 1;\n                        return [ \"switch\", walk(expr), MAP(body, function(branch, i){\n                                var block = tighten(MAP(branch[1], walk));\n                                if (i == last && block.length > 0) {\n                                        var node = block[block.length - 1];\n                                        if (node[0] == \"break\" && !node[1])\n                                                block.pop();\n                                }\n                                return [ branch[0] ? walk(branch[0]) : null, block ];\n                        }) ];\n                },\n                \"function\": _lambda,\n                \"defun\": _lambda,\n                \"block\": function(body) {\n                        if (body) return rmblock([ \"block\", tighten(MAP(body, walk)) ]);\n                },\n                \"binary\": function(op, left, right) {\n                        left = walk(left);\n                        right = walk(right);\n                        var best = [ \"binary\", op, left, right ];\n                        if (is_constant(right) && is_constant(left)) {\n                                var val = {};\n                                var orig = val;\n                                switch (op) {\n                                    case \"+\"   : val = left[1] +   right[1]; break;\n                                    case \"*\"   : val = left[1] *   right[1]; break;\n                                    case \"/\"   : val = left[1] /   right[1]; break;\n                                    case \"-\"   : val = left[1] -   right[1]; break;\n                                    case \"<<\"  : val = left[1] <<  right[1]; break;\n                                    case \">>\"  : val = left[1] >>  right[1]; break;\n                                    case \">>>\" : val = left[1] >>> right[1]; break;\n                                    case \"==\"  : val = left[1] ==  right[1]; break;\n                                    case \"===\" : val = left[1] === right[1]; break;\n                                    case \"!=\"  : val = left[1] !=  right[1]; break;\n                                    case \"!==\" : val = left[1] !== right[1]; break;\n                                    case \"<\"   : val = left[1] <   right[1]; break;\n                                    case \"<=\"  : val = left[1] <=  right[1]; break;\n                                    case \">\"   : val = left[1] >   right[1]; break;\n                                    case \">=\"  : val = left[1] >=  right[1]; break;\n                                }\n                                if (val !== orig) {\n                                        switch (typeof val) {\n                                            case \"string\": val = [ \"string\", val ]; break;\n                                            case \"boolean\": val = [ \"name\", val+\"\" ]; break;\n                                            case \"number\": val = [ \"num\", val ]; break;\n                                            default: return best;\n                                        }\n                                        best = best_of(best, walk(val));\n                                }\n                        }\n                        return best;\n                },\n                \"conditional\": function(c, t, e) {\n                        return make_conditional(walk(c), walk(t), walk(e));\n                },\n                \"try\": function(t, c, f) {\n                        return [\n                                \"try\",\n                                tighten(MAP(t, walk)),\n                                c != null ? [ c[0], tighten(MAP(c[1], walk)) ] : null,\n                                f != null ? tighten(MAP(f, walk)) : null\n                        ];\n                },\n                \"unary-prefix\": function(op, expr) {\n                        expr = walk(expr);\n                        var ret = [ \"unary-prefix\", op, expr ];\n                        if (op == \"!\")\n                                ret = best_of(ret, negate(expr));\n                        return ret;\n                },\n                \"name\": function(name) {\n                        switch (name) {\n                            case \"true\": return [ \"unary-prefix\", \"!\", [ \"num\", 0 ]];\n                            case \"false\": return [ \"unary-prefix\", \"!\", [ \"num\", 1 ]];\n                        }\n                },\n                \"new\": function(ctor, args) {\n                        if (ctor[0] == \"name\" && ctor[1] == \"Array\" && !scope.has(\"Array\")) {\n                                if (args.length != 1) {\n                                        return [ \"array\", args ];\n                                } else {\n                                        return [ \"call\", [ \"name\", \"Array\" ], args ];\n                                }\n                        }\n                },\n                \"call\": function(expr, args) {\n                        if (expr[0] == \"name\" && expr[1] == \"Array\" && args.length != 1 && !scope.has(\"Array\")) {\n                                return [ \"array\", args ];\n                        }\n                }\n        }, function() {\n                return walk(ast_add_scope(ast));\n        });\n};\n\n/* -----[ re-generate code from the AST ]----- */\n\nvar DOT_CALL_NO_PARENS = jsp.array_to_hash([\n        \"name\",\n        \"array\",\n        \"string\",\n        \"dot\",\n        \"sub\",\n        \"call\",\n        \"regexp\"\n]);\n\nfunction make_string(str) {\n        var dq = 0, sq = 0;\n        str = str.replace(/[\\\\\\b\\f\\n\\r\\t\\x22\\x27]/g, function(s){\n                switch (s) {\n                    case \"\\\\\": return \"\\\\\\\\\";\n                    case \"\\b\": return \"\\\\b\";\n                    case \"\\f\": return \"\\\\f\";\n                    case \"\\n\": return \"\\\\n\";\n                    case \"\\r\": return \"\\\\r\";\n                    case \"\\t\": return \"\\\\t\";\n                    case '\"': ++dq; return '\"';\n                    case \"'\": ++sq; return \"'\";\n                }\n                return s;\n        });\n        if (dq > sq) {\n                return \"'\" + str.replace(/\\x27/g, \"\\\\'\") + \"'\";\n        } else {\n                return '\"' + str.replace(/\\x22/g, '\\\\\"') + '\"';\n        }\n};\n\nfunction gen_code(ast, beautify) {\n        if (beautify) beautify = defaults(beautify, {\n                indent_start : 0,\n                indent_level : 4,\n                quote_keys   : false,\n                space_colon  : false\n        });\n        var indentation = 0,\n            newline = beautify ? \"\\n\" : \"\",\n            space = beautify ? \" \" : \"\";\n\n        function indent(line) {\n                if (line == null)\n                        line = \"\";\n                if (beautify)\n                        line = repeat_string(\" \", beautify.indent_start + indentation * beautify.indent_level) + line;\n                return line;\n        };\n\n        function with_indent(cont, incr) {\n                if (incr == null) incr = 1;\n                indentation += incr;\n                try { return cont.apply(null, slice(arguments, 1)); }\n                finally { indentation -= incr; }\n        };\n\n        function add_spaces(a) {\n                if (beautify)\n                        return a.join(\" \");\n                var b = [];\n                for (var i = 0; i < a.length; ++i) {\n                        var next = a[i + 1];\n                        b.push(a[i]);\n                        if (next &&\n                            ((/[a-z0-9_\\x24]$/i.test(a[i].toString()) && /^[a-z0-9_\\x24]/i.test(next.toString())) ||\n                             (/[\\+\\-]$/.test(a[i].toString()) && /^[\\+\\-]/.test(next.toString())))) {\n                                b.push(\" \");\n                        }\n                }\n                return b.join(\"\");\n        };\n\n        function add_commas(a) {\n                return a.join(\",\" + space);\n        };\n\n        function parenthesize(expr) {\n                var gen = make(expr);\n                for (var i = 1; i < arguments.length; ++i) {\n                        var el = arguments[i];\n                        if ((el instanceof Function && el(expr)) || expr[0] == el)\n                                return \"(\" + gen + \")\";\n                }\n                return gen;\n        };\n\n        function best_of(a) {\n                if (a.length == 1) {\n                        return a[0];\n                }\n                if (a.length == 2) {\n                        var b = a[1];\n                        a = a[0];\n                        return a.length <= b.length ? a : b;\n                }\n                return best_of([ a[0], best_of(a.slice(1)) ]);\n        };\n\n        function needs_parens(expr) {\n                if (expr[0] == \"function\") {\n                        // dot/call on a literal function requires the\n                        // function literal itself to be parenthesized\n                        // only if it's the first \"thing\" in a\n                        // statement.  This means that the parent is\n                        // \"stat\", but it could also be a \"seq\" and\n                        // we're the first in this \"seq\" and the\n                        // parent is \"stat\", and so on.  Messy stuff,\n                        // but it worths the trouble.\n                        var a = slice($stack), self = a.pop(), p = a.pop();\n                        while (p) {\n                                if (p[0] == \"stat\") return true;\n                                if ((p[0] == \"seq\" && p[1] === self) ||\n                                    (p[0] == \"call\" && p[1] === self) ||\n                                    (p[0] == \"binary\" && p[2] === self)) {\n                                        self = p;\n                                        p = a.pop();\n                                } else {\n                                        return false;\n                                }\n                        }\n                }\n                return !HOP(DOT_CALL_NO_PARENS, expr[0]);\n        };\n\n        function make_num(num) {\n                var str = num.toString(10), a = [ str.replace(/^0\\./, \".\") ], m;\n                if (Math.floor(num) === num) {\n                        a.push(\"0x\" + num.toString(16).toLowerCase(), // probably pointless\n                               \"0\" + num.toString(8)); // same.\n                        if ((m = /^(.*?)(0+)$/.exec(num))) {\n                                a.push(m[1] + \"e\" + m[2].length);\n                        }\n                } else if ((m = /^0?\\.(0+)(.*)$/.exec(num))) {\n                        a.push(m[2] + \"e-\" + (m[1].length + m[2].length),\n                               str.substr(str.indexOf(\".\")));\n                }\n                return best_of(a);\n        };\n\n        var generators = {\n                \"string\": make_string,\n                \"num\": make_num,\n                \"name\": make_name,\n                \"toplevel\": function(statements) {\n                        return make_block_statements(statements)\n                                .join(newline + newline);\n                },\n                \"block\": make_block,\n                \"var\": function(defs) {\n                        return \"var \" + add_commas(MAP(defs, make_1vardef)) + \";\";\n                },\n                \"const\": function(defs) {\n                        return \"var \" + add_commas(MAP(defs, make_1vardef)) + \";\";\n                },\n                \"try\": function(tr, ca, fi) {\n                        var out = [ \"try\", make_block(tr) ];\n                        if (ca) out.push(\"catch\", \"(\" + ca[0] + \")\", make_block(ca[1]));\n                        if (fi) out.push(\"finally\", make_block(fi));\n                        return add_spaces(out);\n                },\n                \"throw\": function(expr) {\n                        return add_spaces([ \"throw\", make(expr) ]) + \";\";\n                },\n                \"new\": function(ctor, args) {\n                        args = args.length > 0 ? \"(\" + add_commas(MAP(args, make)) + \")\" : \"\";\n                        return add_spaces([ \"new\", parenthesize(ctor, \"seq\", \"binary\", \"conditional\", \"assign\", function(expr){\n                                var w = ast_walker(), has_call = {};\n                                try {\n                                        w.with_walkers({\n                                                \"call\": function() { throw has_call },\n                                                \"function\": function() { return this }\n                                        }, function(){\n                                                w.walk(expr);\n                                        });\n                                } catch(ex) {\n                                        if (ex === has_call)\n                                                return true;\n                                        throw ex;\n                                }\n                        }) + args ]);\n                },\n                \"switch\": function(expr, body) {\n                        return add_spaces([ \"switch\", \"(\" + make(expr) + \")\", make_switch_block(body) ]);\n                },\n                \"break\": function(label) {\n                        var out = \"break\";\n                        if (label != null)\n                                out += \" \" + make_name(label);\n                        return out + \";\";\n                },\n                \"continue\": function(label) {\n                        var out = \"continue\";\n                        if (label != null)\n                                out += \" \" + make_name(label);\n                        return out + \";\";\n                },\n                \"conditional\": function(co, th, el) {\n                        return add_spaces([ parenthesize(co, \"assign\", \"seq\", \"conditional\"), \"?\",\n                                            parenthesize(th, \"seq\"), \":\",\n                                            parenthesize(el, \"seq\") ]);\n                },\n                \"assign\": function(op, lvalue, rvalue) {\n                        if (op && op !== true) op += \"=\";\n                        else op = \"=\";\n                        return add_spaces([ make(lvalue), op, parenthesize(rvalue, \"seq\") ]);\n                },\n                \"dot\": function(expr) {\n                        var out = make(expr), i = 1;\n                        if (expr[0] == \"num\")\n                                out += \".\";\n                        else if (needs_parens(expr))\n                                out = \"(\" + out + \")\";\n                        while (i < arguments.length)\n                                out += \".\" + make_name(arguments[i++]);\n                        return out;\n                },\n                \"call\": function(func, args) {\n                        var f = make(func);\n                        if (needs_parens(func))\n                                f = \"(\" + f + \")\";\n                        return f + \"(\" + add_commas(MAP(args, function(expr){\n                                return parenthesize(expr, \"seq\");\n                        })) + \")\";\n                },\n                \"function\": make_function,\n                \"defun\": make_function,\n                \"if\": function(co, th, el) {\n                        var out = [ \"if\", \"(\" + make(co) + \")\", el ? make_then(th) : make(th) ];\n                        if (el) {\n                                out.push(\"else\", make(el));\n                        }\n                        return add_spaces(out);\n                },\n                \"for\": function(init, cond, step, block) {\n                        var out = [ \"for\" ];\n                        init = (init != null ? make(init) : \"\").replace(/;*\\s*$/, \";\" + space);\n                        cond = (cond != null ? make(cond) : \"\").replace(/;*\\s*$/, \";\" + space);\n                        step = (step != null ? make(step) : \"\").replace(/;*\\s*$/, \"\");\n                        var args = init + cond + step;\n                        if (args == \"; ; \") args = \";;\";\n                        out.push(\"(\" + args + \")\", make(block));\n                        return add_spaces(out);\n                },\n                \"for-in\": function(has_var, key, hash, block) {\n                        var out = add_spaces([ \"for\", \"(\" ]);\n                        if (has_var)\n                                out += \"var \";\n                        out += add_spaces([ make_name(key) + \" in \" + make(hash) + \")\", make(block) ]);\n                        return out;\n                },\n                \"while\": function(condition, block) {\n                        return add_spaces([ \"while\", \"(\" + make(condition) + \")\", make(block) ]);\n                },\n                \"do\": function(condition, block) {\n                        return add_spaces([ \"do\", make(block), \"while\", \"(\" + make(condition) + \")\" ]) + \";\";\n                },\n                \"return\": function(expr) {\n                        var out = [ \"return\" ];\n                        if (expr != null) out.push(make(expr));\n                        return add_spaces(out) + \";\";\n                },\n                \"binary\": function(operator, lvalue, rvalue) {\n                        var left = make(lvalue), right = make(rvalue);\n                        // XXX: I'm pretty sure other cases will bite here.\n                        //      we need to be smarter.\n                        //      adding parens all the time is the safest bet.\n                        if (member(lvalue[0], [ \"assign\", \"conditional\", \"seq\" ]) ||\n                            lvalue[0] == \"binary\" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]]) {\n                                left = \"(\" + left + \")\";\n                        }\n                        if (member(rvalue[0], [ \"assign\", \"conditional\", \"seq\" ]) ||\n                            rvalue[0] == \"binary\" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] &&\n                            !(rvalue[1] == operator && member(operator, [ \"&&\", \"||\", \"*\" ]))) {\n                                right = \"(\" + right + \")\";\n                        }\n                        return add_spaces([ left, operator, right ]);\n                },\n                \"unary-prefix\": function(operator, expr) {\n                        var val = make(expr);\n                        if (!(expr[0] == \"num\" || (expr[0] == \"unary-prefix\" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))\n                                val = \"(\" + val + \")\";\n                        return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? \" \" : \"\") + val;\n                },\n                \"unary-postfix\": function(operator, expr) {\n                        var val = make(expr);\n                        if (!(expr[0] == \"num\" || (expr[0] == \"unary-postfix\" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))\n                                val = \"(\" + val + \")\";\n                        return val + operator;\n                },\n                \"sub\": function(expr, subscript) {\n                        var hash = make(expr);\n                        if (needs_parens(expr))\n                                hash = \"(\" + hash + \")\";\n                        return hash + \"[\" + make(subscript) + \"]\";\n                },\n                \"object\": function(props) {\n                        if (props.length == 0)\n                                return \"{}\";\n                        return \"{\" + newline + with_indent(function(){\n                                return MAP(props, function(p){\n                                        if (p.length == 3) {\n                                                // getter/setter.  The name is in p[0], the arg.list in p[1][2], the\n                                                // body in p[1][3] and type (\"get\" / \"set\") in p[2].\n                                                return indent(make_function(p[0], p[1][2], p[1][3], p[2]));\n                                        }\n                                        var key = p[0], val = make(p[1]);\n                                        if (beautify && beautify.quote_keys) {\n                                                key = make_string(key);\n                                        } else if ((typeof key == \"number\" || !beautify && +key + \"\" == key)\n                                                   && parseFloat(key) >= 0) {\n                                                key = make_num(+key);\n                                        } else if (!is_identifier(key)) {\n                                                key = make_string(key);\n                                        }\n                                        return indent(add_spaces(beautify && beautify.space_colon\n                                                                 ? [ key, \":\", val ]\n                                                                 : [ key + \":\", val ]));\n                                }).join(\",\" + newline);\n                        }) + newline + indent(\"}\");\n                },\n                \"regexp\": function(rx, mods) {\n                        return \"/\" + rx + \"/\" + mods;\n                },\n                \"array\": function(elements) {\n                        if (elements.length == 0) return \"[]\";\n                        return add_spaces([ \"[\", add_commas(MAP(elements, function(el){\n                                if (!beautify && el[0] == \"atom\" && el[1] == \"undefined\") return \"\";\n                                return parenthesize(el, \"seq\");\n                        })), \"]\" ]);\n                },\n                \"stat\": function(stmt) {\n                        return make(stmt).replace(/;*\\s*$/, \";\");\n                },\n                \"seq\": function() {\n                        return add_commas(MAP(slice(arguments), make));\n                },\n                \"label\": function(name, block) {\n                        return add_spaces([ make_name(name), \":\", make(block) ]);\n                },\n                \"with\": function(expr, block) {\n                        return add_spaces([ \"with\", \"(\" + make(expr) + \")\", make(block) ]);\n                },\n                \"atom\": function(name) {\n                        return make_name(name);\n                }\n        };\n\n        // The squeezer replaces \"block\"-s that contain only a single\n        // statement with the statement itself; technically, the AST\n        // is correct, but this can create problems when we output an\n        // IF having an ELSE clause where the THEN clause ends in an\n        // IF *without* an ELSE block (then the outer ELSE would refer\n        // to the inner IF).  This function checks for this case and\n        // adds the block brackets if needed.\n        function make_then(th) {\n                if (th[0] == \"do\") {\n                        // https://github.com/mishoo/UglifyJS/issues/#issue/57\n                        // IE croaks with \"syntax error\" on code like this:\n                        //     if (foo) do ... while(cond); else ...\n                        // we need block brackets around do/while\n                        return make([ \"block\", [ th ]]);\n                }\n                var b = th;\n                while (true) {\n                        var type = b[0];\n                        if (type == \"if\") {\n                                if (!b[3])\n                                        // no else, we must add the block\n                                        return make([ \"block\", [ th ]]);\n                                b = b[3];\n                        }\n                        else if (type == \"while\" || type == \"do\") b = b[2];\n                        else if (type == \"for\" || type == \"for-in\") b = b[4];\n                        else break;\n                }\n                return make(th);\n        };\n\n        function make_function(name, args, body, keyword) {\n                var out = keyword || \"function\";\n                if (name) {\n                        out += \" \" + make_name(name);\n                }\n                out += \"(\" + add_commas(MAP(args, make_name)) + \")\";\n                return add_spaces([ out, make_block(body) ]);\n        };\n\n        function make_name(name) {\n                return name.toString();\n        };\n\n        function make_block_statements(statements) {\n                for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) {\n                        var stat = statements[i];\n                        var code = make(stat);\n                        if (code != \";\") {\n                                if (!beautify && i == last) {\n                                        if ((stat[0] == \"while\" && empty(stat[2])) ||\n                                            (member(stat[0], [ \"for\", \"for-in\"] ) && empty(stat[4])) ||\n                                            (stat[0] == \"if\" && empty(stat[2]) && !stat[3]) ||\n                                            (stat[0] == \"if\" && stat[3] && empty(stat[3]))) {\n                                                code = code.replace(/;*\\s*$/, \";\");\n                                        } else {\n                                                code = code.replace(/;+\\s*$/, \"\");\n                                        }\n                                }\n                                a.push(code);\n                        }\n                }\n                return MAP(a, indent);\n        };\n\n        function make_switch_block(body) {\n                var n = body.length;\n                if (n == 0) return \"{}\";\n                return \"{\" + newline + MAP(body, function(branch, i){\n                        var has_body = branch[1].length > 0, code = with_indent(function(){\n                                return indent(branch[0]\n                                              ? add_spaces([ \"case\", make(branch[0]) + \":\" ])\n                                              : \"default:\");\n                        }, 0.5) + (has_body ? newline + with_indent(function(){\n                                return make_block_statements(branch[1]).join(newline);\n                        }) : \"\");\n                        if (!beautify && has_body && i < n - 1)\n                                code += \";\";\n                        return code;\n                }).join(newline) + newline + indent(\"}\");\n        };\n\n        function make_block(statements) {\n                if (!statements) return \";\";\n                if (statements.length == 0) return \"{}\";\n                return \"{\" + newline + with_indent(function(){\n                        return make_block_statements(statements).join(newline);\n                }) + newline + indent(\"}\");\n        };\n\n        function make_1vardef(def) {\n                var name = def[0], val = def[1];\n                if (val != null)\n                        name = add_spaces([ name, \"=\", make(val) ]);\n                return name;\n        };\n\n        var $stack = [];\n\n        function make(node) {\n                var type = node[0];\n                var gen = generators[type];\n                if (!gen)\n                        throw new Error(\"Can't find generator for \\\"\" + type + \"\\\"\");\n                $stack.push(node);\n                var ret = gen.apply(type, node.slice(1));\n                $stack.pop();\n                return ret;\n        };\n\n        return make(ast);\n};\n\nfunction split_lines(code, max_line_length) {\n        var splits = [ 0 ];\n        jsp.parse(function(){\n                var next_token = jsp.tokenizer(code);\n                var last_split = 0;\n                var prev_token;\n                function current_length(tok) {\n                        return tok.pos - last_split;\n                };\n                function split_here(tok) {\n                        last_split = tok.pos;\n                        splits.push(last_split);\n                };\n                function custom(){\n                        var tok = next_token.apply(this, arguments);\n                        out: {\n                                if (prev_token) {\n                                        if (prev_token.type == \"keyword\") break out;\n                                }\n                                if (current_length(tok) > max_line_length) {\n                                        switch (tok.type) {\n                                            case \"keyword\":\n                                            case \"atom\":\n                                            case \"name\":\n                                            case \"punc\":\n                                                split_here(tok);\n                                                break out;\n                                        }\n                                }\n                        }\n                        prev_token = tok;\n                        return tok;\n                };\n                custom.context = function() {\n                        return next_token.context.apply(this, arguments);\n                };\n                return custom;\n        }());\n        return splits.map(function(pos, i){\n                return code.substring(pos, splits[i + 1] || code.length);\n        }).join(\"\\n\");\n};\n\n/* -----[ Utilities ]----- */\n\nfunction repeat_string(str, i) {\n        if (i <= 0) return \"\";\n        if (i == 1) return str;\n        var d = repeat_string(str, i >> 1);\n        d += d;\n        if (i & 1) d += str;\n        return d;\n};\n\nfunction defaults(args, defs) {\n        var ret = {};\n        if (args === true)\n                args = {};\n        for (var i in defs) if (HOP(defs, i)) {\n                ret[i] = (args && HOP(args, i)) ? args[i] : defs[i];\n        }\n        return ret;\n};\n\nfunction is_identifier(name) {\n        return /^[a-z_$][a-z0-9_$]*$/i.test(name)\n                && name != \"this\"\n                && !HOP(jsp.KEYWORDS_ATOM, name)\n                && !HOP(jsp.RESERVED_WORDS, name)\n                && !HOP(jsp.KEYWORDS, name);\n};\n\nfunction HOP(obj, prop) {\n        return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n\n// some utilities\n\nvar MAP;\n\n(function(){\n        MAP = function(a, f, o) {\n                var ret = [];\n                for (var i = 0; i < a.length; ++i) {\n                        var val = f.call(o, a[i], i);\n                        if (val instanceof AtTop) ret.unshift(val.v);\n                        else ret.push(val);\n                }\n                return ret;\n        };\n        MAP.at_top = function(val) { return new AtTop(val) };\n        function AtTop(val) { this.v = val };\n})();\n\n/* -----[ Exports ]----- */\n\nexports.ast_walker = ast_walker;\nexports.ast_mangle = ast_mangle;\nexports.ast_squeeze = ast_squeeze;\nexports.gen_code = gen_code;\nexports.ast_add_scope = ast_add_scope;\nexports.ast_squeeze_more = require(\"./squeeze-more\").ast_squeeze_more;\nexports.set_logger = function(logger) { warn = logger };\nexports.make_string = make_string;\nexports.split_lines = split_lines;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/View.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.View = function(element)\n{\n    this.element = element || document.createElement(\"div\");\n    this._visible = false;\n}\n\nWebInspector.View.prototype = {\n    get visible()\n    {\n        return this._visible;\n    },\n\n    set visible(x)\n    {\n        if (this._visible === x)\n            return;\n\n        if (x)\n            this.show();\n        else\n            this.hide();\n    },\n\n    show: function(parentElement)\n    {\n        this._visible = true;\n        if (parentElement && parentElement !== this.element.parentNode) {\n            this.detach();\n            parentElement.appendChild(this.element);\n        }\n        if (!this.element.parentNode && this.attach)\n            this.attach();\n        this.element.addStyleClass(\"visible\");\n    },\n\n    hide: function()\n    {\n        this.element.removeStyleClass(\"visible\");\n        this._visible = false;\n    },\n\n    detach: function()\n    {\n        if (this.element.parentNode)\n            this.element.parentNode.removeChild(this.element);\n    }\n}\n\nWebInspector.View.prototype.__proto__ = WebInspector.Object.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/WatchExpressionsSidebarPane.js",
    "content": "/*\n * Copyright (C) IBM Corp. 2009  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of IBM Corp. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.WatchExpressionsSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Watch Expressions\"));\n    this.reset();\n}\n\nWebInspector.WatchExpressionsSidebarPane.prototype = {\n    reset: function()\n    {\n        this.bodyElement.removeChildren();\n\n        this.expanded = WebInspector.settings.watchExpressions.length > 0;\n        this.section = new WebInspector.WatchExpressionsSection();\n        this.bodyElement.appendChild(this.section.element);\n\n        var addElement = document.createElement(\"button\");\n        addElement.setAttribute(\"type\", \"button\");\n        addElement.textContent = WebInspector.UIString(\"Add\");\n        addElement.addEventListener(\"click\", this.section.addExpression.bind(this.section), false);\n\n        var refreshElement = document.createElement(\"button\");\n        refreshElement.setAttribute(\"type\", \"button\");\n        refreshElement.textContent = WebInspector.UIString(\"Refresh\");\n        refreshElement.addEventListener(\"click\", this.section.update.bind(this.section), false);\n\n        var centerElement = document.createElement(\"div\");\n        centerElement.addStyleClass(\"watch-expressions-buttons-container\");\n        centerElement.appendChild(addElement);\n        centerElement.appendChild(refreshElement);\n        this.bodyElement.appendChild(centerElement);\n\n        this.onexpand = this.refreshExpressions.bind(this);\n    },\n\n    refreshExpressions: function()\n    {\n        if (this.section)\n            this.section.update();\n    }\n}\n\nWebInspector.WatchExpressionsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.WatchExpressionsSection = function()\n{\n    this._watchObjectGroupId = \"watch-group\";\n\n    WebInspector.ObjectPropertiesSection.call(this);\n\n    this.watchExpressions = WebInspector.settings.watchExpressions;\n\n    this.headerElement.className = \"hidden\";\n    this.editable = true;\n    this.expanded = true;\n    this.propertiesElement.addStyleClass(\"watch-expressions\");\n}\n\nWebInspector.WatchExpressionsSection.NewWatchExpression = \"\\xA0\";\n\nWebInspector.WatchExpressionsSection.prototype = {\n    update: function()\n    {\n        function appendResult(expression, watchIndex, result)\n        {\n            var property = new WebInspector.RemoteObjectProperty(expression, result);\n            property.watchIndex = watchIndex;\n\n            // To clarify what's going on here: \n            // In the outer function, we calculate the number of properties\n            // that we're going to be updating, and set that in the\n            // propertyCount variable.  \n            // In this function, we test to see when we are processing the \n            // last property, and then call the superclass's updateProperties() \n            // method to get all the properties refreshed at once.\n            properties.push(property);\n            \n            if (properties.length == propertyCount) {\n                this.updateProperties(properties, WebInspector.WatchExpressionTreeElement, WebInspector.WatchExpressionsSection.CompareProperties);\n\n                // check to see if we just added a new watch expression,\n                // which will always be the last property\n                if (this._newExpressionAdded) {\n                    delete this._newExpressionAdded;\n\n                    treeElement = this.findAddedTreeElement();\n                    if (treeElement)\n                        treeElement.startEditing();\n                }\n            }\n        }\n\n        // TODO: pass exact injected script id.\n        InspectorBackend.releaseWrapperObjectGroup(0, this._watchObjectGroupId)\n        var properties = [];\n\n        // Count the properties, so we known when to call this.updateProperties()\n        // in appendResult()\n        var propertyCount = 0;\n        for (var i = 0; i < this.watchExpressions.length; ++i) {\n            if (!this.watchExpressions[i]) \n                continue;\n            ++propertyCount;\n        }\n\n        // Now process all the expressions, since we have the actual count,\n        // which is checked in the appendResult inner function.\n        for (var i = 0; i < this.watchExpressions.length; ++i) {\n            var expression = this.watchExpressions[i];\n            if (!expression)\n                continue;\n\n            WebInspector.console.evalInInspectedWindow(\"(\" + expression + \")\", this._watchObjectGroupId, false, appendResult.bind(this, expression, i));\n        }\n\n        // note this is setting the expansion of the tree, not the section;\n        // with no expressions, and expanded tree, we get some extra vertical\n        // white space\n        // FIXME: should change to use header buttons instead of the buttons\n        // at the bottom of the section, then we can add a \"No Watch Expressions\n        // element when there are no watch expressions, and this issue should\n        // go away.\n        this.expanded = (propertyCount != 0);\n    },\n\n    addExpression: function()\n    {\n        this._newExpressionAdded = true;\n        this.watchExpressions.push(WebInspector.WatchExpressionsSection.NewWatchExpression);\n        this.update();\n    },\n\n    updateExpression: function(element, value)\n    {\n        this.watchExpressions[element.property.watchIndex] = value;\n        this.saveExpressions();\n        this.update();\n    },\n\n    findAddedTreeElement: function()\n    {\n        var children = this.propertiesTreeOutline.children;\n        for (var i = 0; i < children.length; ++i)\n            if (children[i].property.name === WebInspector.WatchExpressionsSection.NewWatchExpression)\n                return children[i];\n    },\n\n    saveExpressions: function()\n    {\n        var toSave = [];\n        for (var i = 0; i < this.watchExpressions.length; i++)\n            if (this.watchExpressions[i])\n                toSave.push(this.watchExpressions[i]);\n\n        WebInspector.settings.watchExpressions = toSave;\n        return toSave.length;\n    }\n}\n\nWebInspector.WatchExpressionsSection.prototype.__proto__ = WebInspector.ObjectPropertiesSection.prototype;\n\nWebInspector.WatchExpressionsSection.CompareProperties = function(propertyA, propertyB) \n{\n    if (propertyA.watchIndex == propertyB.watchIndex)\n        return 0;\n    else if (propertyA.watchIndex < propertyB.watchIndex)\n        return -1;\n    else\n        return 1;\n}\n\nWebInspector.WatchExpressionTreeElement = function(property)\n{\n    WebInspector.ObjectPropertyTreeElement.call(this, property);\n}\n\nWebInspector.WatchExpressionTreeElement.prototype = {\n    update: function()\n    {\n        WebInspector.ObjectPropertyTreeElement.prototype.update.call(this);\n\n        if (this.property.value.isError())\n            this.valueElement.addStyleClass(\"watch-expressions-error-level\");\n\n        var deleteButton = document.createElement(\"input\");\n        deleteButton.type = \"button\";\n        deleteButton.title = WebInspector.UIString(\"Delete watch expression.\");\n        deleteButton.addStyleClass(\"enabled-button\");\n        deleteButton.addStyleClass(\"delete-button\");\n        deleteButton.addEventListener(\"click\", this._deleteButtonClicked.bind(this), false);\n\n        this.listItemElement.insertBefore(deleteButton, this.listItemElement.firstChild);\n    },\n\n    _deleteButtonClicked: function()\n    {\n        this.treeOutline.section.updateExpression(this, null);\n    },\n\n    startEditing: function()\n    {\n        if (WebInspector.isBeingEdited(this.nameElement) || !this.treeOutline.section.editable)\n            return;\n\n        this.nameElement.textContent = this.property.name.trim();\n\n        var context = { expanded: this.expanded };\n\n        // collapse temporarily, if required\n        this.hasChildren = false;\n\n        this.listItemElement.addStyleClass(\"editing-sub-part\");\n\n        WebInspector.startEditing(this.nameElement, {\n            context: context,\n            commitHandler: this.editingCommitted.bind(this),\n            cancelHandler: this.editingCancelled.bind(this)\n        });\n    },\n\n    editingCancelled: function(element, context)\n    {\n        if (!this.nameElement.textContent)\n            this.treeOutline.section.updateExpression(this, null);\n            \n        this.update();\n        this.editingEnded(context);\n    },\n\n    applyExpression: function(expression, updateInterface)\n    {\n        expression = expression.trim();\n\n        if (!expression)\n            expression = null;\n\n        this.property.name = expression;\n        this.treeOutline.section.updateExpression(this, expression);\n    }\n}\n\nWebInspector.WatchExpressionTreeElement.prototype.__proto__ = WebInspector.ObjectPropertyTreeElement.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/WebKit.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource prefix=\"/webkit/inspector\">\n    <file>inspector.html</file>\n    <file>ApplicationCacheItemsView.js</file>\n    <file>AuditCategories.js</file>\n    <file>AuditFormatters.js</file>\n    <file>AuditLauncherView.js</file>\n    <file>AuditResultView.js</file>\n    <file>AuditRules.js</file>\n    <file>AuditsPanel.js</file>\n    <file>BottomUpProfileDataGridTree.js</file>\n    <file>Breakpoint.js</file>\n    <file>BreakpointManager.js</file>\n    <file>BreakpointsSidebarPane.js</file>\n    <file>CallStackSidebarPane.js</file>\n    <file>Checkbox.js</file>\n    <file>Color.js</file>\n    <file>ConsolePanel.js</file>\n    <file>ConsoleView.js</file>\n    <file>ContextMenu.js</file>\n    <file>CookieItemsView.js</file>\n    <file>CookieParser.js</file>\n    <file>CookiesTable.js</file>\n    <file>CSSCompletions.js</file>\n    <file>CSSKeywordCompletions.js</file>\n    <file>CSSStyleModel.js</file>\n    <file>Database.js</file>\n    <file>DatabaseQueryView.js</file>\n    <file>DatabaseTableView.js</file>\n    <file>DetailedHeapshotView.js</file>\n    <file>DataGrid.js</file>\n    <file>DebuggerModel.js</file>\n    <file>DOMAgent.js</file>\n    <file>DOMStorage.js</file>\n    <file>DOMStorageItemsView.js</file>\n    <file>DOMSyntaxHighlighter.js</file>\n    <file>Drawer.js</file>\n    <file>ElementsPanel.js</file>\n    <file>ElementsTreeOutline.js</file>\n    <file>EventListenersSidebarPane.js</file>\n    <file>ExtensionAPI.js</file>\n    <file>ExtensionAuditCategory.js</file>\n    <file>ExtensionCommon.js</file>\n    <file>ExtensionPanel.js</file>\n    <file>ExtensionRegistryStub.js</file>\n    <file>ExtensionServer.js</file>\n    <file>FontView.js</file>\n    <file>GoToLineDialog.js</file>\n    <file>HAREntry.js</file>\n    <file>HeapSnapshot.js</file>\n    <file>HeapSnapshotView.js</file>\n    <file>HelpScreen.js</file>\n    <file>ImageView.js</file>\n    <file>InjectedFakeWorker.js</file>\n    <file>inspector.js</file>\n    <file>InspectorFrontendHostStub.js</file>\n    <file>KeyboardShortcut.js</file>\n    <file>MetricsSidebarPane.js</file>\n    <file>NetworkItemView.js</file>\n    <file>NetworkManager.js</file>\n    <file>NetworkPanel.js</file>\n    <file>Object.js</file>\n    <file>ObjectPropertiesSection.js</file>\n    <file>Panel.js</file>\n    <file>PanelEnablerView.js</file>\n    <file>Placard.js</file>\n    <file>PleaseWaitMessage.js</file>\n    <file>Popover.js</file>\n    <file>ProfileDataGridTree.js</file>\n    <file>ProfilesPanel.js</file>\n    <file>ProfileView.js</file>\n    <file>PropertiesSection.js</file>\n    <file>PropertiesSidebarPane.js</file>\n    <file>RemoteObject.js</file>\n    <file>Resource.js</file>\n    <file>ResourceCategory.js</file>\n    <file>ResourceCookiesView.js</file>\n    <file>ResourceHeadersView.js</file>\n    <file>ResourceTimingView.js</file>\n    <file>ResourceTreeModel.js</file>\n    <file>ResourceView.js</file>\n    <file>ResourcesPanel.js</file>\n    <file>ScopeChainSidebarPane.js</file>\n    <file>Script.js</file>\n    <file>ScriptFormatter.js</file>\n    <file>ScriptFormatterWorker.js</file>\n    <file>ScriptsPanel.js</file>\n    <file>Section.js</file>\n    <file>Settings.js</file>\n    <file>ShortcutsHelp.js</file>\n    <file>ShowMoreDataGridNode.js</file>\n    <file>SidebarPane.js</file>\n    <file>SidebarTreeElement.js</file>\n    <file>SourceCSSTokenizer.js</file>\n    <file>SourceFrame.js</file>\n    <file>SourceFrameContent.js</file>\n    <file>SourceHTMLTokenizer.js</file>\n    <file>SourceJavaScriptTokenizer.js</file>\n    <file>SourceTokenizer.js</file>\n    <file>StatusBarButton.js</file>\n    <file>StylesSidebarPane.js</file>\n    <file>SummaryBar.js</file>\n    <file>TabbedPane.js</file>\n    <file>TestController.js</file>\n    <file>TextEditorHighlighter.js</file>\n    <file>TextEditorModel.js</file>\n    <file>TextPrompt.js</file>\n    <file>TextViewer.js</file>\n    <file>TimelineAgent.js</file>\n    <file>TimelineGrid.js</file>\n    <file>TimelineOverviewPane.js</file>\n    <file>TimelinePanel.js</file>\n    <file>TopDownProfileDataGridTree.js</file>\n    <file>treeoutline.js</file>\n    <file>utilities.js</file>\n    <file>View.js</file>\n    <file>WatchExpressionsSidebarPane.js</file>\n    <file>WelcomeView.js</file>\n    <file>WorkersSidebarPane.js</file>\n    <file>UglifyJS/parse-js.js</file>\n    <file>UglifyJS/process.js</file>\n    <file>audits.css</file>\n    <file>goToLineDialog.css</file>\n    <file>heapProfiler.css</file>\n    <file>helpScreen.css</file>\n    <file>inspector.css</file>\n    <file>inspectorSyntaxHighlight.css</file>\n    <file>networkPanel.css</file>\n    <file>popover.css</file>\n    <file>textViewer.css</file>\n    <file>Images/applicationCache.png</file>\n    <file>Images/auditsIcon.png</file>\n    <file>Images/back.png</file>\n    <file>Images/breakpointBorder.png</file>\n    <file>Images/breakpointConditionalBorder.png</file>\n    <file>Images/breakpointConditionalCounterBorder.png</file>\n    <file>Images/breakpointCounterBorder.png</file>\n    <file>Images/breakpointsActivateButtonGlyph.png</file>\n    <file>Images/breakpointsDeactivateButtonGlyph.png</file>\n    <file>Images/checker.png</file>\n    <file>Images/clearConsoleButtonGlyph.png</file>\n    <file>Images/closeButtons.png</file>\n    <file>Images/consoleButtonGlyph.png</file>\n    <file>Images/cookie.png</file>\n    <file>Images/consoleIcon.png</file>\n    <file>Images/database.png</file>\n    <file>Images/databaseTable.png</file>\n    <file>Images/debuggerContinue.png</file>\n    <file>Images/debuggerPause.png</file>\n    <file>Images/debuggerStepInto.png</file>\n    <file>Images/debuggerStepOut.png</file>\n    <file>Images/debuggerStepOver.png</file>\n    <file>Images/disclosureTriangleSmallDown.png</file>\n    <file>Images/disclosureTriangleSmallDownBlack.png</file>\n    <file>Images/disclosureTriangleSmallDownWhite.png</file>\n    <file>Images/disclosureTriangleSmallRight.png</file>\n    <file>Images/disclosureTriangleSmallRightBlack.png</file>\n    <file>Images/disclosureTriangleSmallRightDown.png</file>\n    <file>Images/disclosureTriangleSmallRightDownBlack.png</file>\n    <file>Images/disclosureTriangleSmallRightDownWhite.png</file>\n    <file>Images/disclosureTriangleSmallRightWhite.png</file>\n    <file>Images/dockButtonGlyph.png</file>\n    <file>Images/elementsIcon.png</file>\n    <file>Images/enableOutlineButtonGlyph.png</file>\n    <file>Images/enableSolidButtonGlyph.png</file>\n    <file>Images/errorIcon.png</file>\n    <file>Images/errorMediumIcon.png</file>\n    <file>Images/errorRedDot.png</file>\n    <file>Images/excludeButtonGlyph.png</file>\n    <file>Images/focusButtonGlyph.png</file>\n    <file>Images/forward.png</file>\n    <file>Images/frame.png</file>\n    <file>Images/gearButtonGlyph.png</file>\n    <file>Images/glossyHeader.png</file>\n    <file>Images/glossyHeaderPressed.png</file>\n    <file>Images/glossyHeaderSelected.png</file>\n    <file>Images/glossyHeaderSelectedPressed.png</file>\n    <file>Images/goArrow.png</file>\n    <file>Images/graphLabelCalloutLeft.png</file>\n    <file>Images/graphLabelCalloutRight.png</file>\n    <file>Images/largerResourcesButtonGlyph.png</file>\n    <file>Images/localStorage.png</file>\n    <file>Images/networkIcon.png</file>\n    <file>Images/nodeSearchButtonGlyph.png</file>\n    <file>Images/paneAddButtons.png</file>\n    <file>Images/paneBottomGrow.png</file>\n    <file>Images/paneBottomGrowActive.png</file>\n    <file>Images/paneGrowHandleLine.png</file>\n    <file>Images/paneSettingsButtons.png</file>\n    <file>Images/pauseOnExceptionButtonGlyph.png</file>\n    <file>Images/percentButtonGlyph.png</file>\n    <file>Images/popoverArrows.png</file>\n    <file>Images/popoverBackground.png</file>\n    <file>Images/profileGroupIcon.png</file>\n    <file>Images/profileIcon.png</file>\n    <file>Images/profilesIcon.png</file>\n    <file>Images/profileSmallIcon.png</file>\n    <file>Images/profilesSilhouette.png</file>\n    <file>Images/programCounterBorder.png</file>\n    <file>Images/radioDot.png</file>\n    <file>Images/recordButtonGlyph.png</file>\n    <file>Images/recordToggledButtonGlyph.png</file>\n    <file>Images/reloadButtonGlyph.png</file>\n    <file>Images/resourceCSSIcon.png</file>\n    <file>Images/resourceDocumentIcon.png</file>\n    <file>Images/resourceDocumentIconSmall.png</file>\n    <file>Images/resourceJSIcon.png</file>\n    <file>Images/resourcePlainIcon.png</file>\n    <file>Images/resourcePlainIconSmall.png</file>\n    <file>Images/resourcesIcon.png</file>\n    <file>Images/resourcesSizeGraphIcon.png</file>\n    <file>Images/resourcesTimeGraphIcon.png</file>\n    <file>Images/scriptsIcon.png</file>\n    <file>Images/scriptsSilhouette.png</file>\n    <file>Images/searchSmallBlue.png</file>\n    <file>Images/searchSmallBrightBlue.png</file>\n    <file>Images/searchSmallGray.png</file>\n    <file>Images/searchSmallWhite.png</file>\n    <file>Images/segment.png</file>\n    <file>Images/segmentEnd.png</file>\n    <file>Images/segmentHover.png</file>\n    <file>Images/segmentHoverEnd.png</file>\n    <file>Images/segmentSelected.png</file>\n    <file>Images/segmentSelectedEnd.png</file>\n    <file>Images/sessionStorage.png</file>\n    <file>Images/spinner.gif</file>\n    <file>Images/splitviewDimple.png</file>\n    <file>Images/splitviewDividerBackground.png</file>\n    <file>Images/statusbarBackground.png</file>\n    <file>Images/statusbarBottomBackground.png</file>\n    <file>Images/statusbarButtons.png</file>\n    <file>Images/statusbarMenuButton.png</file>\n    <file>Images/statusbarMenuButtonSelected.png</file>\n    <file>Images/statusbarResizerHorizontal.png</file>\n    <file>Images/statusbarResizerVertical.png</file>\n    <file>Images/successGreenDot.png</file>\n    <file>Images/thumbActiveHoriz.png</file>\n    <file>Images/thumbActiveVert.png</file>\n    <file>Images/thumbHoriz.png</file>\n    <file>Images/thumbVert.png</file>\n    <file>Images/thumbHoverHoriz.png</file>\n    <file>Images/thumbHoverVert.png</file>\n    <file>Images/timelineBarBlue.png</file>\n    <file>Images/timelineBarGray.png</file>\n    <file>Images/timelineBarGreen.png</file>\n    <file>Images/timelineBarOrange.png</file>\n    <file>Images/timelineBarPurple.png</file>\n    <file>Images/timelineBarRed.png</file>\n    <file>Images/timelineBarYellow.png</file>\n    <file>Images/timelineCheckmarks.png</file>\n    <file>Images/timelineDots.png</file>\n    <file>Images/timelineHollowPillBlue.png</file>\n    <file>Images/timelineHollowPillGray.png</file>\n    <file>Images/timelineHollowPillGreen.png</file>\n    <file>Images/timelineHollowPillOrange.png</file>\n    <file>Images/timelineHollowPillPurple.png</file>\n    <file>Images/timelineHollowPillRed.png</file>\n    <file>Images/timelineHollowPillYellow.png</file>\n    <file>Images/timelineIcon.png</file>\n    <file>Images/timelinePillBlue.png</file>\n    <file>Images/timelinePillGray.png</file>\n    <file>Images/timelinePillGreen.png</file>\n    <file>Images/timelinePillOrange.png</file>\n    <file>Images/timelinePillPurple.png</file>\n    <file>Images/timelinePillRed.png</file>\n    <file>Images/timelinePillYellow.png</file>\n    <file>Images/toolbarItemSelected.png</file>\n    <file>Images/trackHoriz.png</file>\n    <file>Images/trackVert.png</file>\n    <file>Images/treeDownTriangleBlack.png</file>\n    <file>Images/treeDownTriangleWhite.png</file>\n    <file>Images/treeRightTriangleBlack.png</file>\n    <file>Images/treeRightTriangleWhite.png</file>\n    <file>Images/treeUpTriangleBlack.png</file>\n    <file>Images/treeUpTriangleWhite.png</file>\n    <file>Images/undockButtonGlyph.png</file>\n    <file>Images/userInputIcon.png</file>\n    <file>Images/userInputPreviousIcon.png</file>\n    <file>Images/userInputResultIcon.png</file>\n    <file>Images/warningIcon.png</file>\n    <file>Images/warningMediumIcon.png</file>\n    <file>Images/warningOrangeDot.png</file>\n    <file>Images/warningsErrors.png</file>\n    <file alias=\"DebuggerScript.js\">../../bindings/v8/DebuggerScript.js</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/WelcomeView.js",
    "content": "/*\n * Copyright (C) 2008 Apple Inc. All Rights Reserved.\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.WelcomeView = function(identifier, headingText, instructionsText)\n{\n    WebInspector.View.call(this);\n\n    this.element.addStyleClass(\"panel-enabler-view\");\n    this.element.addStyleClass(identifier);\n    this.element.addStyleClass(\"welcome\");\n\n    this.contentElement = document.createElement(\"div\");\n    this.contentElement.className = \"panel-enabler-view-content\";\n    this.element.appendChild(this.contentElement);\n\n    this.alignerElement = document.createElement(\"div\");\n    this.alignerElement.className = \"welcome-instructions-aligner\";\n    this.contentElement.appendChild(this.alignerElement);\n\n    this.instructionsElement = document.createElement(\"div\");\n    this.instructionsElement.className = \"instructions\";\n    this.contentElement.appendChild(this.instructionsElement);\n\n    this.headerElement = document.createElement(\"h1\");\n    this.headerElement.textContent = headingText;\n    this.instructionsElement.appendChild(this.headerElement);\n\n    if (instructionsText)\n        this.addMessage(instructionsText);\n}\n\nWebInspector.WelcomeView.prototype = {\n    addMessage: function(message)\n    {\n        var messageElement = document.createElement(\"div\");\n        messageElement.className = \"message\";\n        if (typeof message == \"string\")\n            // Message text can contain <br> tags for better text balancing, so we\n            // put it into elements using 'innerHTML', not 'textContent'.\n            messageElement.innerHTML = message;\n        else\n            messageElement.appendChild(message);\n        this.instructionsElement.appendChild(messageElement);\n    }\n}\n\nWebInspector.WelcomeView.prototype.__proto__ = WebInspector.View.prototype;\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/WorkersSidebarPane.js",
    "content": "/*\n * Copyright (C) 2010 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nWebInspector.WorkersSidebarPane = function()\n{\n    WebInspector.SidebarPane.call(this, WebInspector.UIString(\"Workers\"));\n    \n    this._workers = {};\n\n    this._enableWorkersCheckbox = new WebInspector.Checkbox(\n        WebInspector.UIString(\"Debug\"),\n        \"sidebar-pane-subtitle\",\n        WebInspector.UIString(\"Allow debugging workers. Enabling this option will replace native workers with the iframe-based JavaScript implementation\"));\n    this.titleElement.insertBefore(this._enableWorkersCheckbox.element, this.titleElement.firstChild);\n\n    this._enableWorkersCheckbox.addEventListener(this._onTriggerInstrument.bind(this));\n    this._enableWorkersCheckbox.checked = false;\n\n    this._listElement = document.createElement(\"ol\");\n    this._listElement.className = \"workers-list\";\n\n    this.bodyElement.appendChild(this._listElement);\n    this._treeOutline = new TreeOutline(this._listElement);\n}\n\nWebInspector.WorkersSidebarPane.prototype = {\n    addWorker: function(id, url, isShared)\n    {\n        if (id in this._workers) \n            return;\n        var worker = new WebInspector.Worker(id, url, isShared);\n        this._workers[id] = worker;\n\n        var title = WebInspector.linkifyURL(url, WebInspector.displayNameForURL(url), \"worker-item\", true, url);\n        var treeElement = new TreeElement(null, worker, false);\n        treeElement.titleHTML = title;\n        this._treeOutline.appendChild(treeElement);\n    },\n\n    removeWorker: function(id)\n    {\n        if (id in this._workers) {\n            this._treeOutline.removeChild(this._treeOutline.findTreeElement(this._workers[id]));\n            delete this._workers[id];\n        }\n    },\n\n    setInstrumentation: function(enabled)\n    {\n        InspectorBackend.removeAllScriptsToEvaluateOnLoad();\n        if (enabled)\n            InspectorBackend.addScriptToEvaluateOnLoad(\"(\" + InjectedFakeWorker + \")\");\n    },\n\n    reset: function()\n    {\n        this.setInstrumentation(this._enableWorkersCheckbox.checked);\n        this._treeOutline.removeChildren();\n        this._workers = {};\n    },\n\n    _onTriggerInstrument: function(event)\n    {\n        this.setInstrumentation(this._enableWorkersCheckbox.checked);\n    }\n};\n\nWebInspector.WorkersSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;\n\nWebInspector.Worker = function(id, url, shared)\n{\n    this.id = id;\n    this.url = url;\n    this.shared = shared;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/audits.css",
    "content": "/*\n * Copyright (C) 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.audits-sidebar-tree-item .icon {\n    content: url(Images/resourcesTimeGraphIcon.png);\n}\n\n.audit-result-sidebar-tree-item .icon {\n    content: url(Images/resourceDocumentIcon.png);\n}\n\n#audit-views {\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 200px;\n    bottom: 0;\n    overflow: auto;\n}\n\n.audit-launcher-view {\n    z-index: 1000;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background-color: white;\n    font-size: 13px;\n    overflow-x: hidden;\n    overflow-y: overlay;\n    display: none;\n}\n\n.audit-launcher-view.visible {\n    display: block;\n}\n\n.audit-launcher-view .audit-launcher-view-content {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    padding: 0 0 0 16px;\n    white-space: nowrap;\n    display: -webkit-box;\n    -webkit-box-orient: vertical;\n}\n\n.audit-launcher-view h1 {\n    color: rgb(110, 116, 128);\n    font-size: 16px;\n    line-height: 20px;\n    font-weight: normal;\n    padding-top: 15px;\n}\n\n.audit-launcher-view h1.no-audits {\n    text-align: center;\n    font-style: italic;\n    position: relative;\n    left: -8px;\n}\n\n.audit-launcher-view div.button-container {\n    display: -webkit-box;\n    -webkit-box-orient: vertical;\n    width: 100%;\n    padding: 16px 0;\n}\n.audit-launcher-view .flexible-space {\n    -webkit-box-flex: 1;\n}\n\n.audit-launcher-view div.audit-categories-container {\n    position: relative;\n    top: 11px;\n    left: 0;\n    width: 100%;\n    overflow-y: auto;\n}\n\n.audit-launcher-view button {\n    color: rgb(6, 6, 6);\n    background-color: transparent;\n    border: 1px solid rgb(165, 165, 165);\n    background-color: rgb(237, 237, 237);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));\n    -webkit-border-radius: 12px;\n    -webkit-appearance: none;\n}\n\n.audit-launcher-view button {\n    font-size: 13px;\n    padding: 3px 20px;\n    height: 24px;\n    margin: 0 5px 0 0;\n}\n\n.audit-launcher-view button:active {\n    background-color: rgb(215, 215, 215);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));\n}\n\nbody.inactive .audit-launcher-view button, .audit-launcher-view button:disabled {\n    color: rgb(130, 130, 130);\n    border-color: rgb(212, 212, 212);\n    background-color: rgb(239, 239, 239);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(250, 250, 250)), to(rgb(235, 235, 235)));\n}\n\n.audit-launcher-view label {\n    position: relative;\n    display: block;\n    text-align: left;\n    word-break: break-word;\n    padding: 0 0 5px 0;\n}\n\n.audit-launcher-view label.disabled {\n    color: rgb(130, 130, 130);\n}\n\n.audit-launcher-view input[type=\"checkbox\"] {\n    margin-left: 0;\n}\n\n.audit-launcher-view input[type=\"radio\"] {\n    height: 17px;\n    width: 17px;\n    border: 1px solid rgb(165, 165, 165);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));\n    -webkit-border-radius: 8px;\n    -webkit-appearance: none;\n    vertical-align: middle;\n    margin: 0 5px 5px 0;\n}\n\n.audit-launcher-view input[type=\"radio\"]:active:not(:disabled) {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));\n}\n\n.audit-launcher-view input[type=\"radio\"]:checked:not(:disabled), .audit-launcher-view input[type=\"radio\"]:checked:disabled {\n    background: url(Images/radioDot.png) center no-repeat,\n                -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));\n}\n\n.audit-launcher-view .resource-progress > img {\n    content: url(Images/spinner.gif);\n    vertical-align: text-top;\n    margin: 0 4px 0 8px;\n}\n\n.audit-result-view {\n    overflow: auto;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    display: none;\n}\n\n.audit-result-view.visible {\n    display: block;\n}\n\n.audit-result-view .severity-severe {\n    content: url(Images/errorRedDot.png);\n}\n\n.audit-result-view .severity-warning {\n    content: url(Images/warningOrangeDot.png);\n}\n\n.audit-result-view .severity-info {\n    content: url(Images/successGreenDot.png);\n}\n\n.audit-result-tree li.parent::before {\n    content: url(Images/treeRightTriangleBlack.png);\n    float: left;\n    width: 8px;\n    height: 8px;\n    margin-top: 1px;\n    padding-right: 2px;\n}\n\n.audit-result-tree {\n    font-size: 11px;\n    line-height: 14px;\n    -webkit-user-select: text;\n}\n\n.audit-result-tree > ol {\n    position: relative;\n    padding: 2px 6px !important;\n    margin: 0;\n    color: rgb(84, 84, 84);\n    cursor: default;\n    min-width: 100%;\n}\n\n.audit-result-tree, .audit-result-tree ol {\n    list-style-type: none;\n    -webkit-padding-start: 12px;\n    margin: 0;\n}\n\n.audit-result-tree li {\n    padding: 0 0 0 14px;\n    margin-top: 1px;\n    margin-bottom: 1px;\n    word-wrap: break-word;\n    text-indent: -2px;\n}\n\n.audit-result-tree li.parent {\n    text-indent: -12px\n}\n\n.audit-result-tree li.parent::before {\n    content: url(Images/treeRightTriangleBlack.png);\n    float: left;\n    width: 8px;\n    height: 8px;\n    margin-top: 0;\n    padding-right: 2px;\n}\n\n.audit-result-tree li.parent.expanded::before {\n    content: url(Images/treeDownTriangleBlack.png);\n}\n\n.audit-result-tree ol.children {\n    display: none;\n}\n\n.audit-result-tree ol.children.expanded {\n    display: block;\n}\n\n.audit-result {\n    font-weight: bold;\n    color: black;\n}\n\n.audit-result img {\n    float: left;\n    margin-left: -40px;\n    margin-top: -1px;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/goToLineDialog.css",
    "content": ".go-to-line-dialog {\n    position: absolute;\n    top: 40%;\n    left: 40%;\n    z-index: 1900;\n\n    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#E9E9E9), to(#CFCFCF));\n    display: -webkit-box;\n    -webkit-box-orient: vertical;\n    padding: 10px;\n    border-radius: 10px;\n    border: 1px solid gray;\n    -webkit-box-shadow: rgb(40,40,40) 0px 0px 50px;\n\n    font-size: 11px;\n    font-family: 'Lucida Grande', sans-serif;\n}\n\n.go-to-line-dialog input {\n    font-size: 11px;\n}\n\n.go-to-line-dialog button {\n    font-size: 11px;\n    color: rgb(6, 6, 6);\n    border: 1px solid rgb(165, 165, 165);\n    background-color: rgb(237, 237, 237);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));\n    -webkit-border-radius: 12px;\n    -webkit-appearance: none;\n\n    padding: 3px 20px;\n    margin: 0 0 0 10px;\n}\n\n.go-to-line-dialog button:active {\n    background-color: rgb(215, 215, 215);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/heapProfiler.css",
    "content": "/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n * Copyright (C) 2010 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.heap-snapshot-sidebar-tree-item .icon {\n    content: url(Images/profileIcon.png);\n}\n\n.heap-snapshot-sidebar-tree-item.small .icon {\n    content: url(Images/profileSmallIcon.png);\n}\n\n.heap-snapshot-view {\n    display: none;\n    overflow: hidden;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n}\n\n.heap-snapshot-view.visible {\n    display: block;\n}\n\n.heap-snapshot-view .data-grid {\n    border: none;\n    max-height: 100%;\n    position: absolute;\n    left: 0;\n    right: 0;\n    top: 0;\n    bottom: 93px;\n}\n\n.heap-snapshot-view .data-grid th.count-column {\n    text-align: center;\n}\n\n.heap-snapshot-view .data-grid td.count-column {\n    text-align: right;\n}\n\n.heap-snapshot-view .data-grid th.size-column {\n    text-align: center;\n}\n\n.heap-snapshot-view .data-grid td.size-column {\n    text-align: right;\n}\n\n.heap-snapshot-view .data-grid th.countDelta-column {\n    text-align: center;\n}\n\n.heap-snapshot-view .data-grid td.countDelta-column {\n    text-align: right;\n}\n\n.heap-snapshot-view .data-grid th.sizeDelta-column {\n    text-align: center;\n}\n\n.heap-snapshot-view .data-grid td.sizeDelta-column {\n    text-align: right;\n}\n\n#heap-snapshot-summary-container {\n    position: absolute;\n    padding-top: 20px;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    height: 93px;\n    margin-left: -1px;\n    border-left: 1px solid rgb(102, 102, 102);\n    background-color: rgb(101, 111, 130);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));\n    background-repeat: repeat-x;\n    background-position: top;\n    text-align: center;\n    text-shadow: black 0 1px 1px;\n    white-space: nowrap;\n    color: white;\n    -webkit-background-size: 1px 6px;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n}\n\n.heap-snapshot-summary {\n    display: inline-block;\n    width: 50%;\n    min-width: 300px;\n    position: relative;\n}\n\n.heap-snapshot-summary canvas.summary-graph {\n    width: 225px;\n}\n\n.heap-snapshot-summary-label {\n    font-size: 12px;\n    font-weight: bold;\n    position: absolute;\n    top: 1px;\n    width: 50%;\n    left: 25%;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/helpScreen.css",
    "content": ".help-window-outer {\n    position: absolute;\n    top: 60px;\n    left: 5%;\n    width: 90%;\n    bottom: 40px;\n    z-index: 2000;\n}\n\nbody.attached .help-window-outer {\n    top: 32px;\n    left: 0;\n    width: 100%;\n    bottom: 24px;\n}\n\n.help-window-main {\n    max-height: 100%;\n    opacity: 0.85;\n    color: white;\n    background-color: black;\n    display: -webkit-box;\n    -webkit-box-orient: vertical;\n    border: 20px black solid;\n    border-top-width: 0;\n    border-radius: 8px;\n    -webkit-box-shadow: 10px 10px 8px rgba(40, 40, 40, 0.40);\n}\n\nbody.attached .help-window-main {\n    border-width: 10px;\n    border-radius: 0;\n    -webkit-box-shadow: 0 0 0;\n}\n\n.help-window-caption {\n    margin: 8px;\n}\n\nbody.attached .help-window-caption {\n    display: none;\n}\n\n.help-window-title {\n    border-bottom: solid 1px lightGrey;\n    font-size: 18px;\n    padding-bottom: 6px;\n}\n\n.help-content {\n    overflow-y: auto;\n    overflow-x: hidden;\n    scrollbar-width: 11px;\n    -webkit-box-flex: 1;\n}\n\n.help-content::-webkit-scrollbar {\n    width: 11px;\n}\n\n.help-content::-webkit-scrollbar-corner,\n.help-content::-webkit-resizer {\n    display: none;\n}\n\n.help-content::-webkit-scrollbar-thumb:vertical {\n    background: -webkit-gradient(linear, left top, right top, from(rgb(128, 128, 128)), to(rgb(128, 128, 128)), color-stop(40%, rgb(96, 96, 96)));\n    border-radius: 5px;\n    min-height: 20px;\n}\n\n.help-content::-webkit-scrollbar-thumb:vertical:hover,\n.help-content::-webkit-scrollbar-thumb:vertical:active {\n    background: -webkit-gradient(linear, left top, right top, from(rgb(176, 176, 176)), to(rgb(176, 176, 176)), color-stop(40%, rgb(144, 144, 144)));\n}\n\n.help-content::-webkit-scrollbar-track:vertical {\n    background: -webkit-gradient(linear, left top, right top, from(rgb(10, 10, 10)), to(rgb(32, 32, 32)), color-stop(25%, rgb(32, 32, 32)));\n    border-radius: 5px;\n}\n\n.help-close-button {\n    border: 0;\n    padding: 0;\n    margin: 0px -20px 15px -20px;\n    font-size: 14px;\n    color: rgb(222, 222, 222);\n    background: -webkit-gradient(radial, 30% 30%, 1, 50% 50%, 8, from(rgb(128, 128, 128)), to(rgb(80, 80, 80)));\n    border-radius: 8px;\n    height: 16px;\n    width: 16px;\n}\n\n.help-close-button:hover {\n    color: white;\n}\n\nbody.platform-mac .help-close-button {\n    float: left;\n    margin-right: 10px;\n    font-size: 12px;\n}\n\nbody:not(.platform-mac) .help-close-button {\n    float: right;\n}\n\n.help-table {\n    width: 100%;\n    font-size: 13px;\n    -webkit-user-select: auto;\n}\n\n.help-table th {\n    padding-top: 6px;\n    text-align: left;\n    color: yellow;\n}\n\n.help-table td {\n    white-space: nowrap;\n    vertical-align: top;\n}\n\n.help-key-cell {\n    text-align: right;\n}\n\n.help-key {\n    color: yellow;\n}\n\nbody:not(.platform-mac) .help-key {\n    font-weight: bold;\n    text-shadow: black 1px 1px 7px;\n}\n\nbody.platform-mac .help-key {\n    font-family: Lucida Grande, sans-serif;\n    font-size: 13px;\n}\n\n.help-combine-keys {\n    color: white;\n    font-weight: bold;\n    margin: 0 0.3em;\n    font-size: 12px;\n}\n\n.help-key-delimiter {\n    color: white;\n    margin: 0 0.5em;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/index.html",
    "content": "<!--\nCopyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1.  Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n2.  Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n    its contributors may be used to endorse or promote products derived\n    from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n-->\n<!DOCTYPE html>\n<html>\n<head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n<!-- ========== weinre additions: starting ========== -->\n<meta http-equiv=\"X-UA-Compatible\" content=\"chrome=1\">\n<link rel=\"shortcut icon\" href=\"../images/weinre-icon-64x64.png\">\n<title>weinre</title>\n<script type=\"text/javascript\" src=\"weinre/browser-support-check.js\"></script>\n<script type=\"text/javascript\" src=\"weinre/hacks.js\"></script>\n<script type=\"text/javascript\" src=\"../modjewel.js\"></script>\n<script type=\"text/javascript\">modjewel.require(\"modjewel\").warnOnRecursiveRequire(true)</script>\n<script type=\"text/javascript\" src=\"../weinre/common/Binding.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/Callback.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/Debug.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/EventListeners.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/Ex.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/HookLib.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/IDGenerator.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/IDLTools.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/MessageDispatcher.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/MethodNamer.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/StackTrace.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/WebSocketXhr.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/common/Weinre.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/Client.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/ConnectorList.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/DOMTemplates.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/ExtensionRegistryImpl.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/InspectorBackendImpl.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/InspectorFrontendHostImpl.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/RemotePanel.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/WeinreClientEventsImpl.amd.js\"></script>\n<script type=\"text/javascript\" src=\"../weinre/client/WeinreExtraTargetEventsImpl.amd.js\"></script>\n<!-- ========== weinre additions: done ========== -->\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"audits.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"goToLineDialog.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"heapProfiler.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"inspector.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"inspectorSyntaxHighlight.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"networkPanel.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"helpScreen.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"popover.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"textViewer.css\">\n    <script type=\"text/javascript\" src=\"utilities.js\"></script>\n    <script type=\"text/javascript\" src=\"treeoutline.js\"></script>\n    <script type=\"text/javascript\" src=\"inspector.js\"></script>\n    <script type=\"text/javascript\" src=\"InspectorBackendStub.js\"></script>\n    <script type=\"text/javascript\" src=\"InspectorFrontendHostStub.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionRegistryStub.js\"></script>\n    <script type=\"text/javascript\" src=\"Object.js\"></script>\n    <script type=\"text/javascript\" src=\"Settings.js\"></script>\n    <script type=\"text/javascript\" src=\"CSSStyleModel.js\"></script>\n    <script type=\"text/javascript\" src=\"Checkbox.js\"></script>\n    <script type=\"text/javascript\" src=\"ContextMenu.js\"></script>\n    <script type=\"text/javascript\" src=\"KeyboardShortcut.js\"></script>\n    <script type=\"text/javascript\" src=\"TextPrompt.js\"></script>\n    <script type=\"text/javascript\" src=\"Popover.js\"></script>\n    <script type=\"text/javascript\" src=\"TabbedPane.js\"></script>\n    <script type=\"text/javascript\" src=\"Placard.js\"></script>\n    <script type=\"text/javascript\" src=\"PleaseWaitMessage.js\"></script>\n    <script type=\"text/javascript\" src=\"View.js\"></script>\n    <script type=\"text/javascript\" src=\"Drawer.js\"></script>\n    <script type=\"text/javascript\" src=\"ConsoleView.js\"></script>\n    <script type=\"text/javascript\" src=\"Panel.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelineGrid.js\"></script>    \n    <script type=\"text/javascript\" src=\"Resource.js\"></script>\n    <script type=\"text/javascript\" src=\"NetworkManager.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceTreeModel.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceCategory.js\"></script>\n    <script type=\"text/javascript\" src=\"Database.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMStorage.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMStorageItemsView.js\"></script>\n    <script type=\"text/javascript\" src=\"DataGrid.js\"></script>\n    <script type=\"text/javascript\" src=\"ShowMoreDataGridNode.js\"></script>\n    <script type=\"text/javascript\" src=\"CookiesTable.js\"></script>\n    <script type=\"text/javascript\" src=\"CookieItemsView.js\"></script>\n    <script type=\"text/javascript\" src=\"ApplicationCacheItemsView.js\"></script>\n    <script type=\"text/javascript\" src=\"Script.js\"></script>\n    <script type=\"text/javascript\" src=\"Breakpoint.js\"></script>\n    <script type=\"text/javascript\" src=\"BreakpointManager.js\"></script>\n    <script type=\"text/javascript\" src=\"SidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"ElementsTreeOutline.js\"></script>\n    <script type=\"text/javascript\" src=\"SidebarTreeElement.js\"></script>\n    <script type=\"text/javascript\" src=\"Section.js\"></script>\n    <script type=\"text/javascript\" src=\"PropertiesSection.js\"></script>\n    <script type=\"text/javascript\" src=\"RemoteObject.js\"></script>\n    <script type=\"text/javascript\" src=\"ObjectPropertiesSection.js\"></script>\n    <script type=\"text/javascript\" src=\"BreakpointsSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"CallStackSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"ScopeChainSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"WatchExpressionsSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"WorkersSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"MetricsSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"PropertiesSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"EventListenersSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"Color.js\"></script>\n    <script type=\"text/javascript\" src=\"CSSCompletions.js\"></script>\n    <script type=\"text/javascript\" src=\"CSSKeywordCompletions.js\"></script>\n    <script type=\"text/javascript\" src=\"StylesSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"PanelEnablerView.js\"></script>\n    <script type=\"text/javascript\" src=\"WelcomeView.js\"></script>\n    <script type=\"text/javascript\" src=\"StatusBarButton.js\"></script>\n    <script type=\"text/javascript\" src=\"SummaryBar.js\"></script>\n    <script type=\"text/javascript\" src=\"ElementsPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"NetworkPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"InjectedFakeWorker.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceFrame.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceFrameContent.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceView.js\"></script>\n    <script type=\"text/javascript\" src=\"ScriptsPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourcesPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ProfilesPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ConsolePanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionAPI.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionAuditCategory.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionCommon.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionServer.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditsPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditResultView.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditLauncherView.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditRules.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditCategories.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditFormatters.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceHeadersView.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceCookiesView.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceTimingView.js\"></script>\n    <script type=\"text/javascript\" src=\"NetworkItemView.js\"></script>\n    <script type=\"text/javascript\" src=\"ScriptFormatter.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMSyntaxHighlighter.js\"></script>\n    <script type=\"text/javascript\" src=\"TextEditorModel.js\"></script>\n    <script type=\"text/javascript\" src=\"TextEditorHighlighter.js\"></script>\n    <script type=\"text/javascript\" src=\"TextViewer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceCSSTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceHTMLTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceJavaScriptTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"FontView.js\"></script>\n    <script type=\"text/javascript\" src=\"ImageView.js\"></script>\n    <script type=\"text/javascript\" src=\"DatabaseTableView.js\"></script>\n    <script type=\"text/javascript\" src=\"DatabaseQueryView.js\"></script>\n    <script type=\"text/javascript\" src=\"ProfileDataGridTree.js\"></script>\n    <script type=\"text/javascript\" src=\"BottomUpProfileDataGridTree.js\"></script>\n    <script type=\"text/javascript\" src=\"TopDownProfileDataGridTree.js\"></script>\n    <script type=\"text/javascript\" src=\"ProfileView.js\"></script>\n    <script type=\"text/javascript\" src=\"HeapSnapshot.js\"></script>\n    <script type=\"text/javascript\" src=\"HeapSnapshotView.js\"></script>\n    <script type=\"text/javascript\" src=\"DetailedHeapshotView.js\"></script>\n    <script type=\"text/javascript\" src=\"DebuggerModel.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMAgent.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelineAgent.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelinePanel.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelineOverviewPane.js\"></script>\n    <script type=\"text/javascript\" src=\"TestController.js\"></script>\n    <script type=\"text/javascript\" src=\"HelpScreen.js\"></script>\n    <script type=\"text/javascript\" src=\"GoToLineDialog.js\"></script>\n    <script type=\"text/javascript\" src=\"ShortcutsHelp.js\"></script>\n    <script type=\"text/javascript\" src=\"HAREntry.js\"></script>\n    <script type=\"text/javascript\" src=\"CookieParser.js\"></script>\n<!-- ========== weinre additions: starting ========== -->\n<link rel=\"stylesheet\" type=\"text/css\" href=\"weinre/client.css\">\n<script type=\"text/javascript\" src=\"../interfaces/all-json-idls-min.js\"></script>\n<script type=\"text/javascript\">modjewel.require(\"weinre/client/Client\").main()</script>\n<!-- ========== weinre additions: done ========== -->\n</head>\n<body class=\"detached\">\n    <div id=\"toolbar\">\n        <div class=\"toolbar-item close-left\"><button id=\"close-button-left\"></button></div>\n        <div class=\"toolbar-item flexable-space\"></div>\n        <div class=\"toolbar-item hidden\" id=\"search-results-matches\"></div>\n        <div class=\"toolbar-item\"><input id=\"search\" type=\"search\" incremental results=\"0\"><div id=\"search-toolbar-label\" class=\"toolbar-label\"></div></div>\n        <div class=\"toolbar-item close-right\"><button id=\"close-button-right\"></button></div>\n    </div>\n    <div id=\"main\">\n        <div id=\"main-panels\" spellcheck=\"false\"></div>\n        <div id=\"main-status-bar\" class=\"status-bar\"><div id=\"anchored-status-bar-items\"><button id=\"dock-status-bar-item\" class=\"status-bar-item\"><div class=\"glyph\"></div><div class=\"glyph shadow\"></div></button><button id=\"console-status-bar-item\" class=\"status-bar-item\"><div class=\"glyph\"></div><div class=\"glyph shadow\"></div></button><div id=\"counters\"><div id=\"error-warning-count\" class=\"hidden\"></div></div></div></div>\n    </div>\n    <div id=\"drawer\">\n        <div id=\"console-view\"><div id=\"console-messages\" class=\"monospace\"><div id=\"console-prompt\" spellcheck=\"false\"><br></div></div></div>\n        <div id=\"drawer-status-bar\" class=\"status-bar\"><div id=\"other-drawer-status-bar-items\"><button id=\"clear-console-status-bar-item\" class=\"status-bar-item clear-status-bar-item\"><div class=\"glyph\"></div><div class=\"glyph shadow\"></div></button><div id=\"console-filter\" class=\"scope-bar status-bar-item\"></div></div></div>\n    </div>\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/inspector.css",
    "content": "/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2009 Anthony Ricaud <rik@webkit.org>\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nhtml {\n    height: 100%;\n}\n\nbody {\n    cursor: default;\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    overflow: hidden;\n    font-family: Lucida Grande, sans-serif;\n    font-size: 10px;\n    margin: 0;\n    -webkit-text-size-adjust: none;\n    -ms-text-size-adjust: none;\n    -moz-text-size-adjust: none;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n}\n\n* {\n    -webkit-box-sizing: border-box;\n    box-sizing: border-box;\n    -moz-box-sizing: border-box;\n}\n\n:focus {\n    outline: none;\n}\n\ninput[type=\"search\"]:focus, input[type=\"text\"]:focus {\n    outline: auto 5px -webkit-focus-ring-color;\n}\n\niframe, a img {\n    border: none;\n}\n\nimg {\n    -webkit-user-drag: none;\n}\n\n.hidden {\n    display: none !important;\n}\n\n#toolbar {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    height: 56px;\n    display: -webkit-box;\n    display: -ms-flexbox;\n    display: -moz-box;\n    padding: 0 5px;\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(191, 191, 191)), to(rgb(151, 151, 151)));\n    background-image: linear-gradient(to bottom, rgb(191, 191, 191) 0%, rgb(151, 151, 151) 100%);\n    border-bottom: 1px solid rgb(80, 80, 80);\n    -webkit-box-orient: horizontal;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    -ms-flex-direction: row;\n    -moz-box-orient: horizontal;\n    background-origin: padding;\n    background-clip: padding;\n}\n\nbody.inactive #toolbar {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(233, 233, 233)), to(rgb(207, 207, 207)));\n    background-image: linear-gradient(to bottom, rgb(233, 233, 233) 0%, rgb(207, 207, 207) 100%);\n    border-bottom: 1px solid rgb(64%, 64%, 64%);\n}\n\nbody.detached.platform-mac-leopard #toolbar,\nbody.detached.platform-mac-snowleopard #toolbar {\n    background: transparent !important;\n}\n\nbody.attached #toolbar {\n    height: 34px;\n    border-top: 1px solid rgb(100, 100, 100);\n    cursor: row-resize;\n    padding-left: 0;\n}\n\nbody.attached.port-qt #toolbar {\n    cursor: auto;\n}\n\nbody.attached.inactive #toolbar {\n    border-top: 1px solid rgb(64%, 64%, 64%);\n}\n\n.toolbar-item {\n    display: -webkit-box;\n    display: -ms-flexbox;\n    display: -moz-box;\n    padding: 4px 6px;\n    margin: 0;\n    background-color: transparent;\n    border-style: none;\n    border-color: transparent;\n    -webkit-box-orient: vertical;\n    -webkit-box-align: center;\n    -webkit-box-pack: end;\n    -ms-flex-direction: column;\n    -ms-flex-align: center;\n    -ms-flex-pack: end;\n    -moz-box-orient: vertical;\n    -moz-box-align: center;\n    -moz-box-pack: end;\n}\n\n.toolbar-item.toggleable.toggled-on {\n    border-width: 0 2px 0 2px;\n    padding: 4px 4px;\n    -webkit-border-image: url(Images/toolbarItemSelected.png) 0 2 0 2;\n    border-image: url(Images/toolbarItemSelected.png) 0 2 0 2;\n    border-style: solid;\n}\n\n.toolbar-item.flexable-space {\n    -webkit-box-flex: 1;\n    -ms-flex: 1;\n    -moz-box-flex: 1;\n    visibility: hidden;\n}\n\n.toolbar-item input {\n    margin-bottom: 8px;\n}\n\n.toolbar-icon {\n    display: inline-block;\n    width: 32px;\n    height: 32px;\n    -webkit-background-size: 100% auto;\n    background-size: 100% auto;\n}\n\nbody.attached .toolbar-icon {\n    width: 24px;\n    height: 24px;\n    vertical-align: middle;\n}\n\n.toolbar-item:active .toolbar-icon {\n    background-position: 0 32px;\n}\n\nbody.attached .toolbar-item:active .toolbar-icon {\n    background-position: 0 24px;\n}\n\n.toolbar-label {\n    font-size: 11px;\n    font-family: Lucida Grande, sans-serif;\n    text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;\n}\n\n.toolbar-item.toggleable:active .toolbar-label {\n    text-shadow: none;\n}\n\nbody.attached .toolbar-label {\n    display: inline-block;\n    vertical-align: middle;\n    margin-left: 3px;\n}\n\nbody.attached #search-toolbar-label {\n    display: none;\n}\n\n#search {\n    width: 205px;\n    font-size: 16px;\n    margin-bottom: 5px;\n}\n\nbody.attached #search {\n    font-size: 11px;\n    margin-bottom: 8px;\n}\n\n#search-results-matches {\n    font-size: 11px;\n    text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;\n    margin-bottom: 22px;\n}\n\nbody.attached #search-results-matches {\n    margin-bottom: 6px;\n}\n\n.toolbar-item.elements .toolbar-icon {\n    background-image: url(Images/elementsIcon.png);\n}\n\n.toolbar-item.resources .toolbar-icon {\n    background-image: url(Images/resourcesIcon.png);\n}\n\n.toolbar-item.network .toolbar-icon {\n    background-image: url(Images/networkIcon.png);\n}\n\n.toolbar-item.scripts .toolbar-icon {\n    background-image: url(Images/scriptsIcon.png);\n}\n\n.toolbar-item.timeline .toolbar-icon {\n    background-image: url(Images/timelineIcon.png);\n}\n\n.toolbar-item.profiles .toolbar-icon {\n    background-image: url(Images/profilesIcon.png);\n}\n\n.toolbar-item.audits .toolbar-icon {\n    background-image: url(Images/auditsIcon.png);\n}\n\n.toolbar-item.console .toolbar-icon {\n    background-image: url(Images/consoleIcon.png);\n}\n\n#close-button-left, #close-button-right {\n    width: 14px;\n    height: 14px;\n    background-image: url(Images/closeButtons.png);\n    background-position: 0 0;\n    background-color: transparent;\n    border: 0 none transparent;\n    margin: 5px 0;\n}\n\n#close-button-left:hover, #close-button-right:hover {\n    background-position: 14px 0;\n}\n\n#close-button-left:active, #close-button-right:active {\n    background-position: 28px 0;\n}\n\nbody.detached .toolbar-item.close-left, body.detached .toolbar-item.close-right {\n    display: none;\n}\n\nbody.attached.port-qt .toolbar-item.close-left, body.attached.port-qt .toolbar-item.close-right {\n    display: none;\n}\n\nbody.platform-mac .toolbar-item.close-right {\n    display: none;\n}\n\nbody:not(.platform-mac) .toolbar-item.close-left {\n    display: none;\n}\n\n#main {\n    position: absolute;\n    z-index: 1;\n    top: 56px;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    overflow: hidden;\n    background-color: white;\n}\n\nbody.attached #main {\n    top: 34px;\n}\n\n#main-panels {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 23px;\n    overflow: hidden;\n}\n\n#main-status-bar {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    right: 0;\n}\n\nbody.drawer-visible #main-status-bar {\n    height: 24px;\n    background-image: url(Images/statusbarResizerVertical.png), url(Images/statusbarBackground.png);\n    background-repeat: no-repeat, repeat-x;\n    background-position: right center, center;\n    cursor: row-resize;\n}\n\nbody.drawer-visible #main-status-bar * {\n    cursor: default;\n}\n\nbody.drawer-visible #main-panels {\n    bottom: 24px;\n}\n\n.status-bar {\n    background-color: rgb(235, 235, 235);\n    background-image: url(Images/statusbarBackground.png);\n    background-repeat: repeat-x;\n    white-space: nowrap;\n    height: 23px;\n    overflow: hidden;\n    z-index: 12;\n}\n\n.status-bar > div {\n    display: inline-block;\n    vertical-align: top;\n}\n\n.status-bar-item {\n    display: inline-block;\n    height: 24px;\n    padding: 0;\n    margin-left: -1px;\n    margin-right: 0;\n    vertical-align: top;\n    border: 0 transparent none;\n    background-color: transparent;\n}\n\n.status-bar-item:active {\n    position: relative;\n    z-index: 200;\n}\n\n.glyph {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background-color: rgba(0, 0, 0, 0.75);\n    z-index: 1;\n}\n\n.glyph.shadow {\n    top: 1px;\n    background-color: white !important;\n    z-index: 0;\n}\n\nbutton.status-bar-item {\n    position: relative;\n    width: 32px;\n    background-image: url(Images/statusbarButtons.png);\n    background-position: 0 0;\n}\n\nbutton.status-bar-item:active {\n    background-position: 32px 0 !important;\n}\n\nbutton.status-bar-item .glyph.shadow {\n    background-color: rgba(255, 255, 255, 0.33) !important;\n}\n\nbutton.status-bar-item.toggled-on .glyph {\n    background-color: rgb(66, 129, 235);\n}\n\nbutton.status-bar-item.toggled-1 .glyph {\n    background-color: rgb(66, 129, 235);\n}\n\nbutton.status-bar-item.toggled-2 .glyph {\n    background-color: purple;\n}\n\nbutton.status-bar-item:disabled {\n    opacity: 0.5;\n    background-position: 0 0 !important;\n}\n\nselect.status-bar-item {\n    min-width: 48px;\n    border-width: 0 17px 0 2px;\n    padding: 0 2px 0 6px;\n    font-weight: bold;\n    color: rgb(48, 48, 48);\n    text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n    -webkit-border-image: url(Images/statusbarMenuButton.png) 0 17 0 2;\n    border-image: url(Images/statusbarMenuButton.png) 0 17 0 2;\n    -webkit-border-radius: 0;\n    border-radius: 0;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n}\n\nselect.status-bar-item:active {\n    color: black;\n    -webkit-border-image: url(Images/statusbarMenuButtonSelected.png) 0 17 0 2;\n    border-image: url(Images/statusbarMenuButtonSelected.png) 0 17 0 2;\n}\n\n#dock-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/undockButtonGlyph.png);\n}\n\nbody.detached #dock-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/dockButtonGlyph.png);\n}\n\nbody.port-qt #dock-status-bar-item {\n    display: none\n}\n\n#console-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/consoleButtonGlyph.png);\n}\n\n.clear-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/clearConsoleButtonGlyph.png);\n}\n\n#counters {\n    position: absolute;\n    right: 16px;\n    top: 0;\n    cursor: pointer;\n    padding: 6px 2px 6px 0px;\n    font-size: 10px;\n    height: 19px;\n}\n\n#error-warning-count {\n    display: inline;\n}\n\n#error-warning-count:hover {\n    border-bottom: 1px solid rgb(96, 96, 96);\n}\n\n#error-count::before {\n    content: url(Images/errorIcon.png);\n    width: 10px;\n    height: 10px;\n    vertical-align: -1px;\n    margin-right: 2px;\n}\n\n#error-count + #warning-count {\n    margin-left: 6px;\n}\n\n#warning-count::before {\n    content: url(Images/warningIcon.png);\n    width: 10px;\n    height: 10px;\n    vertical-align: -1px;\n    margin-right: 2px;\n}\n\n#drawer {\n    display: none;\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    height: 200px;\n    background-color: white;\n    background-image: url(Images/statusbarBottomBackground.png);\n    background-repeat: repeat-x;\n    background-position: bottom;\n}\n\nbody.drawer-visible #drawer {\n    display: block;\n}\n\n#drawer-status-bar {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    background: none;\n}\n\n.monospace {\n    font-size: 10px !important;\n    font-family: monospace;\n}\n\nbody.platform-mac .monospace, body.platform-mac .source-code {\n    font-family: Monaco, monospace;\n}\n\n/* Keep .platform-mac to make the rule more specific than the general one above. */\nbody.platform-mac.platform-mac-snowleopard .monospace,\nbody.platform-mac.platform-mac-snowleopard .source-code {\n    font-size: 11px !important;\n    font-family: Menlo, monospace;\n}\n\nbody.platform-windows .monospace, body.platform-windows .source-code {\n    font-size: 12px !important;\n    font-family: Consolas, Lucida Console, monospace;\n}\n\nbody.platform-linux .monospace, body.platform-linux .source-code {\n    font-size: 11px !important;\n    font-family: dejavu sans mono, monospace;\n}\n\n#console-messages {\n    position: absolute;\n    z-index: 0;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 23px;\n    padding: 2px 0;\n    overflow-y: auto;\n    overflow-y: overlay;\n    word-wrap: break-word;\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    -webkit-text-size-adjust: auto;\n    -ms-text-size-adjust: auto;\n    -moz-text-size-adjust: auto;\n}\n\n#console-prompt {\n    position: relative;\n    padding: 1px 22px 1px 24px;\n    min-height: 16px;\n    white-space: pre-wrap;\n    -webkit-user-modify: read-write-plaintext-only;\n    -moz-user-modify: read-write;\n}\n\n#console-prompt::before {\n    background-image: url(Images/userInputIcon.png);\n}\n\n.console-user-command-result.console-log-level::before {\n    background-image: url(Images/userInputResultIcon.png);\n}\n\n.console-message, .console-user-command {\n    position: relative;\n    border-bottom: 1px solid rgb(240, 240, 240);\n    padding: 1px 22px 1px 24px;\n    min-height: 16px;\n}\n\n.console-adjacent-user-command-result {\n    border-bottom: none;\n}\n\n.console-adjacent-user-command-result + .console-user-command-result.console-log-level::before {\n    background-image: none;\n}\n\n.console-message::before, .console-user-command::before, #console-prompt::before, .console-group-title::before {\n    position: absolute;\n    display: block;\n    content: \"\";\n    left: 7px;\n    top: 0.8em;\n    width: 10px;\n    height: 10px;\n    margin-top: -5px;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n}\n\n/* Hack to detect IE*/\n@media screen\\0 {\n    /* Set image directly to console div element instead of using pseudo selector\nsince it causes displaying caret in incorrecty place*/\n    #console-prompt {\n        background: url(Images/userInputIcon.png) 7px 5px no-repeat;\n    }\n\n    #console-prompt::before{\n        content: none !important;\n    }\n\n    /*Set icons as background-image since IE doesn't support -webkit-mask-image*/\n    #console-status-bar-item .glyph {\n        background-image: url(Images/consoleButtonGlyph.png);\n    }\n\n    .clear-status-bar-item .glyph {\n        background-image: url(Images/clearConsoleButtonGlyph.png);\n    }\n\n    .node-search-status-bar-item .glyph {\n        background-image: url(Images/nodeSearchButtonGlyph.png);\n    }\n\n    #console-status-bar-item .glyph,\n    .clear-status-bar-item .glyph,\n    .node-search-status-bar-item .glyph{\n        background-color: transparent;\n    }\n\n    /*Set background image for selected tab since IE doesn't support border-image property*/\n    .toolbar-item.toggleable.toggled-on {\n        background: url(Images/toolbarItemSelected.png);\n        background-size: 1px 100%;\n    }\n}\n\n/* Hack to detect Firefox*/\n@-moz-document url-prefix() {\n    /*Set icons as background-image since FF doesn't support mask-image*/\n    #console-status-bar-item .glyph {\n        background-image: url(Images/consoleButtonGlyph.png);\n    }\n\n    .clear-status-bar-item .glyph {\n        background-image: url(Images/clearConsoleButtonGlyph.png);\n    }\n\n    .node-search-status-bar-item .glyph {\n        background-image: url(Images/nodeSearchButtonGlyph.png);\n    }\n\n    #console-status-bar-item .glyph,\n    .clear-status-bar-item .glyph,\n    .node-search-status-bar-item .glyph{\n        background-color: transparent;\n    }\n}\n\n.console-message .bubble {\n    display: inline-block;\n    height: 14px;\n    background-color: rgb(128, 151, 189);\n    vertical-align: middle;\n    white-space: nowrap;\n    padding: 1px 4px;\n    margin-top: -2px;\n    margin-right: 4px;\n    text-align: left;\n    font-size: 11px;\n    line-height: normal;\n    font-family: Helvetica, Arial, sans-serif;\n    font-weight: bold;\n    text-shadow: none;\n    color: white;\n    -webkit-border-radius: 7px;\n    border-radius: 7px;\n}\n\n.console-message-text {\n    white-space: pre-wrap;\n}\n\n.repeated-message {\n    padding-left: 6px;\n}\n\n.repeated-message.console-error-level::before, .repeated-message.console-warning-level:before, .repeated-message.console-debug-level:before {\n    visibility: hidden;\n}\n\n.console-group .console-group > .console-group-messages {\n    margin-left: 16px;\n}\n\n.console-group-title {\n    font-weight: bold;\n}\n\n.console-group-title::before {\n    background-image: url(Images/disclosureTriangleSmallDown.png);\n    top: 0.6em;\n    width: 11px;\n    height: 12px;\n}\n\n.console-group.collapsed .console-group-title::before {\n    background-image: url(Images/disclosureTriangleSmallRight.png);\n}\n\n.console-group.collapsed > .console-group-messages {\n    display: none;\n}\n\n.console-error-level .console-message-text {\n    color: red;\n}\n\n.console-debug-level .console-message-text {\n    color: blue;\n}\n\n.console-debug-level::before {\n    background-image: url(Images/searchSmallBrightBlue.png);\n}\n\n.console-error-level::before {\n    background-image: url(Images/errorIcon.png);\n}\n\n.console-warning-level::before {\n    background-image: url(Images/warningIcon.png);\n}\n\n.console-user-command .console-message {\n    margin-left: -24px;\n    padding-right: 0;\n    border-bottom: none;\n}\n\n.console-user-command::before {\n    background-image: url(Images/userInputPreviousIcon.png);\n}\n\n.console-user-command > .console-message-text {\n    color: rgb(0, 128, 255);\n}\n\n#console-messages a {\n    color: rgb(33%, 33%, 33%);\n    cursor: pointer;\n}\n\n#console-messages a:hover {\n    color: rgb(15%, 15%, 15%);\n}\n\n.console-message-url {\n    float: right;\n    margin-left: 4px;\n}\n\n.console-group-messages .section {\n    margin: 0 0 0 12px !important;\n}\n\n.console-group-messages .section .header {\n    padding: 0 8px 0 0;\n    background-image: none;\n    border: none;\n    min-height: 0;\n}\n\n.console-group-messages .section .header::before {\n    position: absolute;\n    top: 1px;\n    left: 1px;\n    width: 8px;\n    height: 8px;\n    content: url(Images/treeRightTriangleBlack.png);\n}\n\n.console-group-messages .section.expanded .header::before {\n    content: url(Images/treeDownTriangleBlack.png);\n}\n\n.console-group-messages .section .header .title {\n    color: black;\n    font-weight: normal;\n}\n\n.console-group-messages .section .properties li .info {\n    padding-top: 0;\n    padding-bottom: 0;\n    color: rgb(60%, 60%, 60%);\n}\n\n.console-group-messages .outline-disclosure {\n    padding-left: 0;\n}\n\n.console-group-messages .outline-disclosure > ol {\n    padding: 0 0 0 12px !important;\n}\n\n.console-group-messages .outline-disclosure, .console-group-messages .outline-disclosure ol {\n    font-size: inherit;\n    line-height: 12px;\n}\n\n.console-group-messages .outline-disclosure.single-node li {\n    padding-left: 2px;\n}\n\n.console-group-messages .outline-disclosure li .selection {\n    margin-left: -6px;\n    margin-right: -6px;\n}\n\n.console-group-messages .add-attribute {\n    display: none;\n}\n\n.console-formatted-object, .console-formatted-node {\n    position: relative;\n    display: inline-block;\n    vertical-align: top;\n}\n\n.console-formatted-object .section, .console-formatted-node .section {\n    position: static;\n}\n\n.console-formatted-object .properties, .console-formatted-node .properties {\n    padding-left: 0 !important;\n}\n\n.console-formatted-number {\n    color: rgb(28, 0, 207);\n}\n\n.console-formatted-string, .console-formatted-regexp {\n    color: rgb(196, 26, 22);\n}\n\n.console-formatted-null, .console-formatted-undefined {\n    color: rgb(128, 128, 128);\n}\n\n.error-message {\n    color: red;\n}\n\n.auto-complete-text, .editing .auto-complete-text {\n    color: rgb(128, 128, 128) !important;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    -webkit-user-modify: read-only;\n    -moz-user-modify: read-only;\n}\n\n.panel {\n    display: none;\n    overflow: hidden;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n}\n\n.panel.visible {\n    display: block;\n}\n\n.webkit-line-gutter-backdrop {\n    /* Keep this in sync with view-source.css (.webkit-line-gutter-backdrop) */\n    width: 31px;\n    background-color: rgb(240, 240, 240);\n    border-right: 1px solid rgb(187, 187, 187);\n    position: absolute;\n    z-index: -1;\n    left: 0;\n    top: 0;\n    height: 100%\n}\n\n.resource-view {\n    display: none;\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 0;\n    bottom: 0;\n    overflow: auto;\n}\n\n.resource-view.visible {\n    display: block;\n}\n\n.resource-view.font {\n    font-size: 60px;\n    white-space: pre-wrap;\n    word-wrap: break-word;\n    text-align: center;\n    padding: 15px;\n}\n\n.resource-view.image > .image {\n    padding: 20px 20px 10px 20px;\n    text-align: center;\n}\n\n.resource-view.image > .info {\n    padding-bottom: 10px;\n    font-size: 11px;\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n}\n\n.resource-view.image img.resource-image-view {\n    max-width: 100%;\n    max-height: 1000px;\n    background-image: url(Images/checker.png);\n    -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.5);\n    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.5);\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    -webkit-user-drag: auto;\n}\n\n.resource-url {\n    vertical-align: middle;\n}\n\n.resource-status-image {\n    margin-top: -3px;\n    vertical-align: middle;\n}\n\n.resource-view.image .title {\n    text-align: center;\n    font-size: 13px;\n}\n\n.resource-view.image .infoList {\n    margin: 0;\n}\n\n.resource-view.image .infoList dt {\n    font-weight: bold;\n    display: inline-block;\n    width: 50%;\n    text-align: right;\n    color: rgb(76, 76, 76);\n}\n\n.resource-view.image .infoList dd {\n    display: inline-block;\n    padding-left: 8px;\n    width: 50%;\n    text-align: left;\n    margin: 0;\n}\n\n.resource-view.image .infoList dd::after {\n    white-space: pre;\n    content: \"\\A\";\n}\n\n.resource-timing-row {\n    position: relative;\n    height: 12px;\n}\n\n.resource-timing-bar {\n    position: absolute;\n    background-color: red;\n    border-left: 1px solid red;\n    opacity: 0.4;\n}\n\n.resource-timing-bar-title {\n    position: absolute;\n}\n\n#elements-content {\n    display: block;\n    overflow: auto;\n    padding: 0;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 325px;\n    bottom: 0;\n}\n\n#elements-sidebar {\n    position: absolute;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    width: 325px;\n    border-left: 1px solid rgb(64%, 64%, 64%);\n    cursor: default;\n    overflow: auto;\n}\n\n.crumbs {\n    display: inline-block;\n    font-size: 11px;\n    line-height: 19px;\n    text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n    color: rgb(20, 20, 20);\n    margin-left: -1px;\n    padding-right: 12px;\n}\n\n.crumbs .crumb {\n    height: 24px;\n    border-width: 0 12px 0 2px;\n    -webkit-border-image: url(Images/segment.png) 0 12 0 2;\n    border-image: url(Images/segment.png) 0 12 0 2;\n    margin-right: -12px;\n    padding-left: 18px;\n    padding-right: 2px;\n    white-space: nowrap;\n    line-height: 23px;\n    float: right;\n}\n\n.crumbs .crumb.collapsed > * {\n    display: none;\n}\n\n.crumbs .crumb.collapsed::before {\n    content: \"\\2026\";\n    font-weight: bold;\n}\n\n.crumbs .crumb.compact .extra {\n    display: none;\n}\n\n.crumbs .crumb.dimmed {\n    color: rgba(0, 0, 0, 0.45);\n}\n\n.crumbs .crumb.start {\n    padding-left: 7px;\n}\n\n.crumbs .crumb.end {\n    border-width: 0 2px 0 2px;\n    padding-right: 6px;\n    -webkit-border-image: url(Images/segmentEnd.png) 0 2 0 2;\n    border-image: url(Images/segmentEnd.png) 0 2 0 2;\n}\n\n.crumbs .crumb.selected {\n    -webkit-border-image: url(Images/segmentSelected.png) 0 12 0 2;\n    border-image: url(Images/segmentSelected.png) 0 12 0 2;\n    color: black;\n    text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;\n}\n\n.crumbs .crumb.selected:hover {\n    -webkit-border-image: url(Images/segmentSelected.png) 0 12 0 2;\n    border-image: url(Images/segmentSelected.png) 0 12 0 2;\n}\n\n.crumbs .crumb.selected.end, .crumbs .crumb.selected.end:hover {\n    -webkit-border-image: url(Images/segmentSelectedEnd.png) 0 2 0 2;\n    border-image: url(Images/segmentSelectedEnd.png) 0 2 0 2;\n}\n\n.crumbs .crumb:hover {\n    -webkit-border-image: url(Images/segmentHover.png) 0 12 0 2;\n    border-image: url(Images/segmentHover.png) 0 12 0 2;\n    color: black;\n}\n\n.crumbs .crumb.dimmed:hover {\n    -webkit-border-image: url(Images/segmentHover.png) 0 12 0 2;\n    border-image: url(Images/segmentHover.png) 0 12 0 2;\n    color: rgba(0, 0, 0, 0.75);\n}\n\n.crumbs .crumb.end:hover {\n    -webkit-border-image: url(Images/segmentHoverEnd.png) 0 2 0 2;\n    border-image: url(Images/segmentHoverEnd.png) 0 2 0 2;\n}\n\n.outline-disclosure li.hovered:not(.selected) .selection {\n    display: block;\n    left: 3px;\n    right: 3px;\n    background-color: rgba(56, 121, 217, 0.1);\n    -webkit-border-radius: 5px;\n    border-radius: 5px;\n}\n\n.outline-disclosure li.highlighted .highlight {\n    background-color: rgb(255, 230, 179);\n    -webkit-border-radius: 4px;\n    border-radius: 4px;\n    padding-bottom: 2px;\n    margin-bottom: -2px;\n}\n\n.outline-disclosure li.selected.highlighted .highlight {\n    background-color: transparent;\n    padding-bottom: 0;\n    margin-bottom: 0;\n}\n\n.outline-disclosure li .selection {\n    display: none;\n    position: absolute;\n    left: 0;\n    right: 0;\n    height: 15px;\n    z-index: -1;\n}\n\n.outline-disclosure li.selected .selection {\n    display: block;\n    background-color: rgb(212, 212, 212);\n}\n\n.outline-disclosure ol:focus li.selected .selection {\n    background-color: rgb(56, 121, 217);\n}\n\n.outline-disclosure {\n    font-size: 11px;\n}\n\n.outline-disclosure > ol {\n    position: relative;\n    padding: 2px 6px !important;\n    margin: 0;\n    color: black;\n    cursor: default;\n    min-width: 100%;\n}\n\n.outline-disclosure, .outline-disclosure ol {\n    list-style-type: none;\n    -webkit-padding-start: 12px;\n    -moz-padding-start: 12px;\n    margin: 0;\n}\n\n.source-code {\n    font-family: monospace;\n    font-size: 10px !important;\n    white-space: pre-wrap;\n}\n\n.outline-disclosure li {\n    padding: 0 0 0 14px;\n    margin-top: 1px;\n    margin-bottom: 1px;\n    word-wrap: break-word;\n    text-indent: -2px;\n}\n\n.resources .outline-disclosure li {\n    text-indent: -1px;\n}\n\n.outline-disclosure ol:focus li.selected {\n    color: white;\n}\n\n.outline-disclosure ol:focus li.selected * {\n    color: inherit;\n}\n\n.outline-disclosure li.parent {\n    text-indent: -12px\n}\n\n.outline-disclosure li .webkit-html-tag.close {\n    margin-left: -12px;\n}\n\n.outline-disclosure li.parent::before {\n    content: url(Images/treeRightTriangleBlack.png);\n    float: left;\n    width: 8px;\n    height: 8px;\n    margin-top: 1px;\n    padding-right: 2px;\n}\n\n.outline-disclosure li.parent::before {\n    content: url(Images/treeRightTriangleBlack.png);\n}\n\n.outline-disclosure ol:focus li.parent.selected::before {\n    content: url(Images/treeRightTriangleWhite.png);\n}\n\n.outline-disclosure li.parent.expanded::before {\n    content: url(Images/treeDownTriangleBlack.png);\n}\n\n.outline-disclosure ol:focus li.parent.expanded.selected::before {\n    content: url(Images/treeDownTriangleWhite.png);\n}\n\n.outline-disclosure ol.children {\n    display: none;\n}\n\n.outline-disclosure ol.children.expanded {\n    display: block;\n}\n\n.add-attribute {\n    margin-left: 1px;\n    margin-right: 1px;\n    white-space: nowrap;\n}\n\n.placard {\n    position: relative;\n    margin-top: 1px;\n    padding: 3px 8px 4px 18px;\n    min-height: 18px;\n    white-space: nowrap;\n}\n\n.placard:nth-of-type(2n) {\n    background-color: rgb(234, 243, 255);\n}\n\n.placard.selected {\n    border-top: 1px solid rgb(145, 160, 192);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(162, 177, 207)), to(rgb(120, 138, 177)));\n    background-image: linear-gradient(to bottom, rgb(162, 177, 207) 0%, rgb(120, 138, 177) 100%);\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-origin: padding;\n    background-clip: padding;\n}\n\n:focus .placard.selected {\n    border-top: 1px solid rgb(68, 128, 200);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(92, 147, 213)), to(rgb(21, 83, 170)));\n    background-image: linear-gradient(to bottom, rgb(92, 147, 213) 0%, rgb(21, 83, 170) 100%);\n}\n\nbody.inactive .placard.selected {\n    border-top: 1px solid rgb(151, 151, 151);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(180, 180, 180)), to(rgb(138, 138, 138)));\n    background-image: linear-gradient(to bottom, rgb(180, 180, 180) 0%, rgb(138, 138, 138) 100%);\n}\n\n.placard .title {\n    color: black;\n    font-weight: normal;\n    word-wrap: break-word;\n    white-space: normal;\n}\n\n.placard.selected .title {\n    color: white;\n    font-weight: bold;\n}\n\n.placard .subtitle {\n    float: right;\n    font-size: 10px;\n    margin-left: 5px;\n    max-width: 55%;\n    color: rgba(0, 0, 0, 0.7);\n    text-overflow: ellipsis;\n    overflow: hidden;\n}\n\n.placard.selected .subtitle {\n    color: rgba(255, 255, 255, 0.7);\n}\n\n.placard .subtitle a {\n    color: inherit;\n}\n\n.section {\n    position: relative;\n    margin-top: 1px;\n}\n\n.watch-expressions-buttons-container {\n    text-align: center;\n}\n\n.events-pane .section:not(:nth-of-type(1)) {\n    border-top: 1px solid rgb(191, 191, 191);\n}\n\n.event-bar:first-child {\n    margin-top: 1px;\n}\n\n.section .header {\n    color: black;\n    padding: 0 8px 0 18px;\n    min-height: 18px;\n    white-space: nowrap;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-origin: padding;\n    background-clip: padding;\n}\n\n.section .header::before {\n    position: absolute;\n    top: 2px;\n    left: 7px;\n    width: 8px;\n    height: 8px;\n    content: url(Images/treeRightTriangleBlack.png);\n    opacity: 0.8;\n}\n\n.section.expanded .header::before {\n    content: url(Images/treeDownTriangleBlack.png);\n}\n\n.section .header .title, .event-bar .header .title {\n    font-weight: normal;\n    word-wrap: break-word;\n    white-space: normal;\n    line-height: 18px;\n}\n\n.section .header .title.blank-title {\n    font-style: italic;\n}\n\n.section .header label, .event-bar .header label {\n    display: none;\n}\n\n.section.expanded .header label, .event-bar.expanded .header label {\n    display: inline;\n}\n\n.section .header .subtitle, .event-bar .header .subtitle {\n    float: right;\n    margin-left: 5px;\n    max-width: 55%;\n    text-overflow: ellipsis;\n    overflow: hidden;\n}\n\n.section .header .subtitle a {\n    color: inherit;\n}\n\n.section .properties, .event-bar .event-properties {\n    display: none;\n}\n\n.section.expanded .properties, .event-bar.expanded .event-properties {\n    display: block;\n    padding-left: 16px;\n}\n\n.section.no-affect .properties li {\n    opacity: 0.5;\n}\n\n.section.no-affect .properties li.editing {\n    opacity: 1.0;\n}\n\n.properties-tree {\n    margin: 0;\n    padding: 0 6px 2px;\n    list-style: none;\n    min-height: 18px;\n}\n\n.properties-tree li {\n    margin-left: 12px;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    cursor: auto;\n}\n\n.properties-tree li.parent {\n    margin-left: 1px;\n}\n\n.properties-tree li.parent::before {\n    content: url(Images/treeRightTriangleBlack.png);\n    opacity: 0.75;\n    float: left;\n    width: 8px;\n    height: 8px;\n    margin-top: 0;\n    padding-right: 3px;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    cursor: default;\n}\n\n.properties-tree li.parent.expanded::before {\n    content: url(Images/treeDownTriangleBlack.png);\n    margin-top: 1px;\n}\n\n.properties-tree li .info {\n    padding-top: 4px;\n    padding-bottom: 3px;\n}\n\n.properties-tree ol {\n    display: none;\n    margin: 0;\n    -webkit-padding-start: 12px;\n    -moz-padding-start: 12px;\n    list-style: none;\n}\n\n.properties-tree ol.expanded {\n    display: block;\n}\n\n.event-listener-breakpoints .event-category {\n    font-size: 11px;\n    font-weight: bold;\n    color: rgb(96, 96, 96);\n    padding-top: 2px;\n}\n\n.event-listener-breakpoints.properties-tree .children li {\n    margin-left: 12px;\n    height: 16px;\n}\n\n.event-listener-breakpoints .checkbox-elem {\n    font-size: 10px;\n    float: left;\n    top: -2px;\n    position: relative;\n    left: -1px;\n}\n\n.section .event-bars {\n    display: none;\n}\n\n.section.expanded .event-bars {\n    display: block;\n}\n\n.event-bar {\n    position: relative;\n    margin-left: 10px;\n}\n\n.event-bars .event-bar .header {\n    padding: 0 8px 0 18px;\n    min-height: 16px;\n    opacity: 1.0;\n    white-space: nowrap;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-origin: padding;\n    background-clip: padding;\n}\n\n.event-bars .event-bar .header .title {\n    font-weight: normal;\n    color: black;\n    text-shadow: white 0 1px 0;\n}\n\n.event-bars .event-bar .header .subtitle {\n    color: rgba(90, 90, 90, 0.75);\n}\n\n.event-bars .event-bar .header::before {\n    position: absolute;\n    top: 2px;\n    left: 7px;\n    width: 8px;\n    height: 8px;\n    opacity: 0.75;\n    content: url(Images/treeRightTriangleBlack.png);\n}\n\n.event-bars .event-bar.expanded .header::before {\n    content: url(Images/treeDownTriangleBlack.png);\n}\n\n.editing {\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    -webkit-box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;\n    box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;\n    outline: 1px solid rgb(66%, 66%, 66%) !important;\n    background-color: white;\n    -webkit-user-modify: read-write-plaintext-only;\n    -moz-user-modify: read-write;\n    text-overflow: clip !important;\n    padding-left: 2px;\n    margin-left: -2px;\n    padding-right: 2px;\n    margin-right: -2px;\n    margin-bottom: -1px;\n    padding-bottom: 1px;\n    opacity: 1.0 !important;\n}\n\n.editing, .editing * {\n    color: black !important;\n    text-decoration: none !important;\n}\n\n.child-editing {\n    color: black !important;\n    text-decoration: none !important;\n    overflow: visible !important;\n}\n\n.editing br {\n    display: none;\n}\n\n.elements-tree-editor {\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    -webkit-user-modify: read-write-plaintext-only;\n    -moz-user-modify: read-write-plaintext-only;\n}\n\n.section .properties li.editing {\n    margin-left: 10px;\n    text-overflow: clip;\n}\n\nli.editing .swatch, li.editing .enabled-button,  li.editing-sub-part .delete-button {\n    display: none !important;\n}\n\n.watch-expressions > li.editing-sub-part .name {\n    display: block;\n    width: 100%;\n}\n\n.watch-expressions > li.editing-sub-part .value, .watch-expressions > li.editing-sub-part .separator  {\n    display: none;\n}\n\n.watch-expressions-error-level {\n    color: red;\n}\n\n.section .properties li.editing-sub-part {\n    padding: 3px 6px 8px 18px;\n    margin: -3px -6px -8px -6px;\n    text-overflow: clip;\n}\n\n/* FIXME: need a better icon (comment in bug 27514) */\n.section .properties .delete-button {\n    width: 10px;\n    height: 10px;\n    background-image: url(Images/errorIcon.png);\n    background-position: 0 0;\n    background-color: transparent;\n    background-repeat: no-repeat;\n    border: 0 none transparent;\n}\n\n.section .properties .name, .event-properties .name {\n    color: rgb(136, 19, 145);\n}\n\n.section .properties .value.dimmed {\n    color: rgb(100, 100, 100);\n}\n\n.section .properties .value.error {\n    color: red;\n}\n\n.section .properties .number, .event-properties .number {\n    color: blue;\n}\n\n.section .properties .keyword, .event-properties .keyword {\n    color: rgb(136, 19, 79);\n}\n\n.section .properties .color, .event-properties .color {\n    color: rgb(118, 15, 21);\n}\n\n.swatch {\n    display: inline-block;\n    vertical-align: baseline;\n    margin-left: 1px;\n    margin-right: 2px;\n    margin-bottom: -1px;\n    width: 1em;\n    height: 1em;\n    border: 1px solid rgba(128, 128, 128, 0.6);\n}\n\n.swatch:hover {\n    border: 1px solid rgba(64, 64, 64, 0.8);\n}\n\n.pane:not(.expanded) + .pane, .pane:first-of-type {\n    margin-top: -1px;\n}\n\n.pane > .title {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(243, 243, 243)), color-stop(0.05, rgb(243, 243, 243)), color-stop(0.05, rgb(230, 230, 230)), to(rgb(209, 209, 209)));\n    background-image: linear-gradient(to bottom, rgb(243, 243, 243) 0%, rgb(243, 243, 243) 10%, rgb(230, 230, 230) 40%, rgb(209, 209, 209) 100%);\n    height: 20px;\n    padding: 0 5px;\n    border-top: 1px solid rgb(189, 189, 189);\n    border-bottom: 1px solid rgb(189, 189, 189);\n    font-weight: bold;\n    font-size: 12px;\n    line-height: 18px;\n    color: rgb(110, 110, 110);\n    text-shadow: white 0 1px 0;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-origin: padding;\n    background-clip: padding;\n}\n\n.pane > .title:active {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(231, 231, 231)), color-stop(0.05, rgb(231, 231, 231)), color-stop(0.05, rgb(207, 207, 207)), to(rgb(186, 186, 186)));\n    background-image: linear-gradient(to bottom, rgb(231, 231, 231) 0%,rgb(231, 231, 231) 10%, rgb(207, 207, 207) 40%, rgb(186, 186, 186) 100%);\n    border-top: 1px solid rgb(178, 178, 178);\n    border-bottom: 1px solid rgb(178, 178, 178);\n}\n\n.pane > .title::before {\n    content: url(Images/disclosureTriangleSmallRightBlack.png);\n    float: left;\n    width: 11px;\n    height: 12px;\n    margin-right: 2px;\n    margin-top: 1px;\n}\n\n.pane.expanded > .title::before {\n    content: url(Images/disclosureTriangleSmallDownBlack.png);\n}\n\n.pane > .title > select {\n    float: right;\n    width: 23px;\n    height: 17px;\n    color: transparent;\n    background-color: transparent;\n    border: none;\n    background-image: url(Images/paneSettingsButtons.png);\n    background-repeat: no-repeat;\n    margin: 1px 0 0 0;\n    padding: 0;\n    -webkit-border-radius: 0;\n    border-radius: 0;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    /* hack for appearance for non-webkit browsers */\n    padding-left: 10px;\n    padding-right: 13px;\n}\n\n.pane > .title > select:hover {\n    background-position: -23px 0px;\n}\n\n.pane > .title > select:active {\n    background-position: -46px 0px;\n}\n\n.pane > .title > select > option, .pane > .title > select > hr {\n    color: black;\n}\n\n.pane > .title > button.add {\n    float: right;\n    width: 23px;\n    height: 17px;\n    color: transparent;\n    background-color: transparent;\n    border: none;\n    background-image: url(Images/paneAddButtons.png);\n    background-repeat: no-repeat;\n    margin: 1px 0 0 0;\n    padding: 0;\n    -webkit-border-radius: 0;\n    border-radius: 0;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n}\n\n.pane > .title > button.add:hover {\n    background-position: -23px 0px;\n}\n\n.pane > .title > button.add:active {\n    background-position: -46px 0px;\n}\n\n.pane > .body {\n    position: relative;\n    display: none;\n    overflow-y: auto;\n    overflow-x: hidden;\n}\n\n.pane > .body .info {\n    text-align: center;\n    font-style: italic;\n    font-size: 10px;\n    padding: 6px;\n    color: black;\n}\n\n.pane > .body .placard + .info {\n    border-top: 1px solid rgb(189, 189, 189);\n    background-color: rgb(255, 255, 194);\n}\n\n.pane.expanded > .body, .pane.expanded > .growbar {\n    display: block;\n}\n\n.pane > .body .breakpoint-condition {\n    display: block;\n    margin-top: 4px;\n    margin-bottom: 4px;\n    margin-left: 25px;\n    margin-right: 10px;\n}\n\n.pane.expanded:nth-last-of-type(1) {\n    border-bottom: 1px solid rgb(189, 189, 189);\n}\n\n.pane > .growbar {\n    display: none;\n    background-image: url(Images/paneGrowHandleLine.png), url(Images/paneBottomGrow.png);\n    background-repeat: no-repeat, repeat-x;\n    background-position: center center, bottom;\n    height: 5px;\n}\n\n.sidebar-pane-subtitle {\n    position: absolute;\n    right: 0;\n    font-weight: normal;\n}\n\nbody.platform-windows .sidebar-pane-subtitle {\n    padding-top: 1px;\n}\n\n.sidebar-pane-subtitle input, .section .header input[type=checkbox] {\n    font-size: inherit;\n    hight: 1em;\n    width: 1em;\n    margin-left: 0;\n    margin-top: 0;\n    margin-bottom: 0.25em;\n    vertical-align: middle;\n    /*Hack for IE - 'box-sizing: border-box' significantly reduce checkbox size so we set it to default*/\n    box-sizing: content-box;\n}\n\n.metrics {\n    padding: 8px;\n    font-size: 10px;\n    text-align: center;\n    white-space: nowrap;\n}\n\n.metrics .label {\n    position: absolute;\n    margin-top: -10px;\n    font-size: 9px;\n    color: grey;\n    background-color: white;\n    margin-left: 3px;\n    padding-left: 2px;\n    padding-right: 2px;\n}\n\n.metrics .position {\n    border: 1px rgb(66%, 66%, 66%) dotted;\n    display: inline-block;\n    text-align: center;\n    padding: 3px;\n    margin: 3px;\n}\n\n.metrics .margin {\n    border: 1px dashed;\n    display: inline-block;\n    text-align: center;\n    vertical-align: middle;\n    padding: 3px;\n    margin: 3px;\n}\n\n.metrics .border {\n    border: 1px black solid;\n    display: inline-block;\n    text-align: center;\n    vertical-align: middle;\n    padding: 3px;\n    margin: 3px;\n}\n\n.metrics .padding {\n    border: 1px grey dashed;\n    display: inline-block;\n    text-align: center;\n    vertical-align: middle;\n    padding: 3px;\n    margin: 3px;\n}\n\n.metrics .content {\n    position: static;\n    border: 1px grey solid;\n    display: inline-block;\n    text-align: center;\n    vertical-align: middle;\n    padding: 3px;\n    margin: 3px;\n    min-width: 80px;\n    text-align: center;\n    overflow: visible;\n}\n\n.metrics .content span {\n    display: inline-block;\n}\n\n.metrics .editing {\n    position: relative;\n    z-index: 100;\n}\n\n.metrics .left {\n    display: inline-block;\n    vertical-align: middle;\n}\n\n.metrics .right {\n    display: inline-block;\n    vertical-align: middle;\n}\n\n.metrics .top {\n    display: inline-block;\n}\n\n.metrics .bottom {\n    display: inline-block;\n}\n\n.sidebar {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    width: 200px;\n    overflow-y: auto;\n    overflow-x: hidden;\n    background-color: rgb(214, 221, 229);\n    border-right: 1px solid rgb(64%, 64%, 64%);\n}\n\nbody.inactive .sidebar {\n    background-color: rgb(232, 232, 232);\n}\n\n.frame-storage-tree-item .icon {\n    content: url(Images/frame.png);\n}\n\n.database-storage-tree-item .icon {\n    content: url(Images/database.png);\n}\n\n.database-table-storage-tree-item .icon {\n    content: url(Images/databaseTable.png);\n}\n\n.domstorage-storage-tree-item.local-storage .icon {\n    content: url(Images/localStorage.png);\n}\n\n.domstorage-storage-tree-item.session-storage .icon {\n    content: url(Images/sessionStorage.png);\n}\n\n.cookie-storage-tree-item .icon {\n    content: url(Images/cookie.png);\n}\n\n.application-cache-storage-tree-item .icon {\n    content: url(Images/applicationCache.png);\n}\n\n/* FIXME: Make separate png for file-system */\n.file-system-storage-tree-item .icon {\n    content: url(Images/applicationCache.png);\n}\n\n#storage-views {\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 200px;\n    bottom: 0;\n}\n\n.resources.panel .sidebar {\n    padding-left: 0;\n    z-index: 10;\n}\n\n.resources.panel .sidebar li {\n    height: 17px;\n    white-space: nowrap;\n    text-indent: 0;\n    margin-left: -2px;\n}\n\n.resources.panel .sidebar li.parent {\n    text-indent: 0;\n    margin-left: -12px;\n}\n\n.resources.panel .sidebar li.selected {\n    color: white;\n    text-shadow: rgba(0, 0, 0, 0.33) 0 1px 0;\n    font-weight: bold;\n}\n\n.resources.panel .sidebar li.selected .selection {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(162, 177, 207)), to(rgb(120, 138, 177)));\n    background-image: linear-gradient(to bottom, rgb(162, 177, 207) 0%, rgb(120, 138, 177) 100%);\n    border-top: 1px solid #979797;\n    height: 17px;\n}\n\n.resources.panel .sidebar :focus li.selected .selection {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(92, 147, 213)), to(rgb(21, 83, 170)));\n    background-image: linear-gradient(to bottom, rgb(92, 147, 213) 0%, rgb(21, 83, 170) 100%);\n    border-top: 1px solid rgb(68, 128, 200);\n}\n\nbody.inactive .resources.panel .sidebar li.selected .selection {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(180, 180, 180)), to(rgb(138, 138, 138)));\n    background-image: linear-gradient(to bottom, rgb(180, 180, 180) 0%, rgb(138, 138, 138) 100%);\n    border-top: 1px solid rgb(151, 151, 151);\n}\n\n.resources.panel .sidebar .icon {\n    width: 16px;\n    height: 16px;\n    float: left;\n}\n\n.resources.panel .base-storage-tree-element-title {\n    overflow: hidden;\n    position: relative;\n    text-overflow: ellipsis;\n    padding-left: 2px;\n    top: 1px;\n}\n\nli.selected .base-storage-tree-element-subtitle {\n    color: white;\n}\n\n.base-storage-tree-element-subtitle {\n    padding-left: 2px;\n    color: rgb(80, 80, 80);\n    text-shadow: none;\n}\n\n.resources.panel .status {\n    float: right;\n    height: 16px;\n    margin-top: 1px;\n    margin-left: 4px;\n    line-height: 1em;\n}\n\n.resources.panel li .status .bubble {\n    height: 13px;\n    padding-top: 0;\n}\n\n.storage-view {\n    display: none;\n    overflow: hidden;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n}\n\n.storage-view.visible {\n    display: block;\n}\n\n.storage-view {\n    overflow: hidden;\n}\n\n.storage-view .data-grid {\n    border: none;\n    height: 100%;\n}\n\n.storage-empty-view, .storage-view .storage-table-error {\n    position: absolute;\n    top: 0;\n    bottom: 25%;\n    left: 0;\n    right: 0;\n    font-size: 24px;\n    color: rgb(75%, 75%, 75%);\n    margin-top: auto;\n    margin-bottom: auto;\n    height: 50px;\n    line-height: 26px;\n    text-align: center;\n    font-weight: bold;\n    padding: 10px;\n    white-space: pre-wrap;\n}\n\n.storage-view .storage-table-error {\n    color: rgb(66%, 33%, 33%);\n}\n\n.data-grid {\n    position: relative;\n    border: 1px solid #aaa;\n}\n\n.data-grid .highlight {\n    background-color: rgb(255, 230, 179);\n}\n\n.data-grid tr.selected .highlight {\n    background-color: transparent;\n}\n\n.data-grid table {\n    table-layout: fixed;\n    border-spacing: 0;\n    border-collapse: collapse;\n    width: 100%;\n    font-size: 10px;\n    font-family: Lucida Grande, sans-serif;\n}\n\n.data-grid .data-container {\n    position: absolute;\n    top: 16px;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    padding-right: 14px;\n    overflow-x: hidden;\n    overflow-y: overlay;\n}\n\n.data-grid.inline .data-container {\n    position: static;\n}\n\n.data-grid th {\n    text-align: left;\n    background-image: url(Images/glossyHeader.png);\n    background-repeat: repeat-x;\n    border-right: 1px solid rgb(179, 179, 179);\n    border-bottom: 1px solid rgb(179, 179, 179);\n    height: 15px;\n    font-weight: normal;\n    vertical-align: middle;\n    padding: 0 4px;\n    white-space: nowrap;\n}\n\n.data-grid th.corner {\n    width: 15px;\n    border-right: 0 none transparent;\n}\n\n.data-grid tr.filler {\n    display: table-row !important;\n    height: auto !important;\n}\n\n.data-grid tr.filler td {\n    height: auto !important;\n    padding: 0 !important;\n}\n\n.data-grid table.data {\n    position: absolute;\n    left: 0;\n    top: 0;\n    right: 16px;\n    bottom: 0;\n    height: 100%;\n    border-top: 0 none transparent;\n    background-image: -webkit-gradient(linear, left top, left bottom, from(white), color-stop(0.5, white), color-stop(0.5, rgb(234, 243, 255)), to(rgb(234, 243, 255)));\n    background-image: linear-gradient(to bottom, white 0%, white 10%, rgb(234, 243, 255) 40%, rgb(234, 243, 255) 100%);\n    -webkit-background-size: 1px 32px;\n    background-size: 1px 32px;\n}\n\n.data-grid.inline table.data {\n    position: static;\n}\n\n.data-grid table.data tr {\n    display: none;\n}\n\n.data-grid table.data tr.revealed {\n    display: table-row;\n}\n\n.data-grid td {\n    vertical-align: top;\n    height: 12px;\n    line-height: 12px;\n    padding: 2px 4px;\n    white-space: nowrap;\n    border-right: 1px solid #aaa;\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n}\n\n.data-grid td > div, .data-grid th > div {\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n}\n\n.data-grid .centered div {\n    text-align: center;\n}\n\n.data-grid .right div {\n    text-align: right;\n}\n\n.data-grid th.sortable div {\n    position: relative;\n}\n\n.data-grid th.sortable:active {\n    background-image: url(Images/glossyHeaderPressed.png);\n}\n\n.data-grid th.sort-ascending, .data-grid th.sort-descending {\n    border-right: 1px solid rgb(107, 140, 196);\n    border-bottom: 1px solid rgb(107, 140, 196);\n    background-image: url(Images/glossyHeaderSelected.png);\n    background-repeat: repeat-x;\n}\n\n.data-grid th.sortable.sort-ascending:active, .data-grid th.sortable.sort-descending:active {\n    background-image: url(Images/glossyHeaderSelectedPressed.png);\n}\n\n.data-grid th.sort-ascending > div::after {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    height: 12px;\n    margin-bottom: auto;\n    margin-top: auto;\n    width: 8px;\n    content: url(Images/treeUpTriangleBlack.png);\n}\n\n.data-grid th.sort-descending > div::after {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    height: 8px;\n    margin-bottom: auto;\n    margin-top: auto;\n    width: 8px;\n    content: url(Images/treeDownTriangleBlack.png);\n}\n\n.data-grid button {\n    line-height: 19px;\n}\n\nbody.inactive .data-grid th.sort-ascending, body.inactive .data-grid th.sort-descending {\n    background-image: url(Images/glossyHeader.png);\n    border-right: 1px solid rgb(179, 179, 179);\n    border-bottom: 1px solid rgb(179, 179, 179);\n}\n\n.data-grid tr.parent td.disclosure::before {\n    float: left;\n    content: url(Images/treeRightTriangleBlack.png);\n    width: 8px;\n    height: 8px;\n    margin-right: 2px;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n}\n\n.data-grid tr.expanded td.disclosure::before {\n    content: url(Images/treeDownTriangleBlack.png);\n    width: 8px;\n    height: 8px;\n    margin-top: 1px;\n}\n\n.data-grid tr.selected {\n    background-color: rgb(212, 212, 212);\n    color: inherit;\n}\n\n.data-grid:focus tr.selected {\n    background-color: rgb(56, 121, 217);\n    color: white;\n}\n\n.data-grid:focus tr.parent.selected td.disclosure::before {\n    content: url(Images/treeRightTriangleWhite.png);\n}\n\n.data-grid:focus tr.expanded.selected td.disclosure::before {\n    content: url(Images/treeDownTriangleWhite.png);\n}\n\n.data-grid tr:not(.parent) td.disclosure {\n    text-indent: 10px;\n}\n\n.data-grid-resizer {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    width: 5px;\n    z-index: 500;\n    cursor: col-resize;\n}\n\n.storage-view.query {\n    padding: 2px 0;\n    overflow-y: overlay;\n    overflow-x: hidden;\n    -webkit-text-size-adjust: auto;\n    -ms-text-size-adjust: auto;\n    -moz-text-size-adjust: auto;\n}\n\n.database-query-prompt {\n    position: relative;\n    padding: 1px 22px 1px 24px;\n    min-height: 16px;\n    white-space: pre-wrap;\n    -webkit-user-modify: read-write-plaintext-only;\n    -moz-user-modify: read-write;\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n}\n\n.database-user-query::before, .database-query-prompt::before, .database-query-result::before {\n    position: absolute;\n    display: block;\n    content: \"\";\n    left: 7px;\n    top: 0.8em;\n    width: 10px;\n    height: 10px;\n    margin-top: -5px;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n}\n\n.database-query-prompt::before {\n    background-image: url(Images/userInputIcon.png);\n}\n\n.database-user-query {\n    position: relative;\n    border-bottom: 1px solid rgb(245, 245, 245);\n    padding: 1px 22px 1px 24px;\n    min-height: 16px;\n}\n\n.database-user-query::before {\n    background-image: url(Images/userInputPreviousIcon.png);\n}\n\n.database-query-text {\n    color: rgb(0, 128, 255);\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: none;\n}\n\n.database-query-result {\n    position: relative;\n    padding: 1px 22px 1px 24px;\n    min-height: 16px;\n    margin-left: -24px;\n    padding-right: 0;\n}\n\n.database-query-result.error {\n    color: red;\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: none;\n}\n\n.database-query-result.error::before {\n    background-image: url(Images/errorIcon.png);\n}\n\n.panel-enabler-view {\n    z-index: 1000;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background-color: white;\n    font-size: 13px;\n    text-align: center;\n    overflow-x: hidden;\n    overflow-y: overlay;\n    display: none;\n}\n\n.panel-enabler-view.visible {\n    display: block;\n}\n\n.panel-enabler-view .panel-enabler-view-content {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    max-height: 390px;\n    margin: auto;\n    white-space: nowrap;\n}\n\n.panel-enabler-view h1 {\n    color: rgb(110, 116, 128);\n    font-size: 16px;\n    line-height: 20px;\n    font-weight: normal;\n    margin-top: 0;\n}\n\n.panel-enabler-disclaimer {\n    font-size: 10px;\n    color: rgb(110, 116, 128);\n    margin-bottom: 12px;\n    margin-left: 20px;\n}\n\n.panel-enabler-disclaimer:empty {\n    display: none;\n}\n\n.panel-enabler-view img, div.welcome-instructions-aligner {\n    height: 100%;\n    min-height: 200px;\n    max-width: 100%;\n    top: 0;\n    bottom: 0;\n    padding: 20px 0 20px 20px;\n    margin: auto;\n    vertical-align: middle;\n}\n\n.panel-enabler-view img.hidden {\n    display: initial !important;\n    width: 0;\n}\n\n.panel-enabler-view form {\n    display: inline-block;\n    vertical-align: middle;\n    width: 330px;\n    margin: 0;\n    padding: 15px;\n    white-space: normal;\n}\n\n.panel-enabler-view label {\n    position: relative;\n    display: block;\n    text-align: left;\n    word-break: break-word;\n    margin: 0 0 5px 20px;\n}\n\n.panel-enabler-view button:not(.status-bar-item), .pane button, button.show-all-nodes {\n    color: rgb(6, 6, 6);\n    background-color: transparent;\n    border: 1px solid rgb(165, 165, 165);\n    background-color: rgb(237, 237, 237);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));\n    background-image: linear-gradient(to bottom, rgb(252, 252, 252) 0%, rgb(233, 233, 233) 100%);\n    -webkit-border-radius: 12px;\n    border-radius: 12px;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n}\n\n.panel-enabler-view button:not(.status-bar-item) {\n    font-size: 13px;\n    margin: 6px 0 0 0;\n    padding: 3px 20px;\n    height: 24px;\n}\n\nbutton.show-all-nodes {\n    font-size: 13px;\n    margin: 0;\n    padding: 0 20px;\n    height: 20px;\n}\n\n.panel-enabler-view.welcome {\n    z-index: auto;\n}\n\n.panel-enabler-view.welcome div.welcome-instructions-aligner {\n    display: inline-block;\n    width: 0;\n}\n\n.panel-enabler-view.welcome .instructions {\n    display: inline-block;\n    vertical-align: middle;\n    margin: 0;\n    white-space: normal;\n    line-height: 175%;\n}\n\n.panel-enabler-view.welcome .message {\n    margin-bottom: 2ex;\n}\n\n.panel-enabler-view.welcome button.status-bar-item {\n    background-image: none;\n    vertical-align: top;\n}\n\n.pane button {\n    margin: 6px 0 6px 3px;\n    padding: 2px 9px;\n}\n\n.panel-enabler-view button:active:not(.status-bar-item), .pane button:active, button.show-all-nodes:active {\n    background-color: rgb(215, 215, 215);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));\n    background-image: linear-gradient(to bottom, rgb(194, 194, 194) 0%, rgb(239, 239, 239) 100%);\n}\n\nbody.inactive .panel-enabler-view button:not(.status-bar-item), .panel-enabler-view button:disabled:not(.status-bar-item), body.inactive .pane button, .pane button:disabled, body.inactive button.show-all-nodes {\n    color: rgb(130, 130, 130);\n    border-color: rgb(212, 212, 212);\n    background-color: rgb(239, 239, 239);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(250, 250, 250)), to(rgb(235, 235, 235)));\n    background-image: linear-gradient(to bottom, rgb(250, 250, 250) 0%, rgb(235, 235, 235) 100%);\n}\n\n.panel-enabler-view input {\n    height: 17px;\n    width: 17px;\n    border: 1px solid rgb(165, 165, 165);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));\n    background-image: linear-gradient(to bottom, rgb(252, 252, 252) 0%, rgb(223, 223, 223) 100%);\n    -webkit-border-radius: 8px;\n    border-radius: 8px;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    vertical-align: middle;\n    margin: 0 5px 5px 0;\n}\n\n.panel-enabler-view input:active {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));\n    background-image: linear-gradient(to bottom, rgb(194, 194, 194) 0%, rgb(239, 239, 239) 100%);\n}\n\n.panel-enabler-view input:checked {\n    background: url(Images/radioDot.png) center no-repeat,\n    -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));\n    background-image: linear-gradient(to bottom, rgb(252, 252, 252) 0%, rgb(223, 223, 223) 100%);\n}\n\n.panel-enabler-view.scripts img {\n    content: url(Images/scriptsSilhouette.png);\n}\n\n.panel-enabler-view.profiles img {\n    content: url(Images/profilesSilhouette.png);\n}\n\nbutton.enable-toggle-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/enableOutlineButtonGlyph.png);\n}\n\nbutton.enable-toggle-status-bar-item.toggled-on .glyph {\n    -webkit-mask-image: url(Images/enableSolidButtonGlyph.png);\n}\n\n.scripts-pause-on-exceptions-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/pauseOnExceptionButtonGlyph.png);\n}\n\n#scripts-status-bar {\n    position: absolute;\n    top: -1px;\n    left: 0;\n    right: 0;\n    height: 24px;\n}\n\n#scripts-files {\n    max-width: 250px;\n}\n\n#scripts-files option.extension-script {\n    color: rgb(70, 134, 240);\n}\n\n#scripts-functions {\n    max-width: 150px;\n}\n\n#scripts-status-bar .status-bar-item img {\n    margin-top: 2px;\n}\n\n#scripts-back img {\n    content: url(Images/back.png);\n}\n\n#scripts-forward img {\n    content: url(Images/forward.png);\n}\n\n#scripts-pause img {\n    content: url(Images/debuggerPause.png);\n}\n\n#scripts-pause.paused img {\n    content: url(Images/debuggerContinue.png);\n}\n\n#scripts-step-over img {\n    content: url(Images/debuggerStepOver.png);\n}\n\n#scripts-step-into img {\n    content: url(Images/debuggerStepInto.png);\n}\n\n#scripts-step-out img {\n    content: url(Images/debuggerStepOut.png);\n}\n\n.toggle-breakpoints .glyph {\n    -webkit-mask-image: url(Images/breakpointsActivateButtonGlyph.png);\n    background-color: rgb(96, 96, 96) !important;\n}\n\n.toggle-breakpoints.toggled-on .glyph {\n    -webkit-mask-image: url(Images/breakpointsDeactivateButtonGlyph.png);\n}\n\n#scripts-debugger-status {\n    position: absolute;\n    line-height: 24px;\n    top: 0;\n    right: 8px;\n}\n\n#scripts-sidebar-resizer-widget {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 225px;\n    width: 16px;\n    cursor: col-resize;\n    background-image: url(Images/statusbarResizerHorizontal.png);\n    background-repeat: no-repeat;\n    background-position: center;\n}\n\n#scripts-sidebar-buttons {\n    position: absolute;\n    right: 0;\n    top: 0;\n    bottom: 0;\n    width: 225px;\n    overflow: hidden;\n    border-left: 1px solid rgb(64%, 64%, 64%);\n}\n\n#script-resource-views {\n    display: block;\n    padding: 0;\n    position: absolute;\n    top: 23px;\n    left: 0;\n    right: 225px;\n    bottom: 0;\n}\n\n.script-view {\n    display: none;\n    overflow: hidden;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n}\n\n.script-view.visible {\n    display: block;\n}\n\n#scripts-sidebar {\n    position: absolute;\n    top: 23px;\n    right: 0;\n    bottom: 0;\n    width: 225px;\n    border-left: 1px solid rgb(64%, 64%, 64%);\n    cursor: default;\n    overflow: auto;\n}\n\n.resources-larger-resources-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/largerResourcesButtonGlyph.png);\n}\n\n#resources-filter, #console-filter.console-filter-top {\n    background: -webkit-gradient(linear, left top, left bottom, from(rgb(236, 236, 236)), to(rgb(217, 217, 217)));\n    background-image: linear-gradient(to bottom, rgb(236, 236, 236) 0%, rgb(217, 217, 217) 100%);\n    border-bottom: 1px solid rgb(64%, 64%, 64%);\n    width: 100%;\n}\n\n#console-messages.console-filter-top {\n    margin-top: 23px;\n}\n\n#console-filter {\n    margin-top: 1px;\n}\n\n.tabbed-pane {\n    -webkit-box-orient: vertical;\n    -ms-flex-direction: column;\n    -moz-box-orient: vertical;\n    height: 100%;\n}\n\n.tabbed-pane-content {\n    -webkit-box-flex: 1;\n    -ms-flex: 1;\n    -moz-box-flex: 1;\n    position: relative;\n}\n\n.tabbed-pane-header {\n    height: 23px;\n    padding: 0 10px;\n    border-bottom: 1px solid rgb(163, 163, 163);\n}\n\n.tabbed-pane-header li {\n    display: inline-block;\n    margin-top: 2px;\n    font-size: 11px;\n    font-weight: bold;\n    color: rgb(46, 46, 46);\n    background: transparent;\n    text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;\n    vertical-align: middle;\n    padding: 3px 7px 2px;\n    height: 21px;\n    border: 1px solid transparent;\n    border-bottom: none;\n}\n\n.tabbed-pane-header li.selected {\n    background-color: white;\n    border: 1px solid rgb(163, 163, 163);\n    border-bottom: none;\n}\n\n.scope-bar {\n    height: 23px;\n    padding: 2px 10px 0;\n    overflow: hidden;\n}\n\n.scope-bar li {\n    display: inline-block;\n    margin: 1px 2px 0 0;\n    padding: 1px 7px 3px;\n    font-size: 11px;\n    line-height: 12px;\n    font-weight: bold;\n    color: rgb(46, 46, 46);\n    background: transparent;\n    text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;\n    -webkit-border-radius: 8px;\n    border-radius: 8px;\n    vertical-align: middle;\n}\n\n.scope-bar-divider {\n    margin: 1px 9px 0 8px;\n    background-color: rgba(0, 0, 0, 0.4);\n    height: 16px;\n    width: 1px;\n    vertical-align: middle;\n    display: inline-block;\n}\n\n.scope-bar li.selected, .scope-bar li:hover, .scope-bar li:active {\n    color: white;\n    text-shadow: rgba(0, 0, 0, 0.4) 0 1px 0;\n}\n\n.scope-bar li:hover {\n    background: rgba(0, 0, 0, 0.2);\n}\n\n.scope-bar li.selected {\n    background: rgba(0, 0, 0, 0.3);\n    -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5) inset, 0 -1px 1px rgba(255, 255, 255, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 0.5);\n    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5) inset, 0 -1px 1px rgba(255, 255, 255, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 0.5);\n}\n\n.scope-bar li:active {\n    background: rgba(0, 0, 0, 0.5);\n    -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5) inset, 0 -1px 1px rgba(255, 255, 255, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 0.5);\n    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5) inset, 0 -1px 1px rgba(255, 255, 255, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 0.5);\n}\n\n#resources-container {\n    position: absolute;\n    top: 23px;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    border-right: 0 none transparent;\n    overflow-y: auto;\n    overflow-x: hidden;\n}\n\n#resources-container.viewing-resource {\n    right: auto;\n    width: 200px;\n    border-right: 1px solid rgb(64%, 64%, 64%);\n}\n\n#resources-container.viewing-resource #resources-sidebar {\n    width: 100%;\n    border-right: 0 none transparent;\n}\n\n#resources-sidebar {\n    min-height: 100%;\n    bottom: auto;\n    overflow: visible;\n}\n\n#resources-container-content {\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 200px;\n    min-height: 100%;\n}\n\n#resources-container.viewing-resource #resources-container-content {\n    display: none;\n}\n\n#resources-summary {\n    position: absolute;\n    padding-top: 20px;\n    top: 0;\n    left: 0;\n    right: 0;\n    height: 93px;\n    margin-left: -1px;\n    border-left: 1px solid rgb(102, 102, 102);\n    background-color: rgb(101, 111, 130);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.5)));\n    background-image: linear-gradient(to bottom, rgb(0, 0, 0) 0%, rgb(0, 0, 0) 50%);\n    background-repeat: repeat-x;\n    background-position: bottom;\n    text-align: center;\n    text-shadow: black 0 1px 1px;\n    white-space: nowrap;\n    color: white;\n    -webkit-background-size: 1px 6px;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-size: 1px 6px;\n    background-origin: padding;\n    background-clip: padding;\n    z-index: 400;\n}\n\n.summary-graph-legend {\n    margin-top: -10px;\n    padding-left: 15px;\n}\n\n.summary-graph-legend-item {\n    display: inline-block;\n    font-weight: bold;\n    margin-right: 15px;\n    vertical-align: top;\n}\n\n.summary-graph-legend-item.total {\n    margin-left: 10px;\n}\n\n.summary-graph-legend-label {\n    display: inline-block;\n    text-align: left;\n}\n\n.summary-graph-legend-header {\n    font-size: 12px;\n}\n\n.summary-graph-legend-value {\n    font-size: 10px;\n}\n\n.summary-graph-legend-swatch {\n    vertical-align: top;\n    margin-top: 1px;\n    margin-right: 3px;\n}\n\n.resources-dividers {\n    position: absolute;\n    left: 0;\n    right: 0;\n    height: 100%;\n    top: 0;\n    z-index: -100;\n}\n\n.resources-event-dividers {\n    position: absolute;\n    left: 0;\n    right: 5px;\n    height: 100%;\n    top: 0;\n    z-index: 300;\n    pointer-events: none;\n}\n\n.timeline .resources-event-dividers {\n    height: 19px;\n}\n\n.resources-dividers-label-bar {\n    position: absolute;\n    top: 0;\n    left: 0px;\n    right: 0;\n    background-color: rgba(255, 255, 255, 0.8);\n    background-clip: padding;\n    border-bottom: 1px solid rgba(0, 0, 0, 0.3);\n    height: 20px;\n    z-index: 200;\n}\n\n.resources-divider {\n    position: absolute;\n    width: 1px;\n    top: 0;\n    bottom: 0;\n    background-color: rgba(0, 0, 0, 0.1);\n}\n\n.resources-event-divider-padding {\n    position: absolute;\n    width: 8px;\n    top: 0;\n    bottom: 0;\n    pointer-events: auto;\n}\n\n.resources-event-divider {\n    position: absolute;\n    width: 2px;\n    top: 0;\n    bottom: 0;\n    z-index: 300;\n}\n\n.resources-red-divider {\n    background-color: rgba(255, 0, 0, 0.5);\n}\n\n.resources-blue-divider {\n    background-color: rgba(0, 0, 255, 0.5);\n}\n\n.resources-orange-divider {\n    background-color: rgba(255, 178, 23, 0.5);\n}\n\n.resources-divider.last {\n    background-color: transparent;\n}\n\n.resources-divider-label {\n    position: absolute;\n    top: 4px;\n    right: 3px;\n    font-size: 9px;\n    color: rgb(50%, 50%, 50%);\n    white-space: nowrap;\n}\n\n.memory-graph-label {\n    position: absolute;\n    top: 5px;\n    left: 5px;\n    font-size: 9px;\n    color: rgb(50%, 50%, 50%);\n    white-space: nowrap;\n}\n\n.resources-graph-label {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    margin: auto -7px;\n    height: 13px;\n    line-height: 13px;\n    font-size: 9px;\n    color: rgba(0, 0, 0, 0.75);\n    text-shadow: rgba(255, 255, 255, 0.25) 1px 0 0, rgba(255, 255, 255, 0.25) -1px 0 0, rgba(255, 255, 255, 0.333) 0 1px 0, rgba(255, 255, 255, 0.25) 0 -1px 0;\n    z-index: 150;\n    overflow: hidden;\n    text-align: center;\n    font-weight: bold;\n    opacity: 0;\n    -webkit-transition: opacity 250ms ease-in-out;\n    transition: opacity 250ms ease-in-out;\n}\n\n.resources-graph-side:hover .resources-graph-label {\n    opacity: 1;\n}\n\n.resources-graph-label:empty {\n    display: none;\n}\n\n.resources-graph-label.waiting {\n    margin-right: 5px;\n}\n\n.resources-graph-label.waiting-right {\n    margin-left: 5px;\n}\n\n.resources-graph-label.before {\n    color: rgba(0, 0, 0, 0.7);\n    text-shadow: none;\n    text-align: right;\n    margin-right: 2px;\n}\n\n.resources-graph-label.before::after {\n    padding-left: 2px;\n    height: 6px;\n    content: url(Images/graphLabelCalloutLeft.png);\n}\n\n.resources-graph-label.after {\n    color: rgba(0, 0, 0, 0.7);\n    text-shadow: none;\n    text-align: left;\n    margin-left: 2px;\n}\n\n.resources-graph-label.after::before {\n    padding-right: 2px;\n    height: 6px;\n    content: url(Images/graphLabelCalloutRight.png);\n}\n\n.resources-graph-bar {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    margin: auto -7px;\n    border-width: 6px 7px;\n    height: 13px;\n    min-width: 14px;\n    opacity: 0.65;\n    -webkit-border-image: url(Images/timelinePillGray.png) 6 7 6 7;\n    border-image: url(Images/timelinePillGray.png) 6 7 6 7;\n}\n\n.resources-category-documents, .resources-category-stylesheets, .resources-category-images,\n.resources-category-scripts, .resources-category-xhr, .resources-category-fonts,\n.resources-category-websockets, .resources-category-other {\n    display: none;\n}\n\n.filter-all .resources-category-documents, .filter-documents .resources-category-documents,\n.filter-all .resources-category-stylesheets, .filter-stylesheets .resources-category-stylesheets,\n.filter-all .resources-category-images, .filter-images .resources-category-images,\n.filter-all .resources-category-scripts, .filter-scripts .resources-category-scripts,\n.filter-all .resources-category-xhr, .filter-xhr .resources-category-xhr,\n.filter-all .resources-category-fonts, .filter-fonts .resources-category-fonts,\n.filter-all .resources-category-websockets, .filter-websockets .resources-category-websockets,\n.filter-all .resources-category-other, .filter-other .resources-category-other,\n.resource-sidebar-tree-item.selected {\n    display: list-item;\n}\n\n.console-warning-level, .console-error-level, .console-log-level {\n    display: none;\n}\n\n.filter-all .console-warning-level, .filter-warnings .console-warning-level,\n.filter-all .console-error-level, .filter-errors .console-error-level,\n.filter-all .console-log-level, .filter-logs .console-log-level {\n    display: block;\n}\n\n.console-user-command-result {\n    display: block;\n}\n\n.resources-graph-bar.waiting, .resources-graph-bar.waiting-right {\n    opacity: 0.35;\n}\n\n.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;\n}\n\n.resources-category-documents .resources-graph-bar {\n    -webkit-border-image: url(Images/timelinePillBlue.png) 6 7 6 7;\n    border-image: url(Images/timelinePillBlue.png) 6 7 6 7;\n}\n\n.resources-category-documents.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillBlue.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillBlue.png) 6 7 6 7;\n}\n\n.resources-category-stylesheets .resources-graph-bar {\n    -webkit-border-image: url(Images/timelinePillGreen.png) 6 7 6 7;\n    border-image: url(Images/timelinePillGreen.png) 6 7 6 7;\n}\n\n.resources-category-stylesheets.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillGreen.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillGreen.png) 6 7 6 7;\n}\n\n.resources-category-images .resources-graph-bar {\n    -webkit-border-image: url(Images/timelinePillPurple.png) 6 7 6 7;\n    border-image: url(Images/timelinePillPurple.png) 6 7 6 7;\n}\n\n.resources-category-images.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillPurple.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillPurple.png) 6 7 6 7;\n}\n\n.resources-category-fonts .resources-graph-bar {\n    -webkit-border-image: url(Images/timelinePillRed.png) 6 7 6 7;\n    border-image: url(Images/timelinePillRed.png) 6 7 6 7;\n}\n\n.resources-category-fonts.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillRed.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillRed.png) 6 7 6 7;\n}\n\n.resources-category-scripts .resources-graph-bar {\n    -webkit-border-image: url(Images/timelinePillOrange.png) 6 7 6 7;\n    border-image: url(Images/timelinePillOrange.png) 6 7 6 7;\n}\n\n.resources-category-scripts.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillOrange.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillOrange.png) 6 7 6 7;\n}\n\n.resources-category-xhr .resources-graph-bar {\n    -webkit-border-image: url(Images/timelinePillYellow.png) 6 7 6 7;\n    border-image: url(Images/timelinePillYellow.png) 6 7 6 7;\n}\n\n.resources-category-xhr.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillYellow.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillYellow.png) 6 7 6 7;\n}\n\n/* FIXME: Create bar images for WebSocket. */\n.resources-category-websockets .resources-graph-bar {\n    -webkit-border-image: url(Images/timelinePillGray.png) 6 7 6 7;\n    border-image: url(Images/timelinePillGray.png) 6 7 6 7;\n}\n\n.resources-category-websockets.resource-cached .resources-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;\n    border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;\n}\n\n#resource-views {\n    position: absolute;\n    top: 23px;\n    right: 0;\n    left: 200px;\n    bottom: 0;\n}\n\n.source-view-frame {\n    width: 100%;\n    height: 100%;\n}\n\n.sidebar-resizer-vertical {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    width: 5px;\n    z-index: 500;\n    cursor: col-resize;\n}\n\n.resources .sidebar-resizer-vertical {\n    top: 23px;\n}\n\n.sidebar-tree, .sidebar-tree .children {\n    position: relative;\n    padding: 0;\n    margin: 0;\n    list-style: none;\n    font-size: 11px;\n}\n\n.sidebar-tree-section {\n    position: relative;\n    height: 18px;\n    padding: 4px 10px 6px 10px;\n    white-space: nowrap;\n    margin-top: 1px;\n    color: rgb(92, 110, 129);\n    font-weight: bold;\n    text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n}\n\n.sidebar-tree-item {\n    position: relative;\n    height: 36px;\n    padding: 0 5px 0 5px;\n    white-space: nowrap;\n    margin-top: 1px;\n    line-height: 34px;\n    border-top: 1px solid transparent;\n}\n\n.sidebar-tree .children {\n    display: none;\n}\n\n.sidebar-tree .children.expanded {\n    display: block;\n}\n\n.sidebar-tree-section + .children > .sidebar-tree-item {\n    padding-left: 10px !important;\n}\n\n.sidebar-tree-section + .children.small > .sidebar-tree-item {\n    padding-left: 17px !important;\n}\n\n.sidebar-tree > .children > .sidebar-tree-item {\n    padding-left: 37px;\n}\n\n.sidebar-tree > .children > .children > .sidebar-tree-item {\n    padding-left: 37px;\n}\n\n.sidebar-tree.hide-disclosure-buttons > .children {\n    display: none;\n}\n\n.sidebar-tree > .children.hide-disclosure-buttons > .children {\n    display: none;\n}\n\n.sidebar-tree.some-expandable:not(.hide-disclosure-buttons) > .sidebar-tree-item:not(.parent) .icon {\n    margin-left: 16px;\n}\n\n.sidebar-tree-item .disclosure-button {\n    float: left;\n    width: 16px;\n    height: 100%;\n    border: 0;\n    background-color: transparent;\n    background-image: url(Images/disclosureTriangleSmallRight.png);\n    background-repeat: no-repeat;\n    background-position: center;\n    -webkit-apearance: none;\n    -moz-apearance: none;\n}\n\n.sidebar-tree.hide-disclosure-buttons .sidebar-tree-item .disclosure-button {\n    display: none;\n}\n\nbody.inactive .sidebar-tree-item .disclosure-button {\n    background-image: url(Images/disclosureTriangleSmallRightBlack.png);\n}\n\nbody.inactive .sidebar-tree-item.expanded .disclosure-button {\n    background-image: url(Images/disclosureTriangleSmallDownBlack.png);\n}\n\nbody.inactive .sidebar-tree-item .disclosure-button:active {\n    background-image: url(Images/disclosureTriangleSmallRightDownBlack.png);\n}\n\n.sidebar-tree-item.selected .disclosure-button {\n    background-image: url(Images/disclosureTriangleSmallRightWhite.png) !important;\n}\n\n.sidebar-tree-item.expanded .disclosure-button {\n    background-image: url(Images/disclosureTriangleSmallDown.png);\n}\n\n.sidebar-tree-item.selected.expanded .disclosure-button {\n    background-image: url(Images/disclosureTriangleSmallDownWhite.png) !important;\n}\n\n.sidebar-tree-item.selected .disclosure-button:active {\n    background-image: url(Images/disclosureTriangleSmallRightDownWhite.png) !important;\n}\n\n.sidebar-tree-item .disclosure-button:active {\n    background-image: url(Images/disclosureTriangleSmallRightDown.png);\n}\n\n.sidebar-tree-item .icon {\n    float: left;\n    width: 32px;\n    height: 32px;\n    margin-top: 1px;\n    margin-right: 3px;\n}\n\nli .status {\n    float: right;\n    height: 16px;\n    margin-top: 9px;\n    margin-left: 4px;\n    line-height: 1em;\n}\n\nli .status:empty {\n    display: none;\n}\n\nli .status .bubble {\n    display: inline-block;\n    height: 14px;\n    min-width: 16px;\n    margin-top: 1px;\n    background-color: rgb(128, 151, 189);\n    vertical-align: middle;\n    white-space: nowrap;\n    padding: 1px 4px;\n    text-align: center;\n    font-size: 11px;\n    line-height: normal;\n    font-family: Helvetica, Arial, sans-serif;\n    font-weight: bold;\n    text-shadow: none;\n    color: white;\n    -webkit-border-radius: 7px;\n    border-radius: 7px;\n}\n\nli .status .bubble:empty {\n    display: none;\n}\n\nli.selected .status .bubble {\n    background-color: white !important;\n    color: rgb(132, 154, 190) !important;\n}\n\n:focus li.selected .status .bubble {\n    color: rgb(36, 98, 172) !important;\n}\n\nbody.inactive li.selected .status .bubble {\n    color: rgb(159, 159, 159) !important;\n}\n\n.sidebar-tree.small .sidebar-tree-item, .sidebar-tree .children.small .sidebar-tree-item, .sidebar-tree-item.small, .small .resources-graph-side {\n    height: 20px;\n}\n\n.sidebar-tree.small .sidebar-tree-item .icon, .sidebar-tree .children.small .sidebar-tree-item .icon, .sidebar-tree-item.small .icon {\n    width: 16px;\n    height: 16px;\n}\n\n.sidebar-tree.small .sidebar-tree-item .status, .sidebar-tree .children.small .sidebar-tree-item .status, .sidebar-tree-item.small .status {\n    margin-top: 1px;\n}\n\n.sidebar-tree-item.selected {\n    color: white;\n    border-top: 1px solid rgb(145, 160, 192);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(162, 177, 207)), to(rgb(120, 138, 177)));\n    background-image: linear-gradient(to bottom, rgb(162, 177, 207) 0%, rgb(120, 138, 177) 100%);\n    text-shadow: rgba(0, 0, 0, 0.33) 0 1px 0;\n    font-weight: bold;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-origin: padding;\n    background-clip: padding;\n}\n\n:focus .sidebar-tree-item.selected {\n    border-top: 1px solid rgb(68, 128, 200);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(92, 147, 213)), to(rgb(21, 83, 170)));\n    background-image: linear-gradient(to bottom, rgb(92, 147, 213) 0%, rgb(21, 83, 170) 100%);\n}\n\nbody.inactive .sidebar-tree-item.selected {\n    border-top: 1px solid rgb(151, 151, 151);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(180, 180, 180)), to(rgb(138, 138, 138)));\n    background-image: linear-gradient(to bottom, rgb(180, 180, 180) 0%, rgb(138, 138, 138) 100%);\n}\n\n.sidebar-tree-item .titles {\n    position: relative;\n    top: 5px;\n    line-height: 11px;\n    padding-bottom: 1px;\n    text-overflow: ellipsis;\n    overflow: hidden;\n    white-space: nowrap;\n}\n\n.sidebar-tree-item .titles.no-subtitle {\n    top: 10px;\n}\n\n.sidebar-tree.small .sidebar-tree-item .titles, .sidebar-tree .children.small .sidebar-tree-item .titles, .sidebar-tree-item.small .titles {\n    top: 2px;\n    line-height: normal;\n}\n\n.sidebar-tree:not(.small) .sidebar-tree-item:not(.small) .title::after, .sidebar-tree .children:not(.small) .sidebar-tree-item .title::after {\n    content: \"\\A\";\n    white-space: pre;\n}\n\n.sidebar-tree-item .subtitle {\n    font-size: 9px;\n    color: rgba(0, 0, 0, 0.7);\n}\n\n.sidebar-tree.small .sidebar-tree-item .subtitle, .sidebar-tree .children.small .sidebar-tree-item .subtitle, .sidebar-tree-item.small .subtitle {\n    display: none;\n}\n\n.sidebar-tree-item.selected .subtitle {\n    color: rgba(255, 255, 255, 0.9);\n}\n\n#resources-graphs {\n    position: absolute;\n    left: 0;\n    right: 0;\n    max-height: 100%;\n    top: 112px;\n}\n\n.resources-graph-side {\n    position: relative;\n    height: 36px;\n    padding: 0 5px;\n    white-space: nowrap;\n    margin-top: 1px;\n    border-top: 1px solid transparent;\n    overflow: hidden;\n}\n\n.resources-graph-bar-area {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 8px;\n    left: 9px;\n}\n\n#resources-container:not(.viewing-resource) .resource-sidebar-tree-item:nth-of-type(2n) {\n    background-color: rgba(0, 0, 0, 0.05);\n}\n\n#resources-container:not(.viewing-resource) .resources-graph-side:nth-of-type(2n) {\n    background-color: rgba(0, 0, 0, 0.05);\n}\n\n.resources-time-graph-sidebar-item .icon {\n    content: url(Images/resourcesTimeGraphIcon.png);\n}\n\n.resources-size-graph-sidebar-item .icon {\n    content: url(Images/resourcesSizeGraphIcon.png);\n}\n\n.resources-size-graph-sidebar-item .icon {\n    content: url(Images/resourcesSizeGraphIcon.png);\n}\n\n.resource-sidebar-tree-item .icon {\n    content: url(Images/resourcePlainIcon.png);\n}\n\n.children.small .resource-sidebar-tree-item .icon {\n    content: url(Images/resourcePlainIconSmall.png);\n}\n\n.resource-sidebar-tree-item.resources-category-documents .icon {\n    content: url(Images/resourceDocumentIcon.png);\n}\n\n.children.small .resource-sidebar-tree-item.resources-category-documents .icon {\n    content: url(Images/resourceDocumentIconSmall.png);\n}\n\n.resource-sidebar-tree-item.resources-category-stylesheets .icon {\n    content: url(Images/resourceCSSIcon.png);\n}\n\n.children.small .resource-sidebar-tree-item.resources-category-stylesheets .icon {\n    content: url(Images/resourceDocumentIconSmall.png);\n}\n\n.resource-sidebar-tree-item.resources-category-images .icon {\n    position: relative;\n    background-image: url(Images/resourcePlainIcon.png);\n    background-repeat: no-repeat;\n    content: \"\";\n}\n\n.resources-category-images .image-resource-icon-preview {\n    position: absolute;\n    margin: auto;\n    top: 3px;\n    bottom: 4px;\n    left: 5px;\n    right: 5px;\n    max-width: 18px;\n    max-height: 21px;\n    min-width: 1px;\n    min-height: 1px;\n}\n\n.children.small .resource-sidebar-tree-item.resources-category-images .icon {\n    background-image: url(Images/resourcePlainIconSmall.png);\n    content: \"\";\n}\n\n.children.small .resources-category-images .image-resource-icon-preview {\n    top: 2px;\n    bottom: 1px;\n    left: 3px;\n    right: 3px;\n    max-width: 8px;\n    max-height: 11px;\n}\n\n.resource-sidebar-tree-item.resources-category-fonts .icon {\n    content: url(Images/resourcePlainIcon.png);\n}\n\n.children.small .resource-sidebar-tree-item.resources-category-fonts .icon {\n    content: url(Images/resourcePlainIconSmall.png);\n}\n\n.resource-sidebar-tree-item.resources-category-scripts .icon {\n    content: url(Images/resourceJSIcon.png);\n}\n\n.children.small .resource-sidebar-tree-item.resources-category-scripts .icon {\n    content: url(Images/resourceDocumentIconSmall.png);\n}\n\n.resource-sidebar-tree-item.resources-category-xhr .icon {\n    content: url(Images/resourcePlainIcon.png);\n}\n\n.children.small .resource-sidebar-tree-item.resources-category-xhr .icon {\n    content: url(Images/resourceDocumentIconSmall.png);\n}\n\n.bubble.debug, .console-debug-level .bubble {\n    background-color: rgb(0, 0, 255) !important;\n}\n\n.bubble.warning, .console-warning-level .bubble {\n    background-color: rgb(232, 164, 0) !important;\n}\n\n.bubble.error, .console-error-level .bubble {\n    background-color: rgb(216, 35, 35) !important;\n}\n\n.bubble.search-matches {\n    background-image: url(Images/searchSmallWhite.png);\n    background-repeat: no-repeat;\n    background-position: 3px 2px;\n    padding-left: 13px !important;\n}\n\nli.selected .bubble.search-matches {\n    background-image: url(Images/searchSmallBlue.png);\n}\n\n:focus li.selected .bubble.search-matches {\n    background-image: url(Images/searchSmallBrightBlue.png);\n}\n\nbody.inactive li.selected .bubble.search-matches {\n    background-image: url(Images/searchSmallGray.png);\n}\n\n/* Timeline Style */\n\n#timeline-overview-panel {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    height: 80px;\n}\n\n#timeline-overview-panel .timeline-graph-bar {\n    pointer-events: none;\n}\n\n.timeline-sidebar-background {\n    top: 90px;\n    bottom: 0;\n}\n\n.timeline .sidebar {\n    overflow-y: hidden;\n    z-index: 100;\n    min-height: 100%;\n    bottom: auto;\n}\n\n#timeline-overview-separator {\n    position: absolute;\n    top: 80px;\n    left: 0;\n    right: 0;\n    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(253, 253, 253)), to(rgb(213, 213, 213)));\n    background-image: linear-gradient(to bottom, rgb(253, 253, 253) 0%, rgb(213, 213, 213) 100%);\n    border-top: 1px solid rgb(140, 140, 140);\n    border-bottom: 1px solid rgb(115, 115, 115);\n    height: 10px;\n}\n\n#timeline-overview-sidebar {\n    position: absolute;\n    width: 200px;\n    top: 0px;\n    bottom: 0px;\n    left: 0px;\n    padding-top: 2px;\n    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(242, 242, 242)), to(rgb(209, 209, 209)));\n    background-image: linear-gradient(to bottom, rgb(242, 242, 242) 0%, rgb(209, 209, 209) 100%);\n    border-right: 1px solid rgb(163, 163, 163);\n}\n\n#timeline-overview-grid {\n    position: absolute;\n    top: 0px;\n    bottom: 0px;\n    left: 200px;\n    right: 0px;\n    background-color: rgb(255, 255, 255);\n}\n\n.timeline-window-selector {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    background-color: rgba(125, 173, 217, 0.5);\n    z-index: 250;\n}\n\n#timeline-overview-window {\n    background-color: white;\n    position: absolute;\n    left: 0;\n    right: 0;\n    top: 0;\n    bottom: 60px;\n    z-index: 150;\n}\n\n.timeline-overview-dividers-background {\n    left: 0%;\n    right: 0%;\n    top: 0px;\n    bottom: 60px;\n    background-color: black;\n    position: absolute;\n}\n\n.timeline-overview-window-rulers {\n    top: 0;\n    bottom: 0;\n    position: absolute;\n    opacity: 0.2;\n    border-right: 1px solid black;\n    border-left: 1px solid black;\n    z-index: 150;\n}\n\n.timeline-window-resizer {\n    position: absolute;\n    top: 0px;\n    bottom: 60px;\n    width: 5px;\n    margin-left: -3px;\n    margin-right: -2px;\n    background-color: rgb(153, 153, 153);\n    z-index: 500;\n    cursor: col-resize;\n    -webkit-border-radius: 2px;\n    border-radius: 2px;\n    -webkit-box-shadow: white 1px 0 0, white -1px 0 0, white 0 1px 0, white 0 -1px 0;\n    box-shadow: white 1px 0 0, white -1px 0 0, white 0 1px 0, white 0 -1px 0;\n}\n\n#timeline-overview-grid #resources-graphs {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    height: 80px;\n}\n\n#timeline-container {\n    position: absolute;\n    top: 90px;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    border-right: 0 none transparent;\n    overflow-y: auto;\n    overflow-x: hidden;\n}\n\n.timeline-category-statusbar-item {\n    height: 24px;\n    line-height: 24px;\n    padding-left: 6px;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n    font-weight: bold;\n}\n\n.timeline-category-statusbar-item .timeline-category-checkbox {\n    width: 10px;\n    height: 11px;\n    margin: 0 3px 0 5px;\n    padding: 0;\n    background-image: url(Images/timelineCheckmarks.png);\n    background-repeat: no-repeat;\n    background-position: 0 -66px;\n    vertical-align: -1px;\n    -webkit-appearance: none;\n    -moz-appearance: none;\n}\n\n.timeline-category-statusbar-item .timeline-category-checkbox:checked {\n    background-position-x: -10px;\n}\n\n.timeline-category-statusbar-item.timeline-category-loading .timeline-category-checkbox {\n    background-position-y: 0;\n}\n\n.timeline-category-statusbar-item.timeline-category-scripting .timeline-category-checkbox {\n    background-position-y: -33px;\n}\n\n.timeline-category-statusbar-item.timeline-category-rendering .timeline-category-checkbox {\n    background-position-y: -11px;\n}\n\n.timeline-tree-item {\n    height: 18px;\n    line-height: 15px;\n    padding-right: 5px;\n    padding-left: 10px;\n    padding-top: 2px;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n}\n\n.timeline-expandable {\n    position: absolute;\n    border-left: 1px solid rgb(163, 163, 163);\n}\n\n.timeline-expandable-left {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    width: 3px;\n    border-top: 1px solid rgb(163, 163, 163);\n    border-bottom: 1px solid rgb(163, 163, 163);\n}\n\n.timeline-expandable-collapsed {\n    background-image: url(Images/disclosureTriangleSmallRightBlack.png);\n    background-position-x: 1px;\n    background-position-y: 2px;\n    background-repeat: no-repeat;\n}\n\n.timeline-expandable-expanded {\n    background-image: url(Images/disclosureTriangleSmallDownBlack.png);\n    background-position-x: 1px;\n    background-position-y: 3px;\n    background-repeat: no-repeat;\n}\n\n.timeline-tree-item .type {\n    padding-left: 14px;\n}\n\n.timeline-tree-item .count {\n    font-family: Helvetica, Arial, sans-serif;\n    font-weight: bold;\n}\n\n.timeline-tree-item .timeline-tree-icon {\n    background-image: url(Images/timelineDots.png);\n    margin-top: 2px;\n    width: 12px;\n    height: 12px;\n    position: absolute;\n}\n\n.timeline-tree-item.even {\n    background-color: rgba(0, 0, 0, 0.05);\n}\n\n.timeline-tree-item .data.dimmed {\n    color: rgba(0, 0, 0, 0.7);\n}\n\n#timeline-overview-timelines,\n#timeline-overview-memory {\n    position: absolute;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    top: 20px;\n    z-index: 160;\n}\n\n#timeline-overview-memory > canvas {\n    position: absolute;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    top: 5px;\n}\n\n\n#timeline-graphs {\n    position: absolute;\n    left: 0;\n    right: 0;\n    max-height: 100%;\n    top: 19px;\n}\n\n.timeline-graph-side {\n    position: relative;\n    height: 18px;\n    padding: 0 5px;\n    white-space: nowrap;\n    margin-top: 0px;\n    border-top: 1px solid transparent;\n    overflow: hidden;\n    pointer-events: none;\n}\n\n.timeline-overview-graph-side {\n    height: 20px;\n    z-index: 170;\n    pointer-events: none;\n}\n\n.timeline-overview-graph-side .timeline-graph-bar {\n    height: 13px;\n}\n\n.timeline-graph-bar-area {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    left: 3px;\n    pointer-events: none;\n}\n\n.timeline-graph-bar {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    margin: auto -2px;\n    border-width: 4px 4px 5px;\n    height: 9px;\n    min-width: 5px;\n    opacity: 0.8;\n    -webkit-border-image: url(Images/timelineBarGray.png) 4 4 5 4;\n    border-image: url(Images/timelineBarGray.png) 4 4 5 4;\n    z-index: 180;\n    pointer-events: visibleFill;\n}\n\n.timeline-graph-bar.with-children {\n    opacity: 0.2;\n}\n\n.timeline-graph-bar.cpu {\n    opacity: 0.6;\n}\n\n.timeline-graph-side.even {\n    background-color: rgba(0, 0, 0, 0.05);\n}\n\n.timeline-category-loading .timeline-graph-bar {\n    -webkit-border-image: url(Images/timelineBarBlue.png) 4 4 5 4;\n    border-image: url(Images/timelineBarBlue.png) 4 4 5 4;\n}\n\n.timeline-category-scripting .timeline-graph-bar {\n    -webkit-border-image: url(Images/timelineBarOrange.png) 4 4 5 4;\n    border-image: url(Images/timelineBarOrange.png) 4 4 5 4;\n}\n\n.timeline-category-rendering .timeline-graph-bar {\n    -webkit-border-image: url(Images/timelineBarPurple.png) 4 4 5 4;\n    border-image: url(Images/timelineBarPurple.png) 4 4 5 4;\n}\n\n.timeline-aggregated-category {\n    display: inline-block;\n    height: 11px;\n    margin-right: 2px;\n    margin-left: 6px;\n    position: relative;\n    top: 2px;\n    width: 10px;\n}\n\n.timeline-loading {\n    -webkit-border-image: url(Images/timelineBarBlue.png) 4 4 5 4;\n    border-image: url(Images/timelineBarBlue.png) 4 4 5 4;\n}\n\n.timeline-scripting {\n    -webkit-border-image: url(Images/timelineBarOrange.png) 4 4 5 4;\n    border-image: url(Images/timelineBarOrange.png) 4 4 5 4;\n}\n\n.timeline-rendering {\n    -webkit-border-image: url(Images/timelineBarPurple.png) 4 4 5 4;\n    border-image: url(Images/timelineBarPurple.png) 4 4 5 4;\n}\n\n.popover .timeline-aggregated-category.timeline-loading {\n    margin-left: 0px;\n}\n\n.timeline-category-loading .timeline-tree-icon {\n    background-position-y: 0px;\n}\n\n.timeline-category-scripting .timeline-tree-icon {\n    background-position-y: 48px;\n}\n\n.timeline-category-rendering .timeline-tree-icon {\n    background-position-y: 72px;\n}\n\n.timeline-details {\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    vertical-align: top;\n}\n\n.timeline-function-name {\n    text-align: right;\n}\n\n.timeline-stacktrace-title {\n    padding-top: 4px;\n}\n\n.timeline-details-row-title {\n    font-weight: bold;\n    text-align: right;\n    white-space: nowrap;\n}\n\n.timeline-details-row-data {\n    white-space: nowrap;\n}\n\n.timeline-details-title {\n    border-bottom: 1px solid #B8B8B8;\n    font-size: 11px;\n    font-weight: bold;\n    padding-bottom: 5px;\n    padding-top: 0px;\n    white-space: nowrap;\n}\n\n.timeline-filter-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/largerResourcesButtonGlyph.png);\n}\n\n.timeline-filter-status-bar-item.toggled-on .glyph {\n    background-color: rgb(66, 129, 235) !important;\n}\n\n.timeline-records-counter, .storage-application-cache-status, .storage-application-cache-connectivity {\n    font-size: 11px;\n    text-shadow: white 0 1px 0;\n}\n\n#main-status-bar > .timeline-records-counter {\n    float: right;\n    margin-top: 4px;\n    margin-right: 25px;\n}\n\n#counters > .timeline-records-counter {\n    float: left;\n    margin-top: -2px;\n}\n\n.storage-application-cache-status-icon, .storage-application-cache-connectivity-icon {\n    margin-bottom: -3px;\n    margin-left: 5px;\n    vertical-align: middle;\n}\n\n.status-bar-divider {\n    margin-left: 7px;\n    border-right: 1px solid #CCC;\n}\n\n.storage-application-cache-status, .storage-application-cache-connectivity {\n    position: relative;\n    top: 4px;\n}\n\n/* Profiler Style */\n\n#profile-views {\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 200px;\n    bottom: 0;\n}\n\n.status-bar-items {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 200px;\n    overflow: hidden;\n    border-left: 1px solid rgb(184, 184, 184);\n    margin-left: -1px;\n}\n\n.profile-sidebar-tree-item .icon {\n    content: url(Images/profileIcon.png);\n}\n\n.profile-sidebar-tree-item.small .icon {\n    content: url(Images/profileSmallIcon.png);\n}\n\n.profile-group-sidebar-tree-item .icon {\n    content: url(Images/profileGroupIcon.png);\n}\n\n.profile-view {\n    display: none;\n    overflow: hidden;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n}\n\n.profile-view.visible {\n    display: block;\n}\n\n.profile-view .data-grid {\n    border: none;\n    height: 100%;\n}\n\n.profile-view .data-grid th.average-column {\n    text-align: center;\n}\n\n.profile-view .data-grid td.average-column {\n    text-align: right;\n}\n\n.profile-view .data-grid th.self-column {\n    text-align: center;\n}\n\n.profile-view .data-grid td.self-column {\n    text-align: right;\n}\n\n.profile-view .data-grid th.total-column {\n    text-align: center;\n}\n\n.profile-view .data-grid td.total-column {\n    text-align: right;\n}\n\n.profile-view .data-grid .calls-column {\n    text-align: center;\n}\n\n.profile-node-file {\n    float: right;\n    color: gray;\n    margin-top: -1px;\n}\n\n.data-grid tr.selected .profile-node-file {\n    color: rgb(33%, 33%, 33%);\n}\n\n.data-grid:focus tr.selected .profile-node-file {\n    color: white;\n}\n\nbutton.enable-toggle-status-bar-item .glyph {\n}\n\n.record-profile-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/recordButtonGlyph.png);\n}\n\n.record-profile-status-bar-item.toggled-on .glyph {\n    -webkit-mask-image: url(Images/recordToggledButtonGlyph.png);\n    background-color: rgb(216, 0, 0) !important;\n}\n\n/* FIXME: should have its own glyph. */\n.heap-snapshot-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/focusButtonGlyph.png);\n}\n\n.node-search-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/nodeSearchButtonGlyph.png);\n}\n\n.percent-time-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/percentButtonGlyph.png);\n}\n\n.focus-profile-node-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/focusButtonGlyph.png);\n}\n\n.exclude-profile-node-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/excludeButtonGlyph.png);\n}\n\n.reset-profile-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/reloadButtonGlyph.png);\n}\n\n.delete-storage-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/excludeButtonGlyph.png);\n}\n\n.refresh-storage-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/reloadButtonGlyph.png);\n}\n\nol.breakpoint-list {\n    -webkit-padding-start: 0;\n    -moz-padding-start: 0;\n    list-style: none;\n    margin: 0;\n}\n\n.breakpoint-list li {\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n    padding: 2px 0;\n    color: black;\n}\n\n.breakpoint-list li:hover {\n    color: rgb(15%, 15%, 15%);\n}\n\n.breakpoint-list .checkbox-elem {\n    font-size: 10px;\n    margin: 0 4px;\n    vertical-align: top;\n    position: relative;\n    z-index: 1;\n}\n\n.breakpoint-list .source-text {\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n    margin: 2px 0 0px 20px;\n}\n\n.pane .breakpoint-hit {\n    background-color: rgb(255, 255, 194);\n}\n\nli.breakpoint-hit .breakpoint-hit-marker {\n    background-color: rgb(255, 255, 194);\n    height: 18px;\n    left: 0px;\n    margin-top: -16px;\n    position: absolute;\n    right: 0px;\n    z-index: -1;\n}\n\n.webkit-html-js-node, .webkit-html-css-node {\n    white-space: pre;\n}\n\n.source-frame-breakpoint-condition {\n    z-index: 30;\n    padding: 4px;\n    background-color: rgb(203, 226, 255);\n    -webkit-border-radius: 7px;\n    border-radius: 7px;\n    border: 2px solid rgb(169, 172, 203);\n    width: 90%;\n}\n\n.source-frame-breakpoint-message {\n    background-color: transparent;\n    font-family: Lucida Grande, sans-serif;\n    font-weight: normal;\n    font-size: 11px;\n    text-align: left;\n    text-shadow: none;\n    color: rgb(85, 85, 85);\n    cursor: default;\n    margin: 0 0 2px 0;\n}\n\n#source-frame-breakpoint-condition {\n    margin: 0;\n    border: 1px inset rgb(190, 190, 190) !important;\n    width: 100%;\n    box-shadow: none !important;\n    outline: none !important;\n    -webkit-user-modify: read-write;\n    -moz-user-modify: read-write;\n}\n\n.source-frame-popover-title {\n    text-overflow: ellipsis;\n    overflow: hidden;\n    white-space: nowrap;\n    font-weight: bold;\n    padding-left: 18px;\n}\n\n.source-frame-popover-tree {\n    border-top: 1px solid rgb(194, 194, 147);\n    overflow: auto;\n    position: absolute;\n    top: 15px;\n    bottom: 0;\n    left: 0;\n    right: 0;\n}\n\n.source-frame-eval-expression {\n    border: 1px solid rgb(163, 41, 34);\n    margin: -1px;\n    background-color: rgb(255, 255, 194);\n}\n\n.styles-sidebar-separator {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(243, 243, 243)), color-stop(0.05, rgb(243, 243, 243)), color-stop(0.05, rgb(230, 230, 230)), to(rgb(209, 209, 209)));\n    background-image: linear-gradient(to bottom, rgb(243, 243, 243) 0%,rgb(243, 243 ,243) 10%, rgb(230, 230, 230) 40%, rgb(209, 209, 209) 100%);\n    padding: 0 5px;\n    border-top: 1px solid rgb(189, 189, 189);\n    border-bottom: 1px solid rgb(189, 189, 189);\n    color: rgb(110, 110, 110);\n    text-shadow: white 0 1px 0;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n    font-size: 11px;\n}\n\n.styles-selector {\n    cursor: text;\n}\n\n.workers-list {\n    list-style: none;\n    margin: 0;\n    padding: 0;\n}\n\n.workers-list > li {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    margin-left: 1em;\n    font-size: 12px;\n}\n\na.worker-item {\n    color: rgb(33%, 33%, 33%);\n    cursor: pointer;\n    text-decoration: none;\n}\n\n.styles-section {\n    padding: 2px 2px 4px 4px;\n    min-height: 18px;\n    white-space: nowrap;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-origin: padding;\n    background-clip: padding;\n    -webkit-user-select: text;\n    -ms-user-select: text;\n    -moz-user-select: text;\n}\n\n.styles-section:not(.first-styles-section) {\n    border-top: 1px solid rgb(191, 191, 191);\n}\n\n.styles-section.read-only {\n    background-color: rgb(240, 240, 240);\n}\n\n.styles-section .properties li.not-parsed-ok {\n    margin-left: 0px;\n}\n\n.styles-section .properties li.not-parsed-ok::before {\n    content: url(Images/warningIcon.png);\n    opacity: 0.75;\n    float: left;\n    width: 8px;\n    height: 8px;\n    margin-top: 0;\n    padding-right: 5px;\n    vertical-align: sub;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    cursor: default;\n}\n\n.styles-section .header {\n    white-space: nowrap;\n    -webkit-background-origin: padding;\n    -webkit-background-clip: padding;\n    background-origin: padding;\n    background-clip: padding;\n}\n\n.styles-section .header .title {\n    word-wrap: break-word;\n    white-space: normal;\n}\n\n.styles-section .header .subtitle {\n    color: rgb(85, 85, 85);\n    float: right;\n    margin-left: 5px;\n    max-width: 65%;\n    text-overflow: ellipsis;\n    overflow: hidden;\n}\n\n.styles-section .header .subtitle a {\n    color: inherit;\n}\n\n.styles-section a::before {\n    content: attr(data-uncopyable);\n}\n\n.styles-section .properties {\n    display: none;\n    margin: 0;\n    padding: 2px 4px 0 8px;\n    list-style: none;\n}\n\n.styles-section.no-affect .properties li {\n    opacity: 0.5;\n}\n\n.styles-section.no-affect .properties li.editing {\n    opacity: 1.0;\n}\n\n.styles-section.expanded .properties {\n    display: block;\n}\n\n.styles-section .properties li {\n    margin-left: 12px;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    overflow: hidden;\n    cursor: auto;\n}\n\n.styles-section .properties li.parent {\n    margin-left: 1px;\n}\n\n.styles-section .properties ol {\n    display: none;\n    margin: 0;\n    -webkit-padding-start: 12px;\n    -moz-padding-start: 12px;\n    list-style: none;\n}\n\n.styles-section .properties ol.expanded {\n    display: block;\n}\n\n.styles-section .properties li.parent::before {\n    content: url(Images/treeRightTriangleBlack.png);\n    opacity: 0.75;\n    float: left;\n    width: 8px;\n    height: 8px;\n    margin-top: 0;\n    padding-right: 3px;\n    -webkit-user-select: none;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    cursor: default;\n}\n\n.styles-section .properties li.parent.expanded::before {\n    content: url(Images/treeDownTriangleBlack.png);\n    margin-top: 1px;\n}\n\n.styles-section .properties li .info {\n    padding-top: 4px;\n    padding-bottom: 3px;\n}\n\n.styles-section:hover .properties .enabled-button {\n    display: block;\n}\n\n.styles-section .properties li.disabled .enabled-button {\n    display: block;\n}\n\n.styles-section .properties .enabled-button {\n    display: none;\n    float: right;\n    font-size: 10px;\n    margin: 0 0 0 4px;\n    vertical-align: top;\n    position: relative;\n    z-index: 1;\n    /*Removes checkbox padding that is set in IE by default*/\n    padding: 0;\n}\n\n.styles-section .properties .overloaded, .styles-section .properties .inactive, .styles-section .properties .disabled {\n    text-decoration: line-through;\n}\n\n.styles-section.computed-style .properties .disabled {\n    text-decoration: none;\n    opacity: 0.5;\n}\n\n.styles-section .properties .implicit, .styles-section .properties .inherited {\n    opacity: 0.5;\n}\n\n\n.body .styles-section .properties .inherited {\n    display: none;\n}\n\n.body.show-inherited .styles-section .properties .inherited {\n    display: block;\n}\n\na.worker-item:hover {\n    color: rgb(15%, 15%, 15%);\n}\n\n.resource-content-unavailable {\n    color: rgb(50%, 50%, 50%);\n    font-style: italic;\n    font-size: 14px;\n    text-align: center;\n    padding: 32px;\n}\n\n.node-link {\n    text-decoration: underline;\n    cursor: pointer;\n}\n\n.cursor-pointer {\n    cursor: pointer;\n}\n\n.cursor-auto {\n    cursor: auto;\n}\n\n.please-wait-msg {\n    position: absolute;\n    left: 0;\n    top: 0;\n    border: 4px black solid;\n    border-radius: 4px;\n    background-color: black;\n    opacity: 0.85;\n    color: white;\n    font-size: 12px;\n    font-weight: bold;\n    z-index: 10000;\n}"
  },
  {
    "path": "buildin_modules/weinre/web/client/inspector.html",
    "content": "<!--\nCopyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1.  Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n2.  Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n    its contributors may be used to endorse or promote products derived\n    from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n-->\n<!DOCTYPE html>\n<html>\n<head>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"audits.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"goToLineDialog.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"heapProfiler.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"inspector.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"inspectorSyntaxHighlight.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"networkPanel.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"helpScreen.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"popover.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"textViewer.css\">\n    <script type=\"text/javascript\" src=\"utilities.js\"></script>\n    <script type=\"text/javascript\" src=\"treeoutline.js\"></script>\n    <script type=\"text/javascript\" src=\"inspector.js\"></script>\n    <script type=\"text/javascript\" src=\"InspectorBackendStub.js\"></script>\n    <script type=\"text/javascript\" src=\"InspectorFrontendHostStub.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionRegistryStub.js\"></script>\n    <script type=\"text/javascript\" src=\"Object.js\"></script>\n    <script type=\"text/javascript\" src=\"Settings.js\"></script>\n    <script type=\"text/javascript\" src=\"CSSStyleModel.js\"></script>\n    <script type=\"text/javascript\" src=\"Checkbox.js\"></script>\n    <script type=\"text/javascript\" src=\"ContextMenu.js\"></script>\n    <script type=\"text/javascript\" src=\"KeyboardShortcut.js\"></script>\n    <script type=\"text/javascript\" src=\"TextPrompt.js\"></script>\n    <script type=\"text/javascript\" src=\"Popover.js\"></script>\n    <script type=\"text/javascript\" src=\"TabbedPane.js\"></script>\n    <script type=\"text/javascript\" src=\"Placard.js\"></script>\n    <script type=\"text/javascript\" src=\"PleaseWaitMessage.js\"></script>\n    <script type=\"text/javascript\" src=\"View.js\"></script>\n    <script type=\"text/javascript\" src=\"Drawer.js\"></script>\n    <script type=\"text/javascript\" src=\"ConsoleView.js\"></script>\n    <script type=\"text/javascript\" src=\"Panel.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelineGrid.js\"></script>    \n    <script type=\"text/javascript\" src=\"Resource.js\"></script>\n    <script type=\"text/javascript\" src=\"NetworkManager.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceTreeModel.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceCategory.js\"></script>\n    <script type=\"text/javascript\" src=\"Database.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMStorage.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMStorageItemsView.js\"></script>\n    <script type=\"text/javascript\" src=\"DataGrid.js\"></script>\n    <script type=\"text/javascript\" src=\"ShowMoreDataGridNode.js\"></script>\n    <script type=\"text/javascript\" src=\"CookiesTable.js\"></script>\n    <script type=\"text/javascript\" src=\"CookieItemsView.js\"></script>\n    <script type=\"text/javascript\" src=\"ApplicationCacheItemsView.js\"></script>\n    <script type=\"text/javascript\" src=\"Script.js\"></script>\n    <script type=\"text/javascript\" src=\"Breakpoint.js\"></script>\n    <script type=\"text/javascript\" src=\"BreakpointManager.js\"></script>\n    <script type=\"text/javascript\" src=\"SidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"ElementsTreeOutline.js\"></script>\n    <script type=\"text/javascript\" src=\"SidebarTreeElement.js\"></script>\n    <script type=\"text/javascript\" src=\"Section.js\"></script>\n    <script type=\"text/javascript\" src=\"PropertiesSection.js\"></script>\n    <script type=\"text/javascript\" src=\"RemoteObject.js\"></script>\n    <script type=\"text/javascript\" src=\"ObjectPropertiesSection.js\"></script>\n    <script type=\"text/javascript\" src=\"BreakpointsSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"CallStackSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"ScopeChainSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"WatchExpressionsSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"WorkersSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"MetricsSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"PropertiesSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"EventListenersSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"Color.js\"></script>\n    <script type=\"text/javascript\" src=\"CSSCompletions.js\"></script>\n    <script type=\"text/javascript\" src=\"CSSKeywordCompletions.js\"></script>\n    <script type=\"text/javascript\" src=\"StylesSidebarPane.js\"></script>\n    <script type=\"text/javascript\" src=\"PanelEnablerView.js\"></script>\n    <script type=\"text/javascript\" src=\"WelcomeView.js\"></script>\n    <script type=\"text/javascript\" src=\"StatusBarButton.js\"></script>\n    <script type=\"text/javascript\" src=\"SummaryBar.js\"></script>\n    <script type=\"text/javascript\" src=\"ElementsPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"NetworkPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"InjectedFakeWorker.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceFrame.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceFrameContent.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceView.js\"></script>\n    <script type=\"text/javascript\" src=\"ScriptsPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourcesPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ProfilesPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ConsolePanel.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionAPI.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionAuditCategory.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionCommon.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionServer.js\"></script>\n    <script type=\"text/javascript\" src=\"ExtensionPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditsPanel.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditResultView.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditLauncherView.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditRules.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditCategories.js\"></script>\n    <script type=\"text/javascript\" src=\"AuditFormatters.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceHeadersView.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceCookiesView.js\"></script>\n    <script type=\"text/javascript\" src=\"ResourceTimingView.js\"></script>\n    <script type=\"text/javascript\" src=\"NetworkItemView.js\"></script>\n    <script type=\"text/javascript\" src=\"ScriptFormatter.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMSyntaxHighlighter.js\"></script>\n    <script type=\"text/javascript\" src=\"TextEditorModel.js\"></script>\n    <script type=\"text/javascript\" src=\"TextEditorHighlighter.js\"></script>\n    <script type=\"text/javascript\" src=\"TextViewer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceCSSTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceHTMLTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"SourceJavaScriptTokenizer.js\"></script>\n    <script type=\"text/javascript\" src=\"FontView.js\"></script>\n    <script type=\"text/javascript\" src=\"ImageView.js\"></script>\n    <script type=\"text/javascript\" src=\"DatabaseTableView.js\"></script>\n    <script type=\"text/javascript\" src=\"DatabaseQueryView.js\"></script>\n    <script type=\"text/javascript\" src=\"ProfileDataGridTree.js\"></script>\n    <script type=\"text/javascript\" src=\"BottomUpProfileDataGridTree.js\"></script>\n    <script type=\"text/javascript\" src=\"TopDownProfileDataGridTree.js\"></script>\n    <script type=\"text/javascript\" src=\"ProfileView.js\"></script>\n    <script type=\"text/javascript\" src=\"HeapSnapshot.js\"></script>\n    <script type=\"text/javascript\" src=\"HeapSnapshotView.js\"></script>\n    <script type=\"text/javascript\" src=\"DetailedHeapshotView.js\"></script>\n    <script type=\"text/javascript\" src=\"DebuggerModel.js\"></script>\n    <script type=\"text/javascript\" src=\"DOMAgent.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelineAgent.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelinePanel.js\"></script>\n    <script type=\"text/javascript\" src=\"TimelineOverviewPane.js\"></script>\n    <script type=\"text/javascript\" src=\"TestController.js\"></script>\n    <script type=\"text/javascript\" src=\"HelpScreen.js\"></script>\n    <script type=\"text/javascript\" src=\"GoToLineDialog.js\"></script>\n    <script type=\"text/javascript\" src=\"ShortcutsHelp.js\"></script>\n    <script type=\"text/javascript\" src=\"HAREntry.js\"></script>\n    <script type=\"text/javascript\" src=\"CookieParser.js\"></script>\n</head>\n<body class=\"detached\">\n    <div id=\"toolbar\">\n        <div class=\"toolbar-item close-left\"><button id=\"close-button-left\"></button></div>\n        <div class=\"toolbar-item flexable-space\"></div>\n        <div class=\"toolbar-item hidden\" id=\"search-results-matches\"></div>\n        <div class=\"toolbar-item\"><input id=\"search\" type=\"search\" incremental results=\"0\"><div id=\"search-toolbar-label\" class=\"toolbar-label\"></div></div>\n        <div class=\"toolbar-item close-right\"><button id=\"close-button-right\"></button></div>\n    </div>\n    <div id=\"main\">\n        <div id=\"main-panels\" spellcheck=\"false\"></div>\n        <div id=\"main-status-bar\" class=\"status-bar\"><div id=\"anchored-status-bar-items\"><button id=\"dock-status-bar-item\" class=\"status-bar-item\"><div class=\"glyph\"></div><div class=\"glyph shadow\"></div></button><button id=\"console-status-bar-item\" class=\"status-bar-item\"><div class=\"glyph\"></div><div class=\"glyph shadow\"></div></button><div id=\"counters\"><div id=\"error-warning-count\" class=\"hidden\"></div></div></div></div>\n    </div>\n    <div id=\"drawer\">\n        <div id=\"console-view\"><div id=\"console-messages\" class=\"monospace\"><div id=\"console-prompt\" spellcheck=\"false\"><br></div></div></div>\n        <div id=\"drawer-status-bar\" class=\"status-bar\"><div id=\"other-drawer-status-bar-items\"><button id=\"clear-console-status-bar-item\" class=\"status-bar-item clear-status-bar-item\"><div class=\"glyph\"></div><div class=\"glyph shadow\"></div></button><div id=\"console-filter\" class=\"scope-bar status-bar-item\"></div></div></div>\n    </div>\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/inspector.js",
    "content": "/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc.  All rights reserved.\n * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).\n * Copyright (C) 2009 Joseph Pecoraro\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Keep this ; so that concatenated version of the script worked.\n;(function preloadImages()\n{\n    (new Image()).src = \"Images/clearConsoleButtonGlyph.png\";\n    (new Image()).src = \"Images/consoleButtonGlyph.png\";\n    (new Image()).src = \"Images/dockButtonGlyph.png\";\n    (new Image()).src = \"Images/enableOutlineButtonGlyph.png\";\n    (new Image()).src = \"Images/enableSolidButtonGlyph.png\";\n    (new Image()).src = \"Images/excludeButtonGlyph.png\";\n    (new Image()).src = \"Images/focusButtonGlyph.png\";\n    (new Image()).src = \"Images/largerResourcesButtonGlyph.png\";\n    (new Image()).src = \"Images/nodeSearchButtonGlyph.png\";\n    (new Image()).src = \"Images/pauseOnExceptionButtonGlyph.png\";\n    (new Image()).src = \"Images/percentButtonGlyph.png\";\n    (new Image()).src = \"Images/recordButtonGlyph.png\";\n    (new Image()).src = \"Images/recordToggledButtonGlyph.png\";\n    (new Image()).src = \"Images/reloadButtonGlyph.png\";\n    (new Image()).src = \"Images/undockButtonGlyph.png\";\n})();\n\nvar WebInspector = {\n    resources: {},\n    missingLocalizedStrings: {},\n    pendingDispatches: 0,\n\n    get platform()\n    {\n        if (!(\"_platform\" in this))\n            this._platform = InspectorFrontendHost.platform();\n\n        return this._platform;\n    },\n\n    get platformFlavor()\n    {\n        if (!(\"_platformFlavor\" in this))\n            this._platformFlavor = this._detectPlatformFlavor();\n\n        return this._platformFlavor;\n    },\n\n    _detectPlatformFlavor: function()\n    {\n        var userAgent = navigator.userAgent;\n\n        if (this.platform === \"windows\") {\n            var match = userAgent.match(/Windows NT (\\d+)\\.(?:\\d+)/);\n            if (match && match[1] >= 6)\n                return WebInspector.PlatformFlavor.WindowsVista;\n            return null;\n        } else if (this.platform === \"mac\") {\n            var match = userAgent.match(/Mac OS X\\s*(?:(\\d+)_(\\d+))?/);\n            if (!match || match[1] != 10)\n                return WebInspector.PlatformFlavor.MacSnowLeopard;\n            switch (Number(match[2])) {\n                case 4:\n                    return WebInspector.PlatformFlavor.MacTiger;\n                case 5:\n                    return WebInspector.PlatformFlavor.MacLeopard;\n                case 6:\n                default:\n                    return WebInspector.PlatformFlavor.MacSnowLeopard;\n            }\n        }\n\n        return null;\n    },\n\n    get port()\n    {\n        if (!(\"_port\" in this))\n            this._port = InspectorFrontendHost.port();\n\n        return this._port;\n    },\n\n    get previousFocusElement()\n    {\n        return this._previousFocusElement;\n    },\n\n    get currentFocusElement()\n    {\n        return this._currentFocusElement;\n    },\n\n    set currentFocusElement(x)\n    {\n        if (this._currentFocusElement !== x)\n            this._previousFocusElement = this._currentFocusElement;\n        this._currentFocusElement = x;\n\n        if (this._currentFocusElement && typeof(this._currentFocusElement.focus) === 'function') {\n            this._currentFocusElement.focus();\n\n            // Hack for IE - return if 'select' is in focus; otherwise it will lost the focus after we call addRange.\n            if(this._currentFocusElement.nodeName.toUpperCase() == 'SELECT'){\n                return;\n            }\n\n            // Make a caret selection inside the new element if there isn't a range selection and\n            // there isn't already a caret selection inside.\n            var selection = window.getSelection();\n            if (selection.isCollapsed && !this._currentFocusElement.isInsertionCaretInside()) {\n                var selectionRange = this._currentFocusElement.ownerDocument.createRange();\n                selectionRange.setStart(this._currentFocusElement, 0);\n                selectionRange.setEnd(this._currentFocusElement, 0);\n\n                selection.removeAllRanges();\n                selection.addRange(selectionRange);\n            }\n        } // Hack for IE - do not call blur() for body element; otherwise browser window will become inactive\n        else if (this._previousFocusElement && this._previousFocusElement.nodeName.toUpperCase() != 'BODY')\n            this._previousFocusElement.blur();\n    },\n\n    get currentPanel()\n    {\n        return this._currentPanel;\n    },\n\n    set currentPanel(x)\n    {\n        if (this._currentPanel === x)\n            return;\n\n        if (this._currentPanel)\n            this._currentPanel.hide();\n\n        this._currentPanel = x;\n\n        this.updateSearchLabel();\n\n        if (x) {\n            x.show();\n\n            if (this.currentQuery) {\n                if (x.performSearch) {\n                    function performPanelSearch()\n                    {\n                        this.updateSearchMatchesCount();\n\n                        x.currentQuery = this.currentQuery;\n                        x.performSearch(this.currentQuery);\n                    }\n\n                    // Perform the search on a timeout so the panel switches fast.\n                    setTimeout(performPanelSearch.bind(this), 0);\n                } else {\n                    // Update to show Not found for panels that can't be searched.\n                    this.updateSearchMatchesCount();\n                }\n            }\n        }\n\n        for (var panelName in WebInspector.panels) {\n            if (WebInspector.panels[panelName] === x) {\n                WebInspector.settings.lastActivePanel = panelName;\n                this._panelHistory.setPanel(panelName);\n            }\n        }\n    },\n\n    createDOMBreakpointsSidebarPane: function()\n    {\n        var pane = new WebInspector.NativeBreakpointsSidebarPane(WebInspector.UIString(\"DOM Breakpoints\"));\n        function breakpointAdded(event)\n        {\n            pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));\n        }\n        WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.DOMBreakpointAdded, breakpointAdded);\n        return pane;\n    },\n\n    createXHRBreakpointsSidebarPane: function()\n    {\n        var pane = new WebInspector.XHRBreakpointsSidebarPane();\n        function breakpointAdded(event)\n        {\n            pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));\n        }\n        WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.XHRBreakpointAdded, breakpointAdded);\n        return pane;\n    },\n\n    _createPanels: function()\n    {\n        var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || \"\").split(',');\n        if (hiddenPanels.indexOf(\"elements\") === -1)\n            this.panels.elements = new WebInspector.ElementsPanel();\n        if (hiddenPanels.indexOf(\"resources\") === -1)\n            this.panels.resources = new WebInspector.ResourcesPanel();\n        if (hiddenPanels.indexOf(\"network\") === -1)\n            this.panels.network = new WebInspector.NetworkPanel();\n        if (hiddenPanels.indexOf(\"scripts\") === -1)\n            this.panels.scripts = new WebInspector.ScriptsPanel();\n        if (hiddenPanels.indexOf(\"timeline\") === -1)\n            this.panels.timeline = new WebInspector.TimelinePanel();\n        if (hiddenPanels.indexOf(\"profiles\") === -1) {\n            this.panels.profiles = new WebInspector.ProfilesPanel();\n            this.panels.profiles.registerProfileType(new WebInspector.CPUProfileType());\n            if (Preferences.heapProfilerPresent) {\n                if (!Preferences.detailedHeapProfiles)\n                    this.panels.profiles.registerProfileType(new WebInspector.HeapSnapshotProfileType());\n                else\n                    this.panels.profiles.registerProfileType(new WebInspector.DetailedHeapshotProfileType());\n            }\n        }\n        if (hiddenPanels.indexOf(\"audits\") === -1)\n            this.panels.audits = new WebInspector.AuditsPanel();\n        if (hiddenPanels.indexOf(\"console\") === -1)\n            this.panels.console = new WebInspector.ConsolePanel();\n    },\n\n    get attached()\n    {\n        return this._attached;\n    },\n\n    set attached(x)\n    {\n        if (this._attached === x)\n            return;\n\n        this._attached = x;\n\n        this.updateSearchLabel();\n\n        var dockToggleButton = document.getElementById(\"dock-status-bar-item\");\n        var body = document.body;\n\n        if (x) {\n            body.removeStyleClass(\"detached\");\n            body.addStyleClass(\"attached\");\n            dockToggleButton.title = WebInspector.UIString(\"Undock into separate window.\");\n        } else {\n            body.removeStyleClass(\"attached\");\n            body.addStyleClass(\"detached\");\n            dockToggleButton.title = WebInspector.UIString(\"Dock to main window.\");\n        }\n        if (this.drawer)\n            this.drawer.resize();\n    },\n\n    get errors()\n    {\n        return this._errors || 0;\n    },\n\n    set errors(x)\n    {\n        x = Math.max(x, 0);\n\n        if (this._errors === x)\n            return;\n        this._errors = x;\n        this._updateErrorAndWarningCounts();\n    },\n\n    get warnings()\n    {\n        return this._warnings || 0;\n    },\n\n    set warnings(x)\n    {\n        x = Math.max(x, 0);\n\n        if (this._warnings === x)\n            return;\n        this._warnings = x;\n        this._updateErrorAndWarningCounts();\n    },\n\n    _updateErrorAndWarningCounts: function()\n    {\n        var errorWarningElement = document.getElementById(\"error-warning-count\");\n        if (!errorWarningElement)\n            return;\n\n        if (!this.errors && !this.warnings) {\n            errorWarningElement.addStyleClass(\"hidden\");\n            return;\n        }\n\n        errorWarningElement.removeStyleClass(\"hidden\");\n\n        errorWarningElement.removeChildren();\n\n        if (this.errors) {\n            var errorElement = document.createElement(\"span\");\n            errorElement.id = \"error-count\";\n            errorElement.textContent = this.errors;\n            errorWarningElement.appendChild(errorElement);\n        }\n\n        if (this.warnings) {\n            var warningsElement = document.createElement(\"span\");\n            warningsElement.id = \"warning-count\";\n            warningsElement.textContent = this.warnings;\n            errorWarningElement.appendChild(warningsElement);\n        }\n\n        if (this.errors) {\n            if (this.warnings) {\n                if (this.errors == 1) {\n                    if (this.warnings == 1)\n                        errorWarningElement.title = WebInspector.UIString(\"%d error, %d warning\", this.errors, this.warnings);\n                    else\n                        errorWarningElement.title = WebInspector.UIString(\"%d error, %d warnings\", this.errors, this.warnings);\n                } else if (this.warnings == 1)\n                    errorWarningElement.title = WebInspector.UIString(\"%d errors, %d warning\", this.errors, this.warnings);\n                else\n                    errorWarningElement.title = WebInspector.UIString(\"%d errors, %d warnings\", this.errors, this.warnings);\n            } else if (this.errors == 1)\n                errorWarningElement.title = WebInspector.UIString(\"%d error\", this.errors);\n            else\n                errorWarningElement.title = WebInspector.UIString(\"%d errors\", this.errors);\n        } else if (this.warnings == 1)\n            errorWarningElement.title = WebInspector.UIString(\"%d warning\", this.warnings);\n        else if (this.warnings)\n            errorWarningElement.title = WebInspector.UIString(\"%d warnings\", this.warnings);\n        else\n            errorWarningElement.title = null;\n    },\n\n    highlightDOMNode: function(nodeId)\n    {\n        if (\"_hideDOMNodeHighlightTimeout\" in this) {\n            clearTimeout(this._hideDOMNodeHighlightTimeout);\n            delete this._hideDOMNodeHighlightTimeout;\n        }\n\n        if (this._highlightedDOMNodeId === nodeId)\n            return;\n\n        this._highlightedDOMNodeId = nodeId;\n        if (nodeId)\n            InspectorBackend.highlightDOMNode(nodeId);\n        else\n            InspectorBackend.hideDOMNodeHighlight();\n    },\n\n    highlightDOMNodeForTwoSeconds: function(nodeId)\n    {\n        this.highlightDOMNode(nodeId);\n        this._hideDOMNodeHighlightTimeout = setTimeout(this.highlightDOMNode.bind(this, 0), 2000);\n    },\n\n    wireElementWithDOMNode: function(element, nodeId)\n    {\n        element.addEventListener(\"click\", this._updateFocusedNode.bind(this, nodeId), false);\n        element.addEventListener(\"mouseover\", this.highlightDOMNode.bind(this, nodeId), false);\n        element.addEventListener(\"mouseout\", this.highlightDOMNode.bind(this, 0), false);\n    },\n\n    _updateFocusedNode: function(nodeId)\n    {\n        this.currentPanel = this.panels.elements;\n        this.panels.elements.updateFocusedNode(nodeId);\n    },\n\n    get networkResources()\n    {\n        return this.panels.network.resources;\n    },\n\n    networkResourceById: function(id)\n    {\n        return this.panels.network.resourceById(id);\n    },\n\n    forAllResources: function(callback)\n    {\n        WebInspector.resourceTreeModel.forAllResources(callback);\n    },\n\n    resourceForURL: function(url)\n    {\n        return this.resourceTreeModel.resourceForURL(url);\n    },\n\n    openLinkExternallyLabel: function()\n    {\n        return WebInspector.UIString(\"Open Link in New Window\");\n    }\n}\n\nWebInspector.PlatformFlavor = {\n    WindowsVista: \"windows-vista\",\n    MacTiger: \"mac-tiger\",\n    MacLeopard: \"mac-leopard\",\n    MacSnowLeopard: \"mac-snowleopard\"\n};\n\n(function parseQueryParameters()\n{\n    WebInspector.queryParamsObject = {};\n    var queryParams = window.location.search;\n    if (!queryParams)\n        return;\n    var params = queryParams.substring(1).split(\"&\");\n    for (var i = 0; i < params.length; ++i) {\n        var pair = params[i].split(\"=\");\n        WebInspector.queryParamsObject[pair[0]] = pair[1];\n    }\n})();\n\nWebInspector.loaded = function()\n{\n    if (\"page\" in WebInspector.queryParamsObject) {\n        var page = WebInspector.queryParamsObject.page;\n        var host = \"host\" in WebInspector.queryParamsObject ? WebInspector.queryParamsObject.host : window.location.host;\n        WebInspector.socket = new WebSocket(\"ws://\" + host + \"/devtools/page/\" + page);\n        WebInspector.socket.onmessage = function(message) { InspectorBackend.dispatch(message.data); }\n        WebInspector.socket.onerror = function(error) { console.error(error); }\n        WebInspector.socket.onopen = function() {\n            InspectorFrontendHost.sendMessageToBackend = WebInspector.socket.send.bind(WebInspector.socket);\n            InspectorFrontendHost.loaded = WebInspector.socket.send.bind(WebInspector.socket, \"loaded\");\n            WebInspector.doLoadedDone();\n        }\n        return;\n    }\n    WebInspector.doLoadedDone();\n}\n\nWebInspector.doLoadedDone = function()\n{\n    InspectorFrontendHost.loaded();\n\n    var platform = WebInspector.platform;\n    document.body.addStyleClass(\"platform-\" + platform);\n    var flavor = WebInspector.platformFlavor;\n    if (flavor)\n        document.body.addStyleClass(\"platform-\" + flavor);\n    var port = WebInspector.port;\n    document.body.addStyleClass(\"port-\" + port);\n\n    WebInspector.settings = new WebInspector.Settings();\n\n    this._registerShortcuts();\n\n    // set order of some sections explicitly\n    WebInspector.shortcutsHelp.section(WebInspector.UIString(\"Console\"));\n    WebInspector.shortcutsHelp.section(WebInspector.UIString(\"Elements Panel\"));\n\n    this.drawer = new WebInspector.Drawer();\n    this.console = new WebInspector.ConsoleView(this.drawer);\n    this.drawer.visibleView = this.console;\n    this.resourceTreeModel = new WebInspector.ResourceTreeModel();\n    this.networkManager = new WebInspector.NetworkManager(this.resourceTreeModel);\n    this.domAgent = new WebInspector.DOMAgent();\n\n    InspectorBackend.registerDomainDispatcher(\"Inspector\", this);\n\n    this.resourceCategories = {\n        documents: new WebInspector.ResourceCategory(\"documents\", WebInspector.UIString(\"Documents\"), \"rgb(47,102,236)\"),\n        stylesheets: new WebInspector.ResourceCategory(\"stylesheets\", WebInspector.UIString(\"Stylesheets\"), \"rgb(157,231,119)\"),\n        images: new WebInspector.ResourceCategory(\"images\", WebInspector.UIString(\"Images\"), \"rgb(164,60,255)\"),\n        scripts: new WebInspector.ResourceCategory(\"scripts\", WebInspector.UIString(\"Scripts\"), \"rgb(255,121,0)\"),\n        xhr: new WebInspector.ResourceCategory(\"xhr\", WebInspector.UIString(\"XHR\"), \"rgb(231,231,10)\"),\n        fonts: new WebInspector.ResourceCategory(\"fonts\", WebInspector.UIString(\"Fonts\"), \"rgb(255,82,62)\"),\n        websockets: new WebInspector.ResourceCategory(\"websockets\", WebInspector.UIString(\"WebSockets\"), \"rgb(186,186,186)\"), // FIXME: Decide the color.\n        other: new WebInspector.ResourceCategory(\"other\", WebInspector.UIString(\"Other\"), \"rgb(186,186,186)\")\n    };\n\n    this.cssModel = new WebInspector.CSSStyleModel();\n    this.debuggerModel = new WebInspector.DebuggerModel();\n\n    this.breakpointManager = new WebInspector.BreakpointManager();\n\n    this.panels = {};\n    this._createPanels();\n    this._panelHistory = new WebInspector.PanelHistory();\n\n    var toolbarElement = document.getElementById(\"toolbar\");\n    var previousToolbarItem = toolbarElement.children[0];\n\n    this.panelOrder = [];\n    for (var panelName in this.panels)\n        previousToolbarItem = WebInspector.addPanelToolbarIcon(toolbarElement, this.panels[panelName], previousToolbarItem);\n\n    this.Tips = {\n        ResourceNotCompressed: {id: 0, message: WebInspector.UIString(\"You could save bandwidth by having your web server compress this transfer with gzip or zlib.\")}\n    };\n\n    this.Warnings = {\n        IncorrectMIMEType: {id: 0, message: WebInspector.UIString(\"Resource interpreted as %s but transferred with MIME type %s.\")}\n    };\n\n    this.addMainEventListeners(document);\n\n    window.addEventListener(\"resize\", this.windowResize.bind(this), true);\n\n    document.addEventListener(\"focus\", this.focusChanged.bind(this), true);\n    document.addEventListener(\"keydown\", this.documentKeyDown.bind(this), false);\n    document.addEventListener(\"beforecopy\", this.documentCanCopy.bind(this), true);\n    document.addEventListener(\"copy\", this.documentCopy.bind(this), true);\n    document.addEventListener(\"contextmenu\", this.contextMenuEventFired.bind(this), true);\n\n    var dockToggleButton = document.getElementById(\"dock-status-bar-item\");\n    dockToggleButton.addEventListener(\"click\", this.toggleAttach.bind(this), false);\n\n    if (this.attached)\n        dockToggleButton.title = WebInspector.UIString(\"Undock into separate window.\");\n    else\n        dockToggleButton.title = WebInspector.UIString(\"Dock to main window.\");\n\n    var errorWarningCount = document.getElementById(\"error-warning-count\");\n    errorWarningCount.addEventListener(\"click\", this.showConsole.bind(this), false);\n    this._updateErrorAndWarningCounts();\n\n    var searchField = document.getElementById(\"search\");\n    searchField.addEventListener(\"search\", this.performSearch.bind(this), false); // when the search is emptied\n    searchField.addEventListener(\"mousedown\", this._searchFieldManualFocus.bind(this), false); // when the search field is manually selected\n    searchField.addEventListener(\"keydown\", this._searchKeyDown.bind(this), true);\n\n    toolbarElement.addEventListener(\"mousedown\", this.toolbarDragStart, true);\n    document.getElementById(\"close-button-left\").addEventListener(\"click\", this.close, true);\n    document.getElementById(\"close-button-right\").addEventListener(\"click\", this.close, true);\n\n    this.extensionServer.initExtensions();\n\n    function onPopulateScriptObjects()\n    {\n        if (!WebInspector.currentPanel)\n            WebInspector.showPanel(WebInspector.settings.lastActivePanel);\n    }\n    InspectorBackend.populateScriptObjects(onPopulateScriptObjects);\n\n    if (Preferences.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled)\n        this.debuggerModel.enableDebugger();\n    if (Preferences.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled)\n        InspectorBackend.enableProfiler();\n    if (WebInspector.settings.monitoringXHREnabled)\n        InspectorBackend.setMonitoringXHREnabled(true);\n\n    InspectorBackend.setConsoleMessagesEnabled(true);\n\n    function propertyNamesCallback(names)\n    {\n        WebInspector.cssNameCompletions = new WebInspector.CSSCompletions(names);\n    }\n    // As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.\n    InspectorBackend.getSupportedCSSProperties(propertyNamesCallback);\n}\n\nWebInspector.addPanelToolbarIcon = function(toolbarElement, panel, previousToolbarItem)\n{\n    var panelToolbarItem = panel.toolbarItem;\n    this.panelOrder.push(panel);\n    panelToolbarItem.addEventListener(\"click\", this._toolbarItemClicked.bind(this));\n    if (previousToolbarItem)\n        toolbarElement.insertBefore(panelToolbarItem, previousToolbarItem.nextSibling);\n    else\n        toolbarElement.insertBefore(panelToolbarItem, toolbarElement.firstChild);\n    return panelToolbarItem;\n}\n\nvar windowLoaded = function()\n{\n    var localizedStringsURL = InspectorFrontendHost.localizedStringsURL();\n    if (localizedStringsURL) {\n        var localizedStringsScriptElement = document.createElement(\"script\");\n        localizedStringsScriptElement.addEventListener(\"load\", WebInspector.loaded.bind(WebInspector), false);\n        localizedStringsScriptElement.type = \"text/javascript\";\n        localizedStringsScriptElement.src = localizedStringsURL;\n        document.head.appendChild(localizedStringsScriptElement);\n    } else\n        WebInspector.loaded();\n\n    window.removeEventListener(\"DOMContentLoaded\", windowLoaded, false);\n    delete windowLoaded;\n};\n\nwindow.addEventListener(\"DOMContentLoaded\", windowLoaded, false);\n\nWebInspector.dispatch = function(message) {\n    // We'd like to enforce asynchronous interaction between the inspector controller and the frontend.\n    // This is important to LayoutTests.\n    function delayDispatch()\n    {\n        InspectorBackend.dispatch(message);\n        WebInspector.pendingDispatches--;\n    }\n    WebInspector.pendingDispatches++;\n    setTimeout(delayDispatch, 0);\n}\n\nWebInspector.dispatchMessageFromBackend = function(messageObject)\n{\n    WebInspector.dispatch(messageObject);\n}\n\nWebInspector.windowResize = function(event)\n{\n    if (this.currentPanel)\n        this.currentPanel.resize();\n    this.drawer.resize();\n}\n\nWebInspector.windowFocused = function(event)\n{\n    // Fires after blur, so when focusing on either the main inspector\n    // or an <iframe> within the inspector we should always remove the\n    // \"inactive\" class.\n    if (event.target.document.nodeType === Node.DOCUMENT_NODE)\n        document.body.removeStyleClass(\"inactive\");\n}\n\nWebInspector.windowBlurred = function(event)\n{\n    // Leaving the main inspector or an <iframe> within the inspector.\n    // We can add \"inactive\" now, and if we are moving the focus to another\n    // part of the inspector then windowFocused will correct this.\n    if (event.target.document.nodeType === Node.DOCUMENT_NODE)\n        document.body.addStyleClass(\"inactive\");\n}\n\nWebInspector.focusChanged = function(event)\n{\n    this.currentFocusElement = event.target;\n}\n\nWebInspector.setAttachedWindow = function(attached)\n{\n    this.attached = attached;\n}\n\nWebInspector.close = function(event)\n{\n    if (this._isClosing)\n        return;\n    this._isClosing = true;\n    InspectorFrontendHost.closeWindow();\n}\n\nWebInspector.disconnectFromBackend = function()\n{\n    InspectorFrontendHost.disconnectFromBackend();\n}\n\nWebInspector.documentClick = function(event)\n{\n    var anchor = event.target.enclosingNodeOrSelfWithNodeName(\"a\");\n    if (!anchor || anchor.target === \"_blank\")\n        return;\n\n    // Prevent the link from navigating, since we don't do any navigation by following links normally.\n    event.preventDefault();\n    event.stopPropagation();\n\n    function followLink()\n    {\n        // FIXME: support webkit-html-external-link links here.\n        if (WebInspector.canShowSourceLine(anchor.href, anchor.getAttribute(\"line_number\"), anchor.getAttribute(\"preferred_panel\"))) {\n            if (anchor.hasStyleClass(\"webkit-html-external-link\")) {\n                anchor.removeStyleClass(\"webkit-html-external-link\");\n                anchor.addStyleClass(\"webkit-html-resource-link\");\n            }\n\n            WebInspector.showSourceLine(anchor.href, anchor.getAttribute(\"line_number\"), anchor.getAttribute(\"preferred_panel\"));\n            return;\n        }\n\n        var profileMatch = WebInspector.ProfileType.URLRegExp.exec(anchor.href);\n        if (profileMatch) {\n            WebInspector.showProfileForURL(anchor.href);\n            return;\n        }\n\n        var parsedURL = anchor.href.asParsedURL();\n        if (parsedURL && parsedURL.scheme === \"webkit-link-action\") {\n            if (parsedURL.host === \"show-panel\") {\n                var panel = parsedURL.path.substring(1);\n                if (WebInspector.panels[panel])\n                    WebInspector.showPanel(panel);\n            }\n            return;\n        }\n\n        WebInspector.showPanel(\"resources\");\n    }\n\n    if (WebInspector.followLinkTimeout)\n        clearTimeout(WebInspector.followLinkTimeout);\n\n    if (anchor.preventFollowOnDoubleClick) {\n        // Start a timeout if this is the first click, if the timeout is canceled\n        // before it fires, then a double clicked happened or another link was clicked.\n        if (event.detail === 1)\n            WebInspector.followLinkTimeout = setTimeout(followLink, 333);\n        return;\n    }\n\n    followLink();\n}\n\nWebInspector.openResource = function(resourceURL, inResourcesPanel)\n{\n    var resource = WebInspector.resourceForURL(resourceURL);\n    if (inResourcesPanel && resource) {\n        WebInspector.panels.resources.showResource(resource);\n        WebInspector.showPanel(\"resources\");\n    } else\n        InspectorBackend.openInInspectedWindow(resource ? resource.url : resourceURL);\n}\n\nWebInspector._registerShortcuts = function()\n{\n    var shortcut = WebInspector.KeyboardShortcut;\n    var section = WebInspector.shortcutsHelp.section(WebInspector.UIString(\"All Panels\"));\n    var keys = [\n        shortcut.shortcutToString(\"]\", shortcut.Modifiers.CtrlOrMeta),\n        shortcut.shortcutToString(\"[\", shortcut.Modifiers.CtrlOrMeta)\n    ];\n    section.addRelatedKeys(keys, WebInspector.UIString(\"Next/previous panel\"));\n    section.addKey(shortcut.shortcutToString(shortcut.Keys.Esc), WebInspector.UIString(\"Toggle console\"));\n    section.addKey(shortcut.shortcutToString(\"f\", shortcut.Modifiers.CtrlOrMeta), WebInspector.UIString(\"Search\"));\n    if (WebInspector.isMac()) {\n        keys = [\n            shortcut.shortcutToString(\"g\", shortcut.Modifiers.Meta),\n            shortcut.shortcutToString(\"g\", shortcut.Modifiers.Meta | shortcut.Modifiers.Shift)\n        ];\n        section.addRelatedKeys(keys, WebInspector.UIString(\"Find next/previous\"));\n    }\n}\n\nWebInspector.documentKeyDown = function(event)\n{\n    var isInputElement = event.target.nodeName === \"INPUT\";\n    var isInEditMode = event.target.enclosingNodeOrSelfWithClass(\"text-prompt\") || WebInspector.isEditingAnyField();\n    var helpKey = WebInspector.isMac() ? \"U+003F\" : \"U+00BF\"; // \"?\" for both platforms\n    var key = event.keyIdentifier || event.key;\n    if (key === \"F1\" ||\n        (key === helpKey && event.shiftKey && (!isInEditMode && !isInputElement || event.metaKey))) {\n        WebInspector.shortcutsHelp.show();\n        event.stopPropagation();\n        event.preventDefault();\n        return;\n    }\n\n    if (WebInspector.isEditingAnyField())\n        return;\n\n    if (this.currentFocusElement && this.currentFocusElement.handleKeyEvent) {\n        this.currentFocusElement.handleKeyEvent(event);\n        if (event.handled) {\n            event.preventDefault();\n            return;\n        }\n    }\n\n    if (this.currentPanel && this.currentPanel.handleShortcut) {\n        this.currentPanel.handleShortcut(event);\n        if (event.handled) {\n            event.preventDefault();\n            return;\n        }\n    }\n\n    var isMac = WebInspector.isMac();\n    switch (key) {\n        case \"Left\":\n            var isBackKey = !isInEditMode && (isMac ? event.metaKey : event.ctrlKey);\n            if (isBackKey && this._panelHistory.canGoBack()) {\n                this._panelHistory.goBack();\n                event.preventDefault();\n            }\n            break;\n\n        case \"Right\":\n            var isForwardKey = !isInEditMode && (isMac ? event.metaKey : event.ctrlKey);\n            if (isForwardKey && this._panelHistory.canGoForward()) {\n                this._panelHistory.goForward();\n                event.preventDefault();\n            }\n            break;\n\n        case \"U+001B\": // Escape key\n            event.preventDefault();\n            if (this.drawer.fullPanel)\n                return;\n\n            this.drawer.visible = !this.drawer.visible;\n            break;\n\n        case \"U+0046\": // F key\n            if (isMac)\n                var isFindKey = event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey;\n            else\n                var isFindKey = event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey;\n\n            if (isFindKey) {\n                WebInspector.focusSearchField();\n                event.preventDefault();\n            }\n            break;\n\n        case \"F3\":\n            if (!isMac) {\n                WebInspector.focusSearchField();\n                event.preventDefault();\n            }\n            break;\n\n        case \"U+0047\": // G key\n            if (isMac && event.metaKey && !event.ctrlKey && !event.altKey) {\n                if (event.shiftKey) {\n                    if (this.currentPanel.jumpToPreviousSearchResult)\n                        this.currentPanel.jumpToPreviousSearchResult();\n                } else if (this.currentPanel.jumpToNextSearchResult)\n                    this.currentPanel.jumpToNextSearchResult();\n                event.preventDefault();\n            }\n            break;\n\n        // Windows and Mac have two different definitions of [, so accept both.\n        case \"U+005B\":\n        case \"U+00DB\": // [ key\n            if (isMac)\n                var isRotateLeft = event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey;\n            else\n                var isRotateLeft = event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey;\n\n            if (isRotateLeft) {\n                var index = this.panelOrder.indexOf(this.currentPanel);\n                index = (index === 0) ? this.panelOrder.length - 1 : index - 1;\n                this.panelOrder[index].toolbarItem.click();\n                event.preventDefault();\n            }\n\n            break;\n\n        // Windows and Mac have two different definitions of ], so accept both.\n        case \"U+005D\":\n        case \"U+00DD\":  // ] key\n            if (isMac)\n                var isRotateRight = event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey;\n            else\n                var isRotateRight = event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey;\n\n            if (isRotateRight) {\n                var index = this.panelOrder.indexOf(this.currentPanel);\n                index = (index + 1) % this.panelOrder.length;\n                this.panelOrder[index].toolbarItem.click();\n                event.preventDefault();\n            }\n\n            break;\n\n        case \"U+0052\": // R key\n            if ((event.metaKey && isMac) || (event.ctrlKey && !isMac)) {\n                InspectorBackend.reloadPage(event.shiftKey);\n                event.preventDefault();\n            }\n            break;\n        case \"F5\":\n            if (!isMac)\n                InspectorBackend.reloadPage(event.ctrlKey || event.shiftKey);\n            break;\n    }\n}\n\nWebInspector.documentCanCopy = function(event)\n{\n    if (this.currentPanel && this.currentPanel.handleCopyEvent)\n        event.preventDefault();\n}\n\nWebInspector.documentCopy = function(event)\n{\n    if (this.currentPanel && this.currentPanel.handleCopyEvent)\n        this.currentPanel.handleCopyEvent(event);\n}\n\nWebInspector.contextMenuEventFired = function(event)\n{\n    if (event.handled || event.target.hasStyleClass(\"popup-glasspane\"))\n        event.preventDefault();\n}\n\nWebInspector.animateStyle = function(animations, duration, callback)\n{\n    var interval;\n    var complete = 0;\n    var hasCompleted = false;\n\n    var intervalDuration = (1000 / 30); // 30 frames per second.\n    var animationsLength = animations.length;\n    var propertyUnit = {opacity: \"\"};\n    var defaultUnit = \"px\";\n\n    function cubicInOut(t, b, c, d)\n    {\n        if ((t/=d/2) < 1) return c/2*t*t*t + b;\n        return c/2*((t-=2)*t*t + 2) + b;\n    }\n\n    // Pre-process animations.\n    for (var i = 0; i < animationsLength; ++i) {\n        var animation = animations[i];\n        var element = null, start = null, end = null, key = null;\n        for (key in animation) {\n            if (key === \"element\")\n                element = animation[key];\n            else if (key === \"start\")\n                start = animation[key];\n            else if (key === \"end\")\n                end = animation[key];\n        }\n\n        if (!element || !end)\n            continue;\n\n        if (!start) {\n            var computedStyle = element.ownerDocument.defaultView.getComputedStyle(element);\n            start = {};\n            for (key in end)\n                start[key] = parseInt(computedStyle.getPropertyValue(key));\n            animation.start = start;\n        } else\n            for (key in start)\n                element.style.setProperty(key, start[key] + (key in propertyUnit ? propertyUnit[key] : defaultUnit));\n    }\n\n    function animateLoop()\n    {\n        // Advance forward.\n        complete += intervalDuration;\n        var next = complete + intervalDuration;\n\n        // Make style changes.\n        for (var i = 0; i < animationsLength; ++i) {\n            var animation = animations[i];\n            var element = animation.element;\n            var start = animation.start;\n            var end = animation.end;\n            if (!element || !end)\n                continue;\n\n            var style = element.style;\n            for (key in end) {\n                var endValue = end[key];\n                if (next < duration) {\n                    var startValue = start[key];\n                    var newValue = cubicInOut(complete, startValue, endValue - startValue, duration);\n                    style.setProperty(key, newValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));\n                } else\n                    style.setProperty(key, endValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));\n            }\n        }\n\n        // End condition.\n        if (complete >= duration) {\n            hasCompleted = true;\n            clearInterval(interval);\n            if (callback)\n                callback();\n        }\n    }\n\n    function forceComplete()\n    {\n        if (!hasCompleted) {\n            complete = duration;\n            animateLoop();\n        }\n    }\n\n    function cancel()\n    {\n        hasCompleted = true;\n        clearInterval(interval);\n    }\n\n    interval = setInterval(animateLoop, intervalDuration);\n    return {\n        cancel: cancel,\n        forceComplete: forceComplete\n    };\n}\n\nWebInspector.updateSearchLabel = function()\n{\n    if (!this.currentPanel)\n        return;\n\n    var newLabel = WebInspector.UIString(\"Search %s\", this.currentPanel.toolbarItemLabel);\n    if (this.attached)\n        document.getElementById(\"search\").setAttribute(\"placeholder\", newLabel);\n    else {\n        document.getElementById(\"search\").removeAttribute(\"placeholder\");\n        document.getElementById(\"search-toolbar-label\").textContent = newLabel;\n    }\n}\n\nWebInspector.focusSearchField = function()\n{\n    var searchField = document.getElementById(\"search\");\n    searchField.focus();\n    searchField.select();\n}\n\nWebInspector.toggleAttach = function()\n{\n    if (!this.attached)\n        InspectorFrontendHost.requestAttachWindow();\n    else\n        InspectorFrontendHost.requestDetachWindow();\n}\n\nWebInspector.toolbarDragStart = function(event)\n{\n    if ((!WebInspector.attached && WebInspector.platformFlavor !== WebInspector.PlatformFlavor.MacLeopard && WebInspector.platformFlavor !== WebInspector.PlatformFlavor.MacSnowLeopard) || WebInspector.port == \"qt\")\n        return;\n\n    var target = event.target;\n    if (target.hasStyleClass(\"toolbar-item\") && target.hasStyleClass(\"toggleable\"))\n        return;\n\n    var toolbar = document.getElementById(\"toolbar\");\n    if (target !== toolbar && !target.hasStyleClass(\"toolbar-item\"))\n        return;\n\n    toolbar.lastScreenX = event.screenX;\n    toolbar.lastScreenY = event.screenY;\n\n    WebInspector.elementDragStart(toolbar, WebInspector.toolbarDrag, WebInspector.toolbarDragEnd, event, (WebInspector.attached ? \"row-resize\" : \"default\"));\n}\n\nWebInspector.toolbarDragEnd = function(event)\n{\n    var toolbar = document.getElementById(\"toolbar\");\n\n    WebInspector.elementDragEnd(event);\n\n    delete toolbar.lastScreenX;\n    delete toolbar.lastScreenY;\n}\n\nWebInspector.toolbarDrag = function(event)\n{\n    var toolbar = document.getElementById(\"toolbar\");\n\n    if (WebInspector.attached) {\n        var height = window.innerHeight - (event.screenY - toolbar.lastScreenY);\n\n        InspectorFrontendHost.setAttachedWindowHeight(height);\n    } else {\n        var x = event.screenX - toolbar.lastScreenX;\n        var y = event.screenY - toolbar.lastScreenY;\n\n        // We cannot call window.moveBy here because it restricts the movement\n        // of the window at the edges.\n        InspectorFrontendHost.moveWindowBy(x, y);\n    }\n\n    toolbar.lastScreenX = event.screenX;\n    toolbar.lastScreenY = event.screenY;\n\n    event.preventDefault();\n}\n\nWebInspector.elementDragStart = function(element, dividerDrag, elementDragEnd, event, cursor)\n{\n    if (this._elementDraggingEventListener || this._elementEndDraggingEventListener)\n        this.elementDragEnd(event);\n\n    this._elementDraggingEventListener = dividerDrag;\n    this._elementEndDraggingEventListener = elementDragEnd;\n\n    document.addEventListener(\"mousemove\", dividerDrag, true);\n    document.addEventListener(\"mouseup\", elementDragEnd, true);\n\n    document.body.style.cursor = cursor;\n\n    event.preventDefault();\n}\n\nWebInspector.elementDragEnd = function(event)\n{\n    document.removeEventListener(\"mousemove\", this._elementDraggingEventListener, true);\n    document.removeEventListener(\"mouseup\", this._elementEndDraggingEventListener, true);\n\n    document.body.style.removeProperty(\"cursor\");\n\n    delete this._elementDraggingEventListener;\n    delete this._elementEndDraggingEventListener;\n\n    event.preventDefault();\n}\n\nWebInspector.toggleSearchingForNode = function()\n{\n    if (this.panels.elements) {\n        this.showPanel(\"elements\");\n        this.panels.elements.toggleSearchingForNode();\n    }\n}\n\nWebInspector.showConsole = function()\n{\n    this.drawer.showView(this.console);\n}\n\nWebInspector.showPanel = function(panel)\n{\n    if (!(panel in this.panels))\n        panel = \"elements\";\n    this.currentPanel = this.panels[panel];\n}\n\nWebInspector.domContentEventFired = function(time)\n{\n    this.panels.audits.mainResourceDOMContentTime = time;\n    if (this.panels.network)\n        this.panels.network.mainResourceDOMContentTime = time;\n    this.extensionServer.notifyPageDOMContentLoaded((time - WebInspector.mainResource.startTime) * 1000);\n    this.mainResourceDOMContentTime = time;\n}\n\nWebInspector.loadEventFired = function(time)\n{\n    this.panels.audits.mainResourceLoadTime = time;\n    this.panels.network.mainResourceLoadTime = time;\n    this.panels.resources.loadEventFired();\n    this.extensionServer.notifyPageLoaded((time - WebInspector.mainResource.startTime) * 1000);\n    this.mainResourceLoadTime = time;\n}\n\nWebInspector.searchingForNodeWasEnabled = function()\n{\n    this.panels.elements.searchingForNodeWasEnabled();\n}\n\nWebInspector.searchingForNodeWasDisabled = function()\n{\n    this.panels.elements.searchingForNodeWasDisabled();\n}\n\nWebInspector.reset = function()\n{\n    this.debuggerModel.reset();\n\n    for (var panelName in this.panels) {\n        var panel = this.panels[panelName];\n        if (\"reset\" in panel)\n            panel.reset();\n    }\n\n    this.resources = {};\n    this.highlightDOMNode(0);\n\n    this.console.clearMessages();\n    this.extensionServer.notifyInspectorReset();\n}\n\nWebInspector.bringToFront = function()\n{\n    InspectorFrontendHost.bringToFront();\n}\n\nWebInspector.inspectedURLChanged = function(url)\n{\n    InspectorFrontendHost.inspectedURLChanged(url);\n    this.settings.inspectedURLChanged(url);\n    this.extensionServer.notifyInspectedURLChanged();\n}\n\nWebInspector.log = function(message, messageLevel)\n{\n    // remember 'this' for setInterval() callback\n    var self = this;\n\n    // return indication if we can actually log a message\n    function isLogAvailable()\n    {\n        return WebInspector.ConsoleMessage && WebInspector.RemoteObject && self.console;\n    }\n\n    // flush the queue of pending messages\n    function flushQueue()\n    {\n        var queued = WebInspector.log.queued;\n        if (!queued)\n            return;\n\n        for (var i = 0; i < queued.length; ++i)\n            logMessage(queued[i]);\n\n        delete WebInspector.log.queued;\n    }\n\n    // flush the queue if it console is available\n    // - this function is run on an interval\n    function flushQueueIfAvailable()\n    {\n        if (!isLogAvailable())\n            return;\n\n        clearInterval(WebInspector.log.interval);\n        delete WebInspector.log.interval;\n\n        flushQueue();\n    }\n\n    // actually log the message\n    function logMessage(message)\n    {\n        var repeatCount = 1;\n        if (message == WebInspector.log.lastMessage)\n            repeatCount = WebInspector.log.repeatCount + 1;\n\n        WebInspector.log.lastMessage = message;\n        WebInspector.log.repeatCount = repeatCount;\n\n        // ConsoleMessage expects a proxy object\n        message = new WebInspector.RemoteObject.fromPrimitiveValue(message);\n\n        // post the message\n        var msg = new WebInspector.ConsoleMessage(\n            WebInspector.ConsoleMessage.MessageSource.Other,\n            WebInspector.ConsoleMessage.MessageType.Log,\n            messageLevel || WebInspector.ConsoleMessage.MessageLevel.Debug,\n            -1,\n            null,\n            repeatCount,\n            null,\n            [message],\n            null);\n\n        self.console.addMessage(msg);\n    }\n\n    // if we can't log the message, queue it\n    if (!isLogAvailable()) {\n        if (!WebInspector.log.queued)\n            WebInspector.log.queued = [];\n\n        WebInspector.log.queued.push(message);\n\n        if (!WebInspector.log.interval)\n            WebInspector.log.interval = setInterval(flushQueueIfAvailable, 1000);\n\n        return;\n    }\n\n    // flush the pending queue if any\n    flushQueue();\n\n    // log the message\n    logMessage(message);\n}\n\nWebInspector.drawLoadingPieChart = function(canvas, percent) {\n    var g = canvas.getContext(\"2d\");\n    var darkColor = \"rgb(122, 168, 218)\";\n    var lightColor = \"rgb(228, 241, 251)\";\n    var cx = 8;\n    var cy = 8;\n    var r = 7;\n\n    g.beginPath();\n    g.arc(cx, cy, r, 0, Math.PI * 2, false);\n    g.closePath();\n\n    g.lineWidth = 1;\n    g.strokeStyle = darkColor;\n    g.fillStyle = lightColor;\n    g.fill();\n    g.stroke();\n\n    var startangle = -Math.PI / 2;\n    var endangle = startangle + (percent * Math.PI * 2);\n\n    g.beginPath();\n    g.moveTo(cx, cy);\n    g.arc(cx, cy, r, startangle, endangle, false);\n    g.closePath();\n\n    g.fillStyle = darkColor;\n    g.fill();\n}\n\nWebInspector.updateFocusedNode = function(nodeId)\n{\n    this._updateFocusedNode(nodeId);\n    this.highlightDOMNodeForTwoSeconds(nodeId);\n}\n\nWebInspector.displayNameForURL = function(url)\n{\n    if (!url)\n        return \"\";\n\n    var resource = this.resourceForURL(url);\n    if (resource)\n        return resource.displayName;\n\n    if (!WebInspector.mainResource)\n        return url.trimURL(\"\");\n\n    var lastPathComponent = WebInspector.mainResource.lastPathComponent;\n    var index = WebInspector.mainResource.url.indexOf(lastPathComponent);\n    if (index !== -1 && index + lastPathComponent.length === WebInspector.mainResource.url.length) {\n        var baseURL = WebInspector.mainResource.url.substring(0, index);\n        if (url.indexOf(baseURL) === 0)\n            return url.substring(index);\n    }\n\n    return url.trimURL(WebInspector.mainResource.domain);\n}\n\nWebInspector._choosePanelToShowSourceLine = function(url, line, preferredPanel)\n{\n    preferredPanel = preferredPanel || \"resources\";\n\n    var panel = this.panels[preferredPanel];\n    if (panel && panel.canShowSourceLine(url, line))\n        return panel;\n    panel = this.panels.resources;\n    return panel.canShowSourceLine(url, line) ? panel : null;\n}\n\nWebInspector.canShowSourceLine = function(url, line, preferredPanel)\n{\n    return !!this._choosePanelToShowSourceLine(url, line, preferredPanel);\n}\n\nWebInspector.showSourceLine = function(url, line, preferredPanel)\n{\n    this.currentPanel = this._choosePanelToShowSourceLine(url, line, preferredPanel);\n    if (!this.currentPanel)\n        return false;\n    if (this.drawer)\n        this.drawer.immediatelyFinishAnimation();\n    this.currentPanel.showSourceLine(url, line);\n    return true;\n}\n\nWebInspector.linkifyStringAsFragment = function(string)\n{\n    var container = document.createDocumentFragment();\n    var linkStringRegEx = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[\\w$\\-_+*'=\\|\\/\\\\(){}[\\]%@&#~,:;.!?]{2,}[\\w$\\-_+*=\\|\\/\\\\({%@&#~]/;\n    var lineColumnRegEx = /:(\\d+)(:(\\d+))?$/;\n\n    while (string) {\n        var linkString = linkStringRegEx.exec(string);\n        if (!linkString)\n            break;\n\n        linkString = linkString[0];\n        var title = linkString;\n        var linkIndex = string.indexOf(linkString);\n        var nonLink = string.substring(0, linkIndex);\n        container.appendChild(document.createTextNode(nonLink));\n\n        var profileStringMatches = WebInspector.ProfileType.URLRegExp.exec(title);\n        if (profileStringMatches)\n            title = WebInspector.panels.profiles.displayTitleForProfileLink(profileStringMatches[2], profileStringMatches[1]);\n\n        var realURL = (linkString.indexOf(\"www.\") === 0 ? \"http://\" + linkString : linkString);\n        var lineColumnMatch = lineColumnRegEx.exec(realURL);\n        if (lineColumnMatch)\n            realURL = realURL.substring(0, realURL.length - lineColumnMatch[0].length);\n\n        var hasResourceWithURL = !!WebInspector.resourceForURL(realURL);\n        var urlNode = WebInspector.linkifyURLAsNode(realURL, title, null, hasResourceWithURL);\n        container.appendChild(urlNode);\n        if (lineColumnMatch) {\n            urlNode.setAttribute(\"line_number\", lineColumnMatch[1]);\n            urlNode.setAttribute(\"preferred_panel\", \"scripts\");\n        }\n        string = string.substring(linkIndex + linkString.length, string.length);\n    }\n\n    if (string)\n        container.appendChild(document.createTextNode(string));\n\n    return container;\n}\n\nWebInspector.showProfileForURL = function(url)\n{\n    WebInspector.showPanel(\"profiles\");\n    WebInspector.panels.profiles.showProfileForURL(url);\n}\n\nWebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, tooltipText)\n{\n    if (!linkText)\n        linkText = url;\n    classes = (classes ? classes + \" \" : \"\");\n    classes += isExternal ? \"webkit-html-external-link\" : \"webkit-html-resource-link\";\n\n    var a = document.createElement(\"a\");\n    a.href = url;\n    a.className = classes;\n    if (typeof tooltipText === \"undefined\")\n        a.title = url;\n    else if (typeof tooltipText !== \"string\" || tooltipText.length)\n        a.title = tooltipText;\n    a.textContent = linkText;\n\n    return a;\n}\n\nWebInspector.linkifyURL = function(url, linkText, classes, isExternal, tooltipText)\n{\n    // Use the DOM version of this function so as to avoid needing to escape attributes.\n    // FIXME:  Get rid of linkifyURL entirely.\n    return WebInspector.linkifyURLAsNode(url, linkText, classes, isExternal, tooltipText).outerHTML;\n}\n\nWebInspector.linkifyResourceAsNode = function(url, preferredPanel, lineNumber, classes, tooltipText)\n{\n    var linkText = WebInspector.displayNameForURL(url);\n    if (lineNumber)\n        linkText += \":\" + lineNumber;\n    var node = WebInspector.linkifyURLAsNode(url, linkText, classes, false, tooltipText);\n    node.setAttribute(\"line_number\", lineNumber);\n    node.setAttribute(\"preferred_panel\", preferredPanel);\n    return node;\n}\n\nWebInspector.resourceURLForRelatedNode = function(node, url)\n{\n    if (!url || url.indexOf(\"://\") > 0)\n        return url;\n\n    for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) {\n        if (frameOwnerCandidate.documentURL) {\n            var result = WebInspector.completeURL(frameOwnerCandidate.documentURL, url);\n            if (result)\n                return result;\n            break;\n        }\n    }\n\n    // documentURL not found or has bad value\n    var resourceURL = url;\n    function callback(resource)\n    {\n        if (resource.path === url) {\n            resourceURL = resource.url;\n            return true;\n        }\n    }\n    WebInspector.forAllResources(callback);\n    return resourceURL;\n}\n\nWebInspector.completeURL = function(baseURL, href)\n{\n    if (href) {\n        // Return absolute URLs as-is.\n        var parsedHref = href.asParsedURL();\n        if (parsedHref && parsedHref.scheme)\n            return href;\n    }\n\n    var parsedURL = baseURL.asParsedURL();\n    if (parsedURL) {\n        var path = href;\n        if (path.charAt(0) !== \"/\") {\n            var basePath = parsedURL.path;\n            // A href of \"?foo=bar\" implies \"basePath?foo=bar\".\n            // With \"basePath?a=b\" and \"?foo=bar\" we should get \"basePath?foo=bar\".\n            var prefix;\n            if (path.charAt(0) === \"?\") {\n                var basePathCutIndex = basePath.indexOf(\"?\");\n                if (basePathCutIndex !== -1)\n                    prefix = basePath.substring(0, basePathCutIndex);\n                else\n                    prefix = basePath;\n            } else\n                prefix = basePath.substring(0, basePath.lastIndexOf(\"/\")) + \"/\";\n\n            path = prefix + path;\n        } else if (path.length > 1 && path.charAt(1) === \"/\") {\n            // href starts with \"//\" which is a full URL with the protocol dropped (use the baseURL protocol).\n            return parsedURL.scheme + \":\" + path;\n        }\n        return parsedURL.scheme + \"://\" + parsedURL.host + (parsedURL.port ? (\":\" + parsedURL.port) : \"\") + path;\n    }\n    return null;\n}\n\nWebInspector.addMainEventListeners = function(doc)\n{\n    doc.defaultView.addEventListener(\"focus\", this.windowFocused.bind(this), false);\n    doc.defaultView.addEventListener(\"blur\", this.windowBlurred.bind(this), false);\n    doc.addEventListener(\"click\", this.documentClick.bind(this), true);\n}\n\nWebInspector._searchFieldManualFocus = function(event)\n{\n    this.currentFocusElement = event.target;\n    this._previousFocusElement = event.target;\n}\n\nWebInspector._searchKeyDown = function(event)\n{\n    // Escape Key will clear the field and clear the search results\n    if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) {\n        // If focus belongs here and text is empty - nothing to do, return unhandled.\n        if (event.target.value === \"\" && this.currentFocusElement === this.previousFocusElement)\n            return;\n        event.preventDefault();\n        event.stopPropagation();\n        // When search was selected manually and is currently blank, we'd like Esc stay unhandled\n        // and hit console drawer handler.\n        event.target.value = \"\";\n\n        this.performSearch(event);\n        this.currentFocusElement = this.previousFocusElement;\n        if (this.currentFocusElement === event.target)\n            this.currentFocusElement.select();\n        return false;\n    }\n\n    if (!isEnterKey(event))\n        return false;\n\n    // Select all of the text so the user can easily type an entirely new query.\n    event.target.select();\n\n    // Only call performSearch if the Enter key was pressed. Otherwise the search\n    // performance is poor because of searching on every key. The search field has\n    // the incremental attribute set, so we still get incremental searches.\n    this.performSearch(event);\n\n    // Call preventDefault since this was the Enter key. This prevents a \"search\" event\n    // from firing for key down. This stops performSearch from being called twice in a row.\n    event.preventDefault();\n}\n\nWebInspector.performSearch = function(event)\n{\n    var forceSearch = (event.keyIdentifier || event.key) === \"Enter\";\n    this.doPerformSearch(event.target.value, forceSearch, event.shiftKey, false);\n}\n\nWebInspector.cancelSearch = function()\n{\n    document.getElementById(\"search\").value = \"\";\n    this.doPerformSearch(\"\");\n}\n\nWebInspector.doPerformSearch = function(query, forceSearch, isBackwardSearch, repeatSearch)\n{\n    var isShortSearch = (query.length < 3);\n\n    // Clear a leftover short search flag due to a non-conflicting forced search.\n    if (isShortSearch && this.shortSearchWasForcedByKeyEvent && this.currentQuery !== query)\n        delete this.shortSearchWasForcedByKeyEvent;\n\n    // Indicate this was a forced search on a short query.\n    if (isShortSearch && forceSearch)\n        this.shortSearchWasForcedByKeyEvent = true;\n\n    if (!query || !query.length || (!forceSearch && isShortSearch)) {\n        // Prevent clobbering a short search forced by the user.\n        if (this.shortSearchWasForcedByKeyEvent) {\n            delete this.shortSearchWasForcedByKeyEvent;\n            return;\n        }\n\n        delete this.currentQuery;\n\n        for (var panelName in this.panels) {\n            var panel = this.panels[panelName];\n            var hadCurrentQuery = !!panel.currentQuery;\n            delete panel.currentQuery;\n            if (hadCurrentQuery && panel.searchCanceled)\n                panel.searchCanceled();\n        }\n\n        this.updateSearchMatchesCount();\n\n        return;\n    }\n\n    if (!repeatSearch && query === this.currentPanel.currentQuery && this.currentPanel.currentQuery === this.currentQuery) {\n        // When this is the same query and a forced search, jump to the next\n        // search result for a good user experience.\n        if (forceSearch) {\n            if (!isBackwardSearch && this.currentPanel.jumpToNextSearchResult)\n                this.currentPanel.jumpToNextSearchResult();\n            else if (isBackwardSearch && this.currentPanel.jumpToPreviousSearchResult)\n                this.currentPanel.jumpToPreviousSearchResult();\n        }\n        return;\n    }\n\n    this.currentQuery = query;\n\n    this.updateSearchMatchesCount();\n\n    if (!this.currentPanel.performSearch)\n        return;\n\n    this.currentPanel.currentQuery = query;\n    this.currentPanel.performSearch(query);\n}\n\nWebInspector.frontendReused = function()\n{\n    this.networkManager.reset();\n    this.reset();\n}\n\nWebInspector.addNodesToSearchResult = function(nodeIds)\n{\n    WebInspector.panels.elements.addNodesToSearchResult(nodeIds);\n}\n\nWebInspector.updateSearchMatchesCount = function(matches, panel)\n{\n    if (!panel)\n        panel = this.currentPanel;\n\n    panel.currentSearchMatches = matches;\n\n    if (panel !== this.currentPanel)\n        return;\n\n    if (!this.currentPanel.currentQuery) {\n        document.getElementById(\"search-results-matches\").addStyleClass(\"hidden\");\n        return;\n    }\n\n    if (matches) {\n        if (matches === 1)\n            var matchesString = WebInspector.UIString(\"1 match\");\n        else\n            var matchesString = WebInspector.UIString(\"%d matches\", matches);\n    } else\n        var matchesString = WebInspector.UIString(\"Not Found\");\n\n    var matchesToolbarElement = document.getElementById(\"search-results-matches\");\n    matchesToolbarElement.removeStyleClass(\"hidden\");\n    matchesToolbarElement.textContent = matchesString;\n}\n\nWebInspector.UIString = function(string)\n{\n    if (window.localizedStrings && string in window.localizedStrings)\n        string = window.localizedStrings[string];\n    else {\n        if (!(string in WebInspector.missingLocalizedStrings)) {\n            if (!WebInspector.InspectorBackendStub)\n                console.error(\"Localized string \\\"\" + string + \"\\\" not found.\");\n            WebInspector.missingLocalizedStrings[string] = true;\n        }\n\n        if (Preferences.showMissingLocalizedStrings)\n            string += \" (not localized)\";\n    }\n\n    return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));\n}\n\nWebInspector.formatLocalized = function(format, substitutions, formatters, initialValue, append)\n{\n    return String.format(WebInspector.UIString(format), substitutions, formatters, initialValue, append);\n}\n\nWebInspector.isMac = function()\n{\n    if (!(\"_isMac\" in this))\n        this._isMac = WebInspector.platform === \"mac\";\n\n    return this._isMac;\n}\n\nWebInspector.isBeingEdited = function(element)\n{\n    return element.__editing;\n}\n\nWebInspector.isEditingAnyField = function()\n{\n    return this.__editing;\n}\n\n// Available config fields (all optional):\n// context: Object - an arbitrary context object to be passed to the commit and cancel handlers\n// commitHandler: Function - handles editing \"commit\" outcome\n// cancelHandler: Function - handles editing \"cancel\" outcome\n// customFinishHandler: Function - custom finish handler for the editing session (invoked on keydown)\n// pasteHandler: Function - handles the \"paste\" event, return values are the same as those for customFinishHandler\n// multiline: Boolean - whether the edited element is multiline\nWebInspector.startEditing = function(element, config)\n{\n    if (element.__editing)\n        return;\n    element.__editing = true;\n    WebInspector.__editing = true;\n\n    config = config || {};\n    var committedCallback = config.commitHandler;\n    var cancelledCallback = config.cancelHandler;\n    var pasteCallback = config.pasteHandler;\n    var context = config.context;\n    var oldText = getContent(element);\n    var moveDirection = \"\";\n\n    element.addStyleClass(\"editing\");\n    element.setAttribute(\"contenteditable\", \"true\");\n\n    var oldTabIndex = element.tabIndex;\n    if (element.tabIndex < 0)\n        element.tabIndex = 0;\n\n    function blurEventListener() {\n        editingCommitted.call(element);\n    }\n\n    function getContent(element) {\n        if (element.tagName === \"INPUT\" && element.type === \"text\")\n            return element.value;\n        else\n            return element.textContent;\n    }\n\n    function cleanUpAfterEditing() {\n        delete this.__editing;\n        delete WebInspector.__editing;\n\n        this.removeStyleClass(\"editing\");\n        this.removeAttribute(\"contenteditable\");\n\n        this.tabIndex = oldTabIndex;\n        this.scrollTop = 0;\n        this.scrollLeft = 0;\n\n        element.removeEventListener(\"blur\", blurEventListener, false);\n        element.removeEventListener(\"keydown\", keyDownEventListener, true);\n        if (pasteCallback)\n            element.removeEventListener(\"paste\", pasteEventListener, true);\n\n        if (element === WebInspector.currentFocusElement || element.isAncestor(WebInspector.currentFocusElement))\n            WebInspector.currentFocusElement = WebInspector.previousFocusElement;\n    }\n\n    function editingCancelled() {\n        if (this.tagName === \"INPUT\" && this.type === \"text\")\n            this.value = oldText;\n        else\n            this.textContent = oldText;\n\n        cleanUpAfterEditing.call(this);\n\n        if (cancelledCallback)\n            cancelledCallback(this, context);\n    }\n\n    function editingCommitted() {\n        cleanUpAfterEditing.call(this);\n\n        if (committedCallback)\n            committedCallback(this, getContent(this), oldText, context, moveDirection);\n    }\n\n    function defaultFinishHandler(event)\n    {\n        var isMetaOrCtrl = WebInspector.isMac() ?\n            event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey :\n            event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey;\n        if (isEnterKey(event) && (!config.multiline || isMetaOrCtrl))\n            return \"commit\";\n        else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code)\n            return \"cancel\";\n        else if ((event.keyIdentifier || event.key) === \"U+0009\") // Tab key\n            return \"move-\" + (event.shiftKey ? \"backward\" : \"forward\");\n    }\n\n    function handleEditingResult(result, event)\n    {\n        if (result === \"commit\") {\n            editingCommitted.call(element);\n            event.preventDefault();\n            event.stopPropagation();\n        } else if (result === \"cancel\") {\n            editingCancelled.call(element);\n            event.preventDefault();\n            event.stopPropagation();\n        } else if (result && result.indexOf(\"move-\") === 0) {\n            moveDirection = result.substring(5);\n            if ((event.keyIdentifier || event.key) !== \"U+0009\")\n                blurEventListener();\n        }\n    }\n\n    function pasteEventListener(event)\n    {\n        var result = pasteCallback(event);\n        handleEditingResult(result, event);\n    }\n\n    function keyDownEventListener(event)\n    {\n        var handler = config.customFinishHandler || defaultFinishHandler;\n        var result = handler(event);\n        handleEditingResult(result, event);\n    }\n\n    element.addEventListener(\"blur\", blurEventListener, false);\n    element.addEventListener(\"keydown\", keyDownEventListener, true);\n    if (pasteCallback)\n        element.addEventListener(\"paste\", pasteEventListener, true);\n\n    WebInspector.currentFocusElement = element;\n    return {\n        cancel: editingCancelled.bind(element),\n        commit: editingCommitted.bind(element)\n    };\n}\n\nWebInspector._toolbarItemClicked = function(event)\n{\n    var toolbarItem = event.currentTarget;\n    this.currentPanel = toolbarItem.panel;\n}\n\n// This table maps MIME types to the Resource.Types which are valid for them.\n// The following line:\n//    \"text/html\":                {0: 1},\n// means that text/html is a valid MIME type for resources that have type\n// WebInspector.Resource.Type.Document (which has a value of 0).\nWebInspector.MIMETypes = {\n    \"text/html\":                   {0: true},\n    \"text/xml\":                    {0: true},\n    \"text/plain\":                  {0: true},\n    \"application/xhtml+xml\":       {0: true},\n    \"text/css\":                    {1: true},\n    \"text/xsl\":                    {1: true},\n    \"image/jpeg\":                  {2: true},\n    \"image/png\":                   {2: true},\n    \"image/gif\":                   {2: true},\n    \"image/bmp\":                   {2: true},\n    \"image/vnd.microsoft.icon\":    {2: true},\n    \"image/x-icon\":                {2: true},\n    \"image/x-xbitmap\":             {2: true},\n    \"font/ttf\":                    {3: true},\n    \"font/opentype\":               {3: true},\n    \"application/x-font-type1\":    {3: true},\n    \"application/x-font-ttf\":      {3: true},\n    \"application/x-font-woff\":     {3: true},\n    \"application/x-truetype-font\": {3: true},\n    \"text/javascript\":             {4: true},\n    \"text/ecmascript\":             {4: true},\n    \"application/javascript\":      {4: true},\n    \"application/ecmascript\":      {4: true},\n    \"application/x-javascript\":    {4: true},\n    \"text/javascript1.1\":          {4: true},\n    \"text/javascript1.2\":          {4: true},\n    \"text/javascript1.3\":          {4: true},\n    \"text/jscript\":                {4: true},\n    \"text/livescript\":             {4: true},\n}\n\nWebInspector.PanelHistory = function()\n{\n    this._history = [];\n    this._historyIterator = -1;\n}\n\nWebInspector.PanelHistory.prototype = {\n    canGoBack: function()\n    {\n        return this._historyIterator > 0;\n    },\n\n    goBack: function()\n    {\n        this._inHistory = true;\n        WebInspector.currentPanel = WebInspector.panels[this._history[--this._historyIterator]];\n        delete this._inHistory;\n    },\n\n    canGoForward: function()\n    {\n        return this._historyIterator < this._history.length - 1;\n    },\n\n    goForward: function()\n    {\n        this._inHistory = true;\n        WebInspector.currentPanel = WebInspector.panels[this._history[++this._historyIterator]];\n        delete this._inHistory;\n    },\n\n    setPanel: function(panelName)\n    {\n        if (this._inHistory)\n            return;\n\n        this._history.splice(this._historyIterator + 1, this._history.length - this._historyIterator - 1);\n        if (!this._history.length || this._history[this._history.length - 1] !== panelName)\n            this._history.push(panelName);\n        this._historyIterator = this._history.length - 1;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/inspectorSyntaxHighlight.css",
    "content": "/*\n * Copyright (C) 2009 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.webkit-css-comment { \n    color: rgb(0, 116, 0);\n}\n\n.webkit-css-url, .webkit-css-color, .webkit-css-string, .webkit-css-keyword {\n    color: rgb(7, 144, 154);\n }\n\n.webkit-css-number {\n    color: rgb(50, 0, 255);\n}\n\n.webkit-css-property, .webkit-css-at-rule {\n    color: rgb(200, 0, 0);\n}\n\n.webkit-css-selector {\n    color: black;\n}\n\n.webkit-css-important {\n    color: rgb(200, 0, 180);\n}\n\n.webkit-javascript-comment {\n    color: rgb(0, 116, 0);\n}\n\n.webkit-javascript-keyword {\n    color: rgb(170, 13, 145);\n}\n\n.webkit-javascript-number {\n    color: rgb(28, 0, 207);\n}\n\n.webkit-javascript-string, .webkit-javascript-regexp {\n    color: rgb(196, 26, 22);\n}\n\n.webkit-javascript-ident {\n    color: black;\n}\n\n.webkit-html-comment {\n    /* Keep this in sync with view-source.css (.webkit-html-comment) */\n    color: rgb(35, 110, 37);\n}\n\n.webkit-html-tag {\n    /* Keep this in sync with view-source.css (.webkit-html-tag) */\n    color: rgb(136, 18, 128);\n}\n\n.webkit-html-doctype {\n    /* Keep this in sync with view-source.css (.webkit-html-doctype) */\n    color: rgb(192, 192, 192);\n}\n\n.webkit-html-attribute-name {\n    /* Keep this in sync with view-source.css (.webkit-html-attribute-name) */\n    color: rgb(153, 69, 0);\n}\n\n.webkit-html-attribute-value {\n    /* Keep this in sync with view-source.css (.webkit-html-attribute-value) */\n    color: rgb(26, 26, 166);\n}\n\n.webkit-html-external-link, .webkit-html-resource-link {\n    /* Keep this in sync with view-source.css (.webkit-html-external-link, .webkit-html-resource-link) */\n    color: #00e;\n}\n\n.webkit-html-external-link {\n    /* Keep this in sync with view-source.css (.webkit-html-external-link) */\n    text-decoration: none;\n}\n\n.webkit-html-external-link:hover {\n    /* Keep this in sync with view-source.css (.webkit-html-external-link:hover) */\n    text-decoration: underline;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/networkPanel.css",
    "content": ".network-larger-resources-status-bar-item .glyph {\n    -webkit-mask-image: url(Images/largerResourcesButtonGlyph.png);\n}\n\n.network-sidebar .data-grid {\n    border: none;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    font-size: 11px;\n}\n\n.network-sidebar .data-grid table.data {\n    -webkit-background-size: 1px 82px;\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, 0.05)), to(rgba(0, 0, 0, 0.05)));\n    font-size: 11px;\n}\n\n.network-sidebar .data-grid.small table.data {\n    -webkit-background-size: 1px 42px;\n}\n\n.network-sidebar .data-grid td:not(.network-summary) {\n    line-height: 17px;\n    height: 37px;\n    border-right: 1px solid rgb(210, 210, 210);\n    vertical-align: middle;\n}\n\n.network-sidebar .data-grid.small td {\n    height: 17px;\n}\n\n.network-sidebar .data-grid th {\n    border-bottom: 1px solid rgb(64%, 64%, 64%);\n    height: 30px;\n    font-size: 11px;\n    font-weight: bold;\n}\n\n.network-sidebar .data-grid.small th {\n    height: 22px;\n}\n\n.network-sidebar .data-grid th, .network.panel .data-grid th.sort-descending, .network.panel .data-grid th.sort-ascending {\n    background: -webkit-gradient(linear, left top, left bottom, from(rgb(236, 236, 236)), to(rgb(217, 217, 217)));\n}\n\n.network-sidebar .data-grid .data-container {\n    top: 31px;\n}\n\n.network-sidebar .data-grid.small .data-container {\n    top: 23px;\n}\n\n.network-sidebar .data-grid select {\n    -webkit-appearance: none;\n    background-color: transparent;\n    border: none;\n    width: 100%;\n    font-size: 11px;\n    font-weight: bold;\n}\n\n.network-sidebar .data-grid.small tr.offscreen {\n    height: 21px;\n}\n\n.network-sidebar .data-grid tr.offscreen {\n    height: 41px;\n}\n\n.network-sidebar .data-grid tr.offscreen td {\n    display: none;\n}\n\n.network-sidebar .data-grid tr.filler {\n    background-color: white;\n}\n\n.network-sidebar .data-grid td.name-column {\n    font-weight: bold;\n    cursor: pointer;\n}\n\n.network.panel:not(.viewing-resource) .network-sidebar td.name-column:hover {\n    text-decoration: underline;\n}\n\n.network-sidebar .data-grid td.method-column,\n.network-sidebar .data-grid td.status-column,\n.network-sidebar .data-grid td.type-column,\n.network-sidebar .data-grid td.size-column,\n.network-sidebar .data-grid td.time-column {\n    background-color: rgba(0, 0, 0, 0.07);\n}\n\n.network-sidebar .data-grid td.size-column,\n.network-sidebar .data-grid td.time-column {\n    text-align: right;\n}\n\n.network-sidebar .small .network-graph-side {\n    height: 14px;\n}\n\n.network-sidebar .data-grid th.sortable:active {\n    background-image: none;\n}\n\n.network-cell-subtitle {\n    font-weight: normal;\n    color: gray;\n}\n\n.network-sidebar tr.selected .network-cell-subtitle {\n    color: white;\n}\n\n.network-header-subtitle {\n    color: gray;\n}\n\n.network-sidebar .data-grid.small .network-cell-subtitle,\n.network-sidebar .data-grid.small .network-header-subtitle\n{\n    display: none;\n}\n\n/* Resource preview icons */\n\n.network-sidebar .data-grid .icon {\n    content: url(Images/resourcePlainIcon.png);\n}\n\n.network-sidebar .data-grid.small .icon {\n    content: url(Images/resourcePlainIconSmall.png);\n}\n\n.network-sidebar .network-category-scripts .icon {\n    content: url(Images/resourceJSIcon.png);\n}\n\n.network-sidebar .data-grid.small .network-category-scripts .icon {\n    content: url(Images/resourceDocumentIconSmall.png);\n}\n\n.network-sidebar .network-category-documents .icon {\n    content: url(Images/resourceDocumentIcon.png);\n}\n\n.network-sidebar .data-grid.small .network-category-documents .icon {\n    content: url(Images/resourceDocumentIconSmall.png);\n}\n\n.network-sidebar .network-category-stylesheets .icon {\n    content: url(Images/resourceCSSIcon.png);\n}\n\n.network-sidebar .data-grid.small .network-category-stylesheets .icon {\n    content: url(Images/resourceDocumentIconSmall.png);\n}\n\n.network-sidebar .network-category-images .icon {\n    position: relative;\n    background-image: url(Images/resourcePlainIcon.png);\n    background-repeat: no-repeat;\n    content: \"\";\n}\n\n.network-sidebar .data-grid.small .network-category-images .icon {\n    background-image: url(Images/resourcePlainIconSmall.png);\n    content: \"\";\n}\n\n.network-sidebar .data-grid .icon {\n    float: left;\n    width: 32px;\n    height: 32px;\n    margin-top: 1px;\n    margin-right: 3px;\n}\n\n.network-sidebar .data-grid.small .icon {\n    width: 16px;\n    height: 16px;\n}\n\n.network-sidebar .image-network-icon-preview {\n    position: absolute;\n    margin: auto;\n    top: 3px;\n    bottom: 4px;\n    left: 5px;\n    right: 5px;\n    max-width: 18px;\n    max-height: 21px;\n    min-width: 1px;\n    min-height: 1px;\n}\n\n.network-sidebar .data-grid.small .image-network-icon-preview {\n    top: 2px;\n    bottom: 1px;\n    left: 3px;\n    right: 3px;\n    max-width: 8px;\n    max-height: 11px;\n}\n\n/* Graph styles */\n\n.network-graph-side {\n    position: relative;\n    height: 36px;\n    padding: 0 5px;\n    white-space: nowrap;\n    margin-top: 1px;\n    border-top: 1px solid transparent;\n    overflow: hidden;\n}\n\n.network-graph-bar-area {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    right: 8px;\n    left: 9px;\n}\n\n.network-graph-label {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    margin: auto -7px;\n    height: 13px;\n    line-height: 13px;\n    font-size: 9px;\n    color: rgba(0, 0, 0, 0.75);\n    text-shadow: rgba(255, 255, 255, 0.25) 1px 0 0, rgba(255, 255, 255, 0.25) -1px 0 0, rgba(255, 255, 255, 0.333) 0 1px 0, rgba(255, 255, 255, 0.25) 0 -1px 0;\n    z-index: 150;\n    overflow: hidden;\n    text-align: center;\n    font-weight: bold;\n    opacity: 0;\n    -webkit-transition: opacity 250ms ease-in-out;\n}\n\n.network-graph-side:hover .network-graph-label {\n    opacity: 1;\n}\n\n.network-graph-label:empty {\n    display: none;\n}\n\n.network-graph-label.waiting {\n    margin-right: 5px;\n}\n\n.network-graph-label.waiting-right {\n    margin-left: 5px;\n}\n\n.network-graph-label.before {\n    color: rgba(0, 0, 0, 0.7);\n    text-shadow: none;\n    text-align: right;\n    margin-right: 2px;\n}\n\n.network-graph-label.before::after {\n    padding-left: 2px;\n    height: 6px;\n    content: url(Images/graphLabelCalloutLeft.png);\n}\n\n.network-graph-label.after {\n    color: rgba(0, 0, 0, 0.7);\n    text-shadow: none;\n    text-align: left;\n    margin-left: 2px;\n}\n\n.network-graph-label.after::before {\n    padding-right: 2px;\n    height: 6px;\n    content: url(Images/graphLabelCalloutRight.png);\n}\n\n.network-graph-bar {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    margin: auto -7px;\n    border-width: 6px 7px;\n    height: 13px;\n    min-width: 14px;\n    opacity: 0.65;\n    -webkit-border-image: url(Images/timelinePillGray.png) 6 7 6 7;\n}\n\n.network-graph-bar.waiting, .network-graph-bar.waiting-right {\n    opacity: 0.35;\n}\n\n/* Resource categories */\n\n\n.resource-cached .network-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;\n}\n\n.network-category-documents .network-graph-bar {\n    -webkit-border-image: url(Images/timelinePillBlue.png) 6 7 6 7;\n}\n\n.network-category-documents.resource-cached .network-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillBlue.png) 6 7 6 7;\n}\n\n.network-category-stylesheets .network-graph-bar {\n    -webkit-border-image: url(Images/timelinePillGreen.png) 6 7 6 7;\n}\n\n.network-category-stylesheets.resource-cached .network-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillGreen.png) 6 7 6 7;\n}\n\n.network-category-images .network-graph-bar {\n    -webkit-border-image: url(Images/timelinePillPurple.png) 6 7 6 7;\n}\n\n.network-category-images.resource-cached .network-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillPurple.png) 6 7 6 7;\n}\n\n.network-category-fonts .network-graph-bar {\n    -webkit-border-image: url(Images/timelinePillRed.png) 6 7 6 7;\n}\n\n.network-category-fonts.resource-cached .network-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillRed.png) 6 7 6 7;\n}\n\n.network-category-scripts .network-graph-bar {\n    -webkit-border-image: url(Images/timelinePillOrange.png) 6 7 6 7;\n}\n\n.network-category-scripts.resource-cached .network-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillOrange.png) 6 7 6 7;\n}\n\n.network-category-xhr .network-graph-bar {\n    -webkit-border-image: url(Images/timelinePillYellow.png) 6 7 6 7;\n}\n\n.network-category-xhr.resource-cached .network-graph-bar {\n    -webkit-border-image: url(Images/timelineHollowPillYellow.png) 6 7 6 7;\n}\n\n.network-category-websockets .network-graph-bar {\n    -webkit-border-image: url(Images/timelinePillGray.png) 6 7 6 7;\n}\n\n.network-category-websockets.resource-cached .network-graph-bar {\n   -webkit-border-image: url(Images/timelineHollowPillGray.png) 6 7 6 7;\n}\n\n\n/* Popover */\n\n.network-timing-row {\n    position: relative;\n    height: 16px;\n}\n\n.network-timing-bar {\n    position: absolute;\n    background-color: red;\n    border-left: 1px solid red;\n    opacity: 0.4;\n    top: 0;\n    bottom: 0;\n}\n\n.network-timing-bar-title {\n    position: absolute;\n    color: black;\n    top: 1px;\n}\n\n.network-dim-cell {\n    color: grey;\n}\n\n/* Dividers */\n\n.network-timeline-grid {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    pointer-events: none;\n}\n\n.network-event-divider-padding {\n    position: absolute;\n    width: 8px;\n    top: 0;\n    bottom: 0;\n    pointer-events: auto;\n}\n\n.network-event-divider {\n    position: absolute;\n    width: 2px;\n    top: 31px;\n    bottom: 0;\n    z-index: 300;\n}\n\n.network-sidebar .network-timeline-grid.small .network-event-divider {\n    top: 23px;\n}\n\n.network-red-divider {\n    background-color: rgba(255, 0, 0, 0.5);\n}\n\n.network-blue-divider {\n    background-color: rgba(0, 0, 255, 0.5);\n}\n\n.network-sidebar .resources-dividers {\n    z-index: 0;\n}\n\n.network-sidebar .resources-dividers-label-bar {\n    background-color: transparent;\n    border: none;\n    height: 30px;\n    pointer-events: none;\n}\n\n.network-sidebar .network-timeline-grid.small .resources-dividers-label-bar {\n    height: 23px;\n}\n\n.network-sidebar .resources-divider-label {\n    top: 0px;\n    margin-top: -4px;\n    color: black;\n}\n\n.network-sidebar .resources-dividers-label-bar .resources-divider {\n    top: 23px;\n}\n\n.network-sidebar .network-timeline-grid.small .resources-dividers-label-bar .resources-divider {\n    top: 15px;\n}\n\n.network-sidebar .resources-divider.first .resources-divider-label {\n    display: none;\n}\n\n.network-sidebar .resources-dividers-label-bar .resources-divider.first {\n    background-color: transparent;\n}\n\n/* Filters */\n#network-filter {\n    margin-top: 1px;\n}\n\n.data-grid table.data tr.revealed.network-item {\n    display: none;\n}\n\n.data-grid.filter-all table.data tr.revealed.network-item,\n.data-grid.filter-documents table.data tr.revealed.network-category-documents,\n.data-grid.filter-stylesheets table.data tr.revealed.network-category-stylesheets,\n.data-grid.filter-images table.data tr.revealed.network-category-images,\n.data-grid.filter-scripts table.data tr.revealed.network-category-scripts,\n.data-grid.filter-xhr table.data tr.revealed.network-category-xhr,\n.data-grid.filter-fonts table.data tr.revealed.network-category-fonts,\n.data-grid.filter-websockets table.data tr.revealed.network-category-websockets,\n.data-grid.filter-other table.data tr.revealed.network-category-other {\n    display: table-row;\n}\n\n/* Summary */\n\n.network-summary-bar {\n    background-color: rgb(101, 111, 130);\n    color: white;\n    height: 20px;\n    font-size: 11px;\n    font-weight: bold;\n    padding-top: 3px;\n    padding-left: 10px;\n    z-index: 2000;\n    white-space: pre;\n    overflow : hidden;\n    text-overflow : ellipsis;\n}\n\n.network-summary-bar-bottom {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    padding-top: 3px;\n}\n\n.data-grid td .network-summary-bar {\n    white-space: pre;\n}\n\n.network-sidebar .data-grid td.network-summary {\n    padding: 0;\n}\n\n/* Viewer */\n\n.network.panel.viewing-resource .network-sidebar .data-grid td,\n.network.panel.viewing-resource .network-sidebar .data-grid th {\n    border-right: none;\n}\n\n.network.panel.viewing-resource .data-grid th.corner {\n    display: none;\n}\n\n#network-container {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    border-right: 0 none transparent;\n    overflow-y: auto;\n    overflow-x: hidden;\n}\n\n.network.panel.viewing-resource #network-container {\n    border-right: 1px solid rgb(163, 163, 163);\n}\n\n#network-views {\n    position: absolute;\n    background: rgb(203, 203, 203);\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n}\n\n#network-close-button {\n    position: absolute;\n    width: 14px;\n    height: 14px;\n    background-image: url(Images/closeButtons.png);\n    background-position: 0 0;\n    background-color: transparent;\n    border: 0 none transparent;\n    top: 8px;\n    left: 5px;\n    z-index: 10;\n    display: none;\n}\n\n#network-views.small #network-close-button  {\n    top: 4px;\n}\n\n#network-close-button:hover {\n    background-position: 14px 0;\n}\n\n#network-close-button:active {\n    background-position: 28px 0;\n}\n\n.network.panel.viewing-resource #network-close-button  {\n    display: block;\n}\n\n\n.network-sidebar .data-grid.full-grid-mode .viewer-column {\n    display: none;\n}\n\n.network-sidebar .data-grid.brief-grid-mode .viewer-column,\n.network-sidebar .data-grid.brief-grid-mode .method-column,\n.network-sidebar .data-grid.brief-grid-mode .status-column,\n.network-sidebar .data-grid.brief-grid-mode .type-column,\n.network-sidebar .data-grid.brief-grid-mode .size-column,\n.network-sidebar .data-grid.brief-grid-mode .time-column {\n    display: none;\n}\n\n.network.panel.viewing-resource .network-timeline-grid {\n    display: none;\n}\n\n.network-sidebar .data-grid.viewing-resource-mode .method-column,\n.network-sidebar .data-grid.viewing-resource-mode .status-column,\n.network-sidebar .data-grid.viewing-resource-mode .type-column,\n.network-sidebar .data-grid.viewing-resource-mode .size-column,\n.network-sidebar .data-grid.viewing-resource-mode .time-column,\n.network-sidebar .data-grid.viewing-resource-mode .timeline-column {\n    display: none;\n}\n\n.network.panel .network-sidebar {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    right: 0;\n}\n\n.network.panel:not(.viewing-resource) .sidebar-resizer-vertical {\n    display: none;\n}\n\n.network.panel.viewing-resource .network-sidebar .data-grid-resizer {\n    display: none;\n}\n\n.network.panel .scope-bar {\n    height: 23px;\n    padding-top: 5px;\n}\n\n.network.panel:not(.viewing-resource) .data-grid tr.selected {\n    background-color: transparent;\n    color: black;\n}\n\n#network-views .network-item-view .tabbed-pane-header {\n    height: 31px;\n    padding-top: 8px;\n    padding-left: 25px;\n    white-space: nowrap;\n}\n\n#network-views.small .network-item-view .tabbed-pane-header {\n    height: 23px;\n    padding-top: 0;\n}\n\n.network.panel.viewing-resource .data-grid .data-container {\n    padding-right: 0;\n}\n\n.network-item-view {\n    display: none;\n    position: absolute;\n    background: white;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n}\n\n.network-item-view.visible {\n    display: -webkit-box;\n}\n\n.network-item-view .tabbed-pane-header {\n    height: 20px;\n    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(236, 236, 236)), to(rgb(217, 217, 217)));\n    border-bottom: 1px solid rgb(163, 163, 163);\n}\n\n.network-item-view .scope-bar li {\n    border-bottom-left-radius: 0;\n    border-bottom-right-radius: 0;\n}\n\n.resource-headers-view {\n    display: none;\n    padding: 6px;\n    -webkit-user-select: text;    \n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    overflow: auto;\n}\n\n.resource-headers-view.visible {\n    display: block;\n}\n\n.resource-headers-view .outline-disclosure .parent {\n    -webkit-user-select: none;\n    font-weight: bold;\n}\n\n.resource-headers-view .outline-disclosure .children li {\n    white-space: nowrap;\n}\n\n.resource-headers-view .outline-disclosure li.expanded .header-count {\n    display: none;\n}\n\n.resource-headers-view .outline-disclosure .header-name {\n    color: rgb(33%, 33%, 33%);\n    display: inline-block;\n    margin-right: 0.5em;\n    font-weight: bold;\n    vertical-align: top;\n    white-space: pre-wrap;\n}\n\n.resource-headers-view .outline-disclosure .header-value {\n    display: inline;\n    margin-right: 100px;\n    white-space: pre-wrap;\n    word-break: break-all;\n    margin-top: 1px;\n}\n\n.resource-headers-view .outline-disclosure .raw-form-data {\n    white-space: pre-wrap;\n}\n\n.resource-cookies-view {\n    display: none;\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 0;\n    bottom: 0;\n    overflow: auto;\n    padding: 12px;\n    height: 100%;\n}\n\n.resource-cookies-view.visible {\n    display: block;\n}\n\n.resource-cookies-view .data-grid {\n    height: 100%;\n}\n\n.resource-cookies-view .data-grid .row-group {\n    font-weight: bold;\n    font-size: 11px;\n}\n\n.resource-timing-view {\n    display: none;\n    position: absolute;\n    top: 0;\n    right: 0;\n    left: 0;\n    bottom: 0;\n    padding: 6px;\n    font-weight: bold;\n    font-size: 11px;\n    color: rgb(30%, 30%, 30%);\n}\n\n.resource-timing-view table {\n    border-spacing: 21px 0;\n}\n\n.resource-timing-view .network-timing-bar {\n    opacity: 1;\n}\n\n.resource-timing-view .network-timing-bar.proxy {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(239, 228, 176)), to(rgb(139, 128, 76)));\n    border-left: 1px solid rgb(139, 128, 76);\n}\n\n.resource-timing-view .network-timing-bar.dns {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(153, 208, 216)), to(rgb(81, 174, 189)));\n    border-left: 1px solid rgb(81, 174, 189);\n}\n\n.resource-timing-view .network-timing-bar.connecting {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(203, 232, 145)), to(rgb(160, 214, 56)));\n    border-left: 1px solid rgb(160, 214, 56);\n}\n\n.resource-timing-view .network-timing-bar.ssl {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(21, 232, 145)), to(rgb(216, 149, 132)));\n    border-left: 1px solid rgb(216, 149, 132);\n}\n\n.resource-timing-view .network-timing-bar.sending {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(232, 192, 182)), to(rgb(216, 147, 130)));\n    border-left: 1px solid rgb(216, 147, 130);\n}\n\n.resource-timing-view .network-timing-bar.waiting {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(188, 179, 208)), to(rgb(141, 125, 175)));\n    border-left: 1px solid rgb(141, 125, 175);\n}\n\n.resource-timing-view .network-timing-bar.receiving {\n    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(214, 214, 214)), to(rgb(182, 182, 182)));\n    border-left: 1px solid rgb(182, 182, 182);\n}\n\n.resource-timing-view.visible {\n    display: block;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/popover.css",
    "content": ".popover {\n    position: absolute;\n    -webkit-border-image: url(Images/popoverBackground.png) 25 25 25 25;\n    border-width: 25px;\n    z-index: 100;\n    pointer-events: none;\n}\n\n.popover .content {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    pointer-events: auto;\n    overflow: auto;\n}\n\n.popover .arrow {\n    position: absolute;\n    background-image: url(Images/popoverArrows.png);\n    width: 19px;\n    height: 19px;\n    margin-left: 15px;\n    margin-top: -25px;\n    top: 0;\n    left: 0;\n}\n\n.popover.top-left-arrow .arrow {\n    /* The default is top-left, no styles needed. */\n}\n\n.popover.top-right-arrow .arrow {\n    right: 25px;\n    left: auto;\n}\n\n.popover.bottom-left-arrow .arrow {\n    top: auto;\n    bottom: 0;\n    margin-top: 0;\n    margin-bottom: -25px;\n    background-position: 0 -19px;\n}\n\n.popover.bottom-right-arrow .arrow {\n    right: 15px;\n    left: auto;\n    top: auto;\n    bottom: 0;\n    margin-top: 0;\n    margin-bottom: -25px;\n    background-position: 0 -19px;\n}\n\n.popover.left-top-arrow .arrow {\n    top: 0;\n    margin-top: 15px;\n    margin-left: -25px;\n    background-position: 0 -38px;\n}\n\n.popover.left-bottom-arrow .arrow {\n    top: auto;\n    bottom: 0;\n    margin-bottom: 15px;\n    margin-left: -25px;\n    background-position: 0 -38px;\n}\n\n.popover.right-top-arrow .arrow {\n    right: 0;\n    left: auto;\n    top: 0;\n    margin-top: 15px;\n    margin-right: -25px;\n    background-position: 0 -57px;\n}\n\n.popover.right-bottom-arrow .arrow {\n    right: 0;\n    left: auto;\n    top: auto;\n    bottom: 0;\n    margin-bottom: 15px;\n    margin-right: -25px;\n    background-position: 0 -57px;\n}\n\n.popover ::-webkit-scrollbar {\n    width: 11px;\n    height: 11px;\n}\n\n.popover ::-webkit-scrollbar-corner {\n    display: none;\n}\n\n.popover ::-webkit-resizer {\n    display: none;\n}\n\n/* Horizontal Scrollbar Styles */\n\n.popover ::-webkit-scrollbar:horizontal:corner-present {\n    border-right-width: 0;\n}\n\n.popover ::-webkit-scrollbar-thumb:horizontal {\n    -webkit-border-image: url(Images/thumbHoriz.png) 0 11 0 11;\n    border-color: transparent;\n    border-width: 0 11px;\n    min-width: 20px;\n}\n\n.popover ::-webkit-scrollbar-thumb:horizontal:hover {\n    -webkit-border-image: url(Images/thumbHoverHoriz.png) 0 11 0 11;\n}\n\n.popover ::-webkit-scrollbar-thumb:horizontal:active {\n    -webkit-border-image: url(Images/thumbActiveHoriz.png) 0 11 0 11;\n}\n\n.popover ::-webkit-scrollbar-track-piece:horizontal:start {\n    margin-left: 5px;\n}\n\n.popover ::-webkit-scrollbar-track-piece:horizontal:end {\n    margin-right: 5px;\n}\n\n.popover ::-webkit-scrollbar-track-piece:horizontal:end:corner-present {\n    margin-right: 4px;\n}\n\n.popover ::-webkit-scrollbar-track-piece:horizontal:decrement {\n    -webkit-border-image: url(Images/trackHoriz.png) 0 11 0 11;\n    border-color: transparent;\n    border-width: 0 0 0 11px;\n}\n\n.popover ::-webkit-scrollbar-track-piece:horizontal:increment {\n    -webkit-border-image: url(Images/trackHoriz.png) 0 11 0 11;\n    border-color: transparent;\n    border-width: 0 11px 0 0;\n}\n\n/* Vertical Scrollbar Styles */\n\n\n.popover ::-webkit-scrollbar:vertical:corner-present {\n    border-bottom-width: 0;\n}\n\n.popover ::-webkit-scrollbar-thumb:vertical {\n    -webkit-border-image: url(Images/thumbVert.png) 11 0 11 0;\n    border-color: transparent;\n    border-width: 11px 0;\n    min-height: 20px;\n}\n\n.popover ::-webkit-scrollbar-thumb:vertical:hover {\n    -webkit-border-image: url(Images/thumbHoverVert.png) 11 0 11 0;\n}\n\n.popover ::-webkit-scrollbar-thumb:vertical:active {\n    -webkit-border-image: url(Images/thumbActiveVert.png) 11 0 11 0;\n}\n\n\n.popover ::-webkit-scrollbar-track-piece:vertical:start {\n    margin-top: 5px;\n}\n\n.popover ::-webkit-scrollbar-track-piece:vertical:end {\n    margin-bottom: 5px;\n}\n\n.popover ::-webkit-scrollbar-track-piece:vertical:end:corner-present {\n    margin-bottom: 4px;\n}\n\n.popover ::-webkit-scrollbar-track-piece:vertical:decrement {\n    -webkit-border-image: url(Images/trackVert.png) 11 0 11 0;\n    border-color: transparent;\n    border-width: 11px 0 0 0;\n}\n\n.popover ::-webkit-scrollbar-track-piece:vertical:increment {\n    -webkit-border-image: url(Images/trackVert.png) 11 0 11 0;\n    border-color: transparent;\n    border-width: 0 0 11px 0;\n}\n\n/* Forced Scrollbar Mode Styles */\n\n.popover ::-webkit-scrollbar-button {\n    display: none;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/textViewer.css",
    "content": ".text-editor {\n    position: absolute;\n    top:0;\n    left:0;\n    right:0;\n    bottom:0;\n    white-space: pre;\n    overflow: auto;\n}\n\n.text-editor-lines {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    overflow: hidden;\n    -webkit-user-select: none;\n}\n\n.text-editor-contents {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    overflow: auto;\n    -webkit-user-select: text;\n}\n\n.text-editor-editable {\n    -webkit-user-modify: read-write-plaintext-only;\n}\n\n.webkit-line-decorations {\n    pointer-events: none;\n    -webkit-user-select: none;\n    -webkit-user-modify: read-only;\n}\n\n.webkit-html-message-bubble {\n    -webkit-box-shadow: black 0px 2px 5px;\n    -webkit-border-radius: 9px;\n    -webkit-border-fit: lines;\n    font-size: 10px;\n    font-family: Lucida Grande, sans-serif;\n    font-weight: bold;\n    margin: 6px 25px;\n    padding: 0 7px 1px;\n    z-index:20;\n}\n\n.webkit-html-warning-message {\n    background-color: rgb(100%, 62%, 42%);\n    border: 2px solid rgb(100%, 52%, 21%);\n}\n\n.webkit-html-error-message {\n    background-color: rgb(100%, 42%, 42%);\n    border: 2px solid rgb(100%, 31%, 31%);\n}\n\n.webkit-html-message-line {\n    padding-left: 23px;\n    text-indent: -20px;\n}\n\n.webkit-html-message-line-hover {\n    padding-left: 23px;\n    text-indent: -20px;\n    white-space: auto;\n    text-overflow: auto;\n    overflow: auto;\n}\n\n.webkit-html-message-icon {\n    position: relative;\n    top: 2px;\n    margin: 0 4px;\n}\n\n.webkit-line-number {\n    color: rgb(128, 128, 128);\n    background-color: rgb(240, 240, 240);\n    border-right: 1px solid rgb(187, 187, 187);\n    text-align: right;\n    vertical-align: top;\n    word-break: normal;\n    padding-right: 4px;\n    padding-left: 6px;\n}\n\n.webkit-line-number-outer {\n    margin-right: -4px;\n    margin-left: -4px;\n    border-color: transparent;\n    border-style: solid;\n    border-width: 0 0 0px 2px;\n    vertical-align: top;\n}\n\n.webkit-line-number-inner {\n    margin-right: 4px;\n}\n\n.webkit-breakpoint .webkit-line-number-inner, .webkit-breakpoint-conditional .webkit-line-number-inner, .webkit-execution-line .webkit-line-number-inner {\n    margin-right: -10px;\n}\n\n.webkit-line-content {\n    padding-left: 2px;\n}\n\n.webkit-breakpoint .webkit-line-number-outer {\n    color: white;\n    border-width: 0 14px 0px 2px;\n    -webkit-border-image: url(Images/breakpointBorder.png) 0 14 0 2;\n}\n\n.webkit-breakpoint-conditional .webkit-line-number-outer {\n    color: white;\n    border-width: 0 14px 0px 2px;\n    -webkit-border-image: url(Images/breakpointConditionalBorder.png) 0 14 0 2;\n}\n\n.webkit-execution-line .webkit-line-number-outer {\n    color: transparent;\n    border-width: 0 14px 0px 2px;\n    -webkit-border-image: url(Images/programCounterBorder.png) 0 14 0 2;\n}\n\n.webkit-breakpoint.webkit-execution-line .webkit-line-number-outer {\n    color: white;\n    -webkit-border-image: url(Images/breakpointCounterBorder.png) 0 14 0 2;\n}\n\n.webkit-breakpoint.webkit-execution-line .webkit-line-number-outer {\n    color: transparent;\n    -webkit-border-image: url(Images/breakpointCounterBorder.png) 0 14 0 2;\n}\n\n.webkit-breakpoint-conditional.webkit-execution-line .webkit-line-number-outer {\n    color: transparent;\n    -webkit-border-image: url(Images/breakpointConditionalCounterBorder.png) 0 14 0 2;\n}\n\n.webkit-breakpoint-disabled .webkit-line-number-outer {\n    opacity: 0.5;\n}\n\n.breakpoints-deactivated .webkit-breakpoint .webkit-line-number-outer {\n    opacity: 0.5;\n}\n\n.breakpoints-deactivated .webkit-breakpoint-disabled .webkit-line-number-outer {\n    opacity: 0.3;\n}\n\n.webkit-execution-line.webkit-line-content {\n    background-color: rgb(171, 191, 254);\n    outline: 1px solid rgb(64, 115, 244);\n}\n\n.diff-container .webkit-added-line.webkit-line-content {\n    background-color: rgb(220, 255, 220);\n}\n\n.diff-container .webkit-removed-line.webkit-line-content {\n    background-color: rgb(255, 220, 220);\n    text-decoration: line-through;\n}\n\n.diff-container .webkit-changed-line.webkit-line-content {\n    background-color: rgb(220, 220, 255);\n}\n\n.webkit-search-result {\n    -webkit-border-radius: 4px;\n    padding: 2px 2px 2px 3px;\n    margin: -2px -2px -2px -3px;\n    opacity: 0.8;\n    -webkit-box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;\n    background-color: rgb(241, 234, 0);\n    color: black;\n}\n\n.webkit-highlighted-line.webkit-line-content {\n    -webkit-animation: \"fadeout\" 2s 0s;\n}\n\n@-webkit-keyframes fadeout {\n    from {background-color: rgb(255, 255, 120); }\n    to { background-color: white; }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/treeoutline.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nfunction TreeOutline(listNode)\n{\n    this.children = [];\n    this.selectedTreeElement = null;\n    this._childrenListNode = listNode;\n    this._childrenListNode.removeChildren();\n    this._knownTreeElements = [];\n    this._treeElementsExpandedState = [];\n    this.expandTreeElementsWhenArrowing = false;\n    this.root = true;\n    this.hasChildren = false;\n    this.expanded = true;\n    this.selected = false;\n    this.treeOutline = this;\n\n    this._childrenListNode.tabIndex = 0;\n    this._childrenListNode.addEventListener(\"keydown\", this._treeKeyDown.bind(this), true);\n}\n\nTreeOutline._knownTreeElementNextIdentifier = 1;\n\nTreeOutline._appendChild = function(child)\n{\n    if (!child)\n        throw(\"child can't be undefined or null\");\n\n    var lastChild = this.children[this.children.length - 1];\n    if (lastChild) {\n        lastChild.nextSibling = child;\n        child.previousSibling = lastChild;\n    } else {\n        child.previousSibling = null;\n        child.nextSibling = null;\n    }\n\n    this.children.push(child);\n    this.hasChildren = true;\n    child.parent = this;\n    child.treeOutline = this.treeOutline;\n    child.treeOutline._rememberTreeElement(child);\n\n    var current = child.children[0];\n    while (current) {\n        current.treeOutline = this.treeOutline;\n        current.treeOutline._rememberTreeElement(current);\n        current = current.traverseNextTreeElement(false, child, true);\n    }\n\n    if (child.hasChildren && child.treeOutline._treeElementsExpandedState[child.identifier] !== undefined)\n        child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier];\n\n    if (!this._childrenListNode) {\n        this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement(\"ol\");\n        this._childrenListNode.parentTreeElement = this;\n        this._childrenListNode.addStyleClass(\"children\");\n        if (this.hidden)\n            this._childrenListNode.addStyleClass(\"hidden\");\n    }\n\n    child._attach();\n}\n\nTreeOutline._insertChild = function(child, index)\n{\n    if (!child)\n        throw(\"child can't be undefined or null\");\n\n    var previousChild = (index > 0 ? this.children[index - 1] : null);\n    if (previousChild) {\n        previousChild.nextSibling = child;\n        child.previousSibling = previousChild;\n    } else {\n        child.previousSibling = null;\n    }\n\n    var nextChild = this.children[index];\n    if (nextChild) {\n        nextChild.previousSibling = child;\n        child.nextSibling = nextChild;\n    } else {\n        child.nextSibling = null;\n    }\n\n    this.children.splice(index, 0, child);\n    this.hasChildren = true;\n    child.parent = this;\n    child.treeOutline = this.treeOutline;\n    child.treeOutline._rememberTreeElement(child);\n\n    var current = child.children[0];\n    while (current) {\n        current.treeOutline = this.treeOutline;\n        current.treeOutline._rememberTreeElement(current);\n        current = current.traverseNextTreeElement(false, child, true);\n    }\n\n    if (child.hasChildren && child.treeOutline._treeElementsExpandedState[child.identifier] !== undefined)\n        child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier];\n\n    if (!this._childrenListNode) {\n        this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement(\"ol\");\n        this._childrenListNode.parentTreeElement = this;\n        this._childrenListNode.addStyleClass(\"children\");\n        if (this.hidden)\n            this._childrenListNode.addStyleClass(\"hidden\");\n    }\n\n    child._attach();\n}\n\nTreeOutline._removeChildAtIndex = function(childIndex)\n{\n    if (childIndex < 0 || childIndex >= this.children.length)\n        throw(\"childIndex out of range\");\n\n    var child = this.children[childIndex];\n    this.children.splice(childIndex, 1);\n\n    var parent = child.parent;\n    if (child.deselect()) {\n        if (child.previousSibling)\n            child.previousSibling.select();\n        else if (child.nextSibling)\n            child.nextSibling.select();\n        else\n            parent.select();\n    }\n\n    if (child.previousSibling)\n        child.previousSibling.nextSibling = child.nextSibling;\n    if (child.nextSibling)\n        child.nextSibling.previousSibling = child.previousSibling;\n\n    if (child.treeOutline) {\n        child.treeOutline._forgetTreeElement(child);\n        child.treeOutline._forgetChildrenRecursive(child);\n    }\n\n    child._detach();\n    child.treeOutline = null;\n    child.parent = null;\n    child.nextSibling = null;\n    child.previousSibling = null;\n}\n\nTreeOutline._removeChild = function(child)\n{\n    if (!child)\n        throw(\"child can't be undefined or null\");\n\n    var childIndex = this.children.indexOf(child);\n    if (childIndex === -1)\n        throw(\"child not found in this node's children\");\n\n    TreeOutline._removeChildAtIndex.call(this, childIndex);\n}\n\nTreeOutline._removeChildren = function()\n{\n    for (var i = 0; i < this.children.length; ++i) {\n        var child = this.children[i];\n        child.deselect();\n\n        if (child.treeOutline) {\n            child.treeOutline._forgetTreeElement(child);\n            child.treeOutline._forgetChildrenRecursive(child);\n        }\n\n        child._detach();\n        child.treeOutline = null;\n        child.parent = null;\n        child.nextSibling = null;\n        child.previousSibling = null;\n    }\n\n    this.children = [];\n}\n\nTreeOutline._removeChildrenRecursive = function()\n{\n    var childrenToRemove = this.children;\n\n    var child = this.children[0];\n    while (child) {\n        if (child.children.length)\n            childrenToRemove = childrenToRemove.concat(child.children);\n        child = child.traverseNextTreeElement(false, this, true);\n    }\n\n    for (var i = 0; i < childrenToRemove.length; ++i) {\n        var child = childrenToRemove[i];\n        child.deselect();\n        if (child.treeOutline)\n            child.treeOutline._forgetTreeElement(child);\n        child._detach();\n        child.children = [];\n        child.treeOutline = null;\n        child.parent = null;\n        child.nextSibling = null;\n        child.previousSibling = null;\n    }\n\n    this.children = [];\n}\n\nTreeOutline.prototype._rememberTreeElement = function(element)\n{\n    if (!this._knownTreeElements[element.identifier])\n        this._knownTreeElements[element.identifier] = [];\n\n    // check if the element is already known\n    var elements = this._knownTreeElements[element.identifier];\n    if (elements.indexOf(element) !== -1)\n        return;\n\n    // add the element\n    elements.push(element);\n}\n\nTreeOutline.prototype._forgetTreeElement = function(element)\n{\n    if (this._knownTreeElements[element.identifier])\n        this._knownTreeElements[element.identifier].remove(element, true);\n}\n\nTreeOutline.prototype._forgetChildrenRecursive = function(parentElement)\n{\n    var child = parentElement.children[0];\n    while (child) {\n        this._forgetTreeElement(child);\n        child = child.traverseNextTreeElement(false, this, true);\n    }\n}\n\nTreeOutline.prototype.getCachedTreeElement = function(representedObject)\n{\n    if (!representedObject)\n        return null;\n\n    if (\"__treeElementIdentifier\" in representedObject) {\n        // If this representedObject has a tree element identifier, and it is a known TreeElement\n        // in our tree we can just return that tree element.\n        var elements = this._knownTreeElements[representedObject.__treeElementIdentifier];\n        if (elements) {\n            for (var i = 0; i < elements.length; ++i)\n                if (elements[i].representedObject === representedObject)\n                    return elements[i];\n        }\n    }\n    return null;\n}\n\nTreeOutline.prototype.findTreeElement = function(representedObject, isAncestor, getParent)\n{\n    if (!representedObject)\n        return null;\n\n    var cachedElement = this.getCachedTreeElement(representedObject);\n    if (cachedElement)\n        return cachedElement;\n\n    // The representedObject isn't known, so we start at the top of the tree and work down to find the first\n    // tree element that represents representedObject or one of its ancestors.\n    var item;\n    var found = false;\n    for (var i = 0; i < this.children.length; ++i) {\n        item = this.children[i];\n        if (item.representedObject === representedObject || isAncestor(item.representedObject, representedObject)) {\n            found = true;\n            break;\n        }\n    }\n\n    if (!found)\n        return null;\n\n    // Make sure the item that we found is connected to the root of the tree.\n    // Build up a list of representedObject's ancestors that aren't already in our tree.\n    var ancestors = [];\n    var currentObject = representedObject;\n    while (currentObject) {\n        ancestors.unshift(currentObject);\n        if (currentObject === item.representedObject)\n            break;\n        currentObject = getParent(currentObject);\n    }\n\n    // For each of those ancestors we populate them to fill in the tree.\n    for (var i = 0; i < ancestors.length; ++i) {\n        // Make sure we don't call findTreeElement with the same representedObject\n        // again, to prevent infinite recursion.\n        if (ancestors[i] === representedObject)\n            continue;\n        // FIXME: we could do something faster than findTreeElement since we will know the next\n        // ancestor exists in the tree.\n        item = this.findTreeElement(ancestors[i], isAncestor, getParent);\n        if (item && item.onpopulate)\n            item.onpopulate(item);\n    }\n\n    return this.getCachedTreeElement(representedObject);\n}\n\nTreeOutline.prototype.treeElementFromPoint = function(x, y)\n{\n    var node = this._childrenListNode.ownerDocument.elementFromPoint(x, y);\n    var listNode = node.enclosingNodeOrSelfWithNodeNameInArray([\"ol\", \"li\"]);\n    if (listNode)\n        return listNode.parentTreeElement || listNode.treeElement;\n    return null;\n}\n\nTreeOutline.prototype._treeKeyDown = function(event)\n{\n    if (event.target !== this._childrenListNode)\n        return;\n\n    if (!this.selectedTreeElement || event.shiftKey || event.metaKey || event.ctrlKey)\n        return;\n\n    var handled = false;\n    var nextSelectedElement;\n    if (event.keyIdentifier === \"Up\" && !event.altKey) {\n        nextSelectedElement = this.selectedTreeElement.traversePreviousTreeElement(true);\n        while (nextSelectedElement && !nextSelectedElement.selectable)\n            nextSelectedElement = nextSelectedElement.traversePreviousTreeElement(!this.expandTreeElementsWhenArrowing);\n        handled = nextSelectedElement ? true : false;\n    } else if (event.keyIdentifier === \"Down\" && !event.altKey) {\n        nextSelectedElement = this.selectedTreeElement.traverseNextTreeElement(true);\n        while (nextSelectedElement && !nextSelectedElement.selectable)\n            nextSelectedElement = nextSelectedElement.traverseNextTreeElement(!this.expandTreeElementsWhenArrowing);\n        handled = nextSelectedElement ? true : false;\n    } else if (event.keyIdentifier === \"Left\") {\n        if (this.selectedTreeElement.expanded) {\n            if (event.altKey)\n                this.selectedTreeElement.collapseRecursively();\n            else\n                this.selectedTreeElement.collapse();\n            handled = true;\n        } else if (this.selectedTreeElement.parent && !this.selectedTreeElement.parent.root) {\n            handled = true;\n            if (this.selectedTreeElement.parent.selectable) {\n                nextSelectedElement = this.selectedTreeElement.parent;\n                handled = nextSelectedElement ? true : false;\n            } else if (this.selectedTreeElement.parent)\n                this.selectedTreeElement.parent.collapse();\n        }\n    } else if (event.keyIdentifier === \"Right\") {\n        if (!this.selectedTreeElement.revealed()) {\n            this.selectedTreeElement.reveal();\n            handled = true;\n        } else if (this.selectedTreeElement.hasChildren) {\n            handled = true;\n            if (this.selectedTreeElement.expanded) {\n                nextSelectedElement = this.selectedTreeElement.children[0];\n                handled = nextSelectedElement ? true : false;\n            } else {\n                if (event.altKey)\n                    this.selectedTreeElement.expandRecursively();\n                else\n                    this.selectedTreeElement.expand();\n            }\n        }\n    } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Backspace.code || event.keyCode === WebInspector.KeyboardShortcut.Keys.Delete.code) {\n        if (this.selectedTreeElement.ondelete)\n            handled = this.selectedTreeElement.ondelete();\n    } else if (isEnterKey(event)) {\n        if (this.selectedTreeElement.onenter)\n            handled = this.selectedTreeElement.onenter();\n    }\n\n    if (nextSelectedElement) {\n        nextSelectedElement.reveal();\n        nextSelectedElement.select(false, true);\n    }\n\n    if (handled) {\n        event.preventDefault();\n        event.stopPropagation();\n    }\n}\n\nTreeOutline.prototype.expand = function()\n{\n    // this is the root, do nothing\n}\n\nTreeOutline.prototype.collapse = function()\n{\n    // this is the root, do nothing\n}\n\nTreeOutline.prototype.revealed = function()\n{\n    return true;\n}\n\nTreeOutline.prototype.reveal = function()\n{\n    // this is the root, do nothing\n}\n\nTreeOutline.prototype.select = function()\n{\n    // this is the root, do nothing\n}\n\nTreeOutline.prototype.appendChild = TreeOutline._appendChild;\nTreeOutline.prototype.insertChild = TreeOutline._insertChild;\nTreeOutline.prototype.removeChild = TreeOutline._removeChild;\nTreeOutline.prototype.removeChildAtIndex = TreeOutline._removeChildAtIndex;\nTreeOutline.prototype.removeChildren = TreeOutline._removeChildren;\nTreeOutline.prototype.removeChildrenRecursive = TreeOutline._removeChildrenRecursive;\n\nfunction TreeElement(title, representedObject, hasChildren)\n{\n    this._title = title;\n    this.representedObject = (representedObject || {});\n\n    if (this.representedObject.__treeElementIdentifier)\n        this.identifier = this.representedObject.__treeElementIdentifier;\n    else {\n        this.identifier = TreeOutline._knownTreeElementNextIdentifier++;\n        this.representedObject.__treeElementIdentifier = this.identifier;\n    }\n\n    this._hidden = false;\n    this.expanded = false;\n    this.selected = false;\n    this.hasChildren = hasChildren;\n    this.children = [];\n    this.treeOutline = null;\n    this.parent = null;\n    this.previousSibling = null;\n    this.nextSibling = null;\n    this._listItemNode = null;\n}\n\nTreeElement.prototype = {\n    selectable: true,\n    arrowToggleWidth: 10,\n\n    get listItemElement() {\n        return this._listItemNode;\n    },\n\n    get childrenListElement() {\n        return this._childrenListNode;\n    },\n\n    get title() {\n        return this._title;\n    },\n\n    set title(x) {\n        this._title = x;\n        this._setListItemNodeContent();\n    },\n\n    get titleHTML() {\n        return this._titleHTML;\n    },\n\n    set titleHTML(x) {\n        this._titleHTML = x;\n        this._setListItemNodeContent();\n    },\n\n    get tooltip() {\n        return this._tooltip;\n    },\n\n    set tooltip(x) {\n        this._tooltip = x;\n        if (this._listItemNode)\n            this._listItemNode.title = x ? x : \"\";\n    },\n\n    get hasChildren() {\n        return this._hasChildren;\n    },\n\n    set hasChildren(x) {\n        if (this._hasChildren === x)\n            return;\n\n        this._hasChildren = x;\n\n        if (!this._listItemNode)\n            return;\n\n        if (x)\n            this._listItemNode.addStyleClass(\"parent\");\n        else {\n            this._listItemNode.removeStyleClass(\"parent\");\n            this.collapse();\n        }\n    },\n\n    get hidden() {\n        return this._hidden;\n    },\n\n    set hidden(x) {\n        if (this._hidden === x)\n            return;\n\n        this._hidden = x;\n\n        if (x) {\n            if (this._listItemNode)\n                this._listItemNode.addStyleClass(\"hidden\");\n            if (this._childrenListNode)\n                this._childrenListNode.addStyleClass(\"hidden\");\n        } else {\n            if (this._listItemNode)\n                this._listItemNode.removeStyleClass(\"hidden\");\n            if (this._childrenListNode)\n                this._childrenListNode.removeStyleClass(\"hidden\");\n        }\n    },\n\n    get shouldRefreshChildren() {\n        return this._shouldRefreshChildren;\n    },\n\n    set shouldRefreshChildren(x) {\n        this._shouldRefreshChildren = x;\n        if (x && this.expanded)\n            this.expand();\n    },\n\n    _setListItemNodeContent: function()\n    {\n        if (!this._listItemNode)\n            return;\n\n        if (!this._titleHTML && !this._title)\n            this._listItemNode.removeChildren();\n        else if (typeof this._titleHTML === \"string\")\n            this._listItemNode.innerHTML = this._titleHTML;\n        else if (typeof this._title === \"string\")\n            this._listItemNode.textContent = this._title;\n        else {\n            this._listItemNode.removeChildren();\n            if (this._title.parentNode)\n                this._title.parentNode.removeChild(this._title);\n            this._listItemNode.appendChild(this._title);\n        }\n    }\n}\n\nTreeElement.prototype.appendChild = TreeOutline._appendChild;\nTreeElement.prototype.insertChild = TreeOutline._insertChild;\nTreeElement.prototype.removeChild = TreeOutline._removeChild;\nTreeElement.prototype.removeChildAtIndex = TreeOutline._removeChildAtIndex;\nTreeElement.prototype.removeChildren = TreeOutline._removeChildren;\nTreeElement.prototype.removeChildrenRecursive = TreeOutline._removeChildrenRecursive;\n\nTreeElement.prototype._attach = function()\n{\n    if (!this._listItemNode || this.parent._shouldRefreshChildren) {\n        if (this._listItemNode && this._listItemNode.parentNode)\n            this._listItemNode.parentNode.removeChild(this._listItemNode);\n\n        this._listItemNode = this.treeOutline._childrenListNode.ownerDocument.createElement(\"li\");\n        this._listItemNode.treeElement = this;\n        this._setListItemNodeContent();\n        this._listItemNode.title = this._tooltip ? this._tooltip : \"\";\n\n        if (this.hidden)\n            this._listItemNode.addStyleClass(\"hidden\");\n        if (this.hasChildren)\n            this._listItemNode.addStyleClass(\"parent\");\n        if (this.expanded)\n            this._listItemNode.addStyleClass(\"expanded\");\n        if (this.selected)\n            this._listItemNode.addStyleClass(\"selected\");\n\n        this._listItemNode.addEventListener(\"mousedown\", TreeElement.treeElementMouseDown, false);\n        this._listItemNode.addEventListener(\"click\", TreeElement.treeElementToggled, false);\n        this._listItemNode.addEventListener(\"dblclick\", TreeElement.treeElementDoubleClicked, false);\n\n        if (this.onattach)\n            this.onattach(this);\n    }\n\n    var nextSibling = null;\n    if (this.nextSibling && this.nextSibling._listItemNode && this.nextSibling._listItemNode.parentNode === this.parent._childrenListNode)\n        nextSibling = this.nextSibling._listItemNode;\n    this.parent._childrenListNode.insertBefore(this._listItemNode, nextSibling);\n    if (this._childrenListNode)\n        this.parent._childrenListNode.insertBefore(this._childrenListNode, this._listItemNode.nextSibling);\n    if (this.selected)\n        this.select();\n    if (this.expanded)\n        this.expand();\n}\n\nTreeElement.prototype._detach = function()\n{\n    if (this._listItemNode && this._listItemNode.parentNode)\n        this._listItemNode.parentNode.removeChild(this._listItemNode);\n    if (this._childrenListNode && this._childrenListNode.parentNode)\n        this._childrenListNode.parentNode.removeChild(this._childrenListNode);\n}\n\nTreeElement.treeElementMouseDown = function(event)\n{\n    var element = event.currentTarget;\n    if (!element || !element.treeElement || !element.treeElement.selectable)\n        return;\n\n    if (element.treeElement.isEventWithinDisclosureTriangle(event))\n        return;\n\n    element.treeElement.selectOnMouseDown(event);\n}\n\nTreeElement.treeElementToggled = function(event)\n{\n    var element = event.currentTarget;\n    if (!element || !element.treeElement)\n        return;\n\n    if (!element.treeElement.isEventWithinDisclosureTriangle(event))\n        return;\n\n    if (element.treeElement.expanded) {\n        if (event.altKey)\n            element.treeElement.collapseRecursively();\n        else\n            element.treeElement.collapse();\n    } else {\n        if (event.altKey)\n            element.treeElement.expandRecursively();\n        else\n            element.treeElement.expand();\n    }\n    event.stopPropagation();\n}\n\nTreeElement.treeElementDoubleClicked = function(event)\n{\n    var element = event.currentTarget;\n    if (!element || !element.treeElement)\n        return;\n\n    if (element.treeElement.ondblclick)\n        element.treeElement.ondblclick.call(element.treeElement, event);\n    else if (element.treeElement.hasChildren && !element.treeElement.expanded)\n        element.treeElement.expand();\n}\n\nTreeElement.prototype.collapse = function()\n{\n    if (this._listItemNode)\n        this._listItemNode.removeStyleClass(\"expanded\");\n    if (this._childrenListNode)\n        this._childrenListNode.removeStyleClass(\"expanded\");\n\n    this.expanded = false;\n    if (this.treeOutline)\n        this.treeOutline._treeElementsExpandedState[this.identifier] = true;\n\n    if (this.oncollapse)\n        this.oncollapse(this);\n}\n\nTreeElement.prototype.collapseRecursively = function()\n{\n    var item = this;\n    while (item) {\n        if (item.expanded)\n            item.collapse();\n        item = item.traverseNextTreeElement(false, this, true);\n    }\n}\n\nTreeElement.prototype.expand = function()\n{\n    if (!this.hasChildren || (this.expanded && !this._shouldRefreshChildren && this._childrenListNode))\n        return;\n\n    if (this.treeOutline && (!this._childrenListNode || this._shouldRefreshChildren)) {\n        if (this._childrenListNode && this._childrenListNode.parentNode)\n            this._childrenListNode.parentNode.removeChild(this._childrenListNode);\n\n        this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement(\"ol\");\n        this._childrenListNode.parentTreeElement = this;\n        this._childrenListNode.addStyleClass(\"children\");\n\n        if (this.hidden)\n            this._childrenListNode.addStyleClass(\"hidden\");\n\n        if (this.onpopulate)\n            this.onpopulate(this);\n\n        for (var i = 0; i < this.children.length; ++i)\n            this.children[i]._attach();\n\n        delete this._shouldRefreshChildren;\n    }\n\n    if (this._listItemNode) {\n        this._listItemNode.addStyleClass(\"expanded\");\n        if (this._childrenListNode && this._childrenListNode.parentNode != this._listItemNode.parentNode)\n            this.parent._childrenListNode.insertBefore(this._childrenListNode, this._listItemNode.nextSibling);\n    }\n\n    if (this._childrenListNode)\n        this._childrenListNode.addStyleClass(\"expanded\");\n\n    this.expanded = true;\n    if (this.treeOutline)\n        this.treeOutline._treeElementsExpandedState[this.identifier] = true;\n\n    if (this.onexpand)\n        this.onexpand(this);\n}\n\nTreeElement.prototype.expandRecursively = function(maxDepth)\n{\n    var item = this;\n    var info = {};\n    var depth = 0;\n\n    // The Inspector uses TreeOutlines to represents object properties, so recursive expansion\n    // in some case can be infinite, since JavaScript objects can hold circular references.\n    // So default to a recursion cap of 3 levels, since that gives fairly good results.\n    if (typeof maxDepth === \"undefined\" || typeof maxDepth === \"null\")\n        maxDepth = 3;\n\n    while (item) {\n        if (depth < maxDepth)\n            item.expand();\n        item = item.traverseNextTreeElement(false, this, (depth >= maxDepth), info);\n        depth += info.depthChange;\n    }\n}\n\nTreeElement.prototype.hasAncestor = function(ancestor) {\n    if (!ancestor)\n        return false;\n\n    var currentNode = this.parent;\n    while (currentNode) {\n        if (ancestor === currentNode)\n            return true;\n        currentNode = currentNode.parent;\n    }\n\n    return false;\n}\n\nTreeElement.prototype.reveal = function()\n{\n    var currentAncestor = this.parent;\n    while (currentAncestor && !currentAncestor.root) {\n        if (!currentAncestor.expanded)\n            currentAncestor.expand();\n        currentAncestor = currentAncestor.parent;\n    }\n\n    if (this.onreveal)\n        this.onreveal(this);\n}\n\nTreeElement.prototype.revealed = function()\n{\n    var currentAncestor = this.parent;\n    while (currentAncestor && !currentAncestor.root) {\n        if (!currentAncestor.expanded)\n            return false;\n        currentAncestor = currentAncestor.parent;\n    }\n\n    return true;\n}\n\nTreeElement.prototype.selectOnMouseDown = function(event)\n{\n    this.select(false, true);\n}\n\nTreeElement.prototype.select = function(supressOnSelect, selectedByUser)\n{\n    if (!this.treeOutline || !this.selectable || this.selected)\n        return;\n\n    if (this.treeOutline.selectedTreeElement)\n        this.treeOutline.selectedTreeElement.deselect();\n\n    this.selected = true;\n    this.treeOutline._childrenListNode.focus();\n\n    // Focusing on another node may detach \"this\" from tree.\n    if (!this.treeOutline)\n        return;\n    this.treeOutline.selectedTreeElement = this;\n    if (this._listItemNode)\n        this._listItemNode.addStyleClass(\"selected\");\n\n    if (this.onselect && !supressOnSelect)\n        this.onselect(this, selectedByUser);\n}\n\nTreeElement.prototype.deselect = function(supressOnDeselect)\n{\n    if (!this.treeOutline || this.treeOutline.selectedTreeElement !== this || !this.selected)\n        return false;\n\n    this.selected = false;\n    this.treeOutline.selectedTreeElement = null;\n    if (this._listItemNode)\n        this._listItemNode.removeStyleClass(\"selected\");\n\n    if (this.ondeselect && !supressOnDeselect)\n        this.ondeselect(this);\n    return true;\n}\n\nTreeElement.prototype.traverseNextTreeElement = function(skipHidden, stayWithin, dontPopulate, info)\n{\n    if (!dontPopulate && this.hasChildren && this.onpopulate)\n        this.onpopulate(this);\n\n    if (info)\n        info.depthChange = 0;\n\n    var element = skipHidden ? (this.revealed() ? this.children[0] : null) : this.children[0];\n    if (element && (!skipHidden || (skipHidden && this.expanded))) {\n        if (info)\n            info.depthChange = 1;\n        return element;\n    }\n\n    if (this === stayWithin)\n        return null;\n\n    element = skipHidden ? (this.revealed() ? this.nextSibling : null) : this.nextSibling;\n    if (element)\n        return element;\n\n    element = this;\n    while (element && !element.root && !(skipHidden ? (element.revealed() ? element.nextSibling : null) : element.nextSibling) && element.parent !== stayWithin) {\n        if (info)\n            info.depthChange -= 1;\n        element = element.parent;\n    }\n\n    if (!element)\n        return null;\n\n    return (skipHidden ? (element.revealed() ? element.nextSibling : null) : element.nextSibling);\n}\n\nTreeElement.prototype.traversePreviousTreeElement = function(skipHidden, dontPopulate)\n{\n    var element = skipHidden ? (this.revealed() ? this.previousSibling : null) : this.previousSibling;\n    if (!dontPopulate && element && element.hasChildren && element.onpopulate)\n        element.onpopulate(element);\n\n    while (element && (skipHidden ? (element.revealed() && element.expanded ? element.children[element.children.length - 1] : null) : element.children[element.children.length - 1])) {\n        if (!dontPopulate && element.hasChildren && element.onpopulate)\n            element.onpopulate(element);\n        element = (skipHidden ? (element.revealed() && element.expanded ? element.children[element.children.length - 1] : null) : element.children[element.children.length - 1]);\n    }\n\n    if (element)\n        return element;\n\n    if (!this.parent || this.parent.root)\n        return null;\n\n    return this.parent;\n}\n\nTreeElement.prototype.isEventWithinDisclosureTriangle = function(event)\n{\n    var left = this._listItemNode.totalOffsetLeft;\n    return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/utilities.js",
    "content": "/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer. \n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution. \n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission. \n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * Contains diff method based on Javascript Diff Algorithm By John Resig\n * http://ejohn.org/files/jsdiff.js (released under the MIT license).\n */\n\nFunction.prototype.bind = function(thisObject)\n{\n    var func = this;\n    var args = Array.prototype.slice.call(arguments, 1);\n    function bound()\n    {\n        return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0)));\n    }\n    bound.toString = function() {\n        return \"bound: \" + func;\n    };\n    return bound;\n}\n\nNode.prototype.rangeOfWord = function(offset, stopCharacters, stayWithinNode, direction)\n{\n    var startNode;\n    var startOffset = 0;\n    var endNode;\n    var endOffset = 0;\n\n    if (!stayWithinNode)\n        stayWithinNode = this;\n\n    if (!direction || direction === \"backward\" || direction === \"both\") {\n        var node = this;\n        while (node) {\n            if (node === stayWithinNode) {\n                if (!startNode)\n                    startNode = stayWithinNode;\n                break;\n            }\n\n            if (node.nodeType === Node.TEXT_NODE) {\n                var start = (node === this ? (offset - 1) : (node.nodeValue.length - 1));\n                for (var i = start; i >= 0; --i) {\n                    if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {\n                        startNode = node;\n                        startOffset = i + 1;\n                        break;\n                    }\n                }\n            }\n\n            if (startNode)\n                break;\n\n            node = node.traversePreviousNode(stayWithinNode);\n        }\n\n        if (!startNode) {\n            startNode = stayWithinNode;\n            startOffset = 0;\n        }\n    } else {\n        startNode = this;\n        startOffset = offset;\n    }\n\n    if (!direction || direction === \"forward\" || direction === \"both\") {\n        node = this;\n        while (node) {\n            if (node === stayWithinNode) {\n                if (!endNode)\n                    endNode = stayWithinNode;\n                break;\n            }\n\n            if (node.nodeType === Node.TEXT_NODE) {\n                var start = (node === this ? offset : 0);\n                for (var i = start; i < node.nodeValue.length; ++i) {\n                    if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {\n                        endNode = node;\n                        endOffset = i;\n                        break;\n                    }\n                }\n            }\n\n            if (endNode)\n                break;\n\n            node = node.traverseNextNode(stayWithinNode);\n        }\n\n        if (!endNode) {\n            endNode = stayWithinNode;\n            endOffset = stayWithinNode.nodeType === Node.TEXT_NODE ? stayWithinNode.nodeValue.length : stayWithinNode.childNodes.length;\n        }\n    } else {\n        endNode = this;\n        endOffset = offset;\n    }\n\n    var result = this.ownerDocument.createRange();\n    result.setStart(startNode, startOffset);\n    result.setEnd(endNode, endOffset);\n\n    return result;\n}\n\nNode.prototype.traverseNextTextNode = function(stayWithin)\n{\n    var node = this.traverseNextNode(stayWithin);\n    if (!node)\n        return;\n\n    while (node && node.nodeType !== Node.TEXT_NODE)\n        node = node.traverseNextNode(stayWithin);\n\n    return node;\n}\n\nNode.prototype.rangeBoundaryForOffset = function(offset)\n{\n    var node = this.traverseNextTextNode(this);\n    while (node && offset > node.nodeValue.length) {\n        offset -= node.nodeValue.length;\n        node = node.traverseNextTextNode(this);\n    }\n    if (!node)\n        return { container: this, offset: 0 };\n    return { container: node, offset: offset };\n}\n\nElement.prototype.removeStyleClass = function(className) \n{\n    // Test for the simple case first.\n    if (this.className === className) {\n        this.className = \"\";\n        return;\n    }\n\n    var index = this.className.indexOf(className);\n    if (index === -1)\n        return;\n\n    this.className = this.className.split(\" \").filter(function(s) {\n        return s && s !== className;\n    }).join(\" \");\n}\n\nElement.prototype.removeMatchingStyleClasses = function(classNameRegex)\n{\n    var regex = new RegExp(\"(^|\\\\s+)\" + classNameRegex + \"($|\\\\s+)\");\n    if (regex.test(this.className))\n        this.className = this.className.replace(regex, \" \");\n}\n\nElement.prototype.addStyleClass = function(className) \n{\n    if (className && !this.hasStyleClass(className))\n        this.className += (this.className.length ? \" \" + className : className);\n}\n\nElement.prototype.hasStyleClass = function(className) \n{\n    if (!className)\n        return false;\n    // Test for the simple case\n    if (this.className === className)\n        return true;\n\n    var index = this.className.indexOf(className);\n    if (index === -1)\n        return false;\n    var toTest = \" \" + this.className + \" \";\n    return toTest.indexOf(\" \" + className + \" \", index) !== -1;\n}\n\nElement.prototype.positionAt = function(x, y)\n{\n    this.style.left = x + \"px\";\n    this.style.top = y + \"px\";\n}\n\nElement.prototype.pruneEmptyTextNodes = function()\n{\n    var sibling = this.firstChild;\n    while (sibling) {\n        var nextSibling = sibling.nextSibling;\n        if (sibling.nodeType === this.TEXT_NODE && sibling.nodeValue === \"\")\n            this.removeChild(sibling);\n        sibling = nextSibling;\n    }\n}\n\nElement.prototype.isScrolledToBottom = function()\n{\n    // This code works only for 0-width border\n    return this.scrollTop + this.clientHeight === this.scrollHeight;\n}\n\nNode.prototype.enclosingNodeOrSelfWithNodeNameInArray = function(nameArray)\n{\n    for (var node = this; node && node !== this.ownerDocument; node = node.parentNode)\n        for (var i = 0; i < nameArray.length; ++i)\n            if (node.nodeName.toLowerCase() === nameArray[i].toLowerCase())\n                return node;\n    return null;\n}\n\nNode.prototype.enclosingNodeOrSelfWithNodeName = function(nodeName)\n{\n    return this.enclosingNodeOrSelfWithNodeNameInArray([nodeName]);\n}\n\nNode.prototype.enclosingNodeOrSelfWithClass = function(className)\n{\n    for (var node = this; node && node !== this.ownerDocument; node = node.parentNode)\n        if (node.nodeType === Node.ELEMENT_NODE && node.hasStyleClass(className))\n            return node;\n    return null;\n}\n\nNode.prototype.enclosingNodeWithClass = function(className)\n{\n    if (!this.parentNode)\n        return null;\n    return this.parentNode.enclosingNodeOrSelfWithClass(className);\n}\n\nElement.prototype.query = function(query) \n{\n    return this.ownerDocument.evaluate(query, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n}\n\nElement.prototype.removeChildren = function()\n{\n    if (this.firstChild)\n        this.textContent = \"\";\n}\n\nElement.prototype.isInsertionCaretInside = function()\n{\n    var selection = window.getSelection();\n    if (!selection.rangeCount || !selection.isCollapsed)\n        return false;\n    var selectionRange = selection.getRangeAt(0);\n    return selectionRange.startContainer === this || selectionRange.startContainer.isDescendant(this);\n}\n\nElement.prototype.createChild = function(elementName, className)\n{\n    var element = document.createElement(elementName);\n    if (className)\n        element.className = className;\n    this.appendChild(element);\n    return element;\n}\n\nObject.defineProperty(Element.prototype, \"totalOffsetLeft\", {get: function()\n{\n    var total = 0;\n    for (var element = this; element; element = element.offsetParent)\n        total += element.offsetLeft + (this !== element ? element.clientLeft : 0);\n    return total;\n}});\n\nObject.defineProperty(Element.prototype, \"totalOffsetTop\", {get: function()\n{\n    var total = 0;\n    for (var element = this; element; element = element.offsetParent)\n        total += element.offsetTop + (this !== element ? element.clientTop : 0);\n    return total;\n}});\n\nElement.prototype.offsetRelativeToWindow = function(targetWindow)\n{\n    var elementOffset = {x: 0, y: 0};\n    var curElement = this;\n    var curWindow = this.ownerDocument.defaultView;\n    while (curWindow && curElement) {\n        elementOffset.x += curElement.totalOffsetLeft;\n        elementOffset.y += curElement.totalOffsetTop;\n        if (curWindow === targetWindow)\n            break;\n\n        curElement = curWindow.frameElement;\n        curWindow = curWindow.parent;\n    }\n\n    return elementOffset;\n}\n\nObject.defineProperty(KeyboardEvent.prototype, \"data\", {get: function()\n{\n    // Emulate \"data\" attribute from DOM 3 TextInput event.\n    // See http://www.w3.org/TR/DOM-Level-3-Events/#events-Events-TextEvent-data\n    switch (this.type) {\n        case \"keypress\":\n            if (!this.ctrlKey && !this.metaKey)\n                return String.fromCharCode(this.charCode);\n            else\n                return \"\";\n        case \"keydown\":\n        case \"keyup\":\n            if (!this.ctrlKey && !this.metaKey && !this.altKey)\n                return String.fromCharCode(this.which);\n            else\n                return \"\";\n    }\n}});\n\nText.prototype.select = function(start, end)\n{\n    start = start || 0;\n    end = end || this.textContent.length;\n\n    if (start < 0)\n        start = end + start;\n\n    var selection = window.getSelection();\n    selection.removeAllRanges();\n    var range = document.createRange();\n    range.setStart(this, start);\n    range.setEnd(this, end);\n    selection.addRange(range);\n    return this;\n}\n\nObject.defineProperty(Element.prototype, \"selectionLeftOffset\", {get: function() {\n    // Calculate selection offset relative to the current element.\n\n    var selection = window.getSelection();\n    if (!selection.containsNode(this, true))\n        return null;\n\n    var leftOffset = selection.anchorOffset;\n    var node = selection.anchorNode;\n\n    while (node !== this) {\n        while (node.previousSibling) {\n            node = node.previousSibling;\n            leftOffset += node.textContent.length;\n        }\n        node = node.parentNode;\n    }\n\n    return leftOffset;\n}});\n\nNode.prototype.isWhitespace = isNodeWhitespace;\nNode.prototype.displayName = nodeDisplayName;\nNode.prototype.isAncestor = function(node)\n{\n    return isAncestorNode(this, node);\n};\nNode.prototype.isDescendant = isDescendantNode;\nNode.prototype.traverseNextNode = traverseNextNode;\nNode.prototype.traversePreviousNode = traversePreviousNode;\nNode.prototype.onlyTextChild = onlyTextChild;\n\nString.prototype.hasSubstring = function(string, caseInsensitive)\n{\n    if (!caseInsensitive)\n        return this.indexOf(string) !== -1;\n    return this.match(new RegExp(string.escapeForRegExp(), \"i\"));\n}\n\nString.prototype.findAll = function(string)\n{\n    var matches = [];\n    var i = this.indexOf(string);\n    while (i !== -1) {\n        matches.push(i);\n        i = this.indexOf(string, i + string.length);\n    }\n    return matches;\n}\n\nString.prototype.lineEndings = function()\n{\n    if (!this._lineEndings) {\n        this._lineEndings = this.findAll(\"\\n\");\n        this._lineEndings.push(this.length);\n    }\n    return this._lineEndings;\n}\n\nString.prototype.asParsedURL = function()\n{\n    // RegExp groups:\n    // 1 - scheme\n    // 2 - hostname\n    // 3 - ?port\n    // 4 - ?path\n    // 5 - ?fragment\n    var match = this.match(/^([^:]+):\\/\\/([^\\/:]*)(?::([\\d]+))?(?:(\\/[^#]*)(?:#(.*))?)?$/i);\n    if (!match)\n        return null;\n    var result = {};\n    result.scheme = match[1].toLowerCase();\n    result.host = match[2];\n    result.port = match[3];\n    result.path = match[4] || \"/\";\n    result.fragment = match[5];\n    return result;\n}\n\nString.prototype.escapeCharacters = function(chars)\n{\n    var foundChar = false;\n    for (var i = 0; i < chars.length; ++i) {\n        if (this.indexOf(chars.charAt(i)) !== -1) {\n            foundChar = true;\n            break;\n        }\n    }\n\n    if (!foundChar)\n        return this;\n\n    var result = \"\";\n    for (var i = 0; i < this.length; ++i) {\n        if (chars.indexOf(this.charAt(i)) !== -1)\n            result += \"\\\\\";\n        result += this.charAt(i);\n    }\n\n    return result;\n}\n\nString.prototype.escapeForRegExp = function()\n{\n    return this.escapeCharacters(\"^[]{}()\\\\.$*+?|\");\n}\n\nString.prototype.escapeHTML = function()\n{\n    return this.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\");\n}\n\nString.prototype.collapseWhitespace = function()\n{\n    return this.replace(/[\\s\\xA0]+/g, \" \");\n}\n\nString.prototype.trimURL = function(baseURLDomain)\n{\n    var result = this.replace(/^(https|http|file):\\/\\//i, \"\");\n    if (baseURLDomain)\n        result = result.replace(new RegExp(\"^\" + baseURLDomain.escapeForRegExp(), \"i\"), \"\");\n    return result;\n}\n\nfunction isNodeWhitespace()\n{\n    if (!this || this.nodeType !== Node.TEXT_NODE)\n        return false;\n    if (!this.nodeValue.length)\n        return true;\n    return this.nodeValue.match(/^[\\s\\xA0]+$/);\n}\n\nfunction nodeDisplayName()\n{\n    if (!this)\n        return \"\";\n\n    switch (this.nodeType) {\n        case Node.DOCUMENT_NODE:\n            return \"Document\";\n\n        case Node.ELEMENT_NODE:\n            var name = \"<\" + this.nodeName.toLowerCase();\n\n            if (this.hasAttributes()) {\n                var value = this.getAttribute(\"id\");\n                if (value)\n                    name += \" id=\\\"\" + value + \"\\\"\";\n                value = this.getAttribute(\"class\");\n                if (value)\n                    name += \" class=\\\"\" + value + \"\\\"\";\n                if (this.nodeName.toLowerCase() === \"a\") {\n                    value = this.getAttribute(\"name\");\n                    if (value)\n                        name += \" name=\\\"\" + value + \"\\\"\";\n                    value = this.getAttribute(\"href\");\n                    if (value)\n                        name += \" href=\\\"\" + value + \"\\\"\";\n                } else if (this.nodeName.toLowerCase() === \"img\") {\n                    value = this.getAttribute(\"src\");\n                    if (value)\n                        name += \" src=\\\"\" + value + \"\\\"\";\n                } else if (this.nodeName.toLowerCase() === \"iframe\") {\n                    value = this.getAttribute(\"src\");\n                    if (value)\n                        name += \" src=\\\"\" + value + \"\\\"\";\n                } else if (this.nodeName.toLowerCase() === \"input\") {\n                    value = this.getAttribute(\"name\");\n                    if (value)\n                        name += \" name=\\\"\" + value + \"\\\"\";\n                    value = this.getAttribute(\"type\");\n                    if (value)\n                        name += \" type=\\\"\" + value + \"\\\"\";\n                } else if (this.nodeName.toLowerCase() === \"form\") {\n                    value = this.getAttribute(\"action\");\n                    if (value)\n                        name += \" action=\\\"\" + value + \"\\\"\";\n                }\n            }\n\n            return name + \">\";\n\n        case Node.TEXT_NODE:\n            if (isNodeWhitespace.call(this))\n                return \"(whitespace)\";\n            return \"\\\"\" + this.nodeValue + \"\\\"\";\n\n        case Node.COMMENT_NODE:\n            return \"<!--\" + this.nodeValue + \"-->\";\n            \n        case Node.DOCUMENT_TYPE_NODE:\n            var docType = \"<!DOCTYPE \" + this.nodeName;\n            if (this.publicId) {\n                docType += \" PUBLIC \\\"\" + this.publicId + \"\\\"\";\n                if (this.systemId)\n                    docType += \" \\\"\" + this.systemId + \"\\\"\";\n            } else if (this.systemId)\n                docType += \" SYSTEM \\\"\" + this.systemId + \"\\\"\";\n            if (this.internalSubset)\n                docType += \" [\" + this.internalSubset + \"]\";\n            return docType + \">\";\n    }\n\n    return this.nodeName.toLowerCase().collapseWhitespace();\n}\n\nfunction isAncestorNode(ancestor, node)\n{\n    if (!node || !ancestor)\n        return false;\n\n    var currentNode = node.parentNode;\n    while (currentNode) {\n        if (ancestor === currentNode)\n            return true;\n        currentNode = currentNode.parentNode;\n    }\n    return false;\n}\n\nfunction isDescendantNode(descendant)\n{\n    return isAncestorNode(descendant, this);\n}\n\nfunction traverseNextNode(stayWithin)\n{\n    if (!this)\n        return;\n\n    var node = this.firstChild;\n    if (node)\n        return node;\n\n    if (stayWithin && this === stayWithin)\n        return null;\n\n    node = this.nextSibling;\n    if (node)\n        return node;\n\n    node = this;\n    while (node && !node.nextSibling && (!stayWithin || !node.parentNode || node.parentNode !== stayWithin))\n        node = node.parentNode;\n    if (!node)\n        return null;\n\n    return node.nextSibling;\n}\n\nfunction traversePreviousNode(stayWithin)\n{\n    if (!this)\n        return;\n    if (stayWithin && this === stayWithin)\n        return null;\n    var node = this.previousSibling;\n    while (node && node.lastChild)\n        node = node.lastChild;\n    if (node)\n        return node;\n    return this.parentNode;\n}\n\nfunction onlyTextChild()\n{\n    if (!this)\n        return null;\n\n    var firstChild = this.firstChild;\n    if (!firstChild || firstChild.nodeType !== Node.TEXT_NODE)\n        return null;\n\n    var sibling = firstChild.nextSibling;\n    return sibling ? null : firstChild;\n}\n\nfunction appropriateSelectorForNode(node, justSelector)\n{\n    if (!node)\n        return \"\";\n\n    var lowerCaseName = node.localName || node.nodeName.toLowerCase();\n\n    var id = node.getAttribute(\"id\");\n    if (id) {\n        var selector = \"#\" + id;\n        return (justSelector ? selector : lowerCaseName + selector);\n    }\n\n    var className = node.getAttribute(\"class\");\n    if (className) {\n        var selector = \".\" + className.replace(/\\s+/, \".\");\n        return (justSelector ? selector : lowerCaseName + selector);\n    }\n\n    if (lowerCaseName === \"input\" && node.getAttribute(\"type\"))\n        return lowerCaseName + \"[type=\\\"\" + node.getAttribute(\"type\") + \"\\\"]\";\n\n    return lowerCaseName;\n}\n\nfunction getDocumentForNode(node)\n{\n    return node.nodeType == Node.DOCUMENT_NODE ? node : node.ownerDocument;\n}\n\nfunction parentNode(node)\n{\n    return node.parentNode;\n}\n\nNumber.millisToString = function(ms, higherResolution)\n{\n    return Number.secondsToString(ms / 1000, higherResolution);\n}\n\nNumber.secondsToString = function(seconds, higherResolution)\n{\n    if (seconds === 0)\n        return \"0\";\n\n    var ms = seconds * 1000;\n    if (higherResolution && ms < 1000)\n        return WebInspector.UIString(\"%.3fms\", ms);\n    else if (ms < 1000)\n        return WebInspector.UIString(\"%.0fms\", ms);\n\n    if (seconds < 60)\n        return WebInspector.UIString(\"%.2fs\", seconds);\n\n    var minutes = seconds / 60;\n    if (minutes < 60)\n        return WebInspector.UIString(\"%.1fmin\", minutes);\n\n    var hours = minutes / 60;\n    if (hours < 24)\n        return WebInspector.UIString(\"%.1fhrs\", hours);\n\n    var days = hours / 24;\n    return WebInspector.UIString(\"%.1f days\", days);\n}\n\nNumber.bytesToString = function(bytes, higherResolution)\n{\n    if (typeof higherResolution === \"undefined\")\n        higherResolution = true;\n\n    if (bytes < 1024)\n        return WebInspector.UIString(\"%.0fB\", bytes);\n\n    var kilobytes = bytes / 1024;\n    if (higherResolution && kilobytes < 1024)\n        return WebInspector.UIString(\"%.2fKB\", kilobytes);\n    else if (kilobytes < 1024)\n        return WebInspector.UIString(\"%.0fKB\", kilobytes);\n\n    var megabytes = kilobytes / 1024;\n    if (higherResolution)\n        return WebInspector.UIString(\"%.2fMB\", megabytes);\n    else\n        return WebInspector.UIString(\"%.0fMB\", megabytes);\n}\n\nNumber.constrain = function(num, min, max)\n{\n    if (num < min)\n        num = min;\n    else if (num > max)\n        num = max;\n    return num;\n}\n\nHTMLTextAreaElement.prototype.moveCursorToEnd = function()\n{\n    var length = this.value.length;\n    this.setSelectionRange(length, length);\n}\n\nObject.defineProperty(Array.prototype, \"remove\", { value: function(value, onlyFirst)\n{\n    if (onlyFirst) {\n        var index = this.indexOf(value);\n        if (index !== -1)\n            this.splice(index, 1);\n        return;\n    }\n\n    var length = this.length;\n    for (var i = 0; i < length; ++i) {\n        if (this[i] === value)\n            this.splice(i, 1);\n    }\n}});\n\nObject.defineProperty(Array.prototype, \"keySet\", { value: function()\n{\n    var keys = {};\n    for (var i = 0; i < this.length; ++i)\n        keys[this[i]] = true;\n    return keys;\n}});\n\nObject.defineProperty(Array.prototype, \"upperBound\", { value: function(value)\n{\n    var first = 0;\n    var count = this.length;\n    while (count > 0) {\n      var step = count >> 1;\n      var middle = first + step;\n      if (value >= this[middle]) {\n          first = middle + 1;\n          count -= step + 1;\n      } else\n          count = step;\n    }\n    return first;\n}});\n\nArray.diff = function(left, right)\n{\n    var o = left;\n    var n = right;\n\n    var ns = {};\n    var os = {};\n\n    for (var i = 0; i < n.length; i++) {\n        if (ns[n[i]] == null)\n            ns[n[i]] = { rows: [], o: null };\n        ns[n[i]].rows.push(i);\n    }\n\n    for (var i = 0; i < o.length; i++) {\n        if (os[o[i]] == null)\n            os[o[i]] = { rows: [], n: null };\n        os[o[i]].rows.push(i);\n    }\n\n    for (var i in ns) {\n        if (ns[i].rows.length == 1 && typeof(os[i]) != \"undefined\" && os[i].rows.length == 1) {\n            n[ns[i].rows[0]] = { text: n[ns[i].rows[0]], row: os[i].rows[0] };\n            o[os[i].rows[0]] = { text: o[os[i].rows[0]], row: ns[i].rows[0] };\n        }\n    }\n\n    for (var i = 0; i < n.length - 1; i++) {\n        if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null && n[i + 1] == o[n[i].row + 1]) {\n            n[i + 1] = { text: n[i + 1], row: n[i].row + 1 };\n            o[n[i].row + 1] = { text: o[n[i].row + 1], row: i + 1 };\n        }\n    }\n\n    for (var i = n.length - 1; i > 0; i--) {\n        if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null && \n            n[i - 1] == o[n[i].row - 1]) {\n            n[i - 1] = { text: n[i - 1], row: n[i].row - 1 };\n            o[n[i].row - 1] = { text: o[n[i].row - 1], row: i - 1 };\n        }\n    }\n\n    return { left: o, right: n };\n}\n\nArray.convert = function(list)\n{\n    // Cast array-like object to an array.\n    return Array.prototype.slice.call(list);\n}\n\nfunction insertionIndexForObjectInListSortedByFunction(anObject, aList, aFunction)\n{\n    var first = 0;\n    var last = aList.length - 1;\n    var floor = Math.floor;\n    var mid, c;\n\n    while (first <= last) {\n        mid = floor((first + last) / 2);\n        c = aFunction(anObject, aList[mid]);\n\n        if (c > 0)\n            first = mid + 1;\n        else if (c < 0)\n            last = mid - 1;\n        else {\n            // Return the first occurance of an item in the list.\n            while (mid > 0 && aFunction(anObject, aList[mid - 1]) === 0)\n                mid--;\n            first = mid;\n            break;\n        }\n    }\n\n    return first;\n}\n\nString.sprintf = function(format)\n{\n    return String.vsprintf(format, Array.prototype.slice.call(arguments, 1));\n}\n\nString.tokenizeFormatString = function(format)\n{\n    var tokens = [];\n    var substitutionIndex = 0;\n\n    function addStringToken(str)\n    {\n        tokens.push({ type: \"string\", value: str });\n    }\n\n    function addSpecifierToken(specifier, precision, substitutionIndex)\n    {\n        tokens.push({ type: \"specifier\", specifier: specifier, precision: precision, substitutionIndex: substitutionIndex });\n    }\n\n    var index = 0;\n    for (var precentIndex = format.indexOf(\"%\", index); precentIndex !== -1; precentIndex = format.indexOf(\"%\", index)) {\n        addStringToken(format.substring(index, precentIndex));\n        index = precentIndex + 1;\n\n        if (format[index] === \"%\") {\n            addStringToken(\"%\");\n            ++index;\n            continue;\n        }\n\n        if (!isNaN(format[index])) {\n            // The first character is a number, it might be a substitution index.\n            var number = parseInt(format.substring(index));\n            while (!isNaN(format[index]))\n                ++index;\n            // If the number is greater than zero and ends with a \"$\",\n            // then this is a substitution index.\n            if (number > 0 && format[index] === \"$\") {\n                substitutionIndex = (number - 1);\n                ++index;\n            }\n        }\n\n        var precision = -1;\n        if (format[index] === \".\") {\n            // This is a precision specifier. If no digit follows the \".\",\n            // then the precision should be zero.\n            ++index;\n            precision = parseInt(format.substring(index));\n            if (isNaN(precision))\n                precision = 0;\n            while (!isNaN(format[index]))\n                ++index;\n        }\n\n        addSpecifierToken(format[index], precision, substitutionIndex);\n\n        ++substitutionIndex;\n        ++index;\n    }\n\n    addStringToken(format.substring(index));\n\n    return tokens;\n}\n\nString.standardFormatters = {\n    d: function(substitution)\n    {\n        if (typeof substitution == \"object\" && WebInspector.RemoteObject.type(substitution) === \"number\")\n            substitution = substitution.description;\n        substitution = parseInt(substitution);\n        return !isNaN(substitution) ? substitution : 0;\n    },\n\n    f: function(substitution, token)\n    {\n        if (typeof substitution == \"object\" && WebInspector.RemoteObject.type(substitution) === \"number\")\n            substitution = substitution.description;\n        substitution = parseFloat(substitution);\n        if (substitution && token.precision > -1)\n            substitution = substitution.toFixed(token.precision);\n        return !isNaN(substitution) ? substitution : (token.precision > -1 ? Number(0).toFixed(token.precision) : 0);\n    },\n\n    s: function(substitution)\n    {\n        if (typeof substitution == \"object\" && WebInspector.RemoteObject.type(substitution) !== \"null\")\n            substitution = substitution.description;\n        return substitution;\n    },\n};\n\nString.vsprintf = function(format, substitutions)\n{\n    return String.format(format, substitutions, String.standardFormatters, \"\", function(a, b) { return a + b; }).formattedResult;\n}\n\nString.format = function(format, substitutions, formatters, initialValue, append)\n{\n    if (!format || !substitutions || !substitutions.length)\n        return { formattedResult: append(initialValue, format), unusedSubstitutions: substitutions };\n\n    function prettyFunctionName()\n    {\n        return \"String.format(\\\"\" + format + \"\\\", \\\"\" + substitutions.join(\"\\\", \\\"\") + \"\\\")\";\n    }\n\n    function warn(msg)\n    {\n        console.warn(prettyFunctionName() + \": \" + msg);\n    }\n\n    function error(msg)\n    {\n        console.error(prettyFunctionName() + \": \" + msg);\n    }\n\n    var result = initialValue;\n    var tokens = String.tokenizeFormatString(format);\n    var usedSubstitutionIndexes = {};\n\n    for (var i = 0; i < tokens.length; ++i) {\n        var token = tokens[i];\n\n        if (token.type === \"string\") {\n            result = append(result, token.value);\n            continue;\n        }\n\n        if (token.type !== \"specifier\") {\n            error(\"Unknown token type \\\"\" + token.type + \"\\\" found.\");\n            continue;\n        }\n\n        if (token.substitutionIndex >= substitutions.length) {\n            // If there are not enough substitutions for the current substitutionIndex\n            // just output the format specifier literally and move on.\n            error(\"not enough substitution arguments. Had \" + substitutions.length + \" but needed \" + (token.substitutionIndex + 1) + \", so substitution was skipped.\");\n            result = append(result, \"%\" + (token.precision > -1 ? token.precision : \"\") + token.specifier);\n            continue;\n        }\n\n        usedSubstitutionIndexes[token.substitutionIndex] = true;\n\n        if (!(token.specifier in formatters)) {\n            // Encountered an unsupported format character, treat as a string.\n            warn(\"unsupported format character \\u201C\" + token.specifier + \"\\u201D. Treating as a string.\");\n            result = append(result, substitutions[token.substitutionIndex]);\n            continue;\n        }\n\n        result = append(result, formatters[token.specifier](substitutions[token.substitutionIndex], token));\n    }\n\n    var unusedSubstitutions = [];\n    for (var i = 0; i < substitutions.length; ++i) {\n        if (i in usedSubstitutionIndexes)\n            continue;\n        unusedSubstitutions.push(substitutions[i]);\n    }\n\n    return { formattedResult: result, unusedSubstitutions: unusedSubstitutions };\n}\n\nfunction isEnterKey(event) {\n    // Check if in IME.\n    return (event.keyCode !== 229 && event.keyIdentifier === \"Enter\") || event.keyCode == 13 || event.charCode == 13;\n}\n\n\nfunction highlightSearchResult(element, offset, length)\n{\n    var lineText = element.textContent;\n    var endOffset = offset + length;\n    var highlightNode = document.createElement(\"span\");\n    highlightNode.className = \"webkit-search-result\";\n    highlightNode.textContent = lineText.substring(offset, endOffset);\n\n    var boundary = element.rangeBoundaryForOffset(offset);\n    var textNode = boundary.container;\n    var text = textNode.textContent;\n\n    if (boundary.offset + length < text.length) {\n        // Selection belong to a single split mode.\n        textNode.textContent = text.substring(boundary.offset + length);\n        textNode.parentElement.insertBefore(highlightNode, textNode);\n        var prefixNode = document.createTextNode(text.substring(0, boundary.offset));\n        textNode.parentElement.insertBefore(prefixNode, highlightNode);\n        return highlightNode;\n    }\n\n    var parentElement = textNode.parentElement;\n    var anchorElement = textNode.nextSibling;\n\n    length -= text.length - boundary.offset;\n    textNode.textContent = text.substring(0, boundary.offset);\n    textNode = textNode.traverseNextTextNode(element);\n\n    while (textNode) {\n        var text = textNode.textContent;\n        if (length < text.length) {\n            textNode.textContent = text.substring(length);\n            break;\n        }\n\n        length -= text.length;\n        textNode.textContent = \"\";\n        textNode = textNode.traverseNextTextNode(element);\n    }\n\n    parentElement.insertBefore(highlightNode, anchorElement);\n    return highlightNode;\n}\n\nfunction createSearchRegex(query)\n{\n    var regex = \"\";\n    for (var i = 0; i < query.length; ++i) {\n        var char = query.charAt(i);\n        if (char === \"]\")\n            char = \"\\\\]\";\n        regex += \"[\" + char + \"]\";\n    }\n    return new RegExp(regex, \"i\");\n}\n\nfunction offerFileForDownload(contents)\n{\n    var builder = new BlobBuilder();\n    builder.append(contents);\n    var blob = builder.getBlob(\"application/octet-stream\");\n    var url = window.webkitURL.createObjectURL(blob);\n    window.open(url);\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/web-inspector-API.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\neval(window.top.installWebInspectorAPIsource())\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/weinre/browser-support-check.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nvar iSupported = false;\n\nif (navigator.userAgent.match(/webkit/i)) {\n    iSupported = true;\n} else if (navigator.userAgent.match(/MSIE/i)) {\n    var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n    iSupported = re.exec(navigator.userAgent) !== null && parseFloat(RegExp.$1) >= 10;\n} else if (navigator.userAgent.match(/Firefox/i)) {\n\tvar re = new RegExp(\"Firefox/([0-9]{1,}[\\.0-9]{0,})\");\n\tiSupported = re.exec(navigator.userAgent) !== null && parseFloat(RegExp.$1) >= 18;\n}\n\nif (!iSupported) {\n    alert(\"It seems your browser or its version is not supported. This web page is designed to work in webkit-based browsers, latest InternetExplorer and Firefox\")\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/weinre/client.css",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n.toolbar-item.remote .toolbar-icon {\n    background-image: url(../../images/weinre-icon-32x32.png);\n}\n\n.monospace {\n     font-size:   12px !important;\n     font-family: Monaco, Consolas, Lucida Console, dejavu sans mono, monospace;\n}\n\n.source-code {\n     font-size:   12px !important;\n     font-family: Monaco, Consolas, Lucida Console, dejavu sans mono, monospace;\n}\n\n.panel.resources .cookie-storage-tree-item {\n    display: none;\n}\n\n.panel.resources .frame-storage-tree-item {\n    display: none;\n}\n\n.panel.resources .application-cache-storage-tree-item {\n    display: none;\n}\n\n.panel.timeline .resources-size-graph-sidebar-item {\n    display: none;\n}\n\n#main-status-bar .timeline-category-rendering {\n    display: none;\n}\n\n#search {\n    display: none;\n}\n\n#search-toolbar-label {\n    display: none;\n}\n\n.weinre-connector-item {\n    font-size: 140%;\n}\n\n.weinre-connector-item.target {\n    text-decoration: underline;\n    color: blue;\n}\n\n.weinre-connector-item.target.connected {\n    color: #0D0;\n}\n\n.weinre-connector-item.closed {\n    color: #B00;\n}\n\n.weinre-connector-item.current {\n    font-weight: bold;\n}\n\n.weinre-connector-item.connected {\n    color: #0D0;\n}\n\n.weinre-connector-item.error {\n    color: #A00;\n    font-weight: bold;\n    font-size: 200%\n}\n\n.weinreServerProperties {\n    margin-left: 2em;\n}\n\n.weinre-normal-text-size {\n    font-size: 140%;\n}\n\n.weinre-fadeable {\n  opacity: 1;\n  -webkit-transition: opacity 5s linear;\n}\n\n.weinre-fade {\n  opacity: 0;\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/client/weinre/hacks.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// a place for hacks\n\n;(function(){\n\nvar version = navigator.appVersion.match(/^.*Chrome\\/(\\d+)\\..*$/)\nif (!version) return\n\nversion = parseInt(version[1])\nif (version <= 26) return\n\nsetTimeout(fixToolbarItem, 1000)\n\nfunction fixToolbarItem() {\n    var toolbarItems = document.querySelectorAll(\".toolbar-item.toggleable\")\n\n    for (var i=0; i<toolbarItems.length; i++) {\n        var style = toolbarItems[i].style\n        if (style.display != \"none\") {\n            toolbarItems[i].style.display = \"inline-block\"\n        }\n    }\n}\n\n})();\n\n// __proto__ inheritance support; Weinre client classes only\n(function () {\n\n    var hasProto = \"__proto__\" in Object.prototype;\n\n    if (!hasProto) {\n        Object.defineProperty(Object.prototype, '__proto__', {set : function(value){\n            var tmpFunc = new Function();\n            tmpFunc.prototype = Object.create(value);\n\n            function copyProperties(a, b) {\n                var d;\n                for (var i in b) {\n                    d = Object.getOwnPropertyDescriptor(b, i);\n\n                    if (d &&(d.get || d.set)) {\n                        Object.defineProperty(a, i, d);\n                    } else {\n                        a[i] = b[i];\n                    }\n                }\n                return a;\n            }\n\n            function findProtoOwner(root, proto, depth){\n\n                if (depth > 1) return;\n\n                var props = Object.getOwnPropertyNames(root),\n                    prop,\n                    d;\n\n                for (var i = props.length; i--;) {\n                    prop = props[i];\n\n                    d = Object.getOwnPropertyDescriptor(root, prop);\n\n                    if (d && (d.get || d.set))  continue;\n\n                    if (typeof(root[prop]) === 'function' && root[prop].prototype === proto) {\n                        return root[prop];\n                    }\n\n                    if (root[prop] && root[prop].prototype instanceof WebInspector.Object) {\n                        var owner = findProtoOwner(root[prop], proto, depth+1);\n\n                        if (owner) return owner;\n                    }\n                }\n            }\n\n            copyProperties(tmpFunc.prototype, this);\n\n            // hack to be able to redefine object prototype; we can't do it another way\n            // because we have prototype as 'this' here only\n            var owner = findProtoOwner (window.WebInspector, this, 0);\n\n            if (owner) {\n                owner.prototype = new tmpFunc();\n                owner.prototype.proto = value;\n            }\n\n        }, get : function(){\n            return this.proto;\n        }});\n    }\n})();\n\n//if (!Object.prototype.__defineGetter__) {\n//    Object.prototype.__defineGetter__ = function (key, fn) {\n//        Object.defineProperty(this, key, {get: fn});\n//    }\n//}\n//\n//if (!Object.prototype.__defineSetter__) {\n//    Object.prototype.__defineSetter__ = function (key, fn) {\n//        Object.defineProperty(this, key, {set: fn, configurable: true, writable : true});\n//    }\n//}\n\n// hack for not existing scrollIntoViewIfNeeded\nif (!HTMLElement.prototype.scrollIntoViewIfNeeded){\n    HTMLElement.prototype.scrollIntoViewIfNeeded = function(alignWithTop) {\n\t\treturn this.scrollIntoView(alignWithTop);\n\t};\n}\n\n// hack for not existing setBaseAndExtent\nif (!Selection.prototype.setBaseAndExtent){\n    Selection.prototype.setBaseAndExtent = Selection.prototype.selectAllChildren;\n}"
  },
  {
    "path": "buildin_modules/weinre/web/demo/split.html",
    "content": "<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<frameset rows=\"50%,50%\">  \n  <frame src=\"/demo/weinre-demo.html\" />  \n  <frame src=\"/client\" />  \n</frameset>"
  },
  {
    "path": "buildin_modules/weinre/web/demo/weinre-demo-min.html",
    "content": "<!DOCTYPE html>\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<meta name=\"viewport\" content=\"user-scalable=no, width=device-width, height=device-height\">\n<title>weinre minified demo</title>\n<link rel=\"stylesheet\" href=\"weinre-demo.css\">\n<script>try {window.WeinreServerId = location.hash.split(\"#\")[1]} catch(e) {window.WeinreServerId = \"anonymous\"}</script>\n<script src=\"/target/target-script-min.js\"></script>\n<script src=\"weinre-demo.js\"></script>\n</head>\n\n<body onload=\"onLoad()\">\n<input id=\"button-start-stuff\" type=\"button\" value=\"start stuff\">\n\n<h1>this is a green h1</h1>\n<h1 class=\"blue\">this is a blue h1</h1>\n<h1 style=\"color:red\">this is a red h1</h1>\n<p>Some text, <i>some italic text</i>, and <b>some bold text</b>.\n\n<hr>\n<p><input id=\"button-clear-output\" type=\"button\" value=\"clear output\">\n<div id=\"output\"></div>\n</body>\n\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/demo/weinre-demo-strict.html",
    "content": "<!DOCTYPE html>\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<script>\"use strict\"</script>\n<meta name=\"viewport\" content=\"user-scalable=no, width=device-width, height=device-height\">\n<title>weinre non-minified strict demo</title>\n<link rel=\"stylesheet\" href=\"weinre-demo.css\">\n<script>try {window.WeinreServerId = location.hash.split(\"#\")[1]} catch(e) {window.WeinreServerId = \"anonymous\"}</script>\n<script src=\"/target/target-script.js\"></script>\n<script src=\"weinre-demo-strict.js\"></script>\n</head>\n\n<body onload=\"onLoad()\">\n<input id=\"button-start-stuff\" type=\"button\" value=\"start stuff\">\n\n<h1>this is a green h1</h1>\n<h1 class=\"blue\">this is a blue h1</h1>\n<h1 style=\"color:red\">this is a red h1</h1>\n<p>Some text, <i>some italic text</i>, and <b>some bold text</b>.\n\n<hr>\n<p><input id=\"button-clear-output\" type=\"button\" value=\"clear output\">\n<div id=\"output\"></div>\n</body>\n\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/demo/weinre-demo-strict.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n\"use strict\";\n\n//------------------------------------------------------------------------------\nvar started = false\n\nvar buttonStartStuff\nvar buttonClearOutput\nvar outputElement\nvar storageIndex = 0\nvar db\nvar otherDB\n\n// set the id based on the hash\nvar hash = location.href.split(\"#\")[1]\nif (!hash) hash = \"anonymous\"\nwindow.WeinreServerId = hash\n\n//------------------------------------------------------------------------------\nfunction onLoad() {\n    if (!buttonStartStuff)       buttonStartStuff       = document.getElementById(\"button-start-stuff\")\n    if (!buttonClearOutput)      buttonClearOutput      = document.getElementById(\"button-clear-output\")\n    if (!outputElement)          outputElement          = document.getElementById(\"output\")\n\n    buttonStartStuff.addEventListener(\"click\", function() {\n        lastClickTime = new Date().toString()\n        if (db) db.transaction(addClick)\n\n        openTheOtherDatabase()\n\n        if (!started) {\n            buttonStartStuff.value = \"stop stuff\"\n            startStuff()\n        }\n        else {\n            buttonStartStuff.value = \"start stuff\"\n            stopStuff()\n        }\n        started = !started\n    })\n\n    buttonClearOutput.addEventListener(\"click\", function() {\n        outputElement.innerHTML = \"\"\n    })\n\n    openTheDatabase()\n}\n\n//------------------------------------------------------------------------------\nvar interval\n\nfunction startStuff() {\n    if (window.localStorage)   window.localStorage.clear()\n    if (window.sessionStorage) window.sessionStorage.clear()\n\n    storageIndex = 0\n\n    interval = setInterval(intervalStuff, 1000)\n}\n\nfunction stopStuff() {\n    clearInterval(interval)\n}\n\n//------------------------------------------------------------------------------\nfunction intervalStuff() {\n\n    var message = \"doing interval stuff at \" + new Date()\n\n    // add a timeout\n    setTimeout(function() { console.log(message)}, 333)\n\n    // add a timeline marker\n    console.markTimeline(message)\n\n    // write to local- and sessionStorage\n    if (window.localStorage) {\n        var smessage = message + \" (local)\"\n        window.localStorage.setItem(  \"item-\" + storageIndex, smessage)\n    }\n\n    if (window.sessionStorage) {\n        var smessage = message + \" (session)\"\n        window.sessionStorage.setItem(\"item-\" + storageIndex, smessage)\n    }\n    storageIndex++\n\n    // write the message to the page\n    output(message)\n\n    // do an XHR\n    var xhr = new XMLHttpRequest()\n    // xhr.addEventListener(\"readystatechange\", function() {logXhr(this)})\n    xhr.open(\"GET\", \"../target/target-script.js\", true)\n    xhr.send()\n}\n\n//------------------------------------------------------------------------------\nfunction sqlSuccess(tx, resultSet) {\n    console.log(\"SQL Success!\")\n}\n\n//------------------------------------------------------------------------------\nfunction sqlError(tx, error) {\n    console.log(\"SQL Error \" + error.code + \": \" + error.message)\n}\n\n//------------------------------------------------------------------------------\nvar lastClickTime\n\nfunction addClick(tx) {\n    var sql = \"insert into clicks (date) values (?)\"\n    tx.executeSql(sql, [lastClickTime], null, sqlError)\n}\n\n//------------------------------------------------------------------------------\nfunction clearDatabase(tx, resultSet) {\n    var sql = \"delete from clicks\"\n    tx.executeSql(sql, null, null, sqlError);\n}\n\n//------------------------------------------------------------------------------\nfunction createDatabase(tx) {\n    var schema = \"clicks (id integer primary key, date text)\"\n    var sql = \"create table if not exists \" + schema\n\n    tx.executeSql(sql, null, clearDatabase, sqlError);\n}\n\n//------------------------------------------------------------------------------\nfunction createDatabase_other(tx) {\n    var schema = \"clicks_other (id integer primary key, other text)\"\n    var sql = \"create table if not exists \" + schema\n\n    tx.executeSql(sql, null, null, sqlError);\n}\n\n//------------------------------------------------------------------------------\nfunction openTheDatabase() {\n    if (window.openDatabase) {\n        db = window.openDatabase(\"clicks_db\", \"1.0\", \"clicks_db\", 8192)\n        db.transaction(createDatabase)\n    }\n}\n\n//------------------------------------------------------------------------------\nfunction openTheOtherDatabase() {\n    if (otherDB) return\n\n    if (window.openDatabase) {\n        otherDB = window.openDatabase(\"clicks_other_db\", \"1.0\", \"clicks_other_db\", 8192)\n        otherDB.transaction(createDatabase_other)\n    }\n}\n\n//------------------------------------------------------------------------------\nfunction output(string) {\n    var element = document.createElement(\"div\")\n    element.innerHTML = string\n    outputElement.appendChild(element)\n}\n\n//------------------------------------------------------------------------------\nfunction logXhr(xhr) {\n    console.log(\"xhr: readyState: \" + xhr.readyState)\n}\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/demo/weinre-demo.css",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nh1 {\n    color:         green;\n    margin:        0.5em;\n    margin-left:   1.0em;\n    padding:       0.4em;\n    padding-left : 0.8em;\n}\n\n.blue {\n    color: blue;\n}\n\n#metrics {\n    margin:   1em;\n    border:   0.2em solid;\n    padding:  3em;\n}\n\n#button {\n    font-size: 150%;\n}"
  },
  {
    "path": "buildin_modules/weinre/web/demo/weinre-demo.html",
    "content": "<!DOCTYPE html>\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<meta name=\"viewport\" content=\"user-scalable=no, width=device-width, height=device-height\">\n<title>weinre non-minified demo</title>\n<link rel=\"stylesheet\" href=\"weinre-demo.css\">\n<script>try {window.WeinreServerId = location.hash.split(\"#\")[1]} catch(e) {window.WeinreServerId = \"anonymous\"}</script>\n<script src=\"/target/target-script.js\"></script>\n<script src=\"weinre-demo.js\"></script>\n</head>\n\n<body onload=\"onLoad()\">\n<input id=\"button-start-stuff\" type=\"button\" value=\"start stuff\">\n\n<h1>this is a green h1</h1>\n<h1 class=\"blue\">this is a blue h1</h1>\n<h1 style=\"color:red\">this is a red h1</h1>\n<p>Some text, <i>some italic text</i>, and <b>some bold text</b>.\n\n<hr>\n<p><input id=\"button-clear-output\" type=\"button\" value=\"clear output\">\n<div id=\"output\"></div>\n</body>\n\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/demo/weinre-demo.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n// \"use liberal\"\n\n//------------------------------------------------------------------------------\nvar started = false\n\nvar buttonStartStuff\nvar buttonClearOutput\nvar outputElement\nvar storageIndex = 0\nvar db\nvar otherDB\n\n// set the id based on the hash\nvar hash = location.href.split(\"#\")[1]\nif (!hash) hash = \"anonymous\"\nwindow.WeinreServerId = hash\n\n//------------------------------------------------------------------------------\nfunction onLoad() {\n    if (!buttonStartStuff)       buttonStartStuff       = document.getElementById(\"button-start-stuff\")\n    if (!buttonClearOutput)      buttonClearOutput      = document.getElementById(\"button-clear-output\")\n    if (!outputElement)          outputElement          = document.getElementById(\"output\")\n\n    buttonStartStuff.addEventListener(\"click\", function() {\n        lastClickTime = new Date().toString()\n        if (db) db.transaction(addClick)\n\n        openTheOtherDatabase()\n\n        if (!started) {\n            buttonStartStuff.value = \"stop stuff\"\n            startStuff()\n        }\n        else {\n            buttonStartStuff.value = \"start stuff\"\n            stopStuff()\n        }\n        started = !started\n    })\n\n    buttonClearOutput.addEventListener(\"click\", function() {\n        outputElement.innerHTML = \"\"\n    })\n\n    openTheDatabase()\n}\n\n//------------------------------------------------------------------------------\nvar interval\n\nfunction startStuff() {\n    console.log() // test for https://issues.apache.org/jira/browse/CB-8023\n\n    if (window.localStorage)   window.localStorage.clear()\n    if (window.sessionStorage) window.sessionStorage.clear()\n\n    storageIndex = 0\n\n    interval = setInterval(intervalStuff, 1000)\n\n    console.log(\"stuff starting\")\n}\n\nfunction stopStuff() {\n    clearInterval(interval)\n    console.log(\"stuff stopping\")\n}\n\n//------------------------------------------------------------------------------\nfunction intervalStuff() {\n\n    var message = \"doing interval stuff at \" + new Date()\n\n    // add a timeout\n    setTimeout(function() { console.log(message)}, 333)\n\n    // add a timeline marker\n    console.markTimeline(message)\n\n    // write to local- and sessionStorage\n    if (window.localStorage) {\n        var smessage = message + \" (local)\"\n        window.localStorage.setItem(  \"item-\" + storageIndex, smessage)\n    }\n\n    if (window.sessionStorage) {\n        var smessage = message + \" (session)\"\n        window.sessionStorage.setItem(\"item-\" + storageIndex, smessage)\n    }\n    storageIndex++\n\n    // write the message to the page\n    output(message)\n\n    // do an XHR\n    var xhr = new XMLHttpRequest()\n    // xhr.addEventListener(\"readystatechange\", function() {logXhr(this)})\n    xhr.open(\"GET\", \"../target/target-script.js\", true)\n    xhr.send()\n}\n\n//------------------------------------------------------------------------------\nfunction sqlSuccess(tx, resultSet) {\n    console.log(\"SQL Success!\")\n}\n\n//------------------------------------------------------------------------------\nfunction sqlError(tx, error) {\n    console.log(\"SQL Error \" + error.code + \": \" + error.message)\n}\n\n//------------------------------------------------------------------------------\nvar lastClickTime\n\nfunction addClick(tx) {\n    var sql = \"insert into clicks (date) values (?)\"\n    tx.executeSql(sql, [lastClickTime], null, sqlError)\n}\n\n//------------------------------------------------------------------------------\nfunction clearDatabase(tx, resultSet) {\n    var sql = \"delete from clicks\"\n    tx.executeSql(sql, null, null, sqlError);\n}\n\n//------------------------------------------------------------------------------\nfunction createDatabase(tx) {\n    var schema = \"clicks (id integer primary key, date text)\"\n    var sql = \"create table if not exists \" + schema\n\n    tx.executeSql(sql, null, clearDatabase, sqlError);\n}\n\n//------------------------------------------------------------------------------\nfunction createDatabase_other(tx) {\n    var schema = \"clicks_other (id integer primary key, other text)\"\n    var sql = \"create table if not exists \" + schema\n\n    tx.executeSql(sql, null, null, sqlError);\n}\n\n//------------------------------------------------------------------------------\nfunction openTheDatabase() {\n    if (window.openDatabase) {\n        db = window.openDatabase(\"clicks_db\", \"1.0\", \"clicks_db\", 8192)\n        db.transaction(createDatabase)\n    }\n}\n\n//------------------------------------------------------------------------------\nfunction openTheOtherDatabase() {\n    if (otherDB) return\n\n    if (window.openDatabase) {\n        otherDB = window.openDatabase(\"clicks_other_db\", \"1.0\", \"clicks_other_db\", 8192)\n        otherDB.transaction(createDatabase_other)\n    }\n}\n\n//------------------------------------------------------------------------------\nfunction output(string) {\n    var element = document.createElement(\"div\")\n    element.innerHTML = string\n    outputElement.appendChild(element)\n}\n\n//------------------------------------------------------------------------------\nfunction logXhr(xhr) {\n    console.log(\"xhr: readyState: \" + xhr.readyState)\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/Building.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - Building</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - Building</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p>The source repository for weinre is maintained at Apache.  See the\narchives information on the <a href=\"Installing.html\">Installing</a>\npage for more information on downloading a source archive.\n\n<p>If you'd prefer to obtain the source via git, you can use one of the\nfollowing repos:\n\n<ul>\n<li>Apache repo: <td><a href=\"https://git-wip-us.apache.org/repos/asf/cordova-weinre.git\">https://git-wip-us.apache.org/repos/asf/cordova-weinre.git</a>\n<li>GitHub repo: <td><a href=\"https://github.com/apache/cordova-weinre\">https://github.com/apache/cordova-weinre</a>\n</ul>\n\n<p>The Apache repo is the canonical repo. The url can be used in a web\nbrowser, or as the argument of a <tt>git clone</tt> command.\n\n<p>The GitHub repo is a clone of the Apache repo, and automatically shadowed\nat some regular interval.  The url is the web view of the repo, from\nwhich you can obtain a url to use with <tt>git clone</tt>.\n\n<p>See the file\n<tt><a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git;a=blob;f=README.md;hb=HEAD\">README.md<a/></tt>\nin the top-most directory of the source distribution for more instructions on\nhow to perform a build.  A <a href=\"https://github.com/apache/cordova-weinre/blob/master/README.md\">markdown-processed version of the README file\nis available on GitHub</a>.\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/ChangeLog.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - ChangeLog</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - ChangeLog</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<!-- ======================================================================= -->\n<h2>2012/??/?? - version 2.0.0</h2>\n\n<ul>\n\n<li><p>port the server from Java to node.js\n<li><p>lots of other changes\n\n</ul>\n\n<p>issues resolved:\n<ul>\n<li><a href=\"https://issues.apache.org/jira/browse/CB-10\">CB-10</a>     - Apache source headers in callback-weinre\n<li><a href=\"https://issues.apache.org/jira/browse/CB-36\">CB-36</a>     - move/delete GitHub issues at phonegap/weinre and callback/callback-weinre into the Apache Callback JIRA\n<li><a href=\"https://issues.apache.org/jira/browse/CB-83\">CB-83</a>     - implement the server in node\n<li><a href=\"https://issues.apache.org/jira/browse/CB-100\">CB-100</a>   - fix issues regarding pre-req licenses for weinre distribution\n<li><a href=\"https://issues.apache.org/jira/browse/CB-175\">CB-175</a>   - error when XHR contentType is null\n<li><a href=\"https://issues.apache.org/jira/browse/CB-176\">CB-176</a>   - add vendor files to weinre instead of pulling in at build time\n<li><a href=\"https://issues.apache.org/jira/browse/CB-182\">CB-182</a>   - error when XHR contentType is null\n<li><a href=\"https://issues.apache.org/jira/browse/CB-232\">CB-232</a>   - rename assets from PhoneGap to Cordova\n<li><a href=\"https://issues.apache.org/jira/browse/CB-257\">CB-257</a>   - the README.md in the weinre-node distribution is bogus\n<li><a href=\"https://issues.apache.org/jira/browse/CB-259\">CB-259</a>   - create a weinre tarball as a build archive that is npm install-able\n<li><a href=\"https://issues.apache.org/jira/browse/CB-266\">CB-266</a>   - weinre runtime error if you don't have a ~/.weinre/server.settings file\n<li><a href=\"https://issues.apache.org/jira/browse/CB-284\">CB-284</a>   - invocation exception on WeinreClientEventsImpl.connectionCreated(): TypeError: Cannot read property 'url' of undefined\n<li><a href=\"https://issues.apache.org/jira/browse/CB-288\">CB-288</a>   - re-version as 2.0.0\n<li><a href=\"https://issues.apache.org/jira/browse/CB-293\">CB-293</a>   - bullet-proof modjewel\n<li><a href=\"https://issues.apache.org/jira/browse/CB-294\">CB-294</a>   - various exceptions thrown in the target in WeinreTargetEventsImpl.connectionCreated()\n<li><a href=\"https://issues.apache.org/jira/browse/CB-315\">CB-315</a>   - generate valid Apache release artifact names\n<li><a href=\"https://issues.apache.org/jira/browse/CB-540\">CB-540</a>   - ability to easily navigate to particular place in DOM via bookmarks/jump to selector\n<li><a href=\"https://issues.apache.org/jira/browse/CB-604\">CB-604</a>   - weinre doesn't work in strict mode\n<li><a href=\"https://issues.apache.org/jira/browse/CB-873\">CB-873</a>   - setTimeout() and setInterval() usage with string arguments is busted\n<li><a href=\"https://issues.apache.org/jira/browse/CB-984\">CB-984</a>   - cannot install weinre with Node 0.8.0\n<li><a href=\"https://issues.apache.org/jira/browse/CB-1666\">CB-1666</a> - \"INVALID_STATE_ERR: DOM Exception 11\" with chbrody/Cordova-SQLitePlugin\n<li><a href=\"https://issues.apache.org/jira/browse/CB-1759\">CB-1759</a> - doc indicates that you should launch weinre with a command prefix of `node`\n<li><a href=\"https://issues.apache.org/jira/browse/CB-1193\">CB-1193</a> - add Windows Phone support\n<li><a href=\"https://issues.apache.org/jira/browse/CB-1800\">CB-1800</a> - remove references to \"incubator\"\n<li><a href=\"https://issues.apache.org/jira/browse/CB-1494\">CB-1494</a> - Supports running server behind a proxy, such as Heroku Cedar\n<li><a href=\"https://issues.apache.org/jira/browse/CB-2650\">CB-2650</a> - Weinre style inspection breaks with normalize.css\n<li><a href=\"https://issues.apache.org/jira/browse/CB-3319\">CB-3319</a> - Chrome is setting window properties which now breaks Weinre\n<li><a href=\"https://issues.apache.org/jira/browse/CB-3328\">CB-3328</a> - chrome version >= 27 breaks flex-box usage\n<li><a href=\"https://issues.apache.org/jira/browse/CB-3378\">CB-3378</a> - support for FF and IE10\n<li><a href=\"https://issues.apache.org/jira/browse/CB-6991\">CB-6991</a> - Weinre fails to load in browsers without a built-in development console\n<li><a href=\"https://issues.apache.org/jira/browse/CB-7367\">CB-7367</a> - allow update of weinre id in page url without page refresh\n<li><a href=\"https://issues.apache.org/jira/browse/CB-7430\">CB-7430</a> - weinre does not play nice with npm dedupe\n<li><a href=\"https://issues.apache.org/jira/browse/CB-7437\">CB-7437</a> - xhr readystate event passed bad event on some platforms\n<li><a href=\"https://issues.apache.org/jira/browse/CB-7438\">CB-7438</a> - weinre target not setting server url when from script's src attribute for https\n<li><a href=\"https://issues.apache.org/jira/browse/CB-5718\">CB-5718</a> - Detection of HTTPS broken\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2011/12/01 - version 1.6.1</h2>\n\n<ul>\n\n<li><p>Error handling for some built-in callbacks has been removed.  This function\nwas added in version 1.6.0.  Unfortunately, it had some problems, and it wasn't\nclear if the fix was going to make things worse.\n\n</ul>\n\n<p>issues resolved:\n<ul>\n<li> <a href=\"https://issues.apache.org/jira/browse/CB-82\"> apache/callback issue 82</a> - removeEventListener broken\n</uL>\n\n<!-- ======================================================================= -->\n<h2>2011/10/28 - version 1.6.0</h2>\n\n<ul>\n\n<li><p>The Network panel has been added to weinre, which will display information\nfor any XHRs that you issue.\n\n<li><p>Error handling for some built-in callbacks has been added.  The support\nis very similar to what's provided in the\n<a href=\"https://github.com/pmuellr/log-callback-error\">log-callback-error project</a>,\nthough the implementation is different.\n\n<li><p>The element highlighter has been modified to show brighter colors.\nThe colors also now more closely match the Web Inspector colors.\nCurrently, there are some artifacts in the corners in some cases, but it's not\nclear to me this is a huge problem - in fact, maybe it's a feachur.  ~shrug~\nAs part of this clean up, I've made the element highlighter pluggable.  If you\nthink you can do better, it should be pretty straight-forward to code up a\nnew one.  Bring it on.\n\n<li><p>The JavaScript code for weinre has been converted from the \"scoop\" DSL\nformat to CoffeeScript.  You no longer have a valid excuse for not hacking the\ncode.\n\n<li><p>The \"Test Drive\" page of the doc has been removed and replaced with\nthe new \"User Interface\" page.\n\n<li><p>weinre now adds an \"error\" listener to window.  For JavaScript engines\nthat support \"window onerror\", you will now see a message logged to the console\nwhen an error occurs anywhere in your JavaScript code.  Unfortunately, just\nas support for \"window onerror\" is becoming available in JavaScript, the browsers\nare neutering it's support.  Depending on your browser, you may or may not\nsee these errors reported, and even if you do, they may not give you <b>any</b>\nuseful information.  Thanks to Ryan Seddon for supplying the following\nbackgrounder links for your enjoyment:\n\n<ul>\n<li><a href=\"http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033252.html\">http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033252.html</a>\n<li><a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=568564\">https://bugzilla.mozilla.org/show_bug.cgi?id=568564</a>\n<li><a href=\"http://www.w3.org/Bugs/Public/show_bug.cgi?id=14177\">http://www.w3.org/Bugs/Public/show_bug.cgi?id=14177</a>\n<li><a href=\"https://bugs.webkit.org/show_bug.cgi?id=70574\">https://bugs.webkit.org/show_bug.cgi?id=70574</a>\n</ul>\n\n</ul>\n\n<p>issues resolved:\n<ul>\n<li> <a href=\"https://issues.apache.org/jira/browse/CB-1\">   issue apache/callback issue 1</a> - update the doc\n<li> <a href=\"https://github.com/phonegap/weinre/issues/41\"> issue phonegap/weinre 41</a> - add support for XHRs on Network panel\n<li> <a href=\"https://github.com/phonegap/weinre/issues/40\"> issue phonegap/weinre 40</a> - clean up spurious messages in the server console\n<li> <a href=\"https://github.com/phonegap/weinre/issues/38\"> issue phonegap/weinre 38</a> - cleanup some of the exception handler bits\n<li> <a href=\"https://github.com/phonegap/weinre/issues/37\"> issue phonegap/weinre 37</a> - Timeout function does not pass arguments\n<li> <a href=\"https://github.com/phonegap/weinre/issues/35\"> issue phonegap/weinre 35</a> - convert JavaScript in weinre from scoop to CoffeeScript\n<li> <a href=\"https://github.com/phonegap/weinre/issues/20\"> issue phonegap/weinre 20</a> - add support for window.onerror\n<li> <a href=\"https://github.com/phonegap/weinre/issues/19\"> issue phonegap/weinre 19</a> - 404 error on /client/index.html in Mac app (incomplete build?)\n<li> <a href=\"https://github.com/phonegap/weinre/issues/11\"> issue phonegap/weinre 11</a> - provide better error handling - by hook or by crook\n<li> <a href=\"https://github.com/phonegap/weinre/issues/10\"> issue phonegap/weinre 10</a> - element highlighter code in the target is just awful\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2011/07/22 - version 1.5.0</h2>\n\n<ul>\n\n<li><p>The Resources panel now includes an active Databases section.  For any WebSQL\ndatabase that you open, you should see an entry in the expanded section.  For each database,\nyou'll see the list of tables owned by the database when the database section\nis expanded.  Note that you need to open\nthe database to see it listed here.  Databases which you have previously created\nin other browsing sessions will not be displayed until they are first opened.\n\n<p>Clicking on a database table will dump the database contents to the panel.\nClicking on the database itself will provide a prompter for you to run SQL\ncommands against that database.  For example, entering\n<tt>\"select * from YourTableNameHere\"</tt>\nwill dump the table contents to the panel.\n\n<li><p>Some of the console functions, like <tt>console.log()</tt>, were not handling\nobject arguments correctly.  You should now see a an object display.  For example,\ntyping <tt>\"window\"</tt> or <tt>\"console.log(window)\"</tt> into the console\nwill show you the same object display for the window.\n\n<li><p>The ant build script did not have the correctly-cased file names for some\nof the files, and the build failed.  This has been fixed.  You should be able\nto do a build on Linux, and other case-sensitive file systems.\n\n<li><p>While weinre already removes some of the Web Inspector panels wholesale,\nthere were still a number of meaningless gee-gaws on the panels that we do show.\nThose have been surgically removed with CSS.\n\n</ul>\n\n<p>issues closed:\n<ul>\n<li> <a href=\"https://github.com/phonegap/weinre/issues/7\">issue 7</a> - support for WebSQL\n<li> <a href=\"https://github.com/phonegap/weinre/issues/8\">issue 8</a> - console.log() etal don't handle object parameters\n<li> <a href=\"https://github.com/phonegap/weinre/issues/12\">issue 12</a> - wrong-cased file names in ant scripts for Linux\n<li> <a href=\"https://github.com/phonegap/weinre/issues/16\">issue 16</a> - hide stuff in the Web Inspector UI that's not used\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2011/05/09 - version 1.4.0</h2>\n<ul>\n<li> better calculation of object's class name. closes <a href=\"https://github.com/pmuellr/weinre/issues/41\">issue 41</a>.\n<li> initial set of changes in for extensions. closes <a href=\"https://github.com/pmuellr/weinre/issues/8\">issue 8</a>.\n<li> added json2.js to the mix; part of issue <a href=\"https://github.com/pmuellr/weinre/issues/45\">issue 45</a>.\n<li> works with recent scooj release.  closes <a href=\"https://github.com/pmuellr/weinre/issues/52\">issue 52</a>.\n<li> add non-authenticated multi-user support.  closes <a href=\"https://github.com/pmuellr/weinre/issues/50\">issue 50</a>.\nSee <a href=\"MultiUser.html\">the MultiUser doc page</a> for more information.\n</ul>\n\n<p>issues closed:\n<ul>\n<li> <a href=\"https://github.com/pmuellr/weinre/issues/8\">issue 8</a> - enable extensions\n<li> <a href=\"https://github.com/pmuellr/weinre/issues/41\">issue 41</a> - in JSC, inspected object's class is always \"object\"\n<li> <a href=\"https://github.com/pmuellr/weinre/issues/50\">issue 50</a> - add non-authenticated multi-user support\n<li> <a href=\"https://github.com/pmuellr/weinre/issues/52\">issue 52</a> - react to recent modjewel / scooj changes\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2011/04/05 - version 1.3.0</h2>\n<ul>\n<li> style editing now enabled in Elements panel\n<li> localStorage and sessionStorage views enabled in Resources panel\n<li> URLs to vendor repos updated for the weinre build\n<li> check for bad versions of Prototype.js\n</ul>\n\n<p>issues closed:\n<ul>\n<li><a href=\"https://github.com/pmuellr/weinre/issues/21\">issue 21</a> - add support for localStorage\n<li><a href=\"https://github.com/pmuellr/weinre/issues/35\">issue 35</a> - testing local files on IOS\n<li><a href=\"https://github.com/pmuellr/weinre/issues/36\">issue 36</a> - element.style cannot be edited\n<li><a href=\"https://github.com/pmuellr/weinre/issues/44\">issue 44</a> - update vendor repos\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2011/03/12 - version 1.2.0</h2>\n<ul>\n<li> DOM elements are now updated live as they change in the target\n<li> more console support; sprintf formatting and expandable object logging\n</ul>\n\n<p>issues closed:\n<ul>\n<li><a href=\"https://github.com/pmuellr/weinre/issues/27\">issue 27</a> - edge case where programmatically created DOM is only picked up partially\n<li><a href=\"https://github.com/pmuellr/weinre/issues/37\">issue 37</a> - console.log output doesn't do sprintf-style string interpolations\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2011/03/02 - version 1.1.0</h2>\n<ul>\n<li>added Timeline panel; tracks timers, intervals, XHRs, some other events, and\n    <tt>console.markTimeline(<i>string</i>)</tt>\n<li>now showing matching style rules in Elements panel\n<li>no more diagnostic messages in the user's console; they are now written\n    to the server console\n<li>caught up to a more recent version of Web Inspector\n<li>refactoring, technical debt paydown\n</ul>\n\n<p>issues closed:\n<ul>\n<li><a href='https://github.com/pmuellr/weinre/issues/10'>issue 10</a> - enable Timeline panel, and provide some events\n<li><a href='https://github.com/pmuellr/weinre/issues/20'>issue 20</a> - catch up to latest Web Inspector code base\n<li><a href='https://github.com/pmuellr/weinre/issues/23'>issue 23</a> - mac app's web pages can't connect to server\n<li><a href='https://github.com/pmuellr/weinre/issues/24'>issue 24</a> - weinre server runs slowly on windows\n<li><a href='https://github.com/pmuellr/weinre/issues/25'>issue 25</a> - pay down technical debt\n<li><a href='https://github.com/pmuellr/weinre/issues/28'>issue 28</a> - create a standalone Java launch\n<li><a href='https://github.com/pmuellr/weinre/issues/29'>issue 29</a> - autoconnect does not always work\n<li><a href='https://github.com/pmuellr/weinre/issues/30'>issue 30</a> - all-json-idls.js is a pig\n<li><a href='https://github.com/pmuellr/weinre/issues/31'>issue 31</a> - redirect error/warn/info/debug messages from client and target to server\n<li><a href='https://github.com/pmuellr/weinre/issues/32'>issue 32</a> - monospace font too small everywhere\n<li><a href='https://github.com/pmuellr/weinre/issues/33'>issue 33</a> - update doc\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2011/01/25 - version 1.0.0</h2>\n<ul>\n<li> Don't display \"not implemented\" messages. Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 19</a>.\n<li> Remove node highlighting cruft.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 18</a>.\n<li> Add meta element to enable GCF for client. Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 17</a>.\n<li> Make bookmarklet more portable.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 16</a>.\n<li> Enable node highlighting.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 2</a>.\n<li> Change copyright statements.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 13</a>.\n<li> Change Weinre.Console to Console.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 11</a>.\n<li> Add implementation for settings.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 5</a>.\n<li> Provide better escape for // comments in minifier.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 6</a>.\n<li> Get metrics working in Elements panel.  Closes <a href=\"https://github.com/pmuellr/weinre/issues/1\">issue 1</a>.\n</ul>\n\n<!-- ======================================================================= -->\n<h2>2010/12/16 - version 0.9.9</h2>\n\n<ul>\n<li>initial release\n</ul>\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/Home.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - Home</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - Home</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p><span class=\"weinre\">weinre</span> is <b>WE</b>b <b>IN</b>spector <b>RE</b>mote.\nPronounced like the word \"winery\".  Or maybe like the word \"weiner\".  Who knows,\nreally.\n\n<p><span class=\"weinre\">weinre</span> is a debugger for web pages, like\nFireBug (for FireFox)\nand\nWeb Inspector (for WebKit-based browsers), except it's designed\nto work <b>remotely</b>, and in particular, to <b>allow you debug web pages\non a mobile device such as a phone</b>.\n\n<div class=\"note\">\n  <p><h3>Do you need to use weinre?</h3>\n\n  <p>weinre was built in an age when there were <b>no</b> remote debuggers\n    available for mobile devices.  Since then, some platforms are starting to\n    provide remote debugger capabilities, as part of their platform tool set.\n\n  <table border=0 cellpadding=5 cellspacing=0>\n\n    <tr><td valign=top>Android:\n    <td><a href=\"https://developer.chrome.com/devtools/docs/remote-debugging\">\n      Remote Debugging on Android with Chrome\n    </a>\n\n    <tr><td valign=top>iOS:\n    <td><a href=\"https://developer.apple.com/library/safari/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html\">\n      Enabling Web Inspector for iOS\n    </a>\n\n    <tr><td valign=top>Firefox&nbsp;OS:\n    <td><a href=\"https://developer.mozilla.org/en-US/Firefox_OS/Debugging\">\n      Debugging on Firefox OS\n    </a>\n\n    <tr><td valign=top>Windows&nbsp;Phone:\n    <td><a href=\"http://msdn.microsoft.com/en-us/library/dn757061.aspx\">\n      Debug Your App Built with Visual Studio Tools for Apache Cordova\n    </a>\n    <i>\n      (note: as of 2015/01/15, that page suggests weinre as the debugger for Windows Phone)\n    </i>\n\n  </table>\n</div>\n\n<p>Interesting places to visit:\n<table>\n\n<tr><td>videos at YouTube:\n<td><a href=\"http://www.youtube.com/results?search_query=weinre\">http://www.youtube.com/results?search_query=weinre</a>\n\n<tr><td>this documentation:\n<td><a href=\"http://people.apache.org/~pmuellr/weinre/\">http://people.apache.org/~pmuellr/weinre/</a> [temporary]</a>\n\n<tr><td>unofficial binary packages:\n<td><a href=\"http://people.apache.org/~pmuellr/weinre/\">http://people.apache.org/~pmuellr/weinre/</a> [temporary]</a>\n\n<tr><td>issues:\n<td><a href=\"https://issues.apache.org/jira/secure/IssueNavigator.jspa?jqlQuery=project=CB+and+component=weinre\">https://issues.apache.org/jira/gobble-de-gook/...</a>\n\n<tr><td>create a new issue:\n<td>\n<a href=\"https://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12312420&components=12316604&issuetype=1\">bug</a>\nor\n<a href=\"https://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12312420&components=12316604&issuetype=2\">new feature</a>\n\n<tr><td>cloneable source at Apache:\n<td><a href=\"https://git-wip-us.apache.org/repos/asf/cordova-weinre.git\">https://git-wip-us.apache.org/repos/asf/cordova-weinre.git</a>\n\n<tr><td>Apache repo cloned at GitHub:\n<td><a href=\"https://github.com/apache/cordova-weinre\">https://github.com/apache/cordova-weinre</a>\n\n<tr><td>mailing lists at Apache:\n<td><a href=\"http://mail-archives.apache.org/mod_mbox/cordova-dev/\">http://mail-archives.apache.org/mod_mbox/cordova-dev/</a> (for weinre development)\n\n<tr><td>discussion at Google Group:\n<td><a href=\"http://groups.google.com/group/weinre\">http://groups.google.com/group/weinre</a> (for weinre usage)\n\n</table>\n\n<p>More information on <span class=\"weinre\">weinre</span>'s big brothers, Web Inspector / Google Chrome\nDeveloper Tools, is available at\n<a href=\"http://code.google.com/chrome/devtools/docs/overview.html\">Google's Chrome Dev Tools pages</a>\nand\n<a href=\"http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/Safari_Developer_Guide/DebuggingYourWebsite/DebuggingYourWebsite.html\">Apple's Web Inspector pages</a>.\n\n<p>If you aren't familiar with FireBug or Web Inspector,\n<span class=\"weinre\">weinre</span> isn't going to make too much sense to you.\n<span class=\"weinre\">weinre</span> reuses the user interface code from the\n<a href=\"http://trac.webkit.org/wiki/WebInspector\">Web Inspector project at WebKit</a>,\nso if you've used Safari's Web Inspector or Chrome's Developer Tools,\n<span class=\"weinre\">weinre</span> will be very familiar.  If you're not\nfamiliar with Web Inspector, the links above to Google's and Apple's documentation\nwill be useful.\n\n<p>Here's an example session using <span class=\"weinre\">weinre</span>:\n\n<p><img src=\"images/weinre-demo.jpg\">\n\n<p>Two screen captures are shown above.  On the left is the\n<span class=\"weinre\">weinre</span> <b>client</b> application, displaying debug\ninformation.\nOn the right is the <b>target</b> web page, running in Mobile Safari in the iOS Simulator.\n\n<p>In normal usage, you will be running the <b>client</b> application in a browser\non your desktop/laptop, and running a <b>target</b> web page on your mobile device.\n\n<p>In the session above, the debugger is display the Elements panel, with the\nembedded console expanded in the bottom third of the window.  In the console\narea, we've entered two statements:\n\n<pre>\ndocument.body.style.backgroundColor\ndocument.body.style.backgroundColor = \"pink\"\n</pre>\n\n<p>The result of running the first statement shows the value of the body's background style is not set.\nThe second statement sets the body's background to pink.  That horrifying pink\nbackground is then rendered in the <b>target</b>'s window.\n\n<p>In addition, an <tt>h1</tt> element is selected in the upper third of the\nElements panel, which causes the side panels on the right to be filled in with\nrelevant information.  In this case, the matched CSS rules for that <tt>h1</tt>\nelement are being shown.\n\n<p>If you are familiar with WebKit's Web Inspector,\na partial list of differences between it and <span class=\"weinre\">weinre</span>\nare listed below:\n\n<ul class=\"spaced\">\n\n<li><span class=\"weinre\">weinre</span> does not make use of any 'native' code\nin the browser, it's all plain old boring JavaScript.\n\n<li>Because <span class=\"weinre\">weinre</span> doesn't use 'native' code,\nit's functionality is limited.  For instance, source level debug of JavaScript\nis not <span class=\"strike\">possible</span>\n<a href=\"http://lexandera.com/aardwolf/\">easy</a>.\n\n<li>Because <span class=\"weinre\">weinre</span> doesn't use 'native' code,\nthe debug target code will run on browsers\nwithout specialized debug support.  For instance, a browser running on your phone.\n\n<li><span class=\"weinre\">weinre</span> supports 'remote' interaction,\nso you can run the debugger user interface on one\nmachine and can debug a web page running\non another machine.  For instance, debug a web page displayed on your phone from your\nlaptop.\n\n<li>Because <span class=\"weinre\">weinre</span> supports 'remote' interaction,\nmultiple debug clients can be debugging the same debug target at the same time.\n\n<li>One thing <b>not</b> different from Web Inspector is that the debug client\nuser interface only runs on WebKit-based browsers.\n\n</ul>\n\n<!-- ======================================================== -->\n<h2>Supported Libraries and Platforms</h2>\n\n<p>Generally version numbers listed here are the earliest\nversions of the relevant thing that have been tested.\nLater versions of those things are also hopefully supported,\nbut let us know.\n\n<h3>Libraries not supported</h3>\n\n<ul>\n<li>versions of Prototype.js before version 1.7 are not supported,\nas they do not support the <tt>JSON.stringify()</tt> API correctly.  You\nwill get an <tt>alert()</tt> in the web page you are debugging if you\nattempt to debug it with <span class=\"weinre\">weinre</span> and you are using an unsupported\nversion of Prototype.js.\n</ul>\n\n<h3>Platforms supported - debug server</h3>\n<p>Any platform that supports <a href=\"http://nodejs.org/\">node.js</a>.\n\n<h3>Platforms supported - debug client</h3>\n<p>The browser where the debugger user interface runs.\n\n<ul>\n<li>Google Chrome\n<li>Apple Safari\n<li>Other recent-ish WebKit-based browsers\n</ul>\n\n<h3>Platforms supported - debug target</h3>\n<p>The browser with the page you are debugging.\n\n<ul>\n<li>Android Browser application\n<li>iOS Mobile Safari application\n<li>PhoneGap/Cordova\n<li>other\n</ul>\n\n<h3>Platforms not supported - debug target</h3>\n\n<ul>\n<li>iOS 3.1.3 or earlier\n<li>webOS 1.45 or earlier\n</ul>\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/Installing.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - Installing</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - Installing</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p><span class=\"weinre\">weinre</span> is implemented as a\n<a href=\"http://nodejs.org/\">node.js</a> application, and so you'll\nneed to <a href=\"http://nodejs.org/download/\">download and install\na node runtime</a> to run <span class=\"weinre\">weinre</span>.\n\n<p>To install <span class=\"weinre\">weinre</span>, use <tt>npm</tt>,\nor download a binary package. <span class=\"weinre\">weinre</span> is not\nsensitive to the directory it's installed in, and does not\nwrite to any files.\n\n<!-- ======================================================================= -->\n<h2>npm installation</h2>\n\n<p><span class=\"weinre\">weinre</span> can be installed as an\n<a href=\"http://npmjs.org/doc/README.html\">npm package</a>.  The\n<tt>*-bin.tar.gz</tt> urls/files for binary packages\ncan be used as a target of the\n<a href=\"http://npmjs.org/doc/install.html\"><tt>npm install</tt></a>\ncommand.\n\n<p>It's likely you will want to install <span class=\"weinre\">weinre</span>\nglobally instead of locally (in the <tt>npm</tt> sense), which means you\nwill typically want to use the <tt>npm -g</tt> option to install.  For\n*ix and Mac, this also means prefixing your command with sudo.  For Windows,\nAFAIK, you don't need sudo or any equivalent.\n\n<p>Here's an example of installing from a binary package via URL:\n\n<pre>\nsudo npm -g install http://example.com/path/to/apache-cordova-weinre-X.Y.Z-bin.tar.gz\n</pre>\n\n<p><span class=\"weinre\">weinre</span> is also deployed on\n<a href=\"https://npmjs.org/package/weinre\">https://npmjs.org/package/weinre</a>\nso that you can install it via:\n\n<pre>\nsudo npm -g install weinre\n</pre>\n\n<!-- ======================================================================= -->\n<h2>Binary Packages</h2>\n\n<!--\n<p>The recent source and binary release archives should be available at:\n\n<ul>\n<li><a href=\"http://www.apache.org/dyn/closer.cgi/incubator/cordova\">http://apache.org/dist/incubator/cordova/</a>\n<br><b><i>(at the time of this writing, that link does not actually resolve because\nthere are no official releases)</i></b>\n</ul>\n\n<p>All of the source and binary release archives should be available at:\n\n<ul>\n<li><a href=\"http://archive.apache.org/dist/incubator/cordova/\">http://archive.apache.org/dist/incubator/cordova/</a>\n<br><b><i>(at the time of this writing, that link does not actually resolve because\nthere are no official releases)</i></b>\n</ul>\n-->\n\n<p>Unofficial binary packages for your convenience:\n\n<ul>\n<li><a href=\"http://people.apache.org/~pmuellr/weinre/\">http://people.apache.org/~pmuellr/weinre/</a>\n</ul>\n\n<p>The binary packages available are:\n\n<ul>\n<li><tt>apache-cordova-weinre-{version}-bin.tar.gz</tt>\n<li><tt>apache-cordova-weinre-{version}-bin.zip</tt>\n<li><tt>apache-cordova-weinre-{version}-doc.tar.gz</tt>\n<li><tt>apache-cordova-weinre-{version}-doc.zip</tt>\n<li><tt>apache-cordova-weinre-{version}-src.tar.gz</tt>\n<li><tt>apache-cordova-weinre-{version}-src.zip</tt>\n</ul>\n\n<p>The difference between the <tt>.tar.gz</tt> and <tt>.zip</tt>\narchives is the archive format only.  When expanded, both archives\nproduce the same files.\n\n<p>The <tt>doc</tt> archives contain the stand-alone HTML documentation\n<p>The <tt>src</tt> archives contain the ready-to-rebuild source\n<p>The <tt>bin</tt> archives contain the ready-to-run binaries\n\n<p>If the <tt>{version}</tt> contains a moniker like <tt>pre</tt>, this\nis indicative of an unofficial, non-final binary package for your convenience,\nas opposed to an official release.\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/License.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - License</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - License</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p>Source specific to <span class=\"weinre\">weinre</span> is all licensed under the\n<a href=\"http://www.apache.org/licenses/LICENSE-2.0\">Apache License, Version 2.0</a>.\n\n<p><span class=\"weinre\">weinre</span> also makes use of third party code;\nthe licensing details for those is available in the\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git;a=blob;f=LICENSE;hb=HEAD\">LICENSE</a>\nfile in the top-most directory of the source distribution.\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/MultiUser.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - Muli-User</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - Muli-User</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p><span class=\"weinre\">weinre</span> was originally designed so that each user\nthat wanted to use <span class=\"weinre\">weinre</span> would run their own\n<span class=\"weinre\">weinre</span> server.  The system has since been enhanced\nto support muliple users using the same server.\n\n<!-- ======================================================== -->\n<h2>Your debug id</h2>\n\n<p>To use a multi-user server, you'll need to select an id for yourself.  This\nid will be used in the client and target URLs of <span class=\"weinre\">weinre</span>\nto scope your clients and targets from the clients and targets of other users.\n\n<p>There is no password, just an id.  There is no real security here.\nThe id is a secret shared between your\ndebug target and client, but it is sent in the clear when your target and\nclient connect to the server.  If someone else knows your <b>id</b>, they can\nconnect to clients or targets you are running with that <b>id</b>.\n\n<p>So don't give your <b>id</b> to anyone else that you don't want to share\nwith.\n\n<p>To keep your <b>id</b>'s familar but non-guessable, you might use a string\nconsisting of your typical userid, followed by a dash, followed by another\nstring not likely to be guessed by other people.\n\n<p>If you are paranoid, you can change your <b>id</b> every time you start\na debug session, of course.\n\n<!-- ======================================================== -->\n<h2>Using your id with the client</h2>\n\n<p>Typically when start a <span class=\"weinre\">weinre</span> client session\nby visiting a URL like\n\n<pre>\nhttp://some.server.xyz/client/\n</pre>\n\n<p>To start\na client with a particular id, append the hash character (<code>#</code>) and\nthe id you want to use the URL.  For instance, to connect with the id\n<code>itsReallyMe</code>, launch the client with the URL\n\n<pre>\nhttp://some.server.xyz/client/#itsReallyMe\n</pre>\n\n<p>The id which is used will be displayed\nin the connected clients list for each connected client.\n\n<!-- ======================================================== -->\n<h2>Using your id with the target</h2>\n\n<p>As with the server, append the hash character (<code>#</code>) to the\nURL of the script being injected into your web page.  If you had previously\nused a &lt;script src&gt; element of:\n\n<pre>\n&lt;script src=\"http://some.server.xyz/target/target-script-min.js\"&gt;&lt;/script&gt;\n</pre>\n\n<p>use this script element to connect with id <code>itsReallyMe</code>\n\n<pre>\n&lt;script src=\"http://some.server.xyz/target/target-script-min.js#itsReallyMe\"&gt;&lt;/script&gt;\n</pre>\n\n<!-- ======================================================== -->\n<h2>Notes</h2>\n\n<ul class=\"spaced\">\n\n<li>The <span class=\"weinre\">weinre</span> server always runs in multi-user\nmode.  If you don't otherwise specify an <b>id</b>, the value of\n<code>anonymous</code> will be used for the <b>id</b>.\n\n<li>The <b>id</b> is passed in the HTTP body of a POST request during the\ninitial connection of the target and client to the server, and is not sent\nthereafter.  Thus, it should remain out of view in server logs and the like,\nthough it will be visible for anyone who has access to the contents of\nHTTP request bodies.\n\n<li>There is no programmatic interface in <span class=\"weinre\">weinre</span>\nto list <b>id</b>'s in current use, for security reasons.  From the Remote panel\nof weinre, each connected client and target have their channel and id's listed,\nif you can't remember what id you used with the client.\n\n</ul>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/Running.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - Running</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - Running</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p>This page describes how to use <span class=\"weinre\">weinre</span> to debug\nyour own web pages on a remote device.\n\n<p>First, some background.\n\n<!-- ======================================================== -->\n<h2>Terminology</h2>\n\n<p>When using <span class=\"weinre\">weinre</span>, there are three programs interacting with\neach other.\n\n<dl class=\"spaced\">\n\n<dt>Debug Server\n<dd>This is the HTTP server that you run from the <tt>weinre-node</tt> distribution.\nIt's the HTTP server that's used by the\n<b>Debug Client</b> and <b>Debug Target</b>.\n\n<dt>Debug Client\n<dd>This is the Web Inspector user interface; the web page which\ndisplays the Elements and Console panels, for instance.\n\n<dt>Debug Target\n<dd>This is your web page that you want to debug.  This\nname (Debug Target) is also used to refer to the machine\nrunning the browser displaying the web page.  Since a design\npoint of <span class=\"weinre\">weinre</span> is to allow\ndebugging applications on mobile devices, the debug\ntarget, when speaking of the machine, is your mobile\ndevice.\n\n</dl>\n\n<p>Both the <b>Debug Client</b> and the <b>Debug Target</b> communicate to\nthe <b>Debug Server</b> via HTTP using <tt>XMLHttpRequest</tt> (XHR).\n\n<p>Typically, you run both the <b>Debug Client</b> and the <b>Debug Server</b>\non your desktop/laptop, and the <b>Debug Target</b> on your mobile device.\n\n<p>The <b>Debug Target</b> is the squirrelliest bit.  You\nwill need to arrange to inject some JavaScript code, provided\nby the <b>Debug Server</b>, into your web page, in order for it\nto function as a <b>Debug Target</b>.\n\n<!-- ======================================================== -->\n<h2>Running the debug server using an <tt>npm</tt> installation</h2>\n\n<p>To run <span class=\"weinre\">weinre</span> from an <tt>npm</tt>\ninstallation, assuming you've installed it globally (in the <tt>npm</tt>\nsense), execute the following command:\n\n<pre>\nweinre [options]\n</pre>\n\n<p>The server will run until you kill it.  Control-C will do the job.\n\n<p>Options available are:\n\n<ul class=\"spaced no-bullet\">\n\n<li><tt>--help</tt> (or <tt>-?</tt> or <tt>-h</tt>)\n<div class=\"indent\">\n<p>Display this help.\n</div>\n\n<li><tt>--httpPort [portNumber]</tt>\n<div class=\"indent\">\n<p>The port to run the HTTP server on.\n<p>Default: <tt>8080</tt>\n</div>\n\n<li><tt>--boundHost [hostname | ip address | -all-]</tt>\n<div class=\"indent\">\n<p>The ip address to bind the server to.\n<p>Default: <tt>localhost</tt>\n\n<p>With the default of <tt>localhost</tt>, you won't be able to access\nthe server from any machine other than the one the server is running on.  You will\nneed to bind to another hostname / ip address to make the server accessible to other\nmachines.  You can use the value <tt>-all-</tt> to indicate that you\nwant to bind to all interfaces available on the current machine.\n\n<p>Use <tt>ifconfig</tt> on Linux or the Mac, and <tt>ipconfig</tt>\non Windows, to get the ip addresses available on your machine.\n</div>\n\n<li><tt>--verbose [true | false]</tt>\n<div class=\"indent\">\n<p>Causes jibberish to be written to stdout\n<p>Default: <tt>false</tt>\n</div>\n\n<li><tt>--debug [true | false]</tt>\n<div class=\"indent\">\n<p>Causes even more jibberish to be written to stdout\n<p>Default: <tt>false</tt>\n</div>\n\n<li><tt>--readTimeout [seconds]</tt>\n<div class=\"indent\">\n<p>The number of seconds the server will wait for a message\nto be available to send to the target or client.\n<p>Default: <tt>5</tt>\n\n<p>Can probably be set larger, but then your browser may\ntime out.  Probably don't want to set it much lower than\nthis as it will cause additional network traffic when\nno messages are being sent (it will cause more \"empty\"\nmessages to be sent).\n</div>\n\n<li><tt>--deathTimeout [seconds]</tt>\n<div class=\"indent\">\n<p>The number of seconds to wait to hear back from a\ndebug client or target before declaring them dead.\n<p>Default: <tt>3 * readTimeout</tt>\n\n<p>Normally the default will be fine.  However, if\nyou're debugging <span class=\"weinre\">weinre</span> itself, you may wish to set\nit much longer.\n</div>\n\n</ul>\n\n<!-- ======================================================== -->\n<h2>The <tt>~/.weinre/server.properties</tt> file</h2>\n\n<p>You may also create a file named\n<tt>server.properties</tt> in the\ndirectory <tt>.weinre</tt> in your\nhome directory (eg.\n<tt>~/.weinre/server.properties</tt>).\nYour home directory is the determined by the value of either the\n<tt>HOME</tt> or <tt>USERPROFILE</tt> environment variable.\n\n<p>The keys should be\nthe same as the name of the options above,\nwith the same values.\n\n<p>As an example, your <tt>~/.weinre/server.properties</tt>\nfile might look like this:\n\n<pre>\nboundHost:    -all-\nhttpPort:     8081\nreuseAddr:    true\nreadTimeout:  1\ndeathTimeout: 5\n</pre>\n\n<p>Command-line options override the options specified in the\n<tt>~/.weinre/server.properties</tt> file.\n\n<!-- ======================================================== -->\n<h2>Running the debug server bound to something other than <tt>localhost</tt></h3>\n\n<p>Since the web page you want to debug (the debug target) is probably running on\na different machine (your mobile device) than the debug server (your desktop / laptop),\nyou <b>can't</b> use the\ndefault <tt>localhost</tt> value for the <tt>--boundHost</tt>\noption.  Instead, you will need to specify a host name / ip address\nwith the <tt>--boundHost</tt> option.  This host name / ip address\nmust be accessible to the machine you want to use as the\ndebug target.\n\n<p>To get started, you can use the value <tt>-all-</tt> for the\n<tt>--boundHost</tt> option.\n\n<p>Now you'll need to figure out what host name / ip address the\ndebug target should use.  If you've use the\n<tt>--boundHost -all-</tt> option, then bring up the debug client\nusing the URL <tt>http://localhost:[portNumber]/client/</tt>\nfrom the same machine the debug server is running on.  On that\npage, under <b>Server Properties</b>, is a list of bound hosts\nthat the server believes it's available on.\n\n<p>From the debug target device (eg, your mobile device),\ntry accessing the server home page\nfrom all of those host names, using the URL\n<tt>http://[host name / ipaddress]:[portNumber]/</tt>.\nOnce you find one\nthat displays the server's home page correctly, remember\nthat host name / ip address, we'll be using it in a minute.\n\n<div class=\"note\">\n<p>When you run the debug server with a bound host other than\n<tt>localhost</tt>, by definition other machines can now access\nyour debug server.  See the <a href=\"Security.html\">Security page</a>\nfor information on how to protect yourself.\n</div>\n\n<!-- ======================================================== -->\n<h2>Instrumenting your web page to act as a debug target</h3>\n\n<p>At this point you now have a URL to the debug server which\nwill be accessible from the debug target.  Let's say that URL\n(to the debug server's home page) is:\n<tt>http://a.b.c:8081</tt>.\n\n<p>To make your web page debuggable with <span class=\"weinre\">weinre</span>,\nadd the following line to your web page:\n<pre>\n&lt;script src=\"http://a.b.c:8081/target/target-script-min.js\"&gt;&lt;/script&gt;\n</pre>\n\n<p>You can now open a debug client by browsing to\n<tt>http://a.b.c:8081/client</tt>\n(or probably\n<tt>http://localhost:8081/client</tt>\nas well) on your desktop/laptop,\nthen reload your newly instrumented web page on your mobile device,\nand see the two connect in the Remote panel of the debug client.\n\n<!-- ======================================================== -->\n<h2>Hardcoding host names / IP addresses in your web page?</h3>\n\n<p>Yeah, gross.\n\n<p>Besides being gross, there are a few practical problems with hardcoding the\ndebug server address in your web page as well:\n\n<ul class=\"spaced\">\n\n<li>Your html file is probably stored in an SCM, and you\ndon't really want to be storing that address in the SCM.\nIt won't work for other people using that html file,\nfor instance.\n\n<p>But you don't want to be keeping the\n<tt>&lt;script src=\"\"></tt> line in your SCM either.\nYou should look for a way, as part of your personal\nbuild process to add that line only for development\nbuilds, and presumably with a user-customizable URL.\n\n<li>The URL the debug server runs on may be\ndifferent depending on your location.  At work, you may use\none IP address and host name; at home, you likely have a different\nIP address and host name.  You may not have a host name at all,\njust an IP address (which is fine - a host name isn't required,\nbut usually makes things easier).  You may be running on a\ndynamically assigned IP address, in which case your IP\nchanges every time you log into your network.\n\n<p>One way out of the dilemma is to use a dynamic\nDNS solution for the the machine you run the debug server on.\nDoing a web search on the following terms will provide you\nsome links to such services:\n<a href=\"http://www.google.com/search?q=dynamic+dns+static+hostname\">dynamic dns static hostname</a>\n\n<p>If you use one of these dynamic DNS services, you\ncan arrange to use the same host name for your debug server\nno matter what network you are connected to.\n\n</ul>\n\n<!-- ======================================================== -->\n<h2>Using a bookmarklet</h2>\n\n<p>Some platforms support 'bookmarkets', which allow you to inject\narbitrary JavaScript code into any web page running in your\nbrowser.  Mobile Safari is one of these browsers.  It appears that\nthe browser shipped with Android 2.2 and later also supports bookmarklets.\n\n<p>Unfortunately, installing bookmarkets on mobile devices isn't usually trivial.  The easiest\ncourse of action is to add a new random bookmark to your bookmarks,\nand then edit it by hand to change the label and URL.  The URL\nyou should use is available in both a 'pre' and 'textarea' section\nof the server's home page (eg, http://localhost:8081/).  You should\nbe able to select the text from one of these areas easily, to\npaste into the previously added bookmark.\n\n<p>Once the bookmarklet is installed, you can debug any web page\nby visiting it, and selecting the bookmarklet from your bookmarks\nmenu.\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/Security.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - Security</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - Security</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p>About security for <span class=\"weinre\">weinre</span>: <b>there is none</b>.\n\n<p>Obviously there should be some.  The question is, what do we need to do?\n\n<!-- ======================================================== -->\n<h2>Background and potential exposures</h2>\n\n<p>Currently <span class=\"weinre\">weinre</span> uses plain old HTTP - not HTTPS - and provides\nno level of authentication for requests.\n\n<p>The primary security exposure with <span class=\"weinre\">weinre</span> is via\nthe debug server.\n\n<p>Currently, the server only reads files from the weinre-node distribution,\nand from the <tt>~/.weinre/</tt> directory (for property files).\nThe only thing the server writes to is <tt>stdout</tt> and <tt>stderr</tt>.\n\n<p>If you use the default <tt>--boundHost</tt> option value of\n<tt>localhost</tt>, then any software on the machine running the debug\nserver can communicate with the debug server.  This probably isn't a big\ndeal, since presumably you control the software running on that machine.\n\n<p>If you use a non-default <tt>--boundHost</tt> option value,\nthen <b>any software on any machine that can access that specified\nhost can communicate with the debug server</b>.  This is a much bigger\ndeal.\n\n<p>The most obvious exposure with using <tt>--boundHost</tt> and\na specific hostname / ip address, is that any debug client or\ndebug target that can access that hostname / ip address can access\nthe server.  For example, a rogue debug client could connect to\nyour debug target and fiddle about with it.\n\n<p>Other exposures include leaving a debug target injection\nscript line (ie, <tt>&lt;script src=\"[...]/target/target-script.js\"&gt;</tt>)\nin your web page, and then that web page connects to a rogue debug\nserver running at that address.\n\n<!-- ======================================================== -->\n<h2>Future Implementation Ideas</h2>\n\n<ul class=\"spaced\">\n\n<li>Let's chat\n\n</ul>\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/UserInterface.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - User Interface</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - User Interface</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p>This page describes the user interface provided by <span class=\"weinre\">weinre</span>.\n\n<!-- ======================================================================= -->\n<h2>the server home page</h2>\n\n<p><img src=\"images/server-home.png\">\n\n<p>The server home page is accessed at the root URL of the server, in this case\n<tt>http://localhost:8081/</tt>.\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>This link will launch the\n<span class=\"weinre\">weinre</span> client page, which is the debugger itself.\nClicking this link will take you to the Remote panel, described below.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-b.png\">\n<td>This is the URL of the script that you add to your\nweb page to allow it to be debugged by the client.\n</table>\n\n<p>Additional links shown in this image are for this documentation, and some demo\npages.\n\n<p>Further down on the page, not shown in the image, are:\n\n<ul>\n<li>The text of the <tt>&lt;script src=&gt;</tt> element you can copy and paste into your\nweb page.\n<li>The source for a bookmarklet, to inject the debug code into any web\npage displayed in your browser.\n<li>Version numbers of <span class=\"weinre\">weinre</span> and it's components.\n</ul>\n\n<!-- ======================================================================= -->\n<h2>the Remote panel</h2>\n\n<p><img src=\"images/panel-remote.png\">\n\n<p>The Remote panel is the initial panel of <span class=\"weinre\">weinre</span>,\nand displays some status regarding the server.\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>The top portion of all of the\n<span class=\"weinre\">weinre</span> panels shows the panel switcher.  To switch\nto a different panel, click on the panel's button.  The current panel is displayed with\na highlight, as shown above for the Remote panel.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-b.png\">\n<td>The Targets section of this page lists targets that are currently connected\nto the server.  A target is a web page that you are debugging.\nIn this case, there is one target connected the server.  Information\nabout each target is displayed in the list, including host name / ip address, and\nthe URL the target is displaying.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-c.png\">\n<td>The Clients section of this page lists the clients that are currently connected\nto the server.  A client is this user interface. Typically, there is just one - the client you are displaying\nat the time.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-d.png\">\n<td>The Server Properties section of this page displays the values of various server\nproperties currently in effect.  Shown here are the hosts that are bound to the\nserver - which host names / ip addresses that the server will respond to.\n</table>\n\n<p>The colors of the entries in the Targets and Clients list indicates their\nstatus.  Blue means the Target or Client is connected to the server, but not\nyet connected to a peer.  Green means the Target or Client is connected to a\npeer, and you can start debugging.  Red means the Target or Client has\ndisconnected from the server, and will eventually fade away and be removed\nfrom the list.\n\n<p>In case there are multiple targets connected, you can switch which one you\nare debugging by clicking on the item.\n\n<!-- ======================================================================= -->\n<h2>the Elements panel</h2>\n\n<p><img src=\"images/panel-elements.png\">\n\n<p>The Elements panel displays your HTML DOM in a tree fashion, and properties\nassociated with selected elements.\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>The elements themselves may be expanded/collapsed via the disclosure buttons.\nElements and text can be edited by double-clicking the item to be edited.\nElements can also be deleted by selecting the element and then pressing the\ndelete button.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-b.png\">\n<td>The sidebar area displays information about the selected element.  In this case,\nthe Styles sidebar is expanded, showing relevant CSS rules.  Some sidebars allow\nediting of the contents.  The Styles sidebar in particular allows you to add, edit\nand remove properties and values by double clicking on them.\n</table>\n\n<!-- ======================================================================= -->\n<h2>the Resources panel</h2>\n\n<p><img src=\"images/panel-resources.png\">\n\n<p>The Resources panel shows WebSQL databases, and data stored in Local Storage\nand Session Storage.\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>The left hand side of the Resources panel is the navigator. Expanding\nthe Databases entry will show all the Web SQL databases currently in use.\nExpanding a particular database will show all the tables in that database.\n\n</table>\n\n<p><table><tr><td><img src=\"images/circled-b.png\">\n<td>The right hand side is the editor/viewer for whatever is selected in the\nnavigator pane.\nWhen a database is selected, a prompt will appear in the editor/viewer area\nwhere you can enter SQL statements to be executed.  The results are displayed\ninline.  When a table is selected, all the rows from the table will be displayed.\nWhen a Local Storage or Session Storage entry is selected, all the relevant keys\nand values will be displayed.  The keys and values in the Local Storage and\nSession Storage tables can be edited by double-clicking.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-c.png\">\n<td>The reload button will refresh the data from the target.\n</table>\n\n<!-- ======================================================================= -->\n<h2>the Network panel</h2>\n\n<p><img src=\"images/panel-network.png\">\n\n<p>The Network panel shows you information regarding XHR requests that you've\nmade.\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>Each XHR will be shown in a separate row in the table.  Clicking the\npath name of the XHR request will show additional information for that\nrequest in the right side of the panel.\nTo display the table again, click the (x)\nbutton in the left top corner of the information pane (not shown in the\nimage above).\n</table>\n\n<p><table><tr><td><img src=\"images/circled-b.png\">\n<td>The \"dots and lines\" button can be used to change the table layout to\nshow less information in a more compact format.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-c.png\">\n<td>The \"not\" button will clear the entries from the table.\n</table>\n\n<!-- ======================================================================= -->\n<h2>the Timeline panel</h2>\n\n<p><img src=\"images/panel-timeline.png\">\n\n<p>The Timeline panel is used to show events that are occurring in the target.\nCurrently only two types of events are shown: timers/intervals, and user-specified\nevents.  Use <tt>console.markTimeline(\"A Label\")</tt> to add a user-specified\nevent to the timeline with the specified label.\n\n<p>Note that timing events are not collected unless you enable the \"record\"\nbutton (see below).\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>The left hand pane of the Timeline panel shows the events that have occurred.\nHovering over an entry will show additional detail about the event.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-b.png\">\n<td>The right hand pane of the Timeline panel shows the events as they occurred\nin time.  Some events have other events associated with them, which will be shown\nwhen the disclosure triangle is expanded.  The top-most time line of the right\npanel can have it's right and left hand edges moved to show a particular time\nrange in more detail.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-c.png\">\n<td>The \"dots and lines\" button can be used to show and hide events that last\nless than a fixed time (currently 15ms).\n</table>\n\n<p><table><tr><td><img src=\"images/circled-d.png\">\n<td>The \"record\" button is used to start or stop event collection.  When\n<span class=\"weinre\">weinre</span> starts, the record button is off (black).\nWhen you click the record button to start collecting events, it will turn\nred.\n</table>\n\n<p><table><tr><td><img src=\"images/circled-e.png\">\n<td>The \"not\" button will clear the current timing entries.\n</table>\n\n\n<!-- ======================================================================= -->\n<h2>the Console panel</h2>\n\n<p><img src=\"images/panel-console.png\">\n\n<p>The Console panel is used to execute arbitrary JavaScript expressions/statements.  It\nalso shows the output from various <tt>console</tt> methods, like\n<tt>console.log()</tt>.\n\n<p>In the example above, the JavaScript statements entered by the user are in\nblue, the output of the statements is just below it, and messages generated by\n<tt>console.log()</tt> are in black.\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>The \"not\" button will clear the console.\n</table>\n\n<p><img src=\"images/panel-remote-console.png\">\n\n<p>The Console can also be embedded in every panel, by clicking the \"console\"\nbutton.\n\n<table><tr><td><img src=\"images/circled-a.png\">\n<td>The \"console\" button will embed the console in the bottom half of the\nother panels, or hide it if it's currently embedded in the other panels.\n</table>\n\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/build-info.txt",
    "content": "weinre build 2.0.0-pre-IXE4AG4O by wuchangming\ngit: 746a5817d014acdda673115e2ee458ec6c9b7673 fix(console): fixed chrome bug, add ArrowUp, ArrowDown, ArrowRight\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/css/main.css",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nbody {\n   padding:                0em 2em;\n   font-size:              120%\n}\n\n/*-----------------------------------------------------------------*/\n.ribbon {\n    position:               absolute;\n    top:                    0;\n    right:                  0;\n    border-left:            thin solid #000;\n    border-bottom:          thin solid #000;\n    -moz-border-radius-bottomleft:     0.5em;\n    -webkit-border-bottom-left-radius: 0.5em;\n    padding:                0.25em 0.5em;\n    background-color:       #FF8;\n    font-style:             italic;\n    -webkit-box-shadow:     5px 5px 15px #888;\n    -moz-box-shadow:        5px 5px 15px #888;\n    box-shadow:             5px 5px 15px #888;\n}\n\n/*-----------------------------------------------------------------*/\n.no-decoration {\n    text-decoration:        none;\n}\n\n/*-----------------------------------------------------------------*/\n.strike {\n    text-decoration:        line-through;\n}\n\n/*-----------------------------------------------------------------*/\n.weinre {\n   color:                  #088;\n   font-style:             italic;\n   font-weight:            bold;\n   font-family:            Menlo, Monaco, Consolas, Lucida Console, dejavu sans mono, monospace;\n}\n\n/*-----------------------------------------------------------------*/\n.width-transition {\n   -webkit-transition:     width 0.3s linear;\n}\n\n/*-----------------------------------------------------------------*/\n.no-bullet {\n   list-style-type:        none;\n}\n\n/*-----------------------------------------------------------------*/\n.indent {\n   margin-left:            3.0em;\n}\n\n/*-----------------------------------------------------------------*/\n.no-bullet li {\n   margin-top:             0.50em;\n   margin-bottom:          0.50em;\n}\n\n/*-----------------------------------------------------------------*/\n.spaced li {\n   margin-top:             0.50em;\n   margin-bottom:          0.50em;\n}\n\n/*-----------------------------------------------------------------*/\n.spaced dt {\n   margin-top:             0.50em;\n}\n\n/*-----------------------------------------------------------------*/\n.spaced dd {\n   margin-bottom:          0.50em;\n}\n\n/*-----------------------------------------------------------------*/\ndt {\n   font-weight:            bold;\n}\n\ntt {\n   white-space:            pre;\n}\n\n/*-----------------------------------------------------------------*/\n.toc {\n    font-style:            italic;\n    text-align:            center;\n}\n\n/*-----------------------------------------------------------------*/\n.toc a {\n    padding:               0.2em 0.5em;\n}\n\n/*-----------------------------------------------------------------*/\n.page-title {\n    text-align:            center;\n}\n\n/*-----------------------------------------------------------------*/\n.todo {\n    background-color:      #FAA;\n}\n\n/*-----------------------------------------------------------------*/\n.help {\n    background-color:      #FDD;\n    font-weight:           bold;\n    font-size:             120%;\n}\n\n/*-----------------------------------------------------------------*/\n.note {\n    background-color:      #FFA;\n    font-weight:           bold;\n    font-size:             120%;\n    margin:                0.25em 1.0em;\n    padding:               0.00em 0.5em;\n    border-width:          1;\n    border-style:          solid;\n    border-radius:         0.5em;\n    -moz-border-radius:    0.5em;\n    -webkit-border-radius: 0.5em;\n}\n\n.note h3 {\n    text-decoration:       underline;\n}\n\n/*-----------------------------------------------------------------*/\npre, xmp {\n    border-width:          1;\n    border-style:          solid;\n    overflow:              auto;\n    padding-top:           0.4em;\n    padding-bottom:        0.4em;\n    padding-left:          1.4em;\n    padding-right:         1.4em;\n    margin-left:           1.4em;\n    margin-right:          1.4em;\n\tbackground:            #FFFFDF;\n\tborder-radius:         0.5em;\n    -moz-border-radius:    0.5em;\n    -webkit-border-radius: 0.5em;\n\tbox-shadow:            0.3em 0.3em 0.3em 0em #DDD;\n\t-moz-box-shadow:       0.3em 0.3em 0.3em 0em #DDD;\n\t-webkit-box-shadow:    0.3em 0.3em 0.3em 0em #DDD;\n}\n\n/*-----------------------------------------------------------------*/\nh2 {\n    padding:               0.25em 0.50em;\n    background-color:      #DDD;\n    border-radius:         0.5em;\n    -moz-border-radius:    0.5em;\n    -webkit-border-radius: 0.5em;\n}\n\n/*-----------------------------------------------------------------*/\nkewl {\n\tbox-shadow:            0.3em 0.3em 0.3em 0em #DDD;\n\t-moz-box-shadow:       0.3em 0.3em 0.3em 0em #DDD;\n\t-webkit-box-shadow:    0.3em 0.3em 0.3em 0em #DDD;\n\tborder-radius:         0.5em;\n    -moz-border-radius:    0.5em;\n    -webkit-border-radius: 0.5em;\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/index.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre - Home</title>\n<link rel=\"stylesheet\" href=\"css/main.css\" type=\"text/css\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n</head>\n\n<body>\n\n<div class=\"ribbon\">clone weinre at\n<a href=\"https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git\">apache</a>\n</div>\n\n<!-- ======================================================================= -->\n<h1 class=\"page-title\">weinre - Home</h1>\n\n<div class=\"toc\">\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n<p>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n</div>\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<p><span class=\"weinre\">weinre</span> is <b>WE</b>b <b>IN</b>spector <b>RE</b>mote.\nPronounced like the word \"winery\".  Or maybe like the word \"weiner\".  Who knows,\nreally.\n\n<p><span class=\"weinre\">weinre</span> is a debugger for web pages, like\nFireBug (for FireFox)\nand\nWeb Inspector (for WebKit-based browsers), except it's designed\nto work <b>remotely</b>, and in particular, to <b>allow you debug web pages\non a mobile device such as a phone</b>.\n\n<div class=\"note\">\n  <p><h3>Do you need to use weinre?</h3>\n\n  <p>weinre was built in an age when there were <b>no</b> remote debuggers\n    available for mobile devices.  Since then, some platforms are starting to\n    provide remote debugger capabilities, as part of their platform tool set.\n\n  <table border=0 cellpadding=5 cellspacing=0>\n\n    <tr><td valign=top>Android:\n    <td><a href=\"https://developer.chrome.com/devtools/docs/remote-debugging\">\n      Remote Debugging on Android with Chrome\n    </a>\n\n    <tr><td valign=top>iOS:\n    <td><a href=\"https://developer.apple.com/library/safari/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html\">\n      Enabling Web Inspector for iOS\n    </a>\n\n    <tr><td valign=top>Firefox&nbsp;OS:\n    <td><a href=\"https://developer.mozilla.org/en-US/Firefox_OS/Debugging\">\n      Debugging on Firefox OS\n    </a>\n\n    <tr><td valign=top>Windows&nbsp;Phone:\n    <td><a href=\"http://msdn.microsoft.com/en-us/library/dn757061.aspx\">\n      Debug Your App Built with Visual Studio Tools for Apache Cordova\n    </a>\n    <i>\n      (note: as of 2015/01/15, that page suggests weinre as the debugger for Windows Phone)\n    </i>\n\n  </table>\n</div>\n\n<p>Interesting places to visit:\n<table>\n\n<tr><td>videos at YouTube:\n<td><a href=\"http://www.youtube.com/results?search_query=weinre\">http://www.youtube.com/results?search_query=weinre</a>\n\n<tr><td>this documentation:\n<td><a href=\"http://people.apache.org/~pmuellr/weinre/\">http://people.apache.org/~pmuellr/weinre/</a> [temporary]</a>\n\n<tr><td>unofficial binary packages:\n<td><a href=\"http://people.apache.org/~pmuellr/weinre/\">http://people.apache.org/~pmuellr/weinre/</a> [temporary]</a>\n\n<tr><td>issues:\n<td><a href=\"https://issues.apache.org/jira/secure/IssueNavigator.jspa?jqlQuery=project=CB+and+component=weinre\">https://issues.apache.org/jira/gobble-de-gook/...</a>\n\n<tr><td>create a new issue:\n<td>\n<a href=\"https://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12312420&components=12316604&issuetype=1\">bug</a>\nor\n<a href=\"https://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12312420&components=12316604&issuetype=2\">new feature</a>\n\n<tr><td>cloneable source at Apache:\n<td><a href=\"https://git-wip-us.apache.org/repos/asf/cordova-weinre.git\">https://git-wip-us.apache.org/repos/asf/cordova-weinre.git</a>\n\n<tr><td>Apache repo cloned at GitHub:\n<td><a href=\"https://github.com/apache/cordova-weinre\">https://github.com/apache/cordova-weinre</a>\n\n<tr><td>mailing lists at Apache:\n<td><a href=\"http://mail-archives.apache.org/mod_mbox/cordova-dev/\">http://mail-archives.apache.org/mod_mbox/cordova-dev/</a> (for weinre development)\n\n<tr><td>discussion at Google Group:\n<td><a href=\"http://groups.google.com/group/weinre\">http://groups.google.com/group/weinre</a> (for weinre usage)\n\n</table>\n\n<p>More information on <span class=\"weinre\">weinre</span>'s big brothers, Web Inspector / Google Chrome\nDeveloper Tools, is available at\n<a href=\"http://code.google.com/chrome/devtools/docs/overview.html\">Google's Chrome Dev Tools pages</a>\nand\n<a href=\"http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/Safari_Developer_Guide/DebuggingYourWebsite/DebuggingYourWebsite.html\">Apple's Web Inspector pages</a>.\n\n<p>If you aren't familiar with FireBug or Web Inspector,\n<span class=\"weinre\">weinre</span> isn't going to make too much sense to you.\n<span class=\"weinre\">weinre</span> reuses the user interface code from the\n<a href=\"http://trac.webkit.org/wiki/WebInspector\">Web Inspector project at WebKit</a>,\nso if you've used Safari's Web Inspector or Chrome's Developer Tools,\n<span class=\"weinre\">weinre</span> will be very familiar.  If you're not\nfamiliar with Web Inspector, the links above to Google's and Apple's documentation\nwill be useful.\n\n<p>Here's an example session using <span class=\"weinre\">weinre</span>:\n\n<p><img src=\"images/weinre-demo.jpg\">\n\n<p>Two screen captures are shown above.  On the left is the\n<span class=\"weinre\">weinre</span> <b>client</b> application, displaying debug\ninformation.\nOn the right is the <b>target</b> web page, running in Mobile Safari in the iOS Simulator.\n\n<p>In normal usage, you will be running the <b>client</b> application in a browser\non your desktop/laptop, and running a <b>target</b> web page on your mobile device.\n\n<p>In the session above, the debugger is display the Elements panel, with the\nembedded console expanded in the bottom third of the window.  In the console\narea, we've entered two statements:\n\n<pre>\ndocument.body.style.backgroundColor\ndocument.body.style.backgroundColor = \"pink\"\n</pre>\n\n<p>The result of running the first statement shows the value of the body's background style is not set.\nThe second statement sets the body's background to pink.  That horrifying pink\nbackground is then rendered in the <b>target</b>'s window.\n\n<p>In addition, an <tt>h1</tt> element is selected in the upper third of the\nElements panel, which causes the side panels on the right to be filled in with\nrelevant information.  In this case, the matched CSS rules for that <tt>h1</tt>\nelement are being shown.\n\n<p>If you are familiar with WebKit's Web Inspector,\na partial list of differences between it and <span class=\"weinre\">weinre</span>\nare listed below:\n\n<ul class=\"spaced\">\n\n<li><span class=\"weinre\">weinre</span> does not make use of any 'native' code\nin the browser, it's all plain old boring JavaScript.\n\n<li>Because <span class=\"weinre\">weinre</span> doesn't use 'native' code,\nit's functionality is limited.  For instance, source level debug of JavaScript\nis not <span class=\"strike\">possible</span>\n<a href=\"http://lexandera.com/aardwolf/\">easy</a>.\n\n<li>Because <span class=\"weinre\">weinre</span> doesn't use 'native' code,\nthe debug target code will run on browsers\nwithout specialized debug support.  For instance, a browser running on your phone.\n\n<li><span class=\"weinre\">weinre</span> supports 'remote' interaction,\nso you can run the debugger user interface on one\nmachine and can debug a web page running\non another machine.  For instance, debug a web page displayed on your phone from your\nlaptop.\n\n<li>Because <span class=\"weinre\">weinre</span> supports 'remote' interaction,\nmultiple debug clients can be debugging the same debug target at the same time.\n\n<li>One thing <b>not</b> different from Web Inspector is that the debug client\nuser interface only runs on WebKit-based browsers.\n\n</ul>\n\n<!-- ======================================================== -->\n<h2>Supported Libraries and Platforms</h2>\n\n<p>Generally version numbers listed here are the earliest\nversions of the relevant thing that have been tested.\nLater versions of those things are also hopefully supported,\nbut let us know.\n\n<h3>Libraries not supported</h3>\n\n<ul>\n<li>versions of Prototype.js before version 1.7 are not supported,\nas they do not support the <tt>JSON.stringify()</tt> API correctly.  You\nwill get an <tt>alert()</tt> in the web page you are debugging if you\nattempt to debug it with <span class=\"weinre\">weinre</span> and you are using an unsupported\nversion of Prototype.js.\n</ul>\n\n<h3>Platforms supported - debug server</h3>\n<p>Any platform that supports <a href=\"http://nodejs.org/\">node.js</a>.\n\n<h3>Platforms supported - debug client</h3>\n<p>The browser where the debugger user interface runs.\n\n<ul>\n<li>Google Chrome\n<li>Apple Safari\n<li>Other recent-ish WebKit-based browsers\n</ul>\n\n<h3>Platforms supported - debug target</h3>\n<p>The browser with the page you are debugging.\n\n<ul>\n<li>Android Browser application\n<li>iOS Mobile Safari application\n<li>PhoneGap/Cordova\n<li>other\n</ul>\n\n<h3>Platforms not supported - debug target</h3>\n\n<ul>\n<li>iOS 3.1.3 or earlier\n<li>webOS 1.45 or earlier\n</ul>\n\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<div class=\"toc\">\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<p>\n  <a href=\"Home.html\">Home</a>\n- <a href=\"UserInterface.html\">User Interface</a>\n- <a href=\"Installing.html\">Installing</a>\n- <a href=\"Running.html\">Running</a>\n- <a href=\"MultiUser.html\">Multi-User</a>\n- <a href=\"Security.html\">Security</a>\n- <a href=\"Building.html\">Building</a>\n- <a href=\"ChangeLog.html\">ChangeLog</a>\n- <a href=\"License.html\">License</a>\n\n<br><img src=\"images/weinre-icon-128x128.png\">\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/doc/scripts/main.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n//-----------------------------------------------------------------------------\nfunction main() {\n//    window.addEventListener(\"load\", addClickToExpandImageHandlers, false);\n}\n\n//-----------------------------------------------------------------------------\nfunction addClickToExpandImageHandlers() {\n    var elements = document.getElementsByTagName(\"img\")\n    for (var i=0; i<elements.length; i++) {\n        var element = elements[i]\n        if (!hasClass(element, \"expand-on-click\")) continue\n\n        addClass(element, \"width-transition\")\n        element._original_width_ = element.width\n        element._contracted_     = true\n        element.width            = element.width / 2\n\n        element.addEventListener(\"click\", clickToExpand, false)\n    }\n}\n\n//-----------------------------------------------------------------------------\nfunction clickToExpand(event) {\n    var element = this\n\n    if (element._contracted_) {\n        element.width = element._original_width_\n    }\n    else {\n        element.width = element._original_width_ / 2\n    }\n\n    element._contracted_ = ! element._contracted_\n\n//     if (hasClass(element, \"contracted\")) {\n//         removeClass(element, \"contracted\")\n//     }\n//\n//     else {\n//         addClass(element,    \"contracted\")\n//     }\n}\n\n//-----------------------------------------------------------------------------\nfunction hasClass(element, className) {\n    var classNames = element.className.split(/\\s+/)\n    for (var i=0; i<classNames.length; i++) {\n        if (className == classNames[i]) return true\n    }\n    return false\n}\n\n//-----------------------------------------------------------------------------\nfunction addClass(element, className) {\n    if (hasClass(element, className)) return\n\n    element.className += \" \" + className\n}\n\n//-----------------------------------------------------------------------------\nfunction removeClass(element, className) {\n    var classNames = element.className.split(/\\s+/)\n    for (var i=0; i<classNames.length; i++) {\n        if (className == classNames[i]) {\n            classNames[i] = \"\"\n        }\n    }\n    element.className = classNames.join(\" \")\n}\n\n//-----------------------------------------------------------------------------\nmain()\n"
  },
  {
    "path": "buildin_modules/weinre/web/index.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre server home</title>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<link rel=\"shortcut icon\" href=\"images/weinre-icon-64x64.png\" />\n<script src=\"versions.js\"></script>\n<style>\n.underline {\n    border-bottom:          solid;\n}\nh1, h2 {\n    padding:                0.25em 0.50em;\n    background-color:       #DDD;\n    border-radius:          0.5em;\n    -moz-border-radius:     0.5em;\n    -webkit-border-radius:  0.5em;\n}\ntd {\n    vertical-align:         top;\n}\npre {\n    overflow:               auto;\n}\ntextarea {\n    width:                  100%;\n}\npre, .indent {\n    margin-left:            2em;\n}\n</style>\n</head>\n<body>\n<h1>weinre - <span class=\"underline\">we</span>b <span class=\"underline\">in</span>spector <span class=\"underline\">re</span>mote</h1>\n\n\n<h2>Access Points</h2>\n\n<table>\n<tr><td>debug client user interface: <td> <span id=\"url-client-ui\">???</span>\n<tr><td>documentation:               <td> <span id=\"url-target-documentation\">???</span>\n</table>\n\n<h2>Target Demos</h2>\n\n<p>The following links point to an already instrumented sample application,\nrun in a couple of different environmental conditions.\n\n<p>First open a new browser window for the debug client user interface, as\nspecified above.  Then open another new browser window for one of the demos\nbelow.  They should auto-connect and result in an active debug connection\nbetween the client and the target demo.\n\n<ul>\n<li><a href=\"demo/weinre-demo.html\">        the non-minified demo</a>\n<li><a href=\"demo/weinre-demo-min.html\">    the minified demo</a>\n<li><a href=\"demo/weinre-demo-strict.html\"> the non-minified strict demo</a>\n</ul>\n\n<h2>Target Script</h2>\n\n<p>You can use this script to inject the weinre target code into your web page.\n\n<p class=\"indent\"><code><span id=\"url-target-script\">???</span></code>\n\n<p>Example:\n\n<pre>\n&ltscript src=\"<span id=\"url-target-script-raw\">???</span>\"&gt;&lt;/script&gt;\n</pre>\n\n<h2>Target Bookmarklet</h2>\n\n<p>You can use this bookmarklet to inject the weinre target code into any\nweb page you are viewing.\n\n<p>link you can drag to your bookmarks:\n\n<div class=\"indent\">\n<span id=\"url-target-bookmarklet\">???</span>\n</div>\n\n<p>bookmarklet url in a pre:\n<pre id=\"target-bookmarklet-src-pre\"></pre>\n\n<p>bookmarklet url in a textarea:\n<div class=\"indent\">\n<textarea id=\"target-bookmarklet-src-text-area\"></textarea>\n</div>\n\n<h2>Development</h2>\n\n<p>interfaces: <span id=\"url-interfaces\">???</span>\n\n<h2>Versions</h2>\n\n<table>\n<tr><td>weinre: <td> <span id=\"version-weinre\">???</span>\n<tr><td>build:  <td> <span id=\"version-build\">???</span>\n</table>\n\n<img src=\"images/weinre-icon-128x128.png\">\n\n<script src=\"index.js\"></script>\n\n</body>\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/index.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nvar weinre_protocol = location.protocol\nvar weinre_host     = location.hostname\nvar weinre_port     = location.port\nvar weinre_pathname = location.pathname\nvar weinre_id       = \"anonymous\"\n\nfunction doReplacements() {\n    var hash = location.href.split(\"#\")[1]\n    if (hash) {\n        weinre_id = hash\n    }\n\n    replaceURL(\"url-client-ui\",              buildHttpURL(\"client/#\" + weinre_id))\n    replaceURL(\"url-interfaces\",             buildHttpURL(\"interfaces/interfaces.html\"))\n    replaceURL(\"url-target-demo\",            buildHttpURL(\"demo/weinre-demo.html#\" + weinre_id))\n    replaceURL(\"url-target-demo-min\",        buildHttpURL(\"demo/weinre-demo-min.html#\" + weinre_id))\n    replaceURL(\"url-target-script\",          buildHttpURL(\"target/target-script-min.js#\" + weinre_id))\n    replaceURL(\"url-target-bookmarklet\",     getTargetBookmarklet(), \"weinre target debug\")\n    replaceURL(\"url-target-documentation\",   buildHttpURL(\"doc/\"))\n\n    replaceText(\"version-weinre\",    Weinre.Versions.weinre)\n    replaceText(\"version-build\",     Weinre.Versions.build)\n\n    replaceText(\"target-bookmarklet-src-pre\",       getTargetBookmarklet())\n    replaceText(\"target-bookmarklet-src-text-area\", getTargetBookmarklet())\n\n    replaceText(\"url-target-script-raw\",  buildHttpURL(\"target/target-script-min.js#\" + weinre_id))\n}\n\ndoReplacements();\n\nwindow.onhashchange = doReplacements;\n\n//---------------------------------------------------------------------\nfunction buildHttpURL(uri) {\n    var port     = weinre_port\n    var pathname = weinre_pathname\n\n    if (pathname == \"/index.html\") pathname = \"/\"\n\n    if (weinre_protocol == \"file:\") {\n        return uri\n    }\n\n    else if (weinre_protocol == \"http:\") {\n        if (port != \"\") port = \":\" + port\n\n        return weinre_protocol + \"//\" + weinre_host + port + pathname + uri\n    }\n\n    else if (weinre_protocol == \"https:\") {\n        if (port != \"\") port = \":\" + port\n\n        return weinre_protocol + \"//\" + weinre_host + port + pathname + uri\n    }\n}\n\n//-----------------------------------------------------------------------------\nfunction targetBookmarkletFunction(e){\n    e.setAttribute(\"src\",\"???\");\n    document.getElementsByTagName(\"body\")[0].appendChild(e);\n}\n\n//-----------------------------------------------------------------------------\nfunction getTargetBookmarklet() {\n    var script = targetBookmarkletFunction.toString();\n    script = script.replace(/\\n/g,   \"\")\n    script = script.replace(\"targetBookmarkletFunction\",\"\")\n    script = script.replace(/\\s*/g, \"\")\n    script = script.replace(\"???\", buildHttpURL(\"target/target-script-min.js#\" + weinre_id))\n    script = \"(\" + script + ')(document.createElement(\"script\"));void(0);'\n    return 'javascript:' + script\n}\n\n//---------------------------------------------------------------------\nfunction replaceURL(id, url, linkText) {\n    if (!linkText) linkText = url\n    replaceText(id, \"<a href='\" + url + \"'>\" + linkText + \"</a>\");\n}\n\n//---------------------------------------------------------------------\nfunction replaceText(id, text) {\n    var element = document.getElementById(id)\n    if (null == element) {\n//      alert(\"error: can't find element with id '\" + id + \"'\")\n        return\n    }\n\n    element.innerHTML = text\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/InjectedScriptHost.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"InjectedScriptHost\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"clearConsoleMessages\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"copyText\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMString\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"text\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"DOMObject\", \n                  \"name\": \"any\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"nodeForId\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"int\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"pushNodePathToFrontend\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMObject\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"node\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"withChildren\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"selectInUI\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"long\", \n                  \"name\": \"int\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"inspectedNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"num\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"DOMObject\", \n                  \"name\": \"any\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"internalConstructorName\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMObject\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"object\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"DOMObject\", \n                  \"name\": \"any\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"currentCallFrame\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"selectDatabase\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMObject\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"database\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"selectDOMStorage\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMObject\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"storage\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"didCreateWorker\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMString\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"isFakeWorker\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"didDestroyWorker\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"long\", \n                  \"name\": \"int\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"nextWorkerId\", \n               \"parameters\": []\n            }\n         ]\n      }\n   ], \n   \"name\": \"core\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/Inspector.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Inspector\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"addScriptToEvaluateOnLoad\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"scriptSource\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"removeAllScriptsToEvaluateOnLoad\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"reloadPage\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"ignoreCache\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"populateScriptObjects\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"openInInspectedWindow\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"newState\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setSearchingForNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"enabled\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"didEvaluateForTestInFrontend\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"testCallId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"jsonResult\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"highlightDOMNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"hideDOMNodeHighlight\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"highlightFrame\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"frameId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"hideFrameHighlight\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setUserAgentOverride\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"userAgent\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"cookies\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"cookiesString\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getCookies\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"deleteCookie\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"cookieName\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"domain\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"startTimelineProfiler\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"stopTimelineProfiler\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"enableDebugger\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"disableDebugger\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"enableProfiler\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"disableProfiler\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"startProfiling\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"stopProfiling\", \n               \"parameters\": []\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Runtime\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"evaluate\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"expression\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"objectGroup\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"includeCommandLineAPI\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getCompletions\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"expression\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"includeCommandLineAPI\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getProperties\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"objectId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"ignoreHasOwnProperty\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"abbreviate\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setPropertyValue\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"objectId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"propertyName\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"expression\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"releaseWrapperObjectGroup\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"injectedScriptId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"objectGroup\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"InjectedScript\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"evaluateOnSelf\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"functionBody\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"argumentsArray\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Console\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"newState\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setConsoleMessagesEnabled\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"enabled\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"clearConsoleMessages\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setMonitoringXHREnabled\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"enabled\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Network\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"resources\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"cachedResources\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"content\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"resourceContent\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"frameId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"base64Encode\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setExtraHeaders\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"headers\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Database\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"tableNames\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getDatabaseTableNames\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"databaseId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"transactionId\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"executeSQL\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"databaseId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"query\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"DOMStorage\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"entries\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getDOMStorageEntries\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"storageId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setDOMStorageItem\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"storageId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"key\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"value\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"removeDOMStorageItem\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"storageId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"key\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"ApplicationCache\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"applicationCaches\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getApplicationCaches\", \n               \"parameters\": []\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"DOM\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"getChildNodes\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setAttribute\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"elementId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"name\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"value\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"removeAttribute\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"elementId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"name\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setTextNodeValue\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"value\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"outNodeId\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"listenersArray\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getEventListenersForNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"copyNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"outNodeId\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"removeNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"outNodeId\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"changeTagName\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"newTagName\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"outerHTML\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getOuterHTML\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"outNodeId\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setOuterHTML\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"outerHTML\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"addInspectedNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"performSearch\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"query\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"runSynchronously\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"searchCanceled\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"pushNodeByPathToFrontend\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"path\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"resolveNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getNodeProperties\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"propertiesArray\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getNodePrototypes\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"pushNodeToFrontend\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"objectId\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"CSS\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"styles\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getStylesForNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"style\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getComputedStyleForNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"style\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getInlineStyleForNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"styleSheetIds\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getAllStyles\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"styleSheet\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getStyleSheet\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"styleSheetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"text\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getStyleSheetText\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"styleSheetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setStyleSheetText\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"styleSheetId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"text\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"style\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setPropertyText\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"styleId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"propertyIndex\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"text\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"overwrite\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"style\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"toggleProperty\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"styleId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"propertyIndex\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"disable\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"rule\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setRuleSelector\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"ruleId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"selector\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"rule\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"addRule\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"contextNodeId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"selector\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"cssProperties\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getSupportedCSSProperties\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"querySelectorAll\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"documentId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"selector\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Timeline\", \n         \"methods\": []\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Debugger\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"activateBreakpoints\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"deactivateBreakpoints\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"breakpointId\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"locations\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setJavaScriptBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"lineNumber\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"columnNumber\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"condition\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"enabled\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"breakpointId\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"actualLineNumber\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"actualColumnNumber\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setJavaScriptBreakpointBySourceId\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"sourceId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"lineNumber\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"columnNumber\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"condition\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"enabled\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"removeJavaScriptBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"breakpointId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"continueToLocation\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"sourceId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"lineNumber\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"columnNumber\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"stepOver\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"stepInto\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"stepOut\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"pause\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"resume\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"success\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"newCallFrames\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"editScriptSource\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"sourceID\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"newContent\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"scriptSource\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getScriptSource\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"sourceID\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"newState\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"setPauseOnExceptionsState\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"pauseOnExceptionsState\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"evaluateOnCallFrame\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"callFrameId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"expression\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"objectGroup\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"includeCommandLineAPI\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getCompletionsOnCallFrame\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"callFrameId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"expression\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"includeCommandLineAPI\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"BrowserDebugger\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setAllBrowserBreakpoints\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"breakpoints\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setDOMBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"type\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"removeDOMBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"type\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setEventListenerBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"eventName\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"removeEventListenerBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"eventName\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setXHRBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"removeXHRBreakpoint\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"Profiler\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"headers\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getProfileHeaders\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"profile\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getProfile\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"type\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"uid\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"removeProfile\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"type\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"uid\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"clearProfiles\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"takeHeapSnapshot\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"detailed\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"InspectorNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"frontendReused\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"addNodesToSearchResult\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"nodeIds\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"bringToFront\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"disconnectFromBackend\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"inspectedURLChanged\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"domContentEventFired\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"loadEventFired\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"reset\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"showPanel\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"panel\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"evaluateForTestInFrontend\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"testCallId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"script\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"updateFocusedNode\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"nodeId\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"ConsoleNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"addConsoleMessage\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"messageObj\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"updateConsoleMessageExpiredCount\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"count\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"updateConsoleMessageRepeatCount\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"count\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"consoleMessagesCleared\", \n               \"parameters\": []\n            }\n         ]\n      }, \n      {\n         \"name\": \"NetworkNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"frameDetachedFromParent\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"frameId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"identifierForInitialRequest\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"loader\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"callStack\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"willSendRequest\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"request\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"redirectResponse\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"markResourceAsCached\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didReceiveResponse\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"resourceType\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"response\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didReceiveContentLength\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"lengthReceived\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didFinishLoading\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"finishTime\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didFailLoading\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"localizedDescription\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didLoadResourceFromMemoryCache\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"resource\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"setInitialContent\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"sourceString\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"type\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didCommitLoadForFrame\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"frame\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"loader\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didCreateWebSocket\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"requestURL\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"willSendWebSocketHandshakeRequest\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"request\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didReceiveWebSocketHandshakeResponse\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"response\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didCloseWebSocket\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"identifier\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"double\", \n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"time\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"DatabaseNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"addDatabase\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"database\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"selectDatabase\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"databaseId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"sqlTransactionSucceeded\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"transactionId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"columnNames\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"values\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"sqlTransactionFailed\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"transactionId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"sqlError\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"DOMStorageNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"addDOMStorage\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"storage\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"updateDOMStorage\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"storageId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"selectDOMStorage\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"storageId\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"ApplicationCacheNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"updateApplicationCacheStatus\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"status\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"updateNetworkState\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"isNowOnline\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"DOMNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"setDocument\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Value\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"root\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"attributesUpdated\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"attributes\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"characterDataModified\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"newValue\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"setChildNodes\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"parentId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"nodes\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"setDetachedRoot\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"root\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"childNodeCountUpdated\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"newValue\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"childNodeInserted\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"parentId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"prevId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"node\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"childNodeRemoved\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"parentId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"TimelineNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"timelineProfilerWasStarted\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"timelineProfilerWasStopped\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"addRecordToTimeline\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"record\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"DebuggerNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"debuggerWasEnabled\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"debuggerWasDisabled\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"parsedScriptSource\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"sourceID\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"lineOffset\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"columnOffset\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"length\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"scriptWorldType\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"failedToParseScriptSource\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"data\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"firstLine\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"errorLine\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"errorMessage\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"breakpointResolved\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"breakpointId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"sourceId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"lineNumber\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"columnNumber\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"pausedScript\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"details\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"resumedScript\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didCreateWorker\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"url\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"isShared\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"didDestroyWorker\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"long\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"id\"\n                  }\n               ]\n            }\n         ]\n      }, \n      {\n         \"name\": \"ProfilerNotify\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"profilerWasEnabled\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"profilerWasDisabled\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"addProfileHeader\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"header\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"addHeapSnapshotChunk\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"uid\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"String\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"chunk\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"finishHeapSnapshot\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"uid\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"setRecordingProfile\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"boolean\"\n                     }, \n                     \"name\": \"isProfiling\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"resetProfiles\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"notify\": true\n               }, \n               \"name\": \"reportHeapSnapshotProgress\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"done\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"total\"\n                  }\n               ]\n            }\n         ]\n      }\n   ], \n   \"name\": \"core\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/InspectorFrontendHost.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"extendedAttributes\": {\n            \"Conditional\": \"INSPECTOR\"\n         }, \n         \"name\": \"InspectorFrontendHost\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"loaded\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"closeWindow\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"disconnectFromBackend\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"bringToFront\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"inspectedURLChanged\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMString\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"newURL\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"requestAttachWindow\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"requestDetachWindow\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setAttachedWindowHeight\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"unsigned\", \n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"height\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"moveWindowBy\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"x\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"float\"\n                     }, \n                     \"name\": \"y\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"setExtensionAPI\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMString\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"script\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"DOMString\", \n                  \"name\": \"string\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"localizedStringsURL\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"DOMString\", \n                  \"name\": \"string\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"hiddenPanels\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"copyText\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMString\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"text\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"DOMString\", \n                  \"name\": \"string\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"platform\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"originalName\": \"DOMString\", \n                  \"name\": \"string\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"port\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"extendedAttributes\": {\n                  \"Custom\": true\n               }, \n               \"name\": \"showContextMenu\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"MouseEvent\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"event\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMObject\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"items\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"sendMessageToBackend\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"DOMString\", \n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }\n         ]\n      }\n   ], \n   \"name\": \"core\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/WeinreClientCommands.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"name\": \"WeinreClientCommands\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"registerClient\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"targets\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getTargets\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"clients\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getClients\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"connectTarget\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"targetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"disconnectTarget\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"extensions\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getExtensions\", \n               \"parameters\": []\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logDebug\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logInfo\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logWarning\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logError\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }\n         ]\n      }\n   ], \n   \"name\": \"weinre\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/WeinreClientEvents.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"name\": \"WeinreClientEvents\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"clientRegistered\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"client\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"targetRegistered\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"target\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"clientUnregistered\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"targetUnregistered\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"targetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"connectionCreated\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"targetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"connectionDestroyed\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"targetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"sendCallback\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"callbackId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"serverProperties\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"properties\"\n                  }\n               ]\n            }\n         ]\n      }\n   ], \n   \"name\": \"weinre\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/WeinreExtraClientCommands.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"name\": \"WeinreExtraClientCommands\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\", \n                        \"rank\": 1\n                     }, \n                     \"name\": \"databaseRecords\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"getDatabases\", \n               \"parameters\": []\n            }\n         ]\n      }\n   ], \n   \"name\": \"weinre\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/WeinreExtraTargetEvents.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"name\": \"WeinreExtraTargetEvents\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"databaseOpened\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"databaseRecord\"\n                  }\n               ]\n            }\n         ]\n      }\n   ], \n   \"name\": \"weinre\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/WeinreTargetCommands.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"name\": \"WeinreTargetCommands\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"targetId\", \n                     \"out\": true\n                  }\n               ], \n               \"name\": \"registerTarget\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"int\"\n                     }, \n                     \"name\": \"url\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"sendClientCallback\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"callbackId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"args\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logDebug\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logInfo\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logWarning\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"logError\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"message\"\n                  }\n               ]\n            }\n         ]\n      }\n   ], \n   \"name\": \"weinre\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/WeinreTargetEvents.json",
    "content": "{\n   \"interfaces\": [\n      {\n         \"name\": \"WeinreTargetEvents\", \n         \"methods\": [\n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"connectionCreated\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"targetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"connectionDestroyed\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"clientId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"targetId\"\n                  }\n               ]\n            }, \n            {\n               \"returns\": {\n                  \"name\": \"void\"\n               }, \n               \"callbackParameters\": [], \n               \"name\": \"sendCallback\", \n               \"parameters\": [\n                  {\n                     \"type\": {\n                        \"name\": \"string\"\n                     }, \n                     \"name\": \"callbackId\"\n                  }, \n                  {\n                     \"type\": {\n                        \"originalName\": \"Object\", \n                        \"name\": \"any\"\n                     }, \n                     \"name\": \"result\"\n                  }\n               ]\n            }\n         ]\n      }\n   ], \n   \"name\": \"weinre\"\n}"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/all-json-idls-min.js",
    "content": "modjewel.require('weinre/common/Weinre').addIDLs([{\"interfaces\": [{\"name\": \"InjectedScriptHost\", \"methods\": [{\"name\": \"clearConsoleMessages\", \"parameters\": []}, {\"name\": \"copyText\", \"parameters\": [{\"name\": \"text\"}]}, {\"parameters\": [{\"name\": \"nodeId\"}], \"name\": \"nodeForId\"}, {\"parameters\": [{\"name\": \"node\"}, {\"name\": \"withChildren\"}, {\"name\": \"selectInUI\"}], \"name\": \"pushNodePathToFrontend\"}, {\"name\": \"inspectedNode\", \"parameters\": [{\"name\": \"num\"}]}, {\"parameters\": [{\"name\": \"object\"}], \"name\": \"internalConstructorName\"}, {\"parameters\": [], \"name\": \"currentCallFrame\"}, {\"parameters\": [{\"name\": \"database\"}], \"name\": \"selectDatabase\"}, {\"parameters\": [{\"name\": \"storage\"}], \"name\": \"selectDOMStorage\"}, {\"name\": \"didCreateWorker\", \"parameters\": [{\"name\": \"id\"}, {\"name\": \"url\"}, {\"name\": \"isFakeWorker\"}]}, {\"name\": \"didDestroyWorker\", \"parameters\": [{\"name\": \"id\"}]}, {\"name\": \"nextWorkerId\", \"parameters\": []}]}], \"name\": \"core\"}, {\"interfaces\": [{\"name\": \"Inspector\", \"methods\": [{\"name\": \"addScriptToEvaluateOnLoad\", \"parameters\": [{\"name\": \"scriptSource\"}]}, {\"name\": \"removeAllScriptsToEvaluateOnLoad\", \"parameters\": []}, {\"name\": \"reloadPage\", \"parameters\": [{\"name\": \"ignoreCache\"}]}, {\"name\": \"populateScriptObjects\", \"parameters\": []}, {\"name\": \"openInInspectedWindow\", \"parameters\": [{\"name\": \"url\"}]}, {\"name\": \"setSearchingForNode\", \"parameters\": [{\"name\": \"enabled\"}]}, {\"name\": \"didEvaluateForTestInFrontend\", \"parameters\": [{\"name\": \"testCallId\"}, {\"name\": \"jsonResult\"}]}, {\"name\": \"highlightDOMNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"hideDOMNodeHighlight\", \"parameters\": []}, {\"name\": \"highlightFrame\", \"parameters\": [{\"name\": \"frameId\"}]}, {\"name\": \"hideFrameHighlight\", \"parameters\": []}, {\"name\": \"setUserAgentOverride\", \"parameters\": [{\"name\": \"userAgent\"}]}, {\"name\": \"getCookies\", \"parameters\": []}, {\"name\": \"deleteCookie\", \"parameters\": [{\"name\": \"cookieName\"}, {\"name\": \"domain\"}]}, {\"name\": \"startTimelineProfiler\", \"parameters\": []}, {\"name\": \"stopTimelineProfiler\", \"parameters\": []}, {\"name\": \"enableDebugger\", \"parameters\": []}, {\"name\": \"disableDebugger\", \"parameters\": []}, {\"name\": \"enableProfiler\", \"parameters\": []}, {\"name\": \"disableProfiler\", \"parameters\": []}, {\"name\": \"startProfiling\", \"parameters\": []}, {\"name\": \"stopProfiling\", \"parameters\": []}]}, {\"name\": \"Runtime\", \"methods\": [{\"name\": \"evaluate\", \"parameters\": [{\"name\": \"expression\"}, {\"name\": \"objectGroup\"}, {\"name\": \"includeCommandLineAPI\"}]}, {\"name\": \"getCompletions\", \"parameters\": [{\"name\": \"expression\"}, {\"name\": \"includeCommandLineAPI\"}]}, {\"name\": \"getProperties\", \"parameters\": [{\"name\": \"objectId\"}, {\"name\": \"ignoreHasOwnProperty\"}, {\"name\": \"abbreviate\"}]}, {\"name\": \"setPropertyValue\", \"parameters\": [{\"name\": \"objectId\"}, {\"name\": \"propertyName\"}, {\"name\": \"expression\"}]}, {\"name\": \"releaseWrapperObjectGroup\", \"parameters\": [{\"name\": \"injectedScriptId\"}, {\"name\": \"objectGroup\"}]}]}, {\"name\": \"InjectedScript\", \"methods\": [{\"name\": \"evaluateOnSelf\", \"parameters\": [{\"name\": \"functionBody\"}, {\"name\": \"argumentsArray\"}]}]}, {\"name\": \"Console\", \"methods\": [{\"name\": \"setConsoleMessagesEnabled\", \"parameters\": [{\"name\": \"enabled\"}]}, {\"name\": \"clearConsoleMessages\", \"parameters\": []}, {\"name\": \"setMonitoringXHREnabled\", \"parameters\": [{\"name\": \"enabled\"}]}]}, {\"name\": \"Network\", \"methods\": [{\"name\": \"cachedResources\", \"parameters\": []}, {\"name\": \"resourceContent\", \"parameters\": [{\"name\": \"frameId\"}, {\"name\": \"url\"}, {\"name\": \"base64Encode\"}]}, {\"name\": \"setExtraHeaders\", \"parameters\": [{\"name\": \"headers\"}]}]}, {\"name\": \"Database\", \"methods\": [{\"name\": \"getDatabaseTableNames\", \"parameters\": [{\"name\": \"databaseId\"}]}, {\"name\": \"executeSQL\", \"parameters\": [{\"name\": \"databaseId\"}, {\"name\": \"query\"}]}]}, {\"name\": \"DOMStorage\", \"methods\": [{\"name\": \"getDOMStorageEntries\", \"parameters\": [{\"name\": \"storageId\"}]}, {\"name\": \"setDOMStorageItem\", \"parameters\": [{\"name\": \"storageId\"}, {\"name\": \"key\"}, {\"name\": \"value\"}]}, {\"name\": \"removeDOMStorageItem\", \"parameters\": [{\"name\": \"storageId\"}, {\"name\": \"key\"}]}]}, {\"name\": \"ApplicationCache\", \"methods\": [{\"name\": \"getApplicationCaches\", \"parameters\": []}]}, {\"name\": \"DOM\", \"methods\": [{\"name\": \"getChildNodes\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"setAttribute\", \"parameters\": [{\"name\": \"elementId\"}, {\"name\": \"name\"}, {\"name\": \"value\"}]}, {\"name\": \"removeAttribute\", \"parameters\": [{\"name\": \"elementId\"}, {\"name\": \"name\"}]}, {\"name\": \"setTextNodeValue\", \"parameters\": [{\"name\": \"nodeId\"}, {\"name\": \"value\"}]}, {\"name\": \"getEventListenersForNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"copyNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"removeNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"changeTagName\", \"parameters\": [{\"name\": \"nodeId\"}, {\"name\": \"newTagName\"}]}, {\"name\": \"getOuterHTML\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"setOuterHTML\", \"parameters\": [{\"name\": \"nodeId\"}, {\"name\": \"outerHTML\"}]}, {\"name\": \"addInspectedNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"performSearch\", \"parameters\": [{\"name\": \"query\"}, {\"name\": \"runSynchronously\"}]}, {\"name\": \"searchCanceled\", \"parameters\": []}, {\"name\": \"pushNodeByPathToFrontend\", \"parameters\": [{\"name\": \"path\"}]}, {\"name\": \"resolveNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"getNodeProperties\", \"parameters\": [{\"name\": \"nodeId\"}, {\"name\": \"propertiesArray\"}]}, {\"name\": \"getNodePrototypes\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"pushNodeToFrontend\", \"parameters\": [{\"name\": \"objectId\"}]}]}, {\"name\": \"CSS\", \"methods\": [{\"name\": \"getStylesForNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"getComputedStyleForNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"getInlineStyleForNode\", \"parameters\": [{\"name\": \"nodeId\"}]}, {\"name\": \"getAllStyles\", \"parameters\": []}, {\"name\": \"getStyleSheet\", \"parameters\": [{\"name\": \"styleSheetId\"}]}, {\"name\": \"getStyleSheetText\", \"parameters\": [{\"name\": \"styleSheetId\"}]}, {\"name\": \"setStyleSheetText\", \"parameters\": [{\"name\": \"styleSheetId\"}, {\"name\": \"text\"}]}, {\"name\": \"setPropertyText\", \"parameters\": [{\"name\": \"styleId\"}, {\"name\": \"propertyIndex\"}, {\"name\": \"text\"}, {\"name\": \"overwrite\"}]}, {\"name\": \"toggleProperty\", \"parameters\": [{\"name\": \"styleId\"}, {\"name\": \"propertyIndex\"}, {\"name\": \"disable\"}]}, {\"name\": \"setRuleSelector\", \"parameters\": [{\"name\": \"ruleId\"}, {\"name\": \"selector\"}]}, {\"name\": \"addRule\", \"parameters\": [{\"name\": \"contextNodeId\"}, {\"name\": \"selector\"}]}, {\"name\": \"getSupportedCSSProperties\", \"parameters\": []}, {\"name\": \"querySelectorAll\", \"parameters\": [{\"name\": \"documentId\"}, {\"name\": \"selector\"}]}]}, {\"name\": \"Timeline\", \"methods\": []}, {\"name\": \"Debugger\", \"methods\": [{\"name\": \"activateBreakpoints\", \"parameters\": []}, {\"name\": \"deactivateBreakpoints\", \"parameters\": []}, {\"name\": \"setJavaScriptBreakpoint\", \"parameters\": [{\"name\": \"url\"}, {\"name\": \"lineNumber\"}, {\"name\": \"columnNumber\"}, {\"name\": \"condition\"}, {\"name\": \"enabled\"}]}, {\"name\": \"setJavaScriptBreakpointBySourceId\", \"parameters\": [{\"name\": \"sourceId\"}, {\"name\": \"lineNumber\"}, {\"name\": \"columnNumber\"}, {\"name\": \"condition\"}, {\"name\": \"enabled\"}]}, {\"name\": \"removeJavaScriptBreakpoint\", \"parameters\": [{\"name\": \"breakpointId\"}]}, {\"name\": \"continueToLocation\", \"parameters\": [{\"name\": \"sourceId\"}, {\"name\": \"lineNumber\"}, {\"name\": \"columnNumber\"}]}, {\"name\": \"stepOver\", \"parameters\": []}, {\"name\": \"stepInto\", \"parameters\": []}, {\"name\": \"stepOut\", \"parameters\": []}, {\"name\": \"pause\", \"parameters\": []}, {\"name\": \"resume\", \"parameters\": []}, {\"name\": \"editScriptSource\", \"parameters\": [{\"name\": \"sourceID\"}, {\"name\": \"newContent\"}]}, {\"name\": \"getScriptSource\", \"parameters\": [{\"name\": \"sourceID\"}]}, {\"name\": \"setPauseOnExceptionsState\", \"parameters\": [{\"name\": \"pauseOnExceptionsState\"}]}, {\"name\": \"evaluateOnCallFrame\", \"parameters\": [{\"name\": \"callFrameId\"}, {\"name\": \"expression\"}, {\"name\": \"objectGroup\"}, {\"name\": \"includeCommandLineAPI\"}]}, {\"name\": \"getCompletionsOnCallFrame\", \"parameters\": [{\"name\": \"callFrameId\"}, {\"name\": \"expression\"}, {\"name\": \"includeCommandLineAPI\"}]}]}, {\"name\": \"BrowserDebugger\", \"methods\": [{\"name\": \"setAllBrowserBreakpoints\", \"parameters\": [{\"name\": \"breakpoints\"}]}, {\"name\": \"setDOMBreakpoint\", \"parameters\": [{\"name\": \"nodeId\"}, {\"name\": \"type\"}]}, {\"name\": \"removeDOMBreakpoint\", \"parameters\": [{\"name\": \"nodeId\"}, {\"name\": \"type\"}]}, {\"name\": \"setEventListenerBreakpoint\", \"parameters\": [{\"name\": \"eventName\"}]}, {\"name\": \"removeEventListenerBreakpoint\", \"parameters\": [{\"name\": \"eventName\"}]}, {\"name\": \"setXHRBreakpoint\", \"parameters\": [{\"name\": \"url\"}]}, {\"name\": \"removeXHRBreakpoint\", \"parameters\": [{\"name\": \"url\"}]}]}, {\"name\": \"Profiler\", \"methods\": [{\"name\": \"getProfileHeaders\", \"parameters\": []}, {\"name\": \"getProfile\", \"parameters\": [{\"name\": \"type\"}, {\"name\": \"uid\"}]}, {\"name\": \"removeProfile\", \"parameters\": [{\"name\": \"type\"}, {\"name\": \"uid\"}]}, {\"name\": \"clearProfiles\", \"parameters\": []}, {\"name\": \"takeHeapSnapshot\", \"parameters\": [{\"name\": \"detailed\"}]}]}, {\"name\": \"InspectorNotify\", \"methods\": [{\"parameters\": [], \"name\": \"frontendReused\"}, {\"parameters\": [{\"name\": \"nodeIds\"}], \"name\": \"addNodesToSearchResult\"}, {\"parameters\": [], \"name\": \"bringToFront\"}, {\"parameters\": [], \"name\": \"disconnectFromBackend\"}, {\"parameters\": [{\"name\": \"url\"}], \"name\": \"inspectedURLChanged\"}, {\"parameters\": [{\"name\": \"time\"}], \"name\": \"domContentEventFired\"}, {\"parameters\": [{\"name\": \"time\"}], \"name\": \"loadEventFired\"}, {\"parameters\": [], \"name\": \"reset\"}, {\"parameters\": [{\"name\": \"panel\"}], \"name\": \"showPanel\"}, {\"parameters\": [{\"name\": \"testCallId\"}, {\"name\": \"script\"}], \"name\": \"evaluateForTestInFrontend\"}, {\"parameters\": [{\"name\": \"nodeId\"}], \"name\": \"updateFocusedNode\"}]}, {\"name\": \"ConsoleNotify\", \"methods\": [{\"parameters\": [{\"name\": \"messageObj\"}], \"name\": \"addConsoleMessage\"}, {\"parameters\": [{\"name\": \"count\"}], \"name\": \"updateConsoleMessageExpiredCount\"}, {\"parameters\": [{\"name\": \"count\"}], \"name\": \"updateConsoleMessageRepeatCount\"}, {\"parameters\": [], \"name\": \"consoleMessagesCleared\"}]}, {\"name\": \"NetworkNotify\", \"methods\": [{\"parameters\": [{\"name\": \"frameId\"}], \"name\": \"frameDetachedFromParent\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"url\"}, {\"name\": \"loader\"}, {\"name\": \"callStack\"}], \"name\": \"identifierForInitialRequest\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"time\"}, {\"name\": \"request\"}, {\"name\": \"redirectResponse\"}], \"name\": \"willSendRequest\"}, {\"parameters\": [{\"name\": \"identifier\"}], \"name\": \"markResourceAsCached\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"time\"}, {\"name\": \"resourceType\"}, {\"name\": \"response\"}], \"name\": \"didReceiveResponse\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"time\"}, {\"name\": \"lengthReceived\"}], \"name\": \"didReceiveContentLength\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"finishTime\"}], \"name\": \"didFinishLoading\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"time\"}, {\"name\": \"localizedDescription\"}], \"name\": \"didFailLoading\"}, {\"parameters\": [{\"name\": \"time\"}, {\"name\": \"resource\"}], \"name\": \"didLoadResourceFromMemoryCache\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"sourceString\"}, {\"name\": \"type\"}], \"name\": \"setInitialContent\"}, {\"parameters\": [{\"name\": \"frame\"}, {\"name\": \"loader\"}], \"name\": \"didCommitLoadForFrame\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"requestURL\"}], \"name\": \"didCreateWebSocket\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"time\"}, {\"name\": \"request\"}], \"name\": \"willSendWebSocketHandshakeRequest\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"time\"}, {\"name\": \"response\"}], \"name\": \"didReceiveWebSocketHandshakeResponse\"}, {\"parameters\": [{\"name\": \"identifier\"}, {\"name\": \"time\"}], \"name\": \"didCloseWebSocket\"}]}, {\"name\": \"DatabaseNotify\", \"methods\": [{\"parameters\": [{\"name\": \"database\"}], \"name\": \"addDatabase\"}, {\"parameters\": [{\"name\": \"databaseId\"}], \"name\": \"selectDatabase\"}, {\"parameters\": [{\"name\": \"transactionId\"}, {\"name\": \"columnNames\"}, {\"name\": \"values\"}], \"name\": \"sqlTransactionSucceeded\"}, {\"parameters\": [{\"name\": \"transactionId\"}, {\"name\": \"sqlError\"}], \"name\": \"sqlTransactionFailed\"}]}, {\"name\": \"DOMStorageNotify\", \"methods\": [{\"parameters\": [{\"name\": \"storage\"}], \"name\": \"addDOMStorage\"}, {\"parameters\": [{\"name\": \"storageId\"}], \"name\": \"updateDOMStorage\"}, {\"parameters\": [{\"name\": \"storageId\"}], \"name\": \"selectDOMStorage\"}]}, {\"name\": \"ApplicationCacheNotify\", \"methods\": [{\"parameters\": [{\"name\": \"status\"}], \"name\": \"updateApplicationCacheStatus\"}, {\"parameters\": [{\"name\": \"isNowOnline\"}], \"name\": \"updateNetworkState\"}]}, {\"name\": \"DOMNotify\", \"methods\": [{\"parameters\": [{\"name\": \"root\"}], \"name\": \"setDocument\"}, {\"parameters\": [{\"name\": \"id\"}, {\"name\": \"attributes\"}], \"name\": \"attributesUpdated\"}, {\"parameters\": [{\"name\": \"id\"}, {\"name\": \"newValue\"}], \"name\": \"characterDataModified\"}, {\"parameters\": [{\"name\": \"parentId\"}, {\"name\": \"nodes\"}], \"name\": \"setChildNodes\"}, {\"parameters\": [{\"name\": \"root\"}], \"name\": \"setDetachedRoot\"}, {\"parameters\": [{\"name\": \"id\"}, {\"name\": \"newValue\"}], \"name\": \"childNodeCountUpdated\"}, {\"parameters\": [{\"name\": \"parentId\"}, {\"name\": \"prevId\"}, {\"name\": \"node\"}], \"name\": \"childNodeInserted\"}, {\"parameters\": [{\"name\": \"parentId\"}, {\"name\": \"id\"}], \"name\": \"childNodeRemoved\"}]}, {\"name\": \"TimelineNotify\", \"methods\": [{\"parameters\": [], \"name\": \"timelineProfilerWasStarted\"}, {\"parameters\": [], \"name\": \"timelineProfilerWasStopped\"}, {\"parameters\": [{\"name\": \"record\"}], \"name\": \"addRecordToTimeline\"}]}, {\"name\": \"DebuggerNotify\", \"methods\": [{\"parameters\": [], \"name\": \"debuggerWasEnabled\"}, {\"parameters\": [], \"name\": \"debuggerWasDisabled\"}, {\"parameters\": [{\"name\": \"sourceID\"}, {\"name\": \"url\"}, {\"name\": \"lineOffset\"}, {\"name\": \"columnOffset\"}, {\"name\": \"length\"}, {\"name\": \"scriptWorldType\"}], \"name\": \"parsedScriptSource\"}, {\"parameters\": [{\"name\": \"url\"}, {\"name\": \"data\"}, {\"name\": \"firstLine\"}, {\"name\": \"errorLine\"}, {\"name\": \"errorMessage\"}], \"name\": \"failedToParseScriptSource\"}, {\"parameters\": [{\"name\": \"breakpointId\"}, {\"name\": \"sourceId\"}, {\"name\": \"lineNumber\"}, {\"name\": \"columnNumber\"}], \"name\": \"breakpointResolved\"}, {\"parameters\": [{\"name\": \"details\"}], \"name\": \"pausedScript\"}, {\"parameters\": [], \"name\": \"resumedScript\"}, {\"parameters\": [{\"name\": \"id\"}, {\"name\": \"url\"}, {\"name\": \"isShared\"}], \"name\": \"didCreateWorker\"}, {\"parameters\": [{\"name\": \"id\"}], \"name\": \"didDestroyWorker\"}]}, {\"name\": \"ProfilerNotify\", \"methods\": [{\"parameters\": [], \"name\": \"profilerWasEnabled\"}, {\"parameters\": [], \"name\": \"profilerWasDisabled\"}, {\"parameters\": [{\"name\": \"header\"}], \"name\": \"addProfileHeader\"}, {\"parameters\": [{\"name\": \"uid\"}, {\"name\": \"chunk\"}], \"name\": \"addHeapSnapshotChunk\"}, {\"parameters\": [{\"name\": \"uid\"}], \"name\": \"finishHeapSnapshot\"}, {\"parameters\": [{\"name\": \"isProfiling\"}], \"name\": \"setRecordingProfile\"}, {\"parameters\": [], \"name\": \"resetProfiles\"}, {\"parameters\": [{\"name\": \"done\"}, {\"name\": \"total\"}], \"name\": \"reportHeapSnapshotProgress\"}]}], \"name\": \"core\"}, {\"interfaces\": [{\"name\": \"InspectorFrontendHost\", \"methods\": [{\"name\": \"loaded\", \"parameters\": []}, {\"name\": \"closeWindow\", \"parameters\": []}, {\"name\": \"disconnectFromBackend\", \"parameters\": []}, {\"name\": \"bringToFront\", \"parameters\": []}, {\"name\": \"inspectedURLChanged\", \"parameters\": [{\"name\": \"newURL\"}]}, {\"name\": \"requestAttachWindow\", \"parameters\": []}, {\"name\": \"requestDetachWindow\", \"parameters\": []}, {\"name\": \"setAttachedWindowHeight\", \"parameters\": [{\"name\": \"height\"}]}, {\"name\": \"moveWindowBy\", \"parameters\": [{\"name\": \"x\"}, {\"name\": \"y\"}]}, {\"name\": \"setExtensionAPI\", \"parameters\": [{\"name\": \"script\"}]}, {\"name\": \"localizedStringsURL\", \"parameters\": []}, {\"name\": \"hiddenPanels\", \"parameters\": []}, {\"name\": \"copyText\", \"parameters\": [{\"name\": \"text\"}]}, {\"parameters\": [], \"name\": \"platform\"}, {\"parameters\": [], \"name\": \"port\"}, {\"parameters\": [{\"name\": \"event\"}, {\"name\": \"items\"}], \"name\": \"showContextMenu\"}, {\"name\": \"sendMessageToBackend\", \"parameters\": [{\"name\": \"message\"}]}]}], \"name\": \"core\"}, {\"interfaces\": [{\"name\": \"WeinreClientCommands\", \"methods\": [{\"name\": \"registerClient\", \"parameters\": []}, {\"name\": \"getTargets\", \"parameters\": []}, {\"name\": \"getClients\", \"parameters\": []}, {\"name\": \"connectTarget\", \"parameters\": [{\"name\": \"clientId\"}, {\"name\": \"targetId\"}]}, {\"name\": \"disconnectTarget\", \"parameters\": [{\"name\": \"clientId\"}]}, {\"name\": \"getExtensions\", \"parameters\": []}, {\"name\": \"logDebug\", \"parameters\": [{\"name\": \"message\"}]}, {\"name\": \"logInfo\", \"parameters\": [{\"name\": \"message\"}]}, {\"name\": \"logWarning\", \"parameters\": [{\"name\": \"message\"}]}, {\"name\": \"logError\", \"parameters\": [{\"name\": \"message\"}]}]}], \"name\": \"weinre\"}, {\"interfaces\": [{\"name\": \"WeinreClientEvents\", \"methods\": [{\"name\": \"clientRegistered\", \"parameters\": [{\"name\": \"client\"}]}, {\"name\": \"targetRegistered\", \"parameters\": [{\"name\": \"target\"}]}, {\"name\": \"clientUnregistered\", \"parameters\": [{\"name\": \"clientId\"}]}, {\"name\": \"targetUnregistered\", \"parameters\": [{\"name\": \"targetId\"}]}, {\"name\": \"connectionCreated\", \"parameters\": [{\"name\": \"clientId\"}, {\"name\": \"targetId\"}]}, {\"name\": \"connectionDestroyed\", \"parameters\": [{\"name\": \"clientId\"}, {\"name\": \"targetId\"}]}, {\"name\": \"sendCallback\", \"parameters\": [{\"name\": \"callbackId\"}, {\"name\": \"result\"}]}, {\"name\": \"serverProperties\", \"parameters\": [{\"name\": \"properties\"}]}]}], \"name\": \"weinre\"}, {\"interfaces\": [{\"name\": \"WeinreExtraClientCommands\", \"methods\": [{\"name\": \"getDatabases\", \"parameters\": []}]}], \"name\": \"weinre\"}, {\"interfaces\": [{\"name\": \"WeinreExtraTargetEvents\", \"methods\": [{\"name\": \"databaseOpened\", \"parameters\": [{\"name\": \"databaseRecord\"}]}]}], \"name\": \"weinre\"}, {\"interfaces\": [{\"name\": \"WeinreTargetCommands\", \"methods\": [{\"name\": \"registerTarget\", \"parameters\": [{\"name\": \"url\"}]}, {\"name\": \"sendClientCallback\", \"parameters\": [{\"name\": \"callbackId\"}, {\"name\": \"args\"}]}, {\"name\": \"logDebug\", \"parameters\": [{\"name\": \"message\"}]}, {\"name\": \"logInfo\", \"parameters\": [{\"name\": \"message\"}]}, {\"name\": \"logWarning\", \"parameters\": [{\"name\": \"message\"}]}, {\"name\": \"logError\", \"parameters\": [{\"name\": \"message\"}]}]}], \"name\": \"weinre\"}, {\"interfaces\": [{\"name\": \"WeinreTargetEvents\", \"methods\": [{\"name\": \"connectionCreated\", \"parameters\": [{\"name\": \"clientId\"}, {\"name\": \"targetId\"}]}, {\"name\": \"connectionDestroyed\", \"parameters\": [{\"name\": \"clientId\"}, {\"name\": \"targetId\"}]}, {\"name\": \"sendCallback\", \"parameters\": [{\"name\": \"callbackId\"}, {\"name\": \"result\"}]}]}], \"name\": \"weinre\"}])"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/all-json-idls.js",
    "content": "modjewel.require('weinre/common/Weinre').addIDLs([\n    {\n        \"interfaces\": [\n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"InjectedScriptHost\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"clearConsoleMessages\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"copyText\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMString\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"text\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"DOMObject\", \n                            \"name\": \"any\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ], \n                        \"name\": \"nodeForId\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"int\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMObject\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"node\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"withChildren\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"selectInUI\"\n                            }\n                        ], \n                        \"name\": \"pushNodePathToFrontend\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"long\", \n                            \"name\": \"int\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"inspectedNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"num\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"DOMObject\", \n                            \"name\": \"any\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMObject\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"object\"\n                            }\n                        ], \n                        \"name\": \"internalConstructorName\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"DOMObject\", \n                            \"name\": \"any\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"currentCallFrame\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMObject\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"database\"\n                            }\n                        ], \n                        \"name\": \"selectDatabase\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMObject\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"storage\"\n                            }\n                        ], \n                        \"name\": \"selectDOMStorage\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"didCreateWorker\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMString\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"isFakeWorker\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"didDestroyWorker\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"long\", \n                            \"name\": \"int\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"nextWorkerId\", \n                        \"parameters\": []\n                    }\n                ]\n            }\n        ], \n        \"name\": \"core\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Inspector\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"addScriptToEvaluateOnLoad\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"scriptSource\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"removeAllScriptsToEvaluateOnLoad\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"reloadPage\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"ignoreCache\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"populateScriptObjects\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"openInInspectedWindow\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"newState\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setSearchingForNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"enabled\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"didEvaluateForTestInFrontend\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"testCallId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"jsonResult\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"highlightDOMNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"hideDOMNodeHighlight\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"highlightFrame\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"frameId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"hideFrameHighlight\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setUserAgentOverride\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"userAgent\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"cookies\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"cookiesString\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getCookies\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"deleteCookie\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"cookieName\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"domain\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"startTimelineProfiler\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"stopTimelineProfiler\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"enableDebugger\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"disableDebugger\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"enableProfiler\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"disableProfiler\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"startProfiling\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"stopProfiling\", \n                        \"parameters\": []\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Runtime\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"evaluate\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"expression\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"objectGroup\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"includeCommandLineAPI\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getCompletions\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"expression\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"includeCommandLineAPI\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getProperties\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"objectId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"ignoreHasOwnProperty\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"abbreviate\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setPropertyValue\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"objectId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"propertyName\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"expression\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"releaseWrapperObjectGroup\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"injectedScriptId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"objectGroup\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"InjectedScript\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"evaluateOnSelf\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"functionBody\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"argumentsArray\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Console\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"newState\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setConsoleMessagesEnabled\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"enabled\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"clearConsoleMessages\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setMonitoringXHREnabled\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"enabled\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Network\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"resources\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"cachedResources\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"content\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"resourceContent\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"frameId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"base64Encode\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setExtraHeaders\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"headers\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Database\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"tableNames\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getDatabaseTableNames\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"databaseId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"transactionId\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"executeSQL\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"databaseId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"query\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"DOMStorage\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"entries\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getDOMStorageEntries\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"storageId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setDOMStorageItem\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"storageId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"key\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"value\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"removeDOMStorageItem\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"storageId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"key\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"ApplicationCache\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"applicationCaches\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getApplicationCaches\", \n                        \"parameters\": []\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"DOM\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"getChildNodes\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setAttribute\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"elementId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"name\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"value\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"removeAttribute\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"elementId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"name\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setTextNodeValue\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"value\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"outNodeId\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"listenersArray\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getEventListenersForNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"copyNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"outNodeId\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"removeNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"outNodeId\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"changeTagName\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"newTagName\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"outerHTML\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getOuterHTML\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"outNodeId\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setOuterHTML\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"outerHTML\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"addInspectedNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"performSearch\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"query\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"runSynchronously\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"searchCanceled\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"pushNodeByPathToFrontend\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"path\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"resolveNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getNodeProperties\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"propertiesArray\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getNodePrototypes\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"pushNodeToFrontend\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"objectId\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"CSS\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"styles\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getStylesForNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"style\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getComputedStyleForNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"style\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getInlineStyleForNode\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"styleSheetIds\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getAllStyles\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"styleSheet\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getStyleSheet\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"styleSheetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"text\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getStyleSheetText\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"styleSheetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setStyleSheetText\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"styleSheetId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"text\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"style\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setPropertyText\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"styleId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"propertyIndex\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"text\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"overwrite\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"style\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"toggleProperty\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"styleId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"propertyIndex\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"disable\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"rule\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setRuleSelector\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"ruleId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"selector\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"rule\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"addRule\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"contextNodeId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"selector\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"cssProperties\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getSupportedCSSProperties\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"querySelectorAll\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"documentId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"selector\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Timeline\", \n                \"methods\": []\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Debugger\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"activateBreakpoints\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"deactivateBreakpoints\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"breakpointId\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"locations\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setJavaScriptBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"lineNumber\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"columnNumber\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"condition\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"enabled\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"breakpointId\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"actualLineNumber\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"actualColumnNumber\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setJavaScriptBreakpointBySourceId\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"sourceId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"lineNumber\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"columnNumber\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"condition\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"enabled\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"removeJavaScriptBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"breakpointId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"continueToLocation\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"sourceId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"lineNumber\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"columnNumber\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"stepOver\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"stepInto\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"stepOut\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"pause\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"resume\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"success\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"newCallFrames\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"editScriptSource\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"sourceID\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"newContent\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"scriptSource\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getScriptSource\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"sourceID\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"newState\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"setPauseOnExceptionsState\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"pauseOnExceptionsState\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"evaluateOnCallFrame\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"callFrameId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"expression\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"objectGroup\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"includeCommandLineAPI\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getCompletionsOnCallFrame\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"callFrameId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"expression\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"includeCommandLineAPI\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"BrowserDebugger\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setAllBrowserBreakpoints\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"breakpoints\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setDOMBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"type\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"removeDOMBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"type\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setEventListenerBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"eventName\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"removeEventListenerBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"eventName\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setXHRBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"removeXHRBreakpoint\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"Profiler\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"headers\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getProfileHeaders\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"profile\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getProfile\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"type\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"uid\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"removeProfile\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"type\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"uid\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"clearProfiles\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"takeHeapSnapshot\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"detailed\"\n                            }\n                        ]\n                    }\n                ]\n            }, \n            {\n                \"name\": \"InspectorNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"frontendReused\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"nodeIds\"\n                            }\n                        ], \n                        \"name\": \"addNodesToSearchResult\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"bringToFront\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"disconnectFromBackend\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }\n                        ], \n                        \"name\": \"inspectedURLChanged\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }\n                        ], \n                        \"name\": \"domContentEventFired\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }\n                        ], \n                        \"name\": \"loadEventFired\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"reset\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"panel\"\n                            }\n                        ], \n                        \"name\": \"showPanel\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"testCallId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"script\"\n                            }\n                        ], \n                        \"name\": \"evaluateForTestInFrontend\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"nodeId\"\n                            }\n                        ], \n                        \"name\": \"updateFocusedNode\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"ConsoleNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"messageObj\"\n                            }\n                        ], \n                        \"name\": \"addConsoleMessage\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"count\"\n                            }\n                        ], \n                        \"name\": \"updateConsoleMessageExpiredCount\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"count\"\n                            }\n                        ], \n                        \"name\": \"updateConsoleMessageRepeatCount\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"consoleMessagesCleared\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"NetworkNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"frameId\"\n                            }\n                        ], \n                        \"name\": \"frameDetachedFromParent\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"loader\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"callStack\"\n                            }\n                        ], \n                        \"name\": \"identifierForInitialRequest\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"request\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"redirectResponse\"\n                            }\n                        ], \n                        \"name\": \"willSendRequest\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }\n                        ], \n                        \"name\": \"markResourceAsCached\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"resourceType\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"response\"\n                            }\n                        ], \n                        \"name\": \"didReceiveResponse\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"lengthReceived\"\n                            }\n                        ], \n                        \"name\": \"didReceiveContentLength\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"finishTime\"\n                            }\n                        ], \n                        \"name\": \"didFinishLoading\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"localizedDescription\"\n                            }\n                        ], \n                        \"name\": \"didFailLoading\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"resource\"\n                            }\n                        ], \n                        \"name\": \"didLoadResourceFromMemoryCache\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"sourceString\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"type\"\n                            }\n                        ], \n                        \"name\": \"setInitialContent\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"frame\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"loader\"\n                            }\n                        ], \n                        \"name\": \"didCommitLoadForFrame\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"requestURL\"\n                            }\n                        ], \n                        \"name\": \"didCreateWebSocket\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"request\"\n                            }\n                        ], \n                        \"name\": \"willSendWebSocketHandshakeRequest\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"response\"\n                            }\n                        ], \n                        \"name\": \"didReceiveWebSocketHandshakeResponse\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"identifier\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"double\", \n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"time\"\n                            }\n                        ], \n                        \"name\": \"didCloseWebSocket\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"DatabaseNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"database\"\n                            }\n                        ], \n                        \"name\": \"addDatabase\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"databaseId\"\n                            }\n                        ], \n                        \"name\": \"selectDatabase\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"transactionId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"columnNames\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"values\"\n                            }\n                        ], \n                        \"name\": \"sqlTransactionSucceeded\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"transactionId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"sqlError\"\n                            }\n                        ], \n                        \"name\": \"sqlTransactionFailed\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"DOMStorageNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"storage\"\n                            }\n                        ], \n                        \"name\": \"addDOMStorage\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"storageId\"\n                            }\n                        ], \n                        \"name\": \"updateDOMStorage\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"storageId\"\n                            }\n                        ], \n                        \"name\": \"selectDOMStorage\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"ApplicationCacheNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"status\"\n                            }\n                        ], \n                        \"name\": \"updateApplicationCacheStatus\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"isNowOnline\"\n                            }\n                        ], \n                        \"name\": \"updateNetworkState\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"DOMNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Value\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"root\"\n                            }\n                        ], \n                        \"name\": \"setDocument\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"attributes\"\n                            }\n                        ], \n                        \"name\": \"attributesUpdated\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"newValue\"\n                            }\n                        ], \n                        \"name\": \"characterDataModified\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"parentId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"nodes\"\n                            }\n                        ], \n                        \"name\": \"setChildNodes\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"root\"\n                            }\n                        ], \n                        \"name\": \"setDetachedRoot\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"newValue\"\n                            }\n                        ], \n                        \"name\": \"childNodeCountUpdated\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"parentId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"prevId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"node\"\n                            }\n                        ], \n                        \"name\": \"childNodeInserted\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"parentId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }\n                        ], \n                        \"name\": \"childNodeRemoved\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"TimelineNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"timelineProfilerWasStarted\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"timelineProfilerWasStopped\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"record\"\n                            }\n                        ], \n                        \"name\": \"addRecordToTimeline\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"DebuggerNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"debuggerWasEnabled\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"debuggerWasDisabled\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"sourceID\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"lineOffset\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"columnOffset\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"length\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"scriptWorldType\"\n                            }\n                        ], \n                        \"name\": \"parsedScriptSource\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"data\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"firstLine\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"errorLine\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"errorMessage\"\n                            }\n                        ], \n                        \"name\": \"failedToParseScriptSource\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"breakpointId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"sourceId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"lineNumber\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"columnNumber\"\n                            }\n                        ], \n                        \"name\": \"breakpointResolved\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"details\"\n                            }\n                        ], \n                        \"name\": \"pausedScript\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"resumedScript\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"url\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"isShared\"\n                            }\n                        ], \n                        \"name\": \"didCreateWorker\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"long\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"id\"\n                            }\n                        ], \n                        \"name\": \"didDestroyWorker\"\n                    }\n                ]\n            }, \n            {\n                \"name\": \"ProfilerNotify\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"profilerWasEnabled\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"profilerWasDisabled\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"header\"\n                            }\n                        ], \n                        \"name\": \"addProfileHeader\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"uid\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"String\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"chunk\"\n                            }\n                        ], \n                        \"name\": \"addHeapSnapshotChunk\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"uid\"\n                            }\n                        ], \n                        \"name\": \"finishHeapSnapshot\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"boolean\"\n                                }, \n                                \"name\": \"isProfiling\"\n                            }\n                        ], \n                        \"name\": \"setRecordingProfile\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"resetProfiles\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"notify\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"done\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"total\"\n                            }\n                        ], \n                        \"name\": \"reportHeapSnapshotProgress\"\n                    }\n                ]\n            }\n        ], \n        \"name\": \"core\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"extendedAttributes\": {\n                    \"Conditional\": \"INSPECTOR\"\n                }, \n                \"name\": \"InspectorFrontendHost\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"loaded\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"closeWindow\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"disconnectFromBackend\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"bringToFront\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"inspectedURLChanged\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMString\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"newURL\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"requestAttachWindow\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"requestDetachWindow\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setAttachedWindowHeight\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"unsigned\", \n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"height\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"moveWindowBy\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"x\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"float\"\n                                }, \n                                \"name\": \"y\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"setExtensionAPI\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMString\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"script\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"DOMString\", \n                            \"name\": \"string\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"localizedStringsURL\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"DOMString\", \n                            \"name\": \"string\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"hiddenPanels\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"copyText\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMString\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"text\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"DOMString\", \n                            \"name\": \"string\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"platform\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"originalName\": \"DOMString\", \n                            \"name\": \"string\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [], \n                        \"name\": \"port\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"extendedAttributes\": {\n                            \"Custom\": true\n                        }, \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"MouseEvent\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"event\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMObject\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"items\"\n                            }\n                        ], \n                        \"name\": \"showContextMenu\"\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"sendMessageToBackend\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"DOMString\", \n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        ], \n        \"name\": \"core\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"name\": \"WeinreClientCommands\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"registerClient\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"targets\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getTargets\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"clients\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getClients\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"connectTarget\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"targetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"disconnectTarget\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"extensions\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getExtensions\", \n                        \"parameters\": []\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logDebug\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logInfo\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logWarning\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logError\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        ], \n        \"name\": \"weinre\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"name\": \"WeinreClientEvents\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"clientRegistered\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"client\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"targetRegistered\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"target\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"clientUnregistered\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"targetUnregistered\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"targetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"connectionCreated\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"targetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"connectionDestroyed\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"targetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"sendCallback\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"callbackId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"serverProperties\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"properties\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        ], \n        \"name\": \"weinre\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"name\": \"WeinreExtraClientCommands\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\", \n                                    \"rank\": 1\n                                }, \n                                \"name\": \"databaseRecords\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"getDatabases\", \n                        \"parameters\": []\n                    }\n                ]\n            }\n        ], \n        \"name\": \"weinre\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"name\": \"WeinreExtraTargetEvents\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"databaseOpened\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"databaseRecord\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        ], \n        \"name\": \"weinre\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"name\": \"WeinreTargetCommands\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"targetId\", \n                                \"out\": true\n                            }\n                        ], \n                        \"name\": \"registerTarget\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"int\"\n                                }, \n                                \"name\": \"url\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"sendClientCallback\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"callbackId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"args\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logDebug\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logInfo\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logWarning\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"logError\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"message\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        ], \n        \"name\": \"weinre\"\n    }, \n    {\n        \"interfaces\": [\n            {\n                \"name\": \"WeinreTargetEvents\", \n                \"methods\": [\n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"connectionCreated\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"targetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"connectionDestroyed\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"clientId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"targetId\"\n                            }\n                        ]\n                    }, \n                    {\n                        \"returns\": {\n                            \"name\": \"void\"\n                        }, \n                        \"callbackParameters\": [], \n                        \"name\": \"sendCallback\", \n                        \"parameters\": [\n                            {\n                                \"type\": {\n                                    \"name\": \"string\"\n                                }, \n                                \"name\": \"callbackId\"\n                            }, \n                            {\n                                \"type\": {\n                                    \"originalName\": \"Object\", \n                                    \"name\": \"any\"\n                                }, \n                                \"name\": \"result\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        ], \n        \"name\": \"weinre\"\n    }\n])"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/interfaces.css",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n#browser {\n    margin-top:  1em;\n}\n\n#interface-picker {\n    float:         left;\n    margin-right:  1.0em;\n    padding-right: 1.0em;\n    border-right:  thin solid;\n}\n\n#interface-picker h2, #interface-content h2 {\n    margin-top:    0.0em;\n    border-bottom: thin solid;\n}\n\n#interface-content {\n    overflow:     hidden;\n    padding-left: 1.0em;\n}\n\n#interface-list li {\n    list-style-type: none;\n}\n\n#interface-body pre {\n    margin-left: 2.0em;\n    white-space: pre;\n    overflow:    auto;\n}\n\n.tdIndent {\n    margin-left: 1.0em;\n}\n\n.indent {\n    white-space: pre;\n}\n\n.attributeName, .methodName, .interfaceName {\n    font-weight: bold;\n}\n\n.type {\n    z-font-style: italic;\n}\n\n.parameterName {\n    color:      #0A0;\n}\n\nh3 {\n    border:                thin solid;\n    -moz-border-radius:    0.5em;\n    -webkit-border-radius: 0.5em;\n    background-color:      #EEE;\n    padding-left:          1.0em;\n}\n\na, a:hover, a:visited, .type {\n    color:      #00A;\n}\n\n@media print {\n    .noprint {\n        display: none;\n    }\n\n    body {\n        font-size: 60%;\n    }\n}\n"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/interfaces.html",
    "content": "<!doctype html>\n\n<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n\n    <head>\n        <title>weinre interfaces</title>\n        <link rel=\"stylesheet\" href=\"interfaces.css\">\n        <script src=\"/modjewel.js\"></script>\n        <script type=\"text/javascript\">require(\"modjewel\").warnOnRecursiveRequire(true)</script>\n        <script src=\"/weinre/common/Weinre.transportd.js\"></script>\n        <script src=\"/weinre/common/Ex.transportd.js\"></script>\n        <script src=\"/weinre/common/StackTrace.transportd.js\"></script>\n        <script src=\"/weinre/common/IDLTools.transportd.js\"></script>\n        <script src=\"/weinre/common/Callback.transportd.js\"></script>\n        <script src=\"/weinre/common/MethodNamer.transportd.js\"></script>\n\n        <script src=\"all-json-idls.js\"></script>\n\n        <script src=\"interfaces.js\"></script>\n    </head>\n\n    <body>\n        <h1>weinre interfaces</h1>\n\n        <div class=\"noprint\">\n            show:\n            <label><input id=\"show-Idl\"        type=\"checkbox\" checked=\"on\"> IDL</label> /\n            <label><input id=\"show-JavaScript\" type=\"checkbox\" checked=\"on\"> JavaScript</label> /\n            <label><input id=\"show-Java\"       type=\"checkbox\" checked=\"on\"> Java</label>\n        </div>\n\n        <div id=\"browser\">\n            <div id=\"interface-picker\" class=\"noprint\">\n                <h2>Interfaces</h2>\n                <ul id=\"interface-list\">\n                    <li>interface 1\n                    <li>interface 2\n                    <li>interface 3\n                </ul>\n            </div>\n\n            <div id=\"interface-content\">\n                <h2 id=\"interface-name\">[ nothing selected ]</h2>\n                <div id=\"interface-body\">\n                    [ nothing selected ]\n                </div>\n            </div>\n        </div>\n    </body>\n\n</html>\n"
  },
  {
    "path": "buildin_modules/weinre/web/interfaces/interfaces.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n;(function(){\n\nwindow.addEventListener(\"load\", onLoad, false)\n\nvar Interfaces = {}\nvar Indent     = \"<span class='indent'>   </span>\"\nvar Indent2    = \"<span class='indent'>      </span>\"\n\nvar e_interfaceList\nvar e_interfaceName\nvar e_interfaceBody\nvar e_showIdl\nvar e_showJavaScript\nvar e_showJava\n\nvar NativeTypes = \"int any number boolean string void\".split(\" \")\n\nvar IDLTools = require(\"weinre/common/IDLTools\")\n\nif (!window.localStorage) {\n    window.localStorage = {\n        getItem: function() {},\n        setItem: function() {}\n    }\n}\n\n//-----------------------------------------------------------------------------\nfunction onLoad() {\n    e_interfaceList  = document.getElementById(\"interface-list\")\n    e_interfaceName  = document.getElementById(\"interface-name\")\n    e_interfaceBody  = document.getElementById(\"interface-body\")\n    e_showIdl        = document.getElementById(\"show-Idl\")\n    e_showJavaScript = document.getElementById(\"show-JavaScript\")\n    e_showJava       = document.getElementById(\"show-Java\")\n\n    setUpShowCheckBoxes()\n    populateInterfacesList(IDLTools.getIDLsMatching(/.*/))\n}\n\n//-----------------------------------------------------------------------------\nfunction setUpShowCheckBoxes() {\n    setUpShowCheckBox(e_showIdl,        \"show-Idl\")\n    setUpShowCheckBox(e_showJavaScript, \"show-JavaScript\")\n    setUpShowCheckBox(e_showJava,       \"show-Java\")\n}\n\n//-----------------------------------------------------------------------------\nfunction setUpShowCheckBox(element, key) {\n    var value = localStorage.getItem(key)\n    if (null == value)\n        value = true\n    else\n        value = (value == \"true\")\n\n    element.checked    = value\n    element.storageKey = key\n\n    element.addEventListener(\"click\", el_showCheckBoxClicked, false)\n}\n\n//-----------------------------------------------------------------------------\nfunction el_showCheckBoxClicked(event) {\n    var element = event.target\n\n    localStorage.setItem(element.storageKey, element.checked)\n\n    reapplyDisplayStyle(\".\" + element.storageKey, element.checked)\n}\n\n//-----------------------------------------------------------------------------\nfunction reapplyDisplayStyles() {\n    reapplyDisplayStyle(\".show-Idl\",        e_showIdl.checked)\n    reapplyDisplayStyle(\".show-JavaScript\", e_showJavaScript.checked)\n    reapplyDisplayStyle(\".show-Java\",       e_showJava.checked)\n}\n\n//-----------------------------------------------------------------------------\nfunction reapplyDisplayStyle(className, value) {\n    value = value ? \"block\" : \"none\"\n    ;[].slice.call(document.querySelectorAll(className)).forEach(function(element) {\n        element.style.display = value\n    })\n}\n\n//-----------------------------------------------------------------------------\nfunction populateInterfacesList(intfs) {\n    e_interfaceList.innerHTML = \"\"\n\n    fixedIntfs = []\n    intfs.forEach(function(intf){\n        fixedIntfs.push(intf.name)\n        Interfaces[intf.name] = intf\n\n        if (!intf.methods)    intf.methods    = []\n        if (!intf.attributes) intf.attributes = []\n    })\n\n    intfs = fixedIntfs\n\n    intfs.sort()\n    intfs.forEach(function(intf){\n        var a  = document.createElement(\"a\")\n        a.href          = \"#\"\n        a.innerHTML     = intf\n        a.interfaceName = intf\n        a.addEventListener(\"click\", el_interfaceClicked, false)\n\n        var li = document.createElement(\"li\")\n        li.appendChild(a)\n        e_interfaceList.appendChild(li)\n    })\n}\n\n//-----------------------------------------------------------------------------\nfunction el_interfaceClicked(event) {\n    event.preventDefault()\n\n    showInterface(event.target.interfaceName)\n}\n\n//-----------------------------------------------------------------------------\nfunction showInterface(interfaceName) {\n    var intf = Interfaces[interfaceName]\n\n    e_interfaceName.innerHTML = interfaceName\n\n    var html = []\n\n    showInterfaceIdl(intf, html)\n    showInterfaceJavaScript(intf, html)\n    showInterfaceJava(intf, html)\n\n    e_interfaceBody.innerHTML = html.join(\"\\n\")\n\n    reapplyDisplayStyles()\n}\n\nwindow.showInterface = showInterface\n\n//-----------------------------------------------------------------------------\nfunction showInterfaceIdl(intf, html) {\n    html.push(\"<div class='show-Idl'><h3>IDL</h3><pre>\")\n    html.push(\"interface {\")\n\n    intf.methods.forEach(function(method){\n        showInterfaceIdlMethod(method, html)\n    })\n\n    if (intf.attributes.length > 0) html.push(\"<table>\")\n    intf.attributes.forEach(function(attribute){\n        showInterfaceIdlAttribute(attribute, html)\n    })\n    if (intf.attributes.length > 0) html.push(\"</table>\")\n\n    html.push(\"};\")\n    html.push(\"</pre></div>\")\n}\n\n//-----------------------------------------------------------------------------\nfunction showInterfaceIdlMethod(method, html) {\n    var line = \"\\n   \"\n\n    var allParameters = method.parameters.concat(method.callbackParameters)\n\n    line += getIdlType(method.returns)\n    line += \" <span class='methodName'>\" + method.name + \"</span> (\" + getIdlParameterList(allParameters) + \");\"\n    html.push(line)\n}\n\n//-----------------------------------------------------------------------------\nfunction getIdlParameterList(parameters) {\n    var result = []\n\n    if (parameters.length == 0) return \"\";\n\n    result.push(\"<table>\")\n    parameters.forEach(function(parameter, index, list){\n        var comma = (index == list.length-1) ? \"\" : \",\"\n        result.push(\"<tr>\")\n        result.push(\"<td>\" + Indent2 + (parameter.out ? \"out\" : \"in\"))\n        result.push(\"<td>\" + getIdlType(parameter.type))\n        result.push(\"<td>\" + \"<span class='parameterName tdIndent'>\" + parameter.name + comma + \"</span>\")\n    })\n\n    result.push(\"</table>\")\n    return result.join(\"\\n\") + Indent\n}\n\n//-----------------------------------------------------------------------------\nfunction getIdlType(type) {\n    var result\n\n\n    if (-1 == NativeTypes.indexOf(type.name)) {\n        result = \"<a href='javascript:showInterface(\\\"\" + type.name + \"\\\"); void(0);'>\" + type.name + \"</a>\"\n    }\n    else {\n        result = type.name\n    }\n\n    for (var i=0; i<type.rank; i++) {\n        result += \"[]\"\n    }\n\n    return \"<span class='type'>\" + result + \"</span>\"\n}\n\n//-----------------------------------------------------------------------------\nIDL2Java = {\n    string: \"String\",\n    any:    \"Object\",\n    int:    \"Long\",\n    boolean: \"Boolean\",\n    \"\":     \"?\"\n}\n\n//-----------------------------------------------------------------------------\nfunction getJavaType(type) {\n    var result\n\n\n    if (-1 == NativeTypes.indexOf(type.name)) {\n        result = \"<a href='javascript:showInterface(\\\"\" + type.name + \"\\\"); void(0);'>\" + type.name + \"</a>\"\n    }\n    else {\n        result = IDL2Java[type.name]\n        if (!result) {\n            result = \"?\" + type.name + \"?\"\n            console.log(\"Unable to translate IDL type to Java: \" + type.name)\n        }\n    }\n\n    for (var i=0; i<type.rank; i++) {\n        result += \"[]\"\n    }\n\n    return \"<span class='type'>\" + result + \"</span>\"\n}\n\n\n//-----------------------------------------------------------------------------\nfunction showInterfaceIdlAttribute(attribute, html) {\n    var line = \"<tr><td>\" + Indent + \"attribute \"\n\n    line += getIdlType(attribute.type)\n    line += \"<td><span class='attributeName tdIndent'>\" + attribute.name + \"</span>;\"\n    html.push(line)\n\n}\n\n//-----------------------------------------------------------------------------\nfunction showInterfaceJavaScript(intf, html) {\n    html.push(\"<div class='show-JavaScript'><h3>JavaScript</h3><pre>\")\n\n    var line = \"\"\n\n    line += \"\\n//-----------------------------------------------------------------------------\"\n    line += \"\\n<span class='interfaceName'>class \" + intf.name + \"</span>\"\n    html.push(line)\n\n    intf.methods.forEach(function(method){\n        showInterfaceJavaScriptMethod(intf, method, html)\n    })\n\n    html.push(\"</pre></div>\")\n}\n\n//-----------------------------------------------------------------------------\nfunction showInterfaceJavaScriptMethod(intf, method, html) {\n    var line = \"\"\n\n    line += \"\\n//-----------------------------------------------------------------------------\"\n    line += \"\\n<span class='methodName'>method \" + method.name + \"</span>(\" + getJavaScriptParameterListSimple(method.parameters, method.returns) + \")\"\n    line += \"\\n    // callback: function(\" + getJavaScriptCallbackParameterListSimple(method.callbackParameters) + \")\"\n    line += \"\\n    Weinre.notImplemented(arguments.callee.signature)\"\n    line += \"\\n\"\n    html.push(line)\n}\n\n//-----------------------------------------------------------------------------\nfunction getJavaScriptParameterList(parameters, returnType) {\n    var result = []\n\n    result.push(\"<table>\")\n    parameters.forEach(function(parameter){\n        result.push(\"<tr>\")\n        result.push(\"<td>\" + Indent2 + \"<span class='parameterName'>\" + parameter.name + \",</span>\")\n        result.push(\"<td><span class='tdIndent'>// \" + getIdlType(parameter.type) + \"</span>\")\n    })\n\n    result.push(\"<tr>\")\n    result.push(\"<td>\" + Indent2 + \"<span class='parameterName'>callback</span>\")\n    result.push(\"<td><span class='tdIndent'>// function(error, \" + getIdlType(returnType) + \")</span>\")\n\n    result.push(\"</table>\")\n    return result.join(\"\\n\") + Indent\n}\n\n//-----------------------------------------------------------------------------\nfunction getJavaScriptParameterListSimple(parameters, returnType) {\n    var result = []\n\n    parameters.forEach(function(parameter){\n        if (parameter.out) return\n        result.push(\"<span class='type'>/*\" + getIdlType(parameter.type) + \"*/ </span><span class='parameterName'>\" + parameter.name + \"</span>\")\n    })\n\n    result.push(\"<span class='parameterName'>callback</span>\")\n    return result.join(\", \")\n}\n\n//-----------------------------------------------------------------------------\nfunction getJavaScriptCallbackParameterListSimple(parameters) {\n    var result = []\n\n    parameters.forEach(function(parameter){\n        if (!parameter.out) return\n        result.push(\"/*\" + getIdlType(parameter.type) + \"*/ \"+ parameter.name)\n    })\n\n    return result.join(\", \")\n}\n\n//-----------------------------------------------------------------------------\nfunction showInterfaceJava(intf, html) {\n    html.push(\"<div class='show-Java'><h3>Java</h3><pre>\")\n\n    intf.methods.forEach(function(method){\n        showInterfaceJavaMethod(intf, method, html)\n    })\n\n    html.push(\"</pre></div>\")\n}\n\n//-----------------------------------------------------------------------------\nfunction showInterfaceJavaMethod(intf, method, html) {\n    var line = \"\"\n\n    line += \"\\n    /**\"\n    line += \"\\n     * \"\n    line += \"\\n     */\"\n    line += \"\\n    <span class='methodName'>public void \" + method.name + \"</span>(\" + getJavaParameterListSimple(method.parameters, method.returns) + \") throws IOException {\"\n    line += \"\\n        Main.warn(getClass().getName() + \\\".\" + method.name + \"() not implemented\\\");\"\n    line += \"\\n\"\n    line += \"\\n        channel.sendCallback(\\\"\" + intf.name + \"\\\", callbackId\" + getJavaCallbackParameterListSimple(method.callbackParameters) + \");\"\n    line += \"\\n    }\"\n    line += \"\\n\"\n    html.push(line)\n}\n\n//-----------------------------------------------------------------------------\nfunction getJavaParameterList(parameters, returnType) {\n    var result = []\n\n    result.push(\"<table>\")\n    parameters.forEach(function(parameter){\n        result.push(\"<tr>\")\n        result.push(\"<td>\" + Indent2 + \"<span class='parameterName'>\" + parameter.name + \",</span>\")\n        result.push(\"<td><span class='tdIndent'>// \" + getIdlType(parameter.type) + \"</span>\")\n    })\n\n    result.push(\"<tr>\")\n    result.push(\"<td>\" + Indent2 + \"<span class='parameterName'>callback</span>\")\n    result.push(\"<td><span class='tdIndent'>// function(error, \" + getIdlType(returnType) + \")</span>\")\n\n    result.push(\"</table>\")\n    return result.join(\"\\n\") + Indent\n}\n\n//-----------------------------------------------------------------------------\nfunction getJavaParameterListSimple(parameters, returnType) {\n    var result = []\n\n    result.push(\"<span class='type'>Channel</span> <span class='parameterName'>channel</span>\")\n\n    parameters.forEach(function(parameter){\n        if (parameter.out) return\n        result.push(\"<span class='type'>\" + getJavaType(parameter.type) + \" </span><span class='parameterName'>\" + parameter.name + \"</span>\")\n    })\n\n    result.push(\"<span class='type'>String</span> <span class='parameterName'>callbackId</span>\")\n    return result.join(\", \")\n}\n\n//-----------------------------------------------------------------------------\nfunction getJavaCallbackParameterListSimple(parameters) {\n    var result = []\n\n    parameters.forEach(function(parameter){\n        if (!parameter.out) return\n        result.push(\"/*\" + getJavaType(parameter.type)  + \" \" + parameter.name + \"*/ (Object) null\")\n    })\n\n    result = result.join(\", \")\n\n    if (result != \"\") result = \", \" + result\n\n    return result\n}\n\n//-----------------------------------------------------------------------------\nfunction toArray(arrayLike) {\n    return [].slice.call(arrayLike)\n}\n\n//-----------------------------------------------------------------------------\nExBreak = new Error(\"breaks out of loops\")\n\n//-----------------------------------------------------------------------------\nfunction exBreak() {\n    throw ExBreak\n}\n\n//-----------------------------------------------------------------------------\nfunction allowExBreak(func) {\n    try {\n        func.call()\n    }\n    catch(e) {\n        if (e == ExBreak) return\n        throw e\n    }\n}\n\n//-----------------------------------------------------------------------------\n})();\n\n"
  },
  {
    "path": "buildin_modules/weinre/web/modjewel.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n//----------------------------------------------------------------------------\n// an implementation of the require() function as specified for use with\n// CommonJS Modules - see http://commonjs.org/specs/modules/1.0.html\n//----------------------------------------------------------------------------\n\n//----------------------------------------------------------------------------\n// inspired from David Flanagan's require() function documented here:\n// http://www.davidflanagan.com/2009/11/a-module-loader.html\n//----------------------------------------------------------------------------\n\n//----------------------------------------------------------------------------\n// only supports \"preloaded\" modules ala define() (AMD)\n//    http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition\n// but the id parameter is required\n//----------------------------------------------------------------------------\n\n//----------------------------------------------------------------------------\n// function wrapper\n//----------------------------------------------------------------------------\n(function(){\n\n//----------------------------------------------------------------------------\n// some constants\n//----------------------------------------------------------------------------\nvar PROGRAM = \"modjewel\"\nvar VERSION = \"2.0.0\"\nvar global  = this\n\n//----------------------------------------------------------------------------\n// if require() is already defined, leave\n//----------------------------------------------------------------------------\nif (global.modjewel) {\n    log(\"modjewel global variable already defined\")\n    return\n}\n\nglobal.modjewel = null\n\n//----------------------------------------------------------------------------\n// \"globals\" (local to this function scope though)\n//----------------------------------------------------------------------------\nvar ModuleStore\nvar ModulePreloadStore\nvar MainModule\nvar WarnOnRecursiveRequire = false\n\n//----------------------------------------------------------------------------\n// the require function\n//----------------------------------------------------------------------------\nfunction get_require(currentModule) {\n    var result = function require(moduleId) {\n\n        if (moduleId.match(/^\\.{1,2}\\//)) {\n            moduleId = normalize(currentModule, moduleId)\n        }\n\n        if (hop(ModuleStore, moduleId)) {\n            var module = ModuleStore[moduleId]\n            if (module.__isLoading) {\n                if (WarnOnRecursiveRequire) {\n                    var fromModule = currentModule ? currentModule.id : \"<root>\"\n                    console.log(\"module '\" + moduleId + \"' recursively require()d from '\" + fromModule + \"', problem?\")\n                }\n            }\n\n            currentModule.moduleIdsRequired.push(moduleId)\n\n            return module.exports\n        }\n\n        if (!hop(ModulePreloadStore, moduleId)) {\n            var fromModule = currentModule ? currentModule.id : \"<root>\"\n            error(\"module '\" + moduleId + \"' not found from '\" + fromModule + \"', must be define()'d first\")\n        }\n\n        var factory = ModulePreloadStore[moduleId][0]\n        var prereqs = ModulePreloadStore[moduleId][1]\n\n        var module = create_module(moduleId)\n\n        var newRequire = get_require(module)\n\n        ModuleStore[moduleId] = module\n\n        module.__isLoading = true\n        try {\n            currentModule.moduleIdsRequired.push(moduleId)\n\n            var prereqModules = []\n            for (var i=0; i<prereqs.length; i++) {\n                var prereqId = prereqs[i]\n                var prereqModule\n\n                if      (prereqId == \"require\") prereqModule = newRequire\n                else if (prereqId == \"exports\") prereqModule = module.exports\n                else if (prereqId == \"module\")  prereqModule = module\n                else                            prereqModule = newRequire(prereqId)\n\n                prereqModules.push(prereqModule)\n            }\n\n            if (typeof factory == \"function\") {\n                var result = factory.apply(null, prereqModules)\n                if (result) {\n                    module.exports = result\n                }\n            }\n            else {\n                module.exports = factory\n            }\n        }\n        finally {\n            module.__isLoading = false\n        }\n\n        return module.exports\n    }\n\n    result.define         = require_define\n    result.implementation = PROGRAM\n    result.version        = VERSION\n\n    return result\n}\n\n//----------------------------------------------------------------------------\n// shorter version of hasOwnProperty\n//----------------------------------------------------------------------------\nfunction hop(object, name) {\n    return Object.prototype.hasOwnProperty.call(object, name)\n}\n\n//----------------------------------------------------------------------------\n// create a new module\n//----------------------------------------------------------------------------\nfunction create_module(id) {\n    return {\n        id:                id,\n        uri:               id,\n        exports:           {},\n        prereqIds:         [],\n        moduleIdsRequired: []\n    }\n}\n\n//----------------------------------------------------------------------------\n// reset the stores\n//----------------------------------------------------------------------------\nfunction require_reset() {\n    ModuleStore        = {}\n    ModulePreloadStore = {}\n    MainModule         = create_module(null)\n\n    var require = get_require(MainModule)\n    var define  = require_define\n    \n    define(\"modjewel\", modjewel_module)\n\n    global.modjewel            = require(\"modjewel\")\n    global.modjewel.require    = require\n    global.modjewel.define     = define\n    global.modjewel.define.amd = {implementation: PROGRAM, version: VERSION}\n}\n\n//----------------------------------------------------------------------------\n// used by pre-built modules that can be included via <script src=>\n// a simplification of\n//    http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition\n// where id is required\n//----------------------------------------------------------------------------\nfunction require_define(moduleId, prereqs, factory) {\n    var rem = [\"require\", \"exports\", \"module\"]\n\n    if (typeof moduleId != \"string\") {\n        console.log(\"modjewel.define(): first parameter must be a string; was: \" + moduleId)\n        return\n    }\n\n    if (arguments.length == 2) {\n        factory = prereqs\n        prereqs = null\n    }\n\n    if (!prereqs || prereqs.length == 0) {\n        prereqs = rem\n    }\n\n    if (typeof factory != \"function\") {\n        if (factory) {\n            ModulePreloadStore[moduleId] = [factory, prereqs]\n            return\n        }\n\n        console.log(\"modjewel.define(): factory was falsy: \" + factory)\n        return\n    }\n\n    if (moduleId.match(/^\\./)) {\n        console.log(\"modjewel.define(): moduleId must not start with '.': '\" + moduleName + \"'\")\n        return\n    }\n\n    if (hop(ModulePreloadStore, moduleId)) {\n        console.log(\"modjewel.define(): module '\" + moduleId + \"' has already been defined\")\n        return\n    }\n\n    ModulePreloadStore[moduleId] = [factory, prereqs]\n}\n\n//----------------------------------------------------------------------------\n// get the path of a module\n//----------------------------------------------------------------------------\nfunction getModulePath(module) {\n    if (!module || !module.id) return \"\"\n\n    var parts = module.id.split(\"/\")\n\n    return parts.slice(0, parts.length-1).join(\"/\")\n}\n\n//----------------------------------------------------------------------------\n// normalize a 'file name' with . and .. with a 'directory name'\n//----------------------------------------------------------------------------\nfunction normalize(module, file) {\n    var modulePath = getModulePath(module)\n    var dirParts   = (\"\" == modulePath) ? [] : modulePath.split(\"/\")\n    var fileParts  = file.split(\"/\")\n\n    for (var i=0; i<fileParts.length; i++) {\n        var filePart = fileParts[i]\n\n        if (filePart == \".\") {\n        }\n\n        else if (filePart == \"..\") {\n            if (dirParts.length > 0) {\n                dirParts.pop()\n            }\n            else {\n                // error(\"error normalizing '\" + module + \"' and '\" + file + \"'\")\n                // eat non-valid .. paths\n            }\n        }\n\n        else {\n            dirParts.push(filePart)\n        }\n    }\n\n    return dirParts.join(\"/\")\n}\n\n//----------------------------------------------------------------------------\n// throw an error\n//----------------------------------------------------------------------------\nfunction error(message) {\n    throw new Error(PROGRAM + \": \" + message)\n}\n\n//----------------------------------------------------------------------------\n// get a list of loaded modules\n//----------------------------------------------------------------------------\nfunction modjewel_getLoadedModuleIds() {\n    var result = []\n\n    for (moduleId in ModuleStore) {\n        result.push(moduleId)\n    }\n\n    return result\n}\n\n//----------------------------------------------------------------------------\n// get a list of the preloaded module ids\n//----------------------------------------------------------------------------\nfunction modjewel_getPreloadedModuleIds() {\n    var result = []\n\n    for (moduleId in ModulePreloadStore) {\n        result.push(moduleId)\n    }\n\n    return result\n}\n\n//----------------------------------------------------------------------------\n// get a module by module id\n//----------------------------------------------------------------------------\nfunction modjewel_getModule(moduleId) {\n    if (null == moduleId) return MainModule\n\n    return ModuleStore[moduleId]\n}\n\n//----------------------------------------------------------------------------\n// get a list of module ids which have been required by the specified module id\n//----------------------------------------------------------------------------\nfunction modjewel_getModuleIdsRequired(moduleId) {\n    var module = modjewel_getModule(moduleId)\n    if (null == module) return null\n\n    return module.moduleIdsRequired.slice()\n}\n\n//----------------------------------------------------------------------------\n// set the WarnOnRecursiveRequireFlag\n// - if you make use of \"module.exports =\" in your code, you will want this on\n//----------------------------------------------------------------------------\nfunction modjewel_warnOnRecursiveRequire(value) {\n    if (arguments.length == 0) return WarnOnRecursiveRequire\n    WarnOnRecursiveRequire = !!value\n}\n\n//----------------------------------------------------------------------------\n// the modjewel module\n//----------------------------------------------------------------------------\nfunction modjewel_module(require, exports, module) {\n    exports.VERSION                = VERSION\n    exports.require                = null // filled in later\n    exports.define                 = null // filled in later\n    exports.getLoadedModuleIds     = modjewel_getLoadedModuleIds\n    exports.getPreloadedModuleIds  = modjewel_getPreloadedModuleIds\n    exports.getModule              = modjewel_getModule\n    exports.getModuleIdsRequired   = modjewel_getModuleIdsRequired\n    exports.warnOnRecursiveRequire = modjewel_warnOnRecursiveRequire\n}\n\n//----------------------------------------------------------------------------\n// log a message\n//----------------------------------------------------------------------------\nfunction log(message) {\n    console.log(\"modjewel: \" + message)\n}\n\n//----------------------------------------------------------------------------\n// make the require function a global\n//----------------------------------------------------------------------------\nrequire_reset()\n\n//----------------------------------------------------------------------------\n})();\n"
  },
  {
    "path": "buildin_modules/weinre/web/target/target-script-min.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Nov 04 2016, wuchangming\n * fixed console.log(null) or console.log(undefined) occur error bug!\n */\n\n/**\n *  Dec 11 2016, wuchangming\n *  add a global consoleforspydebugger to enhance `console` for prevent `log message` lost\n *  before Document 'load' and 'DOMContentLoaded'.\n */\n\n;\n(function() {\n    // modjewel.js\n    (function() {\n        var PROGRAM = \"modjewel\"\n        var VERSION = \"2.0.0\"\n        var global = this\n        if (global.modjewel) {\n            log(\"modjewel global variable already defined\")\n            return\n        }\n        global.modjewel = null\n        var ModuleStore\n        var ModulePreloadStore\n        var MainModule\n        var WarnOnRecursiveRequire = false\n\n        function get_require(currentModule) {\n            var result = function require(moduleId) {\n                if (moduleId.match(/^\\.{1,2}\\//)) {\n                    moduleId = normalize(currentModule, moduleId)\n                }\n                if (hop(ModuleStore, moduleId)) {\n                    var module = ModuleStore[moduleId]\n                    if (module.__isLoading) {\n                        if (WarnOnRecursiveRequire) {\n                            var fromModule = currentModule ? currentModule.id : \"<root>\"\n                            console.log(\"module '\" + moduleId + \"' recursively require()d from '\" + fromModule + \"', problem?\")\n                        }\n                    }\n                    currentModule.moduleIdsRequired.push(moduleId)\n                    return module.exports\n                }\n                if (!hop(ModulePreloadStore, moduleId)) {\n                    var fromModule = currentModule ? currentModule.id : \"<root>\"\n                    error(\"module '\" + moduleId + \"' not found from '\" + fromModule + \"', must be define()'d first\")\n                }\n                var factory = ModulePreloadStore[moduleId][0]\n                var prereqs = ModulePreloadStore[moduleId][1]\n                var module = create_module(moduleId)\n                var newRequire = get_require(module)\n                ModuleStore[moduleId] = module\n                module.__isLoading = true\n                try {\n                    currentModule.moduleIdsRequired.push(moduleId)\n                    var prereqModules = []\n                    for (var i = 0; i < prereqs.length; i++) {\n                        var prereqId = prereqs[i]\n                        var prereqModule\n                        if (prereqId == \"require\") prereqModule = newRequire\n                        else if (prereqId == \"exports\") prereqModule = module.exports\n                        else if (prereqId == \"module\") prereqModule = module\n                        else prereqModule = newRequire(prereqId)\n                        prereqModules.push(prereqModule)\n                    }\n                    if (typeof factory == \"function\") {\n                        var result = factory.apply(null, prereqModules)\n                        if (result) {\n                            module.exports = result\n                        }\n                    } else {\n                        module.exports = factory\n                    }\n                } finally {\n                    module.__isLoading = false\n                }\n                return module.exports\n            }\n            result.define = require_define\n            result.implementation = PROGRAM\n            result.version = VERSION\n            return result\n        }\n\n        function hop(object, name) {\n            return Object.prototype.hasOwnProperty.call(object, name)\n        }\n\n        function create_module(id) {\n            return {\n                id: id,\n                uri: id,\n                exports: {},\n                prereqIds: [],\n                moduleIdsRequired: []\n            }\n        }\n\n        function require_reset() {\n            ModuleStore = {}\n            ModulePreloadStore = {}\n            MainModule = create_module(null)\n            var require = get_require(MainModule)\n            var define = require_define\n            define(\"modjewel\", modjewel_module)\n            global.modjewel = require(\"modjewel\")\n            global.modjewel.require = require\n            global.modjewel.define = define\n            global.modjewel.define.amd = {\n                implementation: PROGRAM,\n                version: VERSION\n            }\n        }\n\n        function require_define(moduleId, prereqs, factory) {\n            var rem = [\"require\", \"exports\", \"module\"]\n            if (typeof moduleId != \"string\") {\n                console.log(\"modjewel.define(): first parameter must be a string; was: \" + moduleId)\n                return\n            }\n            if (arguments.length == 2) {\n                factory = prereqs\n                prereqs = null\n            }\n            if (!prereqs || prereqs.length == 0) {\n                prereqs = rem\n            }\n            if (typeof factory != \"function\") {\n                if (factory) {\n                    ModulePreloadStore[moduleId] = [factory, prereqs]\n                    return\n                }\n                console.log(\"modjewel.define(): factory was falsy: \" + factory)\n                return\n            }\n            if (moduleId.match(/^\\./)) {\n                console.log(\"modjewel.define(): moduleId must not start with '.': '\" + moduleName + \"'\")\n                return\n            }\n            if (hop(ModulePreloadStore, moduleId)) {\n                console.log(\"modjewel.define(): module '\" + moduleId + \"' has already been defined\")\n                return\n            }\n            ModulePreloadStore[moduleId] = [factory, prereqs]\n        }\n\n        function getModulePath(module) {\n            if (!module || !module.id) return \"\"\n            var parts = module.id.split(\"/\")\n            return parts.slice(0, parts.length - 1).join(\"/\")\n        }\n\n        function normalize(module, file) {\n            var modulePath = getModulePath(module)\n            var dirParts = (\"\" == modulePath) ? [] : modulePath.split(\"/\")\n            var fileParts = file.split(\"/\")\n            for (var i = 0; i < fileParts.length; i++) {\n                var filePart = fileParts[i]\n                if (filePart == \".\") {} else if (filePart == \"..\") {\n                    if (dirParts.length > 0) {\n                        dirParts.pop()\n                    } else {}\n                } else {\n                    dirParts.push(filePart)\n                }\n            }\n            return dirParts.join(\"/\")\n        }\n\n        function error(message) {\n            throw new Error(PROGRAM + \": \" + message)\n        }\n\n        function modjewel_getLoadedModuleIds() {\n            var result = []\n            for (moduleId in ModuleStore) {\n                result.push(moduleId)\n            }\n            return result\n        }\n\n        function modjewel_getPreloadedModuleIds() {\n            var result = []\n            for (moduleId in ModulePreloadStore) {\n                result.push(moduleId)\n            }\n            return result\n        }\n\n        function modjewel_getModule(moduleId) {\n            if (null == moduleId) return MainModule\n            return ModuleStore[moduleId]\n        }\n\n        function modjewel_getModuleIdsRequired(moduleId) {\n            var module = modjewel_getModule(moduleId)\n            if (null == module) return null\n            return module.moduleIdsRequired.slice()\n        }\n\n        function modjewel_warnOnRecursiveRequire(value) {\n            if (arguments.length == 0) return WarnOnRecursiveRequire\n            WarnOnRecursiveRequire = !!value\n        }\n\n        function modjewel_module(require, exports, module) {\n            exports.VERSION = VERSION\n            exports.require = null\n            exports.define = null\n            exports.getLoadedModuleIds = modjewel_getLoadedModuleIds\n            exports.getPreloadedModuleIds = modjewel_getPreloadedModuleIds\n            exports.getModule = modjewel_getModule\n            exports.getModuleIdsRequired = modjewel_getModuleIdsRequired\n            exports.warnOnRecursiveRequire = modjewel_warnOnRecursiveRequire\n        }\n\n        function log(message) {\n            console.log(\"modjewel: \" + message)\n        }\n        require_reset()\n    })();\n\n    ;\n    modjewel.require('modjewel').warnOnRecursiveRequire(true);\n\n    // weinre/common/Binding.amd.js\n    ;\n    modjewel.define(\"weinre/common/Binding\", function(require, exports, module) {\n        var Binding, Ex;\n        Ex = require('./Ex');\n        module.exports = Binding = (function() {\n            function Binding(receiver, method) {\n                if (!receiver) {\n                    throw new Ex(arguments, \"receiver argument for Binding constructor was null\");\n                }\n                if (typeof method === \"string\") {\n                    method = receiver[method];\n                }\n                if (typeof method === !\"function\") {\n                    throw new Ex(arguments, \"method argument didn't specify a function\");\n                }\n                return function() {\n                    return method.apply(receiver, [].slice.call(arguments));\n                };\n            }\n            return Binding;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/Callback.amd.js\n    ;\n    modjewel.define(\"weinre/common/Callback\", function(require, exports, module) {\n        var Callback, CallbackIndex, CallbackTable, ConnectorChannel, Ex;\n        Ex = require('./Ex');\n        CallbackTable = {};\n        CallbackIndex = 1;\n        ConnectorChannel = \"???\";\n        module.exports = Callback = (function() {\n            function Callback() {\n                throw new Ex(arguments, \"this class is not intended to be instantiated\");\n            }\n            Callback.setConnectorChannel = function(connectorChannel) {\n                return ConnectorChannel = \"\" + connectorChannel;\n            };\n            Callback.register = function(callback) {\n                var data, func, index, receiver;\n                if (typeof callback === \"function\") {\n                    callback = [null, callback];\n                }\n                if (typeof callback.slice !== \"function\") {\n                    throw new Ex(arguments, \"callback must be an array or function\");\n                }\n                receiver = callback[0];\n                func = callback[1];\n                data = callback.slice(2);\n                if (typeof func === \"string\") {\n                    func = receiver[func];\n                }\n                if (typeof func !== \"function\") {\n                    throw new Ex(arguments, \"callback function was null or not found\");\n                }\n                index = ConnectorChannel + \"::\" + CallbackIndex;\n                CallbackIndex++;\n                if (CallbackIndex >= 65536 * 65536) {\n                    CallbackIndex = 1;\n                }\n                CallbackTable[index] = [receiver, func, data];\n                return index;\n            };\n            Callback.deregister = function(index) {\n                return delete CallbackTable[index];\n            };\n            Callback.invoke = function(index, args) {\n                var callback, e, func, funcName, receiver;\n                callback = CallbackTable[index];\n                if (!callback) {\n                    throw new Ex(arguments, \"callback \" + index + \" not registered or already invoked\");\n                }\n                receiver = callback[0];\n                func = callback[1];\n                args = callback[2].concat(args);\n                try {\n                    return func.apply(receiver, args);\n                } catch (_error) {\n                    e = _error;\n                    funcName = func.name || func.signature;\n                    if (!funcName) {\n                        funcName = \"<unnamed>\";\n                    }\n                    return require(\"./Weinre\").logError(arguments.callee.signature + (\" exception invoking callback: \" + funcName + \"(\" + (args.join(',')) + \"): \") + e);\n                } finally {\n                    Callback.deregister(index);\n                }\n            };\n            return Callback;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/Debug.amd.js\n    ;\n    modjewel.define(\"weinre/common/Debug\", function(require, exports, module) {\n        var Debug;\n        module.exports = new(Debug = (function() {\n            function Debug() {\n                this._printCalledArgs = {};\n            }\n            Debug.prototype.log = function(message) {\n                var console;\n                console = window.console.__original || window.console;\n                return console.log(\"\" + (this.timeStamp()) + \": \" + message);\n            };\n            Debug.prototype.logCall = function(context, intf, method, args, message) {\n                var printArgs, signature;\n                if (message) {\n                    message = \": \" + message;\n                } else {\n                    message = \"\";\n                }\n                signature = this.signature(intf, method);\n                printArgs = this._printCalledArgs[signature];\n                if (printArgs) {\n                    args = JSON.stringify(args, null, 4);\n                } else {\n                    args = \"\";\n                }\n                return this.log(\"\" + context + \" \" + signature + \"(\" + args + \")\" + message);\n            };\n            Debug.prototype.logCallArgs = function(intf, method) {\n                return this._printCalledArgs[this.signature(intf, method)] = true;\n            };\n            Debug.prototype.signature = function(intf, method) {\n                return \"\" + intf + \".\" + method;\n            };\n            Debug.prototype.timeStamp = function() {\n                var date, mins, secs;\n                date = new Date();\n                mins = \"\" + (date.getMinutes());\n                secs = \"\" + (date.getSeconds());\n                if (mins.length === 1) {\n                    mins = \"0\" + mins;\n                }\n                if (secs.length === 1) {\n                    secs = \"0\" + secs;\n                }\n                return \"\" + mins + \":\" + secs;\n            };\n            return Debug;\n        })());\n    });\n\n    ;\n    // weinre/common/EventListeners.amd.js\n    ;\n    modjewel.define(\"weinre/common/EventListeners\", function(require, exports, module) {\n        var EventListeners, Ex, Weinre;\n        Ex = require('./Ex');\n        Weinre = require('./Weinre');\n        module.exports = EventListeners = (function() {\n            function EventListeners() {\n                this.listeners = [];\n            }\n            EventListeners.prototype.add = function(listener, useCapture) {\n                return this.listeners.push([listener, useCapture]);\n            };\n            EventListeners.prototype.remove = function(listener, useCapture) {\n                var listeners, _i, _len, _listener;\n                listeners = this.listeners.slice();\n                for (_i = 0, _len = listeners.length; _i < _len; _i++) {\n                    _listener = listeners[_i];\n                    if (_listener[0] !== listener) {\n                        continue;\n                    }\n                    if (_listener[1] !== useCapture) {\n                        continue;\n                    }\n                    this._listeners.splice(i, 1);\n                    return;\n                }\n            };\n            EventListeners.prototype.fire = function(event) {\n                var e, listener, listeners, _i, _len, _results;\n                listeners = this.listeners.slice();\n                _results = [];\n                for (_i = 0, _len = listeners.length; _i < _len; _i++) {\n                    listener = listeners[_i];\n                    listener = listener[0];\n                    if (typeof listener === \"function\") {\n                        try {\n                            listener.call(null, event);\n                        } catch (_error) {\n                            e = _error;\n                            Weinre.logError(\"\" + arguments.callee.name + \" invocation exception: \" + e);\n                        }\n                        continue;\n                    }\n                    if (typeof(listener != null ? listener.handleEvent : void 0) !== \"function\") {\n                        throw new Ex(arguments, \"listener does not implement the handleEvent() method\");\n                    }\n                    try {\n                        _results.push(listener.handleEvent.call(listener, event));\n                    } catch (_error) {\n                        e = _error;\n                        _results.push(Weinre.logError(\"\" + arguments.callee.name + \" invocation exception: \" + e));\n                    }\n                }\n                return _results;\n            };\n            return EventListeners;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/Ex.amd.js\n    ;\n    modjewel.define(\"weinre/common/Ex\", function(require, exports, module) {\n        var Ex, StackTrace, prefix;\n        StackTrace = require('./StackTrace');\n        module.exports = Ex = (function() {\n            Ex.catching = function(func) {\n                var e;\n                try {\n                    return func.call(this);\n                } catch (_error) {\n                    e = _error;\n                    console.log(\"runtime error: \" + e);\n                    return StackTrace.dump(arguments);\n                }\n            };\n\n            function Ex(args, message) {\n                if (!args || !args.callee) {\n                    throw Ex(arguments, \"first parameter must be an Arguments object\");\n                }\n                StackTrace.dump(args);\n                if (message instanceof Error) {\n                    message = \"threw error: \" + message;\n                }\n                message = prefix(args, message);\n                message;\n            }\n            return Ex;\n        })();\n        prefix = function(args, string) {\n            if (args.callee.signature) {\n                return args.callee.signature + \": \" + string;\n            }\n            if (args.callee.displayName) {\n                return args.callee.displayName + \": \" + string;\n            }\n            if (args.callee.name) {\n                return args.callee.name + \": \" + string;\n            }\n            return \"<anonymous>\" + \": \" + string;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/HookLib.amd.js\n    ;\n    modjewel.define(\"weinre/common/HookLib\", function(require, exports, module) {\n        var HookLib, HookSite, HookSites, IgnoreHooks, callAfterHooks, callBeforeHooks, callExceptHooks, getHookSite, getHookedFunction;\n        HookLib = exports;\n        HookSites = [];\n        IgnoreHooks = 0;\n        module.exports = HookLib = (function() {\n            function HookLib() {}\n            HookLib.addHookSite = function(object, property) {\n                return getHookSite(object, property, true);\n            };\n            HookLib.getHookSite = function(object, property) {\n                return getHookSite(object, property, false);\n            };\n            HookLib.ignoreHooks = function(func) {\n                var result;\n                try {\n                    IgnoreHooks++;\n                    result = func.call();\n                } finally {\n                    IgnoreHooks--;\n                }\n                return result;\n            };\n            return HookLib;\n        })();\n        getHookSite = function(object, property, addIfNotFound) {\n            var hookSite, i, _i, _len;\n            i = 0;\n            for (_i = 0, _len = HookSites.length; _i < _len; _i++) {\n                hookSite = HookSites[_i];\n                if (hookSite.object !== object) {\n                    continue;\n                }\n                if (hookSite.property !== property) {\n                    continue;\n                }\n                return hookSite;\n            }\n            if (!addIfNotFound) {\n                return null;\n            }\n            hookSite = new HookSite(object, property);\n            HookSites.push(hookSite);\n            return hookSite;\n        };\n        HookSite = (function() {\n            function HookSite(object, property) {\n                var hookedFunction;\n                this.object = object;\n                this.property = property;\n                this.target = object[property];\n                this.hookss = [];\n                if (typeof this.target === 'undefined') {\n                    return;\n                } else {\n                    hookedFunction = getHookedFunction(this.target, this);\n                    if (!(navigator.userAgent.match(/MSIE/i) && (object === localStorage || object === sessionStorage))) {\n                        object[property] = hookedFunction;\n                    }\n                }\n            }\n            HookSite.prototype.addHooks = function(hooks) {\n                return this.hookss.push(hooks);\n            };\n            HookSite.prototype.removeHooks = function(hooks) {\n                var i, _i, _ref;\n                for (i = _i = 0, _ref = this.hookss.length; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {\n                    if (this.hookss[i] === hooks) {\n                        this.hookss.splice(i, 1);\n                        return;\n                    }\n                }\n            };\n            return HookSite;\n        })();\n        getHookedFunction = function(func, hookSite) {\n            var hookedFunction;\n            hookedFunction = function() {\n                var e, result;\n                callBeforeHooks(hookSite, this, arguments);\n                try {\n                    result = func.apply(this, arguments);\n                } catch (_error) {\n                    e = _error;\n                    callExceptHooks(hookSite, this, arguments, e);\n                    throw e;\n                } finally {\n                    callAfterHooks(hookSite, this, arguments, result);\n                }\n                return result;\n            };\n            hookedFunction.displayName = func.displayName || func.name;\n            return hookedFunction;\n        };\n        callBeforeHooks = function(hookSite, receiver, args) {\n            var hooks, _i, _len, _ref, _results;\n            if (IgnoreHooks > 0) {\n                return;\n            }\n            _ref = hookSite.hookss;\n            _results = [];\n            for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                hooks = _ref[_i];\n                if (hooks.before) {\n                    _results.push(hooks.before.call(hooks, receiver, args));\n                } else {\n                    _results.push(void 0);\n                }\n            }\n            return _results;\n        };\n        callAfterHooks = function(hookSite, receiver, args, result) {\n            var hooks, _i, _len, _ref, _results;\n            if (IgnoreHooks > 0) {\n                return;\n            }\n            _ref = hookSite.hookss;\n            _results = [];\n            for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                hooks = _ref[_i];\n                if (hooks.after) {\n                    _results.push(hooks.after.call(hooks, receiver, args, result));\n                } else {\n                    _results.push(void 0);\n                }\n            }\n            return _results;\n        };\n        callExceptHooks = function(hookSite, receiver, args, e) {\n            var hooks, _i, _len, _ref, _results;\n            if (IgnoreHooks > 0) {\n                return;\n            }\n            _ref = hookSite.hookss;\n            _results = [];\n            for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                hooks = _ref[_i];\n                if (hooks.except) {\n                    _results.push(hooks.except.call(hooks, receiver, args, e));\n                } else {\n                    _results.push(void 0);\n                }\n            }\n            return _results;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/IDGenerator.amd.js\n    ;\n    modjewel.define(\"weinre/common/IDGenerator\", function(require, exports, module) {\n        var IDGenerator, idName, nextId, nextIdValue;\n        nextIdValue = 1;\n        idName = \"__weinre__id\";\n        module.exports = IDGenerator = (function() {\n            function IDGenerator() {}\n            IDGenerator.checkId = function(object) {\n                return object[idName];\n            };\n            IDGenerator.getId = function(object, map) {\n                var id;\n                id = IDGenerator.checkId(object);\n                if (!id) {\n                    id = nextId();\n                    object[idName] = id;\n                }\n                if (map) {\n                    map[id] = object;\n                }\n                return id;\n            };\n            IDGenerator.next = function() {\n                return nextId();\n            };\n            return IDGenerator;\n        })();\n        nextId = function() {\n            var result;\n            result = nextIdValue;\n            nextIdValue += 1;\n            return result;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/IDLTools.amd.js\n    ;\n    modjewel.define(\"weinre/common/IDLTools\", function(require, exports, module) {\n        var Callback, Ex, IDLTools, IDLs, getProxyMethod;\n        Ex = require('./Ex');\n        Callback = require('./Callback');\n        IDLs = {};\n        module.exports = IDLTools = (function() {\n            function IDLTools() {\n                throw new Ex(arguments, \"this class is not intended to be instantiated\");\n            }\n            IDLTools.addIDLs = function(idls) {\n                var idl, intf, _i, _len, _results;\n                _results = [];\n                for (_i = 0, _len = idls.length; _i < _len; _i++) {\n                    idl = idls[_i];\n                    _results.push((function() {\n                        var _j, _len1, _ref, _results1;\n                        _ref = idl.interfaces;\n                        _results1 = [];\n                        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {\n                            intf = _ref[_j];\n                            IDLs[intf.name] = intf;\n                            _results1.push(intf.module = idl.name);\n                        }\n                        return _results1;\n                    })());\n                }\n                return _results;\n            };\n            IDLTools.getIDL = function(name) {\n                return IDLs[name];\n            };\n            IDLTools.getIDLsMatching = function(regex) {\n                var intf, intfName, results;\n                results = [];\n                for (intfName in IDLs) {\n                    intf = IDLs[intfName];\n                    if (intfName.match(regex)) {\n                        results.push(intf);\n                    }\n                }\n                return results;\n            };\n            IDLTools.validateAgainstIDL = function(klass, interfaceName) {\n                var classMethod, error, errors, intf, intfMethod, messagePrefix, printName, propertyName, _i, _j, _len, _len1, _ref, _results;\n                intf = IDLTools.getIDL(interfaceName);\n                messagePrefix = \"IDL validation for \" + interfaceName + \": \";\n                if (null === intf) {\n                    throw new Ex(arguments, messagePrefix + (\"idl not found: '\" + interfaceName + \"'\"));\n                }\n                errors = [];\n                _ref = intf.methods;\n                for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                    intfMethod = _ref[_i];\n                    classMethod = klass.prototype[intfMethod.name];\n                    printName = klass.name + \"::\" + intfMethod.name;\n                    if (null === classMethod) {\n                        errors.push(messagePrefix + (\"method not implemented: '\" + printName + \"'\"));\n                        continue;\n                    }\n                    if (classMethod.length !== intfMethod.parameters.length) {\n                        if (classMethod.length !== intfMethod.parameters.length + 1) {\n                            errors.push(messagePrefix + (\"wrong number of parameters: '\" + printName + \"'\"));\n                            continue;\n                        }\n                    }\n                }\n                for (propertyName in klass.prototype) {\n                    if (klass.prototype.hasOwnProperty(propertyName)) {\n                        continue;\n                    }\n                    if (propertyName.match(/^_.*/)) {\n                        continue;\n                    }\n                    printName = klass.name + \"::\" + propertyName;\n                    if (!intf.methods[propertyName]) {\n                        errors.push(messagePrefix + (\"method should not be implemented: '\" + printName + \"'\"));\n                        continue;\n                    }\n                }\n                if (!errors.length) {\n                    return;\n                }\n                _results = [];\n                for (_j = 0, _len1 = errors.length; _j < _len1; _j++) {\n                    error = errors[_j];\n                    _results.push(require(\"./Weinre\").logError(error));\n                }\n                return _results;\n            };\n            IDLTools.buildProxyForIDL = function(proxyObject, interfaceName) {\n                var intf, intfMethod, messagePrefix, _i, _len, _ref, _results;\n                intf = IDLTools.getIDL(interfaceName);\n                messagePrefix = \"building proxy for IDL \" + interfaceName + \": \";\n                if (null === intf) {\n                    throw new Ex(arguments, messagePrefix + (\"idl not found: '\" + interfaceName + \"'\"));\n                }\n                _ref = intf.methods;\n                _results = [];\n                for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                    intfMethod = _ref[_i];\n                    _results.push(proxyObject[intfMethod.name] = getProxyMethod(intf, intfMethod));\n                }\n                return _results;\n            };\n            return IDLTools;\n        })();\n        getProxyMethod = function(intf, method) {\n            var proxyMethod, result;\n            result = proxyMethod = function() {\n                var args, callbackId;\n                callbackId = null;\n                args = [].slice.call(arguments);\n                if (args.length > 0) {\n                    if (typeof args[args.length - 1] === \"function\") {\n                        callbackId = Callback.register(args[args.length - 1]);\n                        args = args.slice(0, args.length - 1);\n                    }\n                }\n                while (args.length < method.parameters.length) {\n                    args.push(null);\n                }\n                args.push(callbackId);\n                return this.__invoke(intf.name, method.name, args);\n            };\n            result.displayName = intf.name + \"__\" + method.name;\n            return result;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/MessageDispatcher.amd.js\n    ;\n    modjewel.define(\"weinre/common/MessageDispatcher\", function(require, exports, module) {\n        var Binding, Callback, Ex, IDLTools, InspectorBackend, MessageDispatcher, Verbose, WebSocketXhr, Weinre,\n            __indexOf = [].indexOf || function(item) {\n                for (var i = 0, l = this.length; i < l; i++) {\n                    if (i in this && this[i] === item) return i;\n                }\n                return -1;\n            };\n        Weinre = require('./Weinre');\n        WebSocketXhr = require('./WebSocketXhr');\n        IDLTools = require('./IDLTools');\n        Binding = require('./Binding');\n        Ex = require('./Ex');\n        Callback = require('./Callback');\n        Verbose = false;\n        InspectorBackend = null;\n        module.exports = MessageDispatcher = (function() {\n            function MessageDispatcher(url, id) {\n                if (!id) {\n                    id = \"anonymous\";\n                }\n                this._url = url;\n                this._id = id;\n                this.error = null;\n                this._opening = false;\n                this._opened = false;\n                this._closed = false;\n                this._interfaces = {};\n                this._open();\n            }\n            MessageDispatcher.setInspectorBackend = function(inspectorBackend) {\n                return InspectorBackend = inspectorBackend;\n            };\n            MessageDispatcher.verbose = function(value) {\n                if (arguments.length >= 1) {\n                    Verbose = !!value;\n                }\n                return Verbose;\n            };\n            MessageDispatcher.prototype._open = function() {\n                if (this._opened || this._opening) {\n                    return;\n                }\n                if (this._closed) {\n                    throw new Ex(arguments, \"socket has already been closed\");\n                }\n                this._opening = true;\n                this._socket = new WebSocketXhr(this._url, this._id);\n                this._socket.addEventListener(\"open\", Binding(this, \"_handleOpen\"));\n                this._socket.addEventListener(\"error\", Binding(this, \"_handleError\"));\n                this._socket.addEventListener(\"message\", Binding(this, \"_handleMessage\"));\n                return this._socket.addEventListener(\"close\", Binding(this, \"_handleClose\"));\n            };\n            MessageDispatcher.prototype.close = function() {\n                if (this._closed) {\n                    return;\n                }\n                this._opened = false;\n                this._closed = true;\n                return this._socket.close();\n            };\n            MessageDispatcher.prototype.send = function(data) {\n                return this._socket.send(data);\n            };\n            MessageDispatcher.prototype.getWebSocket = function() {\n                return this._socket;\n            };\n            MessageDispatcher.prototype.registerInterface = function(intfName, intf, validate) {\n                if (validate) {\n                    IDLTools.validateAgainstIDL(intf.constructor, intfName);\n                }\n                if (this._interfaces[intfName]) {\n                    throw new Ex(arguments, \"interface \" + intfName + \" has already been registered\");\n                }\n                return this._interfaces[intfName] = intf;\n            };\n            MessageDispatcher.prototype.createProxy = function(intfName) {\n                var proxy, self, __invoke;\n                proxy = {};\n                IDLTools.buildProxyForIDL(proxy, intfName);\n                self = this;\n                proxy.__invoke = __invoke = function(intfName, methodName, args) {\n                    return self._sendMethodInvocation(intfName, methodName, args);\n                };\n                return proxy;\n            };\n            MessageDispatcher.prototype._sendMethodInvocation = function(intfName, methodName, args) {\n                var data;\n                if (typeof intfName !== \"string\") {\n                    throw new Ex(arguments, \"expecting intf parameter to be a string\");\n                }\n                if (typeof methodName !== \"string\") {\n                    throw new Ex(arguments, \"expecting method parameter to be a string\");\n                }\n                data = {\n                    \"interface\": intfName,\n                    method: methodName,\n                    args: args\n                };\n                data = JSON.stringify(data);\n                this._socket.send(data);\n                if (Verbose) {\n                    return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: send \" + intfName + \".\" + methodName + \"(\" + (JSON.stringify(args)) + \")\"));\n                }\n            };\n            MessageDispatcher.prototype.getState = function() {\n                if (this._opening) {\n                    return \"opening\";\n                }\n                if (this._opened) {\n                    return \"opened\";\n                }\n                if (this._closed) {\n                    return \"closed\";\n                }\n                return \"unknown\";\n            };\n            MessageDispatcher.prototype.isOpen = function() {\n                return this._opened === true;\n            };\n            MessageDispatcher.prototype._handleOpen = function(event) {\n                this._opening = false;\n                this._opened = true;\n                this.channel = event.channel;\n                Callback.setConnectorChannel(this.channel);\n                if (Verbose) {\n                    return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: opened\"));\n                }\n            };\n            MessageDispatcher.prototype._handleError = function(message) {\n                this.error = message;\n                this.close();\n                if (Verbose) {\n                    return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: error: \") + message);\n                }\n            };\n            MessageDispatcher.prototype._handleMessage = function(message) {\n                var args, data, e, intf, intfName, method, methodName, methodSignature, skipErrorForMethods;\n                skipErrorForMethods = ['domContentEventFired', 'loadEventFired', 'childNodeRemoved'];\n                try {\n                    data = JSON.parse(message.data);\n                } catch (_error) {\n                    e = _error;\n                    throw new Ex(arguments, \"invalid JSON data received: \" + e + \": '\" + message.data + \"'\");\n                }\n                intfName = data[\"interface\"];\n                methodName = data.method;\n                args = data.args;\n                methodSignature = \"\" + intfName + \".\" + methodName + \"()\";\n                intf = this._interfaces.hasOwnProperty(intfName) && this._interfaces[intfName];\n                if (!intf && InspectorBackend && intfName.match(/.*Notify/)) {\n                    intf = InspectorBackend.getRegisteredDomainDispatcher(intfName.substr(0, intfName.length - 6));\n                }\n                if (!intf) {\n                    Weinre.notImplemented(\"weinre: request for non-registered interface: \" + methodSignature);\n                    return;\n                }\n                methodSignature = intf.constructor.name + (\".\" + methodName + \"()\");\n                method = intf[methodName];\n                if (typeof method !== \"function\") {\n                    Weinre.notImplemented(methodSignature);\n                    return;\n                }\n                try {\n                    method.apply(intf, args);\n                } catch (_error) {\n                    e = _error;\n                    if (__indexOf.call(skipErrorForMethods, methodName) < 0) {\n                        Weinre.logError((\"weinre: invocation exception on \" + methodSignature + \": \") + e);\n                    }\n                }\n                if (Verbose) {\n                    return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: recv \" + intfName + \".\" + methodName + \"(\" + (JSON.stringify(args)) + \")\"));\n                }\n            };\n            MessageDispatcher.prototype._handleClose = function() {\n                this._reallyClosed = true;\n                if (Verbose) {\n                    return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: closed\"));\n                }\n            };\n            return MessageDispatcher;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/MethodNamer.amd.js\n    ;\n    modjewel.define(\"weinre/common/MethodNamer\", function(require, exports, module) {\n        var MethodNamer,\n            __hasProp = {}.hasOwnProperty;\n        module.exports = MethodNamer = (function() {\n            function MethodNamer() {}\n            MethodNamer.setNamesForClass = function(aClass) {\n                var key, val, _ref, _results;\n                for (key in aClass) {\n                    if (!__hasProp.call(aClass, key)) continue;\n                    val = aClass[key];\n                    if (typeof val === \"function\") {\n                        val.signature = \"\" + aClass.name + \"::\" + key;\n                        val.displayName = key;\n                        val.name = key;\n                    }\n                }\n                _ref = aClass.prototype;\n                _results = [];\n                for (key in _ref) {\n                    if (!__hasProp.call(_ref, key)) continue;\n                    val = _ref[key];\n                    if (typeof val === \"function\") {\n                        val.signature = \"\" + aClass.name + \".\" + key;\n                        val.displayName = key;\n                        _results.push(val.name = key);\n                    } else {\n                        _results.push(void 0);\n                    }\n                }\n                return _results;\n            };\n            return MethodNamer;\n        })();\n        MethodNamer.setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/StackTrace.amd.js\n    ;\n    modjewel.define(\"weinre/common/StackTrace\", function(require, exports, module) {\n        var StackTrace, getTrace;\n        module.exports = StackTrace = (function() {\n            function StackTrace(args) {\n                if (!args || !args.callee) {\n                    throw Error(\"first parameter to \" + arguments.callee.signature + \" must be an Arguments object\");\n                }\n                this.trace = getTrace(args);\n            }\n            StackTrace.dump = function(args) {\n                var stackTrace;\n                args = args || arguments;\n                stackTrace = new StackTrace(args);\n                return stackTrace.dump();\n            };\n            StackTrace.prototype.dump = function() {\n                var frame, _i, _len, _ref, _results;\n                console.log(\"StackTrace:\");\n                _ref = this.trace;\n                _results = [];\n                for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                    frame = _ref[_i];\n                    _results.push(console.log(\"    \" + frame));\n                }\n                return _results;\n            };\n            return StackTrace;\n        })();\n        getTrace = function(args) {\n            var err, func, result, visitedFuncs;\n            result = [];\n            visitedFuncs = [];\n            func = args.callee;\n            while (func) {\n                if (func.signature) {\n                    result.push(func.signature);\n                } else if (func.displayName) {\n                    result.push(func.displayName);\n                } else if (func.name) {\n                    result.push(func.name);\n                } else {\n                    result.push(\"<anonymous>\");\n                }\n                if (-1 !== visitedFuncs.indexOf(func)) {\n                    result.push(\"... recursion\");\n                    return result;\n                }\n                visitedFuncs.push(func);\n                try {\n                    func = func.caller;\n                } catch (_error) {\n                    err = _error;\n                    func = null;\n                }\n            }\n            return result;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/WebSocketXhr.amd.js\n    ;\n    modjewel.define(\"weinre/common/WebSocketXhr\", function(require, exports, module) {\n        var EventListeners, Ex, HookLib, WebSocketXhr, Weinre, _xhrEventHandler;\n        Ex = require('./Ex');\n        Weinre = require('./Weinre');\n        HookLib = require('./HookLib');\n        EventListeners = require('./EventListeners');\n        module.exports = WebSocketXhr = (function() {\n            WebSocketXhr.CONNECTING = 0;\n            WebSocketXhr.OPEN = 1;\n            WebSocketXhr.CLOSING = 2;\n            WebSocketXhr.CLOSED = 3;\n\n            function WebSocketXhr(url, id) {\n                this.initialize(url, id);\n            }\n            WebSocketXhr.prototype.initialize = function(url, id) {\n                if (!id) {\n                    id = \"anonymous\";\n                }\n                this.readyState = WebSocketXhr.CONNECTING;\n                this._url = url;\n                this._id = id;\n                this._urlChannel = null;\n                this._queuedSends = [];\n                this._sendInProgress = true;\n                this._listeners = {\n                    open: new EventListeners(),\n                    message: new EventListeners(),\n                    error: new EventListeners(),\n                    close: new EventListeners()\n                };\n                return this._getChannel();\n            };\n            WebSocketXhr.prototype._getChannel = function() {\n                var body;\n                body = JSON.stringify({\n                    id: this._id\n                });\n                return this._xhr(this._url, \"POST\", body, this._handleXhrResponseGetChannel);\n            };\n            WebSocketXhr.prototype._handleXhrResponseGetChannel = function(xhr) {\n                var e, object;\n                if (xhr.status !== 200) {\n                    return this._handleXhrResponseError(xhr);\n                }\n                try {\n                    object = JSON.parse(xhr.responseText);\n                } catch (_error) {\n                    e = _error;\n                    this._fireEventListeners(\"error\", {\n                        message: \"non-JSON response from channel open request\"\n                    });\n                    this.close();\n                    return;\n                }\n                if (!object.channel) {\n                    this._fireEventListeners(\"error\", {\n                        message: \"channel open request did not include a channel\"\n                    });\n                    this.close();\n                    return;\n                }\n                this._urlChannel = this._url + \"/\" + object.channel;\n                this.readyState = WebSocketXhr.OPEN;\n                this._fireEventListeners(\"open\", {\n                    message: \"open\",\n                    channel: object.channel\n                });\n                this._sendInProgress = false;\n                this._sendQueued();\n                return this._readLoop();\n            };\n            WebSocketXhr.prototype._readLoop = function() {\n                if (this.readyState === WebSocketXhr.CLOSED) {\n                    return;\n                }\n                if (this.readyState === WebSocketXhr.CLOSING) {\n                    return;\n                }\n                return this._xhr(this._urlChannel, \"GET\", \"\", this._handleXhrResponseGet);\n            };\n            WebSocketXhr.prototype._handleXhrResponseGet = function(xhr) {\n                var data, datum, e, self, _i, _len, _results;\n                self = this;\n                if (xhr.status !== 200) {\n                    return this._handleXhrResponseError(xhr);\n                }\n                try {\n                    datum = JSON.parse(xhr.responseText);\n                } catch (_error) {\n                    e = _error;\n                    this.readyState = WebSocketXhr.CLOSED;\n                    this._fireEventListeners(\"error\", {\n                        message: \"non-JSON response from read request\"\n                    });\n                    return;\n                }\n                HookLib.ignoreHooks(function() {\n                    return setTimeout((function() {\n                        return self._readLoop();\n                    }), 0);\n                });\n                _results = [];\n                for (_i = 0, _len = datum.length; _i < _len; _i++) {\n                    data = datum[_i];\n                    _results.push(self._fireEventListeners(\"message\", {\n                        data: data\n                    }));\n                }\n                return _results;\n            };\n            WebSocketXhr.prototype.send = function(data) {\n                if (typeof data !== \"string\") {\n                    throw new Ex(arguments, this.constructor.name + \".send\");\n                }\n                this._queuedSends.push(data);\n                if (this._sendInProgress) {\n                    return;\n                }\n                return this._sendQueued();\n            };\n            WebSocketXhr.prototype._sendQueued = function() {\n                var datum;\n                if (this._queuedSends.length === 0) {\n                    return;\n                }\n                if (this.readyState === WebSocketXhr.CLOSED) {\n                    return;\n                }\n                if (this.readyState === WebSocketXhr.CLOSING) {\n                    return;\n                }\n                datum = JSON.stringify(this._queuedSends);\n                this._queuedSends = [];\n                this._sendInProgress = true;\n                return this._xhr(this._urlChannel, \"POST\", datum, this._handleXhrResponseSend);\n            };\n            WebSocketXhr.prototype._handleXhrResponseSend = function(xhr) {\n                var httpSocket;\n                httpSocket = this;\n                if (xhr.status !== 200) {\n                    return this._handleXhrResponseError(xhr);\n                }\n                this._sendInProgress = false;\n                return HookLib.ignoreHooks(function() {\n                    return setTimeout((function() {\n                        return httpSocket._sendQueued();\n                    }), 0);\n                });\n            };\n            WebSocketXhr.prototype.close = function() {\n                this._sendInProgress = true;\n                this.readyState = WebSocketXhr.CLOSING;\n                this._fireEventListeners(\"close\", {\n                    message: \"closing\",\n                    wasClean: true\n                });\n                return this.readyState = WebSocketXhr.CLOSED;\n            };\n            WebSocketXhr.prototype.addEventListener = function(type, listener, useCapture) {\n                return this._getListeners(type).add(listener, useCapture);\n            };\n            WebSocketXhr.prototype.removeEventListener = function(type, listener, useCapture) {\n                return this._getListeners(type).remove(listener, useCapture);\n            };\n            WebSocketXhr.prototype._fireEventListeners = function(type, event) {\n                if (this.readyState === WebSocketXhr.CLOSED) {\n                    return;\n                }\n                event.target = this;\n                return this._getListeners(type).fire(event);\n            };\n            WebSocketXhr.prototype._getListeners = function(type) {\n                var listeners;\n                listeners = this._listeners[type];\n                if (null === listeners) {\n                    throw new Ex(arguments, \"invalid event listener type: '\" + type + \"'\");\n                }\n                return listeners;\n            };\n            WebSocketXhr.prototype._handleXhrResponseError = function(xhr) {\n                if (xhr.status === 404) {\n                    this.close();\n                    return;\n                }\n                this._fireEventListeners(\"error\", {\n                    target: this,\n                    status: xhr.status,\n                    message: \"error from XHR invocation: \" + xhr.statusText\n                });\n                return Weinre.logError((\"error from XHR invocation: \" + xhr.status + \": \") + xhr.statusText);\n            };\n            WebSocketXhr.prototype._xhr = function(url, method, data, handler) {\n                var xhr;\n                if (null === handler) {\n                    throw new Ex(arguments, \"handler must not be null\");\n                }\n                xhr = (XMLHttpRequest.noConflict ? new XMLHttpRequest.noConflict() : new XMLHttpRequest());\n                xhr.httpSocket = this;\n                xhr.httpSocketHandler = handler;\n                xhr.onreadystatechange = function() {\n                    return _xhrEventHandler(xhr);\n                };\n                HookLib.ignoreHooks(function() {\n                    return xhr.open(method, url, true);\n                });\n                xhr.setRequestHeader(\"Content-Type\", \"text/plain\");\n                return HookLib.ignoreHooks(function() {\n                    return xhr.send(data);\n                });\n            };\n            return WebSocketXhr;\n        })();\n        _xhrEventHandler = function(xhr) {\n            if (xhr.readyState !== 4) {\n                return;\n            }\n            return xhr.httpSocketHandler.call(xhr.httpSocket, xhr);\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/common/Weinre.amd.js\n    ;\n    modjewel.define(\"weinre/common/Weinre\", function(require, exports, module) {\n        var ConsoleLogger, Ex, IDLTools, StackTrace, Weinre, consoleLogger, getLogger, logger, _notImplemented, _showNotImplemented;\n        Ex = require('./Ex');\n        IDLTools = require('./IDLTools');\n        StackTrace = require('./StackTrace');\n        _notImplemented = {};\n        _showNotImplemented = false;\n        logger = null;\n        module.exports = Weinre = (function() {\n            function Weinre() {\n                throw new Ex(arguments, \"this class is not intended to be instantiated\");\n            }\n            Weinre.addIDLs = function(idls) {\n                return IDLTools.addIDLs(idls);\n            };\n            Weinre.deprecated = function() {\n                return StackTrace.dump(arguments);\n            };\n            Weinre.notImplemented = function(thing) {\n                if (_notImplemented[thing]) {\n                    return;\n                }\n                _notImplemented[thing] = true;\n                if (!_showNotImplemented) {\n                    return;\n                }\n                return Weinre.logWarning(thing + \" not implemented\");\n            };\n            Weinre.showNotImplemented = function() {\n                var key, _results;\n                _showNotImplemented = true;\n                _results = [];\n                for (key in _notImplemented) {\n                    _results.push(Weinre.logWarning(key + \" not implemented\"));\n                }\n                return _results;\n            };\n            Weinre.logError = function(message) {\n                return getLogger().logError(message);\n            };\n            Weinre.logWarning = function(message) {\n                return getLogger().logWarning(message);\n            };\n            Weinre.logInfo = function(message) {\n                return getLogger().logInfo(message);\n            };\n            Weinre.logDebug = function(message) {\n                return getLogger().logDebug(message);\n            };\n            return Weinre;\n        })();\n        ConsoleLogger = (function() {\n            function ConsoleLogger() {}\n            ConsoleLogger.prototype.logError = function(message) {\n                return console.log(\"error: \" + message);\n            };\n            ConsoleLogger.prototype.logWarning = function(message) {\n                return console.log(\"warning: \" + message);\n            };\n            ConsoleLogger.prototype.logInfo = function(message) {\n                return console.log(\"info: \" + message);\n            };\n            ConsoleLogger.prototype.logDebug = function(message) {\n                return console.log(\"debug: \" + message);\n            };\n            return ConsoleLogger;\n        })();\n        consoleLogger = new ConsoleLogger();\n        getLogger = function() {\n            if (logger) {\n                return logger;\n            }\n            if (Weinre.client) {\n                logger = Weinre.WeinreClientCommands;\n                return logger;\n            }\n            if (Weinre.target) {\n                logger = Weinre.WeinreTargetCommands;\n                return logger;\n            }\n            return consoleLogger;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/BrowserHacks.amd.js\n    ;\n    modjewel.define(\"weinre/target/BrowserHacks\", function(require, exports, module) {\n        var BrowserHacks;\n        BrowserHacks = function() {\n            if (typeof document.addEventListener === \"undefined\") {\n                alert(\"Oops. It seems the page runs in compatibility mode. Please fix it and try again.\");\n                return;\n            }\n            if (typeof window.Element === \"undefined\") {\n                window.Element = function() {};\n            }\n            if (typeof window.Node === \"undefined\") {\n                window.Node = function() {};\n            }\n            if (!Object.getPrototypeOf) {\n                Object.getPrototypeOf = function(object) {\n                    if (!object.__proto__) {\n                        throw new Error(\"This vm does not support __proto__ and getPrototypeOf. Script requires any of them to operate correctly.\");\n                    }\n                    return object.__proto__;\n                };\n            }\n        };\n        BrowserHacks();\n    });\n\n    ;\n    // weinre/target/CheckForProblems.amd.js\n    ;\n    modjewel.define(\"weinre/target/CheckForProblems\", function(require, exports, module) {\n        var CheckForProblems, checkForOldPrototypeVersion;\n        module.exports = CheckForProblems = (function() {\n            function CheckForProblems() {}\n            CheckForProblems.check = function() {\n                return checkForOldPrototypeVersion();\n            };\n            return CheckForProblems;\n        })();\n        checkForOldPrototypeVersion = function() {\n            var badVersion;\n            badVersion = false;\n            if (typeof Prototype === \"undefined\") {\n                return;\n            }\n            if (!Prototype.Version) {\n                return;\n            }\n            if (Prototype.Version.match(/^1\\.5.*/)) {\n                badVersion = true;\n            }\n            if (Prototype.Version.match(/^1\\.6.*/)) {\n                badVersion = true;\n            }\n            if (badVersion) {\n                return alert(\"Sorry, weinre is not support in versions of Prototype earlier than 1.7\");\n            }\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/Console.amd.js\n    ;\n    modjewel.define(\"weinre/target/Console\", function(require, exports, module) {\n        var Console, MessageLevel, MessageSource, MessageType, OriginalConsole, RemoteConsole, Timeline, UsingRemote, Weinre;\n        Weinre = require('../common/Weinre');\n        Timeline = require('../target/Timeline');\n        UsingRemote = false;\n        RemoteConsole = null;\n        OriginalConsole = null;\n        MessageSource = {\n            HTML: 0,\n            WML: 1,\n            XML: 2,\n            JS: 3,\n            CSS: 4,\n            Other: 5\n        };\n        MessageType = {\n            Log: 0,\n            Object: 1,\n            Trace: 2,\n            StartGroup: 3,\n            StartGroupCollapsed: 4,\n            EndGroup: 5,\n            Assert: 6,\n            UncaughtException: 7,\n            Result: 8\n        };\n        MessageLevel = {\n            Tip: 0,\n            Log: 1,\n            Warning: 2,\n            Error: 3,\n            Debug: 4\n        };\n        module.exports = Console = (function() {\n            function Console() {}\n            Object.defineProperty(Console, 'original', {\n                get: function() {\n                    return OriginalConsole;\n                }\n            });\n            Console.useRemote = function(value) {\n                var oldValue;\n                if (arguments.length === 0) {\n                    return UsingRemote;\n                }\n                oldValue = UsingRemote;\n                UsingRemote = !!value;\n                if (UsingRemote) {\n                    window.console = RemoteConsole;\n                } else {\n                    window.console = OriginalConsole;\n                }\n                return oldValue;\n            };\n            Console.prototype._generic = function(level, messageParts) {\n                // fixed console.log(null)\n                messageParts = messageParts || [];\n                var message, messagePart, parameters, payload, _i, _len;\n                // fixed console.log(null) or console.log(undefined) error ---- begin\n                if (messageParts[0] === null) {\n                    message = 'null';\n                } else if (messageParts[0] === undefined) {\n                    message = 'undefined';\n                } else {\n                    message = messageParts[0].toString();\n                }\n                // fixed console.log(null) or console.log(undefined) error ---- end\n                parameters = [];\n                for (_i = 0, _len = messageParts.length; _i < _len; _i++) {\n                    messagePart = messageParts[_i];\n                    parameters.push(Weinre.injectedScript.wrapObjectForConsole(messagePart, true));\n                }\n                payload = {\n                    source: MessageSource.JS,\n                    type: MessageType.Log,\n                    level: level,\n                    message: message,\n                    parameters: parameters\n                };\n                return Weinre.wi.ConsoleNotify.addConsoleMessage(payload);\n            };\n            Console.prototype.log = function() {\n                return this._generic(MessageLevel.Log, [].slice.call(arguments));\n            };\n            Console.prototype.debug = function() {\n                return this._generic(MessageLevel.Debug, [].slice.call(arguments));\n            };\n            Console.prototype.error = function() {\n                return this._generic(MessageLevel.Error, [].slice.call(arguments));\n            };\n            Console.prototype.info = function() {\n                return this._generic(MessageLevel.Log, [].slice.call(arguments));\n            };\n            Console.prototype.warn = function() {\n                return this._generic(MessageLevel.Warning, [].slice.call(arguments));\n            };\n            Console.prototype.dir = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.dirxml = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.trace = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.assert = function(condition) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.count = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.markTimeline = function(message) {\n                return Timeline.addRecord_Mark(message);\n            };\n            Console.prototype.lastWMLErrorMessage = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.profile = function(title) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.profileEnd = function(title) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.time = function(title) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.timeEnd = function(title) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.group = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.groupCollapsed = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            Console.prototype.groupEnd = function() {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            return Console;\n        })();\n        RemoteConsole = new Console();\n        // make global\n        window.consoleforspydebugger = RemoteConsole;\n        OriginalConsole = window.console || {};\n        RemoteConsole.__original = OriginalConsole;\n        OriginalConsole.__original = OriginalConsole;\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/CSSStore.amd.js\n    ;\n    modjewel.define(\"weinre/target/CSSStore\", function(require, exports, module) {\n        var CSSStore, IDGenerator, Weinre, _elementMatchesSelector, _fallbackMatchesSelector, _getMappableId, _getMappableObject, _mozMatchesSelector, _msMatchesSelector, _webkitMatchesSelector;\n        IDGenerator = require('../common/IDGenerator');\n        Weinre = require('../common/Weinre');\n        _elementMatchesSelector = null;\n        module.exports = CSSStore = (function() {\n            function CSSStore() {\n                this.styleSheetMap = {};\n                this.styleRuleMap = {};\n                this.styleDeclMap = {};\n                this.testElement = document.createElement(\"div\");\n            }\n            CSSStore.prototype.getInlineStyle = function(node) {\n                var cssProperty, styleObject, _i, _len, _ref;\n                styleObject = this._buildMirrorForStyle(node.style, true);\n                _ref = styleObject.cssProperties;\n                for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                    cssProperty = _ref[_i];\n                    cssProperty.status = \"style\";\n                }\n                return styleObject;\n            };\n            CSSStore.prototype.getComputedStyle = function(node) {\n                var styleObject;\n                if (!node) {\n                    return {};\n                }\n                if (node.nodeType !== Node.ELEMENT_NODE) {\n                    return {};\n                }\n                styleObject = this._buildMirrorForStyle(window.getComputedStyle(node), false);\n                return styleObject;\n            };\n            CSSStore.prototype.getMatchedCSSRules = function(node) {\n                var cssRule, err, object, result, styleSheet, _i, _j, _len, _len1, _ref, _ref1;\n                result = [];\n                try {\n                    _ref = document.styleSheets;\n                    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                        styleSheet = _ref[_i];\n                        if (!styleSheet.cssRules) {\n                            continue;\n                        }\n                        _ref1 = styleSheet.cssRules;\n                        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {\n                            cssRule = _ref1[_j];\n                            if (!_elementMatchesSelector(node, cssRule.selectorText)) {\n                                continue;\n                            }\n                            object = {};\n                            object.ruleId = this._getStyleRuleId(cssRule);\n                            object.selectorText = cssRule.selectorText;\n                            object.style = this._buildMirrorForStyle(cssRule.style, true);\n                            result.push(object);\n                        }\n                    }\n                } catch (_error) {\n                    err = _error;\n                    return result;\n                }\n                return result;\n            };\n            CSSStore.prototype.getStyleAttributes = function(node) {\n                var result;\n                result = {};\n                return result;\n            };\n            CSSStore.prototype.getPseudoElements = function(node) {\n                var result;\n                result = [];\n                return result;\n            };\n            CSSStore.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite) {\n                var compare, i, key, mirror, properties, propertyIndices, propertyMirror, styleDecl;\n                styleDecl = Weinre.cssStore._getStyleDecl(styleId);\n                if (!styleDecl) {\n                    Weinre.logWarning(\"requested style not available: \" + styleId);\n                    return null;\n                }\n                mirror = styleDecl.__weinre__mirror;\n                if (!mirror) {\n                    Weinre.logWarning(\"requested mirror not available: \" + styleId);\n                    return null;\n                }\n                properties = mirror.cssProperties;\n                propertyMirror = this._parseProperty(text);\n                if (null === propertyMirror) {\n                    this._removePropertyFromMirror(mirror, propertyIndex);\n                    properties = mirror.cssProperties;\n                } else {\n                    this._removePropertyFromMirror(mirror, propertyIndex);\n                    properties = mirror.cssProperties;\n                    propertyIndices = {};\n                    i = 0;\n                    while (i < properties.length) {\n                        propertyIndices[properties[i].name] = i;\n                        i++;\n                    }\n                    i = 0;\n                    while (i < propertyMirror.cssProperties.length) {\n                        if (propertyIndices[propertyMirror.cssProperties[i].name] != null) {\n                            properties[propertyIndices[propertyMirror.cssProperties[i].name]] = propertyMirror.cssProperties[i];\n                        } else {\n                            properties.push(propertyMirror.cssProperties[i]);\n                        }\n                        i++;\n                    }\n                    for (key in propertyMirror.shorthandValues) {\n                        mirror.shorthandValues[key] = propertyMirror.shorthandValues[key];\n                    }\n                }\n                properties.sort(compare = function(p1, p2) {\n                    if (p1.name < p2.name) {\n                        return -1;\n                    } else if (p1.name > p2.name) {\n                        return 1;\n                    } else {\n                        return 0;\n                    }\n                });\n                this._setStyleFromMirror(styleDecl);\n                return mirror;\n            };\n            CSSStore.prototype._removePropertyFromMirror = function(mirror, index) {\n                var i, newProperties, properties, property;\n                properties = mirror.cssProperties;\n                if (index >= properties.length) {\n                    return;\n                }\n                property = properties[index];\n                properties[index] = null;\n                if (mirror.shorthandValues[property.name]) {\n                    delete mirror.shorthandValues[property.name];\n                    i = 0;\n                    while (i < properties.length) {\n                        if (properties[i]) {\n                            if (properties[i].shorthandName === property.name) {\n                                properties[i] = null;\n                            }\n                        }\n                        i++;\n                    }\n                }\n                newProperties = [];\n                i = 0;\n                while (i < properties.length) {\n                    if (properties[i]) {\n                        newProperties.push(properties[i]);\n                    }\n                    i++;\n                }\n                return mirror.cssProperties = newProperties;\n            };\n            CSSStore.prototype.toggleProperty = function(styleId, propertyIndex, disable) {\n                var cssProperty, mirror, styleDecl;\n                styleDecl = Weinre.cssStore._getStyleDecl(styleId);\n                if (!styleDecl) {\n                    Weinre.logWarning(\"requested style not available: \" + styleId);\n                    return null;\n                }\n                mirror = styleDecl.__weinre__mirror;\n                if (!mirror) {\n                    Weinre.logWarning(\"requested mirror not available: \" + styleId);\n                    return null;\n                }\n                cssProperty = mirror.cssProperties[propertyIndex];\n                if (!cssProperty) {\n                    Weinre.logWarning((\"requested property not available: \" + styleId + \": \") + propertyIndex);\n                    return null;\n                }\n                if (disable) {\n                    cssProperty.status = \"disabled\";\n                } else {\n                    cssProperty.status = \"active\";\n                }\n                this._setStyleFromMirror(styleDecl);\n                return mirror;\n            };\n            CSSStore.prototype._setStyleFromMirror = function(styleDecl) {\n                var cssProperties, cssText, property, _i, _len;\n                cssText = [];\n                cssProperties = styleDecl.__weinre__mirror.cssProperties;\n                cssText = \"\";\n                for (_i = 0, _len = cssProperties.length; _i < _len; _i++) {\n                    property = cssProperties[_i];\n                    if (!property.parsedOk) {\n                        continue;\n                    }\n                    if (property.status === \"disabled\") {\n                        continue;\n                    }\n                    if (property.shorthandName) {\n                        continue;\n                    }\n                    cssText += property.name + \": \" + property.value;\n                    if (property.priority === \"important\") {\n                        cssText += \" !important; \";\n                    } else {\n                        cssText += \"; \";\n                    }\n                }\n                return styleDecl.cssText = cssText;\n            };\n            CSSStore.prototype._buildMirrorForStyle = function(styleDecl, bind) {\n                var i, name, properties, property, result, shorthandName;\n                result = {\n                    properties: {},\n                    cssProperties: []\n                };\n                if (!styleDecl) {\n                    return result;\n                }\n                if (bind) {\n                    result.styleId = this._getStyleDeclId(styleDecl);\n                    styleDecl.__weinre__mirror = result;\n                }\n                result.properties.width = styleDecl.getPropertyValue(\"width\") || \"\";\n                result.properties.height = styleDecl.getPropertyValue(\"height\") || \"\";\n                result.cssText = styleDecl.cssText;\n                result.shorthandValues = {};\n                properties = [];\n                if (styleDecl) {\n                    i = 0;\n                    while (i < styleDecl.length) {\n                        property = {};\n                        name = styleDecl.item(i);\n                        property.name = name;\n                        property.priority = styleDecl.getPropertyPriority(name);\n                        property.implicit = typeof styleDecl.isPropertyImplicit !== \"undefined\" ? styleDecl.isPropertyImplicit(name) : true;\n                        property.shorthandName = typeof styleDecl.getPropertyShorthand !== \"undefined\" ? styleDecl.getPropertyShorthand(name) || \"\" : \"\";\n                        property.status = (property.shorthandName ? \"style\" : \"active\");\n                        property.parsedOk = true;\n                        property.value = styleDecl.getPropertyValue(name);\n                        properties.push(property);\n                        if (property.shorthandName) {\n                            shorthandName = property.shorthandName;\n                            if (!result.shorthandValues[shorthandName]) {\n                                result.shorthandValues[shorthandName] = styleDecl.getPropertyValue(shorthandName);\n                                property = {};\n                                property.name = shorthandName;\n                                property.priority = styleDecl.getPropertyPriority(shorthandName);\n                                property.implicit = styleDecl.isPropertyImplicit(shorthandName);\n                                property.shorthandName = \"\";\n                                property.status = \"active\";\n                                property.parsedOk = true;\n                                property.value = styleDecl.getPropertyValue(name);\n                                properties.push(property);\n                            }\n                        }\n                        i++;\n                    }\n                }\n                properties.sort(function(p1, p2) {\n                    if (p1.name < p2.name) {\n                        return -1;\n                    } else if (p1.name > p2.name) {\n                        return 1;\n                    } else {\n                        return 0;\n                    }\n                });\n                result.cssProperties = properties;\n                return result;\n            };\n            CSSStore.prototype._parseProperty = function(string) {\n                var match, property, propertyPattern, result, testStyleDecl;\n                testStyleDecl = this.testElement.style;\n                try {\n                    testStyleDecl.cssText = string;\n                    if (testStyleDecl.cssText !== \"\") {\n                        return this._buildMirrorForStyle(testStyleDecl, false);\n                    }\n                } catch (_error) {}\n                propertyPattern = /\\s*(.+)\\s*:\\s*(.+)\\s*(!important)?\\s*;/;\n                match = propertyPattern.exec(string);\n                if (!match) {\n                    return null;\n                }\n                match[3] = (match[3] === \"!important\" ? \"important\" : \"\");\n                property = {};\n                property.name = match[1];\n                property.priority = match[3];\n                property.implicit = true;\n                property.shorthandName = \"\";\n                property.status = \"inactive\";\n                property.parsedOk = false;\n                property.value = match[2];\n                result = {};\n                result.width = 0;\n                result.height = 0;\n                result.shorthandValues = 0;\n                result.cssProperties = [property];\n                return result;\n            };\n            CSSStore.prototype._getStyleSheet = function(id) {\n                return _getMappableObject(id, this.styleSheetMap);\n            };\n            CSSStore.prototype._getStyleSheetId = function(styleSheet) {\n                return _getMappableId(styleSheet, this.styleSheetMap);\n            };\n            CSSStore.prototype._getStyleRule = function(id) {\n                return _getMappableObject(id, this.styleRuleMap);\n            };\n            CSSStore.prototype._getStyleRuleId = function(styleRule) {\n                return _getMappableId(styleRule, this.styleRuleMap);\n            };\n            CSSStore.prototype._getStyleDecl = function(id) {\n                return _getMappableObject(id, this.styleDeclMap);\n            };\n            CSSStore.prototype._getStyleDeclId = function(styleDecl) {\n                return _getMappableId(styleDecl, this.styleDeclMap);\n            };\n            return CSSStore;\n        })();\n        _getMappableObject = function(id, map) {\n            return map[id];\n        };\n        _getMappableId = function(object, map) {\n            return IDGenerator.getId(object, map);\n        };\n        _mozMatchesSelector = function(element, selector) {\n            if (!element.mozMatchesSelector) {\n                return false;\n            }\n            return element.mozMatchesSelector(selector);\n        };\n        _webkitMatchesSelector = function(element, selector) {\n            if (!element.webkitMatchesSelector) {\n                return false;\n            }\n            return element.webkitMatchesSelector(selector);\n        };\n        _msMatchesSelector = function(element, selector) {\n            if (!element.msMatchesSelector) {\n                return false;\n            }\n            return element.msMatchesSelector(selector);\n        };\n        _fallbackMatchesSelector = function(element, selector) {\n            return false;\n        };\n        if (Element.prototype.webkitMatchesSelector) {\n            _elementMatchesSelector = _webkitMatchesSelector;\n        } else if (Element.prototype.mozMatchesSelector) {\n            _elementMatchesSelector = _mozMatchesSelector;\n        } else if (Element.prototype.msMatchesSelector) {\n            _elementMatchesSelector = _msMatchesSelector;\n        } else {\n            _elementMatchesSelector = _fallbackMatchesSelector;\n        }\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/ElementHighlighter.amd.js\n    ;\n    modjewel.define(\"weinre/target/ElementHighlighter\", function(require, exports, module) {\n        var ElementHighlighter, canvasAvailable, currentHighlighterElement, fromPx, getMetricsForElement, highlighterClass, supportsCanvas;\n        canvasAvailable = null;\n        highlighterClass = null;\n        currentHighlighterElement = null;\n        module.exports = ElementHighlighter = (function() {\n            ElementHighlighter.create = function() {\n                if (highlighterClass == null) {\n                    highlighterClass = require('./ElementHighlighterDivs2');\n                }\n                return new highlighterClass();\n            };\n\n            function ElementHighlighter() {\n                this.hElement = this.createHighlighterElement();\n                this.hElement.__weinreHighlighter = true;\n                this.hElement.style.display = \"none\";\n                this.hElement.style.zIndex = 10 * 1000 * 1000;\n                if (currentHighlighterElement) {\n                    document.body.removeChild(currentHighlighterElement);\n                }\n                currentHighlighterElement = this.hElement;\n                document.body.appendChild(this.hElement);\n            }\n            ElementHighlighter.prototype.on = function(element) {\n                if (null === element) {\n                    return;\n                }\n                if (element.nodeType !== Node.ELEMENT_NODE) {\n                    return;\n                }\n                this.redraw(getMetricsForElement(element));\n                return this.hElement.style.display = \"block\";\n            };\n            ElementHighlighter.prototype.off = function() {\n                return this.hElement.style.display = \"none\";\n            };\n            return ElementHighlighter;\n        })();\n        getMetricsForElement = function(element) {\n            var cStyle, el, left, metrics, top;\n            metrics = {};\n            left = 0;\n            top = 0;\n            el = element;\n            while (true) {\n                left += el.offsetLeft;\n                top += el.offsetTop;\n                if (!(el = el.offsetParent)) {\n                    break;\n                }\n            }\n            metrics.x = left;\n            metrics.y = top;\n            cStyle = document.defaultView.getComputedStyle(element);\n            metrics.width = element.offsetWidth;\n            metrics.height = element.offsetHeight;\n            metrics.marginLeft = fromPx(cStyle[\"margin-left\"] || cStyle[\"marginLeft\"]);\n            metrics.marginRight = fromPx(cStyle[\"margin-right\"] || cStyle[\"marginRight\"]);\n            metrics.marginTop = fromPx(cStyle[\"margin-top\"] || cStyle[\"marginTop\"]);\n            metrics.marginBottom = fromPx(cStyle[\"margin-bottom\"] || cStyle[\"marginBottom\"]);\n            metrics.borderLeft = fromPx(cStyle[\"border-left-width\"] || cStyle[\"borderLeftWidth\"]);\n            metrics.borderRight = fromPx(cStyle[\"border-right-width\"] || cStyle[\"borderRightWidth\"]);\n            metrics.borderTop = fromPx(cStyle[\"border-top-width\"] || cStyle[\"borderTopWidth\"]);\n            metrics.borderBottom = fromPx(cStyle[\"border-bottom-width\"] || cStyle[\"borderBottomWidth\"]);\n            metrics.paddingLeft = fromPx(cStyle[\"padding-left\"] || cStyle[\"paddingLeft\"]);\n            metrics.paddingRight = fromPx(cStyle[\"padding-right\"] || cStyle[\"paddingRight\"]);\n            metrics.paddingTop = fromPx(cStyle[\"padding-top\"] || cStyle[\"paddingTop\"]);\n            metrics.paddingBottom = fromPx(cStyle[\"padding-bottom\"] || cStyle[\"paddingBottom\"]);\n            metrics.x -= metrics.marginLeft;\n            metrics.y -= metrics.marginTop;\n            return metrics;\n        };\n        fromPx = function(string) {\n            return parseInt(string.replace(/px$/, \"\"));\n        };\n        supportsCanvas = function() {\n            var element;\n            element = document.createElement('canvas');\n            if (!element.getContext) {\n                return false;\n            }\n            if (element.getContext('2d')) {\n                return true;\n            }\n            return false;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/ElementHighlighterDivs2.amd.js\n    ;\n    modjewel.define(\"weinre/target/ElementHighlighterDivs2\", function(require, exports, module) {\n        var ColorBorder, ColorContent, ColorMargin, ColorPadding, ElementHighlighter, ElementHighlighterDivs2, px,\n            __hasProp = {}.hasOwnProperty,\n            __extends = function(child, parent) {\n                for (var key in parent) {\n                    if (__hasProp.call(parent, key)) child[key] = parent[key];\n                }\n\n                function ctor() {\n                    this.constructor = child;\n                }\n                ctor.prototype = parent.prototype;\n                child.prototype = new ctor();\n                child.__super__ = parent.prototype;\n                return child;\n            };\n        ElementHighlighter = require('./ElementHighlighter');\n        ColorMargin = 'rgba(246, 178, 107, 0.66)';\n        ColorBorder = 'rgba(255, 229, 153, 0.66)';\n        ColorPadding = 'rgba(147, 196, 125, 0.55)';\n        ColorContent = 'rgba(111, 168, 220, 0.66)';\n        ColorBorder = 'rgba(255, 255, 153, 0.40)';\n        ColorPadding = 'rgba(  0, 255,   0, 0.20)';\n        ColorContent = 'rgba(  0,   0, 255, 0.30)';\n        module.exports = ElementHighlighterDivs2 = (function(_super) {\n            __extends(ElementHighlighterDivs2, _super);\n\n            function ElementHighlighterDivs2() {\n                return ElementHighlighterDivs2.__super__.constructor.apply(this, arguments);\n            }\n            ElementHighlighterDivs2.prototype.createHighlighterElement = function() {\n                this.hElement1 = document.createElement(\"weinreHighlighter\");\n                this.hElement1.style.position = 'absolute';\n                this.hElement1.style.overflow = 'hidden';\n                this.hElement2 = document.createElement(\"weinreHighlighter\");\n                this.hElement2.style.position = 'absolute';\n                this.hElement2.style.display = 'block';\n                this.hElement2.style.overflow = 'hidden';\n                this.hElement1.appendChild(this.hElement2);\n                this.hElement1.style.borderTopStyle = 'solid';\n                this.hElement1.style.borderLeftStyle = 'solid';\n                this.hElement1.style.borderBottomStyle = 'solid';\n                this.hElement1.style.borderRightStyle = 'solid';\n                this.hElement1.style.borderTopColor = ColorMargin;\n                this.hElement1.style.borderLeftColor = ColorMargin;\n                this.hElement1.style.borderBottomColor = ColorMargin;\n                this.hElement1.style.borderRightColor = ColorMargin;\n                this.hElement1.style.backgroundColor = ColorBorder;\n                this.hElement2.style.borderTopStyle = 'solid';\n                this.hElement2.style.borderLeftStyle = 'solid';\n                this.hElement2.style.borderBottomStyle = 'solid';\n                this.hElement2.style.borderRightStyle = 'solid';\n                this.hElement2.style.borderTopColor = ColorPadding;\n                this.hElement2.style.borderLeftColor = ColorPadding;\n                this.hElement2.style.borderBottomColor = ColorPadding;\n                this.hElement2.style.borderRightColor = ColorPadding;\n                this.hElement2.style.backgroundColor = ColorContent;\n                this.hElement1.style.outline = 'black solid thin';\n                return this.hElement1;\n            };\n            ElementHighlighterDivs2.prototype.redraw = function(metrics) {\n                this.hElement1.style.top = px(metrics.y);\n                this.hElement1.style.left = px(metrics.x);\n                this.hElement1.style.height = px(metrics.height);\n                this.hElement1.style.width = px(metrics.width);\n                this.hElement1.style.borderTopWidth = px(metrics.marginTop);\n                this.hElement1.style.borderLeftWidth = px(metrics.marginLeft);\n                this.hElement1.style.borderBottomWidth = px(metrics.marginBottom);\n                this.hElement1.style.borderRightWidth = px(metrics.marginRight);\n                this.hElement2.style.top = px(metrics.borderTop);\n                this.hElement2.style.left = px(metrics.borderLeft);\n                this.hElement2.style.bottom = px(metrics.borderBottom);\n                this.hElement2.style.right = px(metrics.borderRight);\n                this.hElement2.style.borderTopWidth = px(metrics.paddingTop);\n                this.hElement2.style.borderLeftWidth = px(metrics.paddingLeft);\n                this.hElement2.style.borderBottomWidth = px(metrics.paddingBottom);\n                return this.hElement2.style.borderRightWidth = px(metrics.paddingRight);\n            };\n            return ElementHighlighterDivs2;\n        })(ElementHighlighter);\n        px = function(value) {\n            return \"\" + value + \"px\";\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/HookSites.amd.js\n    ;\n    modjewel.define(\"weinre/target/HookSites\", function(require, exports, module) {\n        var HookLib, HookSites;\n        HookLib = require('../common/HookLib');\n        module.exports = HookSites = (function() {\n            function HookSites() {}\n            return HookSites;\n        })();\n        HookSites.window_clearInterval = HookLib.addHookSite(window, \"clearInterval\");\n        HookSites.window_clearTimeout = HookLib.addHookSite(window, \"clearTimeout\");\n        HookSites.window_setInterval = HookLib.addHookSite(window, \"setInterval\");\n        HookSites.window_setTimeout = HookLib.addHookSite(window, \"setTimeout\");\n        HookSites.window_addEventListener = HookLib.addHookSite(window, \"addEventListener\");\n        HookSites.Node_addEventListener = HookLib.addHookSite(Node.prototype, \"addEventListener\");\n        HookSites.XMLHttpRequest_open = HookLib.addHookSite(XMLHttpRequest.prototype, \"open\");\n        HookSites.XMLHttpRequest_send = HookLib.addHookSite(XMLHttpRequest.prototype, \"send\");\n        HookSites.XMLHttpRequest_addEventListener = HookLib.addHookSite(XMLHttpRequest.prototype, \"addEventListener\");\n        if (window.openDatabase) {\n            HookSites.window_openDatabase = HookLib.addHookSite(window, \"openDatabase\");\n        }\n        if (window.localStorage) {\n            HookSites.LocalStorage_setItem = HookLib.addHookSite(window.localStorage, \"setItem\");\n            HookSites.LocalStorage_removeItem = HookLib.addHookSite(window.localStorage, \"removeItem\");\n            HookSites.LocalStorage_clear = HookLib.addHookSite(window.localStorage, \"clear\");\n        }\n        if (window.sessionStorage) {\n            HookSites.SessionStorage_setItem = HookLib.addHookSite(window.sessionStorage, \"setItem\");\n            HookSites.SessionStorage_removeItem = HookLib.addHookSite(window.sessionStorage, \"removeItem\");\n            HookSites.SessionStorage_clear = HookLib.addHookSite(window.sessionStorage, \"clear\");\n        }\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/InjectedScript.js\n    var injectedScriptConstructor =\n        (function(InjectedScriptHost, inspectedWindow, injectedScriptId) {\n            function bind(thisObject, memberFunction) {\n                var func = memberFunction;\n                var args = Array.prototype.slice.call(arguments, 2);\n\n                function bound() {\n                    return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0)));\n                }\n                bound.toString = function() {\n                    return \"bound: \" + func;\n                };\n                return bound;\n            }\n            var InjectedScript = function() {\n                this._lastBoundObjectId = 1;\n                this._idToWrappedObject = {};\n                this._objectGroups = {};\n            }\n            InjectedScript.prototype = {\n                wrapObjectForConsole: function(object, canAccessInspectedWindow) {\n                    if (canAccessInspectedWindow)\n                        return this._wrapObject(object, \"console\");\n                    var result = {};\n                    result.type = typeof object;\n                    result.description = this._toString(object);\n                    return result;\n                },\n                _wrapObject: function(object, objectGroupName, abbreviate) {\n                    try {\n                        var objectId;\n                        if (typeof object === \"object\" || typeof object === \"function\" || this._isHTMLAllCollection(object)) {\n                            var id = this._lastBoundObjectId++;\n                            this._idToWrappedObject[id] = object;\n                            var group = this._objectGroups[objectGroupName];\n                            if (!group) {\n                                group = [];\n                                this._objectGroups[objectGroupName] = group;\n                            }\n                            group.push(id);\n                            objectId = {\n                                injectedScriptId: injectedScriptId,\n                                id: id,\n                                groupName: objectGroupName\n                            };\n                        }\n                        return InjectedScript.RemoteObject.fromObject(object, objectId, abbreviate);\n                    } catch (e) {\n                        return InjectedScript.RemoteObject.fromObject(\"[ Exception: \" + e.toString() + \" ]\");\n                    }\n                },\n                _parseObjectId: function(objectId) {\n                    return eval(\"(\" + objectId + \")\");\n                },\n                releaseWrapperObjectGroup: function(objectGroupName) {\n                    var group = this._objectGroups[objectGroupName];\n                    if (!group)\n                        return;\n                    for (var i = 0; i < group.length; i++)\n                        delete this._idToWrappedObject[group[i]];\n                    delete this._objectGroups[objectGroupName];\n                },\n                dispatch: function(methodName, args) {\n                    var argsArray = eval(\"(\" + args + \")\");\n                    var result = this[methodName].apply(this, argsArray);\n                    if (typeof result === \"undefined\") {\n                        inspectedWindow.console.error(\"Web Inspector error: InjectedScript.%s returns undefined\", methodName);\n                        result = null;\n                    }\n                    return result;\n                },\n                getProperties: function(objectId, ignoreHasOwnProperty, abbreviate) {\n                    var parsedObjectId = this._parseObjectId(objectId);\n                    var object = this._objectForId(parsedObjectId);\n                    if (!this._isDefined(object))\n                        return false;\n                    var properties = [];\n                    var propertyNames;\n                    if (window.navigator.userAgent.indexOf(\"MSIE\") != -1) {\n                        propertyNames = this._getPropertyNames(object);\n                    } else\n                        propertyNames = ignoreHasOwnProperty ? this._getPropertyNames(object) : Object.getOwnPropertyNames(object);\n                    if (!ignoreHasOwnProperty && object.__proto__)\n                        propertyNames.push(\"__proto__\");\n                    for (var i = 0; i < propertyNames.length; ++i) {\n                        var propertyName = propertyNames[i];\n                        var property = {};\n                        property.name = propertyName + \"\";\n                        var isGetter = object[\"__lookupGetter__\"] && object.__lookupGetter__(propertyName);\n                        if (!isGetter) {\n                            try {\n                                property.value = this._wrapObject(object[propertyName], parsedObjectId.groupName, abbreviate);\n                            } catch (e) {\n                                property.value = new InjectedScript.RemoteObject.fromException(e);\n                            }\n                        } else {\n                            property.value = new InjectedScript.RemoteObject.fromObject(\"\\u2014\");\n                            property.isGetter = true;\n                        }\n                        properties.push(property);\n                    }\n                    return properties;\n                },\n                setPropertyValue: function(objectId, propertyName, expression) {\n                    var parsedObjectId = this._parseObjectId(objectId);\n                    var object = this._objectForId(parsedObjectId);\n                    if (!this._isDefined(object))\n                        return false;\n                    var expressionLength = expression.length;\n                    if (!expressionLength) {\n                        delete object[propertyName];\n                        return !(propertyName in object);\n                    }\n                    try {\n                        var result = inspectedWindow.eval(\"(\" + expression + \")\");\n                        object[propertyName] = result;\n                        return true;\n                    } catch (e) {\n                        try {\n                            var result = inspectedWindow.eval(\"\\\"\" + expression.replace(/\"/g, \"\\\\\\\"\") + \"\\\"\");\n                            object[propertyName] = result;\n                            return true;\n                        } catch (e) {\n                            return false;\n                        }\n                    }\n                },\n                _populatePropertyNames: function(object, resultSet) {\n                    for (var o = object; o; o = Object.getPrototypeOf(o)) {\n                        try {\n                            var names = Object.getOwnPropertyNames(o);\n                            for (var i = 0; i < names.length; ++i)\n                                resultSet[names[i]] = true;\n                        } catch (e) {}\n                    }\n                },\n                _getPropertyNames: function(object, resultSet) {\n                    var propertyNameSet = {};\n                    this._populatePropertyNames(object, propertyNameSet);\n                    return Object.keys(propertyNameSet);\n                },\n                getCompletions: function(expression, includeCommandLineAPI) {\n                    var props = {};\n                    try {\n                        if (!expression)\n                            expression = \"this\";\n                        var expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false, false);\n                        if (typeof expressionResult === \"object\")\n                            this._populatePropertyNames(expressionResult, props);\n                        if (includeCommandLineAPI) {\n                            for (var prop in CommandLineAPI.members_)\n                                props[CommandLineAPI.members_[prop]] = true;\n                        }\n                    } catch (e) {}\n                    return props;\n                },\n                getCompletionsOnCallFrame: function(callFrameId, expression, includeCommandLineAPI) {\n                    var props = {};\n                    try {\n                        var callFrame = this._callFrameForId(callFrameId);\n                        if (!callFrame)\n                            return props;\n                        if (expression) {\n                            var expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true, false);\n                            if (typeof expressionResult === \"object\")\n                                this._populatePropertyNames(expressionResult, props);\n                        } else {\n                            var scopeChain = callFrame.scopeChain;\n                            for (var i = 0; i < scopeChain.length; ++i)\n                                this._populatePropertyNames(scopeChain[i], props);\n                        }\n                        if (includeCommandLineAPI) {\n                            for (var prop in CommandLineAPI.members_)\n                                props[CommandLineAPI.members_[prop]] = true;\n                        }\n                    } catch (e) {}\n                    return props;\n                },\n                evaluate: function(expression, objectGroup, injectCommandLineAPI) {\n                    return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup, false, injectCommandLineAPI);\n                },\n                _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame, injectCommandLineAPI) {\n                    try {\n                        return this._wrapObject(this._evaluateOn(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI), objectGroup);\n                    } catch (e) {\n                        return InjectedScript.RemoteObject.fromException(e);\n                    }\n                },\n                _evaluateOn: function(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI) {\n                    try {\n                        if (injectCommandLineAPI && inspectedWindow.console) {\n                            inspectedWindow.console._commandLineAPI = new CommandLineAPI(this._commandLineAPIImpl, isEvalOnCallFrame ? object : null);\n                            expression = \"with ((window && window.console && window.console._commandLineAPI) || {}) {\\n\" + expression + \"\\n}\";\n                        }\n                        var value = evalFunction.call(object, expression);\n                        if (this._type(value) === \"error\")\n                            throw value.toString();\n                        return value;\n                    } finally {\n                        if (injectCommandLineAPI && inspectedWindow.console)\n                            delete inspectedWindow.console._commandLineAPI;\n                    }\n                },\n                getNodeId: function(node) {\n                    return InjectedScriptHost.pushNodePathToFrontend(node, false, false);\n                },\n                callFrames: function() {\n                    var callFrame = InjectedScriptHost.currentCallFrame();\n                    if (!callFrame)\n                        return false;\n                    injectedScript.releaseWrapperObjectGroup(\"backtrace\");\n                    var result = [];\n                    var depth = 0;\n                    do {\n                        result.push(new InjectedScript.CallFrameProxy(depth++, callFrame));\n                        callFrame = callFrame.caller;\n                    } while (callFrame);\n                    return result;\n                },\n                evaluateOnCallFrame: function(callFrameId, expression, objectGroup, injectCommandLineAPI) {\n                    var callFrame = this._callFrameForId(callFrameId);\n                    if (!callFrame)\n                        return false;\n                    return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI);\n                },\n                _callFrameForId: function(callFrameId) {\n                    var parsedCallFrameId = eval(\"(\" + callFrameId + \")\");\n                    var ordinal = parsedCallFrameId.ordinal;\n                    var callFrame = InjectedScriptHost.currentCallFrame();\n                    while (--ordinal >= 0 && callFrame)\n                        callFrame = callFrame.caller;\n                    return callFrame;\n                },\n                _nodeForId: function(nodeId) {\n                    if (!nodeId)\n                        return null;\n                    return InjectedScriptHost.nodeForId(nodeId);\n                },\n                _objectForId: function(objectId) {\n                    return this._idToWrappedObject[objectId.id];\n                },\n                resolveNode: function(nodeId) {\n                    var node = this._nodeForId(nodeId);\n                    if (!node)\n                        return false;\n                    return this._wrapObject(node, \"prototype\");\n                },\n                getNodeProperties: function(nodeId, properties) {\n                    var node = this._nodeForId(nodeId);\n                    if (!node)\n                        return false;\n                    properties = eval(\"(\" + properties + \")\");\n                    var result = {};\n                    for (var i = 0; i < properties.length; ++i)\n                        result[properties[i]] = node[properties[i]];\n                    return result;\n                },\n                getNodePrototypes: function(nodeId) {\n                    this.releaseWrapperObjectGroup(\"prototypes\");\n                    var node = this._nodeForId(nodeId);\n                    if (!node)\n                        return false;\n                    var result = [];\n                    var prototype = node;\n                    do {\n                        result.push(this._wrapObject(prototype, \"prototypes\"));\n                        prototype = Object.getPrototypeOf(prototype);\n                    } while (prototype)\n                    return result;\n                },\n                pushNodeToFrontend: function(objectId) {\n                    var parsedObjectId = this._parseObjectId(objectId);\n                    var object = this._objectForId(parsedObjectId);\n                    if (!object || this._type(object) !== \"node\")\n                        return false;\n                    return InjectedScriptHost.pushNodePathToFrontend(object, false, false);\n                },\n                evaluateOnSelf: function(funcBody, args) {\n                    var func = eval(\"(\" + funcBody + \")\");\n                    return func.apply(this, eval(\"(\" + args + \")\") || []);\n                },\n                _isDefined: function(object) {\n                    return object || this._isHTMLAllCollection(object);\n                },\n                _isHTMLAllCollection: function(object) {\n                    return (typeof object === \"undefined\") && inspectedWindow.HTMLAllCollection && object instanceof inspectedWindow.HTMLAllCollection;\n                },\n                _type: function(obj) {\n                    if (obj === null)\n                        return \"null\";\n                    var type = typeof obj;\n                    if (type !== \"object\" && type !== \"function\") {\n                        if (this._isHTMLAllCollection(obj))\n                            return \"array\";\n                        return type;\n                    }\n                    if (!inspectedWindow.document)\n                        return type;\n                    if (obj instanceof inspectedWindow.Node) {\n                        try {\n                            return (obj.nodeType === undefined ? type : \"node\");\n                        } catch (ex) {}\n                        return obj.toString();\n                    }\n                    if (obj instanceof inspectedWindow.String)\n                        return \"string\";\n                    if (obj instanceof inspectedWindow.Array)\n                        return \"array\";\n                    if (obj instanceof inspectedWindow.Boolean)\n                        return \"boolean\";\n                    if (obj instanceof inspectedWindow.Number)\n                        return \"number\";\n                    if (obj instanceof inspectedWindow.Date)\n                        return \"date\";\n                    if (obj instanceof inspectedWindow.RegExp)\n                        return \"regexp\";\n                    if (isFinite(obj.length) && typeof obj.splice === \"function\")\n                        return \"array\";\n                    if (isFinite(obj.length) && typeof obj.callee === \"function\")\n                        return \"array\";\n                    if (obj instanceof inspectedWindow.NodeList)\n                        return \"array\";\n                    if (obj instanceof inspectedWindow.HTMLCollection)\n                        return \"array\";\n                    if (obj instanceof inspectedWindow.Error)\n                        return \"error\";\n                    return type;\n                },\n                _describe: function(obj, abbreviated) {\n                    var type = this._type(obj);\n                    switch (type) {\n                        case \"object\":\n                        case \"node\":\n                            var result = InjectedScriptHost.internalConstructorName(obj);\n                            if (result === \"Object\") {\n                                var constructorName = obj.constructor && obj.constructor.name;\n                                if (constructorName)\n                                    return constructorName;\n                            }\n                            return result;\n                        case \"array\":\n                            var className = InjectedScriptHost.internalConstructorName(obj);\n                            if (typeof obj.length === \"number\")\n                                className += \"[\" + obj.length + \"]\";\n                            return className;\n                        case \"string\":\n                            if (!abbreviated)\n                                return obj;\n                            if (obj.length > 100)\n                                return \"\\\"\" + obj.substring(0, 100) + \"\\u2026\\\"\";\n                            return \"\\\"\" + obj + \"\\\"\";\n                        case \"function\":\n                            var objectText = this._toString(obj);\n                            if (abbreviated)\n                                objectText = /.*/.exec(objectText)[0].replace(/ +$/g, \"\");\n                            return objectText;\n                        default:\n                            return this._toString(obj);\n                    }\n                },\n                _toString: function(obj) {\n                    return \"\" + obj;\n                }\n            }\n            var injectedScript = new InjectedScript();\n            InjectedScript.RemoteObject = function(objectId, type, description, hasChildren) {\n                this.objectId = objectId;\n                this.type = type;\n                this.description = description;\n                this.hasChildren = hasChildren;\n            }\n            InjectedScript.RemoteObject.fromException = function(e) {\n                return new InjectedScript.RemoteObject(null, \"error\", e.toString());\n            }\n            InjectedScript.RemoteObject.fromObject = function(object, objectId, abbreviate) {\n                var type = injectedScript._type(object);\n                var rawType = typeof object;\n                var hasChildren = (rawType === \"object\" && object !== null && (Object.getOwnPropertyNames(object).length || !!Object.getPrototypeOf(object))) || rawType === \"function\";\n                var description = \"\";\n                try {\n                    var description = injectedScript._describe(object, abbreviate);\n                    return new InjectedScript.RemoteObject(objectId, type, description, hasChildren);\n                } catch (e) {\n                    return InjectedScript.RemoteObject.fromException(e);\n                }\n            }\n            InjectedScript.CallFrameProxy = function(ordinal, callFrame) {\n                this.id = {\n                    ordinal: ordinal,\n                    injectedScriptId: injectedScriptId\n                };\n                this.type = callFrame.type;\n                this.functionName = (this.type === \"function\" ? callFrame.functionName : \"\");\n                this.sourceID = callFrame.sourceID;\n                this.line = callFrame.line;\n                this.column = callFrame.column;\n                this.scopeChain = this._wrapScopeChain(callFrame);\n            }\n            InjectedScript.CallFrameProxy.prototype = {\n                _wrapScopeChain: function(callFrame) {\n                    var GLOBAL_SCOPE = 0;\n                    var LOCAL_SCOPE = 1;\n                    var WITH_SCOPE = 2;\n                    var CLOSURE_SCOPE = 3;\n                    var CATCH_SCOPE = 4;\n                    var scopeChain = callFrame.scopeChain;\n                    var scopeChainProxy = [];\n                    var foundLocalScope = false;\n                    for (var i = 0; i < scopeChain.length; i++) {\n                        var scopeType = callFrame.scopeType(i);\n                        var scopeObject = scopeChain[i];\n                        var scopeObjectProxy = injectedScript._wrapObject(scopeObject, \"backtrace\", true);\n                        switch (scopeType) {\n                            case LOCAL_SCOPE:\n                                {\n                                    foundLocalScope = true;\n                                    scopeObjectProxy.isLocal = true;\n                                    scopeObjectProxy.thisObject = injectedScript._wrapObject(callFrame.thisObject, \"backtrace\", true);\n                                    break;\n                                }\n                            case CLOSURE_SCOPE:\n                                {\n                                    scopeObjectProxy.isClosure = true;\n                                    break;\n                                }\n                            case WITH_SCOPE:\n                            case CATCH_SCOPE:\n                                {\n                                    if (foundLocalScope && scopeObject instanceof inspectedWindow.Element)\n                                        scopeObjectProxy.isElement = true;\n                                    else if (foundLocalScope && scopeObject instanceof inspectedWindow.Document)\n                                        scopeObjectProxy.isDocument = true;\n                                    else\n                                        scopeObjectProxy.isWithBlock = true;\n                                    break;\n                                }\n                        }\n                        scopeChainProxy.push(scopeObjectProxy);\n                    }\n                    return scopeChainProxy;\n                }\n            }\n\n            function CommandLineAPI(commandLineAPIImpl, callFrame) {\n                function inScopeVariables(member) {\n                    if (!callFrame)\n                        return false;\n                    var scopeChain = callFrame.scopeChain;\n                    for (var i = 0; i < scopeChain.length; ++i) {\n                        if (member in scopeChain[i])\n                            return true;\n                    }\n                    return false;\n                }\n                for (var i = 0; i < CommandLineAPI.members_.length; ++i) {\n                    var member = CommandLineAPI.members_[i];\n                    if (member in inspectedWindow || inScopeVariables(member))\n                        continue;\n                    this[member] = bind(commandLineAPIImpl, commandLineAPIImpl[member]);\n                }\n                for (var i = 0; i < 5; ++i) {\n                    var member = \"$\" + i;\n                    if (member in inspectedWindow || inScopeVariables(member))\n                        continue;\n                    Object.defineProperty(this, \"$\" + i, {\n                        get: bind(commandLineAPIImpl, commandLineAPIImpl._inspectedNode, i)\n                    });\n                }\n            }\n            CommandLineAPI.members_ = [\n                \"$\", \"$$\", \"$x\", \"dir\", \"dirxml\", \"keys\", \"values\", \"profile\", \"profileEnd\",\n                \"monitorEvents\", \"unmonitorEvents\", \"inspect\", \"copy\", \"clear\"\n            ];\n\n            function CommandLineAPIImpl() {}\n            CommandLineAPIImpl.prototype = {\n                $: function() {\n                    return document.getElementById.apply(document, arguments)\n                },\n                $$: function() {\n                    return document.querySelectorAll.apply(document, arguments)\n                },\n                $x: function(xpath, context) {\n                    var nodes = [];\n                    try {\n                        var doc = (context && context.ownerDocument) || inspectedWindow.document;\n                        var results = doc.evaluate(xpath, context || doc, null, XPathResult.ANY_TYPE, null);\n                        var node;\n                        while (node = results.iterateNext())\n                            nodes.push(node);\n                    } catch (e) {}\n                    return nodes;\n                },\n                dir: function() {\n                    return console.dir.apply(console, arguments)\n                },\n                dirxml: function() {\n                    return console.dirxml.apply(console, arguments)\n                },\n                keys: function(object) {\n                    return Object.keys(object);\n                },\n                values: function(object) {\n                    var result = [];\n                    for (var key in object)\n                        result.push(object[key]);\n                    return result;\n                },\n                profile: function() {\n                    return console.profile.apply(console, arguments)\n                },\n                profileEnd: function() {\n                    return console.profileEnd.apply(console, arguments)\n                },\n                monitorEvents: function(object, types) {\n                    if (!object || !object.addEventListener || !object.removeEventListener)\n                        return;\n                    types = this._normalizeEventTypes(types);\n                    for (var i = 0; i < types.length; ++i) {\n                        object.removeEventListener(types[i], this._logEvent, false);\n                        object.addEventListener(types[i], this._logEvent, false);\n                    }\n                },\n                unmonitorEvents: function(object, types) {\n                    if (!object || !object.addEventListener || !object.removeEventListener)\n                        return;\n                    types = this._normalizeEventTypes(types);\n                    for (var i = 0; i < types.length; ++i)\n                        object.removeEventListener(types[i], this._logEvent, false);\n                },\n                inspect: function(object) {\n                    if (arguments.length === 0)\n                        return;\n                    inspectedWindow.console.log(object);\n                    if (injectedScript._type(object) === \"node\")\n                        InjectedScriptHost.pushNodePathToFrontend(object, false, true);\n                    else {\n                        switch (injectedScript._describe(object)) {\n                            case \"Database\":\n                                InjectedScriptHost.selectDatabase(object);\n                                break;\n                            case \"Storage\":\n                                InjectedScriptHost.selectDOMStorage(object);\n                                break;\n                        }\n                    }\n                },\n                copy: function(object) {\n                    if (injectedScript._type(object) === \"node\")\n                        object = object.outerHTML;\n                    InjectedScriptHost.copyText(object);\n                },\n                clear: function() {\n                    InjectedScriptHost.clearConsoleMessages();\n                },\n                _inspectedNode: function(num) {\n                    var nodeId = InjectedScriptHost.inspectedNode(num);\n                    return injectedScript._nodeForId(nodeId);\n                },\n                _normalizeEventTypes: function(types) {\n                    if (typeof types === \"undefined\")\n                        types = [\"mouse\", \"key\", \"load\", \"unload\", \"abort\", \"error\", \"select\", \"change\", \"submit\", \"reset\", \"focus\", \"blur\", \"resize\", \"scroll\"];\n                    else if (typeof types === \"string\")\n                        types = [types];\n                    var result = [];\n                    for (var i = 0; i < types.length; i++) {\n                        if (types[i] === \"mouse\")\n                            result.splice(0, 0, \"mousedown\", \"mouseup\", \"click\", \"dblclick\", \"mousemove\", \"mouseover\", \"mouseout\");\n                        else if (types[i] === \"key\")\n                            result.splice(0, 0, \"keydown\", \"keyup\", \"keypress\");\n                        else\n                            result.push(types[i]);\n                    }\n                    return result;\n                },\n                _logEvent: function(event) {\n                    console.log(event.type, event);\n                }\n            }\n            injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();\n            return injectedScript;\n        });\n    // weinre/target/InjectedScriptHostImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/InjectedScriptHostImpl\", function(require, exports, module) {\n        var InjectedScriptHostImpl, Weinre;\n        Weinre = require('../common/Weinre');\n        module.exports = InjectedScriptHostImpl = (function() {\n            function InjectedScriptHostImpl() {}\n            InjectedScriptHostImpl.prototype.clearConsoleMessages = function(callback) {\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            InjectedScriptHostImpl.prototype.nodeForId = function(nodeId, callback) {\n                return Weinre.nodeStore.getNode(nodeId);\n            };\n            InjectedScriptHostImpl.prototype.pushNodePathToFrontend = function(node, withChildren, selectInUI, callback) {\n                var children, nodeId;\n                nodeId = Weinre.nodeStore.getNodeId(node);\n                children = Weinre.nodeStore.serializeNode(node, 1);\n                Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\n                if (callback) {\n                    Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n                if (selectInUI) {\n                    return Weinre.wi.InspectorNotify.updateFocusedNode(nodeId);\n                }\n            };\n            InjectedScriptHostImpl.prototype.inspectedNode = function(num, callback) {\n                var nodeId;\n                nodeId = Weinre.nodeStore.getInspectedNode(num);\n                return nodeId;\n            };\n            InjectedScriptHostImpl.prototype.internalConstructorName = function(object) {\n                var ctor, ctorName, match, pattern;\n                ctor = object.constructor;\n                ctorName = ctor.fullClassName || ctor.displayName || ctor.name;\n                if (ctorName && (ctorName !== \"Object\")) {\n                    return ctorName;\n                }\n                pattern = /\\[object (.*)\\]/;\n                match = pattern.exec(object.toString());\n                if (match) {\n                    return match[1];\n                }\n                return \"Object\";\n            };\n            return InjectedScriptHostImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/NetworkRequest.amd.js\n    ;\n    modjewel.define(\"weinre/target/NetworkRequest\", function(require, exports, module) {\n        var Ex, HookLib, HookSites, IDGenerator, Loader, NetworkRequest, StackTrace, Weinre, getFormData, getHeaders, getRequest, getResponse, getXhrEventHandler, splitContentType, trim;\n        StackTrace = require('../common/StackTrace');\n        IDGenerator = require('../common/IDGenerator');\n        HookLib = require('../common/HookLib');\n        Weinre = require('../common/Weinre');\n        Ex = require('../common/Ex');\n        HookSites = require('./HookSites');\n        Loader = {\n            url: window.location.href,\n            frameId: 0,\n            loaderId: 0\n        };\n        module.exports = NetworkRequest = (function() {\n            function NetworkRequest(xhr, id, method, url, stackTrace) {\n                this.xhr = xhr;\n                this.id = id;\n                this.method = method;\n                this.url = url;\n                this.stackTrace = stackTrace;\n            }\n            NetworkRequest.prototype.handleSend = function(data) {\n                var redirectResponse, request, time;\n                Weinre.wi.NetworkNotify.identifierForInitialRequest(this.id, this.url, Loader, this.stackTrace);\n                time = Date.now() / 1000.0;\n                request = getRequest(this.url, this.method, this.xhr, data);\n                redirectResponse = {\n                    isNull: true\n                };\n                return Weinre.wi.NetworkNotify.willSendRequest(this.id, time, request, redirectResponse);\n            };\n            NetworkRequest.prototype.handleHeadersReceived = function() {\n                var response, time;\n                time = Date.now() / 1000.0;\n                response = getResponse(this.xhr);\n                return Weinre.wi.NetworkNotify.didReceiveResponse(this.id, time, \"XHR\", response);\n            };\n            NetworkRequest.prototype.handleLoading = function() {};\n            NetworkRequest.prototype.handleDone = function() {\n                var description, e, sourceString, status, statusText, success, time;\n                sourceString = \"\";\n                try {\n                    sourceString = this.xhr.responseText;\n                } catch (_error) {\n                    e = _error;\n                }\n                Weinre.wi.NetworkNotify.setInitialContent(this.id, sourceString, \"XHR\");\n                time = Date.now() / 1000.0;\n                status = this.xhr.status;\n                if (status === 0) {\n                    status = 200;\n                }\n                statusText = this.xhr.statusText;\n                success = status >= 200 && status < 300;\n                if (success) {\n                    return Weinre.wi.NetworkNotify.didFinishLoading(this.id, time);\n                } else {\n                    description = \"\" + status + \" - \" + statusText;\n                    return Weinre.wi.NetworkNotify.didFailLoading(this.id, time, description);\n                }\n            };\n            NetworkRequest.installNativeHooks = function() {\n                HookSites.XMLHttpRequest_open.addHooks({\n                    before: function(receiver, args) {\n                        var frame, id, method, rawStackTrace, stackTrace, url, xhr, _i, _len;\n                        xhr = receiver;\n                        method = args[0];\n                        url = args[1];\n                        id = IDGenerator.next();\n                        rawStackTrace = new StackTrace(args).trace.slice(1);\n                        stackTrace = [];\n                        for (_i = 0, _len = rawStackTrace.length; _i < _len; _i++) {\n                            frame = rawStackTrace[_i];\n                            stackTrace.push({\n                                functionName: frame\n                            });\n                        }\n                        xhr.__weinreNetworkRequest__ = new NetworkRequest(xhr, id, method, url, stackTrace);\n                        return HookLib.ignoreHooks(function() {\n                            return xhr.addEventListener(\"readystatechange\", getXhrEventHandler(xhr), false);\n                        });\n                    }\n                });\n                return HookSites.XMLHttpRequest_send.addHooks({\n                    before: function(receiver, args) {\n                        var data, nr, xhr;\n                        xhr = receiver;\n                        data = args[0];\n                        nr = xhr.__weinreNetworkRequest__;\n                        if (!nr) {\n                            return;\n                        }\n                        return nr.handleSend(data);\n                    }\n                });\n            };\n            return NetworkRequest;\n        })();\n        getRequest = function(url, method, xhr, data) {\n            return {\n                url: url,\n                httpMethod: method,\n                httpHeaderFields: {},\n                requestFormData: getFormData(url, data)\n            };\n        };\n        getResponse = function(xhr) {\n            var contentLength, contentType, encoding, headers, result, _ref;\n            contentType = xhr.getResponseHeader(\"Content-Type\");\n            contentType || (contentType = 'application/octet-stream');\n            _ref = splitContentType(contentType), contentType = _ref[0], encoding = _ref[1];\n            headers = getHeaders(xhr);\n            result = {\n                mimeType: contentType,\n                textEncodingName: encoding,\n                httpStatusCode: xhr.status,\n                httpStatusText: xhr.statusText,\n                httpHeaderFields: headers,\n                connectionReused: false,\n                connectionID: 0,\n                wasCached: false\n            };\n            contentLength = xhr.getResponseHeader(\"Content-Length\");\n            contentLength = parseInt(contentLength);\n            if (!isNaN(contentLength)) {\n                result.expectedContentLength = contentLength;\n            }\n            return result;\n        };\n        getHeaders = function(xhr) {\n            var key, line, lines, result, string, val, _i, _len, _ref;\n            string = xhr.getAllResponseHeaders();\n            lines = string.split('\\r\\n');\n            result = {};\n            for (_i = 0, _len = lines.length; _i < _len; _i++) {\n                line = lines[_i];\n                line = trim(line);\n                if (line === \"\") {\n                    break;\n                }\n                _ref = line.split(':', 2), key = _ref[0], val = _ref[1];\n                result[trim(key)] = trim(val);\n            }\n            return result;\n        };\n        trim = function(string) {\n            return string.replace(/^\\s+|\\s+$/g, '');\n        };\n        getFormData = function(url, data) {\n            var match, pattern;\n            if (data) {\n                return data;\n            }\n            pattern = /.*?\\?(.*?)(#.*)?$/;\n            match = url.match(pattern);\n            if (match) {\n                return match[1];\n            }\n            return \"\";\n        };\n        splitContentType = function(contentType) {\n            var match, pattern;\n            pattern = /\\s*(.*?)\\s*(;\\s*(.*))?\\s*$/;\n            match = contentType.match(pattern);\n            if (!match) {\n                return [contentType, \"\"];\n            }\n            return [match[1], match[3]];\n        };\n        getXhrEventHandler = function(xhr) {\n            return function() {\n                var e, nr;\n                nr = xhr.__weinreNetworkRequest__;\n                if (!nr) {\n                    return;\n                }\n                try {\n                    switch (xhr.readyState) {\n                        case 2:\n                            return nr.handleHeadersReceived();\n                        case 3:\n                            return nr.handleLoading();\n                        case 4:\n                            return nr.handleDone();\n                    }\n                } catch (_error) {\n                    e = _error;\n                }\n            };\n        };\n    });\n\n    ;\n    // weinre/target/NodeStore.amd.js\n    ;\n    modjewel.define(\"weinre/target/NodeStore\", function(require, exports, module) {\n        var Debug, IDGenerator, NodeStore, Weinre, handleDOMAttrModified, handleDOMCharacterDataModified, handleDOMNodeInserted, handleDOMNodeRemoved, handleDOMSubtreeModified;\n        Weinre = require('../common/Weinre');\n        IDGenerator = require('../common/IDGenerator');\n        Debug = require('../common/Debug');\n        module.exports = NodeStore = (function() {\n            function NodeStore() {\n                this._nodeMap = {};\n                this._childrenSent = {};\n                this._inspectedNodes = [];\n                document.addEventListener(\"DOMSubtreeModified\", handleDOMSubtreeModified, false);\n                document.addEventListener(\"DOMNodeInserted\", handleDOMNodeInserted, false);\n                document.addEventListener(\"DOMNodeRemoved\", handleDOMNodeRemoved, false);\n                document.addEventListener(\"DOMAttrModified\", handleDOMAttrModified, false);\n                document.addEventListener(\"DOMCharacterDataModified\", handleDOMCharacterDataModified, false);\n            }\n            NodeStore.prototype.addInspectedNode = function(nodeId) {\n                this._inspectedNodes.unshift(nodeId);\n                if (this._inspectedNodes.length > 5) {\n                    return this._inspectedNodes = this._inspectedNodes.slice(0, 5);\n                }\n            };\n            NodeStore.prototype.getInspectedNode = function(index) {\n                return this._inspectedNodes[index];\n            };\n            NodeStore.prototype.getNode = function(nodeId) {\n                return this._nodeMap[nodeId];\n            };\n            NodeStore.prototype.checkNodeId = function(node) {\n                return IDGenerator.checkId(node);\n            };\n            NodeStore.prototype.getNodeId = function(node) {\n                var id;\n                id = this.checkNodeId(node);\n                if (id) {\n                    return id;\n                }\n                return IDGenerator.getId(node, this._nodeMap);\n            };\n            NodeStore.prototype.getNodeData = function(nodeId, depth) {\n                return this.serializeNode(this.getNode(nodeId), depth);\n            };\n            NodeStore.prototype.getPreviousSiblingId = function(node) {\n                var id, sib;\n                while (true) {\n                    sib = node.previousSibling;\n                    if (!sib) {\n                        return 0;\n                    }\n                    id = this.checkNodeId(sib);\n                    if (id) {\n                        return id;\n                    }\n                    node = sib;\n                }\n            };\n            NodeStore.prototype.nextNodeId = function() {\n                return \"\" + IDGenerator.next();\n            };\n            NodeStore.prototype.serializeNode = function(node, depth) {\n                var children, i, id, localName, nodeData, nodeName, nodeValue;\n                nodeName = \"\";\n                nodeValue = null;\n                localName = null;\n                id = this.getNodeId(node);\n                switch (node.nodeType) {\n                    case Node.TEXT_NODE:\n                    case Node.COMMENT_NODE:\n                    case Node.CDATA_SECTION_NODE:\n                        nodeValue = node.nodeValue;\n                        break;\n                    case Node.ATTRIBUTE_NODE:\n                        localName = node.localName;\n                        break;\n                    case Node.DOCUMENT_FRAGMENT_NODE:\n                        break;\n                    default:\n                        nodeName = node.nodeName;\n                        localName = node.localName;\n                }\n                nodeData = {\n                    id: id,\n                    nodeType: node.nodeType,\n                    nodeName: nodeName,\n                    localName: localName,\n                    nodeValue: nodeValue\n                };\n                if (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n                    nodeData.childNodeCount = this.childNodeCount(node);\n                    children = this.serializeNodeChildren(node, depth);\n                    if (children.length) {\n                        nodeData.children = children;\n                    }\n                    if (node.nodeType === Node.ELEMENT_NODE) {\n                        nodeData.attributes = [];\n                        i = 0;\n                        while (i < node.attributes.length) {\n                            nodeData.attributes.push(node.attributes[i].nodeName);\n                            nodeData.attributes.push(node.attributes[i].nodeValue);\n                            i++;\n                        }\n                    } else {\n                        if (node.nodeType === Node.DOCUMENT_NODE) {\n                            nodeData.documentURL = window.location.href;\n                        }\n                    }\n                } else if (node.nodeType === Node.DOCUMENT_TYPE_NODE) {\n                    nodeData.publicId = node.publicId;\n                    nodeData.systemId = node.systemId;\n                    nodeData.internalSubset = node.internalSubset;\n                } else if (node.nodeType === Node.ATTRIBUTE_NODE) {\n                    nodeData.name = node.nodeName;\n                    nodeData.value = node.nodeValue;\n                }\n                return nodeData;\n            };\n            NodeStore.prototype.serializeNodeChildren = function(node, depth) {\n                var childIds, childNode, i, result;\n                result = [];\n                childIds = this.childNodeIds(node);\n                if (depth === 0) {\n                    if (childIds.length === 1) {\n                        childNode = this.getNode(childIds[0]);\n                        if (childNode.nodeType === Node.TEXT_NODE) {\n                            result.push(this.serializeNode(childNode));\n                        }\n                    }\n                    return result;\n                }\n                depth--;\n                i = 0;\n                while (i < childIds.length) {\n                    result.push(this.serializeNode(this.getNode(childIds[i]), depth));\n                    i++;\n                }\n                return result;\n            };\n            NodeStore.prototype.childNodeCount = function(node) {\n                return this.childNodeIds(node).length;\n            };\n            NodeStore.prototype.childNodeIds = function(node) {\n                var childNode, i, ids, _i, _len, _ref;\n                ids = [];\n                i = 0;\n                _ref = node.childNodes;\n                for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                    childNode = _ref[_i];\n                    if (this.isToBeSkipped(childNode)) {\n                        continue;\n                    }\n                    ids.push(this.getNodeId(childNode));\n                }\n                return ids;\n            };\n            NodeStore.prototype.isToBeSkipped = function(node) {\n                if (!node) {\n                    return true;\n                }\n                if (node.__weinreHighlighter) {\n                    return true;\n                }\n                if (node.nodeType !== Node.TEXT_NODE) {\n                    return false;\n                }\n                return !!node.nodeValue.match(/^\\s*$/);\n            };\n            return NodeStore;\n        })();\n        handleDOMSubtreeModified = function(event) {\n            if (!event.attrChange) {\n                return;\n            }\n            return NodeStore.handleDOMAttrModified(event);\n        };\n        handleDOMNodeInserted = function(event) {\n            var child, parentId, previous, targetId;\n            targetId = Weinre.nodeStore.checkNodeId(event.target);\n            parentId = Weinre.nodeStore.checkNodeId(event.relatedNode);\n            if (!parentId) {\n                return;\n            }\n            child = Weinre.nodeStore.serializeNode(event.target, 0);\n            previous = Weinre.nodeStore.getPreviousSiblingId(event.target);\n            return Weinre.wi.DOMNotify.childNodeInserted(parentId, previous, child);\n        };\n        handleDOMNodeRemoved = function(event) {\n            var childCount, parentId, targetId;\n            targetId = Weinre.nodeStore.checkNodeId(event.target);\n            parentId = Weinre.nodeStore.checkNodeId(event.relatedNode);\n            if (!parentId) {\n                return;\n            }\n            if (targetId) {\n                if (parentId) {\n                    return Weinre.wi.DOMNotify.childNodeRemoved(parentId, targetId);\n                }\n            } else {\n                childCount = Weinre.nodeStore.childNodeCount(event.relatedNode);\n                return Weinre.wi.DOMNotify.childNodeCountUpdated(parentId, childCount);\n            }\n        };\n        handleDOMAttrModified = function(event) {\n            var attrs, i, targetId;\n            targetId = Weinre.nodeStore.checkNodeId(event.target);\n            if (!targetId) {\n                return;\n            }\n            attrs = [];\n            i = 0;\n            while (i < event.target.attributes.length) {\n                attrs.push(event.target.attributes[i].name);\n                attrs.push(event.target.attributes[i].value);\n                i++;\n            }\n            return Weinre.wi.DOMNotify.attributesUpdated(targetId, attrs);\n        };\n        handleDOMCharacterDataModified = function(event) {\n            var targetId;\n            targetId = Weinre.nodeStore.checkNodeId(event.target);\n            if (!targetId) {\n                return;\n            }\n            return Weinre.wi.DOMNotify.characterDataModified(targetId, event.newValue);\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/SqlStepper.amd.js\n    ;\n    modjewel.define(\"weinre/target/SqlStepper\", function(require, exports, module) {\n        var Binding, SqlStepper, executeSql, ourErrorCallback, runStep;\n        Binding = require('../common/Binding');\n        module.exports = SqlStepper = (function() {\n            function SqlStepper(steps) {\n                var context;\n                if (!(this instanceof SqlStepper)) {\n                    return new SqlStepper(steps);\n                }\n                this.__context = {};\n                context = this.__context;\n                context.steps = steps;\n            }\n            SqlStepper.prototype.run = function(db, errorCallback) {\n                var context;\n                context = this.__context;\n                if (context.hasBeenRun) {\n                    throw new Ex(arguments, \"stepper has already been run\");\n                }\n                context.hasBeenRun = true;\n                context.db = db;\n                context.errorCallback = errorCallback;\n                context.nextStep = 0;\n                context.ourErrorCallback = new Binding(this, ourErrorCallback);\n                context.runStep = new Binding(this, runStep);\n                this.executeSql = new Binding(this, executeSql);\n                return db.transaction(context.runStep);\n            };\n            SqlStepper.example = function(db, id) {\n                var errorCb, step1, step2, stepper;\n                step1 = function() {\n                    return this.executeSql(\"SELECT name FROM sqlite_master WHERE type='table'\");\n                };\n                step2 = function(resultSet) {\n                    var i, name, result, rows;\n                    rows = resultSet.rows;\n                    result = [];\n                    i = 0;\n                    while (i < rows.length) {\n                        name = rows.item(i).name;\n                        if (name === \"__WebKitDatabaseInfoTable__\") {\n                            i++;\n                            continue;\n                        }\n                        result.push(name);\n                        i++;\n                    }\n                    return console.log((\"[\" + this.id + \"] table names: \") + result.join(\", \"));\n                };\n                errorCb = function(sqlError) {\n                    return console.log((\"[\" + this.id + \"] sql error:\" + sqlError.code + \": \") + sqlError.message);\n                };\n                stepper = new SqlStepper([step1, step2]);\n                stepper.id = id;\n                return stepper.run(db, errorCb);\n            };\n            return SqlStepper;\n        })();\n        executeSql = function(statement, data) {\n            var context;\n            context = this.__context;\n            return context.tx.executeSql(statement, data, context.runStep, context.ourErrorCallback);\n        };\n        ourErrorCallback = function(tx, sqlError) {\n            var context;\n            context = this.__context;\n            return context.errorCallback.call(this, sqlError);\n        };\n        runStep = function(tx, resultSet) {\n            var context, step;\n            context = this.__context;\n            if (context.nextStep >= context.steps.length) {\n                return;\n            }\n            context.tx = tx;\n            context.currentStep = context.nextStep;\n            context.nextStep++;\n            step = context.steps[context.currentStep];\n            return step.call(this, resultSet);\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/Target.amd.js\n    ;\n    modjewel.define(\"weinre/target/Target\", function(require, exports, module) {\n        var Binding, CSSStore, Callback, CheckForProblems, ElementHighlighter, Ex, HookLib, InjectedScriptHostImpl, MessageDispatcher, NetworkRequest, NodeStore, Target, Weinre, WeinreExtraClientCommandsImpl, WeinreTargetEventsImpl, WiCSSImpl, WiConsoleImpl, WiDOMImpl, WiDOMStorageImpl, WiDatabaseImpl, WiInspectorImpl, WiRuntimeImpl, currentTime;\n        require('./BrowserHacks');\n        Ex = require('../common/Ex');\n        Binding = require('../common/Binding');\n        Callback = require('../common/Callback');\n        MessageDispatcher = require('../common/MessageDispatcher');\n        Weinre = require('../common/Weinre');\n        HookLib = require('../common/HookLib');\n        CheckForProblems = require('./CheckForProblems');\n        NodeStore = require('./NodeStore');\n        CSSStore = require('./CSSStore');\n        ElementHighlighter = require('./ElementHighlighter');\n        InjectedScriptHostImpl = require('./InjectedScriptHostImpl');\n        NetworkRequest = require('./NetworkRequest');\n        WeinreTargetEventsImpl = require('./WeinreTargetEventsImpl');\n        WeinreExtraClientCommandsImpl = require('./WeinreExtraClientCommandsImpl');\n        WiConsoleImpl = require('./WiConsoleImpl');\n        WiCSSImpl = require('./WiCSSImpl');\n        WiDatabaseImpl = require('./WiDatabaseImpl');\n        WiDOMImpl = require('./WiDOMImpl');\n        WiDOMStorageImpl = require('./WiDOMStorageImpl');\n        WiInspectorImpl = require('./WiInspectorImpl');\n        WiRuntimeImpl = require('./WiRuntimeImpl');\n        module.exports = Target = (function() {\n            function Target() {}\n            Target.main = function() {\n                CheckForProblems.check();\n                Weinre.target = new Target();\n                return Weinre.target.initialize();\n            };\n            Target.prototype.setWeinreServerURLFromScriptSrc = function(element) {\n                var match, message, pattern;\n                if (window.WeinreServerURL) {\n                    return;\n                }\n                if (element) {\n                    pattern = /((https?:)?\\/\\/(.*?)\\/)/;\n                    match = pattern.exec(element.src);\n                    if (match) {\n                        window.WeinreServerURL = match[1];\n                        return;\n                    }\n                }\n                message = \"unable to calculate the weinre server url; explicity set the variable window.WeinreServerURL instead\";\n                alert(message);\n                throw new Ex(arguments, message);\n            };\n            Target.prototype.setWeinreServerIdFromScriptSrc = function(element) {\n                var attempt, hash;\n                if (window.WeinreServerId) {\n                    return;\n                }\n                element = this.getTargetScriptElement();\n                hash = \"anonymous\";\n                if (element) {\n                    attempt = element.src.split(\"#\")[1];\n                    if (attempt) {\n                        hash = attempt;\n                    } else {\n                        attempt = location.hash.split(\"#\")[1];\n                        if (attempt) {\n                            hash = attempt;\n                        }\n                    }\n                }\n                return window.WeinreServerId = hash;\n            };\n            Target.prototype.getTargetScriptElement = function() {\n                var element, elements, i, j, scripts;\n                elements = document.getElementsByTagName(\"script\");\n                scripts = [\"target-script.js\", \"target-script-min.js\"];\n                i = 0;\n                while (i < elements.length) {\n                    element = elements[i];\n                    j = 0;\n                    while (j < scripts.length) {\n                        if (-1 !== element.src.indexOf(\"/\" + scripts[j])) {\n                            return element;\n                        }\n                        j++;\n                    }\n                    i++;\n                }\n            };\n            Target.prototype.initialize = function() {\n                var element, injectedScriptHost, messageDispatcher;\n                element = this.getTargetScriptElement();\n                this.setWeinreServerURLFromScriptSrc(element);\n                this.setWeinreServerIdFromScriptSrc(element);\n                if (window.WeinreServerURL[window.WeinreServerURL.length - 1] !== \"/\") {\n                    window.WeinreServerURL += \"/\";\n                }\n                injectedScriptHost = new InjectedScriptHostImpl();\n                Weinre.injectedScript = injectedScriptConstructor(injectedScriptHost, window, 0, \"?\");\n                window.addEventListener(\"load\", Binding(this, \"onLoaded\"), false);\n                document.addEventListener(\"DOMContentLoaded\", Binding(this, \"onDOMContent\"), false);\n                this._startTime = currentTime();\n                if (document.readyState === \"loaded\") {\n                    HookLib.ignoreHooks((function(_this) {\n                        return function() {\n                            return setTimeout((function() {\n                                return _this.onDOMContent();\n                            }), 10);\n                        };\n                    })(this));\n                }\n                if (document.readyState === \"complete\") {\n                    HookLib.ignoreHooks((function(_this) {\n                        return function() {\n                            setTimeout((function() {\n                                return _this.onDOMContent();\n                            }), 10);\n                            return setTimeout((function() {\n                                return _this.onLoaded();\n                            }), 20);\n                        };\n                    })(this));\n                }\n                messageDispatcher = new MessageDispatcher(window.WeinreServerURL + \"ws/target\", window.WeinreServerId);\n                Weinre.messageDispatcher = messageDispatcher;\n                Weinre.wi = {};\n                Weinre.wi.Console = new WiConsoleImpl();\n                Weinre.wi.CSS = new WiCSSImpl();\n                Weinre.wi.Database = new WiDatabaseImpl();\n                Weinre.wi.DOM = new WiDOMImpl();\n                Weinre.wi.DOMStorage = new WiDOMStorageImpl();\n                Weinre.wi.Inspector = new WiInspectorImpl();\n                Weinre.wi.Runtime = new WiRuntimeImpl();\n                messageDispatcher.registerInterface(\"Console\", Weinre.wi.Console, false);\n                messageDispatcher.registerInterface(\"CSS\", Weinre.wi.CSS, false);\n                messageDispatcher.registerInterface(\"Database\", Weinre.wi.Database, false);\n                messageDispatcher.registerInterface(\"DOM\", Weinre.wi.DOM, false);\n                messageDispatcher.registerInterface(\"DOMStorage\", Weinre.wi.DOMStorage, false);\n                messageDispatcher.registerInterface(\"Inspector\", Weinre.wi.Inspector, false);\n                messageDispatcher.registerInterface(\"Runtime\", Weinre.wi.Runtime, false);\n                messageDispatcher.registerInterface(\"WeinreExtraClientCommands\", new WeinreExtraClientCommandsImpl(), true);\n                messageDispatcher.registerInterface(\"WeinreTargetEvents\", new WeinreTargetEventsImpl(), true);\n                Weinre.wi.ApplicationCacheNotify = messageDispatcher.createProxy(\"ApplicationCacheNotify\");\n                Weinre.wi.ConsoleNotify = messageDispatcher.createProxy(\"ConsoleNotify\");\n                Weinre.wi.DOMNotify = messageDispatcher.createProxy(\"DOMNotify\");\n                Weinre.wi.DOMStorageNotify = messageDispatcher.createProxy(\"DOMStorageNotify\");\n                Weinre.wi.DatabaseNotify = messageDispatcher.createProxy(\"DatabaseNotify\");\n                Weinre.wi.InspectorNotify = messageDispatcher.createProxy(\"InspectorNotify\");\n                Weinre.wi.TimelineNotify = messageDispatcher.createProxy(\"TimelineNotify\");\n                Weinre.wi.NetworkNotify = messageDispatcher.createProxy(\"NetworkNotify\");\n                Weinre.WeinreTargetCommands = messageDispatcher.createProxy(\"WeinreTargetCommands\");\n                Weinre.WeinreExtraTargetEvents = messageDispatcher.createProxy(\"WeinreExtraTargetEvents\");\n                messageDispatcher.getWebSocket().addEventListener(\"open\", Binding(this, this.cb_webSocketOpened));\n                Weinre.nodeStore = new NodeStore();\n                Weinre.cssStore = new CSSStore();\n                return NetworkRequest.installNativeHooks();\n            };\n            Target.prototype.cb_webSocketOpened = function() {\n                return Weinre.WeinreTargetCommands.registerTarget(window.location.href, Binding(this, this.cb_registerTarget));\n            };\n            Target.prototype.cb_registerTarget = function(targetDescription) {\n                return Weinre.targetDescription = targetDescription;\n            };\n            Target.prototype.onLoaded = function() {\n                if (!Weinre.wi.InspectorNotify) {\n                    HookLib.ignoreHooks((function(_this) {\n                        return function() {\n                            return setTimeout((function() {\n                                return _this.onLoaded();\n                            }), 10);\n                        };\n                    })(this));\n                    return;\n                }\n                return Weinre.wi.InspectorNotify.loadEventFired(currentTime() - this._startTime);\n            };\n            Target.prototype.onDOMContent = function() {\n                if (!Weinre.wi.InspectorNotify) {\n                    HookLib.ignoreHooks((function(_this) {\n                        return function() {\n                            return setTimeout((function() {\n                                return _this.onDOMContent();\n                            }), 10);\n                        };\n                    })(this));\n                    return;\n                }\n                return Weinre.wi.InspectorNotify.domContentEventFired(currentTime() - this._startTime);\n            };\n            Target.prototype.setDocument = function() {\n                var nodeData, nodeId;\n                if (!Weinre.elementHighlighter) {\n                    Weinre.elementHighlighter = ElementHighlighter.create();\n                }\n                nodeId = Weinre.nodeStore.getNodeId(document);\n                nodeData = Weinre.nodeStore.getNodeData(nodeId, 2);\n                return Weinre.wi.DOMNotify.setDocument(nodeData);\n            };\n            Target.prototype.whenBodyReady = function(receiver, args, func) {\n                if (document.body) {\n                    func.apply(receiver, args);\n                    return;\n                }\n                return document.addEventListener(\"DOMContentLoaded\", function() {\n                    return func.apply(receiver, args);\n                }, false);\n            };\n            return Target;\n        })();\n        currentTime = function() {\n            return (new Date().getMilliseconds()) / 1000.0;\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/Timeline.amd.js\n    ;\n    modjewel.define(\"weinre/target/Timeline\", function(require, exports, module) {\n        var Ex, HookLib, HookSites, IDGenerator, Running, StackTrace, Timeline, TimelineRecordType, TimerIntervals, TimerTimeouts, Weinre, addStackTrace, addTimer, getXhrEventHandler, instrumentedTimerCode, removeTimer;\n        Ex = require('../common/Ex');\n        Weinre = require('../common/Weinre');\n        IDGenerator = require('../common/IDGenerator');\n        StackTrace = require('../common/StackTrace');\n        HookLib = require('../common/HookLib');\n        HookSites = require('./HookSites');\n        Running = false;\n        TimerTimeouts = {};\n        TimerIntervals = {};\n        TimelineRecordType = {\n            EventDispatch: 0,\n            Layout: 1,\n            RecalculateStyles: 2,\n            Paint: 3,\n            ParseHTML: 4,\n            TimerInstall: 5,\n            TimerRemove: 6,\n            TimerFire: 7,\n            XHRReadyStateChange: 8,\n            XHRLoad: 9,\n            EvaluateScript: 10,\n            Mark: 11,\n            ResourceSendRequest: 12,\n            ResourceReceiveResponse: 13,\n            ResourceFinish: 14,\n            FunctionCall: 15,\n            ReceiveResourceData: 16,\n            GCEvent: 17,\n            MarkDOMContent: 18,\n            MarkLoad: 19,\n            ScheduleResourceRequest: 20\n        };\n        module.exports = Timeline = (function() {\n            function Timeline() {}\n            Timeline.start = function() {\n                return Running = true;\n            };\n            Timeline.stop = function() {\n                return Running = false;\n            };\n            Timeline.isRunning = function() {\n                return Running;\n            };\n            Timeline.addRecord_Mark = function(message) {\n                var record;\n                if (!Timeline.isRunning()) {\n                    return;\n                }\n                record = {};\n                record.type = TimelineRecordType.Mark;\n                record.category = {\n                    name: \"scripting\"\n                };\n                record.startTime = Date.now();\n                record.data = {\n                    message: message\n                };\n                addStackTrace(record, 3);\n                return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n            };\n            Timeline.addRecord_EventDispatch = function(event, name, category) {\n                var record;\n                if (!Timeline.isRunning()) {\n                    return;\n                }\n                if (!category) {\n                    category = \"scripting\";\n                }\n                record = {};\n                record.type = TimelineRecordType.EventDispatch;\n                record.category = {\n                    name: category\n                };\n                record.startTime = Date.now();\n                record.data = {\n                    type: event.type\n                };\n                return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n            };\n            Timeline.addRecord_TimerInstall = function(id, timeout, singleShot) {\n                var record;\n                if (!Timeline.isRunning()) {\n                    return;\n                }\n                record = {};\n                record.type = TimelineRecordType.TimerInstall;\n                record.category = {\n                    name: \"scripting\"\n                };\n                record.startTime = Date.now();\n                record.data = {\n                    timerId: id,\n                    timeout: timeout,\n                    singleShot: singleShot\n                };\n                addStackTrace(record, 4);\n                return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n            };\n            Timeline.addRecord_TimerRemove = function(id, timeout, singleShot) {\n                var record;\n                if (!Timeline.isRunning()) {\n                    return;\n                }\n                record = {};\n                record.type = TimelineRecordType.TimerRemove;\n                record.category = {\n                    name: \"scripting\"\n                };\n                record.startTime = Date.now();\n                record.data = {\n                    timerId: id,\n                    timeout: timeout,\n                    singleShot: singleShot\n                };\n                addStackTrace(record, 4);\n                return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n            };\n            Timeline.addRecord_TimerFire = function(id, timeout, singleShot) {\n                var record;\n                if (!Timeline.isRunning()) {\n                    return;\n                }\n                record = {};\n                record.type = TimelineRecordType.TimerFire;\n                record.category = {\n                    name: \"scripting\"\n                };\n                record.startTime = Date.now();\n                record.data = {\n                    timerId: id,\n                    timeout: timeout,\n                    singleShot: singleShot\n                };\n                return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n            };\n            Timeline.addRecord_XHRReadyStateChange = function(method, url, id, xhr) {\n                var contentLength, contentType, e, record;\n                if (!Timeline.isRunning()) {\n                    return;\n                }\n                try {\n                    contentLength = xhr.getResponseHeader(\"Content-Length\");\n                    contentLength = parseInt(contentLength);\n                    contentType = xhr.getResponseHeader(\"Content-Type\");\n                } catch (_error) {\n                    e = _error;\n                    contentLength = 0;\n                    contentType = \"unknown\";\n                }\n                record = {};\n                record.startTime = Date.now();\n                record.category = {\n                    name: \"loading\"\n                };\n                if (xhr.readyState === XMLHttpRequest.OPENED) {\n                    record.type = TimelineRecordType.ResourceSendRequest;\n                    record.data = {\n                        identifier: id,\n                        url: url,\n                        requestMethod: method\n                    };\n                } else if (xhr.readyState === XMLHttpRequest.DONE) {\n                    record.type = TimelineRecordType.ResourceReceiveResponse;\n                    record.data = {\n                        identifier: id,\n                        statusCode: xhr.status,\n                        mimeType: contentType,\n                        url: url\n                    };\n                    if (!isNaN(contentLength)) {\n                        record.data.expectedContentLength = contentLength;\n                    }\n                } else {\n                    return;\n                }\n                return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n            };\n            Timeline.installGlobalListeners = function() {\n                if (window.applicationCache) {\n                    applicationCache.addEventListener(\"checking\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.checking\", \"loading\");\n                    }), false);\n                    applicationCache.addEventListener(\"error\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.error\", \"loading\");\n                    }), false);\n                    applicationCache.addEventListener(\"noupdate\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.noupdate\", \"loading\");\n                    }), false);\n                    applicationCache.addEventListener(\"downloading\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.downloading\", \"loading\");\n                    }), false);\n                    applicationCache.addEventListener(\"progress\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.progress\", \"loading\");\n                    }), false);\n                    applicationCache.addEventListener(\"updateready\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.updateready\", \"loading\");\n                    }), false);\n                    applicationCache.addEventListener(\"cached\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.cached\", \"loading\");\n                    }), false);\n                    applicationCache.addEventListener(\"obsolete\", (function(e) {\n                        return Timeline.addRecord_EventDispatch(e, \"applicationCache.obsolete\", \"loading\");\n                    }), false);\n                }\n                window.addEventListener(\"error\", (function(e) {\n                    return Timeline.addRecord_EventDispatch(e, \"window.error\");\n                }), false);\n                window.addEventListener(\"hashchange\", (function(e) {\n                    return Timeline.addRecord_EventDispatch(e, \"window.hashchange\");\n                }), false);\n                window.addEventListener(\"message\", (function(e) {\n                    return Timeline.addRecord_EventDispatch(e, \"window.message\");\n                }), false);\n                window.addEventListener(\"offline\", (function(e) {\n                    return Timeline.addRecord_EventDispatch(e, \"window.offline\");\n                }), false);\n                window.addEventListener(\"online\", (function(e) {\n                    return Timeline.addRecord_EventDispatch(e, \"window.online\");\n                }), false);\n                return window.addEventListener(\"scroll\", (function(e) {\n                    return Timeline.addRecord_EventDispatch(e, \"window.scroll\");\n                }), false);\n            };\n            Timeline.installNativeHooks = function() {\n                HookSites.window_setInterval.addHooks({\n                    before: function(receiver, args) {\n                        var code, interval;\n                        code = args[0];\n                        if (typeof code !== \"function\") {\n                            return;\n                        }\n                        interval = args[1];\n                        code = instrumentedTimerCode(code, interval, false);\n                        args[0] = code;\n                        this.userData = {};\n                        this.userData.code = code;\n                        return this.userData.interval = interval;\n                    },\n                    after: function(receiver, args, result) {\n                        var code, id;\n                        if (!this.userData) {\n                            return;\n                        }\n                        code = this.userData.code;\n                        if (typeof code !== \"function\") {\n                            return;\n                        }\n                        id = result;\n                        code.__timerId = id;\n                        return addTimer(id, this.userData.interval, false);\n                    }\n                });\n                HookSites.window_clearInterval.addHooks({\n                    before: function(receiver, args) {\n                        var id;\n                        id = args[0];\n                        return removeTimer(id, false);\n                    }\n                });\n                HookSites.window_setTimeout.addHooks({\n                    before: function(receiver, args) {\n                        var code, interval;\n                        code = args[0];\n                        if (typeof code !== \"function\") {\n                            return;\n                        }\n                        interval = args[1];\n                        code = instrumentedTimerCode(code, interval, true);\n                        args[0] = code;\n                        this.userData = {};\n                        this.userData.code = code;\n                        return this.userData.interval = interval;\n                    },\n                    after: function(receiver, args, result) {\n                        var code, id;\n                        if (!this.userData) {\n                            return;\n                        }\n                        code = this.userData.code;\n                        if (typeof code !== \"function\") {\n                            return;\n                        }\n                        id = result;\n                        code.__timerId = id;\n                        return addTimer(id, this.userData.interval, true);\n                    }\n                });\n                HookSites.window_clearTimeout.addHooks({\n                    before: function(receiver, args) {\n                        var id;\n                        id = args[0];\n                        return removeTimer(id, true);\n                    }\n                });\n                return HookSites.XMLHttpRequest_open.addHooks({\n                    before: function(receiver, args) {\n                        var xhr;\n                        xhr = receiver;\n                        IDGenerator.getId(xhr);\n                        xhr.__weinre_method = args[0];\n                        xhr.__weinre_url = args[1];\n                        return xhr.addEventListener(\"readystatechange\", getXhrEventHandler(xhr), false);\n                    }\n                });\n            };\n            return Timeline;\n        })();\n        getXhrEventHandler = function(xhr) {\n            return function(event) {\n                return Timeline.addRecord_XHRReadyStateChange(xhr.__weinre_method, xhr.__weinre_url, IDGenerator.getId(xhr), xhr);\n            };\n        };\n        addTimer = function(id, timeout, singleShot) {\n            var timerSet;\n            timerSet = (singleShot ? TimerTimeouts : TimerIntervals);\n            timerSet[id] = {\n                id: id,\n                timeout: timeout,\n                singleShot: singleShot\n            };\n            return Timeline.addRecord_TimerInstall(id, timeout, singleShot);\n        };\n        removeTimer = function(id, singleShot) {\n            var timer, timerSet;\n            timerSet = (singleShot ? TimerTimeouts : TimerIntervals);\n            timer = timerSet[id];\n            if (!timer) {\n                return;\n            }\n            Timeline.addRecord_TimerRemove(id, timer.timeout, singleShot);\n            return delete timerSet[id];\n        };\n        instrumentedTimerCode = function(code, timeout, singleShot) {\n            var instrumentedCode;\n            if (typeof code !== \"function\") {\n                return code;\n            }\n            instrumentedCode = function() {\n                var id, result;\n                result = code.apply(this, arguments);\n                id = arguments.callee.__timerId;\n                Timeline.addRecord_TimerFire(id, timeout, singleShot);\n                return result;\n            };\n            instrumentedCode.displayName = code.name || code.displayName;\n            return instrumentedCode;\n        };\n        addStackTrace = function(record, skip) {\n            var i, trace, _results;\n            if (!skip) {\n                skip = 1;\n            }\n            trace = new StackTrace(arguments).trace;\n            record.stackTrace = [];\n            i = skip;\n            _results = [];\n            while (i < trace.length) {\n                record.stackTrace.push({\n                    functionName: trace[i],\n                    scriptName: \"\",\n                    lineNumber: \"\"\n                });\n                _results.push(i++);\n            }\n            return _results;\n        };\n        Timeline.installGlobalListeners();\n        Timeline.installNativeHooks();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WeinreExtraClientCommandsImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WeinreExtraClientCommandsImpl\", function(require, exports, module) {\n        var Console, Weinre, WeinreExtraClientCommandsImpl, WiDatabaseImpl;\n        Weinre = require('../common/Weinre');\n        WiDatabaseImpl = require('./WiDatabaseImpl');\n        Console = require('./Console');\n        module.exports = WeinreExtraClientCommandsImpl = (function() {\n            function WeinreExtraClientCommandsImpl() {}\n            WeinreExtraClientCommandsImpl.prototype.getDatabases = function(callback) {\n                var result;\n                if (!callback) {\n                    return;\n                }\n                result = WiDatabaseImpl.getDatabases();\n                return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n            };\n            return WeinreExtraClientCommandsImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WeinreTargetEventsImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WeinreTargetEventsImpl\", function(require, exports, module) {\n        var Callback, Console, Weinre, WeinreTargetEventsImpl;\n        Weinre = require('../common/Weinre');\n        Callback = require('../common/Callback');\n        Console = require('./Console');\n        module.exports = WeinreTargetEventsImpl = (function() {\n            function WeinreTargetEventsImpl() {}\n            WeinreTargetEventsImpl.prototype.connectionCreated = function(clientChannel, targetChannel) {\n                var message;\n                message = (\"weinre: target \" + targetChannel + \" connected to client \") + clientChannel;\n                Weinre.logInfo(message);\n                return Weinre.target.whenBodyReady(this, [], function() {\n                    var oldValue;\n                    oldValue = Console.useRemote(true);\n                    Weinre.target.setDocument();\n                    Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\n                    return Weinre.wi.DOMStorage.initialize();\n                });\n            };\n            WeinreTargetEventsImpl.prototype.connectionDestroyed = function(clientChannel, targetChannel) {\n                var message, oldValue;\n                message = (\"weinre: target \" + targetChannel + \" disconnected from client \") + clientChannel;\n                Weinre.logInfo(message);\n                return oldValue = Console.useRemote(false);\n            };\n            WeinreTargetEventsImpl.prototype.sendCallback = function(callbackId, result) {\n                return Callback.invoke(callbackId, result);\n            };\n            return WeinreTargetEventsImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WiConsoleImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WiConsoleImpl\", function(require, exports, module) {\n        var Weinre, WiConsoleImpl;\n        Weinre = require('../common/Weinre');\n        module.exports = WiConsoleImpl = (function() {\n            function WiConsoleImpl() {\n                this.messagesEnabled = true;\n            }\n            WiConsoleImpl.prototype.setConsoleMessagesEnabled = function(enabled, callback) {\n                var oldValue;\n                oldValue = this.messagesEnabled;\n                this.messagesEnabled = enabled;\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [oldValue]);\n                }\n            };\n            WiConsoleImpl.prototype.clearConsoleMessages = function(callback) {\n                Weinre.wi.ConsoleNotify.consoleMessagesCleared();\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\n                }\n            };\n            WiConsoleImpl.prototype.setMonitoringXHREnabled = function(enabled, callback) {\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\n                }\n            };\n            return WiConsoleImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WiCSSImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WiCSSImpl\", function(require, exports, module) {\n        var Weinre, WiCSSImpl;\n        Weinre = require('../common/Weinre');\n        module.exports = WiCSSImpl = (function() {\n            function WiCSSImpl() {\n                this.dummyComputedStyle = false;\n            }\n            WiCSSImpl.prototype.getStylesForNode = function(nodeId, callback) {\n                var computedStyle, node, parentNode, parentStyle, result;\n                result = {};\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                if (this.dummyComputedStyle) {\n                    computedStyle = {\n                        styleId: null,\n                        properties: [],\n                        shorthandValues: [],\n                        cssProperties: []\n                    };\n                } else {\n                    computedStyle = Weinre.cssStore.getComputedStyle(node);\n                }\n                result = {\n                    inlineStyle: Weinre.cssStore.getInlineStyle(node),\n                    computedStyle: computedStyle,\n                    matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(node),\n                    styleAttributes: Weinre.cssStore.getStyleAttributes(node),\n                    pseudoElements: Weinre.cssStore.getPseudoElements(node),\n                    inherited: []\n                };\n                parentNode = node.parentNode;\n                while (parentNode) {\n                    parentStyle = {\n                        inlineStyle: Weinre.cssStore.getInlineStyle(parentNode),\n                        matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(parentNode)\n                    };\n                    result.inherited.push(parentStyle);\n                    parentNode = parentNode.parentNode;\n                }\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiCSSImpl.prototype.getComputedStyleForNode = function(nodeId, callback) {\n                var node, result;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                result = Weinre.cssStore.getComputedStyle(node);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiCSSImpl.prototype.getInlineStyleForNode = function(nodeId, callback) {\n                var node, result;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                result = Weinre.cssStore.getInlineStyle(node);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiCSSImpl.prototype.getAllStyles = function(callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiCSSImpl.prototype.getStyleSheet = function(styleSheetId, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiCSSImpl.prototype.getStyleSheetText = function(styleSheetId, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiCSSImpl.prototype.setStyleSheetText = function(styleSheetId, text, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiCSSImpl.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite, callback) {\n                var result;\n                result = Weinre.cssStore.setPropertyText(styleId, propertyIndex, text, overwrite);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiCSSImpl.prototype.toggleProperty = function(styleId, propertyIndex, disable, callback) {\n                var result;\n                result = Weinre.cssStore.toggleProperty(styleId, propertyIndex, disable);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiCSSImpl.prototype.setRuleSelector = function(ruleId, selector, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiCSSImpl.prototype.addRule = function(contextNodeId, selector, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiCSSImpl.prototype.querySelectorAll = function(documentId, selector, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            return WiCSSImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WiDatabaseImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WiDatabaseImpl\", function(require, exports, module) {\n        var HookSites, IDGenerator, SqlStepper, Weinre, WiDatabaseImpl, dbAdd, dbById, dbRecordById, dbRecordByName, executeSQL_error, executeSQL_step_1, executeSQL_step_2, getTableNames_step_1, getTableNames_step_2, id2db, logSqlError, name2db;\n        Weinre = require('../common/Weinre');\n        IDGenerator = require('../common/IDGenerator');\n        HookSites = require('./HookSites');\n        SqlStepper = require('./SqlStepper');\n        id2db = {};\n        name2db = {};\n        module.exports = WiDatabaseImpl = (function() {\n            function WiDatabaseImpl() {\n                if (!window.openDatabase) {\n                    return;\n                }\n                HookSites.window_openDatabase.addHooks({\n                    after: function(receiver, args, db) {\n                        var name, version;\n                        if (!db) {\n                            return;\n                        }\n                        name = args[0];\n                        version = args[1];\n                        return dbAdd(db, name, version);\n                    }\n                });\n            }\n            WiDatabaseImpl.getDatabases = function() {\n                var id, result;\n                result = [];\n                for (id in id2db) {\n                    result.push(id2db[id]);\n                }\n                return result;\n            };\n            WiDatabaseImpl.prototype.getDatabaseTableNames = function(databaseId, callback) {\n                var db, stepper;\n                db = dbById(databaseId);\n                if (!db) {\n                    return;\n                }\n                stepper = SqlStepper([getTableNames_step_1, getTableNames_step_2]);\n                stepper.callback = callback;\n                return stepper.run(db, logSqlError);\n            };\n            WiDatabaseImpl.prototype.executeSQL = function(databaseId, query, callback) {\n                var db, stepper, txid;\n                db = dbById(databaseId);\n                if (!db) {\n                    return;\n                }\n                txid = Weinre.targetDescription.channel + \"-\" + IDGenerator.next();\n                stepper = SqlStepper([executeSQL_step_1, executeSQL_step_2]);\n                stepper.txid = txid;\n                stepper.query = query;\n                stepper.callback = callback;\n                stepper.run(db, executeSQL_error);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [true, txid]);\n                }\n            };\n            return WiDatabaseImpl;\n        })();\n        logSqlError = function(sqlError) {\n            return console.log((\"SQL Error \" + sqlError.code + \": \") + sqlError.message);\n        };\n        getTableNames_step_1 = function() {\n            return this.executeSql(\"SELECT name FROM sqlite_master WHERE type='table'\");\n        };\n        getTableNames_step_2 = function(resultSet) {\n            var i, name, result, rows;\n            rows = resultSet.rows;\n            result = [];\n            i = 0;\n            while (i < rows.length) {\n                name = rows.item(i).name;\n                if (name === \"__WebKitDatabaseInfoTable__\") {\n                    i++;\n                    continue;\n                }\n                result.push(name);\n                i++;\n            }\n            return Weinre.WeinreTargetCommands.sendClientCallback(this.callback, [result]);\n        };\n        executeSQL_step_1 = function() {\n            return this.executeSql(this.query);\n        };\n        executeSQL_step_2 = function(resultSet) {\n            var columnNames, i, j, propName, row, rows, values;\n            columnNames = [];\n            values = [];\n            rows = resultSet.rows;\n            i = 0;\n            while (i < rows.length) {\n                row = rows.item(i);\n                if (i === 0) {\n                    for (propName in row) {\n                        columnNames.push(propName);\n                    }\n                }\n                j = 0;\n                while (j < columnNames.length) {\n                    values.push(row[columnNames[j]]);\n                    j++;\n                }\n                i++;\n            }\n            return Weinre.wi.DatabaseNotify.sqlTransactionSucceeded(this.txid, columnNames, values);\n        };\n        executeSQL_error = function(sqlError) {\n            var error;\n            error = {\n                code: sqlError.code,\n                message: sqlError.message\n            };\n            return Weinre.wi.DatabaseNotify.sqlTransactionFailed(this.txid, error);\n        };\n        dbById = function(id) {\n            var record;\n            record = id2db[id];\n            if (!record) {\n                return null;\n            }\n            return record.db;\n        };\n        dbRecordById = function(id) {\n            return id2db[id];\n        };\n        dbRecordByName = function(name) {\n            return name2db[name];\n        };\n        dbAdd = function(db, name, version) {\n            var payload, record;\n            record = dbRecordByName(name);\n            if (record) {\n                return record;\n            }\n            record = {};\n            record.id = IDGenerator.next();\n            record.domain = window.location.origin;\n            record.name = name;\n            record.version = version;\n            record.db = db;\n            id2db[record.id] = record;\n            name2db[name] = record;\n            payload = {};\n            payload.id = record.id;\n            payload.domain = record.domain;\n            payload.name = name;\n            payload.version = version;\n            return Weinre.WeinreExtraTargetEvents.databaseOpened(payload);\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WiDOMImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WiDOMImpl\", function(require, exports, module) {\n        var Weinre, WiDOMImpl;\n        Weinre = require('../common/Weinre');\n        module.exports = WiDOMImpl = (function() {\n            function WiDOMImpl() {}\n            WiDOMImpl.prototype.getChildNodes = function(nodeId, callback) {\n                var children, node;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                children = Weinre.nodeStore.serializeNodeChildren(node, 1);\n                Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiDOMImpl.prototype.setAttribute = function(elementId, name, value, callback) {\n                var element;\n                element = Weinre.nodeStore.getNode(elementId);\n                if (!element) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid elementId: \" + elementId);\n                    return;\n                }\n                element.setAttribute(name, value);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiDOMImpl.prototype.removeAttribute = function(elementId, name, callback) {\n                var element;\n                element = Weinre.nodeStore.getNode(elementId);\n                if (!element) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid elementId: \" + elementId);\n                    return;\n                }\n                element.removeAttribute(name);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiDOMImpl.prototype.setTextNodeValue = function(nodeId, value, callback) {\n                var node;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                node.nodeValue = value;\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiDOMImpl.prototype.getEventListenersForNode = function(nodeId, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiDOMImpl.prototype.copyNode = function(nodeId, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiDOMImpl.prototype.removeNode = function(nodeId, callback) {\n                var node;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                if (!node.parentNode) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed a parentless node: \" + node);\n                    return;\n                }\n                node.parentNode.removeChild(node);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiDOMImpl.prototype.changeTagName = function(nodeId, newTagName, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiDOMImpl.prototype.getOuterHTML = function(nodeId, callback) {\n                var node, value;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                value = node.outerHTML;\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [value]);\n                }\n            };\n            WiDOMImpl.prototype.setOuterHTML = function(nodeId, outerHTML, callback) {\n                var node;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                node.outerHTML = outerHTML;\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiDOMImpl.prototype.addInspectedNode = function(nodeId, callback) {\n                Weinre.nodeStore.addInspectedNode(nodeId);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiDOMImpl.prototype.performSearch = function(query, runSynchronously, callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiDOMImpl.prototype.searchCanceled = function(callback) {\n                return Weinre.notImplemented(arguments.callee.signature);\n            };\n            WiDOMImpl.prototype.pushNodeByPathToFrontend = function(path, callback) {\n                var childNodeIds, curr, currId, i, index, nodeId, nodeName, parts, _i, _ref;\n                parts = path.split(\",\");\n                curr = document;\n                currId = null;\n                nodeId = Weinre.nodeStore.getNodeId(curr);\n                this.getChildNodes(nodeId);\n                for (i = _i = 0, _ref = parts.length; _i < _ref; i = _i += 2) {\n                    index = parseInt(parts[i]);\n                    nodeName = parts[i + 1];\n                    if (isNaN(index)) {\n                        return;\n                    }\n                    childNodeIds = Weinre.nodeStore.childNodeIds(curr);\n                    currId = childNodeIds[index];\n                    if (!currId) {\n                        return;\n                    }\n                    this.getChildNodes(currId);\n                    curr = Weinre.nodeStore.getNode(currId);\n                    if (curr.nodeName !== nodeName) {\n                        return;\n                    }\n                }\n                if (callback && currId) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [currId]);\n                }\n            };\n            WiDOMImpl.prototype.resolveNode = function(nodeId, callback) {\n                var result;\n                result = Weinre.injectedScript.resolveNode(nodeId);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiDOMImpl.prototype.getNodeProperties = function(nodeId, propertiesArray, callback) {\n                var result;\n                propertiesArray = JSON.stringify(propertiesArray);\n                result = Weinre.injectedScript.getNodeProperties(nodeId, propertiesArray);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiDOMImpl.prototype.getNodePrototypes = function(nodeId, callback) {\n                var result;\n                result = Weinre.injectedScript.getNodePrototypes(nodeId);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiDOMImpl.prototype.pushNodeToFrontend = function(objectId, callback) {\n                var result;\n                objectId = JSON.stringify(objectId);\n                result = Weinre.injectedScript.pushNodeToFrontend(objectId);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            return WiDOMImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WiDOMStorageImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WiDOMStorageImpl\", function(require, exports, module) {\n        var HookSites, Weinre, WiDOMStorageImpl, _getStorageArea, _storageEventHandler;\n        Weinre = require('../common/Weinre');\n        HookSites = require('./HookSites');\n        module.exports = WiDOMStorageImpl = (function() {\n            function WiDOMStorageImpl() {}\n            WiDOMStorageImpl.prototype.getDOMStorageEntries = function(storageId, callback) {\n                var i, key, length, result, storageArea, val;\n                storageArea = _getStorageArea(storageId);\n                if (!storageArea) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n                    return;\n                }\n                result = [];\n                length = storageArea.length;\n                i = 0;\n                while (i < length) {\n                    key = storageArea.key(i);\n                    val = storageArea.getItem(key);\n                    result.push([key, val]);\n                    i++;\n                }\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiDOMStorageImpl.prototype.setDOMStorageItem = function(storageId, key, value, callback) {\n                var e, result, storageArea;\n                storageArea = _getStorageArea(storageId);\n                if (!storageArea) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n                    return;\n                }\n                result = true;\n                try {\n                    HookLib.ignoreHooks(function() {\n                        if (storageArea === window.localStorage) {\n                            return localStorage.setItem(key, value);\n                        } else if (storageArea === window.sessionStorage) {\n                            return sessionStorage.setItem(key, value);\n                        }\n                    });\n                } catch (_error) {\n                    e = _error;\n                    result = false;\n                }\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiDOMStorageImpl.prototype.removeDOMStorageItem = function(storageId, key, callback) {\n                var e, result, storageArea;\n                storageArea = _getStorageArea(storageId);\n                if (!storageArea) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n                    return;\n                }\n                result = true;\n                try {\n                    HookLib.ignoreHooks(function() {\n                        if (storageArea === window.localStorage) {\n                            return localStorage.removeItem(key);\n                        } else if (storageArea === window.sessionStorage) {\n                            return sessionStorage.removeItem(key);\n                        }\n                    });\n                } catch (_error) {\n                    e = _error;\n                    result = false;\n                }\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiDOMStorageImpl.prototype.initialize = function() {\n                if (window.localStorage) {\n                    Weinre.wi.DOMStorageNotify.addDOMStorage({\n                        id: 1,\n                        host: window.location.host,\n                        isLocalStorage: true\n                    });\n                    HookSites.LocalStorage_setItem.addHooks({\n                        after: function() {\n                            return _storageEventHandler({\n                                storageArea: window.localStorage\n                            });\n                        }\n                    });\n                    HookSites.LocalStorage_removeItem.addHooks({\n                        after: function() {\n                            return _storageEventHandler({\n                                storageArea: window.localStorage\n                            });\n                        }\n                    });\n                    HookSites.LocalStorage_clear.addHooks({\n                        after: function() {\n                            return _storageEventHandler({\n                                storageArea: window.localStorage\n                            });\n                        }\n                    });\n                }\n                if (window.sessionStorage) {\n                    Weinre.wi.DOMStorageNotify.addDOMStorage({\n                        id: 2,\n                        host: window.location.host,\n                        isLocalStorage: false\n                    });\n                    HookSites.SessionStorage_setItem.addHooks({\n                        after: function() {\n                            return _storageEventHandler({\n                                storageArea: window.sessionStorage\n                            });\n                        }\n                    });\n                    HookSites.SessionStorage_removeItem.addHooks({\n                        after: function() {\n                            return _storageEventHandler({\n                                storageArea: window.sessionStorage\n                            });\n                        }\n                    });\n                    HookSites.SessionStorage_clear.addHooks({\n                        after: function() {\n                            return _storageEventHandler({\n                                storageArea: window.sessionStorage\n                            });\n                        }\n                    });\n                }\n                return document.addEventListener(\"storage\", _storageEventHandler, false);\n            };\n            return WiDOMStorageImpl;\n        })();\n        _getStorageArea = function(storageId) {\n            if (storageId === 1) {\n                return window.localStorage;\n            } else if (storageId === 2) {\n                return window.sessionStorage;\n            }\n            return null;\n        };\n        _storageEventHandler = function(event) {\n            var storageId;\n            if (event.storageArea === window.localStorage) {\n                storageId = 1;\n            } else if (event.storageArea === window.sessionStorage) {\n                storageId = 2;\n            } else {\n                return;\n            }\n            return Weinre.wi.DOMStorageNotify.updateDOMStorage(storageId);\n        };\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WiInspectorImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WiInspectorImpl\", function(require, exports, module) {\n        var Timeline, Weinre, WiInspectorImpl;\n        Weinre = require('../common/Weinre');\n        Timeline = require('../target/Timeline');\n        module.exports = WiInspectorImpl = (function() {\n            function WiInspectorImpl() {}\n            WiInspectorImpl.prototype.reloadPage = function(callback) {\n                if (callback) {\n                    Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n                return window.location.reload();\n            };\n            WiInspectorImpl.prototype.highlightDOMNode = function(nodeId, callback) {\n                var node;\n                node = Weinre.nodeStore.getNode(nodeId);\n                if (!node) {\n                    Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n                    return;\n                }\n                Weinre.elementHighlighter.on(node);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiInspectorImpl.prototype.hideDOMNodeHighlight = function(callback) {\n                Weinre.elementHighlighter.off();\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiInspectorImpl.prototype.startTimelineProfiler = function(callback) {\n                Timeline.start();\n                Weinre.wi.TimelineNotify.timelineProfilerWasStarted();\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            WiInspectorImpl.prototype.stopTimelineProfiler = function(callback) {\n                Timeline.stop();\n                Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n                }\n            };\n            return WiInspectorImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // weinre/target/WiRuntimeImpl.amd.js\n    ;\n    modjewel.define(\"weinre/target/WiRuntimeImpl\", function(require, exports, module) {\n        var Weinre, WiRuntimeImpl;\n        Weinre = require('../common/Weinre');\n        module.exports = WiRuntimeImpl = (function() {\n            function WiRuntimeImpl() {}\n            WiRuntimeImpl.prototype.evaluate = function(expression, objectGroup, includeCommandLineAPI, callback) {\n                var result;\n                result = Weinre.injectedScript.evaluate(expression, objectGroup, includeCommandLineAPI);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiRuntimeImpl.prototype.getCompletions = function(expression, includeCommandLineAPI, callback) {\n                var result;\n                result = Weinre.injectedScript.getCompletions(expression, includeCommandLineAPI);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiRuntimeImpl.prototype.getProperties = function(objectId, ignoreHasOwnProperty, abbreviate, callback) {\n                var result;\n                objectId = JSON.stringify(objectId);\n                result = Weinre.injectedScript.getProperties(objectId, ignoreHasOwnProperty, abbreviate);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiRuntimeImpl.prototype.setPropertyValue = function(objectId, propertyName, expression, callback) {\n                var result;\n                objectId = JSON.stringify(objectId);\n                result = Weinre.injectedScript.setPropertyValue(objectId, propertyName, expression);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            WiRuntimeImpl.prototype.releaseWrapperObjectGroup = function(injectedScriptId, objectGroup, callback) {\n                var result;\n                result = Weinre.injectedScript.releaseWrapperObjectGroup(objectGroup);\n                if (callback) {\n                    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n                }\n            };\n            return WiRuntimeImpl;\n        })();\n        require(\"../common/MethodNamer\").setNamesForClass(module.exports);\n    });\n\n    ;\n    // interfaces/all-json-idls-min.js\n    modjewel.require('weinre/common/Weinre').addIDLs([{\n        \"interfaces\": [{\n            \"name\": \"InjectedScriptHost\",\n            \"methods\": [{\n                \"name\": \"clearConsoleMessages\",\n                \"parameters\": []\n            }, {\n                \"name\": \"copyText\",\n                \"parameters\": [{\n                    \"name\": \"text\"\n                }]\n            }, {\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }],\n                \"name\": \"nodeForId\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"node\"\n                }, {\n                    \"name\": \"withChildren\"\n                }, {\n                    \"name\": \"selectInUI\"\n                }],\n                \"name\": \"pushNodePathToFrontend\"\n            }, {\n                \"name\": \"inspectedNode\",\n                \"parameters\": [{\n                    \"name\": \"num\"\n                }]\n            }, {\n                \"parameters\": [{\n                    \"name\": \"object\"\n                }],\n                \"name\": \"internalConstructorName\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"currentCallFrame\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"database\"\n                }],\n                \"name\": \"selectDatabase\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"storage\"\n                }],\n                \"name\": \"selectDOMStorage\"\n            }, {\n                \"name\": \"didCreateWorker\",\n                \"parameters\": [{\n                    \"name\": \"id\"\n                }, {\n                    \"name\": \"url\"\n                }, {\n                    \"name\": \"isFakeWorker\"\n                }]\n            }, {\n                \"name\": \"didDestroyWorker\",\n                \"parameters\": [{\n                    \"name\": \"id\"\n                }]\n            }, {\n                \"name\": \"nextWorkerId\",\n                \"parameters\": []\n            }]\n        }],\n        \"name\": \"core\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"Inspector\",\n            \"methods\": [{\n                \"name\": \"addScriptToEvaluateOnLoad\",\n                \"parameters\": [{\n                    \"name\": \"scriptSource\"\n                }]\n            }, {\n                \"name\": \"removeAllScriptsToEvaluateOnLoad\",\n                \"parameters\": []\n            }, {\n                \"name\": \"reloadPage\",\n                \"parameters\": [{\n                    \"name\": \"ignoreCache\"\n                }]\n            }, {\n                \"name\": \"populateScriptObjects\",\n                \"parameters\": []\n            }, {\n                \"name\": \"openInInspectedWindow\",\n                \"parameters\": [{\n                    \"name\": \"url\"\n                }]\n            }, {\n                \"name\": \"setSearchingForNode\",\n                \"parameters\": [{\n                    \"name\": \"enabled\"\n                }]\n            }, {\n                \"name\": \"didEvaluateForTestInFrontend\",\n                \"parameters\": [{\n                    \"name\": \"testCallId\"\n                }, {\n                    \"name\": \"jsonResult\"\n                }]\n            }, {\n                \"name\": \"highlightDOMNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"hideDOMNodeHighlight\",\n                \"parameters\": []\n            }, {\n                \"name\": \"highlightFrame\",\n                \"parameters\": [{\n                    \"name\": \"frameId\"\n                }]\n            }, {\n                \"name\": \"hideFrameHighlight\",\n                \"parameters\": []\n            }, {\n                \"name\": \"setUserAgentOverride\",\n                \"parameters\": [{\n                    \"name\": \"userAgent\"\n                }]\n            }, {\n                \"name\": \"getCookies\",\n                \"parameters\": []\n            }, {\n                \"name\": \"deleteCookie\",\n                \"parameters\": [{\n                    \"name\": \"cookieName\"\n                }, {\n                    \"name\": \"domain\"\n                }]\n            }, {\n                \"name\": \"startTimelineProfiler\",\n                \"parameters\": []\n            }, {\n                \"name\": \"stopTimelineProfiler\",\n                \"parameters\": []\n            }, {\n                \"name\": \"enableDebugger\",\n                \"parameters\": []\n            }, {\n                \"name\": \"disableDebugger\",\n                \"parameters\": []\n            }, {\n                \"name\": \"enableProfiler\",\n                \"parameters\": []\n            }, {\n                \"name\": \"disableProfiler\",\n                \"parameters\": []\n            }, {\n                \"name\": \"startProfiling\",\n                \"parameters\": []\n            }, {\n                \"name\": \"stopProfiling\",\n                \"parameters\": []\n            }]\n        }, {\n            \"name\": \"Runtime\",\n            \"methods\": [{\n                \"name\": \"evaluate\",\n                \"parameters\": [{\n                    \"name\": \"expression\"\n                }, {\n                    \"name\": \"objectGroup\"\n                }, {\n                    \"name\": \"includeCommandLineAPI\"\n                }]\n            }, {\n                \"name\": \"getCompletions\",\n                \"parameters\": [{\n                    \"name\": \"expression\"\n                }, {\n                    \"name\": \"includeCommandLineAPI\"\n                }]\n            }, {\n                \"name\": \"getProperties\",\n                \"parameters\": [{\n                    \"name\": \"objectId\"\n                }, {\n                    \"name\": \"ignoreHasOwnProperty\"\n                }, {\n                    \"name\": \"abbreviate\"\n                }]\n            }, {\n                \"name\": \"setPropertyValue\",\n                \"parameters\": [{\n                    \"name\": \"objectId\"\n                }, {\n                    \"name\": \"propertyName\"\n                }, {\n                    \"name\": \"expression\"\n                }]\n            }, {\n                \"name\": \"releaseWrapperObjectGroup\",\n                \"parameters\": [{\n                    \"name\": \"injectedScriptId\"\n                }, {\n                    \"name\": \"objectGroup\"\n                }]\n            }]\n        }, {\n            \"name\": \"InjectedScript\",\n            \"methods\": [{\n                \"name\": \"evaluateOnSelf\",\n                \"parameters\": [{\n                    \"name\": \"functionBody\"\n                }, {\n                    \"name\": \"argumentsArray\"\n                }]\n            }]\n        }, {\n            \"name\": \"Console\",\n            \"methods\": [{\n                \"name\": \"setConsoleMessagesEnabled\",\n                \"parameters\": [{\n                    \"name\": \"enabled\"\n                }]\n            }, {\n                \"name\": \"clearConsoleMessages\",\n                \"parameters\": []\n            }, {\n                \"name\": \"setMonitoringXHREnabled\",\n                \"parameters\": [{\n                    \"name\": \"enabled\"\n                }]\n            }]\n        }, {\n            \"name\": \"Network\",\n            \"methods\": [{\n                \"name\": \"cachedResources\",\n                \"parameters\": []\n            }, {\n                \"name\": \"resourceContent\",\n                \"parameters\": [{\n                    \"name\": \"frameId\"\n                }, {\n                    \"name\": \"url\"\n                }, {\n                    \"name\": \"base64Encode\"\n                }]\n            }, {\n                \"name\": \"setExtraHeaders\",\n                \"parameters\": [{\n                    \"name\": \"headers\"\n                }]\n            }]\n        }, {\n            \"name\": \"Database\",\n            \"methods\": [{\n                \"name\": \"getDatabaseTableNames\",\n                \"parameters\": [{\n                    \"name\": \"databaseId\"\n                }]\n            }, {\n                \"name\": \"executeSQL\",\n                \"parameters\": [{\n                    \"name\": \"databaseId\"\n                }, {\n                    \"name\": \"query\"\n                }]\n            }]\n        }, {\n            \"name\": \"DOMStorage\",\n            \"methods\": [{\n                \"name\": \"getDOMStorageEntries\",\n                \"parameters\": [{\n                    \"name\": \"storageId\"\n                }]\n            }, {\n                \"name\": \"setDOMStorageItem\",\n                \"parameters\": [{\n                    \"name\": \"storageId\"\n                }, {\n                    \"name\": \"key\"\n                }, {\n                    \"name\": \"value\"\n                }]\n            }, {\n                \"name\": \"removeDOMStorageItem\",\n                \"parameters\": [{\n                    \"name\": \"storageId\"\n                }, {\n                    \"name\": \"key\"\n                }]\n            }]\n        }, {\n            \"name\": \"ApplicationCache\",\n            \"methods\": [{\n                \"name\": \"getApplicationCaches\",\n                \"parameters\": []\n            }]\n        }, {\n            \"name\": \"DOM\",\n            \"methods\": [{\n                \"name\": \"getChildNodes\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"setAttribute\",\n                \"parameters\": [{\n                    \"name\": \"elementId\"\n                }, {\n                    \"name\": \"name\"\n                }, {\n                    \"name\": \"value\"\n                }]\n            }, {\n                \"name\": \"removeAttribute\",\n                \"parameters\": [{\n                    \"name\": \"elementId\"\n                }, {\n                    \"name\": \"name\"\n                }]\n            }, {\n                \"name\": \"setTextNodeValue\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }, {\n                    \"name\": \"value\"\n                }]\n            }, {\n                \"name\": \"getEventListenersForNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"copyNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"removeNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"changeTagName\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }, {\n                    \"name\": \"newTagName\"\n                }]\n            }, {\n                \"name\": \"getOuterHTML\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"setOuterHTML\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }, {\n                    \"name\": \"outerHTML\"\n                }]\n            }, {\n                \"name\": \"addInspectedNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"performSearch\",\n                \"parameters\": [{\n                    \"name\": \"query\"\n                }, {\n                    \"name\": \"runSynchronously\"\n                }]\n            }, {\n                \"name\": \"searchCanceled\",\n                \"parameters\": []\n            }, {\n                \"name\": \"pushNodeByPathToFrontend\",\n                \"parameters\": [{\n                    \"name\": \"path\"\n                }]\n            }, {\n                \"name\": \"resolveNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"getNodeProperties\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }, {\n                    \"name\": \"propertiesArray\"\n                }]\n            }, {\n                \"name\": \"getNodePrototypes\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"pushNodeToFrontend\",\n                \"parameters\": [{\n                    \"name\": \"objectId\"\n                }]\n            }]\n        }, {\n            \"name\": \"CSS\",\n            \"methods\": [{\n                \"name\": \"getStylesForNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"getComputedStyleForNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"getInlineStyleForNode\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }]\n            }, {\n                \"name\": \"getAllStyles\",\n                \"parameters\": []\n            }, {\n                \"name\": \"getStyleSheet\",\n                \"parameters\": [{\n                    \"name\": \"styleSheetId\"\n                }]\n            }, {\n                \"name\": \"getStyleSheetText\",\n                \"parameters\": [{\n                    \"name\": \"styleSheetId\"\n                }]\n            }, {\n                \"name\": \"setStyleSheetText\",\n                \"parameters\": [{\n                    \"name\": \"styleSheetId\"\n                }, {\n                    \"name\": \"text\"\n                }]\n            }, {\n                \"name\": \"setPropertyText\",\n                \"parameters\": [{\n                    \"name\": \"styleId\"\n                }, {\n                    \"name\": \"propertyIndex\"\n                }, {\n                    \"name\": \"text\"\n                }, {\n                    \"name\": \"overwrite\"\n                }]\n            }, {\n                \"name\": \"toggleProperty\",\n                \"parameters\": [{\n                    \"name\": \"styleId\"\n                }, {\n                    \"name\": \"propertyIndex\"\n                }, {\n                    \"name\": \"disable\"\n                }]\n            }, {\n                \"name\": \"setRuleSelector\",\n                \"parameters\": [{\n                    \"name\": \"ruleId\"\n                }, {\n                    \"name\": \"selector\"\n                }]\n            }, {\n                \"name\": \"addRule\",\n                \"parameters\": [{\n                    \"name\": \"contextNodeId\"\n                }, {\n                    \"name\": \"selector\"\n                }]\n            }, {\n                \"name\": \"getSupportedCSSProperties\",\n                \"parameters\": []\n            }, {\n                \"name\": \"querySelectorAll\",\n                \"parameters\": [{\n                    \"name\": \"documentId\"\n                }, {\n                    \"name\": \"selector\"\n                }]\n            }]\n        }, {\n            \"name\": \"Timeline\",\n            \"methods\": []\n        }, {\n            \"name\": \"Debugger\",\n            \"methods\": [{\n                \"name\": \"activateBreakpoints\",\n                \"parameters\": []\n            }, {\n                \"name\": \"deactivateBreakpoints\",\n                \"parameters\": []\n            }, {\n                \"name\": \"setJavaScriptBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"url\"\n                }, {\n                    \"name\": \"lineNumber\"\n                }, {\n                    \"name\": \"columnNumber\"\n                }, {\n                    \"name\": \"condition\"\n                }, {\n                    \"name\": \"enabled\"\n                }]\n            }, {\n                \"name\": \"setJavaScriptBreakpointBySourceId\",\n                \"parameters\": [{\n                    \"name\": \"sourceId\"\n                }, {\n                    \"name\": \"lineNumber\"\n                }, {\n                    \"name\": \"columnNumber\"\n                }, {\n                    \"name\": \"condition\"\n                }, {\n                    \"name\": \"enabled\"\n                }]\n            }, {\n                \"name\": \"removeJavaScriptBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"breakpointId\"\n                }]\n            }, {\n                \"name\": \"continueToLocation\",\n                \"parameters\": [{\n                    \"name\": \"sourceId\"\n                }, {\n                    \"name\": \"lineNumber\"\n                }, {\n                    \"name\": \"columnNumber\"\n                }]\n            }, {\n                \"name\": \"stepOver\",\n                \"parameters\": []\n            }, {\n                \"name\": \"stepInto\",\n                \"parameters\": []\n            }, {\n                \"name\": \"stepOut\",\n                \"parameters\": []\n            }, {\n                \"name\": \"pause\",\n                \"parameters\": []\n            }, {\n                \"name\": \"resume\",\n                \"parameters\": []\n            }, {\n                \"name\": \"editScriptSource\",\n                \"parameters\": [{\n                    \"name\": \"sourceID\"\n                }, {\n                    \"name\": \"newContent\"\n                }]\n            }, {\n                \"name\": \"getScriptSource\",\n                \"parameters\": [{\n                    \"name\": \"sourceID\"\n                }]\n            }, {\n                \"name\": \"setPauseOnExceptionsState\",\n                \"parameters\": [{\n                    \"name\": \"pauseOnExceptionsState\"\n                }]\n            }, {\n                \"name\": \"evaluateOnCallFrame\",\n                \"parameters\": [{\n                    \"name\": \"callFrameId\"\n                }, {\n                    \"name\": \"expression\"\n                }, {\n                    \"name\": \"objectGroup\"\n                }, {\n                    \"name\": \"includeCommandLineAPI\"\n                }]\n            }, {\n                \"name\": \"getCompletionsOnCallFrame\",\n                \"parameters\": [{\n                    \"name\": \"callFrameId\"\n                }, {\n                    \"name\": \"expression\"\n                }, {\n                    \"name\": \"includeCommandLineAPI\"\n                }]\n            }]\n        }, {\n            \"name\": \"BrowserDebugger\",\n            \"methods\": [{\n                \"name\": \"setAllBrowserBreakpoints\",\n                \"parameters\": [{\n                    \"name\": \"breakpoints\"\n                }]\n            }, {\n                \"name\": \"setDOMBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }, {\n                    \"name\": \"type\"\n                }]\n            }, {\n                \"name\": \"removeDOMBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }, {\n                    \"name\": \"type\"\n                }]\n            }, {\n                \"name\": \"setEventListenerBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"eventName\"\n                }]\n            }, {\n                \"name\": \"removeEventListenerBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"eventName\"\n                }]\n            }, {\n                \"name\": \"setXHRBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"url\"\n                }]\n            }, {\n                \"name\": \"removeXHRBreakpoint\",\n                \"parameters\": [{\n                    \"name\": \"url\"\n                }]\n            }]\n        }, {\n            \"name\": \"Profiler\",\n            \"methods\": [{\n                \"name\": \"getProfileHeaders\",\n                \"parameters\": []\n            }, {\n                \"name\": \"getProfile\",\n                \"parameters\": [{\n                    \"name\": \"type\"\n                }, {\n                    \"name\": \"uid\"\n                }]\n            }, {\n                \"name\": \"removeProfile\",\n                \"parameters\": [{\n                    \"name\": \"type\"\n                }, {\n                    \"name\": \"uid\"\n                }]\n            }, {\n                \"name\": \"clearProfiles\",\n                \"parameters\": []\n            }, {\n                \"name\": \"takeHeapSnapshot\",\n                \"parameters\": [{\n                    \"name\": \"detailed\"\n                }]\n            }]\n        }, {\n            \"name\": \"InspectorNotify\",\n            \"methods\": [{\n                \"parameters\": [],\n                \"name\": \"frontendReused\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"nodeIds\"\n                }],\n                \"name\": \"addNodesToSearchResult\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"bringToFront\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"disconnectFromBackend\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"url\"\n                }],\n                \"name\": \"inspectedURLChanged\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"time\"\n                }],\n                \"name\": \"domContentEventFired\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"time\"\n                }],\n                \"name\": \"loadEventFired\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"reset\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"panel\"\n                }],\n                \"name\": \"showPanel\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"testCallId\"\n                }, {\n                    \"name\": \"script\"\n                }],\n                \"name\": \"evaluateForTestInFrontend\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"nodeId\"\n                }],\n                \"name\": \"updateFocusedNode\"\n            }]\n        }, {\n            \"name\": \"ConsoleNotify\",\n            \"methods\": [{\n                \"parameters\": [{\n                    \"name\": \"messageObj\"\n                }],\n                \"name\": \"addConsoleMessage\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"count\"\n                }],\n                \"name\": \"updateConsoleMessageExpiredCount\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"count\"\n                }],\n                \"name\": \"updateConsoleMessageRepeatCount\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"consoleMessagesCleared\"\n            }]\n        }, {\n            \"name\": \"NetworkNotify\",\n            \"methods\": [{\n                \"parameters\": [{\n                    \"name\": \"frameId\"\n                }],\n                \"name\": \"frameDetachedFromParent\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"url\"\n                }, {\n                    \"name\": \"loader\"\n                }, {\n                    \"name\": \"callStack\"\n                }],\n                \"name\": \"identifierForInitialRequest\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"time\"\n                }, {\n                    \"name\": \"request\"\n                }, {\n                    \"name\": \"redirectResponse\"\n                }],\n                \"name\": \"willSendRequest\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }],\n                \"name\": \"markResourceAsCached\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"time\"\n                }, {\n                    \"name\": \"resourceType\"\n                }, {\n                    \"name\": \"response\"\n                }],\n                \"name\": \"didReceiveResponse\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"time\"\n                }, {\n                    \"name\": \"lengthReceived\"\n                }],\n                \"name\": \"didReceiveContentLength\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"finishTime\"\n                }],\n                \"name\": \"didFinishLoading\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"time\"\n                }, {\n                    \"name\": \"localizedDescription\"\n                }],\n                \"name\": \"didFailLoading\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"time\"\n                }, {\n                    \"name\": \"resource\"\n                }],\n                \"name\": \"didLoadResourceFromMemoryCache\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"sourceString\"\n                }, {\n                    \"name\": \"type\"\n                }],\n                \"name\": \"setInitialContent\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"frame\"\n                }, {\n                    \"name\": \"loader\"\n                }],\n                \"name\": \"didCommitLoadForFrame\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"requestURL\"\n                }],\n                \"name\": \"didCreateWebSocket\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"time\"\n                }, {\n                    \"name\": \"request\"\n                }],\n                \"name\": \"willSendWebSocketHandshakeRequest\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"time\"\n                }, {\n                    \"name\": \"response\"\n                }],\n                \"name\": \"didReceiveWebSocketHandshakeResponse\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"identifier\"\n                }, {\n                    \"name\": \"time\"\n                }],\n                \"name\": \"didCloseWebSocket\"\n            }]\n        }, {\n            \"name\": \"DatabaseNotify\",\n            \"methods\": [{\n                \"parameters\": [{\n                    \"name\": \"database\"\n                }],\n                \"name\": \"addDatabase\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"databaseId\"\n                }],\n                \"name\": \"selectDatabase\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"transactionId\"\n                }, {\n                    \"name\": \"columnNames\"\n                }, {\n                    \"name\": \"values\"\n                }],\n                \"name\": \"sqlTransactionSucceeded\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"transactionId\"\n                }, {\n                    \"name\": \"sqlError\"\n                }],\n                \"name\": \"sqlTransactionFailed\"\n            }]\n        }, {\n            \"name\": \"DOMStorageNotify\",\n            \"methods\": [{\n                \"parameters\": [{\n                    \"name\": \"storage\"\n                }],\n                \"name\": \"addDOMStorage\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"storageId\"\n                }],\n                \"name\": \"updateDOMStorage\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"storageId\"\n                }],\n                \"name\": \"selectDOMStorage\"\n            }]\n        }, {\n            \"name\": \"ApplicationCacheNotify\",\n            \"methods\": [{\n                \"parameters\": [{\n                    \"name\": \"status\"\n                }],\n                \"name\": \"updateApplicationCacheStatus\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"isNowOnline\"\n                }],\n                \"name\": \"updateNetworkState\"\n            }]\n        }, {\n            \"name\": \"DOMNotify\",\n            \"methods\": [{\n                \"parameters\": [{\n                    \"name\": \"root\"\n                }],\n                \"name\": \"setDocument\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"id\"\n                }, {\n                    \"name\": \"attributes\"\n                }],\n                \"name\": \"attributesUpdated\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"id\"\n                }, {\n                    \"name\": \"newValue\"\n                }],\n                \"name\": \"characterDataModified\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"parentId\"\n                }, {\n                    \"name\": \"nodes\"\n                }],\n                \"name\": \"setChildNodes\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"root\"\n                }],\n                \"name\": \"setDetachedRoot\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"id\"\n                }, {\n                    \"name\": \"newValue\"\n                }],\n                \"name\": \"childNodeCountUpdated\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"parentId\"\n                }, {\n                    \"name\": \"prevId\"\n                }, {\n                    \"name\": \"node\"\n                }],\n                \"name\": \"childNodeInserted\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"parentId\"\n                }, {\n                    \"name\": \"id\"\n                }],\n                \"name\": \"childNodeRemoved\"\n            }]\n        }, {\n            \"name\": \"TimelineNotify\",\n            \"methods\": [{\n                \"parameters\": [],\n                \"name\": \"timelineProfilerWasStarted\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"timelineProfilerWasStopped\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"record\"\n                }],\n                \"name\": \"addRecordToTimeline\"\n            }]\n        }, {\n            \"name\": \"DebuggerNotify\",\n            \"methods\": [{\n                \"parameters\": [],\n                \"name\": \"debuggerWasEnabled\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"debuggerWasDisabled\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"sourceID\"\n                }, {\n                    \"name\": \"url\"\n                }, {\n                    \"name\": \"lineOffset\"\n                }, {\n                    \"name\": \"columnOffset\"\n                }, {\n                    \"name\": \"length\"\n                }, {\n                    \"name\": \"scriptWorldType\"\n                }],\n                \"name\": \"parsedScriptSource\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"url\"\n                }, {\n                    \"name\": \"data\"\n                }, {\n                    \"name\": \"firstLine\"\n                }, {\n                    \"name\": \"errorLine\"\n                }, {\n                    \"name\": \"errorMessage\"\n                }],\n                \"name\": \"failedToParseScriptSource\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"breakpointId\"\n                }, {\n                    \"name\": \"sourceId\"\n                }, {\n                    \"name\": \"lineNumber\"\n                }, {\n                    \"name\": \"columnNumber\"\n                }],\n                \"name\": \"breakpointResolved\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"details\"\n                }],\n                \"name\": \"pausedScript\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"resumedScript\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"id\"\n                }, {\n                    \"name\": \"url\"\n                }, {\n                    \"name\": \"isShared\"\n                }],\n                \"name\": \"didCreateWorker\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"id\"\n                }],\n                \"name\": \"didDestroyWorker\"\n            }]\n        }, {\n            \"name\": \"ProfilerNotify\",\n            \"methods\": [{\n                \"parameters\": [],\n                \"name\": \"profilerWasEnabled\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"profilerWasDisabled\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"header\"\n                }],\n                \"name\": \"addProfileHeader\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"uid\"\n                }, {\n                    \"name\": \"chunk\"\n                }],\n                \"name\": \"addHeapSnapshotChunk\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"uid\"\n                }],\n                \"name\": \"finishHeapSnapshot\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"isProfiling\"\n                }],\n                \"name\": \"setRecordingProfile\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"resetProfiles\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"done\"\n                }, {\n                    \"name\": \"total\"\n                }],\n                \"name\": \"reportHeapSnapshotProgress\"\n            }]\n        }],\n        \"name\": \"core\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"InspectorFrontendHost\",\n            \"methods\": [{\n                \"name\": \"loaded\",\n                \"parameters\": []\n            }, {\n                \"name\": \"closeWindow\",\n                \"parameters\": []\n            }, {\n                \"name\": \"disconnectFromBackend\",\n                \"parameters\": []\n            }, {\n                \"name\": \"bringToFront\",\n                \"parameters\": []\n            }, {\n                \"name\": \"inspectedURLChanged\",\n                \"parameters\": [{\n                    \"name\": \"newURL\"\n                }]\n            }, {\n                \"name\": \"requestAttachWindow\",\n                \"parameters\": []\n            }, {\n                \"name\": \"requestDetachWindow\",\n                \"parameters\": []\n            }, {\n                \"name\": \"setAttachedWindowHeight\",\n                \"parameters\": [{\n                    \"name\": \"height\"\n                }]\n            }, {\n                \"name\": \"moveWindowBy\",\n                \"parameters\": [{\n                    \"name\": \"x\"\n                }, {\n                    \"name\": \"y\"\n                }]\n            }, {\n                \"name\": \"setExtensionAPI\",\n                \"parameters\": [{\n                    \"name\": \"script\"\n                }]\n            }, {\n                \"name\": \"localizedStringsURL\",\n                \"parameters\": []\n            }, {\n                \"name\": \"hiddenPanels\",\n                \"parameters\": []\n            }, {\n                \"name\": \"copyText\",\n                \"parameters\": [{\n                    \"name\": \"text\"\n                }]\n            }, {\n                \"parameters\": [],\n                \"name\": \"platform\"\n            }, {\n                \"parameters\": [],\n                \"name\": \"port\"\n            }, {\n                \"parameters\": [{\n                    \"name\": \"event\"\n                }, {\n                    \"name\": \"items\"\n                }],\n                \"name\": \"showContextMenu\"\n            }, {\n                \"name\": \"sendMessageToBackend\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }]\n        }],\n        \"name\": \"core\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"WeinreClientCommands\",\n            \"methods\": [{\n                \"name\": \"registerClient\",\n                \"parameters\": []\n            }, {\n                \"name\": \"getTargets\",\n                \"parameters\": []\n            }, {\n                \"name\": \"getClients\",\n                \"parameters\": []\n            }, {\n                \"name\": \"connectTarget\",\n                \"parameters\": [{\n                    \"name\": \"clientId\"\n                }, {\n                    \"name\": \"targetId\"\n                }]\n            }, {\n                \"name\": \"disconnectTarget\",\n                \"parameters\": [{\n                    \"name\": \"clientId\"\n                }]\n            }, {\n                \"name\": \"getExtensions\",\n                \"parameters\": []\n            }, {\n                \"name\": \"logDebug\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }, {\n                \"name\": \"logInfo\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }, {\n                \"name\": \"logWarning\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }, {\n                \"name\": \"logError\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }]\n        }],\n        \"name\": \"weinre\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"WeinreClientEvents\",\n            \"methods\": [{\n                \"name\": \"clientRegistered\",\n                \"parameters\": [{\n                    \"name\": \"client\"\n                }]\n            }, {\n                \"name\": \"targetRegistered\",\n                \"parameters\": [{\n                    \"name\": \"target\"\n                }]\n            }, {\n                \"name\": \"clientUnregistered\",\n                \"parameters\": [{\n                    \"name\": \"clientId\"\n                }]\n            }, {\n                \"name\": \"targetUnregistered\",\n                \"parameters\": [{\n                    \"name\": \"targetId\"\n                }]\n            }, {\n                \"name\": \"connectionCreated\",\n                \"parameters\": [{\n                    \"name\": \"clientId\"\n                }, {\n                    \"name\": \"targetId\"\n                }]\n            }, {\n                \"name\": \"connectionDestroyed\",\n                \"parameters\": [{\n                    \"name\": \"clientId\"\n                }, {\n                    \"name\": \"targetId\"\n                }]\n            }, {\n                \"name\": \"sendCallback\",\n                \"parameters\": [{\n                    \"name\": \"callbackId\"\n                }, {\n                    \"name\": \"result\"\n                }]\n            }, {\n                \"name\": \"serverProperties\",\n                \"parameters\": [{\n                    \"name\": \"properties\"\n                }]\n            }]\n        }],\n        \"name\": \"weinre\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"WeinreExtraClientCommands\",\n            \"methods\": [{\n                \"name\": \"getDatabases\",\n                \"parameters\": []\n            }]\n        }],\n        \"name\": \"weinre\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"WeinreExtraTargetEvents\",\n            \"methods\": [{\n                \"name\": \"databaseOpened\",\n                \"parameters\": [{\n                    \"name\": \"databaseRecord\"\n                }]\n            }]\n        }],\n        \"name\": \"weinre\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"WeinreTargetCommands\",\n            \"methods\": [{\n                \"name\": \"registerTarget\",\n                \"parameters\": [{\n                    \"name\": \"url\"\n                }]\n            }, {\n                \"name\": \"sendClientCallback\",\n                \"parameters\": [{\n                    \"name\": \"callbackId\"\n                }, {\n                    \"name\": \"args\"\n                }]\n            }, {\n                \"name\": \"logDebug\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }, {\n                \"name\": \"logInfo\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }, {\n                \"name\": \"logWarning\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }, {\n                \"name\": \"logError\",\n                \"parameters\": [{\n                    \"name\": \"message\"\n                }]\n            }]\n        }],\n        \"name\": \"weinre\"\n    }, {\n        \"interfaces\": [{\n            \"name\": \"WeinreTargetEvents\",\n            \"methods\": [{\n                \"name\": \"connectionCreated\",\n                \"parameters\": [{\n                    \"name\": \"clientId\"\n                }, {\n                    \"name\": \"targetId\"\n                }]\n            }, {\n                \"name\": \"connectionDestroyed\",\n                \"parameters\": [{\n                    \"name\": \"clientId\"\n                }, {\n                    \"name\": \"targetId\"\n                }]\n            }, {\n                \"name\": \"sendCallback\",\n                \"parameters\": [{\n                    \"name\": \"callbackId\"\n                }, {\n                    \"name\": \"result\"\n                }]\n            }]\n        }],\n        \"name\": \"weinre\"\n    }]);\n    // modjewel.require('weinre/common/Weinre').showNotImplemented();\n    modjewel.require('weinre/target/Target').main()\n})();\n"
  },
  {
    "path": "buildin_modules/weinre/web/target/target-script.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n;(function(){\n;eval(\"/*\\n * Licensed to the Apache Software Foundation (ASF) under one\\n * or more contributor license agreements.  See the NOTICE file\\n * distributed with this work for additional information\\n * regarding copyright ownership.  The ASF licenses this file\\n * to you under the Apache License, Version 2.0 (the\\n * \\\"License\\\"); you may not use this file except in compliance\\n * with the License.  You may obtain a copy of the License at\\n *\\n *     http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing,\\n * software distributed under the License is distributed on an\\n * \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\n * KIND, either express or implied.  See the License for the\\n * specific language governing permissions and limitations\\n * under the License.\\n */\\n\\n//----------------------------------------------------------------------------\\n// an implementation of the require() function as specified for use with\\n// CommonJS Modules - see http://commonjs.org/specs/modules/1.0.html\\n//----------------------------------------------------------------------------\\n\\n//----------------------------------------------------------------------------\\n// inspired from David Flanagan's require() function documented here:\\n// http://www.davidflanagan.com/2009/11/a-module-loader.html\\n//----------------------------------------------------------------------------\\n\\n//----------------------------------------------------------------------------\\n// only supports \\\"preloaded\\\" modules ala define() (AMD)\\n//    http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition\\n// but the id parameter is required\\n//----------------------------------------------------------------------------\\n\\n//----------------------------------------------------------------------------\\n// function wrapper\\n//----------------------------------------------------------------------------\\n(function(){\\n\\n//----------------------------------------------------------------------------\\n// some constants\\n//----------------------------------------------------------------------------\\nvar PROGRAM = \\\"modjewel\\\"\\nvar VERSION = \\\"2.0.0\\\"\\nvar global  = this\\n\\n//----------------------------------------------------------------------------\\n// if require() is already defined, leave\\n//----------------------------------------------------------------------------\\nif (global.modjewel) {\\n    log(\\\"modjewel global variable already defined\\\")\\n    return\\n}\\n\\nglobal.modjewel = null\\n\\n//----------------------------------------------------------------------------\\n// \\\"globals\\\" (local to this function scope though)\\n//----------------------------------------------------------------------------\\nvar ModuleStore\\nvar ModulePreloadStore\\nvar MainModule\\nvar WarnOnRecursiveRequire = false\\n\\n//----------------------------------------------------------------------------\\n// the require function\\n//----------------------------------------------------------------------------\\nfunction get_require(currentModule) {\\n    var result = function require(moduleId) {\\n\\n        if (moduleId.match(/^\\\\.{1,2}\\\\//)) {\\n            moduleId = normalize(currentModule, moduleId)\\n        }\\n\\n        if (hop(ModuleStore, moduleId)) {\\n            var module = ModuleStore[moduleId]\\n            if (module.__isLoading) {\\n                if (WarnOnRecursiveRequire) {\\n                    var fromModule = currentModule ? currentModule.id : \\\"<root>\\\"\\n                    console.log(\\\"module '\\\" + moduleId + \\\"' recursively require()d from '\\\" + fromModule + \\\"', problem?\\\")\\n                }\\n            }\\n\\n            currentModule.moduleIdsRequired.push(moduleId)\\n\\n            return module.exports\\n        }\\n\\n        if (!hop(ModulePreloadStore, moduleId)) {\\n            var fromModule = currentModule ? currentModule.id : \\\"<root>\\\"\\n            error(\\\"module '\\\" + moduleId + \\\"' not found from '\\\" + fromModule + \\\"', must be define()'d first\\\")\\n        }\\n\\n        var factory = ModulePreloadStore[moduleId][0]\\n        var prereqs = ModulePreloadStore[moduleId][1]\\n\\n        var module = create_module(moduleId)\\n\\n        var newRequire = get_require(module)\\n\\n        ModuleStore[moduleId] = module\\n\\n        module.__isLoading = true\\n        try {\\n            currentModule.moduleIdsRequired.push(moduleId)\\n\\n            var prereqModules = []\\n            for (var i=0; i<prereqs.length; i++) {\\n                var prereqId = prereqs[i]\\n                var prereqModule\\n\\n                if      (prereqId == \\\"require\\\") prereqModule = newRequire\\n                else if (prereqId == \\\"exports\\\") prereqModule = module.exports\\n                else if (prereqId == \\\"module\\\")  prereqModule = module\\n                else                            prereqModule = newRequire(prereqId)\\n\\n                prereqModules.push(prereqModule)\\n            }\\n\\n            if (typeof factory == \\\"function\\\") {\\n                var result = factory.apply(null, prereqModules)\\n                if (result) {\\n                    module.exports = result\\n                }\\n            }\\n            else {\\n                module.exports = factory\\n            }\\n        }\\n        finally {\\n            module.__isLoading = false\\n        }\\n\\n        return module.exports\\n    }\\n\\n    result.define         = require_define\\n    result.implementation = PROGRAM\\n    result.version        = VERSION\\n\\n    return result\\n}\\n\\n//----------------------------------------------------------------------------\\n// shorter version of hasOwnProperty\\n//----------------------------------------------------------------------------\\nfunction hop(object, name) {\\n    return Object.prototype.hasOwnProperty.call(object, name)\\n}\\n\\n//----------------------------------------------------------------------------\\n// create a new module\\n//----------------------------------------------------------------------------\\nfunction create_module(id) {\\n    return {\\n        id:                id,\\n        uri:               id,\\n        exports:           {},\\n        prereqIds:         [],\\n        moduleIdsRequired: []\\n    }\\n}\\n\\n//----------------------------------------------------------------------------\\n// reset the stores\\n//----------------------------------------------------------------------------\\nfunction require_reset() {\\n    ModuleStore        = {}\\n    ModulePreloadStore = {}\\n    MainModule         = create_module(null)\\n\\n    var require = get_require(MainModule)\\n    var define  = require_define\\n    \\n    define(\\\"modjewel\\\", modjewel_module)\\n\\n    global.modjewel            = require(\\\"modjewel\\\")\\n    global.modjewel.require    = require\\n    global.modjewel.define     = define\\n    global.modjewel.define.amd = {implementation: PROGRAM, version: VERSION}\\n}\\n\\n//----------------------------------------------------------------------------\\n// used by pre-built modules that can be included via <script src=>\\n// a simplification of\\n//    http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition\\n// where id is required\\n//----------------------------------------------------------------------------\\nfunction require_define(moduleId, prereqs, factory) {\\n    var rem = [\\\"require\\\", \\\"exports\\\", \\\"module\\\"]\\n\\n    if (typeof moduleId != \\\"string\\\") {\\n        console.log(\\\"modjewel.define(): first parameter must be a string; was: \\\" + moduleId)\\n        return\\n    }\\n\\n    if (arguments.length == 2) {\\n        factory = prereqs\\n        prereqs = null\\n    }\\n\\n    if (!prereqs || prereqs.length == 0) {\\n        prereqs = rem\\n    }\\n\\n    if (typeof factory != \\\"function\\\") {\\n        if (factory) {\\n            ModulePreloadStore[moduleId] = [factory, prereqs]\\n            return\\n        }\\n\\n        console.log(\\\"modjewel.define(): factory was falsy: \\\" + factory)\\n        return\\n    }\\n\\n    if (moduleId.match(/^\\\\./)) {\\n        console.log(\\\"modjewel.define(): moduleId must not start with '.': '\\\" + moduleName + \\\"'\\\")\\n        return\\n    }\\n\\n    if (hop(ModulePreloadStore, moduleId)) {\\n        console.log(\\\"modjewel.define(): module '\\\" + moduleId + \\\"' has already been defined\\\")\\n        return\\n    }\\n\\n    ModulePreloadStore[moduleId] = [factory, prereqs]\\n}\\n\\n//----------------------------------------------------------------------------\\n// get the path of a module\\n//----------------------------------------------------------------------------\\nfunction getModulePath(module) {\\n    if (!module || !module.id) return \\\"\\\"\\n\\n    var parts = module.id.split(\\\"/\\\")\\n\\n    return parts.slice(0, parts.length-1).join(\\\"/\\\")\\n}\\n\\n//----------------------------------------------------------------------------\\n// normalize a 'file name' with . and .. with a 'directory name'\\n//----------------------------------------------------------------------------\\nfunction normalize(module, file) {\\n    var modulePath = getModulePath(module)\\n    var dirParts   = (\\\"\\\" == modulePath) ? [] : modulePath.split(\\\"/\\\")\\n    var fileParts  = file.split(\\\"/\\\")\\n\\n    for (var i=0; i<fileParts.length; i++) {\\n        var filePart = fileParts[i]\\n\\n        if (filePart == \\\".\\\") {\\n        }\\n\\n        else if (filePart == \\\"..\\\") {\\n            if (dirParts.length > 0) {\\n                dirParts.pop()\\n            }\\n            else {\\n                // error(\\\"error normalizing '\\\" + module + \\\"' and '\\\" + file + \\\"'\\\")\\n                // eat non-valid .. paths\\n            }\\n        }\\n\\n        else {\\n            dirParts.push(filePart)\\n        }\\n    }\\n\\n    return dirParts.join(\\\"/\\\")\\n}\\n\\n//----------------------------------------------------------------------------\\n// throw an error\\n//----------------------------------------------------------------------------\\nfunction error(message) {\\n    throw new Error(PROGRAM + \\\": \\\" + message)\\n}\\n\\n//----------------------------------------------------------------------------\\n// get a list of loaded modules\\n//----------------------------------------------------------------------------\\nfunction modjewel_getLoadedModuleIds() {\\n    var result = []\\n\\n    for (moduleId in ModuleStore) {\\n        result.push(moduleId)\\n    }\\n\\n    return result\\n}\\n\\n//----------------------------------------------------------------------------\\n// get a list of the preloaded module ids\\n//----------------------------------------------------------------------------\\nfunction modjewel_getPreloadedModuleIds() {\\n    var result = []\\n\\n    for (moduleId in ModulePreloadStore) {\\n        result.push(moduleId)\\n    }\\n\\n    return result\\n}\\n\\n//----------------------------------------------------------------------------\\n// get a module by module id\\n//----------------------------------------------------------------------------\\nfunction modjewel_getModule(moduleId) {\\n    if (null == moduleId) return MainModule\\n\\n    return ModuleStore[moduleId]\\n}\\n\\n//----------------------------------------------------------------------------\\n// get a list of module ids which have been required by the specified module id\\n//----------------------------------------------------------------------------\\nfunction modjewel_getModuleIdsRequired(moduleId) {\\n    var module = modjewel_getModule(moduleId)\\n    if (null == module) return null\\n\\n    return module.moduleIdsRequired.slice()\\n}\\n\\n//----------------------------------------------------------------------------\\n// set the WarnOnRecursiveRequireFlag\\n// - if you make use of \\\"module.exports =\\\" in your code, you will want this on\\n//----------------------------------------------------------------------------\\nfunction modjewel_warnOnRecursiveRequire(value) {\\n    if (arguments.length == 0) return WarnOnRecursiveRequire\\n    WarnOnRecursiveRequire = !!value\\n}\\n\\n//----------------------------------------------------------------------------\\n// the modjewel module\\n//----------------------------------------------------------------------------\\nfunction modjewel_module(require, exports, module) {\\n    exports.VERSION                = VERSION\\n    exports.require                = null // filled in later\\n    exports.define                 = null // filled in later\\n    exports.getLoadedModuleIds     = modjewel_getLoadedModuleIds\\n    exports.getPreloadedModuleIds  = modjewel_getPreloadedModuleIds\\n    exports.getModule              = modjewel_getModule\\n    exports.getModuleIdsRequired   = modjewel_getModuleIdsRequired\\n    exports.warnOnRecursiveRequire = modjewel_warnOnRecursiveRequire\\n}\\n\\n//----------------------------------------------------------------------------\\n// log a message\\n//----------------------------------------------------------------------------\\nfunction log(message) {\\n    console.log(\\\"modjewel: \\\" + message)\\n}\\n\\n//----------------------------------------------------------------------------\\n// make the require function a global\\n//----------------------------------------------------------------------------\\nrequire_reset()\\n\\n//----------------------------------------------------------------------------\\n})();\\n\\n//@ sourceURL=modjewel.js\")\nmodjewel.require('modjewel').warnOnRecursiveRequire(true);\n;eval(\";modjewel.define(\\\"weinre/common/Binding\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Binding, Ex;\\n\\nEx = require('./Ex');\\n\\nmodule.exports = Binding = (function() {\\n  function Binding(receiver, method) {\\n    if (!receiver) {\\n      throw new Ex(arguments, \\\"receiver argument for Binding constructor was null\\\");\\n    }\\n    if (typeof method === \\\"string\\\") {\\n      method = receiver[method];\\n    }\\n    if (typeof method === !\\\"function\\\") {\\n      throw new Ex(arguments, \\\"method argument didn't specify a function\\\");\\n    }\\n    return function() {\\n      return method.apply(receiver, [].slice.call(arguments));\\n    };\\n  }\\n\\n  return Binding;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/Binding.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/Callback\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Callback, CallbackIndex, CallbackTable, ConnectorChannel, Ex;\\n\\nEx = require('./Ex');\\n\\nCallbackTable = {};\\n\\nCallbackIndex = 1;\\n\\nConnectorChannel = \\\"???\\\";\\n\\nmodule.exports = Callback = (function() {\\n  function Callback() {\\n    throw new Ex(arguments, \\\"this class is not intended to be instantiated\\\");\\n  }\\n\\n  Callback.setConnectorChannel = function(connectorChannel) {\\n    return ConnectorChannel = \\\"\\\" + connectorChannel;\\n  };\\n\\n  Callback.register = function(callback) {\\n    var data, func, index, receiver;\\n    if (typeof callback === \\\"function\\\") {\\n      callback = [null, callback];\\n    }\\n    if (typeof callback.slice !== \\\"function\\\") {\\n      throw new Ex(arguments, \\\"callback must be an array or function\\\");\\n    }\\n    receiver = callback[0];\\n    func = callback[1];\\n    data = callback.slice(2);\\n    if (typeof func === \\\"string\\\") {\\n      func = receiver[func];\\n    }\\n    if (typeof func !== \\\"function\\\") {\\n      throw new Ex(arguments, \\\"callback function was null or not found\\\");\\n    }\\n    index = ConnectorChannel + \\\"::\\\" + CallbackIndex;\\n    CallbackIndex++;\\n    if (CallbackIndex >= 65536 * 65536) {\\n      CallbackIndex = 1;\\n    }\\n    CallbackTable[index] = [receiver, func, data];\\n    return index;\\n  };\\n\\n  Callback.deregister = function(index) {\\n    return delete CallbackTable[index];\\n  };\\n\\n  Callback.invoke = function(index, args) {\\n    var callback, e, func, funcName, receiver;\\n    callback = CallbackTable[index];\\n    if (!callback) {\\n      throw new Ex(arguments, \\\"callback \\\" + index + \\\" not registered or already invoked\\\");\\n    }\\n    receiver = callback[0];\\n    func = callback[1];\\n    args = callback[2].concat(args);\\n    try {\\n      return func.apply(receiver, args);\\n    } catch (_error) {\\n      e = _error;\\n      funcName = func.name || func.signature;\\n      if (!funcName) {\\n        funcName = \\\"<unnamed>\\\";\\n      }\\n      return require(\\\"./Weinre\\\").logError(arguments.callee.signature + (\\\" exception invoking callback: \\\" + funcName + \\\"(\\\" + (args.join(',')) + \\\"): \\\") + e);\\n    } finally {\\n      Callback.deregister(index);\\n    }\\n  };\\n\\n  return Callback;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/Callback.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/Debug\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Debug;\\n\\nmodule.exports = new (Debug = (function() {\\n  function Debug() {\\n    this._printCalledArgs = {};\\n  }\\n\\n  Debug.prototype.log = function(message) {\\n    var console;\\n    console = window.console.__original || window.console;\\n    return console.log(\\\"\\\" + (this.timeStamp()) + \\\": \\\" + message);\\n  };\\n\\n  Debug.prototype.logCall = function(context, intf, method, args, message) {\\n    var printArgs, signature;\\n    if (message) {\\n      message = \\\": \\\" + message;\\n    } else {\\n      message = \\\"\\\";\\n    }\\n    signature = this.signature(intf, method);\\n    printArgs = this._printCalledArgs[signature];\\n    if (printArgs) {\\n      args = JSON.stringify(args, null, 4);\\n    } else {\\n      args = \\\"\\\";\\n    }\\n    return this.log(\\\"\\\" + context + \\\" \\\" + signature + \\\"(\\\" + args + \\\")\\\" + message);\\n  };\\n\\n  Debug.prototype.logCallArgs = function(intf, method) {\\n    return this._printCalledArgs[this.signature(intf, method)] = true;\\n  };\\n\\n  Debug.prototype.signature = function(intf, method) {\\n    return \\\"\\\" + intf + \\\".\\\" + method;\\n  };\\n\\n  Debug.prototype.timeStamp = function() {\\n    var date, mins, secs;\\n    date = new Date();\\n    mins = \\\"\\\" + (date.getMinutes());\\n    secs = \\\"\\\" + (date.getSeconds());\\n    if (mins.length === 1) {\\n      mins = \\\"0\\\" + mins;\\n    }\\n    if (secs.length === 1) {\\n      secs = \\\"0\\\" + secs;\\n    }\\n    return \\\"\\\" + mins + \\\":\\\" + secs;\\n  };\\n\\n  return Debug;\\n\\n})());\\n\\n});\\n\\n//@ sourceURL=weinre/common/Debug.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/EventListeners\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar EventListeners, Ex, Weinre;\\n\\nEx = require('./Ex');\\n\\nWeinre = require('./Weinre');\\n\\nmodule.exports = EventListeners = (function() {\\n  function EventListeners() {\\n    this.listeners = [];\\n  }\\n\\n  EventListeners.prototype.add = function(listener, useCapture) {\\n    return this.listeners.push([listener, useCapture]);\\n  };\\n\\n  EventListeners.prototype.remove = function(listener, useCapture) {\\n    var listeners, _i, _len, _listener;\\n    listeners = this.listeners.slice();\\n    for (_i = 0, _len = listeners.length; _i < _len; _i++) {\\n      _listener = listeners[_i];\\n      if (_listener[0] !== listener) {\\n        continue;\\n      }\\n      if (_listener[1] !== useCapture) {\\n        continue;\\n      }\\n      this._listeners.splice(i, 1);\\n      return;\\n    }\\n  };\\n\\n  EventListeners.prototype.fire = function(event) {\\n    var e, listener, listeners, _i, _len, _results;\\n    listeners = this.listeners.slice();\\n    _results = [];\\n    for (_i = 0, _len = listeners.length; _i < _len; _i++) {\\n      listener = listeners[_i];\\n      listener = listener[0];\\n      if (typeof listener === \\\"function\\\") {\\n        try {\\n          listener.call(null, event);\\n        } catch (_error) {\\n          e = _error;\\n          Weinre.logError(\\\"\\\" + arguments.callee.name + \\\" invocation exception: \\\" + e);\\n        }\\n        continue;\\n      }\\n      if (typeof (listener != null ? listener.handleEvent : void 0) !== \\\"function\\\") {\\n        throw new Ex(arguments, \\\"listener does not implement the handleEvent() method\\\");\\n      }\\n      try {\\n        _results.push(listener.handleEvent.call(listener, event));\\n      } catch (_error) {\\n        e = _error;\\n        _results.push(Weinre.logError(\\\"\\\" + arguments.callee.name + \\\" invocation exception: \\\" + e));\\n      }\\n    }\\n    return _results;\\n  };\\n\\n  return EventListeners;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/EventListeners.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/Ex\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Ex, StackTrace, prefix;\\n\\nStackTrace = require('./StackTrace');\\n\\nmodule.exports = Ex = (function() {\\n  Ex.catching = function(func) {\\n    var e;\\n    try {\\n      return func.call(this);\\n    } catch (_error) {\\n      e = _error;\\n      console.log(\\\"runtime error: \\\" + e);\\n      return StackTrace.dump(arguments);\\n    }\\n  };\\n\\n  function Ex(args, message) {\\n    if (!args || !args.callee) {\\n      throw Ex(arguments, \\\"first parameter must be an Arguments object\\\");\\n    }\\n    StackTrace.dump(args);\\n    if (message instanceof Error) {\\n      message = \\\"threw error: \\\" + message;\\n    }\\n    message = prefix(args, message);\\n    message;\\n  }\\n\\n  return Ex;\\n\\n})();\\n\\nprefix = function(args, string) {\\n  if (args.callee.signature) {\\n    return args.callee.signature + \\\": \\\" + string;\\n  }\\n  if (args.callee.displayName) {\\n    return args.callee.displayName + \\\": \\\" + string;\\n  }\\n  if (args.callee.name) {\\n    return args.callee.name + \\\": \\\" + string;\\n  }\\n  return \\\"<anonymous>\\\" + \\\": \\\" + string;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/Ex.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/HookLib\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar HookLib, HookSite, HookSites, IgnoreHooks, callAfterHooks, callBeforeHooks, callExceptHooks, getHookSite, getHookedFunction;\\n\\nHookLib = exports;\\n\\nHookSites = [];\\n\\nIgnoreHooks = 0;\\n\\nmodule.exports = HookLib = (function() {\\n  function HookLib() {}\\n\\n  HookLib.addHookSite = function(object, property) {\\n    return getHookSite(object, property, true);\\n  };\\n\\n  HookLib.getHookSite = function(object, property) {\\n    return getHookSite(object, property, false);\\n  };\\n\\n  HookLib.ignoreHooks = function(func) {\\n    var result;\\n    try {\\n      IgnoreHooks++;\\n      result = func.call();\\n    } finally {\\n      IgnoreHooks--;\\n    }\\n    return result;\\n  };\\n\\n  return HookLib;\\n\\n})();\\n\\ngetHookSite = function(object, property, addIfNotFound) {\\n  var hookSite, i, _i, _len;\\n  i = 0;\\n  for (_i = 0, _len = HookSites.length; _i < _len; _i++) {\\n    hookSite = HookSites[_i];\\n    if (hookSite.object !== object) {\\n      continue;\\n    }\\n    if (hookSite.property !== property) {\\n      continue;\\n    }\\n    return hookSite;\\n  }\\n  if (!addIfNotFound) {\\n    return null;\\n  }\\n  hookSite = new HookSite(object, property);\\n  HookSites.push(hookSite);\\n  return hookSite;\\n};\\n\\nHookSite = (function() {\\n  function HookSite(object, property) {\\n    var hookedFunction;\\n    this.object = object;\\n    this.property = property;\\n    this.target = object[property];\\n    this.hookss = [];\\n    if (typeof this.target === 'undefined') {\\n      return;\\n    } else {\\n      hookedFunction = getHookedFunction(this.target, this);\\n      if (!(navigator.userAgent.match(/MSIE/i) && (object === localStorage || object === sessionStorage))) {\\n        object[property] = hookedFunction;\\n      }\\n    }\\n  }\\n\\n  HookSite.prototype.addHooks = function(hooks) {\\n    return this.hookss.push(hooks);\\n  };\\n\\n  HookSite.prototype.removeHooks = function(hooks) {\\n    var i, _i, _ref;\\n    for (i = _i = 0, _ref = this.hookss.length; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {\\n      if (this.hookss[i] === hooks) {\\n        this.hookss.splice(i, 1);\\n        return;\\n      }\\n    }\\n  };\\n\\n  return HookSite;\\n\\n})();\\n\\ngetHookedFunction = function(func, hookSite) {\\n  var hookedFunction;\\n  hookedFunction = function() {\\n    var e, result;\\n    callBeforeHooks(hookSite, this, arguments);\\n    try {\\n      result = func.apply(this, arguments);\\n    } catch (_error) {\\n      e = _error;\\n      callExceptHooks(hookSite, this, arguments, e);\\n      throw e;\\n    } finally {\\n      callAfterHooks(hookSite, this, arguments, result);\\n    }\\n    return result;\\n  };\\n  hookedFunction.displayName = func.displayName || func.name;\\n  return hookedFunction;\\n};\\n\\ncallBeforeHooks = function(hookSite, receiver, args) {\\n  var hooks, _i, _len, _ref, _results;\\n  if (IgnoreHooks > 0) {\\n    return;\\n  }\\n  _ref = hookSite.hookss;\\n  _results = [];\\n  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n    hooks = _ref[_i];\\n    if (hooks.before) {\\n      _results.push(hooks.before.call(hooks, receiver, args));\\n    } else {\\n      _results.push(void 0);\\n    }\\n  }\\n  return _results;\\n};\\n\\ncallAfterHooks = function(hookSite, receiver, args, result) {\\n  var hooks, _i, _len, _ref, _results;\\n  if (IgnoreHooks > 0) {\\n    return;\\n  }\\n  _ref = hookSite.hookss;\\n  _results = [];\\n  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n    hooks = _ref[_i];\\n    if (hooks.after) {\\n      _results.push(hooks.after.call(hooks, receiver, args, result));\\n    } else {\\n      _results.push(void 0);\\n    }\\n  }\\n  return _results;\\n};\\n\\ncallExceptHooks = function(hookSite, receiver, args, e) {\\n  var hooks, _i, _len, _ref, _results;\\n  if (IgnoreHooks > 0) {\\n    return;\\n  }\\n  _ref = hookSite.hookss;\\n  _results = [];\\n  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n    hooks = _ref[_i];\\n    if (hooks.except) {\\n      _results.push(hooks.except.call(hooks, receiver, args, e));\\n    } else {\\n      _results.push(void 0);\\n    }\\n  }\\n  return _results;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/HookLib.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/IDGenerator\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar IDGenerator, idName, nextId, nextIdValue;\\n\\nnextIdValue = 1;\\n\\nidName = \\\"__weinre__id\\\";\\n\\nmodule.exports = IDGenerator = (function() {\\n  function IDGenerator() {}\\n\\n  IDGenerator.checkId = function(object) {\\n    return object[idName];\\n  };\\n\\n  IDGenerator.getId = function(object, map) {\\n    var id;\\n    id = IDGenerator.checkId(object);\\n    if (!id) {\\n      id = nextId();\\n      object[idName] = id;\\n    }\\n    if (map) {\\n      map[id] = object;\\n    }\\n    return id;\\n  };\\n\\n  IDGenerator.next = function() {\\n    return nextId();\\n  };\\n\\n  return IDGenerator;\\n\\n})();\\n\\nnextId = function() {\\n  var result;\\n  result = nextIdValue;\\n  nextIdValue += 1;\\n  return result;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/IDGenerator.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/IDLTools\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Callback, Ex, IDLTools, IDLs, getProxyMethod;\\n\\nEx = require('./Ex');\\n\\nCallback = require('./Callback');\\n\\nIDLs = {};\\n\\nmodule.exports = IDLTools = (function() {\\n  function IDLTools() {\\n    throw new Ex(arguments, \\\"this class is not intended to be instantiated\\\");\\n  }\\n\\n  IDLTools.addIDLs = function(idls) {\\n    var idl, intf, _i, _len, _results;\\n    _results = [];\\n    for (_i = 0, _len = idls.length; _i < _len; _i++) {\\n      idl = idls[_i];\\n      _results.push((function() {\\n        var _j, _len1, _ref, _results1;\\n        _ref = idl.interfaces;\\n        _results1 = [];\\n        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {\\n          intf = _ref[_j];\\n          IDLs[intf.name] = intf;\\n          _results1.push(intf.module = idl.name);\\n        }\\n        return _results1;\\n      })());\\n    }\\n    return _results;\\n  };\\n\\n  IDLTools.getIDL = function(name) {\\n    return IDLs[name];\\n  };\\n\\n  IDLTools.getIDLsMatching = function(regex) {\\n    var intf, intfName, results;\\n    results = [];\\n    for (intfName in IDLs) {\\n      intf = IDLs[intfName];\\n      if (intfName.match(regex)) {\\n        results.push(intf);\\n      }\\n    }\\n    return results;\\n  };\\n\\n  IDLTools.validateAgainstIDL = function(klass, interfaceName) {\\n    var classMethod, error, errors, intf, intfMethod, messagePrefix, printName, propertyName, _i, _j, _len, _len1, _ref, _results;\\n    intf = IDLTools.getIDL(interfaceName);\\n    messagePrefix = \\\"IDL validation for \\\" + interfaceName + \\\": \\\";\\n    if (null === intf) {\\n      throw new Ex(arguments, messagePrefix + (\\\"idl not found: '\\\" + interfaceName + \\\"'\\\"));\\n    }\\n    errors = [];\\n    _ref = intf.methods;\\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n      intfMethod = _ref[_i];\\n      classMethod = klass.prototype[intfMethod.name];\\n      printName = klass.name + \\\"::\\\" + intfMethod.name;\\n      if (null === classMethod) {\\n        errors.push(messagePrefix + (\\\"method not implemented: '\\\" + printName + \\\"'\\\"));\\n        continue;\\n      }\\n      if (classMethod.length !== intfMethod.parameters.length) {\\n        if (classMethod.length !== intfMethod.parameters.length + 1) {\\n          errors.push(messagePrefix + (\\\"wrong number of parameters: '\\\" + printName + \\\"'\\\"));\\n          continue;\\n        }\\n      }\\n    }\\n    for (propertyName in klass.prototype) {\\n      if (klass.prototype.hasOwnProperty(propertyName)) {\\n        continue;\\n      }\\n      if (propertyName.match(/^_.*/)) {\\n        continue;\\n      }\\n      printName = klass.name + \\\"::\\\" + propertyName;\\n      if (!intf.methods[propertyName]) {\\n        errors.push(messagePrefix + (\\\"method should not be implemented: '\\\" + printName + \\\"'\\\"));\\n        continue;\\n      }\\n    }\\n    if (!errors.length) {\\n      return;\\n    }\\n    _results = [];\\n    for (_j = 0, _len1 = errors.length; _j < _len1; _j++) {\\n      error = errors[_j];\\n      _results.push(require(\\\"./Weinre\\\").logError(error));\\n    }\\n    return _results;\\n  };\\n\\n  IDLTools.buildProxyForIDL = function(proxyObject, interfaceName) {\\n    var intf, intfMethod, messagePrefix, _i, _len, _ref, _results;\\n    intf = IDLTools.getIDL(interfaceName);\\n    messagePrefix = \\\"building proxy for IDL \\\" + interfaceName + \\\": \\\";\\n    if (null === intf) {\\n      throw new Ex(arguments, messagePrefix + (\\\"idl not found: '\\\" + interfaceName + \\\"'\\\"));\\n    }\\n    _ref = intf.methods;\\n    _results = [];\\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n      intfMethod = _ref[_i];\\n      _results.push(proxyObject[intfMethod.name] = getProxyMethod(intf, intfMethod));\\n    }\\n    return _results;\\n  };\\n\\n  return IDLTools;\\n\\n})();\\n\\ngetProxyMethod = function(intf, method) {\\n  var proxyMethod, result;\\n  result = proxyMethod = function() {\\n    var args, callbackId;\\n    callbackId = null;\\n    args = [].slice.call(arguments);\\n    if (args.length > 0) {\\n      if (typeof args[args.length - 1] === \\\"function\\\") {\\n        callbackId = Callback.register(args[args.length - 1]);\\n        args = args.slice(0, args.length - 1);\\n      }\\n    }\\n    while (args.length < method.parameters.length) {\\n      args.push(null);\\n    }\\n    args.push(callbackId);\\n    return this.__invoke(intf.name, method.name, args);\\n  };\\n  result.displayName = intf.name + \\\"__\\\" + method.name;\\n  return result;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/IDLTools.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/MessageDispatcher\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Binding, Callback, Ex, IDLTools, InspectorBackend, MessageDispatcher, Verbose, WebSocketXhr, Weinre,\\n  __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\\n\\nWeinre = require('./Weinre');\\n\\nWebSocketXhr = require('./WebSocketXhr');\\n\\nIDLTools = require('./IDLTools');\\n\\nBinding = require('./Binding');\\n\\nEx = require('./Ex');\\n\\nCallback = require('./Callback');\\n\\nVerbose = false;\\n\\nInspectorBackend = null;\\n\\nmodule.exports = MessageDispatcher = (function() {\\n  function MessageDispatcher(url, id) {\\n    if (!id) {\\n      id = \\\"anonymous\\\";\\n    }\\n    this._url = url;\\n    this._id = id;\\n    this.error = null;\\n    this._opening = false;\\n    this._opened = false;\\n    this._closed = false;\\n    this._interfaces = {};\\n    this._open();\\n  }\\n\\n  MessageDispatcher.setInspectorBackend = function(inspectorBackend) {\\n    return InspectorBackend = inspectorBackend;\\n  };\\n\\n  MessageDispatcher.verbose = function(value) {\\n    if (arguments.length >= 1) {\\n      Verbose = !!value;\\n    }\\n    return Verbose;\\n  };\\n\\n  MessageDispatcher.prototype._open = function() {\\n    if (this._opened || this._opening) {\\n      return;\\n    }\\n    if (this._closed) {\\n      throw new Ex(arguments, \\\"socket has already been closed\\\");\\n    }\\n    this._opening = true;\\n    this._socket = new WebSocketXhr(this._url, this._id);\\n    this._socket.addEventListener(\\\"open\\\", Binding(this, \\\"_handleOpen\\\"));\\n    this._socket.addEventListener(\\\"error\\\", Binding(this, \\\"_handleError\\\"));\\n    this._socket.addEventListener(\\\"message\\\", Binding(this, \\\"_handleMessage\\\"));\\n    return this._socket.addEventListener(\\\"close\\\", Binding(this, \\\"_handleClose\\\"));\\n  };\\n\\n  MessageDispatcher.prototype.close = function() {\\n    if (this._closed) {\\n      return;\\n    }\\n    this._opened = false;\\n    this._closed = true;\\n    return this._socket.close();\\n  };\\n\\n  MessageDispatcher.prototype.send = function(data) {\\n    return this._socket.send(data);\\n  };\\n\\n  MessageDispatcher.prototype.getWebSocket = function() {\\n    return this._socket;\\n  };\\n\\n  MessageDispatcher.prototype.registerInterface = function(intfName, intf, validate) {\\n    if (validate) {\\n      IDLTools.validateAgainstIDL(intf.constructor, intfName);\\n    }\\n    if (this._interfaces[intfName]) {\\n      throw new Ex(arguments, \\\"interface \\\" + intfName + \\\" has already been registered\\\");\\n    }\\n    return this._interfaces[intfName] = intf;\\n  };\\n\\n  MessageDispatcher.prototype.createProxy = function(intfName) {\\n    var proxy, self, __invoke;\\n    proxy = {};\\n    IDLTools.buildProxyForIDL(proxy, intfName);\\n    self = this;\\n    proxy.__invoke = __invoke = function(intfName, methodName, args) {\\n      return self._sendMethodInvocation(intfName, methodName, args);\\n    };\\n    return proxy;\\n  };\\n\\n  MessageDispatcher.prototype._sendMethodInvocation = function(intfName, methodName, args) {\\n    var data;\\n    if (typeof intfName !== \\\"string\\\") {\\n      throw new Ex(arguments, \\\"expecting intf parameter to be a string\\\");\\n    }\\n    if (typeof methodName !== \\\"string\\\") {\\n      throw new Ex(arguments, \\\"expecting method parameter to be a string\\\");\\n    }\\n    data = {\\n      \\\"interface\\\": intfName,\\n      method: methodName,\\n      args: args\\n    };\\n    data = JSON.stringify(data);\\n    this._socket.send(data);\\n    if (Verbose) {\\n      return Weinre.logDebug(this.constructor.name + (\\\"[\\\" + this._url + \\\"]: send \\\" + intfName + \\\".\\\" + methodName + \\\"(\\\" + (JSON.stringify(args)) + \\\")\\\"));\\n    }\\n  };\\n\\n  MessageDispatcher.prototype.getState = function() {\\n    if (this._opening) {\\n      return \\\"opening\\\";\\n    }\\n    if (this._opened) {\\n      return \\\"opened\\\";\\n    }\\n    if (this._closed) {\\n      return \\\"closed\\\";\\n    }\\n    return \\\"unknown\\\";\\n  };\\n\\n  MessageDispatcher.prototype.isOpen = function() {\\n    return this._opened === true;\\n  };\\n\\n  MessageDispatcher.prototype._handleOpen = function(event) {\\n    this._opening = false;\\n    this._opened = true;\\n    this.channel = event.channel;\\n    Callback.setConnectorChannel(this.channel);\\n    if (Verbose) {\\n      return Weinre.logDebug(this.constructor.name + (\\\"[\\\" + this._url + \\\"]: opened\\\"));\\n    }\\n  };\\n\\n  MessageDispatcher.prototype._handleError = function(message) {\\n    this.error = message;\\n    this.close();\\n    if (Verbose) {\\n      return Weinre.logDebug(this.constructor.name + (\\\"[\\\" + this._url + \\\"]: error: \\\") + message);\\n    }\\n  };\\n\\n  MessageDispatcher.prototype._handleMessage = function(message) {\\n    var args, data, e, intf, intfName, method, methodName, methodSignature, skipErrorForMethods;\\n    skipErrorForMethods = ['domContentEventFired', 'loadEventFired', 'childNodeRemoved'];\\n    try {\\n      data = JSON.parse(message.data);\\n    } catch (_error) {\\n      e = _error;\\n      throw new Ex(arguments, \\\"invalid JSON data received: \\\" + e + \\\": '\\\" + message.data + \\\"'\\\");\\n    }\\n    intfName = data[\\\"interface\\\"];\\n    methodName = data.method;\\n    args = data.args;\\n    methodSignature = \\\"\\\" + intfName + \\\".\\\" + methodName + \\\"()\\\";\\n    intf = this._interfaces.hasOwnProperty(intfName) && this._interfaces[intfName];\\n    if (!intf && InspectorBackend && intfName.match(/.*Notify/)) {\\n      intf = InspectorBackend.getRegisteredDomainDispatcher(intfName.substr(0, intfName.length - 6));\\n    }\\n    if (!intf) {\\n      Weinre.notImplemented(\\\"weinre: request for non-registered interface: \\\" + methodSignature);\\n      return;\\n    }\\n    methodSignature = intf.constructor.name + (\\\".\\\" + methodName + \\\"()\\\");\\n    method = intf[methodName];\\n    if (typeof method !== \\\"function\\\") {\\n      Weinre.notImplemented(methodSignature);\\n      return;\\n    }\\n    try {\\n      method.apply(intf, args);\\n    } catch (_error) {\\n      e = _error;\\n      if (__indexOf.call(skipErrorForMethods, methodName) < 0) {\\n        Weinre.logError((\\\"weinre: invocation exception on \\\" + methodSignature + \\\": \\\") + e);\\n      }\\n    }\\n    if (Verbose) {\\n      return Weinre.logDebug(this.constructor.name + (\\\"[\\\" + this._url + \\\"]: recv \\\" + intfName + \\\".\\\" + methodName + \\\"(\\\" + (JSON.stringify(args)) + \\\")\\\"));\\n    }\\n  };\\n\\n  MessageDispatcher.prototype._handleClose = function() {\\n    this._reallyClosed = true;\\n    if (Verbose) {\\n      return Weinre.logDebug(this.constructor.name + (\\\"[\\\" + this._url + \\\"]: closed\\\"));\\n    }\\n  };\\n\\n  return MessageDispatcher;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/MessageDispatcher.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/MethodNamer\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar MethodNamer,\\n  __hasProp = {}.hasOwnProperty;\\n\\nmodule.exports = MethodNamer = (function() {\\n  function MethodNamer() {}\\n\\n  MethodNamer.setNamesForClass = function(aClass) {\\n    var key, val, _ref, _results;\\n    for (key in aClass) {\\n      if (!__hasProp.call(aClass, key)) continue;\\n      val = aClass[key];\\n      if (typeof val === \\\"function\\\") {\\n        val.signature = \\\"\\\" + aClass.name + \\\"::\\\" + key;\\n        val.displayName = key;\\n        val.name = key;\\n      }\\n    }\\n    _ref = aClass.prototype;\\n    _results = [];\\n    for (key in _ref) {\\n      if (!__hasProp.call(_ref, key)) continue;\\n      val = _ref[key];\\n      if (typeof val === \\\"function\\\") {\\n        val.signature = \\\"\\\" + aClass.name + \\\".\\\" + key;\\n        val.displayName = key;\\n        _results.push(val.name = key);\\n      } else {\\n        _results.push(void 0);\\n      }\\n    }\\n    return _results;\\n  };\\n\\n  return MethodNamer;\\n\\n})();\\n\\nMethodNamer.setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/MethodNamer.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/StackTrace\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar StackTrace, getTrace;\\n\\nmodule.exports = StackTrace = (function() {\\n  function StackTrace(args) {\\n    if (!args || !args.callee) {\\n      throw Error(\\\"first parameter to \\\" + arguments.callee.signature + \\\" must be an Arguments object\\\");\\n    }\\n    this.trace = getTrace(args);\\n  }\\n\\n  StackTrace.dump = function(args) {\\n    var stackTrace;\\n    args = args || arguments;\\n    stackTrace = new StackTrace(args);\\n    return stackTrace.dump();\\n  };\\n\\n  StackTrace.prototype.dump = function() {\\n    var frame, _i, _len, _ref, _results;\\n    console.log(\\\"StackTrace:\\\");\\n    _ref = this.trace;\\n    _results = [];\\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n      frame = _ref[_i];\\n      _results.push(console.log(\\\"    \\\" + frame));\\n    }\\n    return _results;\\n  };\\n\\n  return StackTrace;\\n\\n})();\\n\\ngetTrace = function(args) {\\n  var err, func, result, visitedFuncs;\\n  result = [];\\n  visitedFuncs = [];\\n  func = args.callee;\\n  while (func) {\\n    if (func.signature) {\\n      result.push(func.signature);\\n    } else if (func.displayName) {\\n      result.push(func.displayName);\\n    } else if (func.name) {\\n      result.push(func.name);\\n    } else {\\n      result.push(\\\"<anonymous>\\\");\\n    }\\n    if (-1 !== visitedFuncs.indexOf(func)) {\\n      result.push(\\\"... recursion\\\");\\n      return result;\\n    }\\n    visitedFuncs.push(func);\\n    try {\\n      func = func.caller;\\n    } catch (_error) {\\n      err = _error;\\n      func = null;\\n    }\\n  }\\n  return result;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/StackTrace.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/WebSocketXhr\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar EventListeners, Ex, HookLib, WebSocketXhr, Weinre, _xhrEventHandler;\\n\\nEx = require('./Ex');\\n\\nWeinre = require('./Weinre');\\n\\nHookLib = require('./HookLib');\\n\\nEventListeners = require('./EventListeners');\\n\\nmodule.exports = WebSocketXhr = (function() {\\n  WebSocketXhr.CONNECTING = 0;\\n\\n  WebSocketXhr.OPEN = 1;\\n\\n  WebSocketXhr.CLOSING = 2;\\n\\n  WebSocketXhr.CLOSED = 3;\\n\\n  function WebSocketXhr(url, id) {\\n    this.initialize(url, id);\\n  }\\n\\n  WebSocketXhr.prototype.initialize = function(url, id) {\\n    if (!id) {\\n      id = \\\"anonymous\\\";\\n    }\\n    this.readyState = WebSocketXhr.CONNECTING;\\n    this._url = url;\\n    this._id = id;\\n    this._urlChannel = null;\\n    this._queuedSends = [];\\n    this._sendInProgress = true;\\n    this._listeners = {\\n      open: new EventListeners(),\\n      message: new EventListeners(),\\n      error: new EventListeners(),\\n      close: new EventListeners()\\n    };\\n    return this._getChannel();\\n  };\\n\\n  WebSocketXhr.prototype._getChannel = function() {\\n    var body;\\n    body = JSON.stringify({\\n      id: this._id\\n    });\\n    return this._xhr(this._url, \\\"POST\\\", body, this._handleXhrResponseGetChannel);\\n  };\\n\\n  WebSocketXhr.prototype._handleXhrResponseGetChannel = function(xhr) {\\n    var e, object;\\n    if (xhr.status !== 200) {\\n      return this._handleXhrResponseError(xhr);\\n    }\\n    try {\\n      object = JSON.parse(xhr.responseText);\\n    } catch (_error) {\\n      e = _error;\\n      this._fireEventListeners(\\\"error\\\", {\\n        message: \\\"non-JSON response from channel open request\\\"\\n      });\\n      this.close();\\n      return;\\n    }\\n    if (!object.channel) {\\n      this._fireEventListeners(\\\"error\\\", {\\n        message: \\\"channel open request did not include a channel\\\"\\n      });\\n      this.close();\\n      return;\\n    }\\n    this._urlChannel = this._url + \\\"/\\\" + object.channel;\\n    this.readyState = WebSocketXhr.OPEN;\\n    this._fireEventListeners(\\\"open\\\", {\\n      message: \\\"open\\\",\\n      channel: object.channel\\n    });\\n    this._sendInProgress = false;\\n    this._sendQueued();\\n    return this._readLoop();\\n  };\\n\\n  WebSocketXhr.prototype._readLoop = function() {\\n    if (this.readyState === WebSocketXhr.CLOSED) {\\n      return;\\n    }\\n    if (this.readyState === WebSocketXhr.CLOSING) {\\n      return;\\n    }\\n    return this._xhr(this._urlChannel, \\\"GET\\\", \\\"\\\", this._handleXhrResponseGet);\\n  };\\n\\n  WebSocketXhr.prototype._handleXhrResponseGet = function(xhr) {\\n    var data, datum, e, self, _i, _len, _results;\\n    self = this;\\n    if (xhr.status !== 200) {\\n      return this._handleXhrResponseError(xhr);\\n    }\\n    try {\\n      datum = JSON.parse(xhr.responseText);\\n    } catch (_error) {\\n      e = _error;\\n      this.readyState = WebSocketXhr.CLOSED;\\n      this._fireEventListeners(\\\"error\\\", {\\n        message: \\\"non-JSON response from read request\\\"\\n      });\\n      return;\\n    }\\n    HookLib.ignoreHooks(function() {\\n      return setTimeout((function() {\\n        return self._readLoop();\\n      }), 0);\\n    });\\n    _results = [];\\n    for (_i = 0, _len = datum.length; _i < _len; _i++) {\\n      data = datum[_i];\\n      _results.push(self._fireEventListeners(\\\"message\\\", {\\n        data: data\\n      }));\\n    }\\n    return _results;\\n  };\\n\\n  WebSocketXhr.prototype.send = function(data) {\\n    if (typeof data !== \\\"string\\\") {\\n      throw new Ex(arguments, this.constructor.name + \\\".send\\\");\\n    }\\n    this._queuedSends.push(data);\\n    if (this._sendInProgress) {\\n      return;\\n    }\\n    return this._sendQueued();\\n  };\\n\\n  WebSocketXhr.prototype._sendQueued = function() {\\n    var datum;\\n    if (this._queuedSends.length === 0) {\\n      return;\\n    }\\n    if (this.readyState === WebSocketXhr.CLOSED) {\\n      return;\\n    }\\n    if (this.readyState === WebSocketXhr.CLOSING) {\\n      return;\\n    }\\n    datum = JSON.stringify(this._queuedSends);\\n    this._queuedSends = [];\\n    this._sendInProgress = true;\\n    return this._xhr(this._urlChannel, \\\"POST\\\", datum, this._handleXhrResponseSend);\\n  };\\n\\n  WebSocketXhr.prototype._handleXhrResponseSend = function(xhr) {\\n    var httpSocket;\\n    httpSocket = this;\\n    if (xhr.status !== 200) {\\n      return this._handleXhrResponseError(xhr);\\n    }\\n    this._sendInProgress = false;\\n    return HookLib.ignoreHooks(function() {\\n      return setTimeout((function() {\\n        return httpSocket._sendQueued();\\n      }), 0);\\n    });\\n  };\\n\\n  WebSocketXhr.prototype.close = function() {\\n    this._sendInProgress = true;\\n    this.readyState = WebSocketXhr.CLOSING;\\n    this._fireEventListeners(\\\"close\\\", {\\n      message: \\\"closing\\\",\\n      wasClean: true\\n    });\\n    return this.readyState = WebSocketXhr.CLOSED;\\n  };\\n\\n  WebSocketXhr.prototype.addEventListener = function(type, listener, useCapture) {\\n    return this._getListeners(type).add(listener, useCapture);\\n  };\\n\\n  WebSocketXhr.prototype.removeEventListener = function(type, listener, useCapture) {\\n    return this._getListeners(type).remove(listener, useCapture);\\n  };\\n\\n  WebSocketXhr.prototype._fireEventListeners = function(type, event) {\\n    if (this.readyState === WebSocketXhr.CLOSED) {\\n      return;\\n    }\\n    event.target = this;\\n    return this._getListeners(type).fire(event);\\n  };\\n\\n  WebSocketXhr.prototype._getListeners = function(type) {\\n    var listeners;\\n    listeners = this._listeners[type];\\n    if (null === listeners) {\\n      throw new Ex(arguments, \\\"invalid event listener type: '\\\" + type + \\\"'\\\");\\n    }\\n    return listeners;\\n  };\\n\\n  WebSocketXhr.prototype._handleXhrResponseError = function(xhr) {\\n    if (xhr.status === 404) {\\n      this.close();\\n      return;\\n    }\\n    this._fireEventListeners(\\\"error\\\", {\\n      target: this,\\n      status: xhr.status,\\n      message: \\\"error from XHR invocation: \\\" + xhr.statusText\\n    });\\n    return Weinre.logError((\\\"error from XHR invocation: \\\" + xhr.status + \\\": \\\") + xhr.statusText);\\n  };\\n\\n  WebSocketXhr.prototype._xhr = function(url, method, data, handler) {\\n    var xhr;\\n    if (null === handler) {\\n      throw new Ex(arguments, \\\"handler must not be null\\\");\\n    }\\n    xhr = (XMLHttpRequest.noConflict ? new XMLHttpRequest.noConflict() : new XMLHttpRequest());\\n    xhr.httpSocket = this;\\n    xhr.httpSocketHandler = handler;\\n    xhr.onreadystatechange = function() {\\n      return _xhrEventHandler(xhr);\\n    };\\n    HookLib.ignoreHooks(function() {\\n      return xhr.open(method, url, true);\\n    });\\n    xhr.setRequestHeader(\\\"Content-Type\\\", \\\"text/plain\\\");\\n    return HookLib.ignoreHooks(function() {\\n      return xhr.send(data);\\n    });\\n  };\\n\\n  return WebSocketXhr;\\n\\n})();\\n\\n_xhrEventHandler = function(xhr) {\\n  if (xhr.readyState !== 4) {\\n    return;\\n  }\\n  return xhr.httpSocketHandler.call(xhr.httpSocket, xhr);\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/WebSocketXhr.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/common/Weinre\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar ConsoleLogger, Ex, IDLTools, StackTrace, Weinre, consoleLogger, getLogger, logger, _notImplemented, _showNotImplemented;\\n\\nEx = require('./Ex');\\n\\nIDLTools = require('./IDLTools');\\n\\nStackTrace = require('./StackTrace');\\n\\n_notImplemented = {};\\n\\n_showNotImplemented = false;\\n\\nlogger = null;\\n\\nmodule.exports = Weinre = (function() {\\n  function Weinre() {\\n    throw new Ex(arguments, \\\"this class is not intended to be instantiated\\\");\\n  }\\n\\n  Weinre.addIDLs = function(idls) {\\n    return IDLTools.addIDLs(idls);\\n  };\\n\\n  Weinre.deprecated = function() {\\n    return StackTrace.dump(arguments);\\n  };\\n\\n  Weinre.notImplemented = function(thing) {\\n    if (_notImplemented[thing]) {\\n      return;\\n    }\\n    _notImplemented[thing] = true;\\n    if (!_showNotImplemented) {\\n      return;\\n    }\\n    return Weinre.logWarning(thing + \\\" not implemented\\\");\\n  };\\n\\n  Weinre.showNotImplemented = function() {\\n    var key, _results;\\n    _showNotImplemented = true;\\n    _results = [];\\n    for (key in _notImplemented) {\\n      _results.push(Weinre.logWarning(key + \\\" not implemented\\\"));\\n    }\\n    return _results;\\n  };\\n\\n  Weinre.logError = function(message) {\\n    return getLogger().logError(message);\\n  };\\n\\n  Weinre.logWarning = function(message) {\\n    return getLogger().logWarning(message);\\n  };\\n\\n  Weinre.logInfo = function(message) {\\n    return getLogger().logInfo(message);\\n  };\\n\\n  Weinre.logDebug = function(message) {\\n    return getLogger().logDebug(message);\\n  };\\n\\n  return Weinre;\\n\\n})();\\n\\nConsoleLogger = (function() {\\n  function ConsoleLogger() {}\\n\\n  ConsoleLogger.prototype.logError = function(message) {\\n    return console.log(\\\"error: \\\" + message);\\n  };\\n\\n  ConsoleLogger.prototype.logWarning = function(message) {\\n    return console.log(\\\"warning: \\\" + message);\\n  };\\n\\n  ConsoleLogger.prototype.logInfo = function(message) {\\n    return console.log(\\\"info: \\\" + message);\\n  };\\n\\n  ConsoleLogger.prototype.logDebug = function(message) {\\n    return console.log(\\\"debug: \\\" + message);\\n  };\\n\\n  return ConsoleLogger;\\n\\n})();\\n\\nconsoleLogger = new ConsoleLogger();\\n\\ngetLogger = function() {\\n  if (logger) {\\n    return logger;\\n  }\\n  if (Weinre.client) {\\n    logger = Weinre.WeinreClientCommands;\\n    return logger;\\n  }\\n  if (Weinre.target) {\\n    logger = Weinre.WeinreTargetCommands;\\n    return logger;\\n  }\\n  return consoleLogger;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/common/Weinre.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/BrowserHacks\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar BrowserHacks;\\n\\nBrowserHacks = function() {\\n  if (typeof document.addEventListener === \\\"undefined\\\") {\\n    alert(\\\"Oops. It seems the page runs in compatibility mode. Please fix it and try again.\\\");\\n    return;\\n  }\\n  if (typeof window.Element === \\\"undefined\\\") {\\n    window.Element = function() {};\\n  }\\n  if (typeof window.Node === \\\"undefined\\\") {\\n    window.Node = function() {};\\n  }\\n  if (!Object.getPrototypeOf) {\\n    Object.getPrototypeOf = function(object) {\\n      if (!object.__proto__) {\\n        throw new Error(\\\"This vm does not support __proto__ and getPrototypeOf. Script requires any of them to operate correctly.\\\");\\n      }\\n      return object.__proto__;\\n    };\\n  }\\n};\\n\\nBrowserHacks();\\n\\n});\\n\\n//@ sourceURL=weinre/target/BrowserHacks.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/CheckForProblems\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar CheckForProblems, checkForOldPrototypeVersion;\\n\\nmodule.exports = CheckForProblems = (function() {\\n  function CheckForProblems() {}\\n\\n  CheckForProblems.check = function() {\\n    return checkForOldPrototypeVersion();\\n  };\\n\\n  return CheckForProblems;\\n\\n})();\\n\\ncheckForOldPrototypeVersion = function() {\\n  var badVersion;\\n  badVersion = false;\\n  if (typeof Prototype === \\\"undefined\\\") {\\n    return;\\n  }\\n  if (!Prototype.Version) {\\n    return;\\n  }\\n  if (Prototype.Version.match(/^1\\\\.5.*/)) {\\n    badVersion = true;\\n  }\\n  if (Prototype.Version.match(/^1\\\\.6.*/)) {\\n    badVersion = true;\\n  }\\n  if (badVersion) {\\n    return alert(\\\"Sorry, weinre is not support in versions of Prototype earlier than 1.7\\\");\\n  }\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/CheckForProblems.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/Console\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Console, MessageLevel, MessageSource, MessageType, OriginalConsole, RemoteConsole, Timeline, UsingRemote, Weinre;\\n\\nWeinre = require('../common/Weinre');\\n\\nTimeline = require('../target/Timeline');\\n\\nUsingRemote = false;\\n\\nRemoteConsole = null;\\n\\nOriginalConsole = null;\\n\\nMessageSource = {\\n  HTML: 0,\\n  WML: 1,\\n  XML: 2,\\n  JS: 3,\\n  CSS: 4,\\n  Other: 5\\n};\\n\\nMessageType = {\\n  Log: 0,\\n  Object: 1,\\n  Trace: 2,\\n  StartGroup: 3,\\n  StartGroupCollapsed: 4,\\n  EndGroup: 5,\\n  Assert: 6,\\n  UncaughtException: 7,\\n  Result: 8\\n};\\n\\nMessageLevel = {\\n  Tip: 0,\\n  Log: 1,\\n  Warning: 2,\\n  Error: 3,\\n  Debug: 4\\n};\\n\\nmodule.exports = Console = (function() {\\n  function Console() {}\\n\\n  Object.defineProperty(Console, 'original', {\\n    get: function() {\\n      return OriginalConsole;\\n    }\\n  });\\n\\n  Console.useRemote = function(value) {\\n    var oldValue;\\n    if (arguments.length === 0) {\\n      return UsingRemote;\\n    }\\n    oldValue = UsingRemote;\\n    UsingRemote = !!value;\\n    if (UsingRemote) {\\n      window.console = RemoteConsole;\\n    } else {\\n      window.console = OriginalConsole;\\n    }\\n    return oldValue;\\n  };\\n\\n  Console.prototype._generic = function(level, messageParts) {\\n    var message, messagePart, parameters, payload, _i, _len;\\n    if (!(messageParts != null ? messageParts.length : void 0)) {\\n      return;\\n    }\\n    message = messageParts[0].toString();\\n    parameters = [];\\n    for (_i = 0, _len = messageParts.length; _i < _len; _i++) {\\n      messagePart = messageParts[_i];\\n      parameters.push(Weinre.injectedScript.wrapObjectForConsole(messagePart, true));\\n    }\\n    payload = {\\n      source: MessageSource.JS,\\n      type: MessageType.Log,\\n      level: level,\\n      message: message,\\n      parameters: parameters\\n    };\\n    return Weinre.wi.ConsoleNotify.addConsoleMessage(payload);\\n  };\\n\\n  Console.prototype.log = function() {\\n    return this._generic(MessageLevel.Log, [].slice.call(arguments));\\n  };\\n\\n  Console.prototype.debug = function() {\\n    return this._generic(MessageLevel.Debug, [].slice.call(arguments));\\n  };\\n\\n  Console.prototype.error = function() {\\n    return this._generic(MessageLevel.Error, [].slice.call(arguments));\\n  };\\n\\n  Console.prototype.info = function() {\\n    return this._generic(MessageLevel.Log, [].slice.call(arguments));\\n  };\\n\\n  Console.prototype.warn = function() {\\n    return this._generic(MessageLevel.Warning, [].slice.call(arguments));\\n  };\\n\\n  Console.prototype.dir = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.dirxml = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.trace = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.assert = function(condition) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.count = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.markTimeline = function(message) {\\n    return Timeline.addRecord_Mark(message);\\n  };\\n\\n  Console.prototype.lastWMLErrorMessage = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.profile = function(title) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.profileEnd = function(title) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.time = function(title) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.timeEnd = function(title) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.group = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.groupCollapsed = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  Console.prototype.groupEnd = function() {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  return Console;\\n\\n})();\\n\\nRemoteConsole = new Console();\\n\\nwindow.consoleforspydebugger = RemoteConsole;\\n\\nOriginalConsole = window.console || {};\\n\\nRemoteConsole.__original = OriginalConsole;\\n\\nOriginalConsole.__original = OriginalConsole;\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/Console.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/CSSStore\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar CSSStore, IDGenerator, Weinre, _elementMatchesSelector, _fallbackMatchesSelector, _getMappableId, _getMappableObject, _mozMatchesSelector, _msMatchesSelector, _webkitMatchesSelector;\\n\\nIDGenerator = require('../common/IDGenerator');\\n\\nWeinre = require('../common/Weinre');\\n\\n_elementMatchesSelector = null;\\n\\nmodule.exports = CSSStore = (function() {\\n  function CSSStore() {\\n    this.styleSheetMap = {};\\n    this.styleRuleMap = {};\\n    this.styleDeclMap = {};\\n    this.testElement = document.createElement(\\\"div\\\");\\n  }\\n\\n  CSSStore.prototype.getInlineStyle = function(node) {\\n    var cssProperty, styleObject, _i, _len, _ref;\\n    styleObject = this._buildMirrorForStyle(node.style, true);\\n    _ref = styleObject.cssProperties;\\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n      cssProperty = _ref[_i];\\n      cssProperty.status = \\\"style\\\";\\n    }\\n    return styleObject;\\n  };\\n\\n  CSSStore.prototype.getComputedStyle = function(node) {\\n    var styleObject;\\n    if (!node) {\\n      return {};\\n    }\\n    if (node.nodeType !== Node.ELEMENT_NODE) {\\n      return {};\\n    }\\n    styleObject = this._buildMirrorForStyle(window.getComputedStyle(node), false);\\n    return styleObject;\\n  };\\n\\n  CSSStore.prototype.getMatchedCSSRules = function(node) {\\n    var cssRule, err, object, result, styleSheet, _i, _j, _len, _len1, _ref, _ref1;\\n    result = [];\\n    try {\\n      _ref = document.styleSheets;\\n      for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n        styleSheet = _ref[_i];\\n        if (!styleSheet.cssRules) {\\n          continue;\\n        }\\n        _ref1 = styleSheet.cssRules;\\n        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {\\n          cssRule = _ref1[_j];\\n          if (!_elementMatchesSelector(node, cssRule.selectorText)) {\\n            continue;\\n          }\\n          object = {};\\n          object.ruleId = this._getStyleRuleId(cssRule);\\n          object.selectorText = cssRule.selectorText;\\n          object.style = this._buildMirrorForStyle(cssRule.style, true);\\n          result.push(object);\\n        }\\n      }\\n    } catch (_error) {\\n      err = _error;\\n      return result;\\n    }\\n    return result;\\n  };\\n\\n  CSSStore.prototype.getStyleAttributes = function(node) {\\n    var result;\\n    result = {};\\n    return result;\\n  };\\n\\n  CSSStore.prototype.getPseudoElements = function(node) {\\n    var result;\\n    result = [];\\n    return result;\\n  };\\n\\n  CSSStore.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite) {\\n    var compare, i, key, mirror, properties, propertyIndices, propertyMirror, styleDecl;\\n    styleDecl = Weinre.cssStore._getStyleDecl(styleId);\\n    if (!styleDecl) {\\n      Weinre.logWarning(\\\"requested style not available: \\\" + styleId);\\n      return null;\\n    }\\n    mirror = styleDecl.__weinre__mirror;\\n    if (!mirror) {\\n      Weinre.logWarning(\\\"requested mirror not available: \\\" + styleId);\\n      return null;\\n    }\\n    properties = mirror.cssProperties;\\n    propertyMirror = this._parseProperty(text);\\n    if (null === propertyMirror) {\\n      this._removePropertyFromMirror(mirror, propertyIndex);\\n      properties = mirror.cssProperties;\\n    } else {\\n      this._removePropertyFromMirror(mirror, propertyIndex);\\n      properties = mirror.cssProperties;\\n      propertyIndices = {};\\n      i = 0;\\n      while (i < properties.length) {\\n        propertyIndices[properties[i].name] = i;\\n        i++;\\n      }\\n      i = 0;\\n      while (i < propertyMirror.cssProperties.length) {\\n        if (propertyIndices[propertyMirror.cssProperties[i].name] != null) {\\n          properties[propertyIndices[propertyMirror.cssProperties[i].name]] = propertyMirror.cssProperties[i];\\n        } else {\\n          properties.push(propertyMirror.cssProperties[i]);\\n        }\\n        i++;\\n      }\\n      for (key in propertyMirror.shorthandValues) {\\n        mirror.shorthandValues[key] = propertyMirror.shorthandValues[key];\\n      }\\n    }\\n    properties.sort(compare = function(p1, p2) {\\n      if (p1.name < p2.name) {\\n        return -1;\\n      } else if (p1.name > p2.name) {\\n        return 1;\\n      } else {\\n        return 0;\\n      }\\n    });\\n    this._setStyleFromMirror(styleDecl);\\n    return mirror;\\n  };\\n\\n  CSSStore.prototype._removePropertyFromMirror = function(mirror, index) {\\n    var i, newProperties, properties, property;\\n    properties = mirror.cssProperties;\\n    if (index >= properties.length) {\\n      return;\\n    }\\n    property = properties[index];\\n    properties[index] = null;\\n    if (mirror.shorthandValues[property.name]) {\\n      delete mirror.shorthandValues[property.name];\\n      i = 0;\\n      while (i < properties.length) {\\n        if (properties[i]) {\\n          if (properties[i].shorthandName === property.name) {\\n            properties[i] = null;\\n          }\\n        }\\n        i++;\\n      }\\n    }\\n    newProperties = [];\\n    i = 0;\\n    while (i < properties.length) {\\n      if (properties[i]) {\\n        newProperties.push(properties[i]);\\n      }\\n      i++;\\n    }\\n    return mirror.cssProperties = newProperties;\\n  };\\n\\n  CSSStore.prototype.toggleProperty = function(styleId, propertyIndex, disable) {\\n    var cssProperty, mirror, styleDecl;\\n    styleDecl = Weinre.cssStore._getStyleDecl(styleId);\\n    if (!styleDecl) {\\n      Weinre.logWarning(\\\"requested style not available: \\\" + styleId);\\n      return null;\\n    }\\n    mirror = styleDecl.__weinre__mirror;\\n    if (!mirror) {\\n      Weinre.logWarning(\\\"requested mirror not available: \\\" + styleId);\\n      return null;\\n    }\\n    cssProperty = mirror.cssProperties[propertyIndex];\\n    if (!cssProperty) {\\n      Weinre.logWarning((\\\"requested property not available: \\\" + styleId + \\\": \\\") + propertyIndex);\\n      return null;\\n    }\\n    if (disable) {\\n      cssProperty.status = \\\"disabled\\\";\\n    } else {\\n      cssProperty.status = \\\"active\\\";\\n    }\\n    this._setStyleFromMirror(styleDecl);\\n    return mirror;\\n  };\\n\\n  CSSStore.prototype._setStyleFromMirror = function(styleDecl) {\\n    var cssProperties, cssText, property, _i, _len;\\n    cssText = [];\\n    cssProperties = styleDecl.__weinre__mirror.cssProperties;\\n    cssText = \\\"\\\";\\n    for (_i = 0, _len = cssProperties.length; _i < _len; _i++) {\\n      property = cssProperties[_i];\\n      if (!property.parsedOk) {\\n        continue;\\n      }\\n      if (property.status === \\\"disabled\\\") {\\n        continue;\\n      }\\n      if (property.shorthandName) {\\n        continue;\\n      }\\n      cssText += property.name + \\\": \\\" + property.value;\\n      if (property.priority === \\\"important\\\") {\\n        cssText += \\\" !important; \\\";\\n      } else {\\n        cssText += \\\"; \\\";\\n      }\\n    }\\n    return styleDecl.cssText = cssText;\\n  };\\n\\n  CSSStore.prototype._buildMirrorForStyle = function(styleDecl, bind) {\\n    var i, name, properties, property, result, shorthandName;\\n    result = {\\n      properties: {},\\n      cssProperties: []\\n    };\\n    if (!styleDecl) {\\n      return result;\\n    }\\n    if (bind) {\\n      result.styleId = this._getStyleDeclId(styleDecl);\\n      styleDecl.__weinre__mirror = result;\\n    }\\n    result.properties.width = styleDecl.getPropertyValue(\\\"width\\\") || \\\"\\\";\\n    result.properties.height = styleDecl.getPropertyValue(\\\"height\\\") || \\\"\\\";\\n    result.cssText = styleDecl.cssText;\\n    result.shorthandValues = {};\\n    properties = [];\\n    if (styleDecl) {\\n      i = 0;\\n      while (i < styleDecl.length) {\\n        property = {};\\n        name = styleDecl.item(i);\\n        property.name = name;\\n        property.priority = styleDecl.getPropertyPriority(name);\\n        property.implicit = typeof styleDecl.isPropertyImplicit !== \\\"undefined\\\" ? styleDecl.isPropertyImplicit(name) : true;\\n        property.shorthandName = typeof styleDecl.getPropertyShorthand !== \\\"undefined\\\" ? styleDecl.getPropertyShorthand(name) || \\\"\\\" : \\\"\\\";\\n        property.status = (property.shorthandName ? \\\"style\\\" : \\\"active\\\");\\n        property.parsedOk = true;\\n        property.value = styleDecl.getPropertyValue(name);\\n        properties.push(property);\\n        if (property.shorthandName) {\\n          shorthandName = property.shorthandName;\\n          if (!result.shorthandValues[shorthandName]) {\\n            result.shorthandValues[shorthandName] = styleDecl.getPropertyValue(shorthandName);\\n            property = {};\\n            property.name = shorthandName;\\n            property.priority = styleDecl.getPropertyPriority(shorthandName);\\n            property.implicit = styleDecl.isPropertyImplicit(shorthandName);\\n            property.shorthandName = \\\"\\\";\\n            property.status = \\\"active\\\";\\n            property.parsedOk = true;\\n            property.value = styleDecl.getPropertyValue(name);\\n            properties.push(property);\\n          }\\n        }\\n        i++;\\n      }\\n    }\\n    properties.sort(function(p1, p2) {\\n      if (p1.name < p2.name) {\\n        return -1;\\n      } else if (p1.name > p2.name) {\\n        return 1;\\n      } else {\\n        return 0;\\n      }\\n    });\\n    result.cssProperties = properties;\\n    return result;\\n  };\\n\\n  CSSStore.prototype._parseProperty = function(string) {\\n    var match, property, propertyPattern, result, testStyleDecl;\\n    testStyleDecl = this.testElement.style;\\n    try {\\n      testStyleDecl.cssText = string;\\n      if (testStyleDecl.cssText !== \\\"\\\") {\\n        return this._buildMirrorForStyle(testStyleDecl, false);\\n      }\\n    } catch (_error) {}\\n    propertyPattern = /\\\\s*(.+)\\\\s*:\\\\s*(.+)\\\\s*(!important)?\\\\s*;/;\\n    match = propertyPattern.exec(string);\\n    if (!match) {\\n      return null;\\n    }\\n    match[3] = (match[3] === \\\"!important\\\" ? \\\"important\\\" : \\\"\\\");\\n    property = {};\\n    property.name = match[1];\\n    property.priority = match[3];\\n    property.implicit = true;\\n    property.shorthandName = \\\"\\\";\\n    property.status = \\\"inactive\\\";\\n    property.parsedOk = false;\\n    property.value = match[2];\\n    result = {};\\n    result.width = 0;\\n    result.height = 0;\\n    result.shorthandValues = 0;\\n    result.cssProperties = [property];\\n    return result;\\n  };\\n\\n  CSSStore.prototype._getStyleSheet = function(id) {\\n    return _getMappableObject(id, this.styleSheetMap);\\n  };\\n\\n  CSSStore.prototype._getStyleSheetId = function(styleSheet) {\\n    return _getMappableId(styleSheet, this.styleSheetMap);\\n  };\\n\\n  CSSStore.prototype._getStyleRule = function(id) {\\n    return _getMappableObject(id, this.styleRuleMap);\\n  };\\n\\n  CSSStore.prototype._getStyleRuleId = function(styleRule) {\\n    return _getMappableId(styleRule, this.styleRuleMap);\\n  };\\n\\n  CSSStore.prototype._getStyleDecl = function(id) {\\n    return _getMappableObject(id, this.styleDeclMap);\\n  };\\n\\n  CSSStore.prototype._getStyleDeclId = function(styleDecl) {\\n    return _getMappableId(styleDecl, this.styleDeclMap);\\n  };\\n\\n  return CSSStore;\\n\\n})();\\n\\n_getMappableObject = function(id, map) {\\n  return map[id];\\n};\\n\\n_getMappableId = function(object, map) {\\n  return IDGenerator.getId(object, map);\\n};\\n\\n_mozMatchesSelector = function(element, selector) {\\n  if (!element.mozMatchesSelector) {\\n    return false;\\n  }\\n  return element.mozMatchesSelector(selector);\\n};\\n\\n_webkitMatchesSelector = function(element, selector) {\\n  if (!element.webkitMatchesSelector) {\\n    return false;\\n  }\\n  return element.webkitMatchesSelector(selector);\\n};\\n\\n_msMatchesSelector = function(element, selector) {\\n  if (!element.msMatchesSelector) {\\n    return false;\\n  }\\n  return element.msMatchesSelector(selector);\\n};\\n\\n_fallbackMatchesSelector = function(element, selector) {\\n  return false;\\n};\\n\\nif (Element.prototype.webkitMatchesSelector) {\\n  _elementMatchesSelector = _webkitMatchesSelector;\\n} else if (Element.prototype.mozMatchesSelector) {\\n  _elementMatchesSelector = _mozMatchesSelector;\\n} else if (Element.prototype.msMatchesSelector) {\\n  _elementMatchesSelector = _msMatchesSelector;\\n} else {\\n  _elementMatchesSelector = _fallbackMatchesSelector;\\n}\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/CSSStore.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/ElementHighlighter\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar ElementHighlighter, canvasAvailable, currentHighlighterElement, fromPx, getMetricsForElement, highlighterClass, supportsCanvas;\\n\\ncanvasAvailable = null;\\n\\nhighlighterClass = null;\\n\\ncurrentHighlighterElement = null;\\n\\nmodule.exports = ElementHighlighter = (function() {\\n  ElementHighlighter.create = function() {\\n    if (highlighterClass == null) {\\n      highlighterClass = require('./ElementHighlighterDivs2');\\n    }\\n    return new highlighterClass();\\n  };\\n\\n  function ElementHighlighter() {\\n    this.hElement = this.createHighlighterElement();\\n    this.hElement.__weinreHighlighter = true;\\n    this.hElement.style.display = \\\"none\\\";\\n    this.hElement.style.zIndex = 10 * 1000 * 1000;\\n    if (currentHighlighterElement) {\\n      document.body.removeChild(currentHighlighterElement);\\n    }\\n    currentHighlighterElement = this.hElement;\\n    document.body.appendChild(this.hElement);\\n  }\\n\\n  ElementHighlighter.prototype.on = function(element) {\\n    if (null === element) {\\n      return;\\n    }\\n    if (element.nodeType !== Node.ELEMENT_NODE) {\\n      return;\\n    }\\n    this.redraw(getMetricsForElement(element));\\n    return this.hElement.style.display = \\\"block\\\";\\n  };\\n\\n  ElementHighlighter.prototype.off = function() {\\n    return this.hElement.style.display = \\\"none\\\";\\n  };\\n\\n  return ElementHighlighter;\\n\\n})();\\n\\ngetMetricsForElement = function(element) {\\n  var cStyle, el, left, metrics, top;\\n  metrics = {};\\n  left = 0;\\n  top = 0;\\n  el = element;\\n  while (true) {\\n    left += el.offsetLeft;\\n    top += el.offsetTop;\\n    if (!(el = el.offsetParent)) {\\n      break;\\n    }\\n  }\\n  metrics.x = left;\\n  metrics.y = top;\\n  cStyle = document.defaultView.getComputedStyle(element);\\n  metrics.width = element.offsetWidth;\\n  metrics.height = element.offsetHeight;\\n  metrics.marginLeft = fromPx(cStyle[\\\"margin-left\\\"] || cStyle[\\\"marginLeft\\\"]);\\n  metrics.marginRight = fromPx(cStyle[\\\"margin-right\\\"] || cStyle[\\\"marginRight\\\"]);\\n  metrics.marginTop = fromPx(cStyle[\\\"margin-top\\\"] || cStyle[\\\"marginTop\\\"]);\\n  metrics.marginBottom = fromPx(cStyle[\\\"margin-bottom\\\"] || cStyle[\\\"marginBottom\\\"]);\\n  metrics.borderLeft = fromPx(cStyle[\\\"border-left-width\\\"] || cStyle[\\\"borderLeftWidth\\\"]);\\n  metrics.borderRight = fromPx(cStyle[\\\"border-right-width\\\"] || cStyle[\\\"borderRightWidth\\\"]);\\n  metrics.borderTop = fromPx(cStyle[\\\"border-top-width\\\"] || cStyle[\\\"borderTopWidth\\\"]);\\n  metrics.borderBottom = fromPx(cStyle[\\\"border-bottom-width\\\"] || cStyle[\\\"borderBottomWidth\\\"]);\\n  metrics.paddingLeft = fromPx(cStyle[\\\"padding-left\\\"] || cStyle[\\\"paddingLeft\\\"]);\\n  metrics.paddingRight = fromPx(cStyle[\\\"padding-right\\\"] || cStyle[\\\"paddingRight\\\"]);\\n  metrics.paddingTop = fromPx(cStyle[\\\"padding-top\\\"] || cStyle[\\\"paddingTop\\\"]);\\n  metrics.paddingBottom = fromPx(cStyle[\\\"padding-bottom\\\"] || cStyle[\\\"paddingBottom\\\"]);\\n  metrics.x -= metrics.marginLeft;\\n  metrics.y -= metrics.marginTop;\\n  return metrics;\\n};\\n\\nfromPx = function(string) {\\n  return parseInt(string.replace(/px$/, \\\"\\\"));\\n};\\n\\nsupportsCanvas = function() {\\n  var element;\\n  element = document.createElement('canvas');\\n  if (!element.getContext) {\\n    return false;\\n  }\\n  if (element.getContext('2d')) {\\n    return true;\\n  }\\n  return false;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/ElementHighlighter.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/ElementHighlighterDivs2\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar ColorBorder, ColorContent, ColorMargin, ColorPadding, ElementHighlighter, ElementHighlighterDivs2, px,\\n  __hasProp = {}.hasOwnProperty,\\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\\n\\nElementHighlighter = require('./ElementHighlighter');\\n\\nColorMargin = 'rgba(246, 178, 107, 0.66)';\\n\\nColorBorder = 'rgba(255, 229, 153, 0.66)';\\n\\nColorPadding = 'rgba(147, 196, 125, 0.55)';\\n\\nColorContent = 'rgba(111, 168, 220, 0.66)';\\n\\nColorBorder = 'rgba(255, 255, 153, 0.40)';\\n\\nColorPadding = 'rgba(  0, 255,   0, 0.20)';\\n\\nColorContent = 'rgba(  0,   0, 255, 0.30)';\\n\\nmodule.exports = ElementHighlighterDivs2 = (function(_super) {\\n  __extends(ElementHighlighterDivs2, _super);\\n\\n  function ElementHighlighterDivs2() {\\n    return ElementHighlighterDivs2.__super__.constructor.apply(this, arguments);\\n  }\\n\\n  ElementHighlighterDivs2.prototype.createHighlighterElement = function() {\\n    this.hElement1 = document.createElement(\\\"weinreHighlighter\\\");\\n    this.hElement1.style.position = 'absolute';\\n    this.hElement1.style.overflow = 'hidden';\\n    this.hElement2 = document.createElement(\\\"weinreHighlighter\\\");\\n    this.hElement2.style.position = 'absolute';\\n    this.hElement2.style.display = 'block';\\n    this.hElement2.style.overflow = 'hidden';\\n    this.hElement1.appendChild(this.hElement2);\\n    this.hElement1.style.borderTopStyle = 'solid';\\n    this.hElement1.style.borderLeftStyle = 'solid';\\n    this.hElement1.style.borderBottomStyle = 'solid';\\n    this.hElement1.style.borderRightStyle = 'solid';\\n    this.hElement1.style.borderTopColor = ColorMargin;\\n    this.hElement1.style.borderLeftColor = ColorMargin;\\n    this.hElement1.style.borderBottomColor = ColorMargin;\\n    this.hElement1.style.borderRightColor = ColorMargin;\\n    this.hElement1.style.backgroundColor = ColorBorder;\\n    this.hElement2.style.borderTopStyle = 'solid';\\n    this.hElement2.style.borderLeftStyle = 'solid';\\n    this.hElement2.style.borderBottomStyle = 'solid';\\n    this.hElement2.style.borderRightStyle = 'solid';\\n    this.hElement2.style.borderTopColor = ColorPadding;\\n    this.hElement2.style.borderLeftColor = ColorPadding;\\n    this.hElement2.style.borderBottomColor = ColorPadding;\\n    this.hElement2.style.borderRightColor = ColorPadding;\\n    this.hElement2.style.backgroundColor = ColorContent;\\n    this.hElement1.style.outline = 'black solid thin';\\n    return this.hElement1;\\n  };\\n\\n  ElementHighlighterDivs2.prototype.redraw = function(metrics) {\\n    this.hElement1.style.top = px(metrics.y);\\n    this.hElement1.style.left = px(metrics.x);\\n    this.hElement1.style.height = px(metrics.height);\\n    this.hElement1.style.width = px(metrics.width);\\n    this.hElement1.style.borderTopWidth = px(metrics.marginTop);\\n    this.hElement1.style.borderLeftWidth = px(metrics.marginLeft);\\n    this.hElement1.style.borderBottomWidth = px(metrics.marginBottom);\\n    this.hElement1.style.borderRightWidth = px(metrics.marginRight);\\n    this.hElement2.style.top = px(metrics.borderTop);\\n    this.hElement2.style.left = px(metrics.borderLeft);\\n    this.hElement2.style.bottom = px(metrics.borderBottom);\\n    this.hElement2.style.right = px(metrics.borderRight);\\n    this.hElement2.style.borderTopWidth = px(metrics.paddingTop);\\n    this.hElement2.style.borderLeftWidth = px(metrics.paddingLeft);\\n    this.hElement2.style.borderBottomWidth = px(metrics.paddingBottom);\\n    return this.hElement2.style.borderRightWidth = px(metrics.paddingRight);\\n  };\\n\\n  return ElementHighlighterDivs2;\\n\\n})(ElementHighlighter);\\n\\npx = function(value) {\\n  return \\\"\\\" + value + \\\"px\\\";\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/ElementHighlighterDivs2.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/HookSites\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar HookLib, HookSites;\\n\\nHookLib = require('../common/HookLib');\\n\\nmodule.exports = HookSites = (function() {\\n  function HookSites() {}\\n\\n  return HookSites;\\n\\n})();\\n\\nHookSites.window_clearInterval = HookLib.addHookSite(window, \\\"clearInterval\\\");\\n\\nHookSites.window_clearTimeout = HookLib.addHookSite(window, \\\"clearTimeout\\\");\\n\\nHookSites.window_setInterval = HookLib.addHookSite(window, \\\"setInterval\\\");\\n\\nHookSites.window_setTimeout = HookLib.addHookSite(window, \\\"setTimeout\\\");\\n\\nHookSites.window_addEventListener = HookLib.addHookSite(window, \\\"addEventListener\\\");\\n\\nHookSites.Node_addEventListener = HookLib.addHookSite(Node.prototype, \\\"addEventListener\\\");\\n\\nHookSites.XMLHttpRequest_open = HookLib.addHookSite(XMLHttpRequest.prototype, \\\"open\\\");\\n\\nHookSites.XMLHttpRequest_send = HookLib.addHookSite(XMLHttpRequest.prototype, \\\"send\\\");\\n\\nHookSites.XMLHttpRequest_addEventListener = HookLib.addHookSite(XMLHttpRequest.prototype, \\\"addEventListener\\\");\\n\\nif (window.openDatabase) {\\n  HookSites.window_openDatabase = HookLib.addHookSite(window, \\\"openDatabase\\\");\\n}\\n\\nif (window.localStorage) {\\n  HookSites.LocalStorage_setItem = HookLib.addHookSite(window.localStorage, \\\"setItem\\\");\\n  HookSites.LocalStorage_removeItem = HookLib.addHookSite(window.localStorage, \\\"removeItem\\\");\\n  HookSites.LocalStorage_clear = HookLib.addHookSite(window.localStorage, \\\"clear\\\");\\n}\\n\\nif (window.sessionStorage) {\\n  HookSites.SessionStorage_setItem = HookLib.addHookSite(window.sessionStorage, \\\"setItem\\\");\\n  HookSites.SessionStorage_removeItem = HookLib.addHookSite(window.sessionStorage, \\\"removeItem\\\");\\n  HookSites.SessionStorage_clear = HookLib.addHookSite(window.sessionStorage, \\\"clear\\\");\\n}\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/HookSites.amd.js\")\n;eval(\"var injectedScriptConstructor = \\n/*\\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\\n *\\n * Redistribution and use in source and binary forms, with or without\\n * modification, are permitted provided that the following conditions\\n * are met:\\n *\\n * 1.  Redistributions of source code must retain the above copyright\\n *     notice, this list of conditions and the following disclaimer.\\n * 2.  Redistributions in binary form must reproduce the above copyright\\n *     notice, this list of conditions and the following disclaimer in the\\n *     documentation and/or other materials provided with the distribution.\\n * 3.  Neither the name of Apple Computer, Inc. (\\\"Apple\\\") nor the names of\\n *     its contributors may be used to endorse or promote products derived\\n *     from this software without specific prior written permission.\\n *\\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \\\"AS IS\\\" AND ANY\\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n */\\n\\n(function (InjectedScriptHost, inspectedWindow, injectedScriptId) {\\n\\nfunction bind(thisObject, memberFunction)\\n{\\n    var func = memberFunction;\\n    var args = Array.prototype.slice.call(arguments, 2);\\n    function bound()\\n    {\\n        return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0)));\\n    }\\n    bound.toString = function() {\\n        return \\\"bound: \\\" + func;\\n    };\\n    return bound;\\n}\\n\\nvar InjectedScript = function()\\n{\\n    this._lastBoundObjectId = 1;\\n    this._idToWrappedObject = {};\\n    this._objectGroups = {};\\n}\\n\\nInjectedScript.prototype = {\\n    wrapObjectForConsole: function(object, canAccessInspectedWindow)\\n    {\\n        if (canAccessInspectedWindow)\\n            return this._wrapObject(object, \\\"console\\\");\\n        var result = {};\\n        result.type = typeof object;\\n        result.description = this._toString(object);\\n        return result;\\n    },\\n\\n    _wrapObject: function(object, objectGroupName, abbreviate)\\n    {\\n        try {\\n            var objectId;\\n            if (typeof object === \\\"object\\\" || typeof object === \\\"function\\\" || this._isHTMLAllCollection(object)) {\\n                var id = this._lastBoundObjectId++;\\n                this._idToWrappedObject[id] = object;\\n    \\n                var group = this._objectGroups[objectGroupName];\\n                if (!group) {\\n                    group = [];\\n                    this._objectGroups[objectGroupName] = group;\\n                }\\n                group.push(id);\\n                objectId = { injectedScriptId: injectedScriptId,\\n                             id: id,\\n                             groupName: objectGroupName };\\n            }\\n            return InjectedScript.RemoteObject.fromObject(object, objectId, abbreviate);\\n        } catch (e) {\\n            return InjectedScript.RemoteObject.fromObject(\\\"[ Exception: \\\" + e.toString() + \\\" ]\\\");\\n        }\\n    },\\n\\n    _parseObjectId: function(objectId)\\n    {\\n        return eval(\\\"(\\\" + objectId + \\\")\\\");\\n    },\\n\\n    releaseWrapperObjectGroup: function(objectGroupName)\\n    {\\n        var group = this._objectGroups[objectGroupName];\\n        if (!group)\\n            return;\\n        for (var i = 0; i < group.length; i++)\\n            delete this._idToWrappedObject[group[i]];\\n        delete this._objectGroups[objectGroupName];\\n    },\\n\\n    dispatch: function(methodName, args)\\n    {\\n        var argsArray = eval(\\\"(\\\" + args + \\\")\\\");\\n        var result = this[methodName].apply(this, argsArray);\\n        if (typeof result === \\\"undefined\\\") {\\n            inspectedWindow.console.error(\\\"Web Inspector error: InjectedScript.%s returns undefined\\\", methodName);\\n            result = null;\\n        }\\n        return result;\\n    },\\n\\n    getProperties: function(objectId, ignoreHasOwnProperty, abbreviate)\\n    {\\n        var parsedObjectId = this._parseObjectId(objectId);\\n        var object = this._objectForId(parsedObjectId);\\n\\n        if (!this._isDefined(object))\\n            return false;\\n        var properties = [];\\n        var propertyNames;\\n\\n        // IE returns 'Invalid calling object' for some of the prototypes, so return the object itself\\n        if (window.navigator.userAgent.indexOf(\\\"MSIE\\\") != -1 ) {\\n            propertyNames = this._getPropertyNames(object);\\n        } else\\n            propertyNames = ignoreHasOwnProperty ? this._getPropertyNames(object) : Object.getOwnPropertyNames(object);\\n\\n\\n        if (!ignoreHasOwnProperty && object.__proto__)\\n            propertyNames.push(\\\"__proto__\\\");\\n    \\n        // Go over properties, prepare results.\\n        for (var i = 0; i < propertyNames.length; ++i) {\\n            var propertyName = propertyNames[i];\\n    \\n            var property = {};\\n            property.name = propertyName + \\\"\\\";\\n            var isGetter = object[\\\"__lookupGetter__\\\"] && object.__lookupGetter__(propertyName);\\n            if (!isGetter) {\\n                try {\\n                    property.value = this._wrapObject(object[propertyName], parsedObjectId.groupName, abbreviate);\\n                } catch(e) {\\n                    property.value = new InjectedScript.RemoteObject.fromException(e);\\n                }\\n            } else {\\n                // FIXME: this should show something like \\\"getter\\\" (bug 16734).\\n                property.value = new InjectedScript.RemoteObject.fromObject(\\\"\\\\u2014\\\"); // em dash\\n                property.isGetter = true;\\n            }\\n            properties.push(property);\\n        }\\n        return properties;\\n    },\\n\\n    setPropertyValue: function(objectId, propertyName, expression)\\n    {\\n        var parsedObjectId = this._parseObjectId(objectId);\\n        var object = this._objectForId(parsedObjectId);\\n        if (!this._isDefined(object))\\n            return false;\\n    \\n        var expressionLength = expression.length;\\n        if (!expressionLength) {\\n            delete object[propertyName];\\n            return !(propertyName in object);\\n        }\\n    \\n        try {\\n            // Surround the expression in parenthesis so the result of the eval is the result\\n            // of the whole expression not the last potential sub-expression.\\n    \\n            // There is a regression introduced here: eval is now happening against global object,\\n            // not call frame while on a breakpoint.\\n            // TODO: bring evaluation against call frame back.\\n            var result = inspectedWindow.eval(\\\"(\\\" + expression + \\\")\\\");\\n            // Store the result in the property.\\n            object[propertyName] = result;\\n            return true;\\n        } catch(e) {\\n            try {\\n                var result = inspectedWindow.eval(\\\"\\\\\\\"\\\" + expression.replace(/\\\"/g, \\\"\\\\\\\\\\\\\\\"\\\") + \\\"\\\\\\\"\\\");\\n                object[propertyName] = result;\\n                return true;\\n            } catch(e) {\\n                return false;\\n            }\\n        }\\n    },\\n\\n    _populatePropertyNames: function(object, resultSet)\\n    {\\n        for (var o = object; o; o = Object.getPrototypeOf(o)) {\\n            try {\\n                var names = Object.getOwnPropertyNames(o);\\n                for (var i = 0; i < names.length; ++i)\\n                    resultSet[names[i]] = true;\\n            } catch (e) {\\n            }\\n        }\\n    },\\n\\n    _getPropertyNames: function(object, resultSet)\\n    {\\n        var propertyNameSet = {};\\n        this._populatePropertyNames(object, propertyNameSet);\\n        return Object.keys(propertyNameSet);\\n    },\\n\\n    getCompletions: function(expression, includeCommandLineAPI)\\n    {\\n        var props = {};\\n        try {\\n            if (!expression)\\n                expression = \\\"this\\\";\\n            var expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false, false);\\n\\n            if (typeof expressionResult === \\\"object\\\")\\n                this._populatePropertyNames(expressionResult, props);\\n\\n            if (includeCommandLineAPI) {\\n                for (var prop in CommandLineAPI.members_)\\n                    props[CommandLineAPI.members_[prop]] = true;\\n            }\\n        } catch(e) {\\n        }\\n        return props;\\n    },\\n\\n    getCompletionsOnCallFrame: function(callFrameId, expression, includeCommandLineAPI)\\n    {\\n        var props = {};\\n        try {\\n            var callFrame = this._callFrameForId(callFrameId);\\n            if (!callFrame)\\n                return props;\\n\\n            if (expression) {\\n                var expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true, false);\\n                if (typeof expressionResult === \\\"object\\\")\\n                    this._populatePropertyNames(expressionResult, props);\\n            } else {\\n                // Evaluate into properties in scope of the selected call frame.\\n                var scopeChain = callFrame.scopeChain;\\n                for (var i = 0; i < scopeChain.length; ++i)\\n                    this._populatePropertyNames(scopeChain[i], props);\\n            }\\n    \\n            if (includeCommandLineAPI) {\\n                for (var prop in CommandLineAPI.members_)\\n                    props[CommandLineAPI.members_[prop]] = true;\\n            }\\n        } catch(e) {\\n        }\\n        return props;\\n    },\\n\\n    evaluate: function(expression, objectGroup, injectCommandLineAPI)\\n    {\\n        return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup, false, injectCommandLineAPI);\\n    },\\n\\n    _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame, injectCommandLineAPI)\\n    {\\n        try {\\n            return this._wrapObject(this._evaluateOn(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI), objectGroup);\\n        } catch (e) {\\n            return InjectedScript.RemoteObject.fromException(e);\\n        }\\n    },\\n\\n    _evaluateOn: function(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI)\\n    {\\n        // Only install command line api object for the time of evaluation.\\n        // Surround the expression in with statements to inject our command line API so that\\n        // the window object properties still take more precedent than our API functions.\\n\\n        try {\\n            if (injectCommandLineAPI && inspectedWindow.console) {\\n                inspectedWindow.console._commandLineAPI = new CommandLineAPI(this._commandLineAPIImpl, isEvalOnCallFrame ? object : null);\\n                expression = \\\"with ((window && window.console && window.console._commandLineAPI) || {}) {\\\\n\\\" + expression + \\\"\\\\n}\\\";\\n            }\\n\\n            var value = evalFunction.call(object, expression);\\n\\n            // When evaluating on call frame error is not thrown, but returned as a value.\\n            if (this._type(value) === \\\"error\\\")\\n                throw value.toString();\\n\\n            return value;\\n        } finally {\\n            if (injectCommandLineAPI && inspectedWindow.console)\\n                delete inspectedWindow.console._commandLineAPI;\\n        }\\n    },\\n\\n    getNodeId: function(node)\\n    {\\n        return InjectedScriptHost.pushNodePathToFrontend(node, false, false);\\n    },\\n\\n    callFrames: function()\\n    {\\n        var callFrame = InjectedScriptHost.currentCallFrame();\\n        if (!callFrame)\\n            return false;\\n    \\n        injectedScript.releaseWrapperObjectGroup(\\\"backtrace\\\");\\n        var result = [];\\n        var depth = 0;\\n        do {\\n            result.push(new InjectedScript.CallFrameProxy(depth++, callFrame));\\n            callFrame = callFrame.caller;\\n        } while (callFrame);\\n        return result;\\n    },\\n\\n    evaluateOnCallFrame: function(callFrameId, expression, objectGroup, injectCommandLineAPI)\\n    {\\n        var callFrame = this._callFrameForId(callFrameId);\\n        if (!callFrame)\\n            return false;\\n        return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI);\\n    },\\n\\n    _callFrameForId: function(callFrameId)\\n    {\\n        var parsedCallFrameId = eval(\\\"(\\\" + callFrameId + \\\")\\\");\\n        var ordinal = parsedCallFrameId.ordinal;\\n        var callFrame = InjectedScriptHost.currentCallFrame();\\n        while (--ordinal >= 0 && callFrame)\\n            callFrame = callFrame.caller;\\n        return callFrame;\\n    },\\n\\n    _nodeForId: function(nodeId)\\n    {\\n        if (!nodeId)\\n            return null;\\n        return InjectedScriptHost.nodeForId(nodeId);\\n    },\\n\\n    _objectForId: function(objectId)\\n    {\\n        return this._idToWrappedObject[objectId.id];\\n    },\\n\\n    resolveNode: function(nodeId)\\n    {\\n        var node = this._nodeForId(nodeId);\\n        if (!node)\\n            return false;\\n        // FIXME: receive the object group from client.\\n        return this._wrapObject(node, \\\"prototype\\\");\\n    },\\n\\n    getNodeProperties: function(nodeId, properties)\\n    {\\n        var node = this._nodeForId(nodeId);\\n        if (!node)\\n            return false;\\n        properties = eval(\\\"(\\\" + properties + \\\")\\\");\\n        var result = {};\\n        for (var i = 0; i < properties.length; ++i)\\n            result[properties[i]] = node[properties[i]];\\n        return result;\\n    },\\n\\n    getNodePrototypes: function(nodeId)\\n    {\\n        this.releaseWrapperObjectGroup(\\\"prototypes\\\");\\n        var node = this._nodeForId(nodeId);\\n        if (!node)\\n            return false;\\n\\n        var result = [];\\n        var prototype = node;\\n\\n//        if (window.navigator.userAgent.indexOf(\\\"MSIE\\\") != -1 )\\n//        {\\n//            result.push(this._wrapObject(prototype, \\\"prototypes\\\"));\\n//            return result;\\n//        }\\n\\n        do {\\n            result.push(this._wrapObject(prototype, \\\"prototypes\\\"));\\n            prototype = Object.getPrototypeOf(prototype);\\n        } while (prototype)\\n        return result;\\n    },\\n\\n    pushNodeToFrontend: function(objectId)\\n    {\\n        var parsedObjectId = this._parseObjectId(objectId);\\n        var object = this._objectForId(parsedObjectId);\\n        if (!object || this._type(object) !== \\\"node\\\")\\n            return false;\\n        return InjectedScriptHost.pushNodePathToFrontend(object, false, false);\\n    },\\n\\n    evaluateOnSelf: function(funcBody, args)\\n    {\\n        var func = eval(\\\"(\\\" + funcBody + \\\")\\\");\\n        return func.apply(this, eval(\\\"(\\\" + args + \\\")\\\") || []);\\n    },\\n\\n    _isDefined: function(object)\\n    {\\n        return object || this._isHTMLAllCollection(object);\\n    },\\n\\n    _isHTMLAllCollection: function(object)\\n    {\\n        // document.all is reported as undefined, but we still want to process it.\\n        return (typeof object === \\\"undefined\\\") && inspectedWindow.HTMLAllCollection && object instanceof inspectedWindow.HTMLAllCollection;\\n    },\\n\\n    _type: function(obj)\\n    {\\n        if (obj === null)\\n            return \\\"null\\\";\\n\\n        var type = typeof obj;\\n        if (type !== \\\"object\\\" && type !== \\\"function\\\") {\\n            // FIXME(33716): typeof document.all is always 'undefined'.\\n            if (this._isHTMLAllCollection(obj))\\n                return \\\"array\\\";\\n            return type;\\n        }\\n\\n        // If owning frame has navigated to somewhere else window properties will be undefined.\\n        // In this case just return result of the typeof.\\n        if (!inspectedWindow.document)\\n            return type;\\n\\n        if (obj instanceof inspectedWindow.Node) {\\n\\n            try {\\n                return (obj.nodeType === undefined ? type : \\\"node\\\");\\n            } catch (ex) {} // for IE there could be 'Invalid calling object' exception\\n\\n            return obj.toString();\\n        }\\n\\n        if (obj instanceof inspectedWindow.String)\\n            return \\\"string\\\";\\n        if (obj instanceof inspectedWindow.Array)\\n            return \\\"array\\\";\\n        if (obj instanceof inspectedWindow.Boolean)\\n            return \\\"boolean\\\";\\n        if (obj instanceof inspectedWindow.Number)\\n            return \\\"number\\\";\\n        if (obj instanceof inspectedWindow.Date)\\n            return \\\"date\\\";\\n        if (obj instanceof inspectedWindow.RegExp)\\n            return \\\"regexp\\\";\\n        // FireBug's array detection.\\n        if (isFinite(obj.length) && typeof obj.splice === \\\"function\\\")\\n            return \\\"array\\\";\\n        if (isFinite(obj.length) && typeof obj.callee === \\\"function\\\") // arguments.\\n            return \\\"array\\\";\\n        if (obj instanceof inspectedWindow.NodeList)\\n            return \\\"array\\\";\\n        if (obj instanceof inspectedWindow.HTMLCollection)\\n            return \\\"array\\\";\\n        if (obj instanceof inspectedWindow.Error)\\n            return \\\"error\\\";\\n        return type;\\n    },\\n\\n    _describe: function(obj, abbreviated)\\n    {\\n        var type = this._type(obj);\\n\\n        switch (type) {\\n        case \\\"object\\\":\\n        case \\\"node\\\":\\n            var result = InjectedScriptHost.internalConstructorName(obj);\\n            if (result === \\\"Object\\\") {\\n                // In Chromium DOM wrapper prototypes will have Object as their constructor name,\\n                // get the real DOM wrapper name from the constructor property.\\n                var constructorName = obj.constructor && obj.constructor.name;\\n                if (constructorName)\\n                    return constructorName;\\n            }\\n            return result;\\n        case \\\"array\\\":\\n            var className = InjectedScriptHost.internalConstructorName(obj);\\n            if (typeof obj.length === \\\"number\\\")\\n                className += \\\"[\\\" + obj.length + \\\"]\\\";\\n            return className;\\n        case \\\"string\\\":\\n            if (!abbreviated)\\n                return obj;\\n            if (obj.length > 100)\\n                return \\\"\\\\\\\"\\\" + obj.substring(0, 100) + \\\"\\\\u2026\\\\\\\"\\\";\\n            return \\\"\\\\\\\"\\\" + obj + \\\"\\\\\\\"\\\";\\n        case \\\"function\\\":\\n            var objectText = this._toString(obj);\\n            if (abbreviated)\\n                objectText = /.*/.exec(objectText)[0].replace(/ +$/g, \\\"\\\");\\n            return objectText;\\n        default:\\n            return this._toString(obj);\\n        }\\n    },\\n\\n    _toString: function(obj)\\n    {\\n        // We don't use String(obj) because inspectedWindow.String is undefined if owning frame navigated to another page.\\n        return \\\"\\\" + obj;\\n    }\\n}\\n\\nvar injectedScript = new InjectedScript();\\n\\nInjectedScript.RemoteObject = function(objectId, type, description, hasChildren)\\n{\\n    this.objectId = objectId;\\n    this.type = type;\\n    this.description = description;\\n    this.hasChildren = hasChildren;\\n}\\n\\nInjectedScript.RemoteObject.fromException = function(e)\\n{\\n    return new InjectedScript.RemoteObject(null, \\\"error\\\", e.toString());\\n}\\n\\nInjectedScript.RemoteObject.fromObject = function(object, objectId, abbreviate)\\n{\\n    var type = injectedScript._type(object);\\n    var rawType = typeof object;\\n    var hasChildren = (rawType === \\\"object\\\" && object !== null && (Object.getOwnPropertyNames(object).length || !!Object.getPrototypeOf(object))) || rawType === \\\"function\\\";\\n    var description = \\\"\\\";\\n    try {\\n        var description = injectedScript._describe(object, abbreviate);\\n        return new InjectedScript.RemoteObject(objectId, type, description, hasChildren);\\n    } catch (e) {\\n        return InjectedScript.RemoteObject.fromException(e);\\n    }\\n}\\n\\nInjectedScript.CallFrameProxy = function(ordinal, callFrame)\\n{\\n    this.id = { ordinal: ordinal, injectedScriptId: injectedScriptId };\\n    this.type = callFrame.type;\\n    this.functionName = (this.type === \\\"function\\\" ? callFrame.functionName : \\\"\\\");\\n    this.sourceID = callFrame.sourceID;\\n    this.line = callFrame.line;\\n    this.column = callFrame.column;\\n    this.scopeChain = this._wrapScopeChain(callFrame);\\n}\\n\\nInjectedScript.CallFrameProxy.prototype = {\\n    _wrapScopeChain: function(callFrame)\\n    {\\n        var GLOBAL_SCOPE = 0;\\n        var LOCAL_SCOPE = 1;\\n        var WITH_SCOPE = 2;\\n        var CLOSURE_SCOPE = 3;\\n        var CATCH_SCOPE = 4;\\n    \\n        var scopeChain = callFrame.scopeChain;\\n        var scopeChainProxy = [];\\n        var foundLocalScope = false;\\n        for (var i = 0; i < scopeChain.length; i++) {\\n            var scopeType = callFrame.scopeType(i);\\n            var scopeObject = scopeChain[i];\\n            var scopeObjectProxy = injectedScript._wrapObject(scopeObject, \\\"backtrace\\\", true);\\n\\n            switch(scopeType) {\\n                case LOCAL_SCOPE: {\\n                    foundLocalScope = true;\\n                    scopeObjectProxy.isLocal = true;\\n                    scopeObjectProxy.thisObject = injectedScript._wrapObject(callFrame.thisObject, \\\"backtrace\\\", true);\\n                    break;\\n                }\\n                case CLOSURE_SCOPE: {\\n                    scopeObjectProxy.isClosure = true;\\n                    break;\\n                }\\n                case WITH_SCOPE:\\n                case CATCH_SCOPE: {\\n                    if (foundLocalScope && scopeObject instanceof inspectedWindow.Element)\\n                        scopeObjectProxy.isElement = true;\\n                    else if (foundLocalScope && scopeObject instanceof inspectedWindow.Document)\\n                        scopeObjectProxy.isDocument = true;\\n                    else\\n                        scopeObjectProxy.isWithBlock = true;\\n                    break;\\n                }\\n            }\\n            scopeChainProxy.push(scopeObjectProxy);\\n        }\\n        return scopeChainProxy;\\n    }\\n}\\n\\nfunction CommandLineAPI(commandLineAPIImpl, callFrame)\\n{\\n    function inScopeVariables(member)\\n    {\\n        if (!callFrame)\\n            return false;\\n\\n        var scopeChain = callFrame.scopeChain;\\n        for (var i = 0; i < scopeChain.length; ++i) {\\n            if (member in scopeChain[i])\\n                return true;\\n        }\\n        return false;\\n    }\\n\\n    for (var i = 0; i < CommandLineAPI.members_.length; ++i) {\\n        var member = CommandLineAPI.members_[i];\\n        if (member in inspectedWindow || inScopeVariables(member))\\n            continue;\\n\\n        this[member] = bind(commandLineAPIImpl, commandLineAPIImpl[member]);\\n    }\\n\\n    for (var i = 0; i < 5; ++i) {\\n        var member = \\\"$\\\" + i;\\n        if (member in inspectedWindow || inScopeVariables(member))\\n            continue;\\n\\n        // fix for non-webkit browsers\\n        //this.__defineGetter__(\\\"$\\\" + i, bind(commandLineAPIImpl, commandLineAPIImpl._inspectedNode, i));\\n        Object.defineProperty(this, \\\"$\\\" + i, {\\n            get: bind(commandLineAPIImpl, commandLineAPIImpl._inspectedNode, i)\\n        });\\n    }\\n}\\n\\nCommandLineAPI.members_ = [\\n    \\\"$\\\", \\\"$$\\\", \\\"$x\\\", \\\"dir\\\", \\\"dirxml\\\", \\\"keys\\\", \\\"values\\\", \\\"profile\\\", \\\"profileEnd\\\",\\n    \\\"monitorEvents\\\", \\\"unmonitorEvents\\\", \\\"inspect\\\", \\\"copy\\\", \\\"clear\\\"\\n];\\n\\nfunction CommandLineAPIImpl()\\n{\\n}\\n\\nCommandLineAPIImpl.prototype = {\\n    $: function()\\n    {\\n        return document.getElementById.apply(document, arguments)\\n    },\\n\\n    $$: function()\\n    {\\n        return document.querySelectorAll.apply(document, arguments)\\n    },\\n\\n    $x: function(xpath, context)\\n    {\\n        var nodes = [];\\n        try {\\n            var doc = (context && context.ownerDocument) || inspectedWindow.document;\\n            var results = doc.evaluate(xpath, context || doc, null, XPathResult.ANY_TYPE, null);\\n            var node;\\n            while (node = results.iterateNext())\\n                nodes.push(node);\\n        } catch (e) {\\n        }\\n        return nodes;\\n    },\\n\\n    dir: function()\\n    {\\n        return console.dir.apply(console, arguments)\\n    },\\n\\n    dirxml: function()\\n    {\\n        return console.dirxml.apply(console, arguments)\\n    },\\n\\n    keys: function(object)\\n    {\\n        return Object.keys(object);\\n    },\\n\\n    values: function(object)\\n    {\\n        var result = [];\\n        for (var key in object)\\n            result.push(object[key]);\\n        return result;\\n    },\\n\\n    profile: function()\\n    {\\n        return console.profile.apply(console, arguments)\\n    },\\n\\n    profileEnd: function()\\n    {\\n        return console.profileEnd.apply(console, arguments)\\n    },\\n\\n    monitorEvents: function(object, types)\\n    {\\n        if (!object || !object.addEventListener || !object.removeEventListener)\\n            return;\\n        types = this._normalizeEventTypes(types);\\n        for (var i = 0; i < types.length; ++i) {\\n            object.removeEventListener(types[i], this._logEvent, false);\\n            object.addEventListener(types[i], this._logEvent, false);\\n        }\\n    },\\n\\n    unmonitorEvents: function(object, types)\\n    {\\n        if (!object || !object.addEventListener || !object.removeEventListener)\\n            return;\\n        types = this._normalizeEventTypes(types);\\n        for (var i = 0; i < types.length; ++i)\\n            object.removeEventListener(types[i], this._logEvent, false);\\n    },\\n\\n    inspect: function(object)\\n    {\\n        if (arguments.length === 0)\\n            return;\\n\\n        inspectedWindow.console.log(object);\\n        if (injectedScript._type(object) === \\\"node\\\")\\n            InjectedScriptHost.pushNodePathToFrontend(object, false, true);\\n        else {\\n            switch (injectedScript._describe(object)) {\\n                case \\\"Database\\\":\\n                    InjectedScriptHost.selectDatabase(object);\\n                    break;\\n                case \\\"Storage\\\":\\n                    InjectedScriptHost.selectDOMStorage(object);\\n                    break;\\n            }\\n        }\\n    },\\n\\n    copy: function(object)\\n    {\\n        if (injectedScript._type(object) === \\\"node\\\")\\n            object = object.outerHTML;\\n        InjectedScriptHost.copyText(object);\\n    },\\n\\n    clear: function()\\n    {\\n        InjectedScriptHost.clearConsoleMessages();\\n    },\\n\\n    _inspectedNode: function(num)\\n    {\\n        var nodeId = InjectedScriptHost.inspectedNode(num);\\n        return injectedScript._nodeForId(nodeId);\\n    },\\n\\n    _normalizeEventTypes: function(types)\\n    {\\n        if (typeof types === \\\"undefined\\\")\\n            types = [ \\\"mouse\\\", \\\"key\\\", \\\"load\\\", \\\"unload\\\", \\\"abort\\\", \\\"error\\\", \\\"select\\\", \\\"change\\\", \\\"submit\\\", \\\"reset\\\", \\\"focus\\\", \\\"blur\\\", \\\"resize\\\", \\\"scroll\\\" ];\\n        else if (typeof types === \\\"string\\\")\\n            types = [ types ];\\n\\n        var result = [];\\n        for (var i = 0; i < types.length; i++) {\\n            if (types[i] === \\\"mouse\\\")\\n                result.splice(0, 0, \\\"mousedown\\\", \\\"mouseup\\\", \\\"click\\\", \\\"dblclick\\\", \\\"mousemove\\\", \\\"mouseover\\\", \\\"mouseout\\\");\\n            else if (types[i] === \\\"key\\\")\\n                result.splice(0, 0, \\\"keydown\\\", \\\"keyup\\\", \\\"keypress\\\");\\n            else\\n                result.push(types[i]);\\n        }\\n        return result;\\n    },\\n\\n    _logEvent: function(event)\\n    {\\n        console.log(event.type, event);\\n    }\\n}\\n\\ninjectedScript._commandLineAPIImpl = new CommandLineAPIImpl();\\nreturn injectedScript;\\n})\\n//@ sourceURL=weinre/target/InjectedScript.js\")\n;eval(\";modjewel.define(\\\"weinre/target/InjectedScriptHostImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar InjectedScriptHostImpl, Weinre;\\n\\nWeinre = require('../common/Weinre');\\n\\nmodule.exports = InjectedScriptHostImpl = (function() {\\n  function InjectedScriptHostImpl() {}\\n\\n  InjectedScriptHostImpl.prototype.clearConsoleMessages = function(callback) {\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  InjectedScriptHostImpl.prototype.nodeForId = function(nodeId, callback) {\\n    return Weinre.nodeStore.getNode(nodeId);\\n  };\\n\\n  InjectedScriptHostImpl.prototype.pushNodePathToFrontend = function(node, withChildren, selectInUI, callback) {\\n    var children, nodeId;\\n    nodeId = Weinre.nodeStore.getNodeId(node);\\n    children = Weinre.nodeStore.serializeNode(node, 1);\\n    Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\\n    if (callback) {\\n      Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n    if (selectInUI) {\\n      return Weinre.wi.InspectorNotify.updateFocusedNode(nodeId);\\n    }\\n  };\\n\\n  InjectedScriptHostImpl.prototype.inspectedNode = function(num, callback) {\\n    var nodeId;\\n    nodeId = Weinre.nodeStore.getInspectedNode(num);\\n    return nodeId;\\n  };\\n\\n  InjectedScriptHostImpl.prototype.internalConstructorName = function(object) {\\n    var ctor, ctorName, match, pattern;\\n    ctor = object.constructor;\\n    ctorName = ctor.fullClassName || ctor.displayName || ctor.name;\\n    if (ctorName && (ctorName !== \\\"Object\\\")) {\\n      return ctorName;\\n    }\\n    pattern = /\\\\[object (.*)\\\\]/;\\n    match = pattern.exec(object.toString());\\n    if (match) {\\n      return match[1];\\n    }\\n    return \\\"Object\\\";\\n  };\\n\\n  return InjectedScriptHostImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/InjectedScriptHostImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/NetworkRequest\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Ex, HookLib, HookSites, IDGenerator, Loader, NetworkRequest, StackTrace, Weinre, getFormData, getHeaders, getRequest, getResponse, getXhrEventHandler, splitContentType, trim;\\n\\nStackTrace = require('../common/StackTrace');\\n\\nIDGenerator = require('../common/IDGenerator');\\n\\nHookLib = require('../common/HookLib');\\n\\nWeinre = require('../common/Weinre');\\n\\nEx = require('../common/Ex');\\n\\nHookSites = require('./HookSites');\\n\\nLoader = {\\n  url: window.location.href,\\n  frameId: 0,\\n  loaderId: 0\\n};\\n\\nmodule.exports = NetworkRequest = (function() {\\n  function NetworkRequest(xhr, id, method, url, stackTrace) {\\n    this.xhr = xhr;\\n    this.id = id;\\n    this.method = method;\\n    this.url = url;\\n    this.stackTrace = stackTrace;\\n  }\\n\\n  NetworkRequest.prototype.handleSend = function(data) {\\n    var redirectResponse, request, time;\\n    Weinre.wi.NetworkNotify.identifierForInitialRequest(this.id, this.url, Loader, this.stackTrace);\\n    time = Date.now() / 1000.0;\\n    request = getRequest(this.url, this.method, this.xhr, data);\\n    redirectResponse = {\\n      isNull: true\\n    };\\n    return Weinre.wi.NetworkNotify.willSendRequest(this.id, time, request, redirectResponse);\\n  };\\n\\n  NetworkRequest.prototype.handleHeadersReceived = function() {\\n    var response, time;\\n    time = Date.now() / 1000.0;\\n    response = getResponse(this.xhr);\\n    return Weinre.wi.NetworkNotify.didReceiveResponse(this.id, time, \\\"XHR\\\", response);\\n  };\\n\\n  NetworkRequest.prototype.handleLoading = function() {};\\n\\n  NetworkRequest.prototype.handleDone = function() {\\n    var description, e, sourceString, status, statusText, success, time;\\n    sourceString = \\\"\\\";\\n    try {\\n      sourceString = this.xhr.responseText;\\n    } catch (_error) {\\n      e = _error;\\n    }\\n    Weinre.wi.NetworkNotify.setInitialContent(this.id, sourceString, \\\"XHR\\\");\\n    time = Date.now() / 1000.0;\\n    status = this.xhr.status;\\n    if (status === 0) {\\n      status = 200;\\n    }\\n    statusText = this.xhr.statusText;\\n    success = status >= 200 && status < 300;\\n    if (success) {\\n      return Weinre.wi.NetworkNotify.didFinishLoading(this.id, time);\\n    } else {\\n      description = \\\"\\\" + status + \\\" - \\\" + statusText;\\n      return Weinre.wi.NetworkNotify.didFailLoading(this.id, time, description);\\n    }\\n  };\\n\\n  NetworkRequest.installNativeHooks = function() {\\n    HookSites.XMLHttpRequest_open.addHooks({\\n      before: function(receiver, args) {\\n        var frame, id, method, rawStackTrace, stackTrace, url, xhr, _i, _len;\\n        xhr = receiver;\\n        method = args[0];\\n        url = args[1];\\n        id = IDGenerator.next();\\n        rawStackTrace = new StackTrace(args).trace.slice(1);\\n        stackTrace = [];\\n        for (_i = 0, _len = rawStackTrace.length; _i < _len; _i++) {\\n          frame = rawStackTrace[_i];\\n          stackTrace.push({\\n            functionName: frame\\n          });\\n        }\\n        xhr.__weinreNetworkRequest__ = new NetworkRequest(xhr, id, method, url, stackTrace);\\n        return HookLib.ignoreHooks(function() {\\n          return xhr.addEventListener(\\\"readystatechange\\\", getXhrEventHandler(xhr), false);\\n        });\\n      }\\n    });\\n    return HookSites.XMLHttpRequest_send.addHooks({\\n      before: function(receiver, args) {\\n        var data, nr, xhr;\\n        xhr = receiver;\\n        data = args[0];\\n        nr = xhr.__weinreNetworkRequest__;\\n        if (!nr) {\\n          return;\\n        }\\n        return nr.handleSend(data);\\n      }\\n    });\\n  };\\n\\n  return NetworkRequest;\\n\\n})();\\n\\ngetRequest = function(url, method, xhr, data) {\\n  return {\\n    url: url,\\n    httpMethod: method,\\n    httpHeaderFields: {},\\n    requestFormData: getFormData(url, data)\\n  };\\n};\\n\\ngetResponse = function(xhr) {\\n  var contentLength, contentType, encoding, headers, result, _ref;\\n  contentType = xhr.getResponseHeader(\\\"Content-Type\\\");\\n  contentType || (contentType = 'application/octet-stream');\\n  _ref = splitContentType(contentType), contentType = _ref[0], encoding = _ref[1];\\n  headers = getHeaders(xhr);\\n  result = {\\n    mimeType: contentType,\\n    textEncodingName: encoding,\\n    httpStatusCode: xhr.status,\\n    httpStatusText: xhr.statusText,\\n    httpHeaderFields: headers,\\n    connectionReused: false,\\n    connectionID: 0,\\n    wasCached: false\\n  };\\n  contentLength = xhr.getResponseHeader(\\\"Content-Length\\\");\\n  contentLength = parseInt(contentLength);\\n  if (!isNaN(contentLength)) {\\n    result.expectedContentLength = contentLength;\\n  }\\n  return result;\\n};\\n\\ngetHeaders = function(xhr) {\\n  var key, line, lines, result, string, val, _i, _len, _ref;\\n  string = xhr.getAllResponseHeaders();\\n  lines = string.split('\\\\r\\\\n');\\n  result = {};\\n  for (_i = 0, _len = lines.length; _i < _len; _i++) {\\n    line = lines[_i];\\n    line = trim(line);\\n    if (line === \\\"\\\") {\\n      break;\\n    }\\n    _ref = line.split(':', 2), key = _ref[0], val = _ref[1];\\n    result[trim(key)] = trim(val);\\n  }\\n  return result;\\n};\\n\\ntrim = function(string) {\\n  return string.replace(/^\\\\s+|\\\\s+$/g, '');\\n};\\n\\ngetFormData = function(url, data) {\\n  var match, pattern;\\n  if (data) {\\n    return data;\\n  }\\n  pattern = /.*?\\\\?(.*?)(#.*)?$/;\\n  match = url.match(pattern);\\n  if (match) {\\n    return match[1];\\n  }\\n  return \\\"\\\";\\n};\\n\\nsplitContentType = function(contentType) {\\n  var match, pattern;\\n  pattern = /\\\\s*(.*?)\\\\s*(;\\\\s*(.*))?\\\\s*$/;\\n  match = contentType.match(pattern);\\n  if (!match) {\\n    return [contentType, \\\"\\\"];\\n  }\\n  return [match[1], match[3]];\\n};\\n\\ngetXhrEventHandler = function(xhr) {\\n  return function() {\\n    var e, nr;\\n    nr = xhr.__weinreNetworkRequest__;\\n    if (!nr) {\\n      return;\\n    }\\n    try {\\n      switch (xhr.readyState) {\\n        case 2:\\n          return nr.handleHeadersReceived();\\n        case 3:\\n          return nr.handleLoading();\\n        case 4:\\n          return nr.handleDone();\\n      }\\n    } catch (_error) {\\n      e = _error;\\n    }\\n  };\\n};\\n\\n});\\n\\n//@ sourceURL=weinre/target/NetworkRequest.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/NodeStore\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Debug, IDGenerator, NodeStore, Weinre, handleDOMAttrModified, handleDOMCharacterDataModified, handleDOMNodeInserted, handleDOMNodeRemoved, handleDOMSubtreeModified;\\n\\nWeinre = require('../common/Weinre');\\n\\nIDGenerator = require('../common/IDGenerator');\\n\\nDebug = require('../common/Debug');\\n\\nmodule.exports = NodeStore = (function() {\\n  function NodeStore() {\\n    this._nodeMap = {};\\n    this._childrenSent = {};\\n    this._inspectedNodes = [];\\n    document.addEventListener(\\\"DOMSubtreeModified\\\", handleDOMSubtreeModified, false);\\n    document.addEventListener(\\\"DOMNodeInserted\\\", handleDOMNodeInserted, false);\\n    document.addEventListener(\\\"DOMNodeRemoved\\\", handleDOMNodeRemoved, false);\\n    document.addEventListener(\\\"DOMAttrModified\\\", handleDOMAttrModified, false);\\n    document.addEventListener(\\\"DOMCharacterDataModified\\\", handleDOMCharacterDataModified, false);\\n  }\\n\\n  NodeStore.prototype.addInspectedNode = function(nodeId) {\\n    this._inspectedNodes.unshift(nodeId);\\n    if (this._inspectedNodes.length > 5) {\\n      return this._inspectedNodes = this._inspectedNodes.slice(0, 5);\\n    }\\n  };\\n\\n  NodeStore.prototype.getInspectedNode = function(index) {\\n    return this._inspectedNodes[index];\\n  };\\n\\n  NodeStore.prototype.getNode = function(nodeId) {\\n    return this._nodeMap[nodeId];\\n  };\\n\\n  NodeStore.prototype.checkNodeId = function(node) {\\n    return IDGenerator.checkId(node);\\n  };\\n\\n  NodeStore.prototype.getNodeId = function(node) {\\n    var id;\\n    id = this.checkNodeId(node);\\n    if (id) {\\n      return id;\\n    }\\n    return IDGenerator.getId(node, this._nodeMap);\\n  };\\n\\n  NodeStore.prototype.getNodeData = function(nodeId, depth) {\\n    return this.serializeNode(this.getNode(nodeId), depth);\\n  };\\n\\n  NodeStore.prototype.getPreviousSiblingId = function(node) {\\n    var id, sib;\\n    while (true) {\\n      sib = node.previousSibling;\\n      if (!sib) {\\n        return 0;\\n      }\\n      id = this.checkNodeId(sib);\\n      if (id) {\\n        return id;\\n      }\\n      node = sib;\\n    }\\n  };\\n\\n  NodeStore.prototype.nextNodeId = function() {\\n    return \\\"\\\" + IDGenerator.next();\\n  };\\n\\n  NodeStore.prototype.serializeNode = function(node, depth) {\\n    var children, i, id, localName, nodeData, nodeName, nodeValue;\\n    nodeName = \\\"\\\";\\n    nodeValue = null;\\n    localName = null;\\n    id = this.getNodeId(node);\\n    switch (node.nodeType) {\\n      case Node.TEXT_NODE:\\n      case Node.COMMENT_NODE:\\n      case Node.CDATA_SECTION_NODE:\\n        nodeValue = node.nodeValue;\\n        break;\\n      case Node.ATTRIBUTE_NODE:\\n        localName = node.localName;\\n        break;\\n      case Node.DOCUMENT_FRAGMENT_NODE:\\n        break;\\n      default:\\n        nodeName = node.nodeName;\\n        localName = node.localName;\\n    }\\n    nodeData = {\\n      id: id,\\n      nodeType: node.nodeType,\\n      nodeName: nodeName,\\n      localName: localName,\\n      nodeValue: nodeValue\\n    };\\n    if (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\\n      nodeData.childNodeCount = this.childNodeCount(node);\\n      children = this.serializeNodeChildren(node, depth);\\n      if (children.length) {\\n        nodeData.children = children;\\n      }\\n      if (node.nodeType === Node.ELEMENT_NODE) {\\n        nodeData.attributes = [];\\n        i = 0;\\n        while (i < node.attributes.length) {\\n          nodeData.attributes.push(node.attributes[i].nodeName);\\n          nodeData.attributes.push(node.attributes[i].nodeValue);\\n          i++;\\n        }\\n      } else {\\n        if (node.nodeType === Node.DOCUMENT_NODE) {\\n          nodeData.documentURL = window.location.href;\\n        }\\n      }\\n    } else if (node.nodeType === Node.DOCUMENT_TYPE_NODE) {\\n      nodeData.publicId = node.publicId;\\n      nodeData.systemId = node.systemId;\\n      nodeData.internalSubset = node.internalSubset;\\n    } else if (node.nodeType === Node.ATTRIBUTE_NODE) {\\n      nodeData.name = node.nodeName;\\n      nodeData.value = node.nodeValue;\\n    }\\n    return nodeData;\\n  };\\n\\n  NodeStore.prototype.serializeNodeChildren = function(node, depth) {\\n    var childIds, childNode, i, result;\\n    result = [];\\n    childIds = this.childNodeIds(node);\\n    if (depth === 0) {\\n      if (childIds.length === 1) {\\n        childNode = this.getNode(childIds[0]);\\n        if (childNode.nodeType === Node.TEXT_NODE) {\\n          result.push(this.serializeNode(childNode));\\n        }\\n      }\\n      return result;\\n    }\\n    depth--;\\n    i = 0;\\n    while (i < childIds.length) {\\n      result.push(this.serializeNode(this.getNode(childIds[i]), depth));\\n      i++;\\n    }\\n    return result;\\n  };\\n\\n  NodeStore.prototype.childNodeCount = function(node) {\\n    return this.childNodeIds(node).length;\\n  };\\n\\n  NodeStore.prototype.childNodeIds = function(node) {\\n    var childNode, i, ids, _i, _len, _ref;\\n    ids = [];\\n    i = 0;\\n    _ref = node.childNodes;\\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\\n      childNode = _ref[_i];\\n      if (this.isToBeSkipped(childNode)) {\\n        continue;\\n      }\\n      ids.push(this.getNodeId(childNode));\\n    }\\n    return ids;\\n  };\\n\\n  NodeStore.prototype.isToBeSkipped = function(node) {\\n    if (!node) {\\n      return true;\\n    }\\n    if (node.__weinreHighlighter) {\\n      return true;\\n    }\\n    if (node.nodeType !== Node.TEXT_NODE) {\\n      return false;\\n    }\\n    return !!node.nodeValue.match(/^\\\\s*$/);\\n  };\\n\\n  return NodeStore;\\n\\n})();\\n\\nhandleDOMSubtreeModified = function(event) {\\n  if (!event.attrChange) {\\n    return;\\n  }\\n  return NodeStore.handleDOMAttrModified(event);\\n};\\n\\nhandleDOMNodeInserted = function(event) {\\n  var child, parentId, previous, targetId;\\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\\n  parentId = Weinre.nodeStore.checkNodeId(event.relatedNode);\\n  if (!parentId) {\\n    return;\\n  }\\n  child = Weinre.nodeStore.serializeNode(event.target, 0);\\n  previous = Weinre.nodeStore.getPreviousSiblingId(event.target);\\n  return Weinre.wi.DOMNotify.childNodeInserted(parentId, previous, child);\\n};\\n\\nhandleDOMNodeRemoved = function(event) {\\n  var childCount, parentId, targetId;\\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\\n  parentId = Weinre.nodeStore.checkNodeId(event.relatedNode);\\n  if (!parentId) {\\n    return;\\n  }\\n  if (targetId) {\\n    if (parentId) {\\n      return Weinre.wi.DOMNotify.childNodeRemoved(parentId, targetId);\\n    }\\n  } else {\\n    childCount = Weinre.nodeStore.childNodeCount(event.relatedNode);\\n    return Weinre.wi.DOMNotify.childNodeCountUpdated(parentId, childCount);\\n  }\\n};\\n\\nhandleDOMAttrModified = function(event) {\\n  var attrs, i, targetId;\\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\\n  if (!targetId) {\\n    return;\\n  }\\n  attrs = [];\\n  i = 0;\\n  while (i < event.target.attributes.length) {\\n    attrs.push(event.target.attributes[i].name);\\n    attrs.push(event.target.attributes[i].value);\\n    i++;\\n  }\\n  return Weinre.wi.DOMNotify.attributesUpdated(targetId, attrs);\\n};\\n\\nhandleDOMCharacterDataModified = function(event) {\\n  var targetId;\\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\\n  if (!targetId) {\\n    return;\\n  }\\n  return Weinre.wi.DOMNotify.characterDataModified(targetId, event.newValue);\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/NodeStore.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/SqlStepper\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Binding, SqlStepper, executeSql, ourErrorCallback, runStep;\\n\\nBinding = require('../common/Binding');\\n\\nmodule.exports = SqlStepper = (function() {\\n  function SqlStepper(steps) {\\n    var context;\\n    if (!(this instanceof SqlStepper)) {\\n      return new SqlStepper(steps);\\n    }\\n    this.__context = {};\\n    context = this.__context;\\n    context.steps = steps;\\n  }\\n\\n  SqlStepper.prototype.run = function(db, errorCallback) {\\n    var context;\\n    context = this.__context;\\n    if (context.hasBeenRun) {\\n      throw new Ex(arguments, \\\"stepper has already been run\\\");\\n    }\\n    context.hasBeenRun = true;\\n    context.db = db;\\n    context.errorCallback = errorCallback;\\n    context.nextStep = 0;\\n    context.ourErrorCallback = new Binding(this, ourErrorCallback);\\n    context.runStep = new Binding(this, runStep);\\n    this.executeSql = new Binding(this, executeSql);\\n    return db.transaction(context.runStep);\\n  };\\n\\n  SqlStepper.example = function(db, id) {\\n    var errorCb, step1, step2, stepper;\\n    step1 = function() {\\n      return this.executeSql(\\\"SELECT name FROM sqlite_master WHERE type='table'\\\");\\n    };\\n    step2 = function(resultSet) {\\n      var i, name, result, rows;\\n      rows = resultSet.rows;\\n      result = [];\\n      i = 0;\\n      while (i < rows.length) {\\n        name = rows.item(i).name;\\n        if (name === \\\"__WebKitDatabaseInfoTable__\\\") {\\n          i++;\\n          continue;\\n        }\\n        result.push(name);\\n        i++;\\n      }\\n      return console.log((\\\"[\\\" + this.id + \\\"] table names: \\\") + result.join(\\\", \\\"));\\n    };\\n    errorCb = function(sqlError) {\\n      return console.log((\\\"[\\\" + this.id + \\\"] sql error:\\\" + sqlError.code + \\\": \\\") + sqlError.message);\\n    };\\n    stepper = new SqlStepper([step1, step2]);\\n    stepper.id = id;\\n    return stepper.run(db, errorCb);\\n  };\\n\\n  return SqlStepper;\\n\\n})();\\n\\nexecuteSql = function(statement, data) {\\n  var context;\\n  context = this.__context;\\n  return context.tx.executeSql(statement, data, context.runStep, context.ourErrorCallback);\\n};\\n\\nourErrorCallback = function(tx, sqlError) {\\n  var context;\\n  context = this.__context;\\n  return context.errorCallback.call(this, sqlError);\\n};\\n\\nrunStep = function(tx, resultSet) {\\n  var context, step;\\n  context = this.__context;\\n  if (context.nextStep >= context.steps.length) {\\n    return;\\n  }\\n  context.tx = tx;\\n  context.currentStep = context.nextStep;\\n  context.nextStep++;\\n  step = context.steps[context.currentStep];\\n  return step.call(this, resultSet);\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/SqlStepper.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/Target\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Binding, CSSStore, Callback, CheckForProblems, ElementHighlighter, Ex, HookLib, InjectedScriptHostImpl, MessageDispatcher, NetworkRequest, NodeStore, Target, Weinre, WeinreExtraClientCommandsImpl, WeinreTargetEventsImpl, WiCSSImpl, WiConsoleImpl, WiDOMImpl, WiDOMStorageImpl, WiDatabaseImpl, WiInspectorImpl, WiRuntimeImpl, currentTime;\\n\\nrequire('./BrowserHacks');\\n\\nEx = require('../common/Ex');\\n\\nBinding = require('../common/Binding');\\n\\nCallback = require('../common/Callback');\\n\\nMessageDispatcher = require('../common/MessageDispatcher');\\n\\nWeinre = require('../common/Weinre');\\n\\nHookLib = require('../common/HookLib');\\n\\nCheckForProblems = require('./CheckForProblems');\\n\\nNodeStore = require('./NodeStore');\\n\\nCSSStore = require('./CSSStore');\\n\\nElementHighlighter = require('./ElementHighlighter');\\n\\nInjectedScriptHostImpl = require('./InjectedScriptHostImpl');\\n\\nNetworkRequest = require('./NetworkRequest');\\n\\nWeinreTargetEventsImpl = require('./WeinreTargetEventsImpl');\\n\\nWeinreExtraClientCommandsImpl = require('./WeinreExtraClientCommandsImpl');\\n\\nWiConsoleImpl = require('./WiConsoleImpl');\\n\\nWiCSSImpl = require('./WiCSSImpl');\\n\\nWiDatabaseImpl = require('./WiDatabaseImpl');\\n\\nWiDOMImpl = require('./WiDOMImpl');\\n\\nWiDOMStorageImpl = require('./WiDOMStorageImpl');\\n\\nWiInspectorImpl = require('./WiInspectorImpl');\\n\\nWiRuntimeImpl = require('./WiRuntimeImpl');\\n\\nmodule.exports = Target = (function() {\\n  function Target() {}\\n\\n  Target.main = function() {\\n    CheckForProblems.check();\\n    Weinre.target = new Target();\\n    return Weinre.target.initialize();\\n  };\\n\\n  Target.prototype.setWeinreServerURLFromScriptSrc = function(element) {\\n    var match, message, pattern;\\n    if (window.WeinreServerURL) {\\n      return;\\n    }\\n    if (element) {\\n      pattern = /((https?:)?\\\\/\\\\/(.*?)\\\\/)/;\\n      match = pattern.exec(element.src);\\n      if (match) {\\n        window.WeinreServerURL = match[1];\\n        return;\\n      }\\n    }\\n    message = \\\"unable to calculate the weinre server url; explicity set the variable window.WeinreServerURL instead\\\";\\n    alert(message);\\n    throw new Ex(arguments, message);\\n  };\\n\\n  Target.prototype.setWeinreServerIdFromScriptSrc = function(element) {\\n    var attempt, hash;\\n    if (window.WeinreServerId) {\\n      return;\\n    }\\n    element = this.getTargetScriptElement();\\n    hash = \\\"anonymous\\\";\\n    if (element) {\\n      attempt = element.src.split(\\\"#\\\")[1];\\n      if (attempt) {\\n        hash = attempt;\\n      } else {\\n        attempt = location.hash.split(\\\"#\\\")[1];\\n        if (attempt) {\\n          hash = attempt;\\n        }\\n      }\\n    }\\n    return window.WeinreServerId = hash;\\n  };\\n\\n  Target.prototype.getTargetScriptElement = function() {\\n    var element, elements, i, j, scripts;\\n    elements = document.getElementsByTagName(\\\"script\\\");\\n    scripts = [\\\"target-script.js\\\", \\\"target-script-min.js\\\"];\\n    i = 0;\\n    while (i < elements.length) {\\n      element = elements[i];\\n      j = 0;\\n      while (j < scripts.length) {\\n        if (-1 !== element.src.indexOf(\\\"/\\\" + scripts[j])) {\\n          return element;\\n        }\\n        j++;\\n      }\\n      i++;\\n    }\\n  };\\n\\n  Target.prototype.initialize = function() {\\n    var element, injectedScriptHost, messageDispatcher;\\n    element = this.getTargetScriptElement();\\n    this.setWeinreServerURLFromScriptSrc(element);\\n    this.setWeinreServerIdFromScriptSrc(element);\\n    if (window.WeinreServerURL[window.WeinreServerURL.length - 1] !== \\\"/\\\") {\\n      window.WeinreServerURL += \\\"/\\\";\\n    }\\n    injectedScriptHost = new InjectedScriptHostImpl();\\n    Weinre.injectedScript = injectedScriptConstructor(injectedScriptHost, window, 0, \\\"?\\\");\\n    window.addEventListener(\\\"load\\\", Binding(this, \\\"onLoaded\\\"), false);\\n    document.addEventListener(\\\"DOMContentLoaded\\\", Binding(this, \\\"onDOMContent\\\"), false);\\n    this._startTime = currentTime();\\n    if (document.readyState === \\\"loaded\\\") {\\n      HookLib.ignoreHooks((function(_this) {\\n        return function() {\\n          return setTimeout((function() {\\n            return _this.onDOMContent();\\n          }), 10);\\n        };\\n      })(this));\\n    }\\n    if (document.readyState === \\\"complete\\\") {\\n      HookLib.ignoreHooks((function(_this) {\\n        return function() {\\n          setTimeout((function() {\\n            return _this.onDOMContent();\\n          }), 10);\\n          return setTimeout((function() {\\n            return _this.onLoaded();\\n          }), 20);\\n        };\\n      })(this));\\n    }\\n    messageDispatcher = new MessageDispatcher(window.WeinreServerURL + \\\"ws/target\\\", window.WeinreServerId);\\n    Weinre.messageDispatcher = messageDispatcher;\\n    Weinre.wi = {};\\n    Weinre.wi.Console = new WiConsoleImpl();\\n    Weinre.wi.CSS = new WiCSSImpl();\\n    Weinre.wi.Database = new WiDatabaseImpl();\\n    Weinre.wi.DOM = new WiDOMImpl();\\n    Weinre.wi.DOMStorage = new WiDOMStorageImpl();\\n    Weinre.wi.Inspector = new WiInspectorImpl();\\n    Weinre.wi.Runtime = new WiRuntimeImpl();\\n    messageDispatcher.registerInterface(\\\"Console\\\", Weinre.wi.Console, false);\\n    messageDispatcher.registerInterface(\\\"CSS\\\", Weinre.wi.CSS, false);\\n    messageDispatcher.registerInterface(\\\"Database\\\", Weinre.wi.Database, false);\\n    messageDispatcher.registerInterface(\\\"DOM\\\", Weinre.wi.DOM, false);\\n    messageDispatcher.registerInterface(\\\"DOMStorage\\\", Weinre.wi.DOMStorage, false);\\n    messageDispatcher.registerInterface(\\\"Inspector\\\", Weinre.wi.Inspector, false);\\n    messageDispatcher.registerInterface(\\\"Runtime\\\", Weinre.wi.Runtime, false);\\n    messageDispatcher.registerInterface(\\\"WeinreExtraClientCommands\\\", new WeinreExtraClientCommandsImpl(), true);\\n    messageDispatcher.registerInterface(\\\"WeinreTargetEvents\\\", new WeinreTargetEventsImpl(), true);\\n    Weinre.wi.ApplicationCacheNotify = messageDispatcher.createProxy(\\\"ApplicationCacheNotify\\\");\\n    Weinre.wi.ConsoleNotify = messageDispatcher.createProxy(\\\"ConsoleNotify\\\");\\n    Weinre.wi.DOMNotify = messageDispatcher.createProxy(\\\"DOMNotify\\\");\\n    Weinre.wi.DOMStorageNotify = messageDispatcher.createProxy(\\\"DOMStorageNotify\\\");\\n    Weinre.wi.DatabaseNotify = messageDispatcher.createProxy(\\\"DatabaseNotify\\\");\\n    Weinre.wi.InspectorNotify = messageDispatcher.createProxy(\\\"InspectorNotify\\\");\\n    Weinre.wi.TimelineNotify = messageDispatcher.createProxy(\\\"TimelineNotify\\\");\\n    Weinre.wi.NetworkNotify = messageDispatcher.createProxy(\\\"NetworkNotify\\\");\\n    Weinre.WeinreTargetCommands = messageDispatcher.createProxy(\\\"WeinreTargetCommands\\\");\\n    Weinre.WeinreExtraTargetEvents = messageDispatcher.createProxy(\\\"WeinreExtraTargetEvents\\\");\\n    messageDispatcher.getWebSocket().addEventListener(\\\"open\\\", Binding(this, this.cb_webSocketOpened));\\n    Weinre.nodeStore = new NodeStore();\\n    Weinre.cssStore = new CSSStore();\\n    return NetworkRequest.installNativeHooks();\\n  };\\n\\n  Target.prototype.cb_webSocketOpened = function() {\\n    return Weinre.WeinreTargetCommands.registerTarget(window.location.href, Binding(this, this.cb_registerTarget));\\n  };\\n\\n  Target.prototype.cb_registerTarget = function(targetDescription) {\\n    return Weinre.targetDescription = targetDescription;\\n  };\\n\\n  Target.prototype.onLoaded = function() {\\n    if (!Weinre.wi.InspectorNotify) {\\n      HookLib.ignoreHooks((function(_this) {\\n        return function() {\\n          return setTimeout((function() {\\n            return _this.onLoaded();\\n          }), 10);\\n        };\\n      })(this));\\n      return;\\n    }\\n    return Weinre.wi.InspectorNotify.loadEventFired(currentTime() - this._startTime);\\n  };\\n\\n  Target.prototype.onDOMContent = function() {\\n    if (!Weinre.wi.InspectorNotify) {\\n      HookLib.ignoreHooks((function(_this) {\\n        return function() {\\n          return setTimeout((function() {\\n            return _this.onDOMContent();\\n          }), 10);\\n        };\\n      })(this));\\n      return;\\n    }\\n    return Weinre.wi.InspectorNotify.domContentEventFired(currentTime() - this._startTime);\\n  };\\n\\n  Target.prototype.setDocument = function() {\\n    var nodeData, nodeId;\\n    if (!Weinre.elementHighlighter) {\\n      Weinre.elementHighlighter = ElementHighlighter.create();\\n    }\\n    nodeId = Weinre.nodeStore.getNodeId(document);\\n    nodeData = Weinre.nodeStore.getNodeData(nodeId, 2);\\n    return Weinre.wi.DOMNotify.setDocument(nodeData);\\n  };\\n\\n  Target.prototype.whenBodyReady = function(receiver, args, func) {\\n    if (document.body) {\\n      func.apply(receiver, args);\\n      return;\\n    }\\n    return document.addEventListener(\\\"DOMContentLoaded\\\", function() {\\n      return func.apply(receiver, args);\\n    }, false);\\n  };\\n\\n  return Target;\\n\\n})();\\n\\ncurrentTime = function() {\\n  return (new Date().getMilliseconds()) / 1000.0;\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/Target.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/Timeline\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Ex, HookLib, HookSites, IDGenerator, Running, StackTrace, Timeline, TimelineRecordType, TimerIntervals, TimerTimeouts, Weinre, addStackTrace, addTimer, getXhrEventHandler, instrumentedTimerCode, removeTimer;\\n\\nEx = require('../common/Ex');\\n\\nWeinre = require('../common/Weinre');\\n\\nIDGenerator = require('../common/IDGenerator');\\n\\nStackTrace = require('../common/StackTrace');\\n\\nHookLib = require('../common/HookLib');\\n\\nHookSites = require('./HookSites');\\n\\nRunning = false;\\n\\nTimerTimeouts = {};\\n\\nTimerIntervals = {};\\n\\nTimelineRecordType = {\\n  EventDispatch: 0,\\n  Layout: 1,\\n  RecalculateStyles: 2,\\n  Paint: 3,\\n  ParseHTML: 4,\\n  TimerInstall: 5,\\n  TimerRemove: 6,\\n  TimerFire: 7,\\n  XHRReadyStateChange: 8,\\n  XHRLoad: 9,\\n  EvaluateScript: 10,\\n  Mark: 11,\\n  ResourceSendRequest: 12,\\n  ResourceReceiveResponse: 13,\\n  ResourceFinish: 14,\\n  FunctionCall: 15,\\n  ReceiveResourceData: 16,\\n  GCEvent: 17,\\n  MarkDOMContent: 18,\\n  MarkLoad: 19,\\n  ScheduleResourceRequest: 20\\n};\\n\\nmodule.exports = Timeline = (function() {\\n  function Timeline() {}\\n\\n  Timeline.start = function() {\\n    return Running = true;\\n  };\\n\\n  Timeline.stop = function() {\\n    return Running = false;\\n  };\\n\\n  Timeline.isRunning = function() {\\n    return Running;\\n  };\\n\\n  Timeline.addRecord_Mark = function(message) {\\n    var record;\\n    if (!Timeline.isRunning()) {\\n      return;\\n    }\\n    record = {};\\n    record.type = TimelineRecordType.Mark;\\n    record.category = {\\n      name: \\\"scripting\\\"\\n    };\\n    record.startTime = Date.now();\\n    record.data = {\\n      message: message\\n    };\\n    addStackTrace(record, 3);\\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\\n  };\\n\\n  Timeline.addRecord_EventDispatch = function(event, name, category) {\\n    var record;\\n    if (!Timeline.isRunning()) {\\n      return;\\n    }\\n    if (!category) {\\n      category = \\\"scripting\\\";\\n    }\\n    record = {};\\n    record.type = TimelineRecordType.EventDispatch;\\n    record.category = {\\n      name: category\\n    };\\n    record.startTime = Date.now();\\n    record.data = {\\n      type: event.type\\n    };\\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\\n  };\\n\\n  Timeline.addRecord_TimerInstall = function(id, timeout, singleShot) {\\n    var record;\\n    if (!Timeline.isRunning()) {\\n      return;\\n    }\\n    record = {};\\n    record.type = TimelineRecordType.TimerInstall;\\n    record.category = {\\n      name: \\\"scripting\\\"\\n    };\\n    record.startTime = Date.now();\\n    record.data = {\\n      timerId: id,\\n      timeout: timeout,\\n      singleShot: singleShot\\n    };\\n    addStackTrace(record, 4);\\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\\n  };\\n\\n  Timeline.addRecord_TimerRemove = function(id, timeout, singleShot) {\\n    var record;\\n    if (!Timeline.isRunning()) {\\n      return;\\n    }\\n    record = {};\\n    record.type = TimelineRecordType.TimerRemove;\\n    record.category = {\\n      name: \\\"scripting\\\"\\n    };\\n    record.startTime = Date.now();\\n    record.data = {\\n      timerId: id,\\n      timeout: timeout,\\n      singleShot: singleShot\\n    };\\n    addStackTrace(record, 4);\\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\\n  };\\n\\n  Timeline.addRecord_TimerFire = function(id, timeout, singleShot) {\\n    var record;\\n    if (!Timeline.isRunning()) {\\n      return;\\n    }\\n    record = {};\\n    record.type = TimelineRecordType.TimerFire;\\n    record.category = {\\n      name: \\\"scripting\\\"\\n    };\\n    record.startTime = Date.now();\\n    record.data = {\\n      timerId: id,\\n      timeout: timeout,\\n      singleShot: singleShot\\n    };\\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\\n  };\\n\\n  Timeline.addRecord_XHRReadyStateChange = function(method, url, id, xhr) {\\n    var contentLength, contentType, e, record;\\n    if (!Timeline.isRunning()) {\\n      return;\\n    }\\n    try {\\n      contentLength = xhr.getResponseHeader(\\\"Content-Length\\\");\\n      contentLength = parseInt(contentLength);\\n      contentType = xhr.getResponseHeader(\\\"Content-Type\\\");\\n    } catch (_error) {\\n      e = _error;\\n      contentLength = 0;\\n      contentType = \\\"unknown\\\";\\n    }\\n    record = {};\\n    record.startTime = Date.now();\\n    record.category = {\\n      name: \\\"loading\\\"\\n    };\\n    if (xhr.readyState === XMLHttpRequest.OPENED) {\\n      record.type = TimelineRecordType.ResourceSendRequest;\\n      record.data = {\\n        identifier: id,\\n        url: url,\\n        requestMethod: method\\n      };\\n    } else if (xhr.readyState === XMLHttpRequest.DONE) {\\n      record.type = TimelineRecordType.ResourceReceiveResponse;\\n      record.data = {\\n        identifier: id,\\n        statusCode: xhr.status,\\n        mimeType: contentType,\\n        url: url\\n      };\\n      if (!isNaN(contentLength)) {\\n        record.data.expectedContentLength = contentLength;\\n      }\\n    } else {\\n      return;\\n    }\\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\\n  };\\n\\n  Timeline.installGlobalListeners = function() {\\n    if (window.applicationCache) {\\n      applicationCache.addEventListener(\\\"checking\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.checking\\\", \\\"loading\\\");\\n      }), false);\\n      applicationCache.addEventListener(\\\"error\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.error\\\", \\\"loading\\\");\\n      }), false);\\n      applicationCache.addEventListener(\\\"noupdate\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.noupdate\\\", \\\"loading\\\");\\n      }), false);\\n      applicationCache.addEventListener(\\\"downloading\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.downloading\\\", \\\"loading\\\");\\n      }), false);\\n      applicationCache.addEventListener(\\\"progress\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.progress\\\", \\\"loading\\\");\\n      }), false);\\n      applicationCache.addEventListener(\\\"updateready\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.updateready\\\", \\\"loading\\\");\\n      }), false);\\n      applicationCache.addEventListener(\\\"cached\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.cached\\\", \\\"loading\\\");\\n      }), false);\\n      applicationCache.addEventListener(\\\"obsolete\\\", (function(e) {\\n        return Timeline.addRecord_EventDispatch(e, \\\"applicationCache.obsolete\\\", \\\"loading\\\");\\n      }), false);\\n    }\\n    window.addEventListener(\\\"error\\\", (function(e) {\\n      return Timeline.addRecord_EventDispatch(e, \\\"window.error\\\");\\n    }), false);\\n    window.addEventListener(\\\"hashchange\\\", (function(e) {\\n      return Timeline.addRecord_EventDispatch(e, \\\"window.hashchange\\\");\\n    }), false);\\n    window.addEventListener(\\\"message\\\", (function(e) {\\n      return Timeline.addRecord_EventDispatch(e, \\\"window.message\\\");\\n    }), false);\\n    window.addEventListener(\\\"offline\\\", (function(e) {\\n      return Timeline.addRecord_EventDispatch(e, \\\"window.offline\\\");\\n    }), false);\\n    window.addEventListener(\\\"online\\\", (function(e) {\\n      return Timeline.addRecord_EventDispatch(e, \\\"window.online\\\");\\n    }), false);\\n    return window.addEventListener(\\\"scroll\\\", (function(e) {\\n      return Timeline.addRecord_EventDispatch(e, \\\"window.scroll\\\");\\n    }), false);\\n  };\\n\\n  Timeline.installNativeHooks = function() {\\n    HookSites.window_setInterval.addHooks({\\n      before: function(receiver, args) {\\n        var code, interval;\\n        code = args[0];\\n        if (typeof code !== \\\"function\\\") {\\n          return;\\n        }\\n        interval = args[1];\\n        code = instrumentedTimerCode(code, interval, false);\\n        args[0] = code;\\n        this.userData = {};\\n        this.userData.code = code;\\n        return this.userData.interval = interval;\\n      },\\n      after: function(receiver, args, result) {\\n        var code, id;\\n        if (!this.userData) {\\n          return;\\n        }\\n        code = this.userData.code;\\n        if (typeof code !== \\\"function\\\") {\\n          return;\\n        }\\n        id = result;\\n        code.__timerId = id;\\n        return addTimer(id, this.userData.interval, false);\\n      }\\n    });\\n    HookSites.window_clearInterval.addHooks({\\n      before: function(receiver, args) {\\n        var id;\\n        id = args[0];\\n        return removeTimer(id, false);\\n      }\\n    });\\n    HookSites.window_setTimeout.addHooks({\\n      before: function(receiver, args) {\\n        var code, interval;\\n        code = args[0];\\n        if (typeof code !== \\\"function\\\") {\\n          return;\\n        }\\n        interval = args[1];\\n        code = instrumentedTimerCode(code, interval, true);\\n        args[0] = code;\\n        this.userData = {};\\n        this.userData.code = code;\\n        return this.userData.interval = interval;\\n      },\\n      after: function(receiver, args, result) {\\n        var code, id;\\n        if (!this.userData) {\\n          return;\\n        }\\n        code = this.userData.code;\\n        if (typeof code !== \\\"function\\\") {\\n          return;\\n        }\\n        id = result;\\n        code.__timerId = id;\\n        return addTimer(id, this.userData.interval, true);\\n      }\\n    });\\n    HookSites.window_clearTimeout.addHooks({\\n      before: function(receiver, args) {\\n        var id;\\n        id = args[0];\\n        return removeTimer(id, true);\\n      }\\n    });\\n    return HookSites.XMLHttpRequest_open.addHooks({\\n      before: function(receiver, args) {\\n        var xhr;\\n        xhr = receiver;\\n        IDGenerator.getId(xhr);\\n        xhr.__weinre_method = args[0];\\n        xhr.__weinre_url = args[1];\\n        return xhr.addEventListener(\\\"readystatechange\\\", getXhrEventHandler(xhr), false);\\n      }\\n    });\\n  };\\n\\n  return Timeline;\\n\\n})();\\n\\ngetXhrEventHandler = function(xhr) {\\n  return function(event) {\\n    return Timeline.addRecord_XHRReadyStateChange(xhr.__weinre_method, xhr.__weinre_url, IDGenerator.getId(xhr), xhr);\\n  };\\n};\\n\\naddTimer = function(id, timeout, singleShot) {\\n  var timerSet;\\n  timerSet = (singleShot ? TimerTimeouts : TimerIntervals);\\n  timerSet[id] = {\\n    id: id,\\n    timeout: timeout,\\n    singleShot: singleShot\\n  };\\n  return Timeline.addRecord_TimerInstall(id, timeout, singleShot);\\n};\\n\\nremoveTimer = function(id, singleShot) {\\n  var timer, timerSet;\\n  timerSet = (singleShot ? TimerTimeouts : TimerIntervals);\\n  timer = timerSet[id];\\n  if (!timer) {\\n    return;\\n  }\\n  Timeline.addRecord_TimerRemove(id, timer.timeout, singleShot);\\n  return delete timerSet[id];\\n};\\n\\ninstrumentedTimerCode = function(code, timeout, singleShot) {\\n  var instrumentedCode;\\n  if (typeof code !== \\\"function\\\") {\\n    return code;\\n  }\\n  instrumentedCode = function() {\\n    var id, result;\\n    result = code.apply(this, arguments);\\n    id = arguments.callee.__timerId;\\n    Timeline.addRecord_TimerFire(id, timeout, singleShot);\\n    return result;\\n  };\\n  instrumentedCode.displayName = code.name || code.displayName;\\n  return instrumentedCode;\\n};\\n\\naddStackTrace = function(record, skip) {\\n  var i, trace, _results;\\n  if (!skip) {\\n    skip = 1;\\n  }\\n  trace = new StackTrace(arguments).trace;\\n  record.stackTrace = [];\\n  i = skip;\\n  _results = [];\\n  while (i < trace.length) {\\n    record.stackTrace.push({\\n      functionName: trace[i],\\n      scriptName: \\\"\\\",\\n      lineNumber: \\\"\\\"\\n    });\\n    _results.push(i++);\\n  }\\n  return _results;\\n};\\n\\nTimeline.installGlobalListeners();\\n\\nTimeline.installNativeHooks();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/Timeline.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WeinreExtraClientCommandsImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Console, Weinre, WeinreExtraClientCommandsImpl, WiDatabaseImpl;\\n\\nWeinre = require('../common/Weinre');\\n\\nWiDatabaseImpl = require('./WiDatabaseImpl');\\n\\nConsole = require('./Console');\\n\\nmodule.exports = WeinreExtraClientCommandsImpl = (function() {\\n  function WeinreExtraClientCommandsImpl() {}\\n\\n  WeinreExtraClientCommandsImpl.prototype.getDatabases = function(callback) {\\n    var result;\\n    if (!callback) {\\n      return;\\n    }\\n    result = WiDatabaseImpl.getDatabases();\\n    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n  };\\n\\n  return WeinreExtraClientCommandsImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WeinreExtraClientCommandsImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WeinreTargetEventsImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Callback, Console, Weinre, WeinreTargetEventsImpl;\\n\\nWeinre = require('../common/Weinre');\\n\\nCallback = require('../common/Callback');\\n\\nConsole = require('./Console');\\n\\nmodule.exports = WeinreTargetEventsImpl = (function() {\\n  function WeinreTargetEventsImpl() {}\\n\\n  WeinreTargetEventsImpl.prototype.connectionCreated = function(clientChannel, targetChannel) {\\n    var message;\\n    message = (\\\"weinre: target \\\" + targetChannel + \\\" connected to client \\\") + clientChannel;\\n    Weinre.logInfo(message);\\n    return Weinre.target.whenBodyReady(this, [], function() {\\n      var oldValue;\\n      oldValue = Console.useRemote(true);\\n      Weinre.target.setDocument();\\n      Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\\n      return Weinre.wi.DOMStorage.initialize();\\n    });\\n  };\\n\\n  WeinreTargetEventsImpl.prototype.connectionDestroyed = function(clientChannel, targetChannel) {\\n    var message, oldValue;\\n    message = (\\\"weinre: target \\\" + targetChannel + \\\" disconnected from client \\\") + clientChannel;\\n    Weinre.logInfo(message);\\n    return oldValue = Console.useRemote(false);\\n  };\\n\\n  WeinreTargetEventsImpl.prototype.sendCallback = function(callbackId, result) {\\n    return Callback.invoke(callbackId, result);\\n  };\\n\\n  return WeinreTargetEventsImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WeinreTargetEventsImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WiConsoleImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Weinre, WiConsoleImpl;\\n\\nWeinre = require('../common/Weinre');\\n\\nmodule.exports = WiConsoleImpl = (function() {\\n  function WiConsoleImpl() {\\n    this.messagesEnabled = true;\\n  }\\n\\n  WiConsoleImpl.prototype.setConsoleMessagesEnabled = function(enabled, callback) {\\n    var oldValue;\\n    oldValue = this.messagesEnabled;\\n    this.messagesEnabled = enabled;\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [oldValue]);\\n    }\\n  };\\n\\n  WiConsoleImpl.prototype.clearConsoleMessages = function(callback) {\\n    Weinre.wi.ConsoleNotify.consoleMessagesCleared();\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\\n    }\\n  };\\n\\n  WiConsoleImpl.prototype.setMonitoringXHREnabled = function(enabled, callback) {\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\\n    }\\n  };\\n\\n  return WiConsoleImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WiConsoleImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WiCSSImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Weinre, WiCSSImpl;\\n\\nWeinre = require('../common/Weinre');\\n\\nmodule.exports = WiCSSImpl = (function() {\\n  function WiCSSImpl() {\\n    this.dummyComputedStyle = false;\\n  }\\n\\n  WiCSSImpl.prototype.getStylesForNode = function(nodeId, callback) {\\n    var computedStyle, node, parentNode, parentStyle, result;\\n    result = {};\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    if (this.dummyComputedStyle) {\\n      computedStyle = {\\n        styleId: null,\\n        properties: [],\\n        shorthandValues: [],\\n        cssProperties: []\\n      };\\n    } else {\\n      computedStyle = Weinre.cssStore.getComputedStyle(node);\\n    }\\n    result = {\\n      inlineStyle: Weinre.cssStore.getInlineStyle(node),\\n      computedStyle: computedStyle,\\n      matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(node),\\n      styleAttributes: Weinre.cssStore.getStyleAttributes(node),\\n      pseudoElements: Weinre.cssStore.getPseudoElements(node),\\n      inherited: []\\n    };\\n    parentNode = node.parentNode;\\n    while (parentNode) {\\n      parentStyle = {\\n        inlineStyle: Weinre.cssStore.getInlineStyle(parentNode),\\n        matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(parentNode)\\n      };\\n      result.inherited.push(parentStyle);\\n      parentNode = parentNode.parentNode;\\n    }\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiCSSImpl.prototype.getComputedStyleForNode = function(nodeId, callback) {\\n    var node, result;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    result = Weinre.cssStore.getComputedStyle(node);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiCSSImpl.prototype.getInlineStyleForNode = function(nodeId, callback) {\\n    var node, result;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    result = Weinre.cssStore.getInlineStyle(node);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiCSSImpl.prototype.getAllStyles = function(callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiCSSImpl.prototype.getStyleSheet = function(styleSheetId, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiCSSImpl.prototype.getStyleSheetText = function(styleSheetId, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiCSSImpl.prototype.setStyleSheetText = function(styleSheetId, text, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiCSSImpl.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite, callback) {\\n    var result;\\n    result = Weinre.cssStore.setPropertyText(styleId, propertyIndex, text, overwrite);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiCSSImpl.prototype.toggleProperty = function(styleId, propertyIndex, disable, callback) {\\n    var result;\\n    result = Weinre.cssStore.toggleProperty(styleId, propertyIndex, disable);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiCSSImpl.prototype.setRuleSelector = function(ruleId, selector, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiCSSImpl.prototype.addRule = function(contextNodeId, selector, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiCSSImpl.prototype.querySelectorAll = function(documentId, selector, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  return WiCSSImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WiCSSImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WiDatabaseImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar HookSites, IDGenerator, SqlStepper, Weinre, WiDatabaseImpl, dbAdd, dbById, dbRecordById, dbRecordByName, executeSQL_error, executeSQL_step_1, executeSQL_step_2, getTableNames_step_1, getTableNames_step_2, id2db, logSqlError, name2db;\\n\\nWeinre = require('../common/Weinre');\\n\\nIDGenerator = require('../common/IDGenerator');\\n\\nHookSites = require('./HookSites');\\n\\nSqlStepper = require('./SqlStepper');\\n\\nid2db = {};\\n\\nname2db = {};\\n\\nmodule.exports = WiDatabaseImpl = (function() {\\n  function WiDatabaseImpl() {\\n    if (!window.openDatabase) {\\n      return;\\n    }\\n    HookSites.window_openDatabase.addHooks({\\n      after: function(receiver, args, db) {\\n        var name, version;\\n        if (!db) {\\n          return;\\n        }\\n        name = args[0];\\n        version = args[1];\\n        return dbAdd(db, name, version);\\n      }\\n    });\\n  }\\n\\n  WiDatabaseImpl.getDatabases = function() {\\n    var id, result;\\n    result = [];\\n    for (id in id2db) {\\n      result.push(id2db[id]);\\n    }\\n    return result;\\n  };\\n\\n  WiDatabaseImpl.prototype.getDatabaseTableNames = function(databaseId, callback) {\\n    var db, stepper;\\n    db = dbById(databaseId);\\n    if (!db) {\\n      return;\\n    }\\n    stepper = SqlStepper([getTableNames_step_1, getTableNames_step_2]);\\n    stepper.callback = callback;\\n    return stepper.run(db, logSqlError);\\n  };\\n\\n  WiDatabaseImpl.prototype.executeSQL = function(databaseId, query, callback) {\\n    var db, stepper, txid;\\n    db = dbById(databaseId);\\n    if (!db) {\\n      return;\\n    }\\n    txid = Weinre.targetDescription.channel + \\\"-\\\" + IDGenerator.next();\\n    stepper = SqlStepper([executeSQL_step_1, executeSQL_step_2]);\\n    stepper.txid = txid;\\n    stepper.query = query;\\n    stepper.callback = callback;\\n    stepper.run(db, executeSQL_error);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [true, txid]);\\n    }\\n  };\\n\\n  return WiDatabaseImpl;\\n\\n})();\\n\\nlogSqlError = function(sqlError) {\\n  return console.log((\\\"SQL Error \\\" + sqlError.code + \\\": \\\") + sqlError.message);\\n};\\n\\ngetTableNames_step_1 = function() {\\n  return this.executeSql(\\\"SELECT name FROM sqlite_master WHERE type='table'\\\");\\n};\\n\\ngetTableNames_step_2 = function(resultSet) {\\n  var i, name, result, rows;\\n  rows = resultSet.rows;\\n  result = [];\\n  i = 0;\\n  while (i < rows.length) {\\n    name = rows.item(i).name;\\n    if (name === \\\"__WebKitDatabaseInfoTable__\\\") {\\n      i++;\\n      continue;\\n    }\\n    result.push(name);\\n    i++;\\n  }\\n  return Weinre.WeinreTargetCommands.sendClientCallback(this.callback, [result]);\\n};\\n\\nexecuteSQL_step_1 = function() {\\n  return this.executeSql(this.query);\\n};\\n\\nexecuteSQL_step_2 = function(resultSet) {\\n  var columnNames, i, j, propName, row, rows, values;\\n  columnNames = [];\\n  values = [];\\n  rows = resultSet.rows;\\n  i = 0;\\n  while (i < rows.length) {\\n    row = rows.item(i);\\n    if (i === 0) {\\n      for (propName in row) {\\n        columnNames.push(propName);\\n      }\\n    }\\n    j = 0;\\n    while (j < columnNames.length) {\\n      values.push(row[columnNames[j]]);\\n      j++;\\n    }\\n    i++;\\n  }\\n  return Weinre.wi.DatabaseNotify.sqlTransactionSucceeded(this.txid, columnNames, values);\\n};\\n\\nexecuteSQL_error = function(sqlError) {\\n  var error;\\n  error = {\\n    code: sqlError.code,\\n    message: sqlError.message\\n  };\\n  return Weinre.wi.DatabaseNotify.sqlTransactionFailed(this.txid, error);\\n};\\n\\ndbById = function(id) {\\n  var record;\\n  record = id2db[id];\\n  if (!record) {\\n    return null;\\n  }\\n  return record.db;\\n};\\n\\ndbRecordById = function(id) {\\n  return id2db[id];\\n};\\n\\ndbRecordByName = function(name) {\\n  return name2db[name];\\n};\\n\\ndbAdd = function(db, name, version) {\\n  var payload, record;\\n  record = dbRecordByName(name);\\n  if (record) {\\n    return record;\\n  }\\n  record = {};\\n  record.id = IDGenerator.next();\\n  record.domain = window.location.origin;\\n  record.name = name;\\n  record.version = version;\\n  record.db = db;\\n  id2db[record.id] = record;\\n  name2db[name] = record;\\n  payload = {};\\n  payload.id = record.id;\\n  payload.domain = record.domain;\\n  payload.name = name;\\n  payload.version = version;\\n  return Weinre.WeinreExtraTargetEvents.databaseOpened(payload);\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WiDatabaseImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WiDOMImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Weinre, WiDOMImpl;\\n\\nWeinre = require('../common/Weinre');\\n\\nmodule.exports = WiDOMImpl = (function() {\\n  function WiDOMImpl() {}\\n\\n  WiDOMImpl.prototype.getChildNodes = function(nodeId, callback) {\\n    var children, node;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    children = Weinre.nodeStore.serializeNodeChildren(node, 1);\\n    Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.setAttribute = function(elementId, name, value, callback) {\\n    var element;\\n    element = Weinre.nodeStore.getNode(elementId);\\n    if (!element) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid elementId: \\\" + elementId);\\n      return;\\n    }\\n    element.setAttribute(name, value);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.removeAttribute = function(elementId, name, callback) {\\n    var element;\\n    element = Weinre.nodeStore.getNode(elementId);\\n    if (!element) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid elementId: \\\" + elementId);\\n      return;\\n    }\\n    element.removeAttribute(name);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.setTextNodeValue = function(nodeId, value, callback) {\\n    var node;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    node.nodeValue = value;\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.getEventListenersForNode = function(nodeId, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiDOMImpl.prototype.copyNode = function(nodeId, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiDOMImpl.prototype.removeNode = function(nodeId, callback) {\\n    var node;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    if (!node.parentNode) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed a parentless node: \\\" + node);\\n      return;\\n    }\\n    node.parentNode.removeChild(node);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.changeTagName = function(nodeId, newTagName, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiDOMImpl.prototype.getOuterHTML = function(nodeId, callback) {\\n    var node, value;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    value = node.outerHTML;\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [value]);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.setOuterHTML = function(nodeId, outerHTML, callback) {\\n    var node;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    node.outerHTML = outerHTML;\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.addInspectedNode = function(nodeId, callback) {\\n    Weinre.nodeStore.addInspectedNode(nodeId);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.performSearch = function(query, runSynchronously, callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiDOMImpl.prototype.searchCanceled = function(callback) {\\n    return Weinre.notImplemented(arguments.callee.signature);\\n  };\\n\\n  WiDOMImpl.prototype.pushNodeByPathToFrontend = function(path, callback) {\\n    var childNodeIds, curr, currId, i, index, nodeId, nodeName, parts, _i, _ref;\\n    parts = path.split(\\\",\\\");\\n    curr = document;\\n    currId = null;\\n    nodeId = Weinre.nodeStore.getNodeId(curr);\\n    this.getChildNodes(nodeId);\\n    for (i = _i = 0, _ref = parts.length; _i < _ref; i = _i += 2) {\\n      index = parseInt(parts[i]);\\n      nodeName = parts[i + 1];\\n      if (isNaN(index)) {\\n        return;\\n      }\\n      childNodeIds = Weinre.nodeStore.childNodeIds(curr);\\n      currId = childNodeIds[index];\\n      if (!currId) {\\n        return;\\n      }\\n      this.getChildNodes(currId);\\n      curr = Weinre.nodeStore.getNode(currId);\\n      if (curr.nodeName !== nodeName) {\\n        return;\\n      }\\n    }\\n    if (callback && currId) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [currId]);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.resolveNode = function(nodeId, callback) {\\n    var result;\\n    result = Weinre.injectedScript.resolveNode(nodeId);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.getNodeProperties = function(nodeId, propertiesArray, callback) {\\n    var result;\\n    propertiesArray = JSON.stringify(propertiesArray);\\n    result = Weinre.injectedScript.getNodeProperties(nodeId, propertiesArray);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.getNodePrototypes = function(nodeId, callback) {\\n    var result;\\n    result = Weinre.injectedScript.getNodePrototypes(nodeId);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiDOMImpl.prototype.pushNodeToFrontend = function(objectId, callback) {\\n    var result;\\n    objectId = JSON.stringify(objectId);\\n    result = Weinre.injectedScript.pushNodeToFrontend(objectId);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  return WiDOMImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WiDOMImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WiDOMStorageImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar HookSites, Weinre, WiDOMStorageImpl, _getStorageArea, _storageEventHandler;\\n\\nWeinre = require('../common/Weinre');\\n\\nHookSites = require('./HookSites');\\n\\nmodule.exports = WiDOMStorageImpl = (function() {\\n  function WiDOMStorageImpl() {}\\n\\n  WiDOMStorageImpl.prototype.getDOMStorageEntries = function(storageId, callback) {\\n    var i, key, length, result, storageArea, val;\\n    storageArea = _getStorageArea(storageId);\\n    if (!storageArea) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid storageId: \\\" + storageId);\\n      return;\\n    }\\n    result = [];\\n    length = storageArea.length;\\n    i = 0;\\n    while (i < length) {\\n      key = storageArea.key(i);\\n      val = storageArea.getItem(key);\\n      result.push([key, val]);\\n      i++;\\n    }\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiDOMStorageImpl.prototype.setDOMStorageItem = function(storageId, key, value, callback) {\\n    var e, result, storageArea;\\n    storageArea = _getStorageArea(storageId);\\n    if (!storageArea) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid storageId: \\\" + storageId);\\n      return;\\n    }\\n    result = true;\\n    try {\\n      HookLib.ignoreHooks(function() {\\n        if (storageArea === window.localStorage) {\\n          return localStorage.setItem(key, value);\\n        } else if (storageArea === window.sessionStorage) {\\n          return sessionStorage.setItem(key, value);\\n        }\\n      });\\n    } catch (_error) {\\n      e = _error;\\n      result = false;\\n    }\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiDOMStorageImpl.prototype.removeDOMStorageItem = function(storageId, key, callback) {\\n    var e, result, storageArea;\\n    storageArea = _getStorageArea(storageId);\\n    if (!storageArea) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid storageId: \\\" + storageId);\\n      return;\\n    }\\n    result = true;\\n    try {\\n      HookLib.ignoreHooks(function() {\\n        if (storageArea === window.localStorage) {\\n          return localStorage.removeItem(key);\\n        } else if (storageArea === window.sessionStorage) {\\n          return sessionStorage.removeItem(key);\\n        }\\n      });\\n    } catch (_error) {\\n      e = _error;\\n      result = false;\\n    }\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiDOMStorageImpl.prototype.initialize = function() {\\n    if (window.localStorage) {\\n      Weinre.wi.DOMStorageNotify.addDOMStorage({\\n        id: 1,\\n        host: window.location.host,\\n        isLocalStorage: true\\n      });\\n      HookSites.LocalStorage_setItem.addHooks({\\n        after: function() {\\n          return _storageEventHandler({\\n            storageArea: window.localStorage\\n          });\\n        }\\n      });\\n      HookSites.LocalStorage_removeItem.addHooks({\\n        after: function() {\\n          return _storageEventHandler({\\n            storageArea: window.localStorage\\n          });\\n        }\\n      });\\n      HookSites.LocalStorage_clear.addHooks({\\n        after: function() {\\n          return _storageEventHandler({\\n            storageArea: window.localStorage\\n          });\\n        }\\n      });\\n    }\\n    if (window.sessionStorage) {\\n      Weinre.wi.DOMStorageNotify.addDOMStorage({\\n        id: 2,\\n        host: window.location.host,\\n        isLocalStorage: false\\n      });\\n      HookSites.SessionStorage_setItem.addHooks({\\n        after: function() {\\n          return _storageEventHandler({\\n            storageArea: window.sessionStorage\\n          });\\n        }\\n      });\\n      HookSites.SessionStorage_removeItem.addHooks({\\n        after: function() {\\n          return _storageEventHandler({\\n            storageArea: window.sessionStorage\\n          });\\n        }\\n      });\\n      HookSites.SessionStorage_clear.addHooks({\\n        after: function() {\\n          return _storageEventHandler({\\n            storageArea: window.sessionStorage\\n          });\\n        }\\n      });\\n    }\\n    return document.addEventListener(\\\"storage\\\", _storageEventHandler, false);\\n  };\\n\\n  return WiDOMStorageImpl;\\n\\n})();\\n\\n_getStorageArea = function(storageId) {\\n  if (storageId === 1) {\\n    return window.localStorage;\\n  } else if (storageId === 2) {\\n    return window.sessionStorage;\\n  }\\n  return null;\\n};\\n\\n_storageEventHandler = function(event) {\\n  var storageId;\\n  if (event.storageArea === window.localStorage) {\\n    storageId = 1;\\n  } else if (event.storageArea === window.sessionStorage) {\\n    storageId = 2;\\n  } else {\\n    return;\\n  }\\n  return Weinre.wi.DOMStorageNotify.updateDOMStorage(storageId);\\n};\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WiDOMStorageImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WiInspectorImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Timeline, Weinre, WiInspectorImpl;\\n\\nWeinre = require('../common/Weinre');\\n\\nTimeline = require('../target/Timeline');\\n\\nmodule.exports = WiInspectorImpl = (function() {\\n  function WiInspectorImpl() {}\\n\\n  WiInspectorImpl.prototype.reloadPage = function(callback) {\\n    if (callback) {\\n      Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n    return window.location.reload();\\n  };\\n\\n  WiInspectorImpl.prototype.highlightDOMNode = function(nodeId, callback) {\\n    var node;\\n    node = Weinre.nodeStore.getNode(nodeId);\\n    if (!node) {\\n      Weinre.logWarning(arguments.callee.signature + \\\" passed an invalid nodeId: \\\" + nodeId);\\n      return;\\n    }\\n    Weinre.elementHighlighter.on(node);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiInspectorImpl.prototype.hideDOMNodeHighlight = function(callback) {\\n    Weinre.elementHighlighter.off();\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiInspectorImpl.prototype.startTimelineProfiler = function(callback) {\\n    Timeline.start();\\n    Weinre.wi.TimelineNotify.timelineProfilerWasStarted();\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  WiInspectorImpl.prototype.stopTimelineProfiler = function(callback) {\\n    Timeline.stop();\\n    Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\\n    }\\n  };\\n\\n  return WiInspectorImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WiInspectorImpl.amd.js\")\n;eval(\";modjewel.define(\\\"weinre/target/WiRuntimeImpl\\\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\\nvar Weinre, WiRuntimeImpl;\\n\\nWeinre = require('../common/Weinre');\\n\\nmodule.exports = WiRuntimeImpl = (function() {\\n  function WiRuntimeImpl() {}\\n\\n  WiRuntimeImpl.prototype.evaluate = function(expression, objectGroup, includeCommandLineAPI, callback) {\\n    var result;\\n    result = Weinre.injectedScript.evaluate(expression, objectGroup, includeCommandLineAPI);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiRuntimeImpl.prototype.getCompletions = function(expression, includeCommandLineAPI, callback) {\\n    var result;\\n    result = Weinre.injectedScript.getCompletions(expression, includeCommandLineAPI);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiRuntimeImpl.prototype.getProperties = function(objectId, ignoreHasOwnProperty, abbreviate, callback) {\\n    var result;\\n    objectId = JSON.stringify(objectId);\\n    result = Weinre.injectedScript.getProperties(objectId, ignoreHasOwnProperty, abbreviate);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiRuntimeImpl.prototype.setPropertyValue = function(objectId, propertyName, expression, callback) {\\n    var result;\\n    objectId = JSON.stringify(objectId);\\n    result = Weinre.injectedScript.setPropertyValue(objectId, propertyName, expression);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  WiRuntimeImpl.prototype.releaseWrapperObjectGroup = function(injectedScriptId, objectGroup, callback) {\\n    var result;\\n    result = Weinre.injectedScript.releaseWrapperObjectGroup(objectGroup);\\n    if (callback) {\\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\\n    }\\n  };\\n\\n  return WiRuntimeImpl;\\n\\n})();\\n\\nrequire(\\\"../common/MethodNamer\\\").setNamesForClass(module.exports);\\n\\n});\\n\\n//@ sourceURL=weinre/target/WiRuntimeImpl.amd.js\")\n;eval(\"modjewel.require('weinre/common/Weinre').addIDLs([{\\\"interfaces\\\": [{\\\"name\\\": \\\"InjectedScriptHost\\\", \\\"methods\\\": [{\\\"name\\\": \\\"clearConsoleMessages\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"copyText\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"text\\\"}]}, {\\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}], \\\"name\\\": \\\"nodeForId\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"node\\\"}, {\\\"name\\\": \\\"withChildren\\\"}, {\\\"name\\\": \\\"selectInUI\\\"}], \\\"name\\\": \\\"pushNodePathToFrontend\\\"}, {\\\"name\\\": \\\"inspectedNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"num\\\"}]}, {\\\"parameters\\\": [{\\\"name\\\": \\\"object\\\"}], \\\"name\\\": \\\"internalConstructorName\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"currentCallFrame\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"database\\\"}], \\\"name\\\": \\\"selectDatabase\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"storage\\\"}], \\\"name\\\": \\\"selectDOMStorage\\\"}, {\\\"name\\\": \\\"didCreateWorker\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"id\\\"}, {\\\"name\\\": \\\"url\\\"}, {\\\"name\\\": \\\"isFakeWorker\\\"}]}, {\\\"name\\\": \\\"didDestroyWorker\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"id\\\"}]}, {\\\"name\\\": \\\"nextWorkerId\\\", \\\"parameters\\\": []}]}], \\\"name\\\": \\\"core\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"Inspector\\\", \\\"methods\\\": [{\\\"name\\\": \\\"addScriptToEvaluateOnLoad\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"scriptSource\\\"}]}, {\\\"name\\\": \\\"removeAllScriptsToEvaluateOnLoad\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"reloadPage\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"ignoreCache\\\"}]}, {\\\"name\\\": \\\"populateScriptObjects\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"openInInspectedWindow\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"url\\\"}]}, {\\\"name\\\": \\\"setSearchingForNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"enabled\\\"}]}, {\\\"name\\\": \\\"didEvaluateForTestInFrontend\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"testCallId\\\"}, {\\\"name\\\": \\\"jsonResult\\\"}]}, {\\\"name\\\": \\\"highlightDOMNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"hideDOMNodeHighlight\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"highlightFrame\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"frameId\\\"}]}, {\\\"name\\\": \\\"hideFrameHighlight\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"setUserAgentOverride\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"userAgent\\\"}]}, {\\\"name\\\": \\\"getCookies\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"deleteCookie\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"cookieName\\\"}, {\\\"name\\\": \\\"domain\\\"}]}, {\\\"name\\\": \\\"startTimelineProfiler\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"stopTimelineProfiler\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"enableDebugger\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"disableDebugger\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"enableProfiler\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"disableProfiler\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"startProfiling\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"stopProfiling\\\", \\\"parameters\\\": []}]}, {\\\"name\\\": \\\"Runtime\\\", \\\"methods\\\": [{\\\"name\\\": \\\"evaluate\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"expression\\\"}, {\\\"name\\\": \\\"objectGroup\\\"}, {\\\"name\\\": \\\"includeCommandLineAPI\\\"}]}, {\\\"name\\\": \\\"getCompletions\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"expression\\\"}, {\\\"name\\\": \\\"includeCommandLineAPI\\\"}]}, {\\\"name\\\": \\\"getProperties\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"objectId\\\"}, {\\\"name\\\": \\\"ignoreHasOwnProperty\\\"}, {\\\"name\\\": \\\"abbreviate\\\"}]}, {\\\"name\\\": \\\"setPropertyValue\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"objectId\\\"}, {\\\"name\\\": \\\"propertyName\\\"}, {\\\"name\\\": \\\"expression\\\"}]}, {\\\"name\\\": \\\"releaseWrapperObjectGroup\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"injectedScriptId\\\"}, {\\\"name\\\": \\\"objectGroup\\\"}]}]}, {\\\"name\\\": \\\"InjectedScript\\\", \\\"methods\\\": [{\\\"name\\\": \\\"evaluateOnSelf\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"functionBody\\\"}, {\\\"name\\\": \\\"argumentsArray\\\"}]}]}, {\\\"name\\\": \\\"Console\\\", \\\"methods\\\": [{\\\"name\\\": \\\"setConsoleMessagesEnabled\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"enabled\\\"}]}, {\\\"name\\\": \\\"clearConsoleMessages\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"setMonitoringXHREnabled\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"enabled\\\"}]}]}, {\\\"name\\\": \\\"Network\\\", \\\"methods\\\": [{\\\"name\\\": \\\"cachedResources\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"resourceContent\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"frameId\\\"}, {\\\"name\\\": \\\"url\\\"}, {\\\"name\\\": \\\"base64Encode\\\"}]}, {\\\"name\\\": \\\"setExtraHeaders\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"headers\\\"}]}]}, {\\\"name\\\": \\\"Database\\\", \\\"methods\\\": [{\\\"name\\\": \\\"getDatabaseTableNames\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"databaseId\\\"}]}, {\\\"name\\\": \\\"executeSQL\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"databaseId\\\"}, {\\\"name\\\": \\\"query\\\"}]}]}, {\\\"name\\\": \\\"DOMStorage\\\", \\\"methods\\\": [{\\\"name\\\": \\\"getDOMStorageEntries\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"storageId\\\"}]}, {\\\"name\\\": \\\"setDOMStorageItem\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"storageId\\\"}, {\\\"name\\\": \\\"key\\\"}, {\\\"name\\\": \\\"value\\\"}]}, {\\\"name\\\": \\\"removeDOMStorageItem\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"storageId\\\"}, {\\\"name\\\": \\\"key\\\"}]}]}, {\\\"name\\\": \\\"ApplicationCache\\\", \\\"methods\\\": [{\\\"name\\\": \\\"getApplicationCaches\\\", \\\"parameters\\\": []}]}, {\\\"name\\\": \\\"DOM\\\", \\\"methods\\\": [{\\\"name\\\": \\\"getChildNodes\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"setAttribute\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"elementId\\\"}, {\\\"name\\\": \\\"name\\\"}, {\\\"name\\\": \\\"value\\\"}]}, {\\\"name\\\": \\\"removeAttribute\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"elementId\\\"}, {\\\"name\\\": \\\"name\\\"}]}, {\\\"name\\\": \\\"setTextNodeValue\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}, {\\\"name\\\": \\\"value\\\"}]}, {\\\"name\\\": \\\"getEventListenersForNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"copyNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"removeNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"changeTagName\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}, {\\\"name\\\": \\\"newTagName\\\"}]}, {\\\"name\\\": \\\"getOuterHTML\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"setOuterHTML\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}, {\\\"name\\\": \\\"outerHTML\\\"}]}, {\\\"name\\\": \\\"addInspectedNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"performSearch\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"query\\\"}, {\\\"name\\\": \\\"runSynchronously\\\"}]}, {\\\"name\\\": \\\"searchCanceled\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"pushNodeByPathToFrontend\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"path\\\"}]}, {\\\"name\\\": \\\"resolveNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"getNodeProperties\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}, {\\\"name\\\": \\\"propertiesArray\\\"}]}, {\\\"name\\\": \\\"getNodePrototypes\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"pushNodeToFrontend\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"objectId\\\"}]}]}, {\\\"name\\\": \\\"CSS\\\", \\\"methods\\\": [{\\\"name\\\": \\\"getStylesForNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"getComputedStyleForNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"getInlineStyleForNode\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}]}, {\\\"name\\\": \\\"getAllStyles\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"getStyleSheet\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"styleSheetId\\\"}]}, {\\\"name\\\": \\\"getStyleSheetText\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"styleSheetId\\\"}]}, {\\\"name\\\": \\\"setStyleSheetText\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"styleSheetId\\\"}, {\\\"name\\\": \\\"text\\\"}]}, {\\\"name\\\": \\\"setPropertyText\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"styleId\\\"}, {\\\"name\\\": \\\"propertyIndex\\\"}, {\\\"name\\\": \\\"text\\\"}, {\\\"name\\\": \\\"overwrite\\\"}]}, {\\\"name\\\": \\\"toggleProperty\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"styleId\\\"}, {\\\"name\\\": \\\"propertyIndex\\\"}, {\\\"name\\\": \\\"disable\\\"}]}, {\\\"name\\\": \\\"setRuleSelector\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"ruleId\\\"}, {\\\"name\\\": \\\"selector\\\"}]}, {\\\"name\\\": \\\"addRule\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"contextNodeId\\\"}, {\\\"name\\\": \\\"selector\\\"}]}, {\\\"name\\\": \\\"getSupportedCSSProperties\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"querySelectorAll\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"documentId\\\"}, {\\\"name\\\": \\\"selector\\\"}]}]}, {\\\"name\\\": \\\"Timeline\\\", \\\"methods\\\": []}, {\\\"name\\\": \\\"Debugger\\\", \\\"methods\\\": [{\\\"name\\\": \\\"activateBreakpoints\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"deactivateBreakpoints\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"setJavaScriptBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"url\\\"}, {\\\"name\\\": \\\"lineNumber\\\"}, {\\\"name\\\": \\\"columnNumber\\\"}, {\\\"name\\\": \\\"condition\\\"}, {\\\"name\\\": \\\"enabled\\\"}]}, {\\\"name\\\": \\\"setJavaScriptBreakpointBySourceId\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"sourceId\\\"}, {\\\"name\\\": \\\"lineNumber\\\"}, {\\\"name\\\": \\\"columnNumber\\\"}, {\\\"name\\\": \\\"condition\\\"}, {\\\"name\\\": \\\"enabled\\\"}]}, {\\\"name\\\": \\\"removeJavaScriptBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"breakpointId\\\"}]}, {\\\"name\\\": \\\"continueToLocation\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"sourceId\\\"}, {\\\"name\\\": \\\"lineNumber\\\"}, {\\\"name\\\": \\\"columnNumber\\\"}]}, {\\\"name\\\": \\\"stepOver\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"stepInto\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"stepOut\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"pause\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"resume\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"editScriptSource\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"sourceID\\\"}, {\\\"name\\\": \\\"newContent\\\"}]}, {\\\"name\\\": \\\"getScriptSource\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"sourceID\\\"}]}, {\\\"name\\\": \\\"setPauseOnExceptionsState\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"pauseOnExceptionsState\\\"}]}, {\\\"name\\\": \\\"evaluateOnCallFrame\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"callFrameId\\\"}, {\\\"name\\\": \\\"expression\\\"}, {\\\"name\\\": \\\"objectGroup\\\"}, {\\\"name\\\": \\\"includeCommandLineAPI\\\"}]}, {\\\"name\\\": \\\"getCompletionsOnCallFrame\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"callFrameId\\\"}, {\\\"name\\\": \\\"expression\\\"}, {\\\"name\\\": \\\"includeCommandLineAPI\\\"}]}]}, {\\\"name\\\": \\\"BrowserDebugger\\\", \\\"methods\\\": [{\\\"name\\\": \\\"setAllBrowserBreakpoints\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"breakpoints\\\"}]}, {\\\"name\\\": \\\"setDOMBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}, {\\\"name\\\": \\\"type\\\"}]}, {\\\"name\\\": \\\"removeDOMBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}, {\\\"name\\\": \\\"type\\\"}]}, {\\\"name\\\": \\\"setEventListenerBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"eventName\\\"}]}, {\\\"name\\\": \\\"removeEventListenerBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"eventName\\\"}]}, {\\\"name\\\": \\\"setXHRBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"url\\\"}]}, {\\\"name\\\": \\\"removeXHRBreakpoint\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"url\\\"}]}]}, {\\\"name\\\": \\\"Profiler\\\", \\\"methods\\\": [{\\\"name\\\": \\\"getProfileHeaders\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"getProfile\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"type\\\"}, {\\\"name\\\": \\\"uid\\\"}]}, {\\\"name\\\": \\\"removeProfile\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"type\\\"}, {\\\"name\\\": \\\"uid\\\"}]}, {\\\"name\\\": \\\"clearProfiles\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"takeHeapSnapshot\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"detailed\\\"}]}]}, {\\\"name\\\": \\\"InspectorNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [], \\\"name\\\": \\\"frontendReused\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"nodeIds\\\"}], \\\"name\\\": \\\"addNodesToSearchResult\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"bringToFront\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"disconnectFromBackend\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"url\\\"}], \\\"name\\\": \\\"inspectedURLChanged\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"time\\\"}], \\\"name\\\": \\\"domContentEventFired\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"time\\\"}], \\\"name\\\": \\\"loadEventFired\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"reset\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"panel\\\"}], \\\"name\\\": \\\"showPanel\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"testCallId\\\"}, {\\\"name\\\": \\\"script\\\"}], \\\"name\\\": \\\"evaluateForTestInFrontend\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"nodeId\\\"}], \\\"name\\\": \\\"updateFocusedNode\\\"}]}, {\\\"name\\\": \\\"ConsoleNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [{\\\"name\\\": \\\"messageObj\\\"}], \\\"name\\\": \\\"addConsoleMessage\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"count\\\"}], \\\"name\\\": \\\"updateConsoleMessageExpiredCount\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"count\\\"}], \\\"name\\\": \\\"updateConsoleMessageRepeatCount\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"consoleMessagesCleared\\\"}]}, {\\\"name\\\": \\\"NetworkNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [{\\\"name\\\": \\\"frameId\\\"}], \\\"name\\\": \\\"frameDetachedFromParent\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"url\\\"}, {\\\"name\\\": \\\"loader\\\"}, {\\\"name\\\": \\\"callStack\\\"}], \\\"name\\\": \\\"identifierForInitialRequest\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"time\\\"}, {\\\"name\\\": \\\"request\\\"}, {\\\"name\\\": \\\"redirectResponse\\\"}], \\\"name\\\": \\\"willSendRequest\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}], \\\"name\\\": \\\"markResourceAsCached\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"time\\\"}, {\\\"name\\\": \\\"resourceType\\\"}, {\\\"name\\\": \\\"response\\\"}], \\\"name\\\": \\\"didReceiveResponse\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"time\\\"}, {\\\"name\\\": \\\"lengthReceived\\\"}], \\\"name\\\": \\\"didReceiveContentLength\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"finishTime\\\"}], \\\"name\\\": \\\"didFinishLoading\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"time\\\"}, {\\\"name\\\": \\\"localizedDescription\\\"}], \\\"name\\\": \\\"didFailLoading\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"time\\\"}, {\\\"name\\\": \\\"resource\\\"}], \\\"name\\\": \\\"didLoadResourceFromMemoryCache\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"sourceString\\\"}, {\\\"name\\\": \\\"type\\\"}], \\\"name\\\": \\\"setInitialContent\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"frame\\\"}, {\\\"name\\\": \\\"loader\\\"}], \\\"name\\\": \\\"didCommitLoadForFrame\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"requestURL\\\"}], \\\"name\\\": \\\"didCreateWebSocket\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"time\\\"}, {\\\"name\\\": \\\"request\\\"}], \\\"name\\\": \\\"willSendWebSocketHandshakeRequest\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"time\\\"}, {\\\"name\\\": \\\"response\\\"}], \\\"name\\\": \\\"didReceiveWebSocketHandshakeResponse\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"identifier\\\"}, {\\\"name\\\": \\\"time\\\"}], \\\"name\\\": \\\"didCloseWebSocket\\\"}]}, {\\\"name\\\": \\\"DatabaseNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [{\\\"name\\\": \\\"database\\\"}], \\\"name\\\": \\\"addDatabase\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"databaseId\\\"}], \\\"name\\\": \\\"selectDatabase\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"transactionId\\\"}, {\\\"name\\\": \\\"columnNames\\\"}, {\\\"name\\\": \\\"values\\\"}], \\\"name\\\": \\\"sqlTransactionSucceeded\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"transactionId\\\"}, {\\\"name\\\": \\\"sqlError\\\"}], \\\"name\\\": \\\"sqlTransactionFailed\\\"}]}, {\\\"name\\\": \\\"DOMStorageNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [{\\\"name\\\": \\\"storage\\\"}], \\\"name\\\": \\\"addDOMStorage\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"storageId\\\"}], \\\"name\\\": \\\"updateDOMStorage\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"storageId\\\"}], \\\"name\\\": \\\"selectDOMStorage\\\"}]}, {\\\"name\\\": \\\"ApplicationCacheNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [{\\\"name\\\": \\\"status\\\"}], \\\"name\\\": \\\"updateApplicationCacheStatus\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"isNowOnline\\\"}], \\\"name\\\": \\\"updateNetworkState\\\"}]}, {\\\"name\\\": \\\"DOMNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [{\\\"name\\\": \\\"root\\\"}], \\\"name\\\": \\\"setDocument\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"id\\\"}, {\\\"name\\\": \\\"attributes\\\"}], \\\"name\\\": \\\"attributesUpdated\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"id\\\"}, {\\\"name\\\": \\\"newValue\\\"}], \\\"name\\\": \\\"characterDataModified\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"parentId\\\"}, {\\\"name\\\": \\\"nodes\\\"}], \\\"name\\\": \\\"setChildNodes\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"root\\\"}], \\\"name\\\": \\\"setDetachedRoot\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"id\\\"}, {\\\"name\\\": \\\"newValue\\\"}], \\\"name\\\": \\\"childNodeCountUpdated\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"parentId\\\"}, {\\\"name\\\": \\\"prevId\\\"}, {\\\"name\\\": \\\"node\\\"}], \\\"name\\\": \\\"childNodeInserted\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"parentId\\\"}, {\\\"name\\\": \\\"id\\\"}], \\\"name\\\": \\\"childNodeRemoved\\\"}]}, {\\\"name\\\": \\\"TimelineNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [], \\\"name\\\": \\\"timelineProfilerWasStarted\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"timelineProfilerWasStopped\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"record\\\"}], \\\"name\\\": \\\"addRecordToTimeline\\\"}]}, {\\\"name\\\": \\\"DebuggerNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [], \\\"name\\\": \\\"debuggerWasEnabled\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"debuggerWasDisabled\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"sourceID\\\"}, {\\\"name\\\": \\\"url\\\"}, {\\\"name\\\": \\\"lineOffset\\\"}, {\\\"name\\\": \\\"columnOffset\\\"}, {\\\"name\\\": \\\"length\\\"}, {\\\"name\\\": \\\"scriptWorldType\\\"}], \\\"name\\\": \\\"parsedScriptSource\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"url\\\"}, {\\\"name\\\": \\\"data\\\"}, {\\\"name\\\": \\\"firstLine\\\"}, {\\\"name\\\": \\\"errorLine\\\"}, {\\\"name\\\": \\\"errorMessage\\\"}], \\\"name\\\": \\\"failedToParseScriptSource\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"breakpointId\\\"}, {\\\"name\\\": \\\"sourceId\\\"}, {\\\"name\\\": \\\"lineNumber\\\"}, {\\\"name\\\": \\\"columnNumber\\\"}], \\\"name\\\": \\\"breakpointResolved\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"details\\\"}], \\\"name\\\": \\\"pausedScript\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"resumedScript\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"id\\\"}, {\\\"name\\\": \\\"url\\\"}, {\\\"name\\\": \\\"isShared\\\"}], \\\"name\\\": \\\"didCreateWorker\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"id\\\"}], \\\"name\\\": \\\"didDestroyWorker\\\"}]}, {\\\"name\\\": \\\"ProfilerNotify\\\", \\\"methods\\\": [{\\\"parameters\\\": [], \\\"name\\\": \\\"profilerWasEnabled\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"profilerWasDisabled\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"header\\\"}], \\\"name\\\": \\\"addProfileHeader\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"uid\\\"}, {\\\"name\\\": \\\"chunk\\\"}], \\\"name\\\": \\\"addHeapSnapshotChunk\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"uid\\\"}], \\\"name\\\": \\\"finishHeapSnapshot\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"isProfiling\\\"}], \\\"name\\\": \\\"setRecordingProfile\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"resetProfiles\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"done\\\"}, {\\\"name\\\": \\\"total\\\"}], \\\"name\\\": \\\"reportHeapSnapshotProgress\\\"}]}], \\\"name\\\": \\\"core\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"InspectorFrontendHost\\\", \\\"methods\\\": [{\\\"name\\\": \\\"loaded\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"closeWindow\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"disconnectFromBackend\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"bringToFront\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"inspectedURLChanged\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"newURL\\\"}]}, {\\\"name\\\": \\\"requestAttachWindow\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"requestDetachWindow\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"setAttachedWindowHeight\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"height\\\"}]}, {\\\"name\\\": \\\"moveWindowBy\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"x\\\"}, {\\\"name\\\": \\\"y\\\"}]}, {\\\"name\\\": \\\"setExtensionAPI\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"script\\\"}]}, {\\\"name\\\": \\\"localizedStringsURL\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"hiddenPanels\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"copyText\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"text\\\"}]}, {\\\"parameters\\\": [], \\\"name\\\": \\\"platform\\\"}, {\\\"parameters\\\": [], \\\"name\\\": \\\"port\\\"}, {\\\"parameters\\\": [{\\\"name\\\": \\\"event\\\"}, {\\\"name\\\": \\\"items\\\"}], \\\"name\\\": \\\"showContextMenu\\\"}, {\\\"name\\\": \\\"sendMessageToBackend\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}]}], \\\"name\\\": \\\"core\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"WeinreClientCommands\\\", \\\"methods\\\": [{\\\"name\\\": \\\"registerClient\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"getTargets\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"getClients\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"connectTarget\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"clientId\\\"}, {\\\"name\\\": \\\"targetId\\\"}]}, {\\\"name\\\": \\\"disconnectTarget\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"clientId\\\"}]}, {\\\"name\\\": \\\"getExtensions\\\", \\\"parameters\\\": []}, {\\\"name\\\": \\\"logDebug\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}, {\\\"name\\\": \\\"logInfo\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}, {\\\"name\\\": \\\"logWarning\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}, {\\\"name\\\": \\\"logError\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}]}], \\\"name\\\": \\\"weinre\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"WeinreClientEvents\\\", \\\"methods\\\": [{\\\"name\\\": \\\"clientRegistered\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"client\\\"}]}, {\\\"name\\\": \\\"targetRegistered\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"target\\\"}]}, {\\\"name\\\": \\\"clientUnregistered\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"clientId\\\"}]}, {\\\"name\\\": \\\"targetUnregistered\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"targetId\\\"}]}, {\\\"name\\\": \\\"connectionCreated\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"clientId\\\"}, {\\\"name\\\": \\\"targetId\\\"}]}, {\\\"name\\\": \\\"connectionDestroyed\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"clientId\\\"}, {\\\"name\\\": \\\"targetId\\\"}]}, {\\\"name\\\": \\\"sendCallback\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"callbackId\\\"}, {\\\"name\\\": \\\"result\\\"}]}, {\\\"name\\\": \\\"serverProperties\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"properties\\\"}]}]}], \\\"name\\\": \\\"weinre\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"WeinreExtraClientCommands\\\", \\\"methods\\\": [{\\\"name\\\": \\\"getDatabases\\\", \\\"parameters\\\": []}]}], \\\"name\\\": \\\"weinre\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"WeinreExtraTargetEvents\\\", \\\"methods\\\": [{\\\"name\\\": \\\"databaseOpened\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"databaseRecord\\\"}]}]}], \\\"name\\\": \\\"weinre\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"WeinreTargetCommands\\\", \\\"methods\\\": [{\\\"name\\\": \\\"registerTarget\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"url\\\"}]}, {\\\"name\\\": \\\"sendClientCallback\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"callbackId\\\"}, {\\\"name\\\": \\\"args\\\"}]}, {\\\"name\\\": \\\"logDebug\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}, {\\\"name\\\": \\\"logInfo\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}, {\\\"name\\\": \\\"logWarning\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}, {\\\"name\\\": \\\"logError\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"message\\\"}]}]}], \\\"name\\\": \\\"weinre\\\"}, {\\\"interfaces\\\": [{\\\"name\\\": \\\"WeinreTargetEvents\\\", \\\"methods\\\": [{\\\"name\\\": \\\"connectionCreated\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"clientId\\\"}, {\\\"name\\\": \\\"targetId\\\"}]}, {\\\"name\\\": \\\"connectionDestroyed\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"clientId\\\"}, {\\\"name\\\": \\\"targetId\\\"}]}, {\\\"name\\\": \\\"sendCallback\\\", \\\"parameters\\\": [{\\\"name\\\": \\\"callbackId\\\"}, {\\\"name\\\": \\\"result\\\"}]}]}], \\\"name\\\": \\\"weinre\\\"}])\\n//@ sourceURL=interfaces/all-json-idls-min.js\")\n// modjewel.require('weinre/common/Weinre').showNotImplemented();\nmodjewel.require('weinre/target/Target').main()\n})();"
  },
  {
    "path": "buildin_modules/weinre/web/tests/element-highlighter.html",
    "content": "<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n\n<head>\n<title>weinre.web/tests/element-highlighter.html</title>\n<script>try {window.WeinreServerId = location.hash.split(\"#\")[1]} catch(e) {window.WeinreServerId = \"anonymous\"}</script>\n<script src=\"/target/target-script.js\"></script>\n</head>\n\n<body>\n\n<style>\n.red  { background-color: red }\n\n.m0   { margin:          0px; }\n.b0   { border:          0px solid gray; }\n.p0   { padding:         0px; }\n\n.m1   { margin:         20px; }\n.b1   { border:         20px solid gray; }\n.p1   { padding:        20px; }\n\n.m-1l { margin-left:   -20px; }\n.m-1r { margin-right:  -20px; }\n.m-1t { margin-top:    -20px; }\n.m-1b { margin-bottom: -20px; }\n\n</style>\n\n<h1> top-level </h1>\n<div class=\"red m0 b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b1 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b1 p1\" style=\"width:50px; height:50px;\">x</div>\n\n<h1> 2nd-level, single margin </h1>\n\n<div class=\"m1\">\n<div class=\"red m0 b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b1 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b1 p1\" style=\"width:50px; height:50px;\">x</div>\n</div>\n\n<h1> 2nd-level, double margin </h1>\n\n<div class=\"m1\"><div class=\"m1\">\n<div class=\"red m0 b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m0 b1 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 b1 p1\" style=\"width:50px; height:50px;\">x</div>\n</div></div>\n\n<h1> 2nd-level, double margin, negatives </h1>\n\n<div class=\"m1\"><div class=\"m1\">\n<div class=\"red m1 m-1l b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 m-1r b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 m-1t b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 m-1b b1 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 m-1b b0 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 m-1t b0 p1\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 m-1r b1 p0\" style=\"width:50px; height:50px;\">x</div>\n<div class=\"red m1 m-1l b1 p1\" style=\"width:50px; height:50px;\">x</div>\n</div></div>\n\n</body>\n</html>"
  },
  {
    "path": "buildin_modules/weinre/web/tests/index.html",
    "content": "<!--\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n-->\n\n<html>\n<head>\n<title>weinre.web/tests</title>\n</head>\n<body>\n<ul>\n<li><a href=\"element-highlighter.html\">element-highlighter</a>\n</ul>\n</body>\n</html>"
  },
  {
    "path": "buildin_modules/weinre/web/versions.js",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n if (typeof Weinre == \"undefined\") Weinre = {};\n\n Weinre.Versions = {\n    weinre:   \"2.0.0-pre-IXE4AG4O\",\n    build:    \"IXE4AG4O\",\n };\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/Client.amd.js",
    "content": ";modjewel.define(\"weinre/client/Client\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar AutoConnect, Binding, Callback, Client, IDGenerator, IDLTools, InspectorBackendImpl, InspectorFrontendHostImpl, MessageDispatcher, RemotePanel, Weinre, WeinreClientEventsImpl, WeinreExtraTargetEventsImpl, addHack_DOMNotify_setChildNodes, installWebInspectorAPIsource, new_DOMNotify_setChildNodes, old_DOMNotify_setChildNodes;\n\nIDLTools = require('../common/IDLTools');\n\nCallback = require('../common/Callback');\n\nWeinre = require('../common/Weinre');\n\nMessageDispatcher = require('../common/MessageDispatcher');\n\nBinding = require('../common/Binding');\n\nIDGenerator = require('../common/IDGenerator');\n\nInspectorBackendImpl = require('./InspectorBackendImpl');\n\nInspectorFrontendHostImpl = require('./InspectorFrontendHostImpl');\n\nWeinreClientEventsImpl = require('./WeinreClientEventsImpl');\n\nWeinreExtraTargetEventsImpl = require('./WeinreExtraTargetEventsImpl');\n\nRemotePanel = require('./RemotePanel');\n\nAutoConnect = true;\n\nWeinre.showNotImplemented();\n\nmodule.exports = Client = (function() {\n  function Client() {}\n\n  Client.prototype.initialize = function() {\n    var messageDispatcher;\n    addHack_DOMNotify_setChildNodes();\n    window.addEventListener('load', Binding(this, 'onLoaded'), false);\n    messageDispatcher = new MessageDispatcher('../ws/client', this._getId());\n    Weinre.messageDispatcher = messageDispatcher;\n    InspectorBackendImpl.setupProxies();\n    Weinre.WeinreClientCommands = messageDispatcher.createProxy('WeinreClientCommands');\n    Weinre.WeinreExtraClientCommands = messageDispatcher.createProxy('WeinreExtraClientCommands');\n    messageDispatcher.registerInterface('WeinreExtraTargetEvents', new WeinreExtraTargetEventsImpl(), false);\n    messageDispatcher.registerInterface('WebInspector', WebInspector, false);\n    messageDispatcher.registerInterface('WeinreClientEvents', new WeinreClientEventsImpl(this), false);\n    messageDispatcher.registerInterface('InspectorFrontendHost', InspectorFrontendHost, false);\n    WebInspector.mainResource = {};\n    return WebInspector.mainResource.url = location.href;\n  };\n\n  Client.prototype._getId = function() {\n    var hash;\n    hash = location.href.split('#')[1];\n    if (hash) {\n      return hash;\n    }\n    return 'anonymous';\n  };\n\n  Client.prototype.uiAvailable = function() {\n    return WebInspector.panels && WebInspector.panels.remote;\n  };\n\n  Client.prototype.autoConnect = function(value) {\n    if (arguments.length >= 1) {\n      AutoConnect = !!value;\n    }\n    return AutoConnect;\n  };\n\n  Client.prototype._installRemotePanel = function() {\n    var button, panel, toolButtonToHide, toolButtonsToHide, toolbar, _i, _len;\n    WebInspector.panels.remote = new RemotePanel();\n    panel = WebInspector.panels.remote;\n    toolbar = document.getElementById('toolbar');\n    WebInspector.addPanelToolbarIcon(toolbar, panel, toolbar.childNodes[1]);\n    WebInspector.panelOrder.unshift(WebInspector.panelOrder.pop());\n    WebInspector.currentPanel = panel;\n    toolButtonsToHide = ['scripts'];\n    if (navigator.userAgent.match(/MSIE/i)) {\n      toolButtonsToHide.push('resources', 'network', 'timeline', 'profiles', 'audits');\n    }\n    for (_i = 0, _len = toolButtonsToHide.length; _i < _len; _i++) {\n      toolButtonToHide = toolButtonsToHide[_i];\n      if (!WebInspector.panels[toolButtonToHide]) {\n        continue;\n      }\n      if (!WebInspector.panels[toolButtonToHide].toolbarItem) {\n        continue;\n      }\n      WebInspector.panels[toolButtonToHide].toolbarItem.style.display = 'none';\n    }\n    button = document.getElementById('dock-status-bar-item');\n    if (button) {\n      return button.style.display = 'none';\n    }\n  };\n\n  Client.prototype.onLoaded = function() {\n    Weinre.WeinreClientCommands.registerClient(Binding(this, this.cb_registerClient));\n    return this._installRemotePanel();\n  };\n\n  Client.prototype.cb_registerClient = function(clientDescription) {\n    Weinre.clientDescription = clientDescription;\n    if (this.uiAvailable()) {\n      WebInspector.panels.remote.setCurrentClient(clientDescription.channel);\n      WebInspector.panels.remote.afterInitialConnection();\n    }\n    return Weinre.messageDispatcher.getWebSocket().addEventListener('close', Binding(this, this.cb_webSocketClosed));\n  };\n\n  Client.prototype.cb_webSocketClosed = function() {\n    return setTimeout((function() {\n      WebInspector.panels.remote.connectionClosed();\n      return WebInspector.currentPanel = WebInspector.panels.remote;\n    }), 1000);\n  };\n\n  Client.main = function() {\n    Weinre.client = new Client();\n    Weinre.client.initialize();\n    return window.installWebInspectorAPIsource = installWebInspectorAPIsource;\n  };\n\n  return Client;\n\n})();\n\nold_DOMNotify_setChildNodes = null;\n\nnew_DOMNotify_setChildNodes = function(parentId, payloads) {\n  var domNode;\n  domNode = this._domAgent._idToDOMNode[parentId];\n  if (domNode.children) {\n    if (domNode.children.length > 0) {\n      return;\n    }\n  }\n  return old_DOMNotify_setChildNodes.call(this, parentId, payloads);\n};\n\naddHack_DOMNotify_setChildNodes = function() {\n  old_DOMNotify_setChildNodes = WebInspector.DOMDispatcher.prototype.setChildNodes;\n  return WebInspector.DOMDispatcher.prototype.setChildNodes = new_DOMNotify_setChildNodes;\n};\n\ninstallWebInspectorAPIsource = function() {\n  var extensionAPI, id;\n  if ('webInspector' in window) {\n    return;\n  }\n  extensionAPI = window.parent.InspectorFrontendHost.getExtensionAPI();\n  extensionAPI = extensionAPI.replace('location.hostname + location.port', \"location.hostname + ':' + location.port\");\n  id = IDGenerator.next();\n  console.log(\"installing webInspector with injectedScriptId: \" + id);\n  extensionAPI += \"(null, null, \" + id + \")\";\n  return extensionAPI;\n};\n\nrequire('../common/MethodNamer').setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/ConnectorList.amd.js",
    "content": ";modjewel.define(\"weinre/client/ConnectorList\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar ConnectorList, dt;\n\ndt = require('./DOMTemplates');\n\nmodule.exports = ConnectorList = (function() {\n  function ConnectorList(title) {\n    this.connectors = {};\n    this.noneItem = dt.LI(\"none\");\n    this.ulConnectors = dt.UL(this.noneItem);\n    this.div = dt.DIV(dt.H1(title), this.ulConnectors);\n    this.noneItem.addStyleClass(\"weinre-connector-item\");\n  }\n\n  ConnectorList.prototype.getElement = function() {\n    return this.div;\n  };\n\n  ConnectorList.prototype.add = function(connector) {\n    var insertionPoint, li;\n    if (this.connectors[connector.channel]) {\n      return;\n    }\n    this.connectors[connector.channel] = connector;\n    li = this.getListItem(connector);\n    li.addStyleClass(\"weinre-fadeable\");\n    this.noneItem.style.display = \"none\";\n    insertionPoint = this.getConnectorInsertionPoint(connector);\n    if (!insertionPoint) {\n      return this.ulConnectors.appendChild(li);\n    } else {\n      return this.ulConnectors.insertBefore(li, insertionPoint);\n    }\n  };\n\n  ConnectorList.prototype.get = function(channel) {\n    return this.connectors[channel];\n  };\n\n  ConnectorList.prototype.getNewestConnectorChannel = function(ignoring) {\n    var connectorChannel, newest;\n    newest = 0;\n    for (connectorChannel in this.connectors) {\n      if (connectorChannel === ignoring) {\n        continue;\n      }\n      if (connectorChannel > newest) {\n        newest = connectorChannel;\n      }\n    }\n    if (newest === 0) {\n      return null;\n    }\n    return newest;\n  };\n\n  ConnectorList.prototype.getConnectorInsertionPoint = function(connector) {\n    var childNode, i, _i, _len, _ref;\n    i = 0;\n    _ref = this.ulConnectors.childNodes;\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      childNode = _ref[_i];\n      if (null === childNode.connectorChannel) {\n        continue;\n      }\n      if (childNode.connectorChannel < connector.channel) {\n        return childNode;\n      }\n    }\n    return null;\n  };\n\n  ConnectorList.prototype.remove = function(channel, fast) {\n    var connector, element, self;\n    self = this;\n    element = this.getConnectorElement(channel);\n    if (!element) {\n      return;\n    }\n    connector = this.connectors[channel];\n    if (connector) {\n      connector.closed = true;\n    }\n    delete this.connectors[channel];\n    if (fast) {\n      return this._remove(element);\n    } else {\n      this.setState(element, \"closed\");\n      element.addStyleClass(\"weinre-fade\");\n      return window.setTimeout((function() {\n        return self._remove(element);\n      }), 5000);\n    }\n  };\n\n  ConnectorList.prototype._remove = function(element) {\n    this.ulConnectors.removeChild(element);\n    if (this.getConnectors().length === 0) {\n      return this.noneItem.style.display = \"list-item\";\n    }\n  };\n\n  ConnectorList.prototype.removeAll = function() {\n    var connector, _i, _len, _ref, _results;\n    _ref = this.getConnectors();\n    _results = [];\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      connector = _ref[_i];\n      _results.push(this.remove(connector.channel, true));\n    }\n    return _results;\n  };\n\n  ConnectorList.prototype.getConnectors = function() {\n    var channel, result;\n    result = [];\n    for (channel in this.connectors) {\n      if (!this.connectors.hasOwnProperty(channel)) {\n        continue;\n      }\n      result.push(this.connectors[channel]);\n    }\n    return result;\n  };\n\n  ConnectorList.prototype.getConnectorElement = function(channel) {\n    var connector;\n    connector = this.connectors[channel];\n    if (!connector) {\n      return null;\n    }\n    return connector.element;\n  };\n\n  ConnectorList.prototype.setCurrent = function(channel) {\n    var connector, element, _i, _len, _ref;\n    _ref = this.getConnectors();\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      connector = _ref[_i];\n      connector.element.removeStyleClass(\"current\");\n    }\n    element = this.getConnectorElement(channel);\n    if (null === element) {\n      return;\n    }\n    return element.addStyleClass(\"current\");\n  };\n\n  ConnectorList.prototype.setState = function(channel, state) {\n    var element;\n    if (typeof channel === \"string\") {\n      element = this.getConnectorElement(channel);\n    } else {\n      element = channel;\n    }\n    if (!element) {\n      return;\n    }\n    element.removeStyleClass(\"error\");\n    element.removeStyleClass(\"closed\");\n    element.removeStyleClass(\"connected\");\n    element.removeStyleClass(\"not-connected\");\n    return element.addStyleClass(state);\n  };\n\n  return ConnectorList;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/DOMTemplates.amd.js",
    "content": ";modjewel.define(\"weinre/client/DOMTemplates\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, addToElement_Node, addToElement_Object, addToElement_String, elementName, elementNames, getElementFunction, _i, _len;\n\nEx = require('../common/Ex');\n\ngetElementFunction = function(elementName) {\n  return function() {\n    var args, argument, element, _i, _len;\n    element = document.createElement(elementName);\n    args = [].slice.call(arguments);\n    for (_i = 0, _len = args.length; _i < _len; _i++) {\n      argument = args[_i];\n      if (argument.nodeType) {\n        addToElement_Node(element, argument);\n      } else if (typeof argument === \"string\") {\n        addToElement_String(element, argument);\n      } else if (typeof argument === \"object\") {\n        addToElement_Object(element, argument);\n      } else {\n        throw new Ex(arguments, (\"invalid value passed to DOMTemplates.\" + elementName + \"(): \") + argument);\n      }\n    }\n    return element;\n  };\n};\n\naddToElement_String = function(element, aString) {\n  return addToElement_Node(element, document.createTextNode(aString));\n};\n\naddToElement_Node = function(element, anElement) {\n  return element.appendChild(anElement);\n};\n\naddToElement_Object = function(element, anObject) {\n  var actualKey, key, val, _results;\n  _results = [];\n  for (key in anObject) {\n    if (!anObject.hasOwnProperty(key)) {\n      continue;\n    }\n    val = anObject[key];\n    if (key.substr(0, 1) === \"$\") {\n      actualKey = key.substr(1);\n      _results.push(element[actualKey] = val);\n    } else {\n      _results.push(element.setAttribute(key, val));\n    }\n  }\n  return _results;\n};\n\nelementNames = 'H1 H2 H3 H4 H5 H6 UL OL DL LI DT DD SPAN DIV A B I TT P HR BR PRE IMG CANVAS TABLE TR TD FORM INPUT BUTTON SELECT OPTGROUP OPTION TEXTAREA';\n\nelementNames = elementNames.split(' ');\n\nfor (_i = 0, _len = elementNames.length; _i < _len; _i++) {\n  elementName = elementNames[_i];\n  exports[elementName] = getElementFunction(elementName);\n  exports[elementName].name = \"\" + elementName;\n  exports[elementName].displayName = \"\" + elementName;\n  exports[elementName].signature = \"DOMTemplates.\" + elementName;\n}\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/ExtensionRegistryImpl.amd.js",
    "content": ";modjewel.define(\"weinre/client/ExtensionRegistryImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, Ex, ExtensionRegistryImpl, Weinre, extensions;\n\nEx = require('../common/Ex');\n\nBinding = require('../common/Binding');\n\nWeinre = require('../common/Weinre');\n\nextensions = [];\n\nmodule.exports = ExtensionRegistryImpl = (function() {\n  function ExtensionRegistryImpl() {}\n\n  ExtensionRegistryImpl.prototype.getExtensionsAsync = function() {\n    if (extensions.length) {\n      return;\n    }\n    return Weinre.WeinreClientCommands.getExtensions(Binding(this, this._cb_getExtensions));\n  };\n\n  ExtensionRegistryImpl.prototype._cb_getExtensions = function(extensionsResult) {\n    extensions = extensionsResult;\n    return this._installExtensions();\n  };\n\n  ExtensionRegistryImpl.prototype._installExtensions = function() {\n    return WebInspector.addExtensions(extensions);\n  };\n\n  return ExtensionRegistryImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/InspectorBackendImpl.amd.js",
    "content": ";modjewel.define(\"weinre/client/InspectorBackendImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, IDLTools, InspectorBackendImpl, MessageDispatcher, Weinre;\n\nEx = require('../common/Ex');\n\nIDLTools = require('../common/IDLTools');\n\nMessageDispatcher = require('../common/MessageDispatcher');\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = InspectorBackendImpl = (function() {\n  function InspectorBackendImpl() {\n    this.registeredDomainDispatchers = {};\n    MessageDispatcher.setInspectorBackend(this);\n  }\n\n  InspectorBackendImpl.setupProxies = function() {\n    var intf, intfName, intfNames, method, proxy, proxyMethod, _i, _len, _results;\n    intfNames = [\"ApplicationCache\", \"BrowserDebugger\", \"CSS\", \"Console\", \"DOM\", \"DOMStorage\", \"Database\", \"Debugger\", \"InjectedScript\", \"Inspector\", \"Network\", \"Profiler\", \"Runtime\"];\n    _results = [];\n    for (_i = 0, _len = intfNames.length; _i < _len; _i++) {\n      intfName = intfNames[_i];\n      proxy = Weinre.messageDispatcher.createProxy(intfName);\n      intf = IDLTools.getIDL(intfName);\n      if (!intf) {\n        throw new Ex(arguments, \"interface not registered: '\" + intfName + \"'\");\n      }\n      _results.push((function() {\n        var _j, _len1, _ref, _results1;\n        _ref = intf.methods;\n        _results1 = [];\n        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {\n          method = _ref[_j];\n          proxyMethod = InspectorBackendImpl.getProxyMethod(proxy, method);\n          _results1.push(InspectorBackendImpl.prototype[method.name] = proxyMethod);\n        }\n        return _results1;\n      })());\n    }\n    return _results;\n  };\n\n  InspectorBackendImpl.getProxyMethod = function(proxy, method) {\n    return function() {\n      return proxy[method.name].apply(proxy, arguments);\n    };\n  };\n\n  InspectorBackendImpl.prototype.registerDomainDispatcher = function(name, intf) {\n    return this.registeredDomainDispatchers[name] = intf;\n  };\n\n  InspectorBackendImpl.prototype.getRegisteredDomainDispatcher = function(name) {\n    if (!this.registeredDomainDispatchers.hasOwnProperty(name)) {\n      return null;\n    }\n    return this.registeredDomainDispatchers[name];\n  };\n\n  return InspectorBackendImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/InspectorFrontendHostImpl.amd.js",
    "content": ";modjewel.define(\"weinre/client/InspectorFrontendHostImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar IDLTools, InspectorFrontendHostImpl, Weinre, _extensionAPI;\n\nWeinre = require('../common/Weinre');\n\nIDLTools = require('../common/IDLTools');\n\n_extensionAPI = null;\n\nmodule.exports = InspectorFrontendHostImpl = (function() {\n  function InspectorFrontendHostImpl() {\n    this._getPlatformAndPort();\n  }\n\n  InspectorFrontendHostImpl.prototype.showContextMenu = function() {};\n\n  InspectorFrontendHostImpl.prototype.loaded = function() {};\n\n  InspectorFrontendHostImpl.prototype.localizedStringsURL = function() {\n    return \"nls/English.lproj/localizedStrings.js\";\n  };\n\n  InspectorFrontendHostImpl.prototype.hiddenPanels = function() {\n    return \"audits,profiles\";\n  };\n\n  InspectorFrontendHostImpl.prototype.platform = function() {\n    return \"weinre\";\n  };\n\n  InspectorFrontendHostImpl.prototype.port = function() {\n    return \"weinre\";\n  };\n\n  InspectorFrontendHostImpl.prototype.sendMessageToBackend = function(message) {\n    var object;\n    object = JSON.parse(message);\n    if (object[0] === \"setInjectedScriptSource\") {\n      object[1] = \"<long script elided>\";\n    }\n    return Weinre.logInfo(arguments.callee.name + (\"(\" + (JSON.stringify(object, null, 4)) + \")\"));\n  };\n\n  InspectorFrontendHostImpl.prototype.setExtensionAPI = function(extensionAPI) {\n    return _extensionAPI = extensionAPI;\n  };\n\n  InspectorFrontendHostImpl.prototype.getExtensionAPI = function() {\n    return _extensionAPI;\n  };\n\n  InspectorFrontendHostImpl.prototype.inspectedURLChanged = function() {};\n\n  InspectorFrontendHostImpl.prototype._getPlatformAndPort = function() {\n    var key, pieces, properties, property, splits, uas, url, val, _i, _len, _results;\n    this._platform = \"weinre\";\n    this._platformFlavor = \"weinre\";\n    this._port = \"weinre\";\n    if (true) {\n      return;\n    }\n    uas = navigator.userAgent;\n    if (uas.match(/mac os x/i)) {\n      this._platform = \"mac\";\n    } else if (uas.match(/macintosh/i)) {\n      this._platform = \"mac\";\n    } else if (uas.match(/linux/i)) {\n      this._platform = \"linux\";\n    } else {\n      if (uas.match(/windows/i)) {\n        this._platform = \"windows\";\n      }\n    }\n    url = window.location.href;\n    splits = url.split(\"#\", 2);\n    if (splits.length > 1) {\n      properties = splits[1];\n      properties = properties.split(\"&\");\n      _results = [];\n      for (_i = 0, _len = properties.length; _i < _len; _i++) {\n        property = properties[_i];\n        pieces = property.split(\"=\");\n        if (pieces.length > 1) {\n          key = pieces[0];\n          val = pieces[1];\n          if (key === \"platform\") {\n            _results.push(this._platform = val);\n          } else if (key === \"platformFlavor\") {\n            _results.push(this._platformFlavor = val);\n          } else {\n            if (key === \"port\") {\n              _results.push(this._port = val);\n            } else {\n              _results.push(void 0);\n            }\n          }\n        } else {\n          _results.push(void 0);\n        }\n      }\n      return _results;\n    }\n  };\n\n  return InspectorFrontendHostImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/RemotePanel.amd.js",
    "content": ";modjewel.define(\"weinre/client/RemotePanel\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, ClientList, ConnectorList, DT, RemotePanel, TargetList, Weinre,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nBinding = require('../common/Binding');\n\nWeinre = require('../common/Weinre');\n\nConnectorList = require('./ConnectorList');\n\nDT = require('./DOMTemplates');\n\nWebInspector.Panel.prototype.constructor = WebInspector.Panel;\n\nmodule.exports = RemotePanel = (function(_super) {\n  __extends(RemotePanel, _super);\n\n  Object.defineProperty(RemotePanel.prototype, \"toolbarItemClass\", {\n    get: function() {\n      return \"remote\";\n    }\n  });\n\n  Object.defineProperty(RemotePanel.prototype, \"toolbarItemLabel\", {\n    get: function() {\n      return \"Remote\";\n    }\n  });\n\n  Object.defineProperty(RemotePanel.prototype, \"statusBarItems\", {\n    get: function() {\n      return [];\n    }\n  });\n\n  Object.defineProperty(RemotePanel.prototype, \"defaultFocusedElement\", {\n    get: function() {\n      return this.contentElement;\n    }\n  });\n\n  function RemotePanel() {\n    RemotePanel.__super__.constructor.call(this, \"remote\");\n    this.initialize();\n  }\n\n  RemotePanel.prototype.initialize = function() {\n    var div, icon;\n    div = DT.DIV();\n    div.style.position = \"absolute\";\n    div.style.top = \"1em\";\n    div.style.right = \"1em\";\n    div.style.left = \"1em\";\n    div.style.bottom = \"1em\";\n    div.style.overflow = \"auto\";\n    icon = DT.IMG({\n      src: \"../images/weinre-icon-128x128.png\"\n    });\n    icon.style.float = \"right\";\n    div.appendChild(icon);\n    this.targetList = new TargetList();\n    this.clientList = new ClientList();\n    div.appendChild(this.targetList.getElement());\n    div.appendChild(this.clientList.getElement());\n    this.serverProperties = DT.DIV({\n      $className: \"weinreServerProperties\"\n    });\n    div.appendChild(DT.H1(\"Server Properties\"));\n    div.appendChild(this.serverProperties);\n    this.element.appendChild(div);\n    return this.reset();\n  };\n\n  RemotePanel.prototype.addClient = function(client) {\n    return this.clientList.add(client);\n  };\n\n  RemotePanel.prototype.addTarget = function(target) {\n    return this.targetList.add(target);\n  };\n\n  RemotePanel.prototype.getTarget = function(channel) {\n    return this.targetList.get(channel);\n  };\n\n  RemotePanel.prototype.removeClient = function(channel) {\n    return this.clientList.remove(channel);\n  };\n\n  RemotePanel.prototype.removeTarget = function(channel) {\n    return this.targetList.remove(channel);\n  };\n\n  RemotePanel.prototype.setCurrentClient = function(channel) {\n    return this.clientList.setCurrent(channel);\n  };\n\n  RemotePanel.prototype.setCurrentTarget = function(channel) {\n    return this.targetList.setCurrent(channel);\n  };\n\n  RemotePanel.prototype.setClientState = function(channel, state) {\n    return this.clientList.setState(channel, state);\n  };\n\n  RemotePanel.prototype.setTargetState = function(channel, state) {\n    return this.targetList.setState(channel, state);\n  };\n\n  RemotePanel.prototype.getNewestTargetChannel = function(ignoring) {\n    return this.targetList.getNewestConnectorChannel(ignoring);\n  };\n\n  RemotePanel.prototype.afterInitialConnection = function() {\n    return this.clientList.afterInitialConnection();\n  };\n\n  RemotePanel.prototype.reset = function() {\n    this.clientList.removeAll();\n    this.targetList.removeAll();\n    Weinre.WeinreClientCommands.getTargets(Binding(this, \"cb_getTargets\"));\n    return Weinre.WeinreClientCommands.getClients(Binding(this, \"cb_getClients\"));\n  };\n\n  RemotePanel.prototype.connectionClosed = function() {\n    this.clientList.removeAll();\n    return this.targetList.removeAll();\n  };\n\n  RemotePanel.prototype.cb_getTargets = function(targets) {\n    var newestTargetChannel, target, _i, _len;\n    for (_i = 0, _len = targets.length; _i < _len; _i++) {\n      target = targets[_i];\n      this.addTarget(target);\n    }\n    if (!Weinre.client.autoConnect()) {\n      return;\n    }\n    newestTargetChannel = this.getNewestTargetChannel();\n    if (!newestTargetChannel) {\n      return;\n    }\n    if (!Weinre.messageDispatcher) {\n      return;\n    }\n    return Weinre.WeinreClientCommands.connectTarget(Weinre.messageDispatcher.channel, newestTargetChannel);\n  };\n\n  RemotePanel.prototype.cb_getClients = function(clients) {\n    var client, _i, _len, _results;\n    _results = [];\n    for (_i = 0, _len = clients.length; _i < _len; _i++) {\n      client = clients[_i];\n      _results.push(this.addClient(client));\n    }\n    return _results;\n  };\n\n  RemotePanel.prototype.show = function() {\n    return RemotePanel.__super__.show.call(this);\n  };\n\n  RemotePanel.prototype.hide = function() {\n    return RemotePanel.__super__.hide.call(this);\n  };\n\n  RemotePanel.prototype.setServerProperties = function(properties) {\n    var aVal, finalVal, key, keys, table, val, _i, _j, _len, _len1;\n    table = \"<table>\";\n    keys = [];\n    for (key in properties) {\n      keys.push(key);\n    }\n    keys = keys.sort();\n    for (_i = 0, _len = keys.length; _i < _len; _i++) {\n      key = keys[_i];\n      val = properties[key];\n      if (typeof val === \"string\") {\n        val = val.escapeHTML();\n      } else {\n        finalVal = \"\";\n        for (_j = 0, _len1 = val.length; _j < _len1; _j++) {\n          aVal = val[_j];\n          finalVal += \"<li>\" + aVal.escapeHTML();\n        }\n        val = \"<ul>\" + finalVal + \"</ul>\";\n      }\n      table += (\"<tr class='weinre-normal-text-size'><td valign='top'>\" + (key.escapeHTML()) + \": <td>\") + val;\n    }\n    table += \"</table>\";\n    return this.serverProperties.innerHTML = table;\n  };\n\n  return RemotePanel;\n\n})(WebInspector.Panel);\n\nTargetList = (function(_super) {\n  __extends(TargetList, _super);\n\n  function TargetList() {\n    TargetList.__super__.constructor.call(this, \"Targets\");\n  }\n\n  TargetList.prototype.getListItem = function(target) {\n    var item, self, text;\n    self = this;\n    text = target.hostName + (\" [channel: \" + target.channel + \" id: \" + target.id + \"]\") + \" - \" + target.url;\n    item = DT.LI({\n      $connectorChannel: target.channel\n    }, text);\n    item.addStyleClass(\"weinre-connector-item\");\n    item.addStyleClass(\"target\");\n    item.addEventListener(\"click\", (function(e) {\n      return self.connectToTarget(target.channel, e);\n    }), false);\n    target.element = item;\n    return item;\n  };\n\n  TargetList.prototype.connectToTarget = function(targetChannel, event) {\n    var target;\n    if (event) {\n      event.preventDefault();\n      event.stopPropagation();\n    }\n    target = this.connectors[targetChannel];\n    if (!target) {\n      return false;\n    }\n    if (target.closed) {\n      return false;\n    }\n    Weinre.WeinreClientCommands.connectTarget(Weinre.messageDispatcher.channel, targetChannel);\n    return false;\n  };\n\n  return TargetList;\n\n})(ConnectorList);\n\nClientList = (function(_super) {\n  __extends(ClientList, _super);\n\n  function ClientList() {\n    ClientList.__super__.constructor.call(this, \"Clients\");\n    this.noneItem.innerHTML = \"Waiting for connection...\";\n  }\n\n  ClientList.prototype.afterInitialConnection = function() {\n    this.noneItem.innerHTML = \"连接已断开，请尝试刷新页面\";\n    return this.noneItem.addStyleClass(\"error\");\n  };\n\n  ClientList.prototype.getListItem = function(client) {\n    var item, text;\n    text = client.hostName + (\" [channel: \" + client.channel + \" id: \" + client.id + \"]\");\n    item = DT.LI({\n      $connectorChannel: client.channel\n    }, text);\n    item.addStyleClass(\"weinre-connector-item\");\n    item.addStyleClass(\"client\");\n    if (Weinre.messageDispatcher) {\n      if (client.channel === Weinre.messageDispatcher.channel) {\n        item.addStyleClass(\"current\");\n      }\n    }\n    client.element = item;\n    return item;\n  };\n\n  return ClientList;\n\n})(ConnectorList);\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/WeinreClientEventsImpl.amd.js",
    "content": ";modjewel.define(\"weinre/client/WeinreClientEventsImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Callback, Weinre, WeinreClientEventsImpl, WeinreExtraTargetEventsImpl, titleConnectedPrefix, titleNotConnected;\n\nCallback = require('../common/Callback');\n\nWeinre = require('../common/Weinre');\n\nWeinreExtraTargetEventsImpl = require('./WeinreExtraTargetEventsImpl');\n\ntitleNotConnected = \"weinre: target not connected\";\n\ntitleConnectedPrefix = \"weinre: \";\n\ndocument.title = titleNotConnected;\n\nmodule.exports = WeinreClientEventsImpl = (function() {\n  function WeinreClientEventsImpl(client) {\n    this.client = client;\n  }\n\n  WeinreClientEventsImpl.prototype.clientRegistered = function(clientDescription) {\n    if (this.client.uiAvailable()) {\n      return WebInspector.panels.remote.addClient(clientDescription);\n    }\n  };\n\n  WeinreClientEventsImpl.prototype.targetRegistered = function(targetDescription) {\n    if (this.client.uiAvailable()) {\n      WebInspector.panels.remote.addTarget(targetDescription);\n    }\n    if (!Weinre.client.autoConnect()) {\n      return;\n    }\n    if (!Weinre.messageDispatcher) {\n      return;\n    }\n    return Weinre.WeinreClientCommands.connectTarget(Weinre.messageDispatcher.channel, targetDescription.channel);\n  };\n\n  WeinreClientEventsImpl.prototype.clientUnregistered = function(clientChannel) {\n    if (this.client.uiAvailable()) {\n      return WebInspector.panels.remote.removeClient(clientChannel);\n    }\n  };\n\n  WeinreClientEventsImpl.prototype.targetUnregistered = function(targetChannel) {\n    if (this.client.uiAvailable()) {\n      return WebInspector.panels.remote.removeTarget(targetChannel);\n    }\n  };\n\n  WeinreClientEventsImpl.prototype.connectionCreated = function(clientChannel, targetChannel) {\n    var target;\n    if (!this.client.uiAvailable()) {\n      return;\n    }\n    WebInspector.panels.remote.setClientState(clientChannel, \"connected\");\n    WebInspector.panels.remote.setTargetState(targetChannel, \"connected\");\n    if (clientChannel !== Weinre.messageDispatcher.channel) {\n      return;\n    }\n    WebInspector.panels.elements.reset();\n    WebInspector.panels.timeline._clearPanel();\n    WebInspector.panels.resources.reset();\n    target = WebInspector.panels.remote.getTarget(targetChannel);\n    if (!target) {\n      return;\n    }\n    document.title = titleConnectedPrefix + target.url;\n    WebInspector.inspectedURLChanged(target.url);\n    return Weinre.WeinreExtraClientCommands.getDatabases(function(databaseRecords) {\n      return WeinreExtraTargetEventsImpl.addDatabaseRecords(databaseRecords);\n    });\n  };\n\n  WeinreClientEventsImpl.prototype.connectionDestroyed = function(clientChannel, targetChannel) {\n    var nextTargetChannel;\n    if (!this.client.uiAvailable()) {\n      return;\n    }\n    WebInspector.panels.remote.setClientState(clientChannel, \"not-connected\");\n    WebInspector.panels.remote.setTargetState(targetChannel, \"not-connected\");\n    if (clientChannel !== Weinre.messageDispatcher.channel) {\n      return;\n    }\n    document.title = titleNotConnected;\n    if (!Weinre.client.autoConnect()) {\n      return;\n    }\n    if (!this.client.uiAvailable()) {\n      return;\n    }\n    nextTargetChannel = WebInspector.panels.remote.getNewestTargetChannel(targetChannel);\n    if (!nextTargetChannel) {\n      return;\n    }\n    Weinre.WeinreClientCommands.connectTarget(Weinre.messageDispatcher.channel, nextTargetChannel);\n    return Weinre.logInfo(\"autoconnecting to \" + nextTargetChannel);\n  };\n\n  WeinreClientEventsImpl.prototype.sendCallback = function(callbackId, result) {\n    return Callback.invoke(callbackId, result);\n  };\n\n  WeinreClientEventsImpl.prototype.serverProperties = function(properties) {\n    if (this.client.uiAvailable()) {\n      return WebInspector.panels.remote.setServerProperties(properties);\n    }\n  };\n\n  return WeinreClientEventsImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/client/WeinreExtraTargetEventsImpl.amd.js",
    "content": ";modjewel.define(\"weinre/client/WeinreExtraTargetEventsImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar WeinreExtraTargetEventsImpl;\n\nmodule.exports = WeinreExtraTargetEventsImpl = (function() {\n  function WeinreExtraTargetEventsImpl() {}\n\n  WeinreExtraTargetEventsImpl.prototype.databaseOpened = function(databaseRecord) {\n    return WeinreExtraTargetEventsImpl.addDatabaseRecords([databaseRecord]);\n  };\n\n  WeinreExtraTargetEventsImpl.addDatabaseRecords = function(databaseRecords) {\n    var database, databaseRecord, existingDb, existingDbNames, existingDbs, _i, _j, _len, _len1, _results;\n    if (!WebInspector.panels) {\n      return;\n    }\n    if (!WebInspector.panels.resources) {\n      return;\n    }\n    if (!WebInspector.panels.resources._databases) {\n      return;\n    }\n    existingDbs = WebInspector.panels.resources._databases;\n    existingDbNames = {};\n    for (_i = 0, _len = existingDbs.length; _i < _len; _i++) {\n      existingDb = existingDbs[_i];\n      existingDbNames[existingDb.name] = existingDb;\n    }\n    _results = [];\n    for (_j = 0, _len1 = databaseRecords.length; _j < _len1; _j++) {\n      databaseRecord = databaseRecords[_j];\n      if (existingDbNames[databaseRecord.name]) {\n        continue;\n      }\n      database = new WebInspector.Database(databaseRecord.id, databaseRecord.domain, databaseRecord.name, databaseRecord.version);\n      _results.push(WebInspector.panels.resources.addDatabase(database));\n    }\n    return _results;\n  };\n\n  return WeinreExtraTargetEventsImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/Binding.amd.js",
    "content": ";modjewel.define(\"weinre/common/Binding\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, Ex;\n\nEx = require('./Ex');\n\nmodule.exports = Binding = (function() {\n  function Binding(receiver, method) {\n    if (!receiver) {\n      throw new Ex(arguments, \"receiver argument for Binding constructor was null\");\n    }\n    if (typeof method === \"string\") {\n      method = receiver[method];\n    }\n    if (typeof method === !\"function\") {\n      throw new Ex(arguments, \"method argument didn't specify a function\");\n    }\n    return function() {\n      return method.apply(receiver, [].slice.call(arguments));\n    };\n  }\n\n  return Binding;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/Callback.amd.js",
    "content": ";modjewel.define(\"weinre/common/Callback\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Callback, CallbackIndex, CallbackTable, ConnectorChannel, Ex;\n\nEx = require('./Ex');\n\nCallbackTable = {};\n\nCallbackIndex = 1;\n\nConnectorChannel = \"???\";\n\nmodule.exports = Callback = (function() {\n  function Callback() {\n    throw new Ex(arguments, \"this class is not intended to be instantiated\");\n  }\n\n  Callback.setConnectorChannel = function(connectorChannel) {\n    return ConnectorChannel = \"\" + connectorChannel;\n  };\n\n  Callback.register = function(callback) {\n    var data, func, index, receiver;\n    if (typeof callback === \"function\") {\n      callback = [null, callback];\n    }\n    if (typeof callback.slice !== \"function\") {\n      throw new Ex(arguments, \"callback must be an array or function\");\n    }\n    receiver = callback[0];\n    func = callback[1];\n    data = callback.slice(2);\n    if (typeof func === \"string\") {\n      func = receiver[func];\n    }\n    if (typeof func !== \"function\") {\n      throw new Ex(arguments, \"callback function was null or not found\");\n    }\n    index = ConnectorChannel + \"::\" + CallbackIndex;\n    CallbackIndex++;\n    if (CallbackIndex >= 65536 * 65536) {\n      CallbackIndex = 1;\n    }\n    CallbackTable[index] = [receiver, func, data];\n    return index;\n  };\n\n  Callback.deregister = function(index) {\n    return delete CallbackTable[index];\n  };\n\n  Callback.invoke = function(index, args) {\n    var callback, e, func, funcName, receiver;\n    callback = CallbackTable[index];\n    if (!callback) {\n      throw new Ex(arguments, \"callback \" + index + \" not registered or already invoked\");\n    }\n    receiver = callback[0];\n    func = callback[1];\n    args = callback[2].concat(args);\n    try {\n      return func.apply(receiver, args);\n    } catch (_error) {\n      e = _error;\n      funcName = func.name || func.signature;\n      if (!funcName) {\n        funcName = \"<unnamed>\";\n      }\n      return require(\"./Weinre\").logError(arguments.callee.signature + (\" exception invoking callback: \" + funcName + \"(\" + (args.join(',')) + \"): \") + e);\n    } finally {\n      Callback.deregister(index);\n    }\n  };\n\n  return Callback;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/Debug.amd.js",
    "content": ";modjewel.define(\"weinre/common/Debug\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Debug;\n\nmodule.exports = new (Debug = (function() {\n  function Debug() {\n    this._printCalledArgs = {};\n  }\n\n  Debug.prototype.log = function(message) {\n    var console;\n    console = window.console.__original || window.console;\n    return console.log(\"\" + (this.timeStamp()) + \": \" + message);\n  };\n\n  Debug.prototype.logCall = function(context, intf, method, args, message) {\n    var printArgs, signature;\n    if (message) {\n      message = \": \" + message;\n    } else {\n      message = \"\";\n    }\n    signature = this.signature(intf, method);\n    printArgs = this._printCalledArgs[signature];\n    if (printArgs) {\n      args = JSON.stringify(args, null, 4);\n    } else {\n      args = \"\";\n    }\n    return this.log(\"\" + context + \" \" + signature + \"(\" + args + \")\" + message);\n  };\n\n  Debug.prototype.logCallArgs = function(intf, method) {\n    return this._printCalledArgs[this.signature(intf, method)] = true;\n  };\n\n  Debug.prototype.signature = function(intf, method) {\n    return \"\" + intf + \".\" + method;\n  };\n\n  Debug.prototype.timeStamp = function() {\n    var date, mins, secs;\n    date = new Date();\n    mins = \"\" + (date.getMinutes());\n    secs = \"\" + (date.getSeconds());\n    if (mins.length === 1) {\n      mins = \"0\" + mins;\n    }\n    if (secs.length === 1) {\n      secs = \"0\" + secs;\n    }\n    return \"\" + mins + \":\" + secs;\n  };\n\n  return Debug;\n\n})());\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/EventListeners.amd.js",
    "content": ";modjewel.define(\"weinre/common/EventListeners\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar EventListeners, Ex, Weinre;\n\nEx = require('./Ex');\n\nWeinre = require('./Weinre');\n\nmodule.exports = EventListeners = (function() {\n  function EventListeners() {\n    this.listeners = [];\n  }\n\n  EventListeners.prototype.add = function(listener, useCapture) {\n    return this.listeners.push([listener, useCapture]);\n  };\n\n  EventListeners.prototype.remove = function(listener, useCapture) {\n    var listeners, _i, _len, _listener;\n    listeners = this.listeners.slice();\n    for (_i = 0, _len = listeners.length; _i < _len; _i++) {\n      _listener = listeners[_i];\n      if (_listener[0] !== listener) {\n        continue;\n      }\n      if (_listener[1] !== useCapture) {\n        continue;\n      }\n      this._listeners.splice(i, 1);\n      return;\n    }\n  };\n\n  EventListeners.prototype.fire = function(event) {\n    var e, listener, listeners, _i, _len, _results;\n    listeners = this.listeners.slice();\n    _results = [];\n    for (_i = 0, _len = listeners.length; _i < _len; _i++) {\n      listener = listeners[_i];\n      listener = listener[0];\n      if (typeof listener === \"function\") {\n        try {\n          listener.call(null, event);\n        } catch (_error) {\n          e = _error;\n          Weinre.logError(\"\" + arguments.callee.name + \" invocation exception: \" + e);\n        }\n        continue;\n      }\n      if (typeof (listener != null ? listener.handleEvent : void 0) !== \"function\") {\n        throw new Ex(arguments, \"listener does not implement the handleEvent() method\");\n      }\n      try {\n        _results.push(listener.handleEvent.call(listener, event));\n      } catch (_error) {\n        e = _error;\n        _results.push(Weinre.logError(\"\" + arguments.callee.name + \" invocation exception: \" + e));\n      }\n    }\n    return _results;\n  };\n\n  return EventListeners;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/Ex.amd.js",
    "content": ";modjewel.define(\"weinre/common/Ex\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, StackTrace, prefix;\n\nStackTrace = require('./StackTrace');\n\nmodule.exports = Ex = (function() {\n  Ex.catching = function(func) {\n    var e;\n    try {\n      return func.call(this);\n    } catch (_error) {\n      e = _error;\n      console.log(\"runtime error: \" + e);\n      return StackTrace.dump(arguments);\n    }\n  };\n\n  function Ex(args, message) {\n    if (!args || !args.callee) {\n      throw Ex(arguments, \"first parameter must be an Arguments object\");\n    }\n    StackTrace.dump(args);\n    if (message instanceof Error) {\n      message = \"threw error: \" + message;\n    }\n    message = prefix(args, message);\n    message;\n  }\n\n  return Ex;\n\n})();\n\nprefix = function(args, string) {\n  if (args.callee.signature) {\n    return args.callee.signature + \": \" + string;\n  }\n  if (args.callee.displayName) {\n    return args.callee.displayName + \": \" + string;\n  }\n  if (args.callee.name) {\n    return args.callee.name + \": \" + string;\n  }\n  return \"<anonymous>\" + \": \" + string;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/HookLib.amd.js",
    "content": ";modjewel.define(\"weinre/common/HookLib\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookLib, HookSite, HookSites, IgnoreHooks, callAfterHooks, callBeforeHooks, callExceptHooks, getHookSite, getHookedFunction;\n\nHookLib = exports;\n\nHookSites = [];\n\nIgnoreHooks = 0;\n\nmodule.exports = HookLib = (function() {\n  function HookLib() {}\n\n  HookLib.addHookSite = function(object, property) {\n    return getHookSite(object, property, true);\n  };\n\n  HookLib.getHookSite = function(object, property) {\n    return getHookSite(object, property, false);\n  };\n\n  HookLib.ignoreHooks = function(func) {\n    var result;\n    try {\n      IgnoreHooks++;\n      result = func.call();\n    } finally {\n      IgnoreHooks--;\n    }\n    return result;\n  };\n\n  return HookLib;\n\n})();\n\ngetHookSite = function(object, property, addIfNotFound) {\n  var hookSite, i, _i, _len;\n  i = 0;\n  for (_i = 0, _len = HookSites.length; _i < _len; _i++) {\n    hookSite = HookSites[_i];\n    if (hookSite.object !== object) {\n      continue;\n    }\n    if (hookSite.property !== property) {\n      continue;\n    }\n    return hookSite;\n  }\n  if (!addIfNotFound) {\n    return null;\n  }\n  hookSite = new HookSite(object, property);\n  HookSites.push(hookSite);\n  return hookSite;\n};\n\nHookSite = (function() {\n  function HookSite(object, property) {\n    var hookedFunction;\n    this.object = object;\n    this.property = property;\n    this.target = object[property];\n    this.hookss = [];\n    if (typeof this.target === 'undefined') {\n      return;\n    } else {\n      hookedFunction = getHookedFunction(this.target, this);\n      if (!(navigator.userAgent.match(/MSIE/i) && (object === localStorage || object === sessionStorage))) {\n        object[property] = hookedFunction;\n      }\n    }\n  }\n\n  HookSite.prototype.addHooks = function(hooks) {\n    return this.hookss.push(hooks);\n  };\n\n  HookSite.prototype.removeHooks = function(hooks) {\n    var i, _i, _ref;\n    for (i = _i = 0, _ref = this.hookss.length; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {\n      if (this.hookss[i] === hooks) {\n        this.hookss.splice(i, 1);\n        return;\n      }\n    }\n  };\n\n  return HookSite;\n\n})();\n\ngetHookedFunction = function(func, hookSite) {\n  var hookedFunction;\n  hookedFunction = function() {\n    var e, result;\n    callBeforeHooks(hookSite, this, arguments);\n    try {\n      result = func.apply(this, arguments);\n    } catch (_error) {\n      e = _error;\n      callExceptHooks(hookSite, this, arguments, e);\n      throw e;\n    } finally {\n      callAfterHooks(hookSite, this, arguments, result);\n    }\n    return result;\n  };\n  hookedFunction.displayName = func.displayName || func.name;\n  return hookedFunction;\n};\n\ncallBeforeHooks = function(hookSite, receiver, args) {\n  var hooks, _i, _len, _ref, _results;\n  if (IgnoreHooks > 0) {\n    return;\n  }\n  _ref = hookSite.hookss;\n  _results = [];\n  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n    hooks = _ref[_i];\n    if (hooks.before) {\n      _results.push(hooks.before.call(hooks, receiver, args));\n    } else {\n      _results.push(void 0);\n    }\n  }\n  return _results;\n};\n\ncallAfterHooks = function(hookSite, receiver, args, result) {\n  var hooks, _i, _len, _ref, _results;\n  if (IgnoreHooks > 0) {\n    return;\n  }\n  _ref = hookSite.hookss;\n  _results = [];\n  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n    hooks = _ref[_i];\n    if (hooks.after) {\n      _results.push(hooks.after.call(hooks, receiver, args, result));\n    } else {\n      _results.push(void 0);\n    }\n  }\n  return _results;\n};\n\ncallExceptHooks = function(hookSite, receiver, args, e) {\n  var hooks, _i, _len, _ref, _results;\n  if (IgnoreHooks > 0) {\n    return;\n  }\n  _ref = hookSite.hookss;\n  _results = [];\n  for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n    hooks = _ref[_i];\n    if (hooks.except) {\n      _results.push(hooks.except.call(hooks, receiver, args, e));\n    } else {\n      _results.push(void 0);\n    }\n  }\n  return _results;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/IDGenerator.amd.js",
    "content": ";modjewel.define(\"weinre/common/IDGenerator\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar IDGenerator, idName, nextId, nextIdValue;\n\nnextIdValue = 1;\n\nidName = \"__weinre__id\";\n\nmodule.exports = IDGenerator = (function() {\n  function IDGenerator() {}\n\n  IDGenerator.checkId = function(object) {\n    return object[idName];\n  };\n\n  IDGenerator.getId = function(object, map) {\n    var id;\n    id = IDGenerator.checkId(object);\n    if (!id) {\n      id = nextId();\n      object[idName] = id;\n    }\n    if (map) {\n      map[id] = object;\n    }\n    return id;\n  };\n\n  IDGenerator.next = function() {\n    return nextId();\n  };\n\n  return IDGenerator;\n\n})();\n\nnextId = function() {\n  var result;\n  result = nextIdValue;\n  nextIdValue += 1;\n  return result;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/IDLTools.amd.js",
    "content": ";modjewel.define(\"weinre/common/IDLTools\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Callback, Ex, IDLTools, IDLs, getProxyMethod;\n\nEx = require('./Ex');\n\nCallback = require('./Callback');\n\nIDLs = {};\n\nmodule.exports = IDLTools = (function() {\n  function IDLTools() {\n    throw new Ex(arguments, \"this class is not intended to be instantiated\");\n  }\n\n  IDLTools.addIDLs = function(idls) {\n    var idl, intf, _i, _len, _results;\n    _results = [];\n    for (_i = 0, _len = idls.length; _i < _len; _i++) {\n      idl = idls[_i];\n      _results.push((function() {\n        var _j, _len1, _ref, _results1;\n        _ref = idl.interfaces;\n        _results1 = [];\n        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {\n          intf = _ref[_j];\n          IDLs[intf.name] = intf;\n          _results1.push(intf.module = idl.name);\n        }\n        return _results1;\n      })());\n    }\n    return _results;\n  };\n\n  IDLTools.getIDL = function(name) {\n    return IDLs[name];\n  };\n\n  IDLTools.getIDLsMatching = function(regex) {\n    var intf, intfName, results;\n    results = [];\n    for (intfName in IDLs) {\n      intf = IDLs[intfName];\n      if (intfName.match(regex)) {\n        results.push(intf);\n      }\n    }\n    return results;\n  };\n\n  IDLTools.validateAgainstIDL = function(klass, interfaceName) {\n    var classMethod, error, errors, intf, intfMethod, messagePrefix, printName, propertyName, _i, _j, _len, _len1, _ref, _results;\n    intf = IDLTools.getIDL(interfaceName);\n    messagePrefix = \"IDL validation for \" + interfaceName + \": \";\n    if (null === intf) {\n      throw new Ex(arguments, messagePrefix + (\"idl not found: '\" + interfaceName + \"'\"));\n    }\n    errors = [];\n    _ref = intf.methods;\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      intfMethod = _ref[_i];\n      classMethod = klass.prototype[intfMethod.name];\n      printName = klass.name + \"::\" + intfMethod.name;\n      if (null === classMethod) {\n        errors.push(messagePrefix + (\"method not implemented: '\" + printName + \"'\"));\n        continue;\n      }\n      if (classMethod.length !== intfMethod.parameters.length) {\n        if (classMethod.length !== intfMethod.parameters.length + 1) {\n          errors.push(messagePrefix + (\"wrong number of parameters: '\" + printName + \"'\"));\n          continue;\n        }\n      }\n    }\n    for (propertyName in klass.prototype) {\n      if (klass.prototype.hasOwnProperty(propertyName)) {\n        continue;\n      }\n      if (propertyName.match(/^_.*/)) {\n        continue;\n      }\n      printName = klass.name + \"::\" + propertyName;\n      if (!intf.methods[propertyName]) {\n        errors.push(messagePrefix + (\"method should not be implemented: '\" + printName + \"'\"));\n        continue;\n      }\n    }\n    if (!errors.length) {\n      return;\n    }\n    _results = [];\n    for (_j = 0, _len1 = errors.length; _j < _len1; _j++) {\n      error = errors[_j];\n      _results.push(require(\"./Weinre\").logError(error));\n    }\n    return _results;\n  };\n\n  IDLTools.buildProxyForIDL = function(proxyObject, interfaceName) {\n    var intf, intfMethod, messagePrefix, _i, _len, _ref, _results;\n    intf = IDLTools.getIDL(interfaceName);\n    messagePrefix = \"building proxy for IDL \" + interfaceName + \": \";\n    if (null === intf) {\n      throw new Ex(arguments, messagePrefix + (\"idl not found: '\" + interfaceName + \"'\"));\n    }\n    _ref = intf.methods;\n    _results = [];\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      intfMethod = _ref[_i];\n      _results.push(proxyObject[intfMethod.name] = getProxyMethod(intf, intfMethod));\n    }\n    return _results;\n  };\n\n  return IDLTools;\n\n})();\n\ngetProxyMethod = function(intf, method) {\n  var proxyMethod, result;\n  result = proxyMethod = function() {\n    var args, callbackId;\n    callbackId = null;\n    args = [].slice.call(arguments);\n    if (args.length > 0) {\n      if (typeof args[args.length - 1] === \"function\") {\n        callbackId = Callback.register(args[args.length - 1]);\n        args = args.slice(0, args.length - 1);\n      }\n    }\n    while (args.length < method.parameters.length) {\n      args.push(null);\n    }\n    args.push(callbackId);\n    return this.__invoke(intf.name, method.name, args);\n  };\n  result.displayName = intf.name + \"__\" + method.name;\n  return result;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/MessageDispatcher.amd.js",
    "content": ";modjewel.define(\"weinre/common/MessageDispatcher\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, Callback, Ex, IDLTools, InspectorBackend, MessageDispatcher, Verbose, WebSocketXhr, Weinre,\n  __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\nWeinre = require('./Weinre');\n\nWebSocketXhr = require('./WebSocketXhr');\n\nIDLTools = require('./IDLTools');\n\nBinding = require('./Binding');\n\nEx = require('./Ex');\n\nCallback = require('./Callback');\n\nVerbose = false;\n\nInspectorBackend = null;\n\nmodule.exports = MessageDispatcher = (function() {\n  function MessageDispatcher(url, id) {\n    if (!id) {\n      id = \"anonymous\";\n    }\n    this._url = url;\n    this._id = id;\n    this.error = null;\n    this._opening = false;\n    this._opened = false;\n    this._closed = false;\n    this._interfaces = {};\n    this._open();\n  }\n\n  MessageDispatcher.setInspectorBackend = function(inspectorBackend) {\n    return InspectorBackend = inspectorBackend;\n  };\n\n  MessageDispatcher.verbose = function(value) {\n    if (arguments.length >= 1) {\n      Verbose = !!value;\n    }\n    return Verbose;\n  };\n\n  MessageDispatcher.prototype._open = function() {\n    if (this._opened || this._opening) {\n      return;\n    }\n    if (this._closed) {\n      throw new Ex(arguments, \"socket has already been closed\");\n    }\n    this._opening = true;\n    this._socket = new WebSocketXhr(this._url, this._id);\n    this._socket.addEventListener(\"open\", Binding(this, \"_handleOpen\"));\n    this._socket.addEventListener(\"error\", Binding(this, \"_handleError\"));\n    this._socket.addEventListener(\"message\", Binding(this, \"_handleMessage\"));\n    return this._socket.addEventListener(\"close\", Binding(this, \"_handleClose\"));\n  };\n\n  MessageDispatcher.prototype.close = function() {\n    if (this._closed) {\n      return;\n    }\n    this._opened = false;\n    this._closed = true;\n    return this._socket.close();\n  };\n\n  MessageDispatcher.prototype.send = function(data) {\n    return this._socket.send(data);\n  };\n\n  MessageDispatcher.prototype.getWebSocket = function() {\n    return this._socket;\n  };\n\n  MessageDispatcher.prototype.registerInterface = function(intfName, intf, validate) {\n    if (validate) {\n      IDLTools.validateAgainstIDL(intf.constructor, intfName);\n    }\n    if (this._interfaces[intfName]) {\n      throw new Ex(arguments, \"interface \" + intfName + \" has already been registered\");\n    }\n    return this._interfaces[intfName] = intf;\n  };\n\n  MessageDispatcher.prototype.createProxy = function(intfName) {\n    var proxy, self, __invoke;\n    proxy = {};\n    IDLTools.buildProxyForIDL(proxy, intfName);\n    self = this;\n    proxy.__invoke = __invoke = function(intfName, methodName, args) {\n      return self._sendMethodInvocation(intfName, methodName, args);\n    };\n    return proxy;\n  };\n\n  MessageDispatcher.prototype._sendMethodInvocation = function(intfName, methodName, args) {\n    var data;\n    if (typeof intfName !== \"string\") {\n      throw new Ex(arguments, \"expecting intf parameter to be a string\");\n    }\n    if (typeof methodName !== \"string\") {\n      throw new Ex(arguments, \"expecting method parameter to be a string\");\n    }\n    data = {\n      \"interface\": intfName,\n      method: methodName,\n      args: args\n    };\n    data = JSON.stringify(data);\n    this._socket.send(data);\n    if (Verbose) {\n      return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: send \" + intfName + \".\" + methodName + \"(\" + (JSON.stringify(args)) + \")\"));\n    }\n  };\n\n  MessageDispatcher.prototype.getState = function() {\n    if (this._opening) {\n      return \"opening\";\n    }\n    if (this._opened) {\n      return \"opened\";\n    }\n    if (this._closed) {\n      return \"closed\";\n    }\n    return \"unknown\";\n  };\n\n  MessageDispatcher.prototype.isOpen = function() {\n    return this._opened === true;\n  };\n\n  MessageDispatcher.prototype._handleOpen = function(event) {\n    this._opening = false;\n    this._opened = true;\n    this.channel = event.channel;\n    Callback.setConnectorChannel(this.channel);\n    if (Verbose) {\n      return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: opened\"));\n    }\n  };\n\n  MessageDispatcher.prototype._handleError = function(message) {\n    this.error = message;\n    this.close();\n    if (Verbose) {\n      return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: error: \") + message);\n    }\n  };\n\n  MessageDispatcher.prototype._handleMessage = function(message) {\n    var args, data, e, intf, intfName, method, methodName, methodSignature, skipErrorForMethods;\n    skipErrorForMethods = ['domContentEventFired', 'loadEventFired', 'childNodeRemoved'];\n    try {\n      data = JSON.parse(message.data);\n    } catch (_error) {\n      e = _error;\n      throw new Ex(arguments, \"invalid JSON data received: \" + e + \": '\" + message.data + \"'\");\n    }\n    intfName = data[\"interface\"];\n    methodName = data.method;\n    args = data.args;\n    methodSignature = \"\" + intfName + \".\" + methodName + \"()\";\n    intf = this._interfaces.hasOwnProperty(intfName) && this._interfaces[intfName];\n    if (!intf && InspectorBackend && intfName.match(/.*Notify/)) {\n      intf = InspectorBackend.getRegisteredDomainDispatcher(intfName.substr(0, intfName.length - 6));\n    }\n    if (!intf) {\n      Weinre.notImplemented(\"weinre: request for non-registered interface: \" + methodSignature);\n      return;\n    }\n    methodSignature = intf.constructor.name + (\".\" + methodName + \"()\");\n    method = intf[methodName];\n    if (typeof method !== \"function\") {\n      Weinre.notImplemented(methodSignature);\n      return;\n    }\n    try {\n      method.apply(intf, args);\n    } catch (_error) {\n      e = _error;\n      if (__indexOf.call(skipErrorForMethods, methodName) < 0) {\n        Weinre.logError((\"weinre: invocation exception on \" + methodSignature + \": \") + e);\n      }\n    }\n    if (Verbose) {\n      return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: recv \" + intfName + \".\" + methodName + \"(\" + (JSON.stringify(args)) + \")\"));\n    }\n  };\n\n  MessageDispatcher.prototype._handleClose = function() {\n    this._reallyClosed = true;\n    if (Verbose) {\n      return Weinre.logDebug(this.constructor.name + (\"[\" + this._url + \"]: closed\"));\n    }\n  };\n\n  return MessageDispatcher;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/MethodNamer.amd.js",
    "content": ";modjewel.define(\"weinre/common/MethodNamer\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar MethodNamer,\n  __hasProp = {}.hasOwnProperty;\n\nmodule.exports = MethodNamer = (function() {\n  function MethodNamer() {}\n\n  MethodNamer.setNamesForClass = function(aClass) {\n    var key, val, _ref, _results;\n    for (key in aClass) {\n      if (!__hasProp.call(aClass, key)) continue;\n      val = aClass[key];\n      if (typeof val === \"function\") {\n        val.signature = \"\" + aClass.name + \"::\" + key;\n        val.displayName = key;\n        val.name = key;\n      }\n    }\n    _ref = aClass.prototype;\n    _results = [];\n    for (key in _ref) {\n      if (!__hasProp.call(_ref, key)) continue;\n      val = _ref[key];\n      if (typeof val === \"function\") {\n        val.signature = \"\" + aClass.name + \".\" + key;\n        val.displayName = key;\n        _results.push(val.name = key);\n      } else {\n        _results.push(void 0);\n      }\n    }\n    return _results;\n  };\n\n  return MethodNamer;\n\n})();\n\nMethodNamer.setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/StackTrace.amd.js",
    "content": ";modjewel.define(\"weinre/common/StackTrace\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar StackTrace, getTrace;\n\nmodule.exports = StackTrace = (function() {\n  function StackTrace(args) {\n    if (!args || !args.callee) {\n      throw Error(\"first parameter to \" + arguments.callee.signature + \" must be an Arguments object\");\n    }\n    this.trace = getTrace(args);\n  }\n\n  StackTrace.dump = function(args) {\n    var stackTrace;\n    args = args || arguments;\n    stackTrace = new StackTrace(args);\n    return stackTrace.dump();\n  };\n\n  StackTrace.prototype.dump = function() {\n    var frame, _i, _len, _ref, _results;\n    console.log(\"StackTrace:\");\n    _ref = this.trace;\n    _results = [];\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      frame = _ref[_i];\n      _results.push(console.log(\"    \" + frame));\n    }\n    return _results;\n  };\n\n  return StackTrace;\n\n})();\n\ngetTrace = function(args) {\n  var err, func, result, visitedFuncs;\n  result = [];\n  visitedFuncs = [];\n  func = args.callee;\n  while (func) {\n    if (func.signature) {\n      result.push(func.signature);\n    } else if (func.displayName) {\n      result.push(func.displayName);\n    } else if (func.name) {\n      result.push(func.name);\n    } else {\n      result.push(\"<anonymous>\");\n    }\n    if (-1 !== visitedFuncs.indexOf(func)) {\n      result.push(\"... recursion\");\n      return result;\n    }\n    visitedFuncs.push(func);\n    try {\n      func = func.caller;\n    } catch (_error) {\n      err = _error;\n      func = null;\n    }\n  }\n  return result;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/WebSocketXhr.amd.js",
    "content": ";modjewel.define(\"weinre/common/WebSocketXhr\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar EventListeners, Ex, HookLib, WebSocketXhr, Weinre, _xhrEventHandler;\n\nEx = require('./Ex');\n\nWeinre = require('./Weinre');\n\nHookLib = require('./HookLib');\n\nEventListeners = require('./EventListeners');\n\nmodule.exports = WebSocketXhr = (function() {\n  WebSocketXhr.CONNECTING = 0;\n\n  WebSocketXhr.OPEN = 1;\n\n  WebSocketXhr.CLOSING = 2;\n\n  WebSocketXhr.CLOSED = 3;\n\n  function WebSocketXhr(url, id) {\n    this.initialize(url, id);\n  }\n\n  WebSocketXhr.prototype.initialize = function(url, id) {\n    if (!id) {\n      id = \"anonymous\";\n    }\n    this.readyState = WebSocketXhr.CONNECTING;\n    this._url = url;\n    this._id = id;\n    this._urlChannel = null;\n    this._queuedSends = [];\n    this._sendInProgress = true;\n    this._listeners = {\n      open: new EventListeners(),\n      message: new EventListeners(),\n      error: new EventListeners(),\n      close: new EventListeners()\n    };\n    return this._getChannel();\n  };\n\n  WebSocketXhr.prototype._getChannel = function() {\n    var body;\n    body = JSON.stringify({\n      id: this._id\n    });\n    return this._xhr(this._url, \"POST\", body, this._handleXhrResponseGetChannel);\n  };\n\n  WebSocketXhr.prototype._handleXhrResponseGetChannel = function(xhr) {\n    var e, object;\n    if (xhr.status !== 200) {\n      return this._handleXhrResponseError(xhr);\n    }\n    try {\n      object = JSON.parse(xhr.responseText);\n    } catch (_error) {\n      e = _error;\n      this._fireEventListeners(\"error\", {\n        message: \"non-JSON response from channel open request\"\n      });\n      this.close();\n      return;\n    }\n    if (!object.channel) {\n      this._fireEventListeners(\"error\", {\n        message: \"channel open request did not include a channel\"\n      });\n      this.close();\n      return;\n    }\n    this._urlChannel = this._url + \"/\" + object.channel;\n    this.readyState = WebSocketXhr.OPEN;\n    this._fireEventListeners(\"open\", {\n      message: \"open\",\n      channel: object.channel\n    });\n    this._sendInProgress = false;\n    this._sendQueued();\n    return this._readLoop();\n  };\n\n  WebSocketXhr.prototype._readLoop = function() {\n    if (this.readyState === WebSocketXhr.CLOSED) {\n      return;\n    }\n    if (this.readyState === WebSocketXhr.CLOSING) {\n      return;\n    }\n    return this._xhr(this._urlChannel, \"GET\", \"\", this._handleXhrResponseGet);\n  };\n\n  WebSocketXhr.prototype._handleXhrResponseGet = function(xhr) {\n    var data, datum, e, self, _i, _len, _results;\n    self = this;\n    if (xhr.status !== 200) {\n      return this._handleXhrResponseError(xhr);\n    }\n    try {\n      datum = JSON.parse(xhr.responseText);\n    } catch (_error) {\n      e = _error;\n      this.readyState = WebSocketXhr.CLOSED;\n      this._fireEventListeners(\"error\", {\n        message: \"non-JSON response from read request\"\n      });\n      return;\n    }\n    HookLib.ignoreHooks(function() {\n      return setTimeout((function() {\n        return self._readLoop();\n      }), 0);\n    });\n    _results = [];\n    for (_i = 0, _len = datum.length; _i < _len; _i++) {\n      data = datum[_i];\n      _results.push(self._fireEventListeners(\"message\", {\n        data: data\n      }));\n    }\n    return _results;\n  };\n\n  WebSocketXhr.prototype.send = function(data) {\n    if (typeof data !== \"string\") {\n      throw new Ex(arguments, this.constructor.name + \".send\");\n    }\n    this._queuedSends.push(data);\n    if (this._sendInProgress) {\n      return;\n    }\n    return this._sendQueued();\n  };\n\n  WebSocketXhr.prototype._sendQueued = function() {\n    var datum;\n    if (this._queuedSends.length === 0) {\n      return;\n    }\n    if (this.readyState === WebSocketXhr.CLOSED) {\n      return;\n    }\n    if (this.readyState === WebSocketXhr.CLOSING) {\n      return;\n    }\n    datum = JSON.stringify(this._queuedSends);\n    this._queuedSends = [];\n    this._sendInProgress = true;\n    return this._xhr(this._urlChannel, \"POST\", datum, this._handleXhrResponseSend);\n  };\n\n  WebSocketXhr.prototype._handleXhrResponseSend = function(xhr) {\n    var httpSocket;\n    httpSocket = this;\n    if (xhr.status !== 200) {\n      return this._handleXhrResponseError(xhr);\n    }\n    this._sendInProgress = false;\n    return HookLib.ignoreHooks(function() {\n      return setTimeout((function() {\n        return httpSocket._sendQueued();\n      }), 0);\n    });\n  };\n\n  WebSocketXhr.prototype.close = function() {\n    this._sendInProgress = true;\n    this.readyState = WebSocketXhr.CLOSING;\n    this._fireEventListeners(\"close\", {\n      message: \"closing\",\n      wasClean: true\n    });\n    return this.readyState = WebSocketXhr.CLOSED;\n  };\n\n  WebSocketXhr.prototype.addEventListener = function(type, listener, useCapture) {\n    return this._getListeners(type).add(listener, useCapture);\n  };\n\n  WebSocketXhr.prototype.removeEventListener = function(type, listener, useCapture) {\n    return this._getListeners(type).remove(listener, useCapture);\n  };\n\n  WebSocketXhr.prototype._fireEventListeners = function(type, event) {\n    if (this.readyState === WebSocketXhr.CLOSED) {\n      return;\n    }\n    event.target = this;\n    return this._getListeners(type).fire(event);\n  };\n\n  WebSocketXhr.prototype._getListeners = function(type) {\n    var listeners;\n    listeners = this._listeners[type];\n    if (null === listeners) {\n      throw new Ex(arguments, \"invalid event listener type: '\" + type + \"'\");\n    }\n    return listeners;\n  };\n\n  WebSocketXhr.prototype._handleXhrResponseError = function(xhr) {\n    if (xhr.status === 404) {\n      this.close();\n      return;\n    }\n    this._fireEventListeners(\"error\", {\n      target: this,\n      status: xhr.status,\n      message: \"error from XHR invocation: \" + xhr.statusText\n    });\n    return Weinre.logError((\"error from XHR invocation: \" + xhr.status + \": \") + xhr.statusText);\n  };\n\n  WebSocketXhr.prototype._xhr = function(url, method, data, handler) {\n    var xhr;\n    if (null === handler) {\n      throw new Ex(arguments, \"handler must not be null\");\n    }\n    xhr = (XMLHttpRequest.noConflict ? new XMLHttpRequest.noConflict() : new XMLHttpRequest());\n    xhr.httpSocket = this;\n    xhr.httpSocketHandler = handler;\n    xhr.onreadystatechange = function() {\n      return _xhrEventHandler(xhr);\n    };\n    HookLib.ignoreHooks(function() {\n      return xhr.open(method, url, true);\n    });\n    xhr.setRequestHeader(\"Content-Type\", \"text/plain\");\n    return HookLib.ignoreHooks(function() {\n      return xhr.send(data);\n    });\n  };\n\n  return WebSocketXhr;\n\n})();\n\n_xhrEventHandler = function(xhr) {\n  if (xhr.readyState !== 4) {\n    return;\n  }\n  return xhr.httpSocketHandler.call(xhr.httpSocket, xhr);\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/common/Weinre.amd.js",
    "content": ";modjewel.define(\"weinre/common/Weinre\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar ConsoleLogger, Ex, IDLTools, StackTrace, Weinre, consoleLogger, getLogger, logger, _notImplemented, _showNotImplemented;\n\nEx = require('./Ex');\n\nIDLTools = require('./IDLTools');\n\nStackTrace = require('./StackTrace');\n\n_notImplemented = {};\n\n_showNotImplemented = false;\n\nlogger = null;\n\nmodule.exports = Weinre = (function() {\n  function Weinre() {\n    throw new Ex(arguments, \"this class is not intended to be instantiated\");\n  }\n\n  Weinre.addIDLs = function(idls) {\n    return IDLTools.addIDLs(idls);\n  };\n\n  Weinre.deprecated = function() {\n    return StackTrace.dump(arguments);\n  };\n\n  Weinre.notImplemented = function(thing) {\n    if (_notImplemented[thing]) {\n      return;\n    }\n    _notImplemented[thing] = true;\n    if (!_showNotImplemented) {\n      return;\n    }\n    return Weinre.logWarning(thing + \" not implemented\");\n  };\n\n  Weinre.showNotImplemented = function() {\n    var key, _results;\n    _showNotImplemented = true;\n    _results = [];\n    for (key in _notImplemented) {\n      _results.push(Weinre.logWarning(key + \" not implemented\"));\n    }\n    return _results;\n  };\n\n  Weinre.logError = function(message) {\n    return getLogger().logError(message);\n  };\n\n  Weinre.logWarning = function(message) {\n    return getLogger().logWarning(message);\n  };\n\n  Weinre.logInfo = function(message) {\n    return getLogger().logInfo(message);\n  };\n\n  Weinre.logDebug = function(message) {\n    return getLogger().logDebug(message);\n  };\n\n  return Weinre;\n\n})();\n\nConsoleLogger = (function() {\n  function ConsoleLogger() {}\n\n  ConsoleLogger.prototype.logError = function(message) {\n    return console.log(\"error: \" + message);\n  };\n\n  ConsoleLogger.prototype.logWarning = function(message) {\n    return console.log(\"warning: \" + message);\n  };\n\n  ConsoleLogger.prototype.logInfo = function(message) {\n    return console.log(\"info: \" + message);\n  };\n\n  ConsoleLogger.prototype.logDebug = function(message) {\n    return console.log(\"debug: \" + message);\n  };\n\n  return ConsoleLogger;\n\n})();\n\nconsoleLogger = new ConsoleLogger();\n\ngetLogger = function() {\n  if (logger) {\n    return logger;\n  }\n  if (Weinre.client) {\n    logger = Weinre.WeinreClientCommands;\n    return logger;\n  }\n  if (Weinre.target) {\n    logger = Weinre.WeinreTargetCommands;\n    return logger;\n  }\n  return consoleLogger;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/BrowserHacks.amd.js",
    "content": ";modjewel.define(\"weinre/target/BrowserHacks\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar BrowserHacks;\n\nBrowserHacks = function() {\n  if (typeof document.addEventListener === \"undefined\") {\n    alert(\"Oops. It seems the page runs in compatibility mode. Please fix it and try again.\");\n    return;\n  }\n  if (typeof window.Element === \"undefined\") {\n    window.Element = function() {};\n  }\n  if (typeof window.Node === \"undefined\") {\n    window.Node = function() {};\n  }\n  if (!Object.getPrototypeOf) {\n    Object.getPrototypeOf = function(object) {\n      if (!object.__proto__) {\n        throw new Error(\"This vm does not support __proto__ and getPrototypeOf. Script requires any of them to operate correctly.\");\n      }\n      return object.__proto__;\n    };\n  }\n};\n\nBrowserHacks();\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/CSSStore.amd.js",
    "content": ";modjewel.define(\"weinre/target/CSSStore\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar CSSStore, IDGenerator, Weinre, _elementMatchesSelector, _fallbackMatchesSelector, _getMappableId, _getMappableObject, _mozMatchesSelector, _msMatchesSelector, _webkitMatchesSelector;\n\nIDGenerator = require('../common/IDGenerator');\n\nWeinre = require('../common/Weinre');\n\n_elementMatchesSelector = null;\n\nmodule.exports = CSSStore = (function() {\n  function CSSStore() {\n    this.styleSheetMap = {};\n    this.styleRuleMap = {};\n    this.styleDeclMap = {};\n    this.testElement = document.createElement(\"div\");\n  }\n\n  CSSStore.prototype.getInlineStyle = function(node) {\n    var cssProperty, styleObject, _i, _len, _ref;\n    styleObject = this._buildMirrorForStyle(node.style, true);\n    _ref = styleObject.cssProperties;\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      cssProperty = _ref[_i];\n      cssProperty.status = \"style\";\n    }\n    return styleObject;\n  };\n\n  CSSStore.prototype.getComputedStyle = function(node) {\n    var styleObject;\n    if (!node) {\n      return {};\n    }\n    if (node.nodeType !== Node.ELEMENT_NODE) {\n      return {};\n    }\n    styleObject = this._buildMirrorForStyle(window.getComputedStyle(node), false);\n    return styleObject;\n  };\n\n  CSSStore.prototype.getMatchedCSSRules = function(node) {\n    var cssRule, err, object, result, styleSheet, _i, _j, _len, _len1, _ref, _ref1;\n    result = [];\n    try {\n      _ref = document.styleSheets;\n      for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n        styleSheet = _ref[_i];\n        if (!styleSheet.cssRules) {\n          continue;\n        }\n        _ref1 = styleSheet.cssRules;\n        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {\n          cssRule = _ref1[_j];\n          if (!_elementMatchesSelector(node, cssRule.selectorText)) {\n            continue;\n          }\n          object = {};\n          object.ruleId = this._getStyleRuleId(cssRule);\n          object.selectorText = cssRule.selectorText;\n          object.style = this._buildMirrorForStyle(cssRule.style, true);\n          result.push(object);\n        }\n      }\n    } catch (_error) {\n      err = _error;\n      return result;\n    }\n    return result;\n  };\n\n  CSSStore.prototype.getStyleAttributes = function(node) {\n    var result;\n    result = {};\n    return result;\n  };\n\n  CSSStore.prototype.getPseudoElements = function(node) {\n    var result;\n    result = [];\n    return result;\n  };\n\n  CSSStore.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite) {\n    var compare, i, key, mirror, properties, propertyIndices, propertyMirror, styleDecl;\n    styleDecl = Weinre.cssStore._getStyleDecl(styleId);\n    if (!styleDecl) {\n      Weinre.logWarning(\"requested style not available: \" + styleId);\n      return null;\n    }\n    mirror = styleDecl.__weinre__mirror;\n    if (!mirror) {\n      Weinre.logWarning(\"requested mirror not available: \" + styleId);\n      return null;\n    }\n    properties = mirror.cssProperties;\n    propertyMirror = this._parseProperty(text);\n    if (null === propertyMirror) {\n      this._removePropertyFromMirror(mirror, propertyIndex);\n      properties = mirror.cssProperties;\n    } else {\n      this._removePropertyFromMirror(mirror, propertyIndex);\n      properties = mirror.cssProperties;\n      propertyIndices = {};\n      i = 0;\n      while (i < properties.length) {\n        propertyIndices[properties[i].name] = i;\n        i++;\n      }\n      i = 0;\n      while (i < propertyMirror.cssProperties.length) {\n        if (propertyIndices[propertyMirror.cssProperties[i].name] != null) {\n          properties[propertyIndices[propertyMirror.cssProperties[i].name]] = propertyMirror.cssProperties[i];\n        } else {\n          properties.push(propertyMirror.cssProperties[i]);\n        }\n        i++;\n      }\n      for (key in propertyMirror.shorthandValues) {\n        mirror.shorthandValues[key] = propertyMirror.shorthandValues[key];\n      }\n    }\n    properties.sort(compare = function(p1, p2) {\n      if (p1.name < p2.name) {\n        return -1;\n      } else if (p1.name > p2.name) {\n        return 1;\n      } else {\n        return 0;\n      }\n    });\n    this._setStyleFromMirror(styleDecl);\n    return mirror;\n  };\n\n  CSSStore.prototype._removePropertyFromMirror = function(mirror, index) {\n    var i, newProperties, properties, property;\n    properties = mirror.cssProperties;\n    if (index >= properties.length) {\n      return;\n    }\n    property = properties[index];\n    properties[index] = null;\n    if (mirror.shorthandValues[property.name]) {\n      delete mirror.shorthandValues[property.name];\n      i = 0;\n      while (i < properties.length) {\n        if (properties[i]) {\n          if (properties[i].shorthandName === property.name) {\n            properties[i] = null;\n          }\n        }\n        i++;\n      }\n    }\n    newProperties = [];\n    i = 0;\n    while (i < properties.length) {\n      if (properties[i]) {\n        newProperties.push(properties[i]);\n      }\n      i++;\n    }\n    return mirror.cssProperties = newProperties;\n  };\n\n  CSSStore.prototype.toggleProperty = function(styleId, propertyIndex, disable) {\n    var cssProperty, mirror, styleDecl;\n    styleDecl = Weinre.cssStore._getStyleDecl(styleId);\n    if (!styleDecl) {\n      Weinre.logWarning(\"requested style not available: \" + styleId);\n      return null;\n    }\n    mirror = styleDecl.__weinre__mirror;\n    if (!mirror) {\n      Weinre.logWarning(\"requested mirror not available: \" + styleId);\n      return null;\n    }\n    cssProperty = mirror.cssProperties[propertyIndex];\n    if (!cssProperty) {\n      Weinre.logWarning((\"requested property not available: \" + styleId + \": \") + propertyIndex);\n      return null;\n    }\n    if (disable) {\n      cssProperty.status = \"disabled\";\n    } else {\n      cssProperty.status = \"active\";\n    }\n    this._setStyleFromMirror(styleDecl);\n    return mirror;\n  };\n\n  CSSStore.prototype._setStyleFromMirror = function(styleDecl) {\n    var cssProperties, cssText, property, _i, _len;\n    cssText = [];\n    cssProperties = styleDecl.__weinre__mirror.cssProperties;\n    cssText = \"\";\n    for (_i = 0, _len = cssProperties.length; _i < _len; _i++) {\n      property = cssProperties[_i];\n      if (!property.parsedOk) {\n        continue;\n      }\n      if (property.status === \"disabled\") {\n        continue;\n      }\n      if (property.shorthandName) {\n        continue;\n      }\n      cssText += property.name + \": \" + property.value;\n      if (property.priority === \"important\") {\n        cssText += \" !important; \";\n      } else {\n        cssText += \"; \";\n      }\n    }\n    return styleDecl.cssText = cssText;\n  };\n\n  CSSStore.prototype._buildMirrorForStyle = function(styleDecl, bind) {\n    var i, name, properties, property, result, shorthandName;\n    result = {\n      properties: {},\n      cssProperties: []\n    };\n    if (!styleDecl) {\n      return result;\n    }\n    if (bind) {\n      result.styleId = this._getStyleDeclId(styleDecl);\n      styleDecl.__weinre__mirror = result;\n    }\n    result.properties.width = styleDecl.getPropertyValue(\"width\") || \"\";\n    result.properties.height = styleDecl.getPropertyValue(\"height\") || \"\";\n    result.cssText = styleDecl.cssText;\n    result.shorthandValues = {};\n    properties = [];\n    if (styleDecl) {\n      i = 0;\n      while (i < styleDecl.length) {\n        property = {};\n        name = styleDecl.item(i);\n        property.name = name;\n        property.priority = styleDecl.getPropertyPriority(name);\n        property.implicit = typeof styleDecl.isPropertyImplicit !== \"undefined\" ? styleDecl.isPropertyImplicit(name) : true;\n        property.shorthandName = typeof styleDecl.getPropertyShorthand !== \"undefined\" ? styleDecl.getPropertyShorthand(name) || \"\" : \"\";\n        property.status = (property.shorthandName ? \"style\" : \"active\");\n        property.parsedOk = true;\n        property.value = styleDecl.getPropertyValue(name);\n        properties.push(property);\n        if (property.shorthandName) {\n          shorthandName = property.shorthandName;\n          if (!result.shorthandValues[shorthandName]) {\n            result.shorthandValues[shorthandName] = styleDecl.getPropertyValue(shorthandName);\n            property = {};\n            property.name = shorthandName;\n            property.priority = styleDecl.getPropertyPriority(shorthandName);\n            property.implicit = styleDecl.isPropertyImplicit(shorthandName);\n            property.shorthandName = \"\";\n            property.status = \"active\";\n            property.parsedOk = true;\n            property.value = styleDecl.getPropertyValue(name);\n            properties.push(property);\n          }\n        }\n        i++;\n      }\n    }\n    properties.sort(function(p1, p2) {\n      if (p1.name < p2.name) {\n        return -1;\n      } else if (p1.name > p2.name) {\n        return 1;\n      } else {\n        return 0;\n      }\n    });\n    result.cssProperties = properties;\n    return result;\n  };\n\n  CSSStore.prototype._parseProperty = function(string) {\n    var match, property, propertyPattern, result, testStyleDecl;\n    testStyleDecl = this.testElement.style;\n    try {\n      testStyleDecl.cssText = string;\n      if (testStyleDecl.cssText !== \"\") {\n        return this._buildMirrorForStyle(testStyleDecl, false);\n      }\n    } catch (_error) {}\n    propertyPattern = /\\s*(.+)\\s*:\\s*(.+)\\s*(!important)?\\s*;/;\n    match = propertyPattern.exec(string);\n    if (!match) {\n      return null;\n    }\n    match[3] = (match[3] === \"!important\" ? \"important\" : \"\");\n    property = {};\n    property.name = match[1];\n    property.priority = match[3];\n    property.implicit = true;\n    property.shorthandName = \"\";\n    property.status = \"inactive\";\n    property.parsedOk = false;\n    property.value = match[2];\n    result = {};\n    result.width = 0;\n    result.height = 0;\n    result.shorthandValues = 0;\n    result.cssProperties = [property];\n    return result;\n  };\n\n  CSSStore.prototype._getStyleSheet = function(id) {\n    return _getMappableObject(id, this.styleSheetMap);\n  };\n\n  CSSStore.prototype._getStyleSheetId = function(styleSheet) {\n    return _getMappableId(styleSheet, this.styleSheetMap);\n  };\n\n  CSSStore.prototype._getStyleRule = function(id) {\n    return _getMappableObject(id, this.styleRuleMap);\n  };\n\n  CSSStore.prototype._getStyleRuleId = function(styleRule) {\n    return _getMappableId(styleRule, this.styleRuleMap);\n  };\n\n  CSSStore.prototype._getStyleDecl = function(id) {\n    return _getMappableObject(id, this.styleDeclMap);\n  };\n\n  CSSStore.prototype._getStyleDeclId = function(styleDecl) {\n    return _getMappableId(styleDecl, this.styleDeclMap);\n  };\n\n  return CSSStore;\n\n})();\n\n_getMappableObject = function(id, map) {\n  return map[id];\n};\n\n_getMappableId = function(object, map) {\n  return IDGenerator.getId(object, map);\n};\n\n_mozMatchesSelector = function(element, selector) {\n  if (!element.mozMatchesSelector) {\n    return false;\n  }\n  return element.mozMatchesSelector(selector);\n};\n\n_webkitMatchesSelector = function(element, selector) {\n  if (!element.webkitMatchesSelector) {\n    return false;\n  }\n  return element.webkitMatchesSelector(selector);\n};\n\n_msMatchesSelector = function(element, selector) {\n  if (!element.msMatchesSelector) {\n    return false;\n  }\n  return element.msMatchesSelector(selector);\n};\n\n_fallbackMatchesSelector = function(element, selector) {\n  return false;\n};\n\nif (Element.prototype.webkitMatchesSelector) {\n  _elementMatchesSelector = _webkitMatchesSelector;\n} else if (Element.prototype.mozMatchesSelector) {\n  _elementMatchesSelector = _mozMatchesSelector;\n} else if (Element.prototype.msMatchesSelector) {\n  _elementMatchesSelector = _msMatchesSelector;\n} else {\n  _elementMatchesSelector = _fallbackMatchesSelector;\n}\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/CheckForProblems.amd.js",
    "content": ";modjewel.define(\"weinre/target/CheckForProblems\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar CheckForProblems, checkForOldPrototypeVersion;\n\nmodule.exports = CheckForProblems = (function() {\n  function CheckForProblems() {}\n\n  CheckForProblems.check = function() {\n    return checkForOldPrototypeVersion();\n  };\n\n  return CheckForProblems;\n\n})();\n\ncheckForOldPrototypeVersion = function() {\n  var badVersion;\n  badVersion = false;\n  if (typeof Prototype === \"undefined\") {\n    return;\n  }\n  if (!Prototype.Version) {\n    return;\n  }\n  if (Prototype.Version.match(/^1\\.5.*/)) {\n    badVersion = true;\n  }\n  if (Prototype.Version.match(/^1\\.6.*/)) {\n    badVersion = true;\n  }\n  if (badVersion) {\n    return alert(\"Sorry, weinre is not support in versions of Prototype earlier than 1.7\");\n  }\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/Console.amd.js",
    "content": ";modjewel.define(\"weinre/target/Console\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Console, MessageLevel, MessageSource, MessageType, OriginalConsole, RemoteConsole, Timeline, UsingRemote, Weinre;\n\nWeinre = require('../common/Weinre');\n\nTimeline = require('../target/Timeline');\n\nUsingRemote = false;\n\nRemoteConsole = null;\n\nOriginalConsole = null;\n\nMessageSource = {\n  HTML: 0,\n  WML: 1,\n  XML: 2,\n  JS: 3,\n  CSS: 4,\n  Other: 5\n};\n\nMessageType = {\n  Log: 0,\n  Object: 1,\n  Trace: 2,\n  StartGroup: 3,\n  StartGroupCollapsed: 4,\n  EndGroup: 5,\n  Assert: 6,\n  UncaughtException: 7,\n  Result: 8\n};\n\nMessageLevel = {\n  Tip: 0,\n  Log: 1,\n  Warning: 2,\n  Error: 3,\n  Debug: 4\n};\n\nmodule.exports = Console = (function() {\n  function Console() {}\n\n  Object.defineProperty(Console, 'original', {\n    get: function() {\n      return OriginalConsole;\n    }\n  });\n\n  Console.useRemote = function(value) {\n    var oldValue;\n    if (arguments.length === 0) {\n      return UsingRemote;\n    }\n    oldValue = UsingRemote;\n    UsingRemote = !!value;\n    if (UsingRemote) {\n      window.console = RemoteConsole;\n    } else {\n      window.console = OriginalConsole;\n    }\n    return oldValue;\n  };\n\n  Console.prototype._generic = function(level, messageParts) {\n    var message, messagePart, parameters, payload, _i, _len;\n    if (!(messageParts != null ? messageParts.length : void 0)) {\n      return;\n    }\n    message = messageParts[0].toString();\n    parameters = [];\n    for (_i = 0, _len = messageParts.length; _i < _len; _i++) {\n      messagePart = messageParts[_i];\n      parameters.push(Weinre.injectedScript.wrapObjectForConsole(messagePart, true));\n    }\n    payload = {\n      source: MessageSource.JS,\n      type: MessageType.Log,\n      level: level,\n      message: message,\n      parameters: parameters\n    };\n    return Weinre.wi.ConsoleNotify.addConsoleMessage(payload);\n  };\n\n  Console.prototype.log = function() {\n    return this._generic(MessageLevel.Log, [].slice.call(arguments));\n  };\n\n  Console.prototype.debug = function() {\n    return this._generic(MessageLevel.Debug, [].slice.call(arguments));\n  };\n\n  Console.prototype.error = function() {\n    return this._generic(MessageLevel.Error, [].slice.call(arguments));\n  };\n\n  Console.prototype.info = function() {\n    return this._generic(MessageLevel.Log, [].slice.call(arguments));\n  };\n\n  Console.prototype.warn = function() {\n    return this._generic(MessageLevel.Warning, [].slice.call(arguments));\n  };\n\n  Console.prototype.dir = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.dirxml = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.trace = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.assert = function(condition) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.count = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.markTimeline = function(message) {\n    return Timeline.addRecord_Mark(message);\n  };\n\n  Console.prototype.lastWMLErrorMessage = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.profile = function(title) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.profileEnd = function(title) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.time = function(title) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.timeEnd = function(title) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.group = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.groupCollapsed = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  Console.prototype.groupEnd = function() {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  return Console;\n\n})();\n\nRemoteConsole = new Console();\n\nwindow.consoleforspydebugger = RemoteConsole;\n\nOriginalConsole = window.console || {};\n\nRemoteConsole.__original = OriginalConsole;\n\nOriginalConsole.__original = OriginalConsole;\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/ElementHighlighter.amd.js",
    "content": ";modjewel.define(\"weinre/target/ElementHighlighter\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar ElementHighlighter, canvasAvailable, currentHighlighterElement, fromPx, getMetricsForElement, highlighterClass, supportsCanvas;\n\ncanvasAvailable = null;\n\nhighlighterClass = null;\n\ncurrentHighlighterElement = null;\n\nmodule.exports = ElementHighlighter = (function() {\n  ElementHighlighter.create = function() {\n    if (highlighterClass == null) {\n      highlighterClass = require('./ElementHighlighterDivs2');\n    }\n    return new highlighterClass();\n  };\n\n  function ElementHighlighter() {\n    this.hElement = this.createHighlighterElement();\n    this.hElement.__weinreHighlighter = true;\n    this.hElement.style.display = \"none\";\n    this.hElement.style.zIndex = 10 * 1000 * 1000;\n    if (currentHighlighterElement) {\n      document.body.removeChild(currentHighlighterElement);\n    }\n    currentHighlighterElement = this.hElement;\n    document.body.appendChild(this.hElement);\n  }\n\n  ElementHighlighter.prototype.on = function(element) {\n    if (null === element) {\n      return;\n    }\n    if (element.nodeType !== Node.ELEMENT_NODE) {\n      return;\n    }\n    this.redraw(getMetricsForElement(element));\n    return this.hElement.style.display = \"block\";\n  };\n\n  ElementHighlighter.prototype.off = function() {\n    return this.hElement.style.display = \"none\";\n  };\n\n  return ElementHighlighter;\n\n})();\n\ngetMetricsForElement = function(element) {\n  var cStyle, el, left, metrics, top;\n  metrics = {};\n  left = 0;\n  top = 0;\n  el = element;\n  while (true) {\n    left += el.offsetLeft;\n    top += el.offsetTop;\n    if (!(el = el.offsetParent)) {\n      break;\n    }\n  }\n  metrics.x = left;\n  metrics.y = top;\n  cStyle = document.defaultView.getComputedStyle(element);\n  metrics.width = element.offsetWidth;\n  metrics.height = element.offsetHeight;\n  metrics.marginLeft = fromPx(cStyle[\"margin-left\"] || cStyle[\"marginLeft\"]);\n  metrics.marginRight = fromPx(cStyle[\"margin-right\"] || cStyle[\"marginRight\"]);\n  metrics.marginTop = fromPx(cStyle[\"margin-top\"] || cStyle[\"marginTop\"]);\n  metrics.marginBottom = fromPx(cStyle[\"margin-bottom\"] || cStyle[\"marginBottom\"]);\n  metrics.borderLeft = fromPx(cStyle[\"border-left-width\"] || cStyle[\"borderLeftWidth\"]);\n  metrics.borderRight = fromPx(cStyle[\"border-right-width\"] || cStyle[\"borderRightWidth\"]);\n  metrics.borderTop = fromPx(cStyle[\"border-top-width\"] || cStyle[\"borderTopWidth\"]);\n  metrics.borderBottom = fromPx(cStyle[\"border-bottom-width\"] || cStyle[\"borderBottomWidth\"]);\n  metrics.paddingLeft = fromPx(cStyle[\"padding-left\"] || cStyle[\"paddingLeft\"]);\n  metrics.paddingRight = fromPx(cStyle[\"padding-right\"] || cStyle[\"paddingRight\"]);\n  metrics.paddingTop = fromPx(cStyle[\"padding-top\"] || cStyle[\"paddingTop\"]);\n  metrics.paddingBottom = fromPx(cStyle[\"padding-bottom\"] || cStyle[\"paddingBottom\"]);\n  metrics.x -= metrics.marginLeft;\n  metrics.y -= metrics.marginTop;\n  return metrics;\n};\n\nfromPx = function(string) {\n  return parseInt(string.replace(/px$/, \"\"));\n};\n\nsupportsCanvas = function() {\n  var element;\n  element = document.createElement('canvas');\n  if (!element.getContext) {\n    return false;\n  }\n  if (element.getContext('2d')) {\n    return true;\n  }\n  return false;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/ElementHighlighterDivs2.amd.js",
    "content": ";modjewel.define(\"weinre/target/ElementHighlighterDivs2\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar ColorBorder, ColorContent, ColorMargin, ColorPadding, ElementHighlighter, ElementHighlighterDivs2, px,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nElementHighlighter = require('./ElementHighlighter');\n\nColorMargin = 'rgba(246, 178, 107, 0.66)';\n\nColorBorder = 'rgba(255, 229, 153, 0.66)';\n\nColorPadding = 'rgba(147, 196, 125, 0.55)';\n\nColorContent = 'rgba(111, 168, 220, 0.66)';\n\nColorBorder = 'rgba(255, 255, 153, 0.40)';\n\nColorPadding = 'rgba(  0, 255,   0, 0.20)';\n\nColorContent = 'rgba(  0,   0, 255, 0.30)';\n\nmodule.exports = ElementHighlighterDivs2 = (function(_super) {\n  __extends(ElementHighlighterDivs2, _super);\n\n  function ElementHighlighterDivs2() {\n    return ElementHighlighterDivs2.__super__.constructor.apply(this, arguments);\n  }\n\n  ElementHighlighterDivs2.prototype.createHighlighterElement = function() {\n    this.hElement1 = document.createElement(\"weinreHighlighter\");\n    this.hElement1.style.position = 'absolute';\n    this.hElement1.style.overflow = 'hidden';\n    this.hElement2 = document.createElement(\"weinreHighlighter\");\n    this.hElement2.style.position = 'absolute';\n    this.hElement2.style.display = 'block';\n    this.hElement2.style.overflow = 'hidden';\n    this.hElement1.appendChild(this.hElement2);\n    this.hElement1.style.borderTopStyle = 'solid';\n    this.hElement1.style.borderLeftStyle = 'solid';\n    this.hElement1.style.borderBottomStyle = 'solid';\n    this.hElement1.style.borderRightStyle = 'solid';\n    this.hElement1.style.borderTopColor = ColorMargin;\n    this.hElement1.style.borderLeftColor = ColorMargin;\n    this.hElement1.style.borderBottomColor = ColorMargin;\n    this.hElement1.style.borderRightColor = ColorMargin;\n    this.hElement1.style.backgroundColor = ColorBorder;\n    this.hElement2.style.borderTopStyle = 'solid';\n    this.hElement2.style.borderLeftStyle = 'solid';\n    this.hElement2.style.borderBottomStyle = 'solid';\n    this.hElement2.style.borderRightStyle = 'solid';\n    this.hElement2.style.borderTopColor = ColorPadding;\n    this.hElement2.style.borderLeftColor = ColorPadding;\n    this.hElement2.style.borderBottomColor = ColorPadding;\n    this.hElement2.style.borderRightColor = ColorPadding;\n    this.hElement2.style.backgroundColor = ColorContent;\n    this.hElement1.style.outline = 'black solid thin';\n    return this.hElement1;\n  };\n\n  ElementHighlighterDivs2.prototype.redraw = function(metrics) {\n    this.hElement1.style.top = px(metrics.y);\n    this.hElement1.style.left = px(metrics.x);\n    this.hElement1.style.height = px(metrics.height);\n    this.hElement1.style.width = px(metrics.width);\n    this.hElement1.style.borderTopWidth = px(metrics.marginTop);\n    this.hElement1.style.borderLeftWidth = px(metrics.marginLeft);\n    this.hElement1.style.borderBottomWidth = px(metrics.marginBottom);\n    this.hElement1.style.borderRightWidth = px(metrics.marginRight);\n    this.hElement2.style.top = px(metrics.borderTop);\n    this.hElement2.style.left = px(metrics.borderLeft);\n    this.hElement2.style.bottom = px(metrics.borderBottom);\n    this.hElement2.style.right = px(metrics.borderRight);\n    this.hElement2.style.borderTopWidth = px(metrics.paddingTop);\n    this.hElement2.style.borderLeftWidth = px(metrics.paddingLeft);\n    this.hElement2.style.borderBottomWidth = px(metrics.paddingBottom);\n    return this.hElement2.style.borderRightWidth = px(metrics.paddingRight);\n  };\n\n  return ElementHighlighterDivs2;\n\n})(ElementHighlighter);\n\npx = function(value) {\n  return \"\" + value + \"px\";\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/HookSites.amd.js",
    "content": ";modjewel.define(\"weinre/target/HookSites\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookLib, HookSites;\n\nHookLib = require('../common/HookLib');\n\nmodule.exports = HookSites = (function() {\n  function HookSites() {}\n\n  return HookSites;\n\n})();\n\nHookSites.window_clearInterval = HookLib.addHookSite(window, \"clearInterval\");\n\nHookSites.window_clearTimeout = HookLib.addHookSite(window, \"clearTimeout\");\n\nHookSites.window_setInterval = HookLib.addHookSite(window, \"setInterval\");\n\nHookSites.window_setTimeout = HookLib.addHookSite(window, \"setTimeout\");\n\nHookSites.window_addEventListener = HookLib.addHookSite(window, \"addEventListener\");\n\nHookSites.Node_addEventListener = HookLib.addHookSite(Node.prototype, \"addEventListener\");\n\nHookSites.XMLHttpRequest_open = HookLib.addHookSite(XMLHttpRequest.prototype, \"open\");\n\nHookSites.XMLHttpRequest_send = HookLib.addHookSite(XMLHttpRequest.prototype, \"send\");\n\nHookSites.XMLHttpRequest_addEventListener = HookLib.addHookSite(XMLHttpRequest.prototype, \"addEventListener\");\n\nif (window.openDatabase) {\n  HookSites.window_openDatabase = HookLib.addHookSite(window, \"openDatabase\");\n}\n\nif (window.localStorage) {\n  HookSites.LocalStorage_setItem = HookLib.addHookSite(window.localStorage, \"setItem\");\n  HookSites.LocalStorage_removeItem = HookLib.addHookSite(window.localStorage, \"removeItem\");\n  HookSites.LocalStorage_clear = HookLib.addHookSite(window.localStorage, \"clear\");\n}\n\nif (window.sessionStorage) {\n  HookSites.SessionStorage_setItem = HookLib.addHookSite(window.sessionStorage, \"setItem\");\n  HookSites.SessionStorage_removeItem = HookLib.addHookSite(window.sessionStorage, \"removeItem\");\n  HookSites.SessionStorage_clear = HookLib.addHookSite(window.sessionStorage, \"clear\");\n}\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/InjectedScript.js",
    "content": "var injectedScriptConstructor = \n/*\n * Copyright (C) 2007 Apple Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1.  Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n * 2.  Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n * 3.  Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n *     its contributors may be used to endorse or promote products derived\n *     from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function (InjectedScriptHost, inspectedWindow, injectedScriptId) {\n\nfunction bind(thisObject, memberFunction)\n{\n    var func = memberFunction;\n    var args = Array.prototype.slice.call(arguments, 2);\n    function bound()\n    {\n        return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0)));\n    }\n    bound.toString = function() {\n        return \"bound: \" + func;\n    };\n    return bound;\n}\n\nvar InjectedScript = function()\n{\n    this._lastBoundObjectId = 1;\n    this._idToWrappedObject = {};\n    this._objectGroups = {};\n}\n\nInjectedScript.prototype = {\n    wrapObjectForConsole: function(object, canAccessInspectedWindow)\n    {\n        if (canAccessInspectedWindow)\n            return this._wrapObject(object, \"console\");\n        var result = {};\n        result.type = typeof object;\n        result.description = this._toString(object);\n        return result;\n    },\n\n    _wrapObject: function(object, objectGroupName, abbreviate)\n    {\n        try {\n            var objectId;\n            if (typeof object === \"object\" || typeof object === \"function\" || this._isHTMLAllCollection(object)) {\n                var id = this._lastBoundObjectId++;\n                this._idToWrappedObject[id] = object;\n    \n                var group = this._objectGroups[objectGroupName];\n                if (!group) {\n                    group = [];\n                    this._objectGroups[objectGroupName] = group;\n                }\n                group.push(id);\n                objectId = { injectedScriptId: injectedScriptId,\n                             id: id,\n                             groupName: objectGroupName };\n            }\n            return InjectedScript.RemoteObject.fromObject(object, objectId, abbreviate);\n        } catch (e) {\n            return InjectedScript.RemoteObject.fromObject(\"[ Exception: \" + e.toString() + \" ]\");\n        }\n    },\n\n    _parseObjectId: function(objectId)\n    {\n        return eval(\"(\" + objectId + \")\");\n    },\n\n    releaseWrapperObjectGroup: function(objectGroupName)\n    {\n        var group = this._objectGroups[objectGroupName];\n        if (!group)\n            return;\n        for (var i = 0; i < group.length; i++)\n            delete this._idToWrappedObject[group[i]];\n        delete this._objectGroups[objectGroupName];\n    },\n\n    dispatch: function(methodName, args)\n    {\n        var argsArray = eval(\"(\" + args + \")\");\n        var result = this[methodName].apply(this, argsArray);\n        if (typeof result === \"undefined\") {\n            inspectedWindow.console.error(\"Web Inspector error: InjectedScript.%s returns undefined\", methodName);\n            result = null;\n        }\n        return result;\n    },\n\n    getProperties: function(objectId, ignoreHasOwnProperty, abbreviate)\n    {\n        var parsedObjectId = this._parseObjectId(objectId);\n        var object = this._objectForId(parsedObjectId);\n\n        if (!this._isDefined(object))\n            return false;\n        var properties = [];\n        var propertyNames;\n\n        // IE returns 'Invalid calling object' for some of the prototypes, so return the object itself\n        if (window.navigator.userAgent.indexOf(\"MSIE\") != -1 ) {\n            propertyNames = this._getPropertyNames(object);\n        } else\n            propertyNames = ignoreHasOwnProperty ? this._getPropertyNames(object) : Object.getOwnPropertyNames(object);\n\n\n        if (!ignoreHasOwnProperty && object.__proto__)\n            propertyNames.push(\"__proto__\");\n    \n        // Go over properties, prepare results.\n        for (var i = 0; i < propertyNames.length; ++i) {\n            var propertyName = propertyNames[i];\n    \n            var property = {};\n            property.name = propertyName + \"\";\n            var isGetter = object[\"__lookupGetter__\"] && object.__lookupGetter__(propertyName);\n            if (!isGetter) {\n                try {\n                    property.value = this._wrapObject(object[propertyName], parsedObjectId.groupName, abbreviate);\n                } catch(e) {\n                    property.value = new InjectedScript.RemoteObject.fromException(e);\n                }\n            } else {\n                // FIXME: this should show something like \"getter\" (bug 16734).\n                property.value = new InjectedScript.RemoteObject.fromObject(\"\\u2014\"); // em dash\n                property.isGetter = true;\n            }\n            properties.push(property);\n        }\n        return properties;\n    },\n\n    setPropertyValue: function(objectId, propertyName, expression)\n    {\n        var parsedObjectId = this._parseObjectId(objectId);\n        var object = this._objectForId(parsedObjectId);\n        if (!this._isDefined(object))\n            return false;\n    \n        var expressionLength = expression.length;\n        if (!expressionLength) {\n            delete object[propertyName];\n            return !(propertyName in object);\n        }\n    \n        try {\n            // Surround the expression in parenthesis so the result of the eval is the result\n            // of the whole expression not the last potential sub-expression.\n    \n            // There is a regression introduced here: eval is now happening against global object,\n            // not call frame while on a breakpoint.\n            // TODO: bring evaluation against call frame back.\n            var result = inspectedWindow.eval(\"(\" + expression + \")\");\n            // Store the result in the property.\n            object[propertyName] = result;\n            return true;\n        } catch(e) {\n            try {\n                var result = inspectedWindow.eval(\"\\\"\" + expression.replace(/\"/g, \"\\\\\\\"\") + \"\\\"\");\n                object[propertyName] = result;\n                return true;\n            } catch(e) {\n                return false;\n            }\n        }\n    },\n\n    _populatePropertyNames: function(object, resultSet)\n    {\n        for (var o = object; o; o = Object.getPrototypeOf(o)) {\n            try {\n                var names = Object.getOwnPropertyNames(o);\n                for (var i = 0; i < names.length; ++i)\n                    resultSet[names[i]] = true;\n            } catch (e) {\n            }\n        }\n    },\n\n    _getPropertyNames: function(object, resultSet)\n    {\n        var propertyNameSet = {};\n        this._populatePropertyNames(object, propertyNameSet);\n        return Object.keys(propertyNameSet);\n    },\n\n    getCompletions: function(expression, includeCommandLineAPI)\n    {\n        var props = {};\n        try {\n            if (!expression)\n                expression = \"this\";\n            var expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false, false);\n\n            if (typeof expressionResult === \"object\")\n                this._populatePropertyNames(expressionResult, props);\n\n            if (includeCommandLineAPI) {\n                for (var prop in CommandLineAPI.members_)\n                    props[CommandLineAPI.members_[prop]] = true;\n            }\n        } catch(e) {\n        }\n        return props;\n    },\n\n    getCompletionsOnCallFrame: function(callFrameId, expression, includeCommandLineAPI)\n    {\n        var props = {};\n        try {\n            var callFrame = this._callFrameForId(callFrameId);\n            if (!callFrame)\n                return props;\n\n            if (expression) {\n                var expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true, false);\n                if (typeof expressionResult === \"object\")\n                    this._populatePropertyNames(expressionResult, props);\n            } else {\n                // Evaluate into properties in scope of the selected call frame.\n                var scopeChain = callFrame.scopeChain;\n                for (var i = 0; i < scopeChain.length; ++i)\n                    this._populatePropertyNames(scopeChain[i], props);\n            }\n    \n            if (includeCommandLineAPI) {\n                for (var prop in CommandLineAPI.members_)\n                    props[CommandLineAPI.members_[prop]] = true;\n            }\n        } catch(e) {\n        }\n        return props;\n    },\n\n    evaluate: function(expression, objectGroup, injectCommandLineAPI)\n    {\n        return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup, false, injectCommandLineAPI);\n    },\n\n    _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame, injectCommandLineAPI)\n    {\n        try {\n            return this._wrapObject(this._evaluateOn(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI), objectGroup);\n        } catch (e) {\n            return InjectedScript.RemoteObject.fromException(e);\n        }\n    },\n\n    _evaluateOn: function(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI)\n    {\n        // Only install command line api object for the time of evaluation.\n        // Surround the expression in with statements to inject our command line API so that\n        // the window object properties still take more precedent than our API functions.\n\n        try {\n            if (injectCommandLineAPI && inspectedWindow.console) {\n                inspectedWindow.console._commandLineAPI = new CommandLineAPI(this._commandLineAPIImpl, isEvalOnCallFrame ? object : null);\n                expression = \"with ((window && window.console && window.console._commandLineAPI) || {}) {\\n\" + expression + \"\\n}\";\n            }\n\n            var value = evalFunction.call(object, expression);\n\n            // When evaluating on call frame error is not thrown, but returned as a value.\n            if (this._type(value) === \"error\")\n                throw value.toString();\n\n            return value;\n        } finally {\n            if (injectCommandLineAPI && inspectedWindow.console)\n                delete inspectedWindow.console._commandLineAPI;\n        }\n    },\n\n    getNodeId: function(node)\n    {\n        return InjectedScriptHost.pushNodePathToFrontend(node, false, false);\n    },\n\n    callFrames: function()\n    {\n        var callFrame = InjectedScriptHost.currentCallFrame();\n        if (!callFrame)\n            return false;\n    \n        injectedScript.releaseWrapperObjectGroup(\"backtrace\");\n        var result = [];\n        var depth = 0;\n        do {\n            result.push(new InjectedScript.CallFrameProxy(depth++, callFrame));\n            callFrame = callFrame.caller;\n        } while (callFrame);\n        return result;\n    },\n\n    evaluateOnCallFrame: function(callFrameId, expression, objectGroup, injectCommandLineAPI)\n    {\n        var callFrame = this._callFrameForId(callFrameId);\n        if (!callFrame)\n            return false;\n        return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI);\n    },\n\n    _callFrameForId: function(callFrameId)\n    {\n        var parsedCallFrameId = eval(\"(\" + callFrameId + \")\");\n        var ordinal = parsedCallFrameId.ordinal;\n        var callFrame = InjectedScriptHost.currentCallFrame();\n        while (--ordinal >= 0 && callFrame)\n            callFrame = callFrame.caller;\n        return callFrame;\n    },\n\n    _nodeForId: function(nodeId)\n    {\n        if (!nodeId)\n            return null;\n        return InjectedScriptHost.nodeForId(nodeId);\n    },\n\n    _objectForId: function(objectId)\n    {\n        return this._idToWrappedObject[objectId.id];\n    },\n\n    resolveNode: function(nodeId)\n    {\n        var node = this._nodeForId(nodeId);\n        if (!node)\n            return false;\n        // FIXME: receive the object group from client.\n        return this._wrapObject(node, \"prototype\");\n    },\n\n    getNodeProperties: function(nodeId, properties)\n    {\n        var node = this._nodeForId(nodeId);\n        if (!node)\n            return false;\n        properties = eval(\"(\" + properties + \")\");\n        var result = {};\n        for (var i = 0; i < properties.length; ++i)\n            result[properties[i]] = node[properties[i]];\n        return result;\n    },\n\n    getNodePrototypes: function(nodeId)\n    {\n        this.releaseWrapperObjectGroup(\"prototypes\");\n        var node = this._nodeForId(nodeId);\n        if (!node)\n            return false;\n\n        var result = [];\n        var prototype = node;\n\n//        if (window.navigator.userAgent.indexOf(\"MSIE\") != -1 )\n//        {\n//            result.push(this._wrapObject(prototype, \"prototypes\"));\n//            return result;\n//        }\n\n        do {\n            result.push(this._wrapObject(prototype, \"prototypes\"));\n            prototype = Object.getPrototypeOf(prototype);\n        } while (prototype)\n        return result;\n    },\n\n    pushNodeToFrontend: function(objectId)\n    {\n        var parsedObjectId = this._parseObjectId(objectId);\n        var object = this._objectForId(parsedObjectId);\n        if (!object || this._type(object) !== \"node\")\n            return false;\n        return InjectedScriptHost.pushNodePathToFrontend(object, false, false);\n    },\n\n    evaluateOnSelf: function(funcBody, args)\n    {\n        var func = eval(\"(\" + funcBody + \")\");\n        return func.apply(this, eval(\"(\" + args + \")\") || []);\n    },\n\n    _isDefined: function(object)\n    {\n        return object || this._isHTMLAllCollection(object);\n    },\n\n    _isHTMLAllCollection: function(object)\n    {\n        // document.all is reported as undefined, but we still want to process it.\n        return (typeof object === \"undefined\") && inspectedWindow.HTMLAllCollection && object instanceof inspectedWindow.HTMLAllCollection;\n    },\n\n    _type: function(obj)\n    {\n        if (obj === null)\n            return \"null\";\n\n        var type = typeof obj;\n        if (type !== \"object\" && type !== \"function\") {\n            // FIXME(33716): typeof document.all is always 'undefined'.\n            if (this._isHTMLAllCollection(obj))\n                return \"array\";\n            return type;\n        }\n\n        // If owning frame has navigated to somewhere else window properties will be undefined.\n        // In this case just return result of the typeof.\n        if (!inspectedWindow.document)\n            return type;\n\n        if (obj instanceof inspectedWindow.Node) {\n\n            try {\n                return (obj.nodeType === undefined ? type : \"node\");\n            } catch (ex) {} // for IE there could be 'Invalid calling object' exception\n\n            return obj.toString();\n        }\n\n        if (obj instanceof inspectedWindow.String)\n            return \"string\";\n        if (obj instanceof inspectedWindow.Array)\n            return \"array\";\n        if (obj instanceof inspectedWindow.Boolean)\n            return \"boolean\";\n        if (obj instanceof inspectedWindow.Number)\n            return \"number\";\n        if (obj instanceof inspectedWindow.Date)\n            return \"date\";\n        if (obj instanceof inspectedWindow.RegExp)\n            return \"regexp\";\n        // FireBug's array detection.\n        if (isFinite(obj.length) && typeof obj.splice === \"function\")\n            return \"array\";\n        if (isFinite(obj.length) && typeof obj.callee === \"function\") // arguments.\n            return \"array\";\n        if (obj instanceof inspectedWindow.NodeList)\n            return \"array\";\n        if (obj instanceof inspectedWindow.HTMLCollection)\n            return \"array\";\n        if (obj instanceof inspectedWindow.Error)\n            return \"error\";\n        return type;\n    },\n\n    _describe: function(obj, abbreviated)\n    {\n        var type = this._type(obj);\n\n        switch (type) {\n        case \"object\":\n        case \"node\":\n            var result = InjectedScriptHost.internalConstructorName(obj);\n            if (result === \"Object\") {\n                // In Chromium DOM wrapper prototypes will have Object as their constructor name,\n                // get the real DOM wrapper name from the constructor property.\n                var constructorName = obj.constructor && obj.constructor.name;\n                if (constructorName)\n                    return constructorName;\n            }\n            return result;\n        case \"array\":\n            var className = InjectedScriptHost.internalConstructorName(obj);\n            if (typeof obj.length === \"number\")\n                className += \"[\" + obj.length + \"]\";\n            return className;\n        case \"string\":\n            if (!abbreviated)\n                return obj;\n            if (obj.length > 100)\n                return \"\\\"\" + obj.substring(0, 100) + \"\\u2026\\\"\";\n            return \"\\\"\" + obj + \"\\\"\";\n        case \"function\":\n            var objectText = this._toString(obj);\n            if (abbreviated)\n                objectText = /.*/.exec(objectText)[0].replace(/ +$/g, \"\");\n            return objectText;\n        default:\n            return this._toString(obj);\n        }\n    },\n\n    _toString: function(obj)\n    {\n        // We don't use String(obj) because inspectedWindow.String is undefined if owning frame navigated to another page.\n        return \"\" + obj;\n    }\n}\n\nvar injectedScript = new InjectedScript();\n\nInjectedScript.RemoteObject = function(objectId, type, description, hasChildren)\n{\n    this.objectId = objectId;\n    this.type = type;\n    this.description = description;\n    this.hasChildren = hasChildren;\n}\n\nInjectedScript.RemoteObject.fromException = function(e)\n{\n    return new InjectedScript.RemoteObject(null, \"error\", e.toString());\n}\n\nInjectedScript.RemoteObject.fromObject = function(object, objectId, abbreviate)\n{\n    var type = injectedScript._type(object);\n    var rawType = typeof object;\n    var hasChildren = (rawType === \"object\" && object !== null && (Object.getOwnPropertyNames(object).length || !!Object.getPrototypeOf(object))) || rawType === \"function\";\n    var description = \"\";\n    try {\n        var description = injectedScript._describe(object, abbreviate);\n        return new InjectedScript.RemoteObject(objectId, type, description, hasChildren);\n    } catch (e) {\n        return InjectedScript.RemoteObject.fromException(e);\n    }\n}\n\nInjectedScript.CallFrameProxy = function(ordinal, callFrame)\n{\n    this.id = { ordinal: ordinal, injectedScriptId: injectedScriptId };\n    this.type = callFrame.type;\n    this.functionName = (this.type === \"function\" ? callFrame.functionName : \"\");\n    this.sourceID = callFrame.sourceID;\n    this.line = callFrame.line;\n    this.column = callFrame.column;\n    this.scopeChain = this._wrapScopeChain(callFrame);\n}\n\nInjectedScript.CallFrameProxy.prototype = {\n    _wrapScopeChain: function(callFrame)\n    {\n        var GLOBAL_SCOPE = 0;\n        var LOCAL_SCOPE = 1;\n        var WITH_SCOPE = 2;\n        var CLOSURE_SCOPE = 3;\n        var CATCH_SCOPE = 4;\n    \n        var scopeChain = callFrame.scopeChain;\n        var scopeChainProxy = [];\n        var foundLocalScope = false;\n        for (var i = 0; i < scopeChain.length; i++) {\n            var scopeType = callFrame.scopeType(i);\n            var scopeObject = scopeChain[i];\n            var scopeObjectProxy = injectedScript._wrapObject(scopeObject, \"backtrace\", true);\n\n            switch(scopeType) {\n                case LOCAL_SCOPE: {\n                    foundLocalScope = true;\n                    scopeObjectProxy.isLocal = true;\n                    scopeObjectProxy.thisObject = injectedScript._wrapObject(callFrame.thisObject, \"backtrace\", true);\n                    break;\n                }\n                case CLOSURE_SCOPE: {\n                    scopeObjectProxy.isClosure = true;\n                    break;\n                }\n                case WITH_SCOPE:\n                case CATCH_SCOPE: {\n                    if (foundLocalScope && scopeObject instanceof inspectedWindow.Element)\n                        scopeObjectProxy.isElement = true;\n                    else if (foundLocalScope && scopeObject instanceof inspectedWindow.Document)\n                        scopeObjectProxy.isDocument = true;\n                    else\n                        scopeObjectProxy.isWithBlock = true;\n                    break;\n                }\n            }\n            scopeChainProxy.push(scopeObjectProxy);\n        }\n        return scopeChainProxy;\n    }\n}\n\nfunction CommandLineAPI(commandLineAPIImpl, callFrame)\n{\n    function inScopeVariables(member)\n    {\n        if (!callFrame)\n            return false;\n\n        var scopeChain = callFrame.scopeChain;\n        for (var i = 0; i < scopeChain.length; ++i) {\n            if (member in scopeChain[i])\n                return true;\n        }\n        return false;\n    }\n\n    for (var i = 0; i < CommandLineAPI.members_.length; ++i) {\n        var member = CommandLineAPI.members_[i];\n        if (member in inspectedWindow || inScopeVariables(member))\n            continue;\n\n        this[member] = bind(commandLineAPIImpl, commandLineAPIImpl[member]);\n    }\n\n    for (var i = 0; i < 5; ++i) {\n        var member = \"$\" + i;\n        if (member in inspectedWindow || inScopeVariables(member))\n            continue;\n\n        // fix for non-webkit browsers\n        //this.__defineGetter__(\"$\" + i, bind(commandLineAPIImpl, commandLineAPIImpl._inspectedNode, i));\n        Object.defineProperty(this, \"$\" + i, {\n            get: bind(commandLineAPIImpl, commandLineAPIImpl._inspectedNode, i)\n        });\n    }\n}\n\nCommandLineAPI.members_ = [\n    \"$\", \"$$\", \"$x\", \"dir\", \"dirxml\", \"keys\", \"values\", \"profile\", \"profileEnd\",\n    \"monitorEvents\", \"unmonitorEvents\", \"inspect\", \"copy\", \"clear\"\n];\n\nfunction CommandLineAPIImpl()\n{\n}\n\nCommandLineAPIImpl.prototype = {\n    $: function()\n    {\n        return document.getElementById.apply(document, arguments)\n    },\n\n    $$: function()\n    {\n        return document.querySelectorAll.apply(document, arguments)\n    },\n\n    $x: function(xpath, context)\n    {\n        var nodes = [];\n        try {\n            var doc = (context && context.ownerDocument) || inspectedWindow.document;\n            var results = doc.evaluate(xpath, context || doc, null, XPathResult.ANY_TYPE, null);\n            var node;\n            while (node = results.iterateNext())\n                nodes.push(node);\n        } catch (e) {\n        }\n        return nodes;\n    },\n\n    dir: function()\n    {\n        return console.dir.apply(console, arguments)\n    },\n\n    dirxml: function()\n    {\n        return console.dirxml.apply(console, arguments)\n    },\n\n    keys: function(object)\n    {\n        return Object.keys(object);\n    },\n\n    values: function(object)\n    {\n        var result = [];\n        for (var key in object)\n            result.push(object[key]);\n        return result;\n    },\n\n    profile: function()\n    {\n        return console.profile.apply(console, arguments)\n    },\n\n    profileEnd: function()\n    {\n        return console.profileEnd.apply(console, arguments)\n    },\n\n    monitorEvents: function(object, types)\n    {\n        if (!object || !object.addEventListener || !object.removeEventListener)\n            return;\n        types = this._normalizeEventTypes(types);\n        for (var i = 0; i < types.length; ++i) {\n            object.removeEventListener(types[i], this._logEvent, false);\n            object.addEventListener(types[i], this._logEvent, false);\n        }\n    },\n\n    unmonitorEvents: function(object, types)\n    {\n        if (!object || !object.addEventListener || !object.removeEventListener)\n            return;\n        types = this._normalizeEventTypes(types);\n        for (var i = 0; i < types.length; ++i)\n            object.removeEventListener(types[i], this._logEvent, false);\n    },\n\n    inspect: function(object)\n    {\n        if (arguments.length === 0)\n            return;\n\n        inspectedWindow.console.log(object);\n        if (injectedScript._type(object) === \"node\")\n            InjectedScriptHost.pushNodePathToFrontend(object, false, true);\n        else {\n            switch (injectedScript._describe(object)) {\n                case \"Database\":\n                    InjectedScriptHost.selectDatabase(object);\n                    break;\n                case \"Storage\":\n                    InjectedScriptHost.selectDOMStorage(object);\n                    break;\n            }\n        }\n    },\n\n    copy: function(object)\n    {\n        if (injectedScript._type(object) === \"node\")\n            object = object.outerHTML;\n        InjectedScriptHost.copyText(object);\n    },\n\n    clear: function()\n    {\n        InjectedScriptHost.clearConsoleMessages();\n    },\n\n    _inspectedNode: function(num)\n    {\n        var nodeId = InjectedScriptHost.inspectedNode(num);\n        return injectedScript._nodeForId(nodeId);\n    },\n\n    _normalizeEventTypes: function(types)\n    {\n        if (typeof types === \"undefined\")\n            types = [ \"mouse\", \"key\", \"load\", \"unload\", \"abort\", \"error\", \"select\", \"change\", \"submit\", \"reset\", \"focus\", \"blur\", \"resize\", \"scroll\" ];\n        else if (typeof types === \"string\")\n            types = [ types ];\n\n        var result = [];\n        for (var i = 0; i < types.length; i++) {\n            if (types[i] === \"mouse\")\n                result.splice(0, 0, \"mousedown\", \"mouseup\", \"click\", \"dblclick\", \"mousemove\", \"mouseover\", \"mouseout\");\n            else if (types[i] === \"key\")\n                result.splice(0, 0, \"keydown\", \"keyup\", \"keypress\");\n            else\n                result.push(types[i]);\n        }\n        return result;\n    },\n\n    _logEvent: function(event)\n    {\n        console.log(event.type, event);\n    }\n}\n\ninjectedScript._commandLineAPIImpl = new CommandLineAPIImpl();\nreturn injectedScript;\n})"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/InjectedScriptHostImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/InjectedScriptHostImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar InjectedScriptHostImpl, Weinre;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = InjectedScriptHostImpl = (function() {\n  function InjectedScriptHostImpl() {}\n\n  InjectedScriptHostImpl.prototype.clearConsoleMessages = function(callback) {\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  InjectedScriptHostImpl.prototype.nodeForId = function(nodeId, callback) {\n    return Weinre.nodeStore.getNode(nodeId);\n  };\n\n  InjectedScriptHostImpl.prototype.pushNodePathToFrontend = function(node, withChildren, selectInUI, callback) {\n    var children, nodeId;\n    nodeId = Weinre.nodeStore.getNodeId(node);\n    children = Weinre.nodeStore.serializeNode(node, 1);\n    Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\n    if (callback) {\n      Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n    if (selectInUI) {\n      return Weinre.wi.InspectorNotify.updateFocusedNode(nodeId);\n    }\n  };\n\n  InjectedScriptHostImpl.prototype.inspectedNode = function(num, callback) {\n    var nodeId;\n    nodeId = Weinre.nodeStore.getInspectedNode(num);\n    return nodeId;\n  };\n\n  InjectedScriptHostImpl.prototype.internalConstructorName = function(object) {\n    var ctor, ctorName, match, pattern;\n    ctor = object.constructor;\n    ctorName = ctor.fullClassName || ctor.displayName || ctor.name;\n    if (ctorName && (ctorName !== \"Object\")) {\n      return ctorName;\n    }\n    pattern = /\\[object (.*)\\]/;\n    match = pattern.exec(object.toString());\n    if (match) {\n      return match[1];\n    }\n    return \"Object\";\n  };\n\n  return InjectedScriptHostImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/NetworkRequest.amd.js",
    "content": ";modjewel.define(\"weinre/target/NetworkRequest\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, HookLib, HookSites, IDGenerator, Loader, NetworkRequest, StackTrace, Weinre, getFormData, getHeaders, getRequest, getResponse, getXhrEventHandler, splitContentType, trim;\n\nStackTrace = require('../common/StackTrace');\n\nIDGenerator = require('../common/IDGenerator');\n\nHookLib = require('../common/HookLib');\n\nWeinre = require('../common/Weinre');\n\nEx = require('../common/Ex');\n\nHookSites = require('./HookSites');\n\nLoader = {\n  url: window.location.href,\n  frameId: 0,\n  loaderId: 0\n};\n\nmodule.exports = NetworkRequest = (function() {\n  function NetworkRequest(xhr, id, method, url, stackTrace) {\n    this.xhr = xhr;\n    this.id = id;\n    this.method = method;\n    this.url = url;\n    this.stackTrace = stackTrace;\n  }\n\n  NetworkRequest.prototype.handleSend = function(data) {\n    var redirectResponse, request, time;\n    Weinre.wi.NetworkNotify.identifierForInitialRequest(this.id, this.url, Loader, this.stackTrace);\n    time = Date.now() / 1000.0;\n    request = getRequest(this.url, this.method, this.xhr, data);\n    redirectResponse = {\n      isNull: true\n    };\n    return Weinre.wi.NetworkNotify.willSendRequest(this.id, time, request, redirectResponse);\n  };\n\n  NetworkRequest.prototype.handleHeadersReceived = function() {\n    var response, time;\n    time = Date.now() / 1000.0;\n    response = getResponse(this.xhr);\n    return Weinre.wi.NetworkNotify.didReceiveResponse(this.id, time, \"XHR\", response);\n  };\n\n  NetworkRequest.prototype.handleLoading = function() {};\n\n  NetworkRequest.prototype.handleDone = function() {\n    var description, e, sourceString, status, statusText, success, time;\n    sourceString = \"\";\n    try {\n      sourceString = this.xhr.responseText;\n    } catch (_error) {\n      e = _error;\n    }\n    Weinre.wi.NetworkNotify.setInitialContent(this.id, sourceString, \"XHR\");\n    time = Date.now() / 1000.0;\n    status = this.xhr.status;\n    if (status === 0) {\n      status = 200;\n    }\n    statusText = this.xhr.statusText;\n    success = status >= 200 && status < 300;\n    if (success) {\n      return Weinre.wi.NetworkNotify.didFinishLoading(this.id, time);\n    } else {\n      description = \"\" + status + \" - \" + statusText;\n      return Weinre.wi.NetworkNotify.didFailLoading(this.id, time, description);\n    }\n  };\n\n  NetworkRequest.installNativeHooks = function() {\n    HookSites.XMLHttpRequest_open.addHooks({\n      before: function(receiver, args) {\n        var frame, id, method, rawStackTrace, stackTrace, url, xhr, _i, _len;\n        xhr = receiver;\n        method = args[0];\n        url = args[1];\n        id = IDGenerator.next();\n        rawStackTrace = new StackTrace(args).trace.slice(1);\n        stackTrace = [];\n        for (_i = 0, _len = rawStackTrace.length; _i < _len; _i++) {\n          frame = rawStackTrace[_i];\n          stackTrace.push({\n            functionName: frame\n          });\n        }\n        xhr.__weinreNetworkRequest__ = new NetworkRequest(xhr, id, method, url, stackTrace);\n        return HookLib.ignoreHooks(function() {\n          return xhr.addEventListener(\"readystatechange\", getXhrEventHandler(xhr), false);\n        });\n      }\n    });\n    return HookSites.XMLHttpRequest_send.addHooks({\n      before: function(receiver, args) {\n        var data, nr, xhr;\n        xhr = receiver;\n        data = args[0];\n        nr = xhr.__weinreNetworkRequest__;\n        if (!nr) {\n          return;\n        }\n        return nr.handleSend(data);\n      }\n    });\n  };\n\n  return NetworkRequest;\n\n})();\n\ngetRequest = function(url, method, xhr, data) {\n  return {\n    url: url,\n    httpMethod: method,\n    httpHeaderFields: {},\n    requestFormData: getFormData(url, data)\n  };\n};\n\ngetResponse = function(xhr) {\n  var contentLength, contentType, encoding, headers, result, _ref;\n  contentType = xhr.getResponseHeader(\"Content-Type\");\n  contentType || (contentType = 'application/octet-stream');\n  _ref = splitContentType(contentType), contentType = _ref[0], encoding = _ref[1];\n  headers = getHeaders(xhr);\n  result = {\n    mimeType: contentType,\n    textEncodingName: encoding,\n    httpStatusCode: xhr.status,\n    httpStatusText: xhr.statusText,\n    httpHeaderFields: headers,\n    connectionReused: false,\n    connectionID: 0,\n    wasCached: false\n  };\n  contentLength = xhr.getResponseHeader(\"Content-Length\");\n  contentLength = parseInt(contentLength);\n  if (!isNaN(contentLength)) {\n    result.expectedContentLength = contentLength;\n  }\n  return result;\n};\n\ngetHeaders = function(xhr) {\n  var key, line, lines, result, string, val, _i, _len, _ref;\n  string = xhr.getAllResponseHeaders();\n  lines = string.split('\\r\\n');\n  result = {};\n  for (_i = 0, _len = lines.length; _i < _len; _i++) {\n    line = lines[_i];\n    line = trim(line);\n    if (line === \"\") {\n      break;\n    }\n    _ref = line.split(':', 2), key = _ref[0], val = _ref[1];\n    result[trim(key)] = trim(val);\n  }\n  return result;\n};\n\ntrim = function(string) {\n  return string.replace(/^\\s+|\\s+$/g, '');\n};\n\ngetFormData = function(url, data) {\n  var match, pattern;\n  if (data) {\n    return data;\n  }\n  pattern = /.*?\\?(.*?)(#.*)?$/;\n  match = url.match(pattern);\n  if (match) {\n    return match[1];\n  }\n  return \"\";\n};\n\nsplitContentType = function(contentType) {\n  var match, pattern;\n  pattern = /\\s*(.*?)\\s*(;\\s*(.*))?\\s*$/;\n  match = contentType.match(pattern);\n  if (!match) {\n    return [contentType, \"\"];\n  }\n  return [match[1], match[3]];\n};\n\ngetXhrEventHandler = function(xhr) {\n  return function() {\n    var e, nr;\n    nr = xhr.__weinreNetworkRequest__;\n    if (!nr) {\n      return;\n    }\n    try {\n      switch (xhr.readyState) {\n        case 2:\n          return nr.handleHeadersReceived();\n        case 3:\n          return nr.handleLoading();\n        case 4:\n          return nr.handleDone();\n      }\n    } catch (_error) {\n      e = _error;\n    }\n  };\n};\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/NodeStore.amd.js",
    "content": ";modjewel.define(\"weinre/target/NodeStore\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Debug, IDGenerator, NodeStore, Weinre, handleDOMAttrModified, handleDOMCharacterDataModified, handleDOMNodeInserted, handleDOMNodeRemoved, handleDOMSubtreeModified;\n\nWeinre = require('../common/Weinre');\n\nIDGenerator = require('../common/IDGenerator');\n\nDebug = require('../common/Debug');\n\nmodule.exports = NodeStore = (function() {\n  function NodeStore() {\n    this._nodeMap = {};\n    this._childrenSent = {};\n    this._inspectedNodes = [];\n    document.addEventListener(\"DOMSubtreeModified\", handleDOMSubtreeModified, false);\n    document.addEventListener(\"DOMNodeInserted\", handleDOMNodeInserted, false);\n    document.addEventListener(\"DOMNodeRemoved\", handleDOMNodeRemoved, false);\n    document.addEventListener(\"DOMAttrModified\", handleDOMAttrModified, false);\n    document.addEventListener(\"DOMCharacterDataModified\", handleDOMCharacterDataModified, false);\n  }\n\n  NodeStore.prototype.addInspectedNode = function(nodeId) {\n    this._inspectedNodes.unshift(nodeId);\n    if (this._inspectedNodes.length > 5) {\n      return this._inspectedNodes = this._inspectedNodes.slice(0, 5);\n    }\n  };\n\n  NodeStore.prototype.getInspectedNode = function(index) {\n    return this._inspectedNodes[index];\n  };\n\n  NodeStore.prototype.getNode = function(nodeId) {\n    return this._nodeMap[nodeId];\n  };\n\n  NodeStore.prototype.checkNodeId = function(node) {\n    return IDGenerator.checkId(node);\n  };\n\n  NodeStore.prototype.getNodeId = function(node) {\n    var id;\n    id = this.checkNodeId(node);\n    if (id) {\n      return id;\n    }\n    return IDGenerator.getId(node, this._nodeMap);\n  };\n\n  NodeStore.prototype.getNodeData = function(nodeId, depth) {\n    return this.serializeNode(this.getNode(nodeId), depth);\n  };\n\n  NodeStore.prototype.getPreviousSiblingId = function(node) {\n    var id, sib;\n    while (true) {\n      sib = node.previousSibling;\n      if (!sib) {\n        return 0;\n      }\n      id = this.checkNodeId(sib);\n      if (id) {\n        return id;\n      }\n      node = sib;\n    }\n  };\n\n  NodeStore.prototype.nextNodeId = function() {\n    return \"\" + IDGenerator.next();\n  };\n\n  NodeStore.prototype.serializeNode = function(node, depth) {\n    var children, i, id, localName, nodeData, nodeName, nodeValue;\n    nodeName = \"\";\n    nodeValue = null;\n    localName = null;\n    id = this.getNodeId(node);\n    switch (node.nodeType) {\n      case Node.TEXT_NODE:\n      case Node.COMMENT_NODE:\n      case Node.CDATA_SECTION_NODE:\n        nodeValue = node.nodeValue;\n        break;\n      case Node.ATTRIBUTE_NODE:\n        localName = node.localName;\n        break;\n      case Node.DOCUMENT_FRAGMENT_NODE:\n        break;\n      default:\n        nodeName = node.nodeName;\n        localName = node.localName;\n    }\n    nodeData = {\n      id: id,\n      nodeType: node.nodeType,\n      nodeName: nodeName,\n      localName: localName,\n      nodeValue: nodeValue\n    };\n    if (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n      nodeData.childNodeCount = this.childNodeCount(node);\n      children = this.serializeNodeChildren(node, depth);\n      if (children.length) {\n        nodeData.children = children;\n      }\n      if (node.nodeType === Node.ELEMENT_NODE) {\n        nodeData.attributes = [];\n        i = 0;\n        while (i < node.attributes.length) {\n          nodeData.attributes.push(node.attributes[i].nodeName);\n          nodeData.attributes.push(node.attributes[i].nodeValue);\n          i++;\n        }\n      } else {\n        if (node.nodeType === Node.DOCUMENT_NODE) {\n          nodeData.documentURL = window.location.href;\n        }\n      }\n    } else if (node.nodeType === Node.DOCUMENT_TYPE_NODE) {\n      nodeData.publicId = node.publicId;\n      nodeData.systemId = node.systemId;\n      nodeData.internalSubset = node.internalSubset;\n    } else if (node.nodeType === Node.ATTRIBUTE_NODE) {\n      nodeData.name = node.nodeName;\n      nodeData.value = node.nodeValue;\n    }\n    return nodeData;\n  };\n\n  NodeStore.prototype.serializeNodeChildren = function(node, depth) {\n    var childIds, childNode, i, result;\n    result = [];\n    childIds = this.childNodeIds(node);\n    if (depth === 0) {\n      if (childIds.length === 1) {\n        childNode = this.getNode(childIds[0]);\n        if (childNode.nodeType === Node.TEXT_NODE) {\n          result.push(this.serializeNode(childNode));\n        }\n      }\n      return result;\n    }\n    depth--;\n    i = 0;\n    while (i < childIds.length) {\n      result.push(this.serializeNode(this.getNode(childIds[i]), depth));\n      i++;\n    }\n    return result;\n  };\n\n  NodeStore.prototype.childNodeCount = function(node) {\n    return this.childNodeIds(node).length;\n  };\n\n  NodeStore.prototype.childNodeIds = function(node) {\n    var childNode, i, ids, _i, _len, _ref;\n    ids = [];\n    i = 0;\n    _ref = node.childNodes;\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      childNode = _ref[_i];\n      if (this.isToBeSkipped(childNode)) {\n        continue;\n      }\n      ids.push(this.getNodeId(childNode));\n    }\n    return ids;\n  };\n\n  NodeStore.prototype.isToBeSkipped = function(node) {\n    if (!node) {\n      return true;\n    }\n    if (node.__weinreHighlighter) {\n      return true;\n    }\n    if (node.nodeType !== Node.TEXT_NODE) {\n      return false;\n    }\n    return !!node.nodeValue.match(/^\\s*$/);\n  };\n\n  return NodeStore;\n\n})();\n\nhandleDOMSubtreeModified = function(event) {\n  if (!event.attrChange) {\n    return;\n  }\n  return NodeStore.handleDOMAttrModified(event);\n};\n\nhandleDOMNodeInserted = function(event) {\n  var child, parentId, previous, targetId;\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\n  parentId = Weinre.nodeStore.checkNodeId(event.relatedNode);\n  if (!parentId) {\n    return;\n  }\n  child = Weinre.nodeStore.serializeNode(event.target, 0);\n  previous = Weinre.nodeStore.getPreviousSiblingId(event.target);\n  return Weinre.wi.DOMNotify.childNodeInserted(parentId, previous, child);\n};\n\nhandleDOMNodeRemoved = function(event) {\n  var childCount, parentId, targetId;\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\n  parentId = Weinre.nodeStore.checkNodeId(event.relatedNode);\n  if (!parentId) {\n    return;\n  }\n  if (targetId) {\n    if (parentId) {\n      return Weinre.wi.DOMNotify.childNodeRemoved(parentId, targetId);\n    }\n  } else {\n    childCount = Weinre.nodeStore.childNodeCount(event.relatedNode);\n    return Weinre.wi.DOMNotify.childNodeCountUpdated(parentId, childCount);\n  }\n};\n\nhandleDOMAttrModified = function(event) {\n  var attrs, i, targetId;\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\n  if (!targetId) {\n    return;\n  }\n  attrs = [];\n  i = 0;\n  while (i < event.target.attributes.length) {\n    attrs.push(event.target.attributes[i].name);\n    attrs.push(event.target.attributes[i].value);\n    i++;\n  }\n  return Weinre.wi.DOMNotify.attributesUpdated(targetId, attrs);\n};\n\nhandleDOMCharacterDataModified = function(event) {\n  var targetId;\n  targetId = Weinre.nodeStore.checkNodeId(event.target);\n  if (!targetId) {\n    return;\n  }\n  return Weinre.wi.DOMNotify.characterDataModified(targetId, event.newValue);\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/SqlStepper.amd.js",
    "content": ";modjewel.define(\"weinre/target/SqlStepper\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, SqlStepper, executeSql, ourErrorCallback, runStep;\n\nBinding = require('../common/Binding');\n\nmodule.exports = SqlStepper = (function() {\n  function SqlStepper(steps) {\n    var context;\n    if (!(this instanceof SqlStepper)) {\n      return new SqlStepper(steps);\n    }\n    this.__context = {};\n    context = this.__context;\n    context.steps = steps;\n  }\n\n  SqlStepper.prototype.run = function(db, errorCallback) {\n    var context;\n    context = this.__context;\n    if (context.hasBeenRun) {\n      throw new Ex(arguments, \"stepper has already been run\");\n    }\n    context.hasBeenRun = true;\n    context.db = db;\n    context.errorCallback = errorCallback;\n    context.nextStep = 0;\n    context.ourErrorCallback = new Binding(this, ourErrorCallback);\n    context.runStep = new Binding(this, runStep);\n    this.executeSql = new Binding(this, executeSql);\n    return db.transaction(context.runStep);\n  };\n\n  SqlStepper.example = function(db, id) {\n    var errorCb, step1, step2, stepper;\n    step1 = function() {\n      return this.executeSql(\"SELECT name FROM sqlite_master WHERE type='table'\");\n    };\n    step2 = function(resultSet) {\n      var i, name, result, rows;\n      rows = resultSet.rows;\n      result = [];\n      i = 0;\n      while (i < rows.length) {\n        name = rows.item(i).name;\n        if (name === \"__WebKitDatabaseInfoTable__\") {\n          i++;\n          continue;\n        }\n        result.push(name);\n        i++;\n      }\n      return console.log((\"[\" + this.id + \"] table names: \") + result.join(\", \"));\n    };\n    errorCb = function(sqlError) {\n      return console.log((\"[\" + this.id + \"] sql error:\" + sqlError.code + \": \") + sqlError.message);\n    };\n    stepper = new SqlStepper([step1, step2]);\n    stepper.id = id;\n    return stepper.run(db, errorCb);\n  };\n\n  return SqlStepper;\n\n})();\n\nexecuteSql = function(statement, data) {\n  var context;\n  context = this.__context;\n  return context.tx.executeSql(statement, data, context.runStep, context.ourErrorCallback);\n};\n\nourErrorCallback = function(tx, sqlError) {\n  var context;\n  context = this.__context;\n  return context.errorCallback.call(this, sqlError);\n};\n\nrunStep = function(tx, resultSet) {\n  var context, step;\n  context = this.__context;\n  if (context.nextStep >= context.steps.length) {\n    return;\n  }\n  context.tx = tx;\n  context.currentStep = context.nextStep;\n  context.nextStep++;\n  step = context.steps[context.currentStep];\n  return step.call(this, resultSet);\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/Target.amd.js",
    "content": ";modjewel.define(\"weinre/target/Target\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Binding, CSSStore, Callback, CheckForProblems, ElementHighlighter, Ex, HookLib, InjectedScriptHostImpl, MessageDispatcher, NetworkRequest, NodeStore, Target, Weinre, WeinreExtraClientCommandsImpl, WeinreTargetEventsImpl, WiCSSImpl, WiConsoleImpl, WiDOMImpl, WiDOMStorageImpl, WiDatabaseImpl, WiInspectorImpl, WiRuntimeImpl, currentTime;\n\nrequire('./BrowserHacks');\n\nEx = require('../common/Ex');\n\nBinding = require('../common/Binding');\n\nCallback = require('../common/Callback');\n\nMessageDispatcher = require('../common/MessageDispatcher');\n\nWeinre = require('../common/Weinre');\n\nHookLib = require('../common/HookLib');\n\nCheckForProblems = require('./CheckForProblems');\n\nNodeStore = require('./NodeStore');\n\nCSSStore = require('./CSSStore');\n\nElementHighlighter = require('./ElementHighlighter');\n\nInjectedScriptHostImpl = require('./InjectedScriptHostImpl');\n\nNetworkRequest = require('./NetworkRequest');\n\nWeinreTargetEventsImpl = require('./WeinreTargetEventsImpl');\n\nWeinreExtraClientCommandsImpl = require('./WeinreExtraClientCommandsImpl');\n\nWiConsoleImpl = require('./WiConsoleImpl');\n\nWiCSSImpl = require('./WiCSSImpl');\n\nWiDatabaseImpl = require('./WiDatabaseImpl');\n\nWiDOMImpl = require('./WiDOMImpl');\n\nWiDOMStorageImpl = require('./WiDOMStorageImpl');\n\nWiInspectorImpl = require('./WiInspectorImpl');\n\nWiRuntimeImpl = require('./WiRuntimeImpl');\n\nmodule.exports = Target = (function() {\n  function Target() {}\n\n  Target.main = function() {\n    CheckForProblems.check();\n    Weinre.target = new Target();\n    return Weinre.target.initialize();\n  };\n\n  Target.prototype.setWeinreServerURLFromScriptSrc = function(element) {\n    var match, message, pattern;\n    if (window.WeinreServerURL) {\n      return;\n    }\n    if (element) {\n      pattern = /((https?:)?\\/\\/(.*?)\\/)/;\n      match = pattern.exec(element.src);\n      if (match) {\n        window.WeinreServerURL = match[1];\n        return;\n      }\n    }\n    message = \"unable to calculate the weinre server url; explicity set the variable window.WeinreServerURL instead\";\n    alert(message);\n    throw new Ex(arguments, message);\n  };\n\n  Target.prototype.setWeinreServerIdFromScriptSrc = function(element) {\n    var attempt, hash;\n    if (window.WeinreServerId) {\n      return;\n    }\n    element = this.getTargetScriptElement();\n    hash = \"anonymous\";\n    if (element) {\n      attempt = element.src.split(\"#\")[1];\n      if (attempt) {\n        hash = attempt;\n      } else {\n        attempt = location.hash.split(\"#\")[1];\n        if (attempt) {\n          hash = attempt;\n        }\n      }\n    }\n    return window.WeinreServerId = hash;\n  };\n\n  Target.prototype.getTargetScriptElement = function() {\n    var element, elements, i, j, scripts;\n    elements = document.getElementsByTagName(\"script\");\n    scripts = [\"target-script.js\", \"target-script-min.js\"];\n    i = 0;\n    while (i < elements.length) {\n      element = elements[i];\n      j = 0;\n      while (j < scripts.length) {\n        if (-1 !== element.src.indexOf(\"/\" + scripts[j])) {\n          return element;\n        }\n        j++;\n      }\n      i++;\n    }\n  };\n\n  Target.prototype.initialize = function() {\n    var element, injectedScriptHost, messageDispatcher;\n    element = this.getTargetScriptElement();\n    this.setWeinreServerURLFromScriptSrc(element);\n    this.setWeinreServerIdFromScriptSrc(element);\n    if (window.WeinreServerURL[window.WeinreServerURL.length - 1] !== \"/\") {\n      window.WeinreServerURL += \"/\";\n    }\n    injectedScriptHost = new InjectedScriptHostImpl();\n    Weinre.injectedScript = injectedScriptConstructor(injectedScriptHost, window, 0, \"?\");\n    window.addEventListener(\"load\", Binding(this, \"onLoaded\"), false);\n    document.addEventListener(\"DOMContentLoaded\", Binding(this, \"onDOMContent\"), false);\n    this._startTime = currentTime();\n    if (document.readyState === \"loaded\") {\n      HookLib.ignoreHooks((function(_this) {\n        return function() {\n          return setTimeout((function() {\n            return _this.onDOMContent();\n          }), 10);\n        };\n      })(this));\n    }\n    if (document.readyState === \"complete\") {\n      HookLib.ignoreHooks((function(_this) {\n        return function() {\n          setTimeout((function() {\n            return _this.onDOMContent();\n          }), 10);\n          return setTimeout((function() {\n            return _this.onLoaded();\n          }), 20);\n        };\n      })(this));\n    }\n    messageDispatcher = new MessageDispatcher(window.WeinreServerURL + \"ws/target\", window.WeinreServerId);\n    Weinre.messageDispatcher = messageDispatcher;\n    Weinre.wi = {};\n    Weinre.wi.Console = new WiConsoleImpl();\n    Weinre.wi.CSS = new WiCSSImpl();\n    Weinre.wi.Database = new WiDatabaseImpl();\n    Weinre.wi.DOM = new WiDOMImpl();\n    Weinre.wi.DOMStorage = new WiDOMStorageImpl();\n    Weinre.wi.Inspector = new WiInspectorImpl();\n    Weinre.wi.Runtime = new WiRuntimeImpl();\n    messageDispatcher.registerInterface(\"Console\", Weinre.wi.Console, false);\n    messageDispatcher.registerInterface(\"CSS\", Weinre.wi.CSS, false);\n    messageDispatcher.registerInterface(\"Database\", Weinre.wi.Database, false);\n    messageDispatcher.registerInterface(\"DOM\", Weinre.wi.DOM, false);\n    messageDispatcher.registerInterface(\"DOMStorage\", Weinre.wi.DOMStorage, false);\n    messageDispatcher.registerInterface(\"Inspector\", Weinre.wi.Inspector, false);\n    messageDispatcher.registerInterface(\"Runtime\", Weinre.wi.Runtime, false);\n    messageDispatcher.registerInterface(\"WeinreExtraClientCommands\", new WeinreExtraClientCommandsImpl(), true);\n    messageDispatcher.registerInterface(\"WeinreTargetEvents\", new WeinreTargetEventsImpl(), true);\n    Weinre.wi.ApplicationCacheNotify = messageDispatcher.createProxy(\"ApplicationCacheNotify\");\n    Weinre.wi.ConsoleNotify = messageDispatcher.createProxy(\"ConsoleNotify\");\n    Weinre.wi.DOMNotify = messageDispatcher.createProxy(\"DOMNotify\");\n    Weinre.wi.DOMStorageNotify = messageDispatcher.createProxy(\"DOMStorageNotify\");\n    Weinre.wi.DatabaseNotify = messageDispatcher.createProxy(\"DatabaseNotify\");\n    Weinre.wi.InspectorNotify = messageDispatcher.createProxy(\"InspectorNotify\");\n    Weinre.wi.TimelineNotify = messageDispatcher.createProxy(\"TimelineNotify\");\n    Weinre.wi.NetworkNotify = messageDispatcher.createProxy(\"NetworkNotify\");\n    Weinre.WeinreTargetCommands = messageDispatcher.createProxy(\"WeinreTargetCommands\");\n    Weinre.WeinreExtraTargetEvents = messageDispatcher.createProxy(\"WeinreExtraTargetEvents\");\n    messageDispatcher.getWebSocket().addEventListener(\"open\", Binding(this, this.cb_webSocketOpened));\n    Weinre.nodeStore = new NodeStore();\n    Weinre.cssStore = new CSSStore();\n    return NetworkRequest.installNativeHooks();\n  };\n\n  Target.prototype.cb_webSocketOpened = function() {\n    return Weinre.WeinreTargetCommands.registerTarget(window.location.href, Binding(this, this.cb_registerTarget));\n  };\n\n  Target.prototype.cb_registerTarget = function(targetDescription) {\n    return Weinre.targetDescription = targetDescription;\n  };\n\n  Target.prototype.onLoaded = function() {\n    if (!Weinre.wi.InspectorNotify) {\n      HookLib.ignoreHooks((function(_this) {\n        return function() {\n          return setTimeout((function() {\n            return _this.onLoaded();\n          }), 10);\n        };\n      })(this));\n      return;\n    }\n    return Weinre.wi.InspectorNotify.loadEventFired(currentTime() - this._startTime);\n  };\n\n  Target.prototype.onDOMContent = function() {\n    if (!Weinre.wi.InspectorNotify) {\n      HookLib.ignoreHooks((function(_this) {\n        return function() {\n          return setTimeout((function() {\n            return _this.onDOMContent();\n          }), 10);\n        };\n      })(this));\n      return;\n    }\n    return Weinre.wi.InspectorNotify.domContentEventFired(currentTime() - this._startTime);\n  };\n\n  Target.prototype.setDocument = function() {\n    var nodeData, nodeId;\n    if (!Weinre.elementHighlighter) {\n      Weinre.elementHighlighter = ElementHighlighter.create();\n    }\n    nodeId = Weinre.nodeStore.getNodeId(document);\n    nodeData = Weinre.nodeStore.getNodeData(nodeId, 2);\n    return Weinre.wi.DOMNotify.setDocument(nodeData);\n  };\n\n  Target.prototype.whenBodyReady = function(receiver, args, func) {\n    if (document.body) {\n      func.apply(receiver, args);\n      return;\n    }\n    return document.addEventListener(\"DOMContentLoaded\", function() {\n      return func.apply(receiver, args);\n    }, false);\n  };\n\n  return Target;\n\n})();\n\ncurrentTime = function() {\n  return (new Date().getMilliseconds()) / 1000.0;\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/Timeline.amd.js",
    "content": ";modjewel.define(\"weinre/target/Timeline\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Ex, HookLib, HookSites, IDGenerator, Running, StackTrace, Timeline, TimelineRecordType, TimerIntervals, TimerTimeouts, Weinre, addStackTrace, addTimer, getXhrEventHandler, instrumentedTimerCode, removeTimer;\n\nEx = require('../common/Ex');\n\nWeinre = require('../common/Weinre');\n\nIDGenerator = require('../common/IDGenerator');\n\nStackTrace = require('../common/StackTrace');\n\nHookLib = require('../common/HookLib');\n\nHookSites = require('./HookSites');\n\nRunning = false;\n\nTimerTimeouts = {};\n\nTimerIntervals = {};\n\nTimelineRecordType = {\n  EventDispatch: 0,\n  Layout: 1,\n  RecalculateStyles: 2,\n  Paint: 3,\n  ParseHTML: 4,\n  TimerInstall: 5,\n  TimerRemove: 6,\n  TimerFire: 7,\n  XHRReadyStateChange: 8,\n  XHRLoad: 9,\n  EvaluateScript: 10,\n  Mark: 11,\n  ResourceSendRequest: 12,\n  ResourceReceiveResponse: 13,\n  ResourceFinish: 14,\n  FunctionCall: 15,\n  ReceiveResourceData: 16,\n  GCEvent: 17,\n  MarkDOMContent: 18,\n  MarkLoad: 19,\n  ScheduleResourceRequest: 20\n};\n\nmodule.exports = Timeline = (function() {\n  function Timeline() {}\n\n  Timeline.start = function() {\n    return Running = true;\n  };\n\n  Timeline.stop = function() {\n    return Running = false;\n  };\n\n  Timeline.isRunning = function() {\n    return Running;\n  };\n\n  Timeline.addRecord_Mark = function(message) {\n    var record;\n    if (!Timeline.isRunning()) {\n      return;\n    }\n    record = {};\n    record.type = TimelineRecordType.Mark;\n    record.category = {\n      name: \"scripting\"\n    };\n    record.startTime = Date.now();\n    record.data = {\n      message: message\n    };\n    addStackTrace(record, 3);\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n  };\n\n  Timeline.addRecord_EventDispatch = function(event, name, category) {\n    var record;\n    if (!Timeline.isRunning()) {\n      return;\n    }\n    if (!category) {\n      category = \"scripting\";\n    }\n    record = {};\n    record.type = TimelineRecordType.EventDispatch;\n    record.category = {\n      name: category\n    };\n    record.startTime = Date.now();\n    record.data = {\n      type: event.type\n    };\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n  };\n\n  Timeline.addRecord_TimerInstall = function(id, timeout, singleShot) {\n    var record;\n    if (!Timeline.isRunning()) {\n      return;\n    }\n    record = {};\n    record.type = TimelineRecordType.TimerInstall;\n    record.category = {\n      name: \"scripting\"\n    };\n    record.startTime = Date.now();\n    record.data = {\n      timerId: id,\n      timeout: timeout,\n      singleShot: singleShot\n    };\n    addStackTrace(record, 4);\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n  };\n\n  Timeline.addRecord_TimerRemove = function(id, timeout, singleShot) {\n    var record;\n    if (!Timeline.isRunning()) {\n      return;\n    }\n    record = {};\n    record.type = TimelineRecordType.TimerRemove;\n    record.category = {\n      name: \"scripting\"\n    };\n    record.startTime = Date.now();\n    record.data = {\n      timerId: id,\n      timeout: timeout,\n      singleShot: singleShot\n    };\n    addStackTrace(record, 4);\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n  };\n\n  Timeline.addRecord_TimerFire = function(id, timeout, singleShot) {\n    var record;\n    if (!Timeline.isRunning()) {\n      return;\n    }\n    record = {};\n    record.type = TimelineRecordType.TimerFire;\n    record.category = {\n      name: \"scripting\"\n    };\n    record.startTime = Date.now();\n    record.data = {\n      timerId: id,\n      timeout: timeout,\n      singleShot: singleShot\n    };\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n  };\n\n  Timeline.addRecord_XHRReadyStateChange = function(method, url, id, xhr) {\n    var contentLength, contentType, e, record;\n    if (!Timeline.isRunning()) {\n      return;\n    }\n    try {\n      contentLength = xhr.getResponseHeader(\"Content-Length\");\n      contentLength = parseInt(contentLength);\n      contentType = xhr.getResponseHeader(\"Content-Type\");\n    } catch (_error) {\n      e = _error;\n      contentLength = 0;\n      contentType = \"unknown\";\n    }\n    record = {};\n    record.startTime = Date.now();\n    record.category = {\n      name: \"loading\"\n    };\n    if (xhr.readyState === XMLHttpRequest.OPENED) {\n      record.type = TimelineRecordType.ResourceSendRequest;\n      record.data = {\n        identifier: id,\n        url: url,\n        requestMethod: method\n      };\n    } else if (xhr.readyState === XMLHttpRequest.DONE) {\n      record.type = TimelineRecordType.ResourceReceiveResponse;\n      record.data = {\n        identifier: id,\n        statusCode: xhr.status,\n        mimeType: contentType,\n        url: url\n      };\n      if (!isNaN(contentLength)) {\n        record.data.expectedContentLength = contentLength;\n      }\n    } else {\n      return;\n    }\n    return Weinre.wi.TimelineNotify.addRecordToTimeline(record);\n  };\n\n  Timeline.installGlobalListeners = function() {\n    if (window.applicationCache) {\n      applicationCache.addEventListener(\"checking\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.checking\", \"loading\");\n      }), false);\n      applicationCache.addEventListener(\"error\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.error\", \"loading\");\n      }), false);\n      applicationCache.addEventListener(\"noupdate\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.noupdate\", \"loading\");\n      }), false);\n      applicationCache.addEventListener(\"downloading\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.downloading\", \"loading\");\n      }), false);\n      applicationCache.addEventListener(\"progress\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.progress\", \"loading\");\n      }), false);\n      applicationCache.addEventListener(\"updateready\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.updateready\", \"loading\");\n      }), false);\n      applicationCache.addEventListener(\"cached\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.cached\", \"loading\");\n      }), false);\n      applicationCache.addEventListener(\"obsolete\", (function(e) {\n        return Timeline.addRecord_EventDispatch(e, \"applicationCache.obsolete\", \"loading\");\n      }), false);\n    }\n    window.addEventListener(\"error\", (function(e) {\n      return Timeline.addRecord_EventDispatch(e, \"window.error\");\n    }), false);\n    window.addEventListener(\"hashchange\", (function(e) {\n      return Timeline.addRecord_EventDispatch(e, \"window.hashchange\");\n    }), false);\n    window.addEventListener(\"message\", (function(e) {\n      return Timeline.addRecord_EventDispatch(e, \"window.message\");\n    }), false);\n    window.addEventListener(\"offline\", (function(e) {\n      return Timeline.addRecord_EventDispatch(e, \"window.offline\");\n    }), false);\n    window.addEventListener(\"online\", (function(e) {\n      return Timeline.addRecord_EventDispatch(e, \"window.online\");\n    }), false);\n    return window.addEventListener(\"scroll\", (function(e) {\n      return Timeline.addRecord_EventDispatch(e, \"window.scroll\");\n    }), false);\n  };\n\n  Timeline.installNativeHooks = function() {\n    HookSites.window_setInterval.addHooks({\n      before: function(receiver, args) {\n        var code, interval;\n        code = args[0];\n        if (typeof code !== \"function\") {\n          return;\n        }\n        interval = args[1];\n        code = instrumentedTimerCode(code, interval, false);\n        args[0] = code;\n        this.userData = {};\n        this.userData.code = code;\n        return this.userData.interval = interval;\n      },\n      after: function(receiver, args, result) {\n        var code, id;\n        if (!this.userData) {\n          return;\n        }\n        code = this.userData.code;\n        if (typeof code !== \"function\") {\n          return;\n        }\n        id = result;\n        code.__timerId = id;\n        return addTimer(id, this.userData.interval, false);\n      }\n    });\n    HookSites.window_clearInterval.addHooks({\n      before: function(receiver, args) {\n        var id;\n        id = args[0];\n        return removeTimer(id, false);\n      }\n    });\n    HookSites.window_setTimeout.addHooks({\n      before: function(receiver, args) {\n        var code, interval;\n        code = args[0];\n        if (typeof code !== \"function\") {\n          return;\n        }\n        interval = args[1];\n        code = instrumentedTimerCode(code, interval, true);\n        args[0] = code;\n        this.userData = {};\n        this.userData.code = code;\n        return this.userData.interval = interval;\n      },\n      after: function(receiver, args, result) {\n        var code, id;\n        if (!this.userData) {\n          return;\n        }\n        code = this.userData.code;\n        if (typeof code !== \"function\") {\n          return;\n        }\n        id = result;\n        code.__timerId = id;\n        return addTimer(id, this.userData.interval, true);\n      }\n    });\n    HookSites.window_clearTimeout.addHooks({\n      before: function(receiver, args) {\n        var id;\n        id = args[0];\n        return removeTimer(id, true);\n      }\n    });\n    return HookSites.XMLHttpRequest_open.addHooks({\n      before: function(receiver, args) {\n        var xhr;\n        xhr = receiver;\n        IDGenerator.getId(xhr);\n        xhr.__weinre_method = args[0];\n        xhr.__weinre_url = args[1];\n        return xhr.addEventListener(\"readystatechange\", getXhrEventHandler(xhr), false);\n      }\n    });\n  };\n\n  return Timeline;\n\n})();\n\ngetXhrEventHandler = function(xhr) {\n  return function(event) {\n    return Timeline.addRecord_XHRReadyStateChange(xhr.__weinre_method, xhr.__weinre_url, IDGenerator.getId(xhr), xhr);\n  };\n};\n\naddTimer = function(id, timeout, singleShot) {\n  var timerSet;\n  timerSet = (singleShot ? TimerTimeouts : TimerIntervals);\n  timerSet[id] = {\n    id: id,\n    timeout: timeout,\n    singleShot: singleShot\n  };\n  return Timeline.addRecord_TimerInstall(id, timeout, singleShot);\n};\n\nremoveTimer = function(id, singleShot) {\n  var timer, timerSet;\n  timerSet = (singleShot ? TimerTimeouts : TimerIntervals);\n  timer = timerSet[id];\n  if (!timer) {\n    return;\n  }\n  Timeline.addRecord_TimerRemove(id, timer.timeout, singleShot);\n  return delete timerSet[id];\n};\n\ninstrumentedTimerCode = function(code, timeout, singleShot) {\n  var instrumentedCode;\n  if (typeof code !== \"function\") {\n    return code;\n  }\n  instrumentedCode = function() {\n    var id, result;\n    result = code.apply(this, arguments);\n    id = arguments.callee.__timerId;\n    Timeline.addRecord_TimerFire(id, timeout, singleShot);\n    return result;\n  };\n  instrumentedCode.displayName = code.name || code.displayName;\n  return instrumentedCode;\n};\n\naddStackTrace = function(record, skip) {\n  var i, trace, _results;\n  if (!skip) {\n    skip = 1;\n  }\n  trace = new StackTrace(arguments).trace;\n  record.stackTrace = [];\n  i = skip;\n  _results = [];\n  while (i < trace.length) {\n    record.stackTrace.push({\n      functionName: trace[i],\n      scriptName: \"\",\n      lineNumber: \"\"\n    });\n    _results.push(i++);\n  }\n  return _results;\n};\n\nTimeline.installGlobalListeners();\n\nTimeline.installNativeHooks();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WeinreExtraClientCommandsImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WeinreExtraClientCommandsImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Console, Weinre, WeinreExtraClientCommandsImpl, WiDatabaseImpl;\n\nWeinre = require('../common/Weinre');\n\nWiDatabaseImpl = require('./WiDatabaseImpl');\n\nConsole = require('./Console');\n\nmodule.exports = WeinreExtraClientCommandsImpl = (function() {\n  function WeinreExtraClientCommandsImpl() {}\n\n  WeinreExtraClientCommandsImpl.prototype.getDatabases = function(callback) {\n    var result;\n    if (!callback) {\n      return;\n    }\n    result = WiDatabaseImpl.getDatabases();\n    return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n  };\n\n  return WeinreExtraClientCommandsImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WeinreTargetEventsImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WeinreTargetEventsImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Callback, Console, Weinre, WeinreTargetEventsImpl;\n\nWeinre = require('../common/Weinre');\n\nCallback = require('../common/Callback');\n\nConsole = require('./Console');\n\nmodule.exports = WeinreTargetEventsImpl = (function() {\n  function WeinreTargetEventsImpl() {}\n\n  WeinreTargetEventsImpl.prototype.connectionCreated = function(clientChannel, targetChannel) {\n    var message;\n    message = (\"weinre: target \" + targetChannel + \" connected to client \") + clientChannel;\n    Weinre.logInfo(message);\n    return Weinre.target.whenBodyReady(this, [], function() {\n      var oldValue;\n      oldValue = Console.useRemote(true);\n      Weinre.target.setDocument();\n      Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\n      return Weinre.wi.DOMStorage.initialize();\n    });\n  };\n\n  WeinreTargetEventsImpl.prototype.connectionDestroyed = function(clientChannel, targetChannel) {\n    var message, oldValue;\n    message = (\"weinre: target \" + targetChannel + \" disconnected from client \") + clientChannel;\n    Weinre.logInfo(message);\n    return oldValue = Console.useRemote(false);\n  };\n\n  WeinreTargetEventsImpl.prototype.sendCallback = function(callbackId, result) {\n    return Callback.invoke(callbackId, result);\n  };\n\n  return WeinreTargetEventsImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WiCSSImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WiCSSImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiCSSImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiCSSImpl = (function() {\n  function WiCSSImpl() {\n    this.dummyComputedStyle = false;\n  }\n\n  WiCSSImpl.prototype.getStylesForNode = function(nodeId, callback) {\n    var computedStyle, node, parentNode, parentStyle, result;\n    result = {};\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    if (this.dummyComputedStyle) {\n      computedStyle = {\n        styleId: null,\n        properties: [],\n        shorthandValues: [],\n        cssProperties: []\n      };\n    } else {\n      computedStyle = Weinre.cssStore.getComputedStyle(node);\n    }\n    result = {\n      inlineStyle: Weinre.cssStore.getInlineStyle(node),\n      computedStyle: computedStyle,\n      matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(node),\n      styleAttributes: Weinre.cssStore.getStyleAttributes(node),\n      pseudoElements: Weinre.cssStore.getPseudoElements(node),\n      inherited: []\n    };\n    parentNode = node.parentNode;\n    while (parentNode) {\n      parentStyle = {\n        inlineStyle: Weinre.cssStore.getInlineStyle(parentNode),\n        matchedCSSRules: Weinre.cssStore.getMatchedCSSRules(parentNode)\n      };\n      result.inherited.push(parentStyle);\n      parentNode = parentNode.parentNode;\n    }\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiCSSImpl.prototype.getComputedStyleForNode = function(nodeId, callback) {\n    var node, result;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    result = Weinre.cssStore.getComputedStyle(node);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiCSSImpl.prototype.getInlineStyleForNode = function(nodeId, callback) {\n    var node, result;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    result = Weinre.cssStore.getInlineStyle(node);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiCSSImpl.prototype.getAllStyles = function(callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiCSSImpl.prototype.getStyleSheet = function(styleSheetId, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiCSSImpl.prototype.getStyleSheetText = function(styleSheetId, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiCSSImpl.prototype.setStyleSheetText = function(styleSheetId, text, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiCSSImpl.prototype.setPropertyText = function(styleId, propertyIndex, text, overwrite, callback) {\n    var result;\n    result = Weinre.cssStore.setPropertyText(styleId, propertyIndex, text, overwrite);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiCSSImpl.prototype.toggleProperty = function(styleId, propertyIndex, disable, callback) {\n    var result;\n    result = Weinre.cssStore.toggleProperty(styleId, propertyIndex, disable);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiCSSImpl.prototype.setRuleSelector = function(ruleId, selector, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiCSSImpl.prototype.addRule = function(contextNodeId, selector, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiCSSImpl.prototype.querySelectorAll = function(documentId, selector, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  return WiCSSImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WiConsoleImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WiConsoleImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiConsoleImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiConsoleImpl = (function() {\n  function WiConsoleImpl() {\n    this.messagesEnabled = true;\n  }\n\n  WiConsoleImpl.prototype.setConsoleMessagesEnabled = function(enabled, callback) {\n    var oldValue;\n    oldValue = this.messagesEnabled;\n    this.messagesEnabled = enabled;\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [oldValue]);\n    }\n  };\n\n  WiConsoleImpl.prototype.clearConsoleMessages = function(callback) {\n    Weinre.wi.ConsoleNotify.consoleMessagesCleared();\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\n    }\n  };\n\n  WiConsoleImpl.prototype.setMonitoringXHREnabled = function(enabled, callback) {\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, []);\n    }\n  };\n\n  return WiConsoleImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WiDOMImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WiDOMImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiDOMImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiDOMImpl = (function() {\n  function WiDOMImpl() {}\n\n  WiDOMImpl.prototype.getChildNodes = function(nodeId, callback) {\n    var children, node;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    children = Weinre.nodeStore.serializeNodeChildren(node, 1);\n    Weinre.wi.DOMNotify.setChildNodes(nodeId, children);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiDOMImpl.prototype.setAttribute = function(elementId, name, value, callback) {\n    var element;\n    element = Weinre.nodeStore.getNode(elementId);\n    if (!element) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid elementId: \" + elementId);\n      return;\n    }\n    element.setAttribute(name, value);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiDOMImpl.prototype.removeAttribute = function(elementId, name, callback) {\n    var element;\n    element = Weinre.nodeStore.getNode(elementId);\n    if (!element) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid elementId: \" + elementId);\n      return;\n    }\n    element.removeAttribute(name);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiDOMImpl.prototype.setTextNodeValue = function(nodeId, value, callback) {\n    var node;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    node.nodeValue = value;\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiDOMImpl.prototype.getEventListenersForNode = function(nodeId, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiDOMImpl.prototype.copyNode = function(nodeId, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiDOMImpl.prototype.removeNode = function(nodeId, callback) {\n    var node;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    if (!node.parentNode) {\n      Weinre.logWarning(arguments.callee.signature + \" passed a parentless node: \" + node);\n      return;\n    }\n    node.parentNode.removeChild(node);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiDOMImpl.prototype.changeTagName = function(nodeId, newTagName, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiDOMImpl.prototype.getOuterHTML = function(nodeId, callback) {\n    var node, value;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    value = node.outerHTML;\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [value]);\n    }\n  };\n\n  WiDOMImpl.prototype.setOuterHTML = function(nodeId, outerHTML, callback) {\n    var node;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    node.outerHTML = outerHTML;\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiDOMImpl.prototype.addInspectedNode = function(nodeId, callback) {\n    Weinre.nodeStore.addInspectedNode(nodeId);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiDOMImpl.prototype.performSearch = function(query, runSynchronously, callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiDOMImpl.prototype.searchCanceled = function(callback) {\n    return Weinre.notImplemented(arguments.callee.signature);\n  };\n\n  WiDOMImpl.prototype.pushNodeByPathToFrontend = function(path, callback) {\n    var childNodeIds, curr, currId, i, index, nodeId, nodeName, parts, _i, _ref;\n    parts = path.split(\",\");\n    curr = document;\n    currId = null;\n    nodeId = Weinre.nodeStore.getNodeId(curr);\n    this.getChildNodes(nodeId);\n    for (i = _i = 0, _ref = parts.length; _i < _ref; i = _i += 2) {\n      index = parseInt(parts[i]);\n      nodeName = parts[i + 1];\n      if (isNaN(index)) {\n        return;\n      }\n      childNodeIds = Weinre.nodeStore.childNodeIds(curr);\n      currId = childNodeIds[index];\n      if (!currId) {\n        return;\n      }\n      this.getChildNodes(currId);\n      curr = Weinre.nodeStore.getNode(currId);\n      if (curr.nodeName !== nodeName) {\n        return;\n      }\n    }\n    if (callback && currId) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [currId]);\n    }\n  };\n\n  WiDOMImpl.prototype.resolveNode = function(nodeId, callback) {\n    var result;\n    result = Weinre.injectedScript.resolveNode(nodeId);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiDOMImpl.prototype.getNodeProperties = function(nodeId, propertiesArray, callback) {\n    var result;\n    propertiesArray = JSON.stringify(propertiesArray);\n    result = Weinre.injectedScript.getNodeProperties(nodeId, propertiesArray);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiDOMImpl.prototype.getNodePrototypes = function(nodeId, callback) {\n    var result;\n    result = Weinre.injectedScript.getNodePrototypes(nodeId);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiDOMImpl.prototype.pushNodeToFrontend = function(objectId, callback) {\n    var result;\n    objectId = JSON.stringify(objectId);\n    result = Weinre.injectedScript.pushNodeToFrontend(objectId);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  return WiDOMImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WiDOMStorageImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WiDOMStorageImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookSites, Weinre, WiDOMStorageImpl, _getStorageArea, _storageEventHandler;\n\nWeinre = require('../common/Weinre');\n\nHookSites = require('./HookSites');\n\nmodule.exports = WiDOMStorageImpl = (function() {\n  function WiDOMStorageImpl() {}\n\n  WiDOMStorageImpl.prototype.getDOMStorageEntries = function(storageId, callback) {\n    var i, key, length, result, storageArea, val;\n    storageArea = _getStorageArea(storageId);\n    if (!storageArea) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n      return;\n    }\n    result = [];\n    length = storageArea.length;\n    i = 0;\n    while (i < length) {\n      key = storageArea.key(i);\n      val = storageArea.getItem(key);\n      result.push([key, val]);\n      i++;\n    }\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiDOMStorageImpl.prototype.setDOMStorageItem = function(storageId, key, value, callback) {\n    var e, result, storageArea;\n    storageArea = _getStorageArea(storageId);\n    if (!storageArea) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n      return;\n    }\n    result = true;\n    try {\n      HookLib.ignoreHooks(function() {\n        if (storageArea === window.localStorage) {\n          return localStorage.setItem(key, value);\n        } else if (storageArea === window.sessionStorage) {\n          return sessionStorage.setItem(key, value);\n        }\n      });\n    } catch (_error) {\n      e = _error;\n      result = false;\n    }\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiDOMStorageImpl.prototype.removeDOMStorageItem = function(storageId, key, callback) {\n    var e, result, storageArea;\n    storageArea = _getStorageArea(storageId);\n    if (!storageArea) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid storageId: \" + storageId);\n      return;\n    }\n    result = true;\n    try {\n      HookLib.ignoreHooks(function() {\n        if (storageArea === window.localStorage) {\n          return localStorage.removeItem(key);\n        } else if (storageArea === window.sessionStorage) {\n          return sessionStorage.removeItem(key);\n        }\n      });\n    } catch (_error) {\n      e = _error;\n      result = false;\n    }\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiDOMStorageImpl.prototype.initialize = function() {\n    if (window.localStorage) {\n      Weinre.wi.DOMStorageNotify.addDOMStorage({\n        id: 1,\n        host: window.location.host,\n        isLocalStorage: true\n      });\n      HookSites.LocalStorage_setItem.addHooks({\n        after: function() {\n          return _storageEventHandler({\n            storageArea: window.localStorage\n          });\n        }\n      });\n      HookSites.LocalStorage_removeItem.addHooks({\n        after: function() {\n          return _storageEventHandler({\n            storageArea: window.localStorage\n          });\n        }\n      });\n      HookSites.LocalStorage_clear.addHooks({\n        after: function() {\n          return _storageEventHandler({\n            storageArea: window.localStorage\n          });\n        }\n      });\n    }\n    if (window.sessionStorage) {\n      Weinre.wi.DOMStorageNotify.addDOMStorage({\n        id: 2,\n        host: window.location.host,\n        isLocalStorage: false\n      });\n      HookSites.SessionStorage_setItem.addHooks({\n        after: function() {\n          return _storageEventHandler({\n            storageArea: window.sessionStorage\n          });\n        }\n      });\n      HookSites.SessionStorage_removeItem.addHooks({\n        after: function() {\n          return _storageEventHandler({\n            storageArea: window.sessionStorage\n          });\n        }\n      });\n      HookSites.SessionStorage_clear.addHooks({\n        after: function() {\n          return _storageEventHandler({\n            storageArea: window.sessionStorage\n          });\n        }\n      });\n    }\n    return document.addEventListener(\"storage\", _storageEventHandler, false);\n  };\n\n  return WiDOMStorageImpl;\n\n})();\n\n_getStorageArea = function(storageId) {\n  if (storageId === 1) {\n    return window.localStorage;\n  } else if (storageId === 2) {\n    return window.sessionStorage;\n  }\n  return null;\n};\n\n_storageEventHandler = function(event) {\n  var storageId;\n  if (event.storageArea === window.localStorage) {\n    storageId = 1;\n  } else if (event.storageArea === window.sessionStorage) {\n    storageId = 2;\n  } else {\n    return;\n  }\n  return Weinre.wi.DOMStorageNotify.updateDOMStorage(storageId);\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WiDatabaseImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WiDatabaseImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar HookSites, IDGenerator, SqlStepper, Weinre, WiDatabaseImpl, dbAdd, dbById, dbRecordById, dbRecordByName, executeSQL_error, executeSQL_step_1, executeSQL_step_2, getTableNames_step_1, getTableNames_step_2, id2db, logSqlError, name2db;\n\nWeinre = require('../common/Weinre');\n\nIDGenerator = require('../common/IDGenerator');\n\nHookSites = require('./HookSites');\n\nSqlStepper = require('./SqlStepper');\n\nid2db = {};\n\nname2db = {};\n\nmodule.exports = WiDatabaseImpl = (function() {\n  function WiDatabaseImpl() {\n    if (!window.openDatabase) {\n      return;\n    }\n    HookSites.window_openDatabase.addHooks({\n      after: function(receiver, args, db) {\n        var name, version;\n        if (!db) {\n          return;\n        }\n        name = args[0];\n        version = args[1];\n        return dbAdd(db, name, version);\n      }\n    });\n  }\n\n  WiDatabaseImpl.getDatabases = function() {\n    var id, result;\n    result = [];\n    for (id in id2db) {\n      result.push(id2db[id]);\n    }\n    return result;\n  };\n\n  WiDatabaseImpl.prototype.getDatabaseTableNames = function(databaseId, callback) {\n    var db, stepper;\n    db = dbById(databaseId);\n    if (!db) {\n      return;\n    }\n    stepper = SqlStepper([getTableNames_step_1, getTableNames_step_2]);\n    stepper.callback = callback;\n    return stepper.run(db, logSqlError);\n  };\n\n  WiDatabaseImpl.prototype.executeSQL = function(databaseId, query, callback) {\n    var db, stepper, txid;\n    db = dbById(databaseId);\n    if (!db) {\n      return;\n    }\n    txid = Weinre.targetDescription.channel + \"-\" + IDGenerator.next();\n    stepper = SqlStepper([executeSQL_step_1, executeSQL_step_2]);\n    stepper.txid = txid;\n    stepper.query = query;\n    stepper.callback = callback;\n    stepper.run(db, executeSQL_error);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [true, txid]);\n    }\n  };\n\n  return WiDatabaseImpl;\n\n})();\n\nlogSqlError = function(sqlError) {\n  return console.log((\"SQL Error \" + sqlError.code + \": \") + sqlError.message);\n};\n\ngetTableNames_step_1 = function() {\n  return this.executeSql(\"SELECT name FROM sqlite_master WHERE type='table'\");\n};\n\ngetTableNames_step_2 = function(resultSet) {\n  var i, name, result, rows;\n  rows = resultSet.rows;\n  result = [];\n  i = 0;\n  while (i < rows.length) {\n    name = rows.item(i).name;\n    if (name === \"__WebKitDatabaseInfoTable__\") {\n      i++;\n      continue;\n    }\n    result.push(name);\n    i++;\n  }\n  return Weinre.WeinreTargetCommands.sendClientCallback(this.callback, [result]);\n};\n\nexecuteSQL_step_1 = function() {\n  return this.executeSql(this.query);\n};\n\nexecuteSQL_step_2 = function(resultSet) {\n  var columnNames, i, j, propName, row, rows, values;\n  columnNames = [];\n  values = [];\n  rows = resultSet.rows;\n  i = 0;\n  while (i < rows.length) {\n    row = rows.item(i);\n    if (i === 0) {\n      for (propName in row) {\n        columnNames.push(propName);\n      }\n    }\n    j = 0;\n    while (j < columnNames.length) {\n      values.push(row[columnNames[j]]);\n      j++;\n    }\n    i++;\n  }\n  return Weinre.wi.DatabaseNotify.sqlTransactionSucceeded(this.txid, columnNames, values);\n};\n\nexecuteSQL_error = function(sqlError) {\n  var error;\n  error = {\n    code: sqlError.code,\n    message: sqlError.message\n  };\n  return Weinre.wi.DatabaseNotify.sqlTransactionFailed(this.txid, error);\n};\n\ndbById = function(id) {\n  var record;\n  record = id2db[id];\n  if (!record) {\n    return null;\n  }\n  return record.db;\n};\n\ndbRecordById = function(id) {\n  return id2db[id];\n};\n\ndbRecordByName = function(name) {\n  return name2db[name];\n};\n\ndbAdd = function(db, name, version) {\n  var payload, record;\n  record = dbRecordByName(name);\n  if (record) {\n    return record;\n  }\n  record = {};\n  record.id = IDGenerator.next();\n  record.domain = window.location.origin;\n  record.name = name;\n  record.version = version;\n  record.db = db;\n  id2db[record.id] = record;\n  name2db[name] = record;\n  payload = {};\n  payload.id = record.id;\n  payload.domain = record.domain;\n  payload.name = name;\n  payload.version = version;\n  return Weinre.WeinreExtraTargetEvents.databaseOpened(payload);\n};\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WiInspectorImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WiInspectorImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Timeline, Weinre, WiInspectorImpl;\n\nWeinre = require('../common/Weinre');\n\nTimeline = require('../target/Timeline');\n\nmodule.exports = WiInspectorImpl = (function() {\n  function WiInspectorImpl() {}\n\n  WiInspectorImpl.prototype.reloadPage = function(callback) {\n    if (callback) {\n      Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n    return window.location.reload();\n  };\n\n  WiInspectorImpl.prototype.highlightDOMNode = function(nodeId, callback) {\n    var node;\n    node = Weinre.nodeStore.getNode(nodeId);\n    if (!node) {\n      Weinre.logWarning(arguments.callee.signature + \" passed an invalid nodeId: \" + nodeId);\n      return;\n    }\n    Weinre.elementHighlighter.on(node);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiInspectorImpl.prototype.hideDOMNodeHighlight = function(callback) {\n    Weinre.elementHighlighter.off();\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiInspectorImpl.prototype.startTimelineProfiler = function(callback) {\n    Timeline.start();\n    Weinre.wi.TimelineNotify.timelineProfilerWasStarted();\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  WiInspectorImpl.prototype.stopTimelineProfiler = function(callback) {\n    Timeline.stop();\n    Weinre.wi.TimelineNotify.timelineProfilerWasStopped();\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback);\n    }\n  };\n\n  return WiInspectorImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/web/weinre/target/WiRuntimeImpl.amd.js",
    "content": ";modjewel.define(\"weinre/target/WiRuntimeImpl\", function(require, exports, module) { // Generated by CoffeeScript 1.8.0\nvar Weinre, WiRuntimeImpl;\n\nWeinre = require('../common/Weinre');\n\nmodule.exports = WiRuntimeImpl = (function() {\n  function WiRuntimeImpl() {}\n\n  WiRuntimeImpl.prototype.evaluate = function(expression, objectGroup, includeCommandLineAPI, callback) {\n    var result;\n    result = Weinre.injectedScript.evaluate(expression, objectGroup, includeCommandLineAPI);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiRuntimeImpl.prototype.getCompletions = function(expression, includeCommandLineAPI, callback) {\n    var result;\n    result = Weinre.injectedScript.getCompletions(expression, includeCommandLineAPI);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiRuntimeImpl.prototype.getProperties = function(objectId, ignoreHasOwnProperty, abbreviate, callback) {\n    var result;\n    objectId = JSON.stringify(objectId);\n    result = Weinre.injectedScript.getProperties(objectId, ignoreHasOwnProperty, abbreviate);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiRuntimeImpl.prototype.setPropertyValue = function(objectId, propertyName, expression, callback) {\n    var result;\n    objectId = JSON.stringify(objectId);\n    result = Weinre.injectedScript.setPropertyValue(objectId, propertyName, expression);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  WiRuntimeImpl.prototype.releaseWrapperObjectGroup = function(injectedScriptId, objectGroup, callback) {\n    var result;\n    result = Weinre.injectedScript.releaseWrapperObjectGroup(objectGroup);\n    if (callback) {\n      return Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]);\n    }\n  };\n\n  return WiRuntimeImpl;\n\n})();\n\nrequire(\"../common/MethodNamer\").setNamesForClass(module.exports);\n\n});\n"
  },
  {
    "path": "buildin_modules/weinre/weinre",
    "content": "#!/usr/bin/env node\n\n/*\n#-------------------------------------------------------------------------------\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#-------------------------------------------------------------------------------\n*/\n\n// script to run the weinre server\n\nrequire(\"./lib/cli\").run()\n"
  },
  {
    "path": "lib/config/config.js",
    "content": "'use strict';\n\nvar SPY_WEINRE_DOMAIN = 'spyweinrefortest.com';\nvar SPY_DEBUGGER_DOMAIN = 'spydebugger.com';\n\nvar config = exports;\nconfig.SPY_WEINRE_DOMAIN = SPY_WEINRE_DOMAIN;\nconfig.SPY_DEBUGGER_DOMAIN = SPY_DEBUGGER_DOMAIN;\nconfig.SPY_DEBUGGER_SHORT_DOMAIN = 's.xxx';"
  },
  {
    "path": "lib/index.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar program = require('commander');\nvar weinreDelegate = require('./weinre/weinreDelegate');\nvar colors = require('colors');\nvar http = require('http');\n\nprogram.version(require('../package.json').version).option('-p, --port [value]', 'start port').option('-i, --showIframe [value]', 'spy iframe window').option('-b, --autoDetectBrowser [value]', 'Auto detect Browser Request').option('-e, --externalProxy [value]', 'set external Proxy').option('-c, --cache [value]', 'set no cache').option('-w, --contentEditable [value]', 'set content editable');\n\nprogram.parse(process.argv);\n\nvar cusSpyProxyPort = program.port || 9888;\n\nvar cusShowIframe = false;\nif (program.showIframe === 'true') {\n    cusShowIframe = true;\n}\n\nvar autoDetectBrowser = false;\nif (program.autoDetectBrowser === 'true') {\n    autoDetectBrowser = true;\n}\n\nvar cusCache = false;\nif (program.cache === 'true') {\n    cusCache = true;\n}\n\nvar cusContentEditable = false;\nif (program.contentEditable === 'true') {\n    cusContentEditable = true;\n}\n\nweinreDelegate.createCA();\n\nvar tempServer = new http.Server();\n\nvar createTempServerPromise = function createTempServerPromise(port) {\n    return new Promise(function (resolve, reject) {\n        tempServer.listen(port, function () {\n            tempServer.close(function () {\n                resolve();\n            });\n        });\n        tempServer.on('error', function (e) {\n            console.error(colors.red('警告：启动失败!！'));\n            console.error(colors.red('检查端口 ' + port + ' 是否被占用，或尝试更换启动端口'));\n            reject();\n        });\n    });\n};\n\nvar tempServerPromise = createTempServerPromise(cusSpyProxyPort);\n\ntempServerPromise.then(function () {\n    weinreDelegate.run({\n        cusExternalProxy: program.externalProxy,\n        cusSpyProxyPort: cusSpyProxyPort,\n        cusShowIframe: cusShowIframe,\n        cusAutoDetectBrowser: autoDetectBrowser,\n        cusCache: cusCache,\n        cusContentEditable: cusContentEditable\n    });\n}, function (e) {\n    // throw e\n});"
  },
  {
    "path": "lib/proxy/externalChildProcess.js",
    "content": "'use strict';\n\nfunction _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }\n\nrequire('babel-polyfill');\nvar http = require('http');\nvar AnyProxy = require('anyproxy');\nvar fs = require('fs');\nvar path = require('path');\nvar colors = require('colors');\n\nvar port = void 0,\n    webPort = void 0,\n    socketPort = void 0;\n\nvar tempServerPromise = function tempServerPromise() {\n    return new Promise(function (resolve, reject) {\n        var tempServer = new http.Server();\n        tempServer.listen(function () {\n            var unBoundedPort = tempServer.address().port;\n            tempServer.close(function () {\n                resolve(unBoundedPort);\n            });\n        });\n    });\n};\n\nvar createAnyProxy = function createAnyProxy() {\n    var options = {\n        port: port,\n        forceProxyHttps: true,\n        webInterface: {\n            enable: true,\n            webPort: webPort\n        },\n        dangerouslyIgnoreUnauthorized: true,\n        silent: true //optional, do not print anything into terminal. do not set it when you are still debugging.\n    };\n    new AnyProxy.ProxyServer(options).start();\n};\n\nprocess.on('message', function (_ref) {\n    var type = _ref.type,\n        ports = _ref.ports;\n\n    if (type === 'start') {\n        if (!AnyProxy.utils.certMgr.isRootCAFileExists()) {\n            var userHome = process.env.HOME || process.env.USERPROFILE;\n            var certDir = path.join(userHome, '/.anyproxy/certificates');\n            if (!fs.existsSync(certDir)) {\n                try {\n                    fs.mkdirSync(certDir);\n                } catch (e) {\n                    console.error('fail to create certDir at:' + certDir);\n                }\n            }\n            var mitmCrt = path.resolve(userHome, './node-mitmproxy/node-mitmproxy.ca.crt');\n            var mitmKey = path.resolve(userHome, './node-mitmproxy/node-mitmproxy.ca.key.pem');\n\n            fs.createReadStream(mitmCrt).pipe(fs.createWriteStream(path.join(certDir, './rootCA.crt')));\n            fs.createReadStream(mitmKey).pipe(fs.createWriteStream(path.join(certDir, './rootCA.key')));\n        }\n\n        ;_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n            var ports;\n            return regeneratorRuntime.wrap(function _callee$(_context) {\n                while (1) {\n                    switch (_context.prev = _context.next) {\n                        case 0:\n                            _context.next = 2;\n                            return Promise.all([tempServerPromise(), tempServerPromise(), tempServerPromise()]);\n\n                        case 2:\n                            ports = _context.sent;\n\n                            port = ports[0];\n                            webPort = ports[1];\n                            socketPort = ports[2];\n                            createAnyProxy();\n\n                            process.send({\n                                port: port,\n                                webPort: webPort,\n                                socketPort: socketPort\n                            });\n\n                        case 8:\n                        case 'end':\n                            return _context.stop();\n                    }\n                }\n            }, _callee, undefined);\n        }))();\n    } else if (type === 'restart') {\n        port = ports.port;\n        webPort = ports.webPort;\n        socketPort = ports.socketPort;\n\n        createAnyProxy();\n        console.log(colors.green('重启成功！请手动刷新浏览器'));\n    }\n});"
  },
  {
    "path": "lib/proxy/spyProxy.js",
    "content": "'use strict';\n\nvar url = require('url');\nvar mitmProxy = require('node-mitmproxy');\nvar httpUtil = require('../util/httpUtil');\nvar zlib = require('zlib');\nvar through = require('through2');\nvar config = require('../config/config');\nvar htmlUtil = require('../util/htmlUtil');\nvar path = require('path');\nvar fs = require('fs');\nvar colors = require('colors');\nvar charset = require('charset');\nvar iconv = require('iconv-lite');\nvar jschardet = require('jschardet');\nvar domain = require('domain');\nvar childProcess = require('child_process');\n\nvar d = domain.create();\nd.on('error', function (err) {\n    console.log(err.message);\n});\nmodule.exports = {\n    createProxy: function createProxy(_ref) {\n        var injectScriptTag = _ref.injectScriptTag,\n            _ref$port = _ref.port,\n            port = _ref$port === undefined ? 9888 : _ref$port,\n            weinrePort = _ref.weinrePort,\n            _ref$autoDetectBrowse = _ref.autoDetectBrowser,\n            autoDetectBrowser = _ref$autoDetectBrowse === undefined ? true : _ref$autoDetectBrowse,\n            _externalProxy = _ref.externalProxy,\n            successCB = _ref.successCB,\n            cache = _ref.cache;\n\n        var createMitmProxy = function createMitmProxy() {\n            mitmProxy.createProxy({\n                externalProxy: function externalProxy(req, ssl) {\n                    // ignore weixin mmtls\n                    var headers = req.headers;\n                    if (headers['upgrade'] && headers['upgrade'] === 'mmtls') {\n                        return '';\n                    } else {\n                        return _externalProxy;\n                    }\n                },\n                port: port,\n                getCertSocketTimeout: 3 * 1000,\n                sslConnectInterceptor: function sslConnectInterceptor(req, cltSocket, head) {\n                    var srvUrl = url.parse('https://' + req.url);\n\n                    // 只拦截浏览器的https请求\n                    if (!autoDetectBrowser || req.headers && req.headers['user-agent'] && (/Mozilla/.test(req.headers['user-agent']) || /com.apple.WebKit.Networking/i.test(req.headers['user-agent']))) {\n                        return true;\n                    } else {\n                        return false;\n                    }\n                },\n                requestInterceptor: function requestInterceptor(rOptions, req, res, ssl, next) {\n                    var rPath;\n                    if (rOptions.path) {\n                        rPath = url.parse(rOptions.path).path;\n                    } else {\n                        rOptions.path = '/';\n                    }\n\n                    if (rOptions.headers.host === config.SPY_DEBUGGER_DOMAIN && rPath === '/cert' || rOptions.headers.host === config.SPY_DEBUGGER_SHORT_DOMAIN) {\n                        var userHome = process.env.HOME || process.env.USERPROFILE;\n                        var certPath = path.resolve(userHome, './node-mitmproxy/node-mitmproxy.ca.crt');\n                        try {\n                            var fileString = fs.readFileSync(certPath);\n                            res.setHeader('Content-Type', 'application/x-x509-ca-cert');\n                            res.setHeader(\"Content-Disposition\", \"attachment;filename=node-mitmproxy.ca.crt\");\n                            res.end(fileString.toString());\n                        } catch (e) {\n                            console.log(e);\n                            res.end('please create certificate first!!');\n                        }\n                        next();\n                        return;\n                    }\n                    if (rOptions.headers.host === config.SPY_WEINRE_DOMAIN) {\n                        rOptions.protocol = 'http:';\n                        rOptions.hostname = '127.0.0.1';\n                        rOptions.port = weinrePort;\n                        // trick for non-transparent proxy\n                        rOptions.path = rPath;\n                        rOptions.agent = false;\n                    }\n                    // delete Accept-Encoding\n                    delete rOptions.headers['accept-encoding'];\n\n                    // no cache\n                    if (!cache) {\n                        delete rOptions.headers['if-modified-since'];\n                        delete rOptions.headers['last-modified'];\n                        delete rOptions.headers['if-none-match'];\n                    }\n\n                    next();\n                },\n                responseInterceptor: function responseInterceptor(req, res, proxyReq, proxyRes, ssl, next) {\n                    var isHtml = httpUtil.isHtml(proxyRes);\n                    var contentLengthIsZero = function () {\n                        return proxyRes.headers['content-length'] == 0;\n                    }();\n                    if (!isHtml || contentLengthIsZero) {\n                        next();\n                    } else {\n                        Object.keys(proxyRes.headers).forEach(function (key) {\n                            if (proxyRes.headers[key] != undefined) {\n                                var newkey = key.replace(/^[a-z]|-[a-z]/g, function (match) {\n                                    return match.toUpperCase();\n                                });\n                                var newkey = key;\n\n                                if (isHtml && (key === 'content-length' || key === 'content-security-policy')) {\n                                    // do nothing\n                                } else {\n                                    res.setHeader(newkey, proxyRes.headers[key]);\n                                }\n                            }\n                        });\n\n                        res.writeHead(proxyRes.statusCode);\n\n                        var isGzip = httpUtil.isGzip(proxyRes);\n\n                        var chunks = [];\n                        proxyRes.on('data', function (chunk) {\n                            chunks.push(chunk);\n                        }).on('end', function () {\n                            var allChunk = Buffer.concat(chunks);\n\n                            res.end(chunkReplace(allChunk, injectScriptTag, proxyRes));\n                        });\n                    }\n                    next();\n                }\n            });\n        };\n\n        if (!_externalProxy) {\n            d.run(function () {\n                var ports = void 0;\n\n                var childProxy = childProcess.fork(__dirname + '/externalChildProcess');\n                childProxy.send({\n                    type: 'start'\n                });\n                childProxy.on('message', function (externalProxyPorts) {\n                    ports = externalProxyPorts;\n                    var externalProxyPort = externalProxyPorts.port;\n                    var externalProxyWebPort = externalProxyPorts.webPort;\n                    _externalProxy = 'http://127.0.0.1:' + externalProxyPort;\n                    createMitmProxy();\n                    successCB(externalProxyPorts);\n                });\n                var restartFun = function restartFun() {\n                    console.log(colors.yellow('anyproxy\\u5F02\\u5E38\\u9000\\u51FA\\uFF0C\\u5C1D\\u8BD5\\u91CD\\u542F'));\n                    var childProxy = childProcess.fork(__dirname + '/externalChildProcess');\n                    childProxy.send({\n                        type: 'restart',\n                        ports: ports\n                    });\n                    childProxy.on('exit', function (e) {\n                        restartFun();\n                    });\n                };\n                childProxy.on('exit', function (e) {\n                    restartFun();\n                });\n            });\n        } else {\n            createMitmProxy();\n            successCB(null);\n        }\n    }\n};\nfunction chunkReplace(chunk, injectScriptTag, proxyRes) {\n    var _charset;\n    try {\n        _charset = charset(proxyRes, chunk) || jschardet.detect(chunk).encoding.toLowerCase();\n    } catch (e) {\n        console.error(e);\n    }\n    var chunkString;\n    if (_charset != null && _charset != 'utf-8') {\n        try {\n            chunkString = iconv.decode(chunk, _charset);\n        } catch (e) {\n            console.error(e);\n            chunkString = iconv.decode(chunk, 'utf-8');\n        }\n    } else {\n        chunkString = chunk.toString();\n    }\n\n    var newChunkString = htmlUtil.injectScriptIntoHtml(chunkString, injectScriptTag);\n\n    var buffer;\n    if (_charset != null && _charset != 'utf-8') {\n        try {\n            buffer = iconv.encode(newChunkString, _charset);\n        } catch (e) {\n            console.error(e);\n            buffer = iconv.encode(newChunkString, 'utf-8');\n        }\n    } else {\n        buffer = new Buffer(newChunkString);\n    }\n\n    return buffer;\n}"
  },
  {
    "path": "lib/scripts/postinstall.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\ntry {\n    var anyproxyIndexHtml = fs.readFileSync(path.join(__dirname, '../../template/anyproxy_index.html'));\n    fs.writeFileSync(path.join(__dirname, '../../node_modules/anyproxy/web/index.html'), anyproxyIndexHtml);\n} catch (e) {\n    //\n}"
  },
  {
    "path": "lib/util/htmlUtil.js",
    "content": "'use strict';\n\nvar _ = require('lodash');\n\nvar htmlUtil = exports;\n\n// inject script into html\nhtmlUtil.injectScriptIntoHtml = function (html, script) {\n    html = html.replace(/<head>|<head\\s[^<]*>/gi, function (match) {\n        return match + script;\n    });\n    html = html.replace(/Content-Security-Policy/ig, function (match) {\n        return 'hacky';\n    });\n    return html;\n};\n\nhtmlUtil.createScriptTag = function (_ref) {\n    var tpl = _ref.tpl,\n        showIframe = _ref.showIframe,\n        contentEditable = _ref.contentEditable,\n        weinreDomain = _ref.weinreDomain;\n\n    return _.template(tpl)({\n        showIframe: showIframe,\n        weinreDomain: weinreDomain,\n        contentEditable: contentEditable\n    });\n};"
  },
  {
    "path": "lib/util/httpUtil.js",
    "content": "'use strict';\n\nvar os = require('os');\nvar url = require('url');\nvar config = require('../config/config');\n\nvar httpUtil = exports;\n\nhttpUtil.isGzip = function (res) {\n    var contentEncoding = res.headers['content-encoding'];\n    return !!(contentEncoding && contentEncoding.toLowerCase() == 'gzip');\n};\nhttpUtil.isHtml = function (res) {\n    var contentType = res.headers['content-type'];\n    return typeof contentType != 'undefined' && /text\\/html|application\\/xhtml\\+xml/.test(contentType);\n};\nhttpUtil.hasPort = function (host) {\n    return !!~host.indexOf(':');\n};"
  },
  {
    "path": "lib/weinre/weinreDelegate.js",
    "content": "'use strict';\n\nvar http = require('http');\nvar os = require('os');\nvar weinre = require('../../buildin_modules/weinre/lib/weinre');\nvar child_process = require('child_process');\nvar spyProxy = require('../proxy/spyProxy');\nvar config = require('../config/config');\nvar colors = require('colors');\nvar fs = require('fs');\nvar htmlUtil = require('../util/htmlUtil');\nvar path = require('path');\nvar domain = require('domain');\nvar mitmproxy = require('node-mitmproxy');\nvar _ = require('lodash');\nvar ip = require('ip');\n\nvar d = domain.create();\nd.on('error', function (err) {\n    console.log(err.message);\n});\n\nvar spyProxyPort;\nvar showIframe = false;\nvar contentEditable = false;\n\nvar weinreDelegate = module.exports;\nvar autoDetectBrowser = true;\nvar externalProxy;\nvar cache = false;\n\nweinreDelegate.run = function run(_ref) {\n    var cusSpyProxyPort = _ref.cusSpyProxyPort,\n        cusShowIframe = _ref.cusShowIframe,\n        cusAutoDetectBrowser = _ref.cusAutoDetectBrowser,\n        cusExternalProxy = _ref.cusExternalProxy,\n        cusCache = _ref.cusCache,\n        cusContentEditable = _ref.cusContentEditable;\n\n    spyProxyPort = cusSpyProxyPort;\n    showIframe = cusShowIframe;\n    autoDetectBrowser = cusAutoDetectBrowser;\n    externalProxy = cusExternalProxy;\n    cache = cusCache;\n    contentEditable = cusContentEditable;\n    var unBoundedPort = void 0;\n    // get an unbounded port\n    var tempServer = new http.Server();\n    tempServer.listen(function () {\n        unBoundedPort = tempServer.address().port;\n        tempServer.close(function () {\n            startWeinreServer(unBoundedPort);\n        });\n    });\n};\n\nweinreDelegate.createCA = function () {\n    mitmproxy.createCA();\n};\n\nfunction startWeinreServer(port) {\n    console.log(colors.green('正在启动代理'));\n    d.run(function () {\n\n        var weinreServer = weinre.run({\n            httpPort: port,\n            boundHost: '-all-',\n            verbose: false,\n            debug: false,\n            readTimeout: 5,\n            deathTimeout: 15\n        });\n        weinreServer.on('listening', function () {\n\n            fs.readFile(path.resolve(__dirname, '../../template/inject.js.template.html'), 'utf8', function (err, tpl) {\n                if (err) {\n                    return console.log(err);\n                }\n                var injectScriptTag = htmlUtil.createScriptTag({\n                    tpl: tpl,\n                    showIframe: showIframe,\n                    contentEditable: contentEditable,\n                    weinreDomain: config.SPY_WEINRE_DOMAIN\n                });\n                spyProxy.createProxy({\n                    port: spyProxyPort,\n                    injectScriptTag: injectScriptTag,\n                    weinrePort: port,\n                    autoDetectBrowser: autoDetectBrowser,\n                    externalProxy: externalProxy,\n                    cache: cache,\n                    successCB: function successCB(externalProxyPorts) {\n                        if (!externalProxy) {\n                            var webPort = externalProxyPorts.webPort;\n                            var guiServer = new http.Server();\n                            guiServer.listen(function () {\n                                setTimeout(function () {\n                                    var guiPort = guiServer.address().port;\n                                    if (process.platform === 'win32' || process.platform === 'win64') {\n                                        child_process.exec('start http://127.0.0.1:' + guiPort);\n                                        console.log(colors.green('\\u6D4F\\u89C8\\u5668\\u6253\\u5F00 ---> http://127.0.0.1:' + guiPort));\n                                    } else {\n                                        child_process.exec('open http://127.0.0.1:' + guiPort);\n                                        console.log(colors.green('\\u6D4F\\u89C8\\u5668\\u6253\\u5F00 ---> http://127.0.0.1:' + guiPort));\n                                    }\n                                }, 600);\n                            });\n                            guiServer.on('error', function (e) {\n                                console.log(e);\n                            });\n                            var fp = path.join(__dirname, '../../template/wrap.html');\n                            var fileTemp = fs.readFileSync(fp).toString();\n                            var fileString = _.template(fileTemp)({\n                                weinreUrl: 'http://127.0.0.1:' + port + '/client',\n                                anyProxyUrl: 'http://127.0.0.1:' + webPort\n                            });\n                            guiServer.on('request', function (req, res) {\n                                res.setHeader('Content-Type', 'text/html;charset=utf-8');\n                                res.end(fileString);\n                            });\n                        } else {\n                            // auto open debugger page\n                            if (process.platform === 'win32' || process.platform === 'win64') {\n                                child_process.exec('start http://127.0.0.1:' + port + '/client');\n                                console.log(colors.green('\\u6D4F\\u89C8\\u5668\\u6253\\u5F00 ---> http://127.0.0.1:' + port + '/client'));\n                            } else {\n                                child_process.exec('open http://127.0.0.1:' + port + '/client');\n                                console.log(colors.green('\\u6D4F\\u89C8\\u5668\\u6253\\u5F00 ---> http://127.0.0.1:' + port + '/client'));\n                            }\n                        }\n                        console.log(colors.green('\\u672C\\u673A\\u5728\\u5F53\\u524D\\u7F51\\u7EDC\\u4E0B\\u7684IP\\u5730\\u5740\\u4E3A\\uFF1A' + ip.address()));\n                    }\n                });\n            });\n            weinreServer.on('error', function (e) {\n                console.error(e);\n            });\n        });\n    });\n}"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"spy-debugger\",\n  \"version\": \"3.8.7\",\n  \"description\": \"web page one-stop remote network debugger\",\n  \"main\": \"lib/index.js\",\n  \"scripts\": {\n    \"test\": \"mocha -R landing test/index --exit\",\n    \"build\": \"babel -w src -d lib\",\n    \"dev\": \"node-debug dev/testSpyProxy.js\",\n    \"prepublish\": \"babel src -d lib\"\n  },\n  \"bin\": {\n    \"spy-debugger\": \"lib/index.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/wuchangming/spy-debugger.git\"\n  },\n  \"keywords\": [\n    \"spy\",\n    \"debugger\",\n    \"weinre\",\n    \"https\"\n  ],\n  \"author\": \"wuchangming\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/wuchangming/spy-debugger/issues\"\n  },\n  \"homepage\": \"https://github.com/wuchangming/spy-debugger#readme\",\n  \"dependencies\": {\n    \"anyproxy\": \"4.1.0\",\n    \"babel-plugin-transform-async-to-generator\": \"^6.8.0\",\n    \"babel-polyfill\": \"^6.13.0\",\n    \"charset\": \"^1.0.0\",\n    \"colors\": \"^1.1.2\",\n    \"commander\": \"^2.9.0\",\n    \"debug\": \"^2.2.0\",\n    \"express\": \"^3.21.2\",\n    \"iconv-lite\": \"^0.4.13\",\n    \"ip\": \"^1.1.2\",\n    \"jschardet\": \"^1.4.1\",\n    \"lodash\": \"^4.17.14\",\n    \"node-mitmproxy\": \"3.1.1\",\n    \"nopt\": \"3.0.x\",\n    \"through2\": \"^2.0.5\",\n    \"underscore\": \"1.7.x\"\n  },\n  \"devDependencies\": {\n    \"babel-cli\": \"^6.6.5\",\n    \"babel-preset-es2015\": \"^6.6.0\",\n    \"mocha\": \"^6.1.4\"\n  },\n  \"files\": [\n    \"lib\",\n    \"template\",\n    \"buildin_modules\"\n  ],\n  \"engines\": {\n    \"node\": \">= 6\"\n  }\n}\n"
  },
  {
    "path": "src/config/config.js",
    "content": "const SPY_WEINRE_DOMAIN = 'spyweinrefortest.com';\nconst SPY_DEBUGGER_DOMAIN = 'spydebugger.com';\n\nvar config = exports;\nconfig.SPY_WEINRE_DOMAIN = SPY_WEINRE_DOMAIN;\nconfig.SPY_DEBUGGER_DOMAIN = SPY_DEBUGGER_DOMAIN;\nconfig.SPY_DEBUGGER_SHORT_DOMAIN = 's.xxx';\n"
  },
  {
    "path": "src/index.js",
    "content": "#!/usr/bin/env node\n'use strict'\nconst program = require('commander')\nconst weinreDelegate = require('./weinre/weinreDelegate')\nconst colors = require('colors')\nconst http = require('http')\n\nprogram\n    .version(require('../package.json').version)\n    .option('-p, --port [value]', 'start port')\n    .option('-i, --showIframe [value]', 'spy iframe window')\n    .option('-b, --autoDetectBrowser [value]', 'Auto detect Browser Request')\n    .option('-e, --externalProxy [value]', 'set external Proxy')\n    .option('-c, --cache [value]', 'set no cache')\n    .option('-w, --contentEditable [value]', 'set content editable')\n\nprogram.parse(process.argv)\n\nvar cusSpyProxyPort = program.port || 9888\n\nvar cusShowIframe = false\nif (program.showIframe === 'true') {\n    cusShowIframe = true\n}\n\nvar autoDetectBrowser = false\nif (program.autoDetectBrowser === 'true') {\n    autoDetectBrowser = true\n}\n\nvar cusCache = false\nif (program.cache === 'true') {\n    cusCache = true\n}\n\nvar cusContentEditable = false\nif (program.contentEditable === 'true') {\n    cusContentEditable = true\n}\n\nweinreDelegate.createCA()\n\nlet tempServer = new http.Server()\n\nvar createTempServerPromise = port => {\n    return new Promise((resolve, reject) => {\n        tempServer.listen(port, () => {\n            tempServer.close(() => {\n                resolve()\n            })\n        })\n        tempServer.on('error', e => {\n            console.error(colors.red('警告：启动失败!！'))\n            console.error(colors.red('检查端口 ' + port + ' 是否被占用，或尝试更换启动端口'))\n            reject()\n        })\n    })\n}\n\nvar tempServerPromise = createTempServerPromise(cusSpyProxyPort)\n\ntempServerPromise.then(\n    () => {\n        weinreDelegate.run({\n            cusExternalProxy: program.externalProxy,\n            cusSpyProxyPort,\n            cusShowIframe,\n            cusAutoDetectBrowser: autoDetectBrowser,\n            cusCache,\n            cusContentEditable\n        })\n    },\n    e => {\n        // throw e\n    }\n)\n"
  },
  {
    "path": "src/proxy/externalChildProcess.js",
    "content": "require('babel-polyfill')\nconst http = require('http')\nconst AnyProxy = require('anyproxy')\nconst fs = require('fs')\nconst path = require('path')\nconst colors = require('colors')\n\nlet port, webPort, socketPort\n\nvar tempServerPromise = () => {\n    return new Promise((resolve, reject) => {\n        let tempServer = new http.Server()\n        tempServer.listen(() => {\n            let unBoundedPort = tempServer.address().port\n            tempServer.close(() => {\n                resolve(unBoundedPort)\n            })\n        })\n    })\n}\n\nlet createAnyProxy = () => {\n    var options = {\n        port,\n        forceProxyHttps: true,\n        webInterface: {\n            enable: true,\n            webPort\n        },\n        dangerouslyIgnoreUnauthorized: true,\n        silent: true //optional, do not print anything into terminal. do not set it when you are still debugging.\n    }\n    new AnyProxy.ProxyServer(options).start()\n}\n\nprocess.on('message', ({ type, ports }) => {\n    if (type === 'start') {\n        if (!AnyProxy.utils.certMgr.isRootCAFileExists()) {\n            var userHome = process.env.HOME || process.env.USERPROFILE\n            var certDir = path.join(userHome, '/.anyproxy/certificates')\n            if (!fs.existsSync(certDir)) {\n                try {\n                    fs.mkdirSync(certDir)\n                } catch (e) {\n                    console.error('fail to create certDir at:' + certDir)\n                }\n            }\n            var mitmCrt = path.resolve(userHome, './node-mitmproxy/node-mitmproxy.ca.crt')\n            var mitmKey = path.resolve(userHome, './node-mitmproxy/node-mitmproxy.ca.key.pem')\n\n            fs\n                .createReadStream(mitmCrt)\n                .pipe(fs.createWriteStream(path.join(certDir, './rootCA.crt')))\n            fs\n                .createReadStream(mitmKey)\n                .pipe(fs.createWriteStream(path.join(certDir, './rootCA.key')))\n        }\n\n        ;(async () => {\n            let ports = await Promise.all([\n                tempServerPromise(),\n                tempServerPromise(),\n                tempServerPromise()\n            ])\n            port = ports[0]\n            webPort = ports[1]\n            socketPort = ports[2]\n            createAnyProxy()\n\n            process.send({\n                port,\n                webPort,\n                socketPort\n            })\n        })()\n    } else if (type === 'restart') {\n        port = ports.port\n        webPort = ports.webPort\n        socketPort = ports.socketPort\n\n        createAnyProxy()\n        console.log(colors.green('重启成功！请手动刷新浏览器'))\n    }\n})\n"
  },
  {
    "path": "src/proxy/spyProxy.js",
    "content": "const url = require('url');\nconst mitmProxy = require('node-mitmproxy');\nconst httpUtil = require('../util/httpUtil');\nconst zlib = require('zlib');\nconst through = require('through2');\nconst config = require('../config/config');\nconst htmlUtil = require('../util/htmlUtil');\nconst path = require('path');\nconst fs = require('fs');\nconst colors = require('colors');\nconst charset = require('charset');\nconst iconv = require('iconv-lite');\nconst jschardet = require('jschardet');\nconst domain = require('domain');\nconst childProcess = require('child_process');\n\nvar d = domain.create();\nd.on('error', function(err) {\n    console.log(err.message);\n});\nmodule.exports = {\n    createProxy({\n        injectScriptTag,\n        port = 9888,\n        weinrePort,\n        autoDetectBrowser = true,\n        externalProxy,\n        successCB,\n        cache\n    }) {\n        var createMitmProxy = () => {\n            mitmProxy.createProxy({\n                externalProxy: (req, ssl) => {\n                    // ignore weixin mmtls\n                    var headers = req.headers;\n                    if (headers['upgrade'] && headers['upgrade'] === 'mmtls') {\n                        return '';\n                    } else {\n                        return externalProxy;\n                    }\n                },\n                port,\n                getCertSocketTimeout: 3 * 1000,\n                sslConnectInterceptor: (req, cltSocket, head) => {\n                    var srvUrl = url.parse(`https://${req.url}`);\n\n                    // 只拦截浏览器的https请求\n                    if (\n                        !autoDetectBrowser ||\n                        (req.headers &&\n                            req.headers['user-agent'] &&\n                            (/Mozilla/.test(req.headers['user-agent']) ||\n                                /com.apple.WebKit.Networking/i.test(req.headers['user-agent'])))\n                    ) {\n                        return true;\n                    } else {\n                        return false;\n                    }\n                },\n                requestInterceptor: (rOptions, req, res, ssl, next) => {\n                    var rPath;\n                    if (rOptions.path) {\n                        rPath = url.parse(rOptions.path).path;\n                    } else {\n                        rOptions.path = '/';\n                    }\n\n                    if (\n                        (rOptions.headers.host === config.SPY_DEBUGGER_DOMAIN &&\n                            rPath === '/cert') ||\n                        rOptions.headers.host === config.SPY_DEBUGGER_SHORT_DOMAIN\n                    ) {\n                        var userHome = process.env.HOME || process.env.USERPROFILE;\n                        var certPath = path.resolve(\n                            userHome,\n                            './node-mitmproxy/node-mitmproxy.ca.crt'\n                        );\n                        try {\n                            var fileString = fs.readFileSync(certPath);\n                            res.setHeader('Content-Type', 'application/x-x509-ca-cert');\n                            res.setHeader(\"Content-Disposition\",\"attachment;filename=node-mitmproxy.ca.crt\");\n                            res.end(fileString.toString());\n                        } catch (e) {\n                            console.log(e);\n                            res.end('please create certificate first!!');\n                        }\n                        next();\n                        return;\n                    }\n                    if (rOptions.headers.host === config.SPY_WEINRE_DOMAIN) {\n                        rOptions.protocol = 'http:';\n                        rOptions.hostname = '127.0.0.1';\n                        rOptions.port = weinrePort;\n                        // trick for non-transparent proxy\n                        rOptions.path = rPath;\n                        rOptions.agent = false;\n                    }\n                    // delete Accept-Encoding\n                    delete rOptions.headers['accept-encoding'];\n\n                    // no cache\n                    if (!cache) {\n                        delete rOptions.headers['if-modified-since'];\n                        delete rOptions.headers['last-modified'];\n                        delete rOptions.headers['if-none-match'];\n                    }\n\n                    next();\n                },\n                responseInterceptor: (req, res, proxyReq, proxyRes, ssl, next) => {\n                    var isHtml = httpUtil.isHtml(proxyRes);\n                    var contentLengthIsZero = (() => {\n                        return proxyRes.headers['content-length'] == 0;\n                    })();\n                    if (!isHtml || contentLengthIsZero) {\n                        next();\n                    } else {\n                        Object.keys(proxyRes.headers).forEach(function(key) {\n                            if (proxyRes.headers[key] != undefined) {\n                                var newkey = key.replace(/^[a-z]|-[a-z]/g, match => {\n                                    return match.toUpperCase();\n                                });\n                                var newkey = key;\n\n                                if (\n                                    isHtml &&\n                                    (key === 'content-length' || key === 'content-security-policy')\n                                ) {\n                                    // do nothing\n                                } else {\n                                    res.setHeader(newkey, proxyRes.headers[key]);\n                                }\n                            }\n                        });\n\n                        res.writeHead(proxyRes.statusCode);\n\n                        var isGzip = httpUtil.isGzip(proxyRes);\n\n                        var chunks = []\n                        proxyRes.on('data', function (chunk) {\n                            chunks.push(chunk)\n                        }).on('end', function () {\n                            var allChunk = Buffer.concat(chunks);\n\n                            res.end(chunkReplace(allChunk, injectScriptTag, proxyRes))\n                        })\n                    }\n                    next();\n                }\n            });\n        };\n\n        if (!externalProxy) {\n            d.run(() => {\n                let ports;\n\n                var childProxy = childProcess.fork(`${__dirname}/externalChildProcess`);\n                childProxy.send({\n                    type: 'start'\n                });\n                childProxy.on('message', externalProxyPorts => {\n                    ports = externalProxyPorts;\n                    var externalProxyPort = externalProxyPorts.port;\n                    var externalProxyWebPort = externalProxyPorts.webPort;\n                    externalProxy = 'http://127.0.0.1:' + externalProxyPort;\n                    createMitmProxy();\n                    successCB(externalProxyPorts);\n                });\n                let restartFun = () => {\n                    console.log(colors.yellow(`anyproxy异常退出，尝试重启`));\n                    let childProxy = childProcess.fork(`${__dirname}/externalChildProcess`);\n                    childProxy.send({\n                        type: 'restart',\n                        ports\n                    });\n                    childProxy.on('exit', function(e) {\n                        restartFun();\n                    });\n                };\n                childProxy.on('exit', function(e) {\n                    restartFun();\n                });\n            });\n        } else {\n            createMitmProxy();\n            successCB(null);\n        }\n    }\n};\nfunction chunkReplace(chunk, injectScriptTag, proxyRes) {\n    var _charset;\n    try {\n        _charset =  charset(proxyRes, chunk) || jschardet.detect(chunk).encoding.toLowerCase();\n    } catch (e) {\n        console.error(e);\n    }\n    var chunkString;\n    if (_charset != null && _charset != 'utf-8') {\n        try {\n            chunkString = iconv.decode(chunk, _charset);\n        } catch (e) {\n            console.error(e);\n            chunkString = iconv.decode(chunk, 'utf-8');\n        }\n    } else {\n        chunkString = chunk.toString();\n    }\n\n    var newChunkString = htmlUtil.injectScriptIntoHtml(chunkString, injectScriptTag);\n\n    var buffer;\n    if (_charset != null && _charset != 'utf-8') {\n        try {\n            buffer = iconv.encode(newChunkString, _charset);\n        } catch (e) {\n            console.error(e);\n            buffer = iconv.encode(newChunkString, 'utf-8');\n        }\n    } else {\n        buffer = new Buffer(newChunkString);\n    }\n\n    return buffer;\n}\n"
  },
  {
    "path": "src/util/htmlUtil.js",
    "content": "const _ = require('lodash');\n\nvar htmlUtil = exports;\n\n\n// inject script into html\nhtmlUtil.injectScriptIntoHtml = function(html, script) {\n    html = html.replace(/<head>|<head\\s[^<]*>/gi, function (match) {\n        return match + script;\n    });\n    html = html.replace(/Content-Security-Policy/ig, function (match) {\n        return 'hacky';\n    });\n    return html;\n}\n\nhtmlUtil.createScriptTag = function ({\n    tpl,\n    showIframe,\n    contentEditable,\n    weinreDomain\n}) {\n    return _.template(tpl)({\n        showIframe,\n        weinreDomain,\n        contentEditable\n    });\n};\n"
  },
  {
    "path": "src/util/httpUtil.js",
    "content": "'use strict'\n\nconst os = require('os');\nconst url = require('url');\nconst config = require('../config/config');\n\nvar httpUtil = exports;\n\nhttpUtil.isGzip = function (res) {\n    var contentEncoding = res.headers['content-encoding'];\n    return !!(contentEncoding && contentEncoding.toLowerCase() == 'gzip');\n}\nhttpUtil.isHtml = function (res) {\n    var contentType = res.headers['content-type'];\n    return (typeof contentType != 'undefined') && /text\\/html|application\\/xhtml\\+xml/.test(contentType);\n}\nhttpUtil.hasPort = (host) => {\n  return !!~host.indexOf(':');\n};\n"
  },
  {
    "path": "src/weinre/weinreDelegate.js",
    "content": "'use strict'\n\nconst http = require('http');\nconst os = require('os');\nconst weinre = require('../../buildin_modules/weinre/lib/weinre');\nconst child_process = require('child_process');\nconst spyProxy = require('../proxy/spyProxy');\nconst config = require('../config/config');\nconst colors = require('colors');\nconst fs = require('fs');\nconst htmlUtil = require('../util/htmlUtil');\nconst path = require('path');\nconst domain = require('domain');\nconst mitmproxy = require('node-mitmproxy');\nconst _ = require('lodash');\nconst ip = require('ip');\n\n\nvar d = domain.create();\nd.on('error', function (err) {\n    console.log(err.message);\n});\n\nvar spyProxyPort;\nvar showIframe = false;\nvar contentEditable = false;\n\nvar weinreDelegate = module.exports;\nvar autoDetectBrowser = true;\nvar externalProxy;\nvar cache = false;\n\nweinreDelegate.run = function run({\n    cusSpyProxyPort,\n    cusShowIframe,\n    cusAutoDetectBrowser,\n    cusExternalProxy,\n    cusCache,\n    cusContentEditable\n}) {\n    spyProxyPort = cusSpyProxyPort;\n    showIframe = cusShowIframe;\n    autoDetectBrowser = cusAutoDetectBrowser;\n    externalProxy = cusExternalProxy;\n    cache = cusCache;\n    contentEditable = cusContentEditable;\n    let unBoundedPort;\n    // get an unbounded port\n    let tempServer  = new http.Server();\n    tempServer.listen(() => {\n        unBoundedPort = tempServer.address().port;\n        tempServer.close(() => {\n            startWeinreServer(unBoundedPort);\n        });\n    });\n}\n\nweinreDelegate.createCA = function () {\n    mitmproxy.createCA();\n}\n\nfunction startWeinreServer (port) {\n    console.log(colors.green('正在启动代理'));\n    d.run(() => {\n\n        let weinreServer = weinre.run({\n            httpPort: port,\n            boundHost: '-all-',\n            verbose: false,\n            debug: false,\n            readTimeout: 5,\n            deathTimeout: 15\n        });\n        weinreServer.on('listening', () => {\n\n            fs.readFile(path.resolve(__dirname, '../../template/inject.js.template.html'), 'utf8', function (err,tpl) {\n                if (err) {\n                    return console.log(err);\n                }\n                var injectScriptTag = htmlUtil.createScriptTag({\n                    tpl,\n                    showIframe,\n                    contentEditable,\n                    weinreDomain: config.SPY_WEINRE_DOMAIN\n                });\n                spyProxy.createProxy({\n                    port: spyProxyPort,\n                    injectScriptTag: injectScriptTag,\n                    weinrePort: port,\n                    autoDetectBrowser,\n                    externalProxy: externalProxy,\n                    cache,\n                    successCB: function (externalProxyPorts) {\n                        if (!externalProxy) {\n                            var webPort = externalProxyPorts.webPort;\n                            var guiServer = new http.Server();\n                            guiServer.listen(() => {\n                                setTimeout(() => {\n                                    var guiPort = guiServer.address().port;\n                                    if (process.platform === 'win32' || process.platform === 'win64') {\n                                        child_process.exec(`start http://127.0.0.1:${guiPort}`);\n                                        console.log(colors.green(`浏览器打开 ---> http://127.0.0.1:${guiPort}`));\n                                    } else {\n                                        child_process.exec(`open http://127.0.0.1:${guiPort}`);\n                                        console.log(colors.green(`浏览器打开 ---> http://127.0.0.1:${guiPort}`));\n                                    }\n                                }, 600)\n                            });\n                            guiServer.on('error', (e) => {\n                                console.log(e);\n                            })\n                            var fp = path.join(__dirname, '../../template/wrap.html');\n                            var fileTemp = (fs.readFileSync(fp)).toString();\n                            var fileString = _.template(fileTemp)({\n                                weinreUrl: `http://127.0.0.1:${port}/client`,\n                                anyProxyUrl: `http://127.0.0.1:${webPort}`\n                            });\n                            guiServer.on('request', (req, res) => {\n                                res.setHeader('Content-Type', 'text/html;charset=utf-8');\n                                res.end(fileString);\n                            })\n\n                        } else {\n                            // auto open debugger page\n                            if (process.platform === 'win32' || process.platform === 'win64') {\n                                child_process.exec(`start http://127.0.0.1:${port}/client`);\n                                console.log(colors.green(`浏览器打开 ---> http://127.0.0.1:${port}/client`));\n                            } else {\n                                child_process.exec(`open http://127.0.0.1:${port}/client`);\n                                console.log(colors.green(`浏览器打开 ---> http://127.0.0.1:${port}/client`));\n                            }\n                        }\n                        console.log(colors.green(`本机在当前网络下的IP地址为：${ip.address()}`))\n                    }\n                });\n            });\n            weinreServer.on('error', (e) => {\n                console.error(e);\n            })\n        })\n\n    })\n}\n"
  },
  {
    "path": "template/anyproxy_index.html",
    "content": "<!--\n    2016.12.17 by wuchangming\n    delete github link\n-->\n<!DOCTYPE html>\n<html>\n<head>\n    <title>AnyProxy</title>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"stylesheet\" href=\"/css/uikit.gradient.min.css\" />\n    <link rel=\"stylesheet\" href=\"/css/page.css\" />\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jstree_style/style.min.css\">\n\n    <link rel=\"icon\" type=\"image/png\" href=\"/favico.png\" />\n</head>\n<body>\n\t<div class=\"topHead\">\n\t\t<div class=\"logoWrapper\">\n\t\t\t<h1>AnyProxy</h1>\n\t\t\t<div id=\"J_indicatorEl\"></div>\n\t\t</div>\n\n\t\t<div class=\"ctrlWrapper\">\n\t\t\t<a href=\"#\"><span class=\"topBtn J_statusBtn\"><i class=\"uk-icon-stop\"></i>Stop</span></a>\n\t\t\t<a href=\"#\"><span class=\"topBtn J_statusBtn btn_disable\"><i class=\"uk-icon-play\"></i>Resume</span></a>\n\t\t\t<a href=\"#\"><span class=\"topBtn J_clearBtn\"><i class=\"uk-icon-eraser\"></i>Clear(Ctrl+X)</span></a>\n\n\t\t\t<span class=\"sep\">|</span>\n\t\t\t<a href=\"/fetchCrtFile\" target=\"_blank\"><span class=\"topBtn\"><i class=\"uk-icon-download\"></i>Download rootCA.crt</span></a>\n\t\t\t<a href=\"/qr_root\" class=\"J_fetchRootQR\" target=\"_blank\"><span class=\"topBtn\"><i class=\"uk-icon-qrcode\"></i>QRCode of rootCA.crt</span></a>\n\t\t</div>\n\n\t\t<div class=\"ctrlWrapper\">\n\t\t\t<span id=\"J_filterBtnContainer\"></span>\n\t\t\t<span id=\"J_filterContainer\"></span>\n\t\t\t<span class=\"sep\">|</span>\n\n\t\t\t{@if customMenu.length}\n\t\t\t\t{@each customMenu as item}\n\t\t\t\t\t<a href=\"#\"><span class=\"topBtn J_customButton\" iframeUrl=\"${item.url}\"><i class=\"${item.icon}\"></i>${item.name}</span></a>\n\t\t\t\t{@/each}\n\t\t\t\t<span class=\"sep\">|</span>\n\t\t\t{@/if}\n\n\t\t\t<span title=\"${rule}\"><i class=\"uk-icon-chain\"></i>Rule : ${rule}</span>\n\t\t</div>\n\n\t\t<div style=\"clear:both\"></div>\n\t</div>\n\n\t<div class=\"mainTableWrapper\" id=\"J_content\"></div>\n\n\t<input type=\"hidden\" id=\"socketPort\" value=\"${wsPort}\" />\n\t<input type=\"hidden\" id=\"baseUrl\" value=\"${ipAddress}\" />\n\n    <script src=\"./page.js\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "template/inject.js.template.html",
    "content": "<script>\n// spy-debugger inject --- begin\n(function () {\n    if (window.spydebuggerDone) {\n        return\n    }\n    try {\n        window.spydebuggerDone = true;\n        var showIframe = <%= showIframe %>;\n        if (window.top === window.self || showIframe) {\n\n            window.__spydebuggerPreLogList = [];\n            var funcs = ['log', 'error', 'debug', 'info', 'warn'];\n            for (var i = 0; i < funcs.length; i++) {\n                var _real = console[funcs[i]];\n                console[funcs[i]] = (function (m) {\n                    return function functionName() {\n                        __spydebuggerPreLogList.push({\n                            m: m,\n                            arg: arguments\n                        })\n                        try {\n                            _real.apply(window.console, arguments);\n                        } catch (e) {\n                            \n                        }\n                    }\n                })(funcs[i]);\n\n            }\n\n            document.write('<script src=\"//<%= weinreDomain %>/target/target-script-min.js#anonymous\"><\\/script>');\n\n            var hasExec = false;\n            var executeConsole = function () {\n                if (hasExec) {\n                    return;\n                }\n                hasExec = true;\n                setTimeout(function () {\n                    for (var i = 0; i < __spydebuggerPreLogList.length; i++) {\n                        var o = __spydebuggerPreLogList[i];\n                        var consoleforspydebugger = window.consoleforspydebugger;\n                        consoleforspydebugger[o.m].apply(consoleforspydebugger, o.arg);\n                    }\n                }, 100);\n            }\n\n            document.addEventListener(\"DOMContentLoaded\", executeConsole);\n            window.addEventListener(\"load\", executeConsole);\n\n            if (<%= contentEditable %>) {\n                var callBack = function () {\n                    document.body.style.webkitUserSelect=\"auto\";\n                    document.body.style.webkitTouchCallout=\"default\";\n                    document.body.contentEditable=true;\n                }\n                var completed = function () {\n                    document.removeEventListener(\"DOMContentLoaded\", completed);\n                    window.removeEventListener(\"load\", completed);\n                    callBack();\n                }\n                if (document.readyState === \"complete\" ||\n                    (document.readyState !== \"loading\" && !document.documentElement.doScroll)) {\n                    window.setTimeout(callBack);\n                } else {\n                    document.addEventListener(\"DOMContentLoaded\", completed);\n                    window.addEventListener(\"load\", completed);\n                }\n            }\n        } else {\n            //do noting\n        }\n\n        window.onerror = function (message, url, lineNo, columnNo, errorObj) {\n            console.error(message);\n        }\n\n    } catch (e) {\n        console.error(e);\n    }\n})()\n\n// spy-debugger inject --- end\n</script>\n"
  },
  {
    "path": "template/wrap.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <title>spy-debugger</title>\n    <style>\n        html,body {\n            margin: 0;\n            padding: 0;\n            width: 100%;\n            height: 100%;\n            overscroll-behavior: none;\n        }\n        .container {\n            height: 100%;\n            width: 100%;\n        }\n        .control-bar {\n            padding-left: 3px;\n            height: 99%;\n            width: 3%;\n            display: inline-block;\n        }\n        .monitor {\n            display: inline-block;\n            height: 100%;\n            width: 95%;\n        }\n        .weinre-iframe, .anyproxy-iframe{\n            height: 99%;\n            width: 100%;\n        }\n\n        .control-bar-wrap{\n            height: 100%;\n            display: table;\n        }\n        .control-bar-container {\n            display: table-cell;\n            vertical-align: middle;\n            border-right: #bbb4b4 2px solid;\n        }\n        .control-bar-btn {\n            text-align: center;\n            margin: 8px 4px;\n            padding: 20px 4px;\n            cursor: pointer;\n            border: #42b983 2px solid;\n            transition: background-color 0.5s, color 0.5s;\n            -moz-transition: background-color 0.5s, color 0.5s; /* Firefox 4 */\n            -webkit-transition: background-color 0.5s, color 0.5s; /* Safari 和 Chrome */\n            -o-transition: background-color 0.5s, color 0.5s;\n        }\n        .control-bar-btn.off:hover {\n            color: #ffffff;\n            background-color: #42b983;\n            border-radius: 5px;\n\n        }\n        .control-bar-btn.on {\n            color: #ffffff;\n            background-color: #42b983;\n            border-radius: 5px;\n        }\n        .control-bar-btn.off {\n            color: #42b983;\n            background-color: #ffffff;\n            border-radius: 5px;\n        }\n        .github-logo {\n            margin: auto;\n            width: 28px;\n        }\n        svg:hover {\n            fill: #111;\n        }\n        .options-btn {\n            margin: auto;\n            width: 28px;\n            top:10px;\n        }\n\n    </style>\n</head>\n<body>\n    <div class=\"container\">\n        <div class=\"control-bar\">\n            <div class=\"control-bar-wrap\">\n                <div class=\"control-bar-container\">\n                    <div class=\"options-btn\">\n                        <!-- <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"28\" height=\"28\" viewBox=\"0 0 512.000000 498.000000\" preserveAspectRatio=\"xMidYMid meet\"><g transform=\"translate(0.000000,498.000000) scale(0.100000,-0.100000)\" fill=\"#42b983\" stroke=\"none\"><path d=\"M1480 4745 c-267 -129 -488 -235 -492 -237 -3 -2 9 -136 28 -298 18 -162 34 -308 34 -325 0 -22 -21 -56 -79 -130 l-80 -101 -316 -34 c-173 -19 -319 -37 -324 -40 -7 -4 -253 -1062 -248 -1066 11 -6 543 -337 545 -339 2 -2 17 -60 33 -130 l29 -127 -22 -37 c-12 -20 -89 -141 -170 -270 -81 -128 -148 -237 -148 -242 0 -9 664 -845 677 -852 5 -2 139 42 298 99 160 57 299 103 311 103 12 1 71 -23 131 -53 l110 -54 27 -74 c46 -129 186 -531 186 -535 0 -1 248 -3 550 -3 303 0 550 1 550 3 0 4 175 507 196 565 15 40 22 46 125 97 60 30 117 55 127 55 15 0 472 -156 585 -199 27 -10 29 -8 367 414 187 234 340 429 340 433 0 5 -72 123 -161 263 -88 140 -165 262 -170 271 -12 21 43 268 62 279 8 4 131 81 274 171 164 103 259 169 258 178 -7 53 -238 1046 -244 1050 -5 3 -151 21 -325 40 l-316 34 -82 104 -81 104 36 322 c21 176 34 322 31 324 -4 2 -225 108 -492 237 l-485 233 -230 -229 -230 -229 -135 0 -135 0 -230 229 -230 230 -485 -234z m600 -430 l185 -185 295 0 295 0 185 185 c146 147 189 185 206 181 11 -3 121 -54 245 -114 l225 -109 -22 -194 c-13 -107 -26 -226 -30 -266 l-7 -72 183 -228 182 -228 266 -30 266 -30 58 -255 c32 -140 56 -260 54 -266 -2 -6 -104 -73 -225 -148 -122 -76 -221 -140 -221 -141 0 -2 -29 -130 -65 -285 -35 -156 -62 -288 -58 -294 3 -6 66 -106 140 -222 73 -116 133 -215 133 -219 0 -11 -320 -409 -332 -414 -5 -2 -121 36 -257 83 l-247 87 -265 -129 -266 -129 -36 -104 c-19 -57 -59 -170 -87 -252 l-52 -147 -268 0 -268 0 -52 147 c-28 82 -68 195 -87 252 l-36 104 -266 129 -265 129 -247 -87 c-136 -47 -252 -84 -258 -83 -5 2 -83 96 -172 208 -162 202 -163 204 -148 230 9 14 73 116 143 227 l126 200 -44 190 c-24 104 -54 233 -66 286 l-21 97 -221 137 c-121 76 -222 142 -224 148 -2 6 22 126 54 266 l58 255 266 30 266 30 183 229 183 228 -30 265 -30 266 230 112 c127 62 238 114 246 114 8 1 98 -82 200 -184z\"/><path d=\"M2415 3429 c-204 -29 -418 -140 -562 -293 -115 -121 -201 -273 -245 -433 -29 -105 -31 -362 -5 -467 74 -293 269 -533 539 -661 144 -68 243 -8 418 -89 117 0 162 4 234 22 215 54 419 189 553 366 60 79 137 240 165 341 32 119 32 365 0 485 -29 108 -106 266 -170 350 -215 284 -572 430 -927 379z m310 -305 c33 -8 98 -33 145 -56 163 -79 307 -256 356 -438 23 -87 23 -253 0 -339 -52 -194 -176 -347 -357 -441 -99 -51 -190 -73 -309 -73 -114 0 -206 21 -297 67 -188 94 -316 249 -369 446 -23 87 -23 253 0 340 61 225 239 412 464 485 102 33 252 37 367 9z\"/></g></svg> -->\n                    </div>\n                    <div id=\"weinreBtn\" class=\"spy-debugger-btn control-bar-btn on\">\n                        页面调试\n                    </div>\n                    <div id=\"anyProxyBtn\" class=\"any-proxy-btn control-bar-btn off\">\n                        请求抓包\n                    </div>\n                    <div class=\"github-logo\">\n                        <a href=\"https://github.com/wuchangming/spy-debugger\" target=\"_blank\">\n                            <svg aria-hidden=\"true\" height=\"28\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"28\"><path fill-rule=\"evenodd\" fill=\"#42b983\" d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z\"></path></svg>\n                        </a>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class=\"monitor\">\n            <div id=\"weinreIframe\" class=\"weinre-iframe\" >\n                <iframe src=\"<%= weinreUrl %>\" frameborder=\"0\" height=\"100%\" width=\"100%\" ></iframe>\n            </div>\n            <div id=\"anyProxyIframe\" class=\"anyproxy-iframe\" style=\"display:none;\">\n                <iframe src=\"<%= anyProxyUrl %>\" frameborder=\"0\" height=\"100%\" width=\"100%\" ></iframe>\n            </div>\n        </div>\n    </div>\n</body>\n<script type=\"text/javascript\">\nvar weinreBtn = document.getElementById('weinreBtn');\nvar anyProxyBtn = document.getElementById('anyProxyBtn');\nvar weinreIframe = document.getElementById('weinreIframe');\nvar anyProxyIframe = document.getElementById('anyProxyIframe');\n\nweinreBtn.onclick=function(){\n    weinreIframe.style.display = 'block';\n    anyProxyIframe.style.display = 'none';\n    weinreBtn.className = weinreBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'off' + '(?:\\\\s|$)'), ' ');\n    weinreBtn.className = weinreBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'on' + '(?:\\\\s|$)'), ' ');\n    weinreBtn.className += \" on\";\n\n    anyProxyBtn.className = anyProxyBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'on' + '(?:\\\\s|$)'), ' ');\n    anyProxyBtn.className = anyProxyBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'off' + '(?:\\\\s|$)'), ' ');\n    anyProxyBtn.className += \" off\";\n}\n\nanyProxyBtn.onclick=function(){\n    weinreIframe.style.display = 'none';\n    anyProxyIframe.style.display = 'block';\n    anyProxyBtn.className = anyProxyBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'off' + '(?:\\\\s|$)'), ' ');\n    anyProxyBtn.className = anyProxyBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'on' + '(?:\\\\s|$)'), ' ');\n    anyProxyBtn.className += \" on\";\n    weinreBtn.className = weinreBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'on' + '(?:\\\\s|$)'), ' ');\n    weinreBtn.className = weinreBtn.className.replace(new RegExp('(?:^|\\\\s)'+ 'off' + '(?:\\\\s|$)'), ' ');\n    weinreBtn.className += \" off\";\n}\n\n</script>\n</html>\n"
  },
  {
    "path": "test/index.js",
    "content": "const child_process = require('child_process')\ndescribe(\"spy-debugger\", function() {\n    it('`lib` should be ok', function () {\n        child_process.exec('node ./lib/index.js')\n    })\n})\n"
  }
]