├── .gitignore
├── CHANGELOG.md
├── LICENCE.md
├── README.md
├── ext.crx
├── ext.pem
├── ext
├── _locales
│ └── en
│ │ └── messages.json
├── css
│ └── getpgn.css
├── icons
│ ├── generatePgnsFromSvg.sh
│ ├── knight.svg
│ ├── knight128.png
│ ├── knight16.png
│ ├── knight256.png
│ ├── knight32.png
│ ├── knight48.png
│ ├── knight512.png
│ └── knight64.png
├── js
│ └── jquery-3.5.1.min.js
├── manifest.json
└── src
│ └── bg
│ ├── analysis.js
│ ├── background.js
│ ├── getpgn.js
│ ├── package-lock.json
│ └── package.json
└── screenshots
├── chessCom.png
└── lichessOrg.png
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | temp
3 | .tmp
4 | dist
5 | *.sublime-project
6 | *.sublime-workspace
7 | .DSStore
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## Version 4.0.5 - 2025-03-20
4 | * Fixed for changed URL for live games. (Thanks stupidJoon!)
5 |
6 | ## Version 4.0.4 - 2024-12-04
7 | * Fixed for recent changes to chess.com stylesheets.
8 | * Fixed for world championship games.
9 |
10 | ## Version 4.0.3 - 2023-05-24
11 | * Fixed support for archived games against computers.
12 |
13 | ## Version 4.0.2 - 2022-04-17
14 | * Fixed for change to chess.com download button.
15 |
16 | ## Version 4.0.1 - 2022-03-28
17 | * Fixed for change to chess.com download button.
18 | * Chrome manifest v3 does not support jQuery calls from background. Refactored.
19 | * Fixed chessgames.com support which now requires https.
20 |
21 | ## Version 4.0.0 - 2022-03-27
22 | * Migrated to Chrome manifest v3. (Thanks russelldavis!)
23 | * Improved support for chesstempo.com.
24 |
25 | ## Version 3.8.1 - 2022-03-04
26 | * Prevented chess.com analysis from being sent to lichess. (Thanks russelldavis!)
27 |
28 | ## Version 3.8.0 - 2021-12-20
29 | * Fixed for chess.com with download button (Thanks guidezpl!)
30 |
31 | ## Version 3.7.0 - 2021-07-29
32 | * Fixed for chess.com daily games
33 | * Now works from chess.com event pages
34 |
35 | ## Version 3.6.0 - 2021-02-06
36 | * Fixed for chess.com analysis pages. (Thanks Johannes!)
37 | * Upgraded to jQuery 3.5.1.
38 |
39 | ## Version 3.5.0 - 2020-11-17
40 | * Now works from the chess.com analysis pages.
41 | * Updated for recent changes to chess.com. (Thanks danickfort!)
42 |
43 | ## Version 3.4.0 - 2020-09-19
44 | * Fixed problems related to url changes in chess.com and chesstempo.com.
45 |
46 | ## Version 3.3.0 - 2020-09-03
47 | * Support for the new url format on chess.com. (Thanks mhssmnn!)
48 |
49 | ## Version 3.2.0 - 2019-12-20
50 | * Updated for recent changes to chess.com.
51 |
52 | ## Version 3.1.0
53 | * Updated for recent changes to chess.com.
54 |
55 | ## Version 3.0.1
56 | * Workaround for chess.com bug where the 'result' field in the pgn is not updated after a player times out.
57 |
58 | ## Version 3.0.0
59 | * Support for games from chessgames.com, chess-db.com and chesstempo.com.
60 | * Improved manifest to limit permissions as much as possible.
61 | * Icon now becomes enabled only when there is a valid game to analyse.
62 | * Improved colour of icon so that it is clear when it is available.
63 |
64 | ## Version 2.6.1
65 | * Fixed for immediately finished live games.
66 |
67 | ## Version 2.6.0
68 | * Updated for recent changes to chess.com. Calls are now async. (Thanks 0ddFell0w!)
69 | * Added support for analysis of daily games.
70 |
71 | ## Version 2.5.6
72 | * Updated for recent changes to Lichess import page.
73 |
74 | ## Version 2.5.5
75 |
76 | * Link was not working immediately from live games.
77 | * Upgraded to jQuery 3.3.1.
78 |
79 | ## Version 2.5.4
80 |
81 | * Fixed broken link when analysing after game has finished.
82 | * Now works from live analysis board (urls with 'live#a=1234567').
83 |
84 | ## Version 2.5.3
85 |
86 | * Print-friendly PDF has been removed to a separate extension (Lichess Print-friendly PDF)[https://chrome.google.com/webstore/detail/lichess-print-friendly-pd/goijhimgdjppmhmjkaglhggoapkgobfg].
87 |
88 | ## Version 2.5.2
89 |
90 | * Print-friendly PDF export now uses AWS lambda.
91 |
92 | ## Version 2.5.1
93 |
94 | * Games lost on time were not being detected as such during lichess import.
95 |
96 | ## Version 2.5.0
97 |
98 | * Added support for 'Print-friendly PDF export' which was removed from lichess in November 2016.
99 |
100 | ## Version 2.4.4
101 |
102 | * Fixed support for analysing live games.
103 |
104 | ## Version 2.4.2
105 |
106 | * 'Export to PDF' from lichess was not correctly determining the winner owing to an anomaly in the chess.com pgn.
107 |
108 | ## Version 2.4.1
109 |
110 | * Fixed css name clash.
111 |
112 | ## Version 2.4.0
113 |
114 | * Analyse any live game! (in v3).
115 | * Fixes to support chess.com changes in v3.
116 | * Improved method of pgn retrieval in v3. Much smoother transition.
117 | * Warning message is displayed when the game is still in progress.
118 |
119 | ## Version 2.3.0
120 |
121 | * Fixed to support https changes on lichess.org.
122 |
123 | ## Version 2.2.1
124 |
125 | * Improved reliability of toggling 'computer analysis' before submitting pgn to lichess.
126 |
127 | ## Version 2.2.0
128 |
129 | * Fixed since chess.com change to 'switch to old chess.com' which now requires POST.
130 |
--------------------------------------------------------------------------------
/LICENCE.md:
--------------------------------------------------------------------------------
1 | Licensed under the [MIT license](http://www.opensource.org/licenses/MIT):
2 |
3 |
4 | Copyright (c) 2016-2022 Robert Anderson
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
7 | (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
14 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
15 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## A Chrome extension to open a chess.com game in lichess.org's analysis. ##
2 |
3 | This extension has the following features:
4 |
5 | * Uploads any finished game on chess.com, chess-db.com, chesstempo.com or chessgames.com for lichess analysis.
6 | * Works from the game archive as well as from finished live games.
7 | * Automatically toggles the 'computer analysis' check box on the lichess.org import page.
8 |
9 | The extension can be downloaded here: https://chrome.google.com/webstore/detail/bhjlkimpkkgkmfjlcfngmakenalgleap
10 |
11 | Thanks to Allan Rempel who created a similar plugin for chess.com v2.
12 |
13 | Icon CC-BY-SA 3.0, CBurnett (https://en.wikipedia.org/wiki/User:Cburnett)
14 | with adjustments by AntonSusi (https://commons.wikimedia.org/wiki/User:Antonsusi).
15 |
--------------------------------------------------------------------------------
/ext.crx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext.crx
--------------------------------------------------------------------------------
/ext.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDdrE3Yh9R+amY3
3 | AHhGPAXmVt6hQf/AOi+v8rEXG7w3Qvjy++w2XcOj4GLhWkFKyXwrBUNWC0eL3E57
4 | S+knCcp+x3nA+8DoMbzbvsw4sKXqBXvVO9uKaHrtQV3O0c5kb4LmXMpRJYzauSNR
5 | PgSrEJUShP72Ysi4v4LzmcVJ1H2Dy/gHTpBlpvkpmiWFrw8w1CNpSkxVsWgiW0D5
6 | ewxtykTu5mKNMOKNwu8H8QNFwgJc6iyb8/OsqAWWILhfC7IDVy8tN0S7FjYNp85K
7 | AXqAuSaogOHdn3ylCEVRXqL99KtMBowxMScBJX8KZA35CXH8uNUvSEn/sSZXkCCY
8 | i5YcFDG3AgMBAAECggEAE5X6SNPzh/nhryFo/xelk80AHbJlpPffJ8YjNH38Wsud
9 | kGaG3+TX+N5GDlA5raBwyqJL6UnU1/wuqQEziAH69MmuLclwqXNfkvDgPXAKMMus
10 | PdJsmuWRWu4oGjJ6cHBT2gO/0nylXdv2zWJT6kNsUHcUyfM/dedh7CEdh+Dw+Bh+
11 | 1h4ekuNTDn3Moaeztys3gmJmORHuiMpYdKmeaXUHP0tIDOego5dim/tnhhFBHhho
12 | EVDnI6Ddr0WYthuOdPuf/MrKeTxDtHaVPgzr/rv8/icEf568s6yAFRPhvrJ4RsIZ
13 | 7Gg7Yv+F/0Mb9z51wEdqn38rohGRrxcXqyKbAXAD5QKBgQD8k4+6w7Qe8+t+MuOE
14 | hYKo2pCo91WIy6rU7iX1s9COAZRw6FA+sFaPWUa4gFt2iA4LK0oDde8sSpEzztlK
15 | M1geYxcRAGBqLAhttqtrz5QTSLC65eRQRc0Edr4+COJPQnGO1+1LCTXr80CeQyz5
16 | 9QuW+MDhptarivdb7nw4KMYWZQKBgQDgrYIaZscQghWGkMkMrOmv5JBGTqKgX48C
17 | n9TlyEIORb1QzHAZyU56i8KyKIIDx+IR2JqIc2Dg5Kuz4aSCco3dxkRmCh+d04G5
18 | oaGFvlekbBS85qfRK4S94J5eWCjix81qhpiNo8NonRz4uYiww24/Y28FFZQV7R+T
19 | g7IIYR9n6wKBgC4W4zhqc9jeG8/oi1noXwJe99zNXV9cAu1eE7E1Qc5X/XVo/xOh
20 | a/o2iVArpAUKKL3jBVuCTsWfScXRbhc7LU5GOLRShEV7iYIzvi4rL9MhBZblUndP
21 | dWzmGisJxfo+nqg5QMTbhmpq9hSrH27xR08iT1gd8LhW4HJ3H1XEIvl9AoGBAN6Q
22 | AglVNmxL8DbUxdQglXz/1UtQKhjjkC7xVVwp/AVXYCnh2kow9+S8/aiuJ9zG7FLx
23 | VmNEp/sfilcudmAiShYeiTLrZFZbZm4UhoSOAROHXSOi+SpjCaNuFnMusZG0iu+z
24 | VPs59iBzQnfAkn9HmLaCMT/AGGl/83+VPY6/ZvTxAoGAf0wQ+kb6n1zlEbp/6wSQ
25 | yEYLSnsBI3C+tNFXhoZRdvZnlOiECqiJQUCM07bseVAK4M4Mah0exAaLxz3EGJhF
26 | TMjpZx8Ntj61hRvTpoePfWscCEtTBff57mTVCgr8uYCLjLm/tLKGWsrDMFjjJ/qm
27 | r4ilncxs09C4K4gJhxZnARU=
28 | -----END PRIVATE KEY-----
29 |
--------------------------------------------------------------------------------
/ext/_locales/en/messages.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": {
3 | "description": "A short description of the extension",
4 | "message": "Opens PGN of a Chess.com (v3) game in lichess.org analysis"
5 | },
6 | "locale": {
7 | "description": "2-letter language code (excluding subvariant)",
8 | "message": "en"
9 | },
10 | "name": {
11 | "description": "Extension name",
12 | "message": "Chess.com (v3) Analysis"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ext/css/getpgn.css:
--------------------------------------------------------------------------------
1 | .popuptoast {
2 | width:200px;
3 | height:20px;
4 | height:auto;
5 | position:absolute;
6 | left:50%;
7 | margin-left:-100px;
8 | top:40px;
9 | background-color: #C66666;
10 | color: #F0F0F0;
11 | font-family: Calibri;
12 | font-size: 20px;
13 | padding:10px;
14 | text-align:center;
15 | border-radius: 2px;
16 | -webkit-box-shadow: 0px 0px 24px -1px rgba(56, 56, 56, 1);
17 | -moz-box-shadow: 0px 0px 24px -1px rgba(56, 56, 56, 1);
18 | box-shadow: 0px 0px 24px -1px rgba(56, 56, 56, 1);
19 | }
--------------------------------------------------------------------------------
/ext/icons/generatePgnsFromSvg.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # To regenerate the icons. The CLI for Inkspace needs full paths.
4 |
5 | for x in 16 32 48 64 128 256 512
6 | do
7 | inkscape --export-png /Users/ra/Projects/github/chessChrome/ext/icons/knight${x}.png -w ${x} /Users/ra/Projects/github/chessChrome/ext/icons/knight.svg
8 | done
9 |
--------------------------------------------------------------------------------
/ext/icons/knight.svg:
--------------------------------------------------------------------------------
1 |
2 |
81 |
--------------------------------------------------------------------------------
/ext/icons/knight128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext/icons/knight128.png
--------------------------------------------------------------------------------
/ext/icons/knight16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext/icons/knight16.png
--------------------------------------------------------------------------------
/ext/icons/knight256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext/icons/knight256.png
--------------------------------------------------------------------------------
/ext/icons/knight32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext/icons/knight32.png
--------------------------------------------------------------------------------
/ext/icons/knight48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext/icons/knight48.png
--------------------------------------------------------------------------------
/ext/icons/knight512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext/icons/knight512.png
--------------------------------------------------------------------------------
/ext/icons/knight64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/b3e9fbc6efffaacbb3b3d8a7fa12adc6e93717ff/ext/icons/knight64.png
--------------------------------------------------------------------------------
/ext/js/jquery-3.5.1.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */
2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"