BEB Experimental versions

BEB Experimental versions

[1] See also BEBBookmarklet Editor Bookmarklet.

BEB Version 2.0 with packing support (2009-01-27)

[2] data:text/html;charset=utf-8,%3C!DOCTYPE%20HTML%3E%3Chtml%20lang=en%3E%0A%3Chead%3E%0A%3Ctitle%3EBEB%20%26mdash;%20Bookmarklet%20Editor%20Bookmarklet%3C/title%3E%0A%3Cstyle%3E%0Ahtml,%20body,%20div,%20p%20%7B%0A%20%20display:%20block;%0A%20%20position:%20static;%0A%20%20margin:%200;%0A%20%20border-width:%200;%0A%20%20padding:%200;%0A%20%20text-indent:%200;%0A%7D%0A%0Abody%20%7B%0A%20%20position:%20absolute;%0A%20%20top:%200;%0A%20%20right:%200;%0A%20%20bottom:%200;%0A%20%20left:%200;%0A%20%20margin:%201em;%0A%7D%0A%0A%23decoded-section%20%7B%0A%20%20position:%20absolute;%0A%20%20top:%200;%0A%20%20right:%200;%0A%20%20bottom:%205em;%0A%20%20left:%200;%0A%7D%0A%0A%23decoded-section%20%3E%20p%20%7B%0A%20%20width:%20100%25;%0A%20%20height:%20100%25;%0A%20%20text-indent:%200;%0A%7D%0A%0A%23decoded-url-text%20%7B%0A%20%20display:%20block;%0A%20%20margin-left:%20auto;%0A%20%20margin-right:%20auto;%0A%20%20width:%20100%25;%0A%20%20height:%20100%25;%0A%20%20-moz-box-sizing:%20border-box;%0A%20%20-webkit-box-sizing:%20border-box;%0A%20%20-ms-box-sizing:%20border-box;%0A%20%20box-sizing:%20border-box;%0A%7D%0A%0A%23encoded-section%20%7B%0A%20%20display:%20block;%0A%20%20position:%20absolute;%0A%20%20right:%200;%0A%20%20bottom:%200;%0A%20%20left:%200;%0A%20%20height:%205em;%0A%7D%0A%0A%23encoded-section%20textarea%20%7B%0A%20%20display:%20inline;%0A%20%20width:%2080%25;%0A%20%20height:%201em;%0A%7D%0A%0A%23encoded-section%20textarea%5Bdata-modified%5D%20%7B%0A%20%20color:%20black;%0A%20%20font-weight:%20bolder;%0A%7D%0A%3C/style%3E%0A%3Cscript%3E%0A%20%20document.isModified%20=%20false;%0A%0A%20%20var%20updateTimer%20=%200;%0A%20%20function%20scheduleToUpdateEncodedURL%20%28%29%20%7B%0A%20%20%20%20if%20%28updateTimer%29%20%7B%0A%20%20%20%20%20%20clearTimeout%20%28updateTimer%29;%0A%20%20%20%20%7D%0A%20%20%20%20updateTimer%20=%20setTimeout%20%28updateEncodedURL,%201000%29;%0A%20%20%7D%20//%20scheduleToUpdateEncodedURL%0A%0A%20%20function%20updateEncodedURL%20%28%29%20%7B%0A%20%20%20%20var%20url%20=%20document.getElementById%20%28%27decoded-url-text%27%29.value;%0A%20%20%20%20var%20packedURL;%0A%20%20%20%20if%20%28url.match%20%28/%5Ejavascript:/i%29%29%20%7B%0A%20%20%20%20%20%20var%20code%20=%20url.substring%20%2811%29;%0A%20%20%20%20%20%20url%20=%20%27javascript:%27%20+%20encodeURIComponent%20%28code%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%27/g,%20%27%2527%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%28/g,%20%27%2528%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%29/g,%20%27%2529%27%29;%0A%20%20%20%20%20%20code%20=%20%28new%20Packer%29.pack%0A%20%20%20%20%20%20%20%20%20%20%28code,%0A%20%20%20%20%20%20%20%20%20%20%20document.getElementById%20%28%27encoded-url-packed-shrink%27%29.checked,%0A%20%20%20%20%20%20%20%20%20%20%20document.getElementById%20%28%27encoded-url-packed-base62%27%29.checked%29;%0A%20%20%20%20%20%20packedURL%20=%20%27javascript:%27%20+%20encodeURIComponent%20%28code%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%27/g,%20%27%2527%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%28/g,%20%27%2528%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%29/g,%20%27%2529%27%29;%0A%20%20%20%20%7D%20else%20if%20%28url.match%20%28/%5Edata:/i%29%29%20%7B%0A%20%20%20%20%20%20url%20=%20%27data:%27%20+%20encodeURI%20%28url.substring%20%285%29%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%23/g,%20%27%2523%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%26/g,%20%27%2526%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%27/g,%20%27%2527%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%28/g,%20%27%2528%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%29/g,%20%27%2529%27%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.replace%20%28/%5C%3F/g,%20%27%253F%27%29;%0A%20%20%20%20%20%20packedURL%20=%20url;%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20url%20=%20encodeURI%20%28url%29;%0A%20%20%20%20%20%20packedURL%20=%20url;%0A%20%20%20%20%7D%0A%0A%20%20%20%20var%20encoded%20=%20document.getElementById%20%28%27encoded-url-text%27%29;%0A%20%20%20%20encoded.value%20=%20url;%0A%20%20%20%20encoded.removeAttribute%20%28%27data-modified%27,%20%27%27%29;%0A%0A%20%20%20%20var%20link%20=%20document.getElementById%20%28%27encoded-url-link%27%29;%0A%20%20%20%20link.href%20=%20url;%0A%20%20%20%20link.title%20=%20url.length%20+%20%27%20characters%27;%0A%0A%20%20%20%20link%20=%20document.getElementById%20%28%27encoded-url-link-packed%27%29;%0A%20%20%20%20link.href%20=%20packedURL;%0A%20%20%20%20link.title%20=%20packedURL.length%20+%20%27%20characters%27;%0A%0A%20%20%20%20document.isModified%20=%20true;%0A%20%20%7D%20//%20updateEncodedURL%0A%0A%20%20function%20editEncodedURL%20%28%29%20%7B%0A%20%20%20%20if%20%28document.isModified%29%20%7B%0A%20%20%20%20%20%20if%20%28!confirm%20%28%27The%20code%20is%20modified.%20%20Continue%20anyway%3F%27%29%29%20%7B%0A%20%20%20%20%20%20%20%20return;%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20updateDecodedURL%20%28%29;%0A%20%20%20%20updateEncodedURL%20%28%29;%0A%20%20%20%20document.isModified%20=%20false;%0A%20%20%7D%20//%20editEncodedURL%0A%0A%20%20function%20updateDecodedURL%20%28%29%20%7B%0A%20%20%20%20var%20encoded%20=%20document.getElementById%20%28%27encoded-url-text%27%29;%0A%20%20%20%20document.getElementById%20%28%27decoded-url-text%27%29.value%20=%20decodeURIComponent%20%28encoded.value%29;%0A%20%20%20%20encoded.removeAttribute%20%28%27data-modified%27%29;%0A%20%20%7D%20//%20updateDecodedURL%0A%0A%20%20function%20encodedURLModified%20%28%29%20%7B%0A%20%20%20%20document.getElementById%20%28%27encoded-url-text%27%29.setAttribute%20%28%27data-modified%27,%20%27%27%29;%0A%20%20%7D%20//%20encodedURLModified%0A%3C/script%3E%0A%3C/head%3E%0A%3Cbody%20onbeforeunload=%22if%20%28document.isModified%29%20event.returnValue%20=%20%27Modified%27%22%3E%0A%0A%3Cdiv%20class=section%20id=decoded-section%3E%0A%3Cp%3E%3Ctextarea%20id=decoded-url-text%20onchange=%22%20scheduleToUpdateEncodedURL%20%28%29%20%22%20onkeypress=%22%20scheduleToUpdateEncodedURL%20%28%29%20%22%3Ejavascript:%0A%3C/textarea%3E%0A%3C/div%3E%0A%0A%3Cdiv%20class=section%20id=encoded-section%3E%0A%3Cp%3E%3Ca%20href=%22data:,%22%20id=encoded-url-link%3EURL%3C/a%3E:%20%0A%3Ctextarea%20id=encoded-url-text%20onchange=%22%20%20if%20%28!document.isModified%29%20updateDecodedURL%20%28%29;%20else%20encodedURLModified%20%28%29%20%22%20onkeypress=%22%20encodedURLModified%20%28%29%20%22%3E%3C/textarea%3E%0A%3Cbutton%20type=button%20onclick=%22%20editEncodedURL%20%28%29%20%22%3EEdit%3C/button%3E%0A%0A%3Cp%3E%3Ca%20href=%22data:,%22%20id=encoded-url-link-packed%3EPacked%20URL%3C/a%3E%0A%28%3Clabel%3E%3Cinput%20type=checkbox%20id=encoded-url-packed-base62%20onclick=%22%20scheduleToUpdateEncodedURL%20%28%29%20%22%3E%20Base62%3C/label%3E,%0A%3Clabel%3E%3Cinput%20type=checkbox%20id=encoded-url-packed-shrink%20onclick=%22%20scheduleToUpdateEncodedURL%20%28%29%20%22%20checked%3E%20Shrink%20variables%3C/label%3E%29%0A%0A%3Cp%3E%3Ca%20href=%22http://suika.fam.cx/%257Ewakaba/wiki/sw/n/BEB%22%3EBEB%3C/a%3E%20Version%202.0%20with%20experimental%20%3Ca%20href=%22http://dean.edwards.name/packer/%22%3Epacking%3C/a%3E%20support%20%0A%28%3Ctime%3E2009-01-27%3C/time%3E%29%0A%3C/div%3E%0A%0A%3C!--%0A/*%20*****%20BEGIN%20LICENSE%20BLOCK%20*****%0A%20*%20Copyright%202005-2009%20Wakaba%20%3Cw@suika.fam.cx%3E.%20%20All%20rights%20reserved.%0A%20*%0A%20*%20This%20program%20is%20free%20software;%20you%20can%20redistribute%20it%20and/or%20%0A%20*%20modify%20it%20under%20the%20same%20terms%20as%20Perl%20itself.%0A%20*%0A%20*%20Alternatively,%20the%20contents%20of%20this%20file%20may%20be%20used%20%0A%20*%20under%20the%20following%20terms%20%28the%20%22MPL/GPL/LGPL%22%29,%20%0A%20*%20in%20which%20case%20the%20provisions%20of%20the%20MPL/GPL/LGPL%20are%20applicable%20instead%0A%20*%20of%20those%20above.%20If%20you%20wish%20to%20allow%20use%20of%20your%20version%20of%20this%20file%20only%0A%20*%20under%20the%20terms%20of%20the%20MPL/GPL/LGPL,%20and%20not%20to%20allow%20others%20to%0A%20*%20use%20your%20version%20of%20this%20file%20under%20the%20terms%20of%20the%20Perl,%20indicate%20your%0A%20*%20decision%20by%20deleting%20the%20provisions%20above%20and%20replace%20them%20with%20the%20notice%0A%20*%20and%20other%20provisions%20required%20by%20the%20MPL/GPL/LGPL.%20If%20you%20do%20not%20delete%0A%20*%20the%20provisions%20above,%20a%20recipient%20may%20use%20your%20version%20of%20this%20file%20under%0A%20*%20the%20terms%20of%20any%20one%20of%20the%20Perl%20or%20the%20MPL/GPL/LGPL.%0A%20*%0A%20*%20%22MPL/GPL/LGPL%22:%0A%20*%0A%20*%20Version:%20MPL%201.1/GPL%202.0/LGPL%202.1%0A%20*%0A%20*%20The%20contents%20of%20this%20file%20are%20subject%20to%20the%20Mozilla%20Public%20License%20Version%0A%20*%201.1%20%28the%20%22License%22%29;%20you%20may%20not%20use%20this%20file%20except%20in%20compliance%20with%0A%20*%20the%20License.%20You%20may%20obtain%20a%20copy%20of%20the%20License%20at%0A%20*%20%3Chttp://www.mozilla.org/MPL/%3E%0A%20*%0A%20*%20Software%20distributed%20under%20the%20License%20is%20distributed%20on%20an%20%22AS%20IS%22%20basis,%0A%20*%20WITHOUT%20WARRANTY%20OF%20ANY%20KIND,%20either%20express%20or%20implied.%20See%20the%20License%0A%20*%20for%20the%20specific%20language%20governing%20rights%20and%20limitations%20under%20the%0A%20*%20License.%0A%20*%0A%20*%20The%20Original%20Code%20is%20Bookmarklet%20Editor%20code.%0A%20*%0A%20*%20The%20Initial%20Developer%20of%20the%20Original%20Code%20is%20Wakaba.%0A%20*%20Portions%20created%20by%20the%20Initial%20Developer%20are%20Copyright%20%28C%29%202005%0A%20*%20the%20Initial%20Developer.%20All%20Rights%20Reserved.%0A%20*%0A%20*%20Contributor%28s%29:%0A%20*%20%20%20Wakaba%20%3Cw@suika.fam.cx%3E%0A%20*%0A%20*%20Alternatively,%20the%20contents%20of%20this%20file%20may%20be%20used%20under%20the%20terms%20of%0A%20*%20either%20the%20GNU%20General%20Public%20License%20Version%202%20or%20later%20%28the%20%22GPL%22%29,%20or%0A%20*%20the%20GNU%20Lesser%20General%20Public%20License%20Version%202.1%20or%20later%20%28the%20%22LGPL%22%29,%0A%20*%20in%20which%20case%20the%20provisions%20of%20the%20GPL%20or%20the%20LGPL%20are%20applicable%20instead%0A%20*%20of%20those%20above.%20If%20you%20wish%20to%20allow%20use%20of%20your%20version%20of%20this%20file%20only%0A%20*%20under%20the%20terms%20of%20either%20the%20GPL%20or%20the%20LGPL,%20and%20not%20to%20allow%20others%20to%0A%20*%20use%20your%20version%20of%20this%20file%20under%20the%20terms%20of%20the%20MPL,%20indicate%20your%0A%20*%20decision%20by%20deleting%20the%20provisions%20above%20and%20replace%20them%20with%20the%20notice%0A%20*%20and%20other%20provisions%20required%20by%20the%20LGPL%20or%20the%20GPL.%20If%20you%20do%20not%20delete%0A%20*%20the%20provisions%20above,%20a%20recipient%20may%20use%20your%20version%20of%20this%20file%20under%0A%20*%20the%20terms%20of%20any%20one%20of%20the%20MPL,%20the%20GPL%20or%20the%20LGPL.%0A%20*%0A%20*%20*****%20END%20LICENSE%20BLOCK%20*****%20*/%0A--%3E%0A%0A%3Cscript%3E%0A//%20timestamp:%20Mon,%2023%20Jul%202007%2007:37:56%0A/*%0A%09base2%20-%20copyright%202007,%20Dean%20Edwards%0A%09http://code.google.com/p/base2/%0A%09http://www.opensource.org/licenses/mit-license%0A*/%0A%0Avar%20base2%20=%20%7B%0A%09name:%20%20%20%20%22base2%22,%0A%09version:%20%220.9%20%28alpha%29%22,%0A%09%0A%09global:%20this,%20//%20the%20window%20object%20in%20a%20browser%20environment%0A%09%09%0A%09//%20this%20is%20defined%20here%20because%20it%20must%20be%20defined%20in%20the%20global%20scope%0A%09detect:%20new%20function%28_%29%20%7B%09%0A%09%09//%20Two%20types%20of%20detection:%0A%09%09//%20%201.%20Object%20detection%0A%09%09//%20%20%20%20%20e.g.%20detect%28%22%28java%29%22%29;%0A%09%09//%20%20%20%20%20e.g.%20detect%28%22!%28document.addEventListener%29%22%29;%0A%09%09//%20%202.%20Platform%20detection%20%28browser%20sniffing%29%0A%09%09//%20%20%20%20%20e.g.%20detect%28%22MSIE%22%29;%0A%09%09//%20%20%20%20%20e.g.%20detect%28%22MSIE%7Copera%22%29;%0A%09%09%09%09%0A%09%09var%20global%20=%20_;%0A%09%09var%20jscript/*@cc_on=@_jscript_version@*/;%20//%20http://dean.edwards.name/weblog/2007/03/sniff/%23comment85164%0A%09%09var%20java%20=%20_.java;%0A%09%09%0A%09%09if%20%28_.navigator%29%20%7B%0A%09%09%09var%20element%20=%20document.createElement%28%22span%22%29;%0A%09%09%09var%20platform%20=%20navigator.platform%20+%20%22%20%22%20+%20navigator.userAgent;%0A%09%09%09//%20Fix%20opera%27s%20%28and%20others%29%20user%20agent%20string.%0A%09%09%09if%20%28!jscript%29%20platform%20=%20platform.replace%28/MSIE%5Cs%5B%5Cd.%5D+/,%20%22%22%29;%0A%09%09%09//%20Close%20up%20the%20space%20between%20name%20and%20version%20number.%0A%09%09%09//%20%20e.g.%20MSIE%206%20-%3E%20MSIE6%0A%09%09%09platform%20=%20platform.replace%28/%28%5Ba-z%5D%29%5B%5Cs%5C/%5D%28%5Cd%29/gi,%20%22$1$2%22%29;%0A%09%09%09java%20=%20navigator.javaEnabled%28%29%20%26%26%20java;%0A%09%09%7D%0A%09%09%0A%09%09return%20function%28test%29%20%7B%0A%09%09%09var%20r%20=%20false;%0A%09%09%09var%20not%20=%20test.charAt%280%29%20==%20%22!%22;%0A%09%09%09if%20%28not%29%20test%20=%20test.slice%281%29;%0A%09%09%09test%20=%20test.replace%28/%5E%28%5B%5E%5C%28%5D.*%29$/,%20%22/%28$1%29/i.test%28platform%29%22%29;%0A%09%09%09try%20%7B%0A%09%09%09%09eval%28%22r=!!%22%20+%20test%29;%0A%09%09%09%7D%20catch%20%28error%29%20%7B%0A%09%09%09%09//%20the%20test%20failed%0A%09%09%09%7D%0A%09%09%09return%20!!%28not%20%5E%20r%29;%0A%09%09%7D;%0A%09%7D%28this%29%0A%7D;%0A%0Anew%20function%28_%29%20%7B%20////////////////////%20%20BEGIN:%20CLOSURE%20%20////////////////////%0A%0A//%20=========================================================================%0A//%20base2/lang/header.js%0A//%20=========================================================================%0A%0Avar%20detect%20=%20base2.detect;%0Avar%20slice%20=%20Array.slice%20%7C%7C%20function%28array%29%20%7B%0A%09//%20Slice%20an%20array-like%20object.%0A%09return%20_slice.apply%28array,%20_slice.call%28arguments,%201%29%29;%0A%7D;%0A%0A//%20private%0Avar%20_ID%20=%201;%0Avar%20_PRIVATE%20=%20/%5E%5B_$%5D/;%0Avar%20_FORMAT%20=%20/%25%28%5B1-9%5D%29/g;%0Avar%20_LTRIM%20=%20/%5E%5Cs%5Cs*/;%0Avar%20_RTRIM%20=%20/%5Cs%5Cs*$/;%0Avar%20_RESCAPE%20=%20/%28%5B%5C/%28%29%5B%5C%5D%7B%7D%7C*+-.,%5E$%3F%5C%5C%5D%29/g;%20%20%20%20%20%20%20%20%20%20%20//%20safe%20regular%20expressions%0Avar%20_BASE%20=%20/eval/.test%28detect%29%20%3F%20/%5Cbbase%5Cb/%20:%20/./;%20%20%20//%20some%20platforms%20don%27t%20allow%20decompilation%0Avar%20_HIDDEN%20=%20%5B%22constructor%22,%20%22toString%22,%20%22valueOf%22%5D;%20//%20only%20override%20these%20when%20prototyping%0Avar%20_REGEXP_STRING%20=%20String%28new%20RegExp%29;%0Avar%20_slice%20=%20Array.prototype.slice;%0Avar%20_Function_forEach%20=%20_get_Function_forEach%28%29;%20%20%20%20%20%20//%20curse%20you%20Safari!%0A%0A//%20=========================================================================%0A//%20base2/Base.js%0A//%20=========================================================================%0A%0A//%20http://dean.edwards.name/weblog/2006/03/base/%0A%0Afunction%20Base%28%29%20%7B%0A%09if%20%28this.constructor%20==%20Base%29%20%7B%0A%09%09this.extend%28arguments%5B0%5D%29;%0A%09%7D%20else%20%7B%0A%09%09return%20extend%28arguments%5B0%5D,%20Base.prototype%29;%0A%09%7D%0A%7D;%0A%0ABase.prototype%20=%20%7B%0A%09constructor:%20Base,%0A%0A%09base:%20function%28%29%20%7B%0A%09%09//%20Call%20this%20method%20from%20any%20other%20method%20to%20invoke%20the%20current%20method%27s%20ancestor%20%28super%29.%0A%09%7D,%0A%09%0A%09extend:%20delegate%28extend%29%09%0A%7D;%0A%0ABase.ancestor%20=%20Object;%0A%0ABase.ancestorOf%20=%20delegate%28_ancestorOf%29;%0A%0ABase.base%20=%20Base.prototype.base;%0A%0ABase.extend%20=%20function%28_instance,%20_static%29%20%7B%0A%09//%20Build%20the%20prototype.%0A%09base2.__prototyping%20=%20true;%0A%09var%20_prototype%20=%20new%20this;%0A%09extend%28_prototype,%20_instance%29;%0A%09delete%20base2.__prototyping;%0A%09%0A%09//%20Create%20the%20wrapper%20for%20the%20constructor%20function.%0A%09var%20_constructor%20=%20_prototype.constructor;%0A%09function%20klass%28%29%20%7B%0A%09%09if%20%28!base2.__prototyping%29%20%7B%20//%20Don%27t%20call%20the%20constructor%20function%20when%20prototyping.%0A%09%09%09if%20%28this.constructor%20==%20arguments.callee%20%7C%7C%20this.__constructing%29%20%7B%0A%09%09%09%09//%20Instantiation.%0A%09%09%09%09this.__constructing%20=%20true;%0A%09%09%09%09_constructor.apply%28this,%20arguments%29;%0A%09%09%09%09delete%20this.__constructing;%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09//%20Cast.%0A%09%09%09%09return%20extend%28arguments%5B0%5D,%20_prototype%29;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D;%0A%09_prototype.constructor%20=%20klass;%0A%09%0A%09//%20Build%20the%20static%20interface.%0A%09for%20%28var%20i%20in%20Base%29%20klass%5Bi%5D%20=%20this%5Bi%5D;%0A%09klass.ancestor%20=%20this;%0A%09klass.base%20=%20Undefined;%0A%09klass.init%20=%20Undefined;%0A%09klass.prototype%20=%20_prototype;%0A%09extend%28klass,%20_static%29;%0A%09klass.init%28%29;%0A%09return%20klass;%0A%7D;%0A%09%0ABase.forEach%20=%20delegate%28_Function_forEach%29,%0A%0ABase.implement%20=%20function%28source%29%20%7B%0A%09if%20%28instanceOf%28source,%20Function%29%29%20%7B%0A%09%09//%20If%20we%20are%20implementing%20another%20classs/module%20then%20we%20can%20use%0A%09%09//%20casting%20to%20apply%20the%20interface.%0A%09%09if%20%28Base.ancestorOf%28source%29%29%20%7B%0A%09%09%09source%28this.prototype%29;%0A%09%09%7D%0A%09%7D%20else%20%7B%0A%09%09//%20Add%20the%20interface%20using%20the%20extend%28%29%20function.%0A%09%09extend%28this.prototype,%20source%29;%0A%09%7D%0A%09return%20this;%0A%7D;%0A%0ABase.init%20=%20Undefined;%0A%0A//%20=========================================================================%0A//%20base2/Namespace.js%0A//%20=========================================================================%0A%0Avar%20Namespace%20=%20Base.extend%28%7B%0A%09constructor:%20function%28_private,%20_public%29%20%7B%0A%09%09this.extend%28_public%29;%0A%09%09%0A%09%09//%20Initialise.%0A%09%09if%20%28typeof%20this.init%20==%20%22function%22%29%20this.init%28%29;%0A%09%09%0A%09%09if%20%28this.name%20!=%20%22base2%22%29%20%7B%0A%09%09%09base2.addName%28this.name,%20this%29;%0A%09%09%09this.namespace%20=%20format%28%22var%20%251=base2.%251;%22,%20this.name%29;%0A%09%09%7D%0A%09%09%0A%09%09var%20LIST%20=%20/%5B%5E%5Cs,%5D+/g;%20//%20pattern%20for%20comma%20separated%20list%0A%09%09%0A%09%09//%20This%20string%20should%20be%20evaluated%20immediately%20after%20creating%20a%20Namespace%20object.%0A%09%09_private.imports%20=%20Array2.reduce%28this.imports.match%28LIST%29,%20function%28namespace,%20name%29%20%7B%0A%09%09%09assert%28base2%5Bname%5D,%20format%28%22Namespace%20not%20found:%20%27%251%27.%22,%20name%29%29;%0A%09%09%09return%20namespace%20+=%20base2%5Bname%5D.namespace;%0A%09%09%7D,%20base2.namespace%29;%0A%09%09%0A%09%09//%20This%20string%20should%20be%20evaluated%20after%20you%20have%20created%20all%20of%20the%20objects%0A%09%09//%20that%20are%20being%20exported.%0A%09%09_private.exports%20=%20Array2.reduce%28this.exports.match%28LIST%29,%20function%28namespace,%20name%29%20%7B%0A%09%09%09this.namespace%20+=%20format%28%22var%20%252=%251.%252;%22,%20this.name,%20name%29;%0A%09%09%09return%20namespace%20+=%20format%28%22if%28!%251.%252%29%251.%252=%252;%22,%20this.name,%20name%29;%0A%09%09%7D,%20%22%22,%20this%29;%0A%09%7D,%0A%0A%09exports:%20%22%22,%0A%09imports:%20%22%22,%0A%09namespace:%20%22%22,%0A%09name:%20%22%22,%0A%09%0A%09addName:%20function%28name,%20value%29%20%7B%0A%09%09this%5Bname%5D%20=%20value;%0A%09%09this.exports%20+=%20%22,%22%20+%20name;%0A%09%09this.namespace%20+=%20format%28%22var%20%251=%252.%251;%22,%20name,%20this.name%29;%0A%09%7D%0A%7D%29;%0A%0A%0A//%20=========================================================================%0A//%20base2/Abstract.js%0A//%20=========================================================================%0A%0Avar%20Abstract%20=%20Base.extend%28%7B%0A%09constructor:%20function%28%29%20%7B%0A%09%09throw%20new%20TypeError%28%22Class%20cannot%20be%20instantiated.%22%29;%0A%09%7D%0A%7D%29;%0A%0A//%20=========================================================================%0A//%20base2/Module.js%0A//%20=========================================================================%0A%0Avar%20Module%20=%20Abstract.extend%28null,%20%7B%0A%09extend:%20function%28_interface,%20_static%29%20%7B%0A%09%09//%20Extend%20a%20module%20to%20create%20a%20new%20module.%0A%09%09var%20module%20=%20this.base%28%29;%0A%09%09//%20Inherit%20module%20methods.%0A%09%09forEach%20%28this,%20function%28method,%20name%29%20%7B%0A%09%09%09if%20%28!Module%5Bname%5D%20%26%26%20typeof%20method%20==%20%22function%22%20%26%26%20!_PRIVATE.test%28name%29%29%20%7B%0A%09%09%09%09extend%28module,%20name,%20method%29;%0A%09%09%09%7D%0A%09%09%7D%29;%0A%09%09//%20Iplement%20module%20%28instance%20AND%20static%29%20methods.%0A%09%09module.implement%28_interface%29;%0A%09%09//%20Implement%20static%20properties%20and%20methods.%0A%09%09extend%28module,%20_static%29;%0A%09%09//%20Make%20the%20submarine%20noises%20Larry!%0A%09%09module.init%28%29;%0A%09%09return%20module;%0A%09%7D,%0A%09%0A%09implement:%20function%28_interface%29%20%7B%0A%09%09//%20Implement%20an%20interface%20on%20BOTH%20the%20instance%20and%20static%20interfaces.%0A%09%09var%20module%20=%20this;%0A%09%09if%20%28typeof%20_interface%20==%20%22function%22%29%20%7B%0A%09%09%09module.base%28_interface%29;%0A%09%09%09//%20If%20we%20are%20implementing%20another%20Module%20then%20add%20its%20static%20methods.%0A%09%09%09if%20%28Module.ancestorOf%28_interface%29%29%20%7B%0A%09%09%09%09forEach%20%28_interface,%20function%28method,%20name%29%20%7B%0A%09%09%09%09%09if%20%28!Module%5Bname%5D%20%26%26%20typeof%20method%20==%20%22function%22%20%26%26%20!_PRIVATE.test%28name%29%29%20%7B%0A%09%09%09%09%09%09extend%28module,%20name,%20method%29;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%29;%0A%09%09%09%7D%0A%09%09%7D%20else%20%7B%0A%09%09%09//%20Create%20the%20instance%20interface.%0A%09%09%09_Function_forEach%20%28Object,%20_interface,%20function%28source,%20name%29%20%7B%0A%09%09%09%09if%20%28name.charAt%280%29%20==%20%22@%22%29%20%7B%20//%20object%20detection%0A%09%09%09%09%09if%20%28detect%28name.slice%281%29%29%29%20%7B%0A%09%09%09%09%09%09forEach%20%28source,%20arguments.callee%29;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%20else%20if%20%28!Module%5Bname%5D%20%26%26%20typeof%20source%20==%20%22function%22%29%20%7B%0A%09%09%09%09%09function%20_module%28%29%20%7B%20//%20Late%20binding.%0A%09%09%09%09%09%09return%20module%5Bname%5D.apply%28module,%20%5Bthis%5D.concat%28slice%28arguments%29%29%29;%0A%09%09%09%09%09%7D;%0A%09%09%09%09%09_module._base%20=%20_BASE.test%28source%29;%0A%09%09%09%09%09extend%28module.prototype,%20name,%20_module%29;%0A%09%09%09%09%7D%0A%09%09%09%7D%29;%0A%09%09%09//%20Add%20the%20static%20interface.%0A%09%09%09extend%28module,%20_interface%29;%0A%09%09%7D%0A%09%09return%20module;%0A%09%7D%0A%7D%29;%0A%0A//%20=========================================================================%0A//%20base2/Enumerable.js%0A//%20=========================================================================%0A%0Avar%20Enumerable%20=%20Module.extend%28%7B%0A%09every:%20function%28object,%20test,%20context%29%20%7B%0A%09%09var%20result%20=%20true;%0A%09%09try%20%7B%0A%09%09%09this.forEach%20%28object,%20function%28value,%20key%29%20%7B%0A%09%09%09%09result%20=%20test.call%28context,%20value,%20key,%20object%29;%0A%09%09%09%09if%20%28!result%29%20throw%20StopIteration;%0A%09%09%09%7D%29;%0A%09%09%7D%20catch%20%28error%29%20%7B%0A%09%09%09if%20%28error%20!=%20StopIteration%29%20throw%20error;%0A%09%09%7D%0A%09%09return%20!!result;%20//%20cast%20to%20boolean%0A%09%7D,%0A%09%0A%09filter:%20function%28object,%20test,%20context%29%20%7B%0A%09%09var%20i%20=%200;%0A%09%09return%20this.reduce%28object,%20function%28result,%20value,%20key%29%20%7B%0A%09%09%09if%20%28test.call%28context,%20value,%20key,%20object%29%29%20%7B%0A%09%09%09%09result%5Bi++%5D%20=%20value;%0A%09%09%09%7D%0A%09%09%09return%20result;%0A%09%09%7D,%20%5B%5D%29;%0A%09%7D,%0A%09%0A%09invoke:%20function%28object,%20method%29%20%7B%0A%09%09//%20Apply%20a%20method%20to%20each%20item%20in%20the%20enumerated%20object.%0A%09%09var%20args%20=%20slice%28arguments,%202%29;%0A%09%09return%20this.map%28object,%20%28typeof%20method%20==%20%22function%22%29%20%3F%20function%28item%29%20%7B%0A%09%09%09if%20%28item%20!=%20null%29%20return%20method.apply%28item,%20args%29;%0A%09%09%7D%20:%20function%28item%29%20%7B%0A%09%09%09if%20%28item%20!=%20null%29%20return%20item%5Bmethod%5D.apply%28item,%20args%29;%0A%09%09%7D%29;%0A%09%7D,%0A%09%0A%09map:%20function%28object,%20block,%20context%29%20%7B%0A%09%09var%20result%20=%20%5B%5D,%20i%20=%200;%0A%09%09this.forEach%20%28object,%20function%28value,%20key%29%20%7B%0A%09%09%09result%5Bi++%5D%20=%20block.call%28context,%20value,%20key,%20object%29;%0A%09%09%7D%29;%0A%09%09return%20result;%0A%09%7D,%0A%09%0A%09pluck:%20function%28object,%20key%29%20%7B%0A%09%09return%20this.map%28object,%20function%28item%29%20%7B%0A%09%09%09if%20%28item%20!=%20null%29%20return%20item%5Bkey%5D;%0A%09%09%7D%29;%0A%09%7D,%0A%09%0A%09reduce:%20function%28object,%20block,%20result,%20context%29%20%7B%0A%09%09//-dean:%20test%20Mozilla%27s%20implementation%20with%20undefined%20values%0A%09%09var%20initialised%20=%20arguments.length%20%3E%202;%0A%09%09this.forEach%20%28object,%20function%28value,%20key%29%20%7B%0A%09%09%09if%20%28initialised%29%20%7B%20%0A%09%09%09%09result%20=%20block.call%28context,%20result,%20value,%20key,%20object%29;%0A%09%09%09%7D%20else%20%7B%20%0A%09%09%09%09result%20=%20value;%0A%09%09%09%09initialised%20=%20true;%0A%09%09%09%7D%0A%09%09%7D%29;%0A%09%09return%20result;%0A%09%7D,%0A%09%0A%09some:%20function%28object,%20test,%20context%29%20%7B%0A%09%09//return%20!this.every%28object,%20not%28test%29,%20context%29;%0A%09%09return%20!this.every%28object,%20function%28value,%20key%29%20%7B%0A%09%09%09return%20!test.call%28context,%20value,%20key,%20object%29;%0A%09%09%7D%29;%0A%09%7D%0A%7D,%20%7B%0A%09forEach:%20forEach%0A%7D%29;%0A%0A//%20=========================================================================%0A//%20base2/Hash.js%0A//%20=========================================================================%0A%0Avar%20_HASH%20=%20%22%23%22;%0A%0Avar%20Hash%20=%20Base.extend%28%7B%0A%09constructor:%20function%28values%29%20%7B%0A%09%09this.merge%28values%29;%0A%09%7D,%0A%0A%09copy:%20delegate%28copy%29,%0A%0A%09//%20Ancient%20browsers%20throw%20an%20error%20when%20we%20use%20%22in%22%20as%20an%20operator.%0A%09exists:%20function%28key%29%20%7B%0A%09%09/*@cc_on%20@*/%0A%09%09/*@if%20%28@_jscript_version%20%3C%205.5%29%0A%09%09%09return%20$Legacy.exists%28this,%20_HASH%20+%20key%29;%0A%09%09@else%20@*/%0A%09%09%09return%20_HASH%20+%20key%20in%20this;%0A%09%09/*@end%20@*/%0A%09%7D,%0A%0A%09fetch:%20function%28key%29%20%7B%0A%09%09return%20this%5B_HASH%20+%20key%5D;%0A%09%7D,%0A%0A%09forEach:%20function%28block,%20context%29%20%7B%0A%09%09for%20%28var%20key%20in%20this%29%20if%20%28key.charAt%280%29%20==%20_HASH%29%20%7B%0A%09%09%09block.call%28context,%20this%5Bkey%5D,%20key.slice%281%29,%20this%29;%0A%09%09%7D%0A%09%7D,%0A%0A%09merge:%20function%28values%29%20%7B%0A%09%09forEach%20%28arguments,%20function%28values%29%20%7B%0A%09%09%09forEach%20%28values,%20function%28value,%20key%29%20%7B%0A%09%09%09%09this.store%28key,%20value%29;%0A%09%09%09%7D,%20this%29;%0A%09%09%7D,%20this%29;%0A%09%09return%20this;%0A%09%7D,%0A%0A%09remove:%20function%28key%29%20%7B%0A%09%09var%20value%20=%20this%5B_HASH%20+%20key%5D;%0A%09%09delete%20this%5B_HASH%20+%20key%5D;%0A%09%09return%20value;%0A%09%7D,%0A%0A%09store:%20function%28key,%20value%29%20%7B%0A%09%09if%20%28arguments.length%20==%201%29%20value%20=%20key;%0A%09%09//%20Create%20the%20new%20entry%20%28or%20overwrite%20the%20old%20entry%29.%0A%09%09return%20this%5B_HASH%20+%20key%5D%20=%20value;%0A%09%7D,%0A%0A%09union:%20function%28values%29%20%7B%0A%09%09return%20this.merge.apply%28this.copy%28%29,%20arguments%29;%0A%09%7D%0A%7D%29;%0A%0AHash.implement%28Enumerable%29;%0A%0A//%20=========================================================================%0A//%20base2/Collection.js%0A//%20=========================================================================%0A%0A//%20A%20Hash%20that%20is%20more%20array-like%20%28accessible%20by%20index%29.%0A%0A//%20Collection%20classes%20have%20a%20special%20%28optional%29%20property:%20Item%0A//%20The%20Item%20property%20points%20to%20a%20constructor%20function.%0A//%20Members%20of%20the%20collection%20must%20be%20an%20instance%20of%20Item.%0A%0A//%20The%20static%20create%28%29%20method%20is%20responsible%20for%20all%20construction%20of%20collection%20items.%0A//%20Instance%20methods%20that%20add%20new%20items%20%28add,%20store,%20insertAt,%20storeAt%29%20pass%20*all*%20of%20their%20arguments%0A//%20to%20the%20static%20create%28%29%20method.%20If%20you%20want%20to%20modify%20the%20way%20collection%20items%20are%20%0A//%20created%20then%20you%20only%20need%20to%20override%20this%20method%20for%20custom%20collections.%0A%0Avar%20_KEYS%20=%20%22~%22;%0A%0Avar%20Collection%20=%20Hash.extend%28%7B%0A%09constructor:%20function%28values%29%20%7B%0A%09%09this%5B_KEYS%5D%20=%20new%20Array2;%0A%09%09this.base%28values%29;%0A%09%7D,%0A%09%0A%09add:%20function%28key,%20item%29%20%7B%0A%09%09//%20Duplicates%20not%20allowed%20using%20add%28%29.%0A%09%09//%20But%20you%20can%20still%20overwrite%20entries%20using%20store%28%29.%0A%09%09assert%28!this.exists%28key%29,%20%22Duplicate%20key%20%27%22%20+%20key%20+%20%22%27.%22%29;%0A%09%09return%20this.store.apply%28this,%20arguments%29;%0A%09%7D,%0A%0A%09copy:%20function%28%29%20%7B%0A%09%09var%20copy%20=%20this.base%28%29;%0A%09%09copy%5B_KEYS%5D%20=%20this%5B_KEYS%5D.copy%28%29;%0A%09%09return%20copy;%0A%09%7D,%0A%0A%09count:%20function%28%29%20%7B%0A%09%09return%20this%5B_KEYS%5D.length;%0A%09%7D,%0A%0A%09fetchAt:%20function%28index%29%20%7B%20//%20optimised%20%28refers%20to%20_HASH%29%0A%09%09if%20%28index%20%3C%200%29%20index%20+=%20this%5B_KEYS%5D.length;%20//%20starting%20from%20the%20end%0A%09%09var%20key%20=%20this%5B_KEYS%5D%5Bindex%5D;%0A%09%09if%20%28key%20!==%20undefined%29%20return%20this%5B_HASH%20+%20key%5D;%0A%09%7D,%0A%0A%09forEach:%20function%28block,%20context%29%20%7B%20//%20optimised%20%28refers%20to%20_HASH%29%0A%09%09var%20keys%20=%20this%5B_KEYS%5D;%0A%09%09var%20length%20=%20keys.length,%20i;%0A%09%09for%20%28i%20=%200;%20i%20%3C%20length;%20i++%29%20%7B%0A%09%09%09block.call%28context,%20this%5B_HASH%20+%20keys%5Bi%5D%5D,%20keys%5Bi%5D,%20this%29;%0A%09%09%7D%0A%09%7D,%0A%0A%09indexOf:%20function%28key%29%20%7B%0A%09%09return%20this%5B_KEYS%5D.indexOf%28String%28key%29%29;%0A%09%7D,%0A%0A%09insertAt:%20function%28index,%20key,%20item%29%20%7B%0A%09%09assert%28Math.abs%28index%29%20%3C%20this%5B_KEYS%5D.length,%20%22Index%20out%20of%20bounds.%22%29;%0A%09%09assert%28!this.exists%28key%29,%20%22Duplicate%20key%20%27%22%20+%20key%20+%20%22%27.%22%29;%0A%09%09this%5B_KEYS%5D.insertAt%28index,%20String%28key%29%29;%0A%09%09return%20this.store.apply%28this,%20arguments%29;%0A%09%7D,%0A%09%0A%09item:%20Undefined,%20//%20alias%20of%20fetchAt%20%28defined%20when%20the%20class%20is%20initialised%29%0A%0A%09keys:%20function%28index,%20length%29%20%7B%0A%09%09switch%20%28arguments.length%29%20%7B%0A%09%09%09case%200:%20%20return%20this%5B_KEYS%5D.copy%28%29;%0A%09%09%09case%201:%20%20return%20this%5B_KEYS%5D.item%28index%29;%0A%09%09%09default:%20return%20this%5B_KEYS%5D.slice%28index,%20length%29;%0A%09%09%7D%0A%09%7D,%0A%0A%09remove:%20function%28key%29%20%7B%0A%09%09//%20The%20remove%28%29%20method%20of%20the%20Array%20object%20can%20be%20slow%20so%20check%20if%20the%20key%20exists%20first.%0A%09%09var%20keyDeleted%20=%20arguments%5B1%5D;%0A%09%09if%20%28keyDeleted%20%7C%7C%20this.exists%28key%29%29%20%7B%0A%09%09%09if%20%28!keyDeleted%29%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20//%20The%20key%20has%20already%20been%20deleted%20by%20removeAt%28%29.%0A%09%09%09%09this%5B_KEYS%5D.remove%28String%28key%29%29;%20//%20We%20still%20have%20to%20delete%20the%20value%20though.%0A%09%09%09%7D%0A%09%09%09return%20this.base%28key%29;%0A%09%09%7D%0A%09%7D,%0A%0A%09removeAt:%20function%28index%29%20%7B%0A%09%09var%20key%20=%20this%5B_KEYS%5D.removeAt%28index%29;%0A%09%09if%20%28key%20!==%20undefined%29%20return%20this.remove%28key,%20true%29;%0A%09%7D,%0A%0A%09reverse:%20function%28%29%20%7B%0A%09%09this%5B_KEYS%5D.reverse%28%29;%0A%09%09return%20this;%0A%09%7D,%0A%0A%09sort:%20function%28compare%29%20%7B%20//%20optimised%20%28refers%20to%20_HASH%29%0A%09%09if%20%28compare%29%20%7B%0A%09%09%09var%20self%20=%20this;%0A%09%09%09this%5B_KEYS%5D.sort%28function%28key1,%20key2%29%20%7B%0A%09%09%09%09return%20compare%28self%5B_HASH%20+%20key1%5D,%20self%5B_HASH%20+%20key2%5D,%20key1,%20key2%29;%0A%09%09%09%7D%29;%0A%09%09%7D%20else%20this%5B_KEYS%5D.sort%28%29;%0A%09%09return%20this;%0A%09%7D,%0A%0A%09store:%20function%28key,%20item%29%20%7B%0A%09%09if%20%28arguments.length%20==%201%29%20item%20=%20key;%0A%09%09if%20%28!this.exists%28key%29%29%20%7B%0A%09%09%09this%5B_KEYS%5D.push%28String%28key%29%29;%0A%09%09%7D%0A%09%09var%20klass%20=%20this.constructor;%0A%09%09if%20%28klass.Item%20%26%26%20!instanceOf%28item,%20klass.Item%29%29%20%7B%0A%09%09%09item%20=%20klass.create.apply%28klass,%20arguments%29;%0A%09%09%7D%0A%09%09return%20this%5B_HASH%20+%20key%5D%20=%20item;%0A%09%7D,%0A%0A%09storeAt:%20function%28index,%20item%29%20%7B%0A%09%09assert%28Math.abs%28index%29%20%3C%20this%5B_KEYS%5D.length,%20%22Index%20out%20of%20bounds.%22%29;%0A%09%09arguments%5B0%5D%20=%20this%5B_KEYS%5D.item%28index%29;%0A%09%09return%20this.store.apply%28this,%20arguments%29;%0A%09%7D,%0A%0A%09toString:%20function%28%29%20%7B%0A%09%09return%20String%28this%5B_KEYS%5D%29;%0A%09%7D%0A%7D,%20%7B%0A%09Item:%20null,%20//%20If%20specified,%20all%20members%20of%20the%20collection%20must%20be%20instances%20of%20Item.%0A%09%0A%09create:%20function%28key,%20item%29%20%7B%0A%09%09if%20%28this.Item%29%20return%20new%20this.Item%28key,%20item%29;%0A%09%7D,%0A%09%0A%09extend:%20function%28_instance,%20_static%29%20%7B%0A%09%09var%20klass%20=%20this.base%28_instance%29;%0A%09%09klass.create%20=%20this.create;%0A%09%09extend%28klass,%20_static%29;%0A%09%09if%20%28!klass.Item%29%20%7B%0A%09%09%09klass.Item%20=%20this.Item;%0A%09%09%7D%20else%20if%20%28typeof%20klass.Item%20!=%20%22function%22%29%20%7B%0A%09%09%09klass.Item%20=%20%28this.Item%20%7C%7C%20Base%29.extend%28klass.Item%29;%0A%09%09%7D%0A%09%09klass.init%28%29;%0A%09%09return%20klass;%0A%09%7D,%0A%09%0A%09init:%20function%28%29%20%7B%0A%09%09this.prototype.item%20=%20this.prototype.fetchAt;%0A%09%7D%0A%7D%29;%0A%0A//%20=========================================================================%0A//%20base2/RegGrp.js%0A//%20=========================================================================%0A%0A//%20A%20collection%20of%20regular%20expressions%20and%20their%20associated%20replacement%20values.%0A%0Avar%20RegGrp%20=%20Collection.extend%28%7B%0A%09constructor:%20function%28values,%20flags%29%20%7B%0A%09%09this.base%28values%29;%0A%09%09if%20%28typeof%20flags%20==%20%22string%22%29%20%7B%0A%09%09%09this.global%20=%20/g/.test%28flags%29;%0A%09%09%09this.ignoreCase%20=%20/i/.test%28flags%29;%0A%09%09%7D%0A%09%7D,%0A%0A%09global:%20true,%20//%20global%20is%20the%20default%20setting%0A%09ignoreCase:%20false,%0A%0A%09exec:%20function%28string,%20replacement%29%20%7B%20//%20optimised%20%28refers%20to%20_HASH%29%0A%09%09string%20=%20String%28string%29;%20//%20type-safe%0A%09%09if%20%28arguments.length%20==%201%29%20%7B%0A%09%09%09var%20self%20=%20this;%0A%09%09%09var%20keys%20=%20this%5B_KEYS%5D;%0A%09%09%09replacement%20=%20function%28match%29%20%7B%0A%09%09%09%09if%20%28!match%29%20return%20%22%22;%0A%09%09%09%09var%20item,%20offset%20=%201,%20i%20=%200;%0A%09%09%09%09//%20Loop%20through%20the%20RegGrp%20items.%0A%09%09%09%09while%20%28item%20=%20self%5B_HASH%20+%20keys%5Bi++%5D%5D%29%20%7B%0A%09%09%09%09%09var%20next%20=%20offset%20+%20item.length%20+%201;%0A%09%09%09%09%09if%20%28arguments%5Boffset%5D%29%20%7B%20//%20do%20we%20have%20a%20result%3F%0A%09%09%09%09%09%09var%20replacement%20=%20item.replacement;%0A%09%09%09%09%09%09switch%20%28typeof%20replacement%29%20%7B%0A%09%09%09%09%09%09%09case%20%22function%22:%0A%09%09%09%09%09%09%09%09var%20args%20=%20slice%28arguments,%20offset,%20next%29;%0A%09%09%09%09%09%09%09%09var%20index%20=%20arguments%5Barguments.length%20-%202%5D;%0A%09%09%09%09%09%09%09%09return%20replacement.apply%28self,%20args.concat%28index,%20string%29%29;%0A%09%09%09%09%09%09%09case%20%22number%22:%0A%09%09%09%09%09%09%09%09return%20arguments%5Boffset%20+%20replacement%5D;%0A%09%09%09%09%09%09%09default:%0A%09%09%09%09%09%09%09%09return%20replacement;%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%09offset%20=%20next;%0A%09%09%09%09%7D%0A%09%09%09%7D;%0A%09%09%7D%0A%09%09return%20string.replace%28this.valueOf%28%29,%20replacement%29;%0A%09%7D,%0A%0A%09test:%20function%28string%29%20%7B%0A%09%09return%20this.exec%28string%29%20!=%20string;%0A%09%7D,%0A%09%0A%09toString:%20function%28%29%20%7B%0A%09%09var%20BACK_REF%20=%20/%5C%5C%28%5Cd+%29/g;%0A%09%09var%20length%20=%200;%0A%09%09return%20%22%28%22%20+%20this.map%28function%28item%29%20%7B%0A%09%09%09//%20Fix%20back%20references.%0A%09%09%09var%20ref%20=%20String%28item%29.replace%28BACK_REF,%20function%28match,%20index%29%20%7B%0A%09%09%09%09return%20%22%5C%5C%22%20+%20%281%20+%20Number%28index%29%20+%20length%29;%0A%09%09%09%7D%29;%0A%09%09%09length%20+=%20item.length%20+%201;%0A%09%09%09return%20ref;%0A%09%09%7D%29.join%28%22%29%7C%28%22%29%20+%20%22%29%22;%0A%09%7D,%0A%09%0A%09valueOf:%20function%28type%29%20%7B%0A%09%09if%20%28type%20==%20%22object%22%29%20return%20this;%0A%09%09var%20flags%20=%20%28this.global%20%3F%20%22g%22%20:%20%22%22%29%20+%20%28this.ignoreCase%20%3F%20%22i%22%20:%20%22%22%29;%0A%09%09return%20new%20RegExp%28this,%20flags%29;%0A%09%7D%0A%7D,%20%7B%0A%09IGNORE:%20%22$0%22,%0A%09%0A%09count:%20function%28expression%29%20%7B%0A%09%09//%20Count%20the%20number%20of%20sub-expressions%20in%20a%20RegExp/RegGrp.Item.%0A%09%09return%20match%28String%28expression%29.replace%28/%5C%5C./g,%20%22%22%29.replace%28/%5C%28%5C%3F%5B:=!%5D%7C%5C%5B%5B%5E%5C%5D%5D+%5C%5D/g,%20%22%22%29,%20/%5C%28/g%29.length;%0A%09%7D,%0A%09%0A%09init:%20function%28%29%20%7B%0A%09%09forEach%20%28%22add,exists,fetch,remove,store%22.split%28%22,%22%29,%20function%28name%29%20%7B%0A%09%09%09extend%28this,%20name,%20function%28expression%29%20%7B%0A%09%09%09%09if%20%28instanceOf%28expression,%20RegExp%29%29%20%7B%0A%09%09%09%09%09expression%20=%20expression.source;%0A%09%09%09%09%7D%0A%09%09%09%09return%20base%28this,%20arguments%29;%0A%09%09%09%7D%29;%0A%09%09%7D,%20this.prototype%29;%0A%09%7D%0A%7D%29;%0A%0A//%20=========================================================================%0A//%20base2/RegGrp/Item.js%0A//%20=========================================================================%0A%0ARegGrp.Item%20=%20Base.extend%28%7B%0A%09constructor:%20function%28expression,%20replacement%29%20%7B%0A%09%09expression%20=%20instanceOf%28expression,%20RegExp%29%20%3F%20expression.source%20:%20String%28expression%29;%0A%09%09%0A%09%09if%20%28typeof%20replacement%20==%20%22number%22%29%20replacement%20=%20String%28replacement%29;%0A%09%09else%20if%20%28replacement%20==%20null%29%20replacement%20=%20%22%22;%09%09%0A%09%09%0A%09%09//%20does%20the%20pattern%20use%20sub-expressions%3F%0A%09%09if%20%28typeof%20replacement%20==%20%22string%22%20%26%26%20/%5C$%28%5Cd+%29/.test%28replacement%29%29%20%7B%0A%09%09%09//%20a%20simple%20lookup%3F%20%28e.g.%20%22$2%22%29%0A%09%09%09if%20%28/%5E%5C$%5Cd+$/.test%28replacement%29%29%20%7B%0A%09%09%09%09//%20store%20the%20index%20%28used%20for%20fast%20retrieval%20of%20matched%20strings%29%0A%09%09%09%09replacement%20=%20parseInt%28replacement.slice%281%29%29;%0A%09%09%09%7D%20else%20%7B%20//%20a%20complicated%20lookup%20%28e.g.%20%22Hello%20$2%20$1%22%29%0A%09%09%09%09//%20build%20a%20function%20to%20do%20the%20lookup%0A%09%09%09%09var%20Q%20=%20/%27/.test%28replacement.replace%28/%5C%5C./g,%20%22%22%29%29%20%3F%20%27%22%27%20:%20%22%27%22;%0A%09%09%09%09replacement%20=%20replacement.replace%28/%5Cn/g,%20%22%5C%5Cn%22%29.replace%28/%5Cr/g,%20%22%5C%5Cr%22%29.replace%28/%5C$%28%5Cd+%29/g,%20Q%20+%0A%09%09%09%09%09%22+%28arguments%5B$1%5D%7C%7C%22%20+%20Q+Q%20+%20%22%29+%22%20+%20Q%29;%0A%09%09%09%09replacement%20=%20new%20Function%28%22return%20%22%20+%20Q%20+%20replacement.replace%28/%28%5B%27%22%5D%29%5C1%5C+%28.*%29%5C+%5C1%5C1$/,%20%22$1%22%29%20+%20Q%29;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09this.length%20=%20RegGrp.count%28expression%29;%0A%09%09this.replacement%20=%20replacement;%0A%09%09this.toString%20=%20partial%28String,%20expression%29;%0A%09%7D,%0A%09%0A%09length:%200,%0A%09replacement:%20%22%22%0A%7D%29;%0A%0A//%20=========================================================================%0A//%20JavaScript/~/Function.js%0A//%20=========================================================================%0A%0A//%20some%20browsers%20don%27t%20define%20this%0A%0AFunction.prototype.prototype%20=%20%7B%7D;%0A%0A%0A//%20=========================================================================%0A//%20JavaScript/~/String.js%0A//%20=========================================================================%0A%0A//%20fix%20String.replace%20%28Safari/IE5.0%29%0Aif%20%28%22%22.replace%28/%5E/,%20String%29%29%20%7B%0A%09var%20_GLOBAL%20=%20/%28g%7Cgi%29$/;%0A%09extend%28String.prototype,%20%22replace%22,%20function%28expression,%20replacement%29%20%7B%0A%09%09if%20%28typeof%20replacement%20==%20%22function%22%29%20%7B%20//%20Safari%20doesn%27t%20like%20functions%0A%09%09%09if%20%28instanceOf%28expression,%20RegExp%29%29%20%7B%0A%09%09%09%09var%20regexp%20=%20expression;%0A%09%09%09%09var%20global%20=%20regexp.global;%0A%09%09%09%09if%20%28global%20==%20null%29%20global%20=%20_GLOBAL.test%28regexp%29;%0A%09%09%09%09//%20we%20have%20to%20convert%20global%20RexpExps%20for%20exec%28%29%20to%20work%20consistently%0A%09%09%09%09if%20%28global%29%20regexp%20=%20new%20RegExp%28regexp.source%29;%20//%20non-global%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09regexp%20=%20new%20RegExp%28rescape%28expression%29%29;%0A%09%09%09%7D%0A%09%09%09var%20match,%20string%20=%20this,%20result%20=%20%22%22;%0A%09%09%09while%20%28string%20%26%26%20%28match%20=%20regexp.exec%28string%29%29%29%20%7B%0A%09%09%09%09result%20+=%20string.slice%280,%20match.index%29%20+%20replacement.apply%28this,%20match%29;%0A%09%09%09%09string%20=%20string.slice%28match.index%20+%20match%5B0%5D.length%29;%0A%09%09%09%09if%20%28!global%29%20break;%0A%09%09%09%7D%0A%09%09%09return%20result%20+%20string;%0A%09%09%7D%0A%09%09return%20this.base%28expression,%20replacement%29;%0A%09%7D%29;%0A%7D%0A%0A//%20=========================================================================%0A//%20JavaScript/Array2.js%0A//%20=========================================================================%0A%0A//%20Create%20a%20faux%20constructor%20that%20augments%20the%20built-in%20Array%20object.%0Avar%20Array2%20=%20_createObject2%28%0A%09Array,%0A%09%22concat,join,pop,push,reverse,shift,slice,sort,splice,unshift%22,%20//%20generics%0A%09%5BEnumerable,%20%7B%0A%09%09combine:%20function%28keys,%20values%29%20%7B%0A%09%09%09//%20Combine%20two%20arrays%20to%20make%20a%20hash.%0A%09%09%09if%20%28!values%29%20values%20=%20keys;%0A%09%09%09return%20this.reduce%28keys,%20function%28object,%20key,%20index%29%20%7B%0A%09%09%09%09object%5Bkey%5D%20=%20values%5Bindex%5D;%0A%09%09%09%09return%20object;%0A%09%09%09%7D,%20%7B%7D%29;%0A%09%09%7D,%0A%09%09%0A%09%09copy:%20function%28array%29%20%7B%0A%09%09%09return%20this%28this.concat%28array%29%29;%20//%20and%20cast%20to%20Array2%0A%09%09%7D,%0A%09%09%0A%09%09contains:%20function%28array,%20item%29%20%7B%0A%09%09%09return%20this.indexOf%28array,%20item%29%20!=%20-1;%0A%09%09%7D,%0A%09%09%0A%09%09forEach:%20_Array_forEach,%0A%09%09%0A%09%09indexOf:%20function%28array,%20item,%20fromIndex%29%20%7B%0A%09%09%09var%20length%20=%20array.length;%0A%09%09%09if%20%28fromIndex%20==%20null%29%20%7B%0A%09%09%09%09fromIndex%20=%200;%0A%09%09%09%7D%20else%20if%20%28fromIndex%20%3C%200%29%20%7B%0A%09%09%09%09fromIndex%20=%20Math.max%280,%20length%20+%20fromIndex%29;%0A%09%09%09%7D%0A%09%09%09for%20%28var%20i%20=%20fromIndex;%20i%20%3C%20length;%20i++%29%20%7B%0A%09%09%09%09if%20%28array%5Bi%5D%20===%20item%29%20return%20i;%0A%09%09%09%7D%0A%09%09%09return%20-1;%0A%09%09%7D,%0A%09%09%0A%09%09insertAt:%20function%28array,%20item,%20index%29%20%7B%0A%09%09%09this.splice%28array,%20index,%200,%20item%29;%0A%09%09%09return%20item;%0A%09%09%7D,%0A%09%09%0A%09%09item:%20function%28array,%20index%29%20%7B%0A%09%09%09if%20%28index%20%3C%200%29%20index%20+=%20array.length;%20//%20starting%20from%20the%20end%0A%09%09%09return%20array%5Bindex%5D;%0A%09%09%7D,%0A%09%09%0A%09%09lastIndexOf:%20function%28array,%20item,%20fromIndex%29%20%7B%0A%09%09%09var%20length%20=%20array.length;%0A%09%09%09if%20%28fromIndex%20==%20null%29%20%7B%0A%09%09%09%09fromIndex%20=%20length%20-%201;%0A%09%09%09%7D%20else%20if%20%28from%20%3C%200%29%20%7B%0A%09%09%09%09fromIndex%20=%20Math.max%280,%20length%20+%20fromIndex%29;%0A%09%09%09%7D%0A%09%09%09for%20%28var%20i%20=%20fromIndex;%20i%20%3E=%200;%20i--%29%20%7B%0A%09%09%09%09if%20%28array%5Bi%5D%20===%20item%29%20return%20i;%0A%09%09%09%7D%0A%09%09%09return%20-1;%0A%09%09%7D,%0A%09%0A%09%09map:%20function%28object,%20block,%20context%29%20%7B%0A%09%09%09var%20result%20=%20%5B%5D;%0A%09%09%09this.forEach%20%28object,%20function%28value,%20item%29%20%7B%0A%09%09%09%09result%5Bindex%5D%20=%20block.call%28context,%20item,%20index,%20object%29;%0A%09%09%09%7D%29;%0A%09%09%09return%20result;%0A%09%09%7D,%0A%09%09%0A%09%09remove:%20function%28array,%20item%29%20%7B%0A%09%09%09var%20index%20=%20this.indexOf%28array,%20item%29;%0A%09%09%09if%20%28index%20!=%20-1%29%20this.removeAt%28array,%20index%29;%0A%09%09%09return%20item;%0A%09%09%7D,%0A%09%09%0A%09%09removeAt:%20function%28array,%20index%29%20%7B%0A%09%09%09return%20this.splice%28array,%20index,%201%29;%0A%09%09%7D%0A%09%7D%5D%0A%29;%0A%0AArray2.prototype.forEach%20=%20delegate%28_Array_forEach%29;%0A%0A//%20=========================================================================%0A//%20JavaScript/String2.js%0A//%20=========================================================================%0A%0Avar%20String2%20=%20_createObject2%28%0A%09String,%0A%09%22charAt,charCodeAt,concat,indexOf,lastIndexOf,match,replace,search,slice,split,substr,substring,toLowerCase,toUpperCase%22,%0A%09%5B%7Btrim:%20trim%7D%5D%0A%29;%0A%0A//%20=========================================================================%0A//%20JavaScript/functions.js%0A//%20=========================================================================%0A%0Afunction%20_createObject2%28Native,%20generics,%20extensions%29%20%7B%0A%09//%20Clone%20native%20objects%20and%20extend%20them.%0A%09%0A%09//%20Create%20a%20Module%20that%20will%20contain%20all%20the%20new%20methods.%0A%09var%20INative%20=%20Module.extend%28%29;%0A%09//%20http://developer.mozilla.org/en/docs/New_in_JavaScript_1.6%23Array_and_String_generics%0A%09forEach%20%28generics.split%28%22,%22%29,%20function%28name%29%20%7B%0A%09%09INative%5Bname%5D%20=%20unbind%28Native.prototype%5Bname%5D%29;%0A%09%7D%29;%0A%09forEach%20%28extensions,%20INative.implement,%20INative%29;%0A%09%0A%09//%20create%20a%20faux%20constructor%20that%20augments%20the%20native%20object%0A%09var%20Native2%20=%20function%28%29%20%7B%0A%09%09return%20INative%28this.constructor%20==%20INative%20%3F%20Native.apply%28Native,%20arguments%29%20:%20arguments%5B0%5D%29;%0A%09%7D;%0A%09Native2.prototype%20=%20INative.prototype;%0A%09%0A%09//%20Remove%20methods%20that%20are%20already%20implemented.%0A%09forEach%20%28INative,%20function%28method,%20name%29%20%7B%0A%09%09if%20%28Native%5Bname%5D%29%20%7B%0A%09%09%09INative%5Bname%5D%20=%20Native%5Bname%5D;%0A%09%09%09delete%20INative.prototype%5Bname%5D;%0A%09%09%7D%0A%09%09Native2%5Bname%5D%20=%20INative%5Bname%5D;%0A%09%7D%29;%0A%09%0A%09return%20Native2;%0A%7D;%0A%0A//%20=========================================================================%0A//%20lang/extend.js%0A//%20=========================================================================%0A%0Afunction%20base%28object,%20args%29%20%7B%0A%09return%20object.base.apply%28object,%20args%29;%0A%7D;%0A%0Afunction%20extend%28object,%20source%29%20%7B%20//%20or%20extend%28object,%20key,%20value%29%0A%09var%20extend%20=%20arguments.callee;%0A%09if%20%28object%20!=%20null%29%20%7B%0A%09%09if%20%28arguments.length%20%3E%202%29%20%7B%20//%20Extending%20with%20a%20key/value%20pair.%0A%09%09%09var%20key%20=%20String%28source%29;%0A%09%09%09var%20value%20=%20arguments%5B2%5D;%0A%09%09%09//%20Object%20detection.%0A%09%09%09if%20%28key.charAt%280%29%20==%20%22@%22%29%20%7B%0A%09%09%09%09return%20detect%28key.slice%281%29%29%20%3F%20extend%28object,%20value%29%20:%20object;%0A%09%09%09%7D%0A%09%09%09//%20Protect%20certain%20objects.%0A%09%09%09if%20%28object.extend%20==%20extend%20%26%26%20/%5E%28base%7Cextend%29$/.test%28key%29%29%20%7B%0A%09%09%09%09return%20object;%0A%09%09%09%7D%0A%09%09%09//%20Check%20for%20method%20overriding.%0A%09%09%09if%20%28typeof%20value%20==%20%22function%22%29%20%7B%0A%09%09%09%09var%20ancestor%20=%20object%5Bkey%5D;%0A%09%09%09%09if%20%28value%20!=%20ancestor%20%26%26%20!_ancestorOf%28value,%20ancestor%29%29%20%7B%0A%09%09%09%09%09if%20%28value._base%20%7C%7C%20_BASE.test%28value%29%29%20%7B%0A%09%09%09%09%09%09//%20Override%20the%20existing%20method.%0A%09%09%09%09%09%09var%20method%20=%20value;%0A%09%09%09%09%09%09function%20_base%28%29%20%7B%0A%09%09%09%09%09%09%09var%20previous%20=%20this.base;%0A%09%09%09%09%09%09%09this.base%20=%20ancestor;%0A%09%09%09%09%09%09%09var%20returnValue%20=%20method.apply%28this,%20arguments%29;%0A%09%09%09%09%09%09%09this.base%20=%20previous;%0A%09%09%09%09%09%09%09return%20returnValue;%0A%09%09%09%09%09%09%7D;%0A%09%09%09%09%09%09value%20=%20_base;%0A%09%09%09%09%09%09value.method%20=%20method;%0A%09%09%09%09%09%09value.ancestor%20=%20ancestor;%0A%09%09%09%09%09%7D%0A%09%09%09%09%09object%5Bkey%5D%20=%20value;%0A%09%09%09%09%7D%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09object%5Bkey%5D%20=%20value;%0A%09%09%09%7D%0A%09%09%7D%20else%20if%20%28source%29%20%7B%20//%20Extending%20with%20an%20object%20literal.%0A%09%09%09var%20Type%20=%20instanceOf%28source,%20Function%29%20%3F%20Function%20:%20Object;%0A%09%09%09if%20%28base2.__prototyping%29%20%7B%0A%09%09%09%09//%20Add%20constructor,%20toString%20etc%20if%20we%20are%20prototyping.%0A%09%09%09%09forEach%20%28_HIDDEN,%20function%28key%29%20%7B%0A%09%09%09%09%09if%20%28source%5Bkey%5D%20!=%20Type.prototype%5Bkey%5D%29%20%7B%0A%09%09%09%09%09%09extend%28object,%20key,%20source%5Bkey%5D%29;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%29;%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09//%20Does%20the%20target%20object%20have%20a%20custom%20extend%28%29%20method%3F%0A%09%09%09%09if%20%28typeof%20object.extend%20==%20%22function%22%20%26%26%20typeof%20object%20!=%20%22function%22%20%26%26%20object.extend%20!=%20extend%29%20%7B%0A%09%09%09%09%09extend%20=%20unbind%28object.extend%29;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09//%20Copy%20each%20of%20the%20source%20object%27s%20properties%20to%20the%20target%20object.%0A%09%09%09_Function_forEach%20%28Type,%20source,%20function%28value,%20key%29%20%7B%0A%09%09%09%09extend%28object,%20key,%20value%29;%0A%09%09%09%7D%29;%0A%09%09%7D%0A%09%7D%0A%09return%20object;%0A%7D;%0A%0Afunction%20_ancestorOf%28ancestor,%20fn%29%20%7B%0A%09//%20Check%20if%20a%20function%20is%20in%20another%20function%27s%20inheritance%20chain.%0A%09while%20%28fn%20%26%26%20fn.ancestor%20!=%20ancestor%29%20fn%20=%20fn.ancestor;%0A%09return%20!!fn;%0A%7D;%0A%0A//%20=========================================================================%0A//%20lang/forEach.js%0A//%20=========================================================================%0A%0A//%20http://dean.edwards.name/weblog/2006/07/enum/%0A%0Aif%20%28typeof%20StopIteration%20==%20%22undefined%22%29%20%7B%0A%09StopIteration%20=%20new%20Error%28%22StopIteration%22%29;%0A%7D%0A%0Afunction%20forEach%28object,%20block,%20context,%20fn%29%20%7B%0A%09if%20%28object%20==%20null%29%20return;%0A%09if%20%28!fn%29%20%7B%0A%09%09if%20%28instanceOf%28object,%20Function%29%29%20%7B%0A%09%09%09//%20Functions%20are%20a%20special%20case.%0A%09%09%09fn%20=%20Function;%0A%09%09%7D%20else%20if%20%28typeof%20object.forEach%20==%20%22function%22%20%26%26%20object.forEach%20!=%20arguments.callee%29%20%7B%0A%09%09%09//%20The%20object%20implements%20a%20custom%20forEach%20method.%0A%09%09%09object.forEach%28block,%20context%29;%0A%09%09%09return;%0A%09%09%7D%20else%20if%20%28typeof%20object.length%20==%20%22number%22%29%20%7B%0A%09%09%09//%20The%20object%20is%20array-like.%0A%09%09%09_Array_forEach%28object,%20block,%20context%29;%0A%09%09%09return;%0A%09%09%7D%0A%09%7D%0A%09_Function_forEach%28fn%20%7C%7C%20Object,%20object,%20block,%20context%29;%0A%7D;%0A%0A//%20These%20are%20the%20two%20core%20enumeration%20methods.%20All%20other%20forEach%20methods%0A//%20%20eventually%20call%20one%20of%20these%20two.%0A%0Afunction%20_Array_forEach%28array,%20block,%20context%29%20%7B%0A%09if%20%28array%20==%20null%29%20return;%0A%09var%20length%20=%20array.length,%20i;%20//%20preserve%20length%0A%09if%20%28typeof%20array%20==%20%22string%22%29%20%7B%0A%09%09for%20%28i%20=%200;%20i%20%3C%20length;%20i++%29%20%7B%0A%09%09%09block.call%28context,%20array.charAt%28i%29,%20i,%20array%29;%0A%09%09%7D%0A%09%7D%20else%20%7B%0A%09%09//%20Cater%20for%20sparse%20arrays.%0A%09%09for%20%28i%20=%200;%20i%20%3C%20length;%20i++%29%20%7B%09%09%0A%09%09%09//%20Ignore%20undefined%20values.%20This%20is%20contrary%20to%20standard%20behaviour%0A%09%09%09//%20%20but%20it%27s%20what%20Internet%20Explorer%20does.%20We%20want%20consistent%20behaviour%0A%09%09%09//%20%20so%20we%20do%20this%20on%20all%20platforms.%0A%09%09%09if%20%28array%5Bi%5D%20!==%20undefined%29%20%7B%0A%09%09%09%09block.call%28context,%20array%5Bi%5D,%20i,%20array%29;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D;%0A%0Afunction%20_get_Function_forEach%28%29%20%7B%0A%09//%20http://code.google.com/p/base2/issues/detail%3Fid=10%0A%09%0A%09//%20run%20the%20test%20for%20Safari%27s%20buggy%20enumeration%0A%09var%20Temp%20=%20function%28%29%7Bthis.i=1%7D;%0A%09Temp.prototype%20=%20%7Bi:1%7D;%0A%09var%20count%20=%200;%0A%09for%20%28var%20i%20in%20new%20Temp%29%20count++;%0A%09%0A%09return%20%28count%20%3E%201%29%20%3F%20function%28fn,%20object,%20block,%20context%29%20%7B%0A%09%09///////////////////////////////////////%0A%09%09//%20%20%20%20Safari%20fix%20%28pre%20version%203%29%20%20%20%20%20//%0A%09%09///////////////////////////////////////%09%09%0A%09%09var%20processed%20=%20%7B%7D;%0A%09%09for%20%28var%20key%20in%20object%29%20%7B%0A%09%09%09if%20%28!processed%5Bkey%5D%20%26%26%20fn.prototype%5Bkey%5D%20===%20undefined%29%20%7B%0A%09%09%09%09processed%5Bkey%5D%20=%20true;%0A%09%09%09%09block.call%28context,%20object%5Bkey%5D,%20key,%20object%29;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%20:%20function%28fn,%20object,%20block,%20context%29%20%7B%0A%09%09//%20Enumerate%20an%20object%20and%20compare%20its%20keys%20with%20fn%27s%20prototype.%0A%09%09for%20%28var%20key%20in%20object%29%20%7B%0A%09%09%09if%20%28fn.prototype%5Bkey%5D%20===%20undefined%29%20%7B%0A%09%09%09%09block.call%28context,%20object%5Bkey%5D,%20key,%20object%29;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D;%0A%7D;%0A%0A//%20=========================================================================%0A//%20lang/instanceOf.js%0A//%20=========================================================================%0A%0Afunction%20instanceOf%28object,%20klass%29%20%7B%0A%09assertType%28klass,%20%22function%22,%20%22Invalid%20%27instanceOf%27%20operand.%22%29;%0A%09%0A%09//%20Ancient%20browsers%20throw%20an%20error%20when%20we%20use%20%22instanceof%22%20as%20an%20operator.%0A%09/*@cc_on%20@*/%0A%09/*@if%20%28@_jscript_version%20%3C%205.1%29%0A%09%09if%20%28$Legacy.instanceOf%28object,%20klass%29%29%20return%20true;%0A%09@else%20@*/%0A%09%09if%20%28object%20instanceof%20klass%29%20return%20true;%0A%09/*@end%20@*/%0A%09%0A%09//%20Handle%20exceptions%20where%20the%20target%20object%20originates%20from%20another%20frame%0A%09//%20this%20is%20handy%20for%20JSON%20parsing%20%28amongst%20other%20things%29.%0A%09if%20%28object%20!=%20null%29%20switch%20%28klass%29%20%7B%0A%09%09case%20Array:%20//%20this%20is%20the%20only%20troublesome%20one%0A%09%09%09return%20!!%28object.join%20%26%26%20object.splice%20%26%26%20typeof%20object%20==%20%22object%22%29;%0A%09%09case%20RegExp:%0A%09%09%09return%20typeof%20object.source%20==%20%22string%22%20%26%26%20typeof%20object.ignoreCase%20==%20%22boolean%22;%0A%09%09case%20Function:%0A%09%09%09return%20!!%28typeof%20object%20==%20%22function%22%20%26%26%20object.call%29;%0A%09%09case%20Date:%0A%09%09%09return%20!!object.getTimezoneOffset;%0A%09%09case%20String:%0A%09%09case%20Number:%0A%09%09case%20Boolean:%0A%09%09%09return%20typeof%20object%20==%20typeof%20klass.prototype.valueOf%28%29;%0A%09%09case%20Object:%0A%09%09%09return%20true;%0A%09%7D%0A%09return%20false;%0A%7D;%0A%0A//%20=========================================================================%0A//%20lang/assert.js%0A//%20=========================================================================%0A%0Afunction%20assert%28condition,%20message,%20Err%29%20%7B%0A%09if%20%28!condition%29%20%7B%0A%09%09throw%20new%20%28Err%20%7C%7C%20Error%29%28message%20%7C%7C%20%22Assertion%20failed.%22%29;%0A%09%7D%0A%7D;%0A%0Afunction%20assertArity%28args,%20arity,%20message%29%20%7B%0A%09if%20%28arity%20==%20null%29%20arity%20=%20args.callee.length;%0A%09if%20%28args.length%20%3C%20arity%29%20%7B%0A%09%09throw%20new%20SyntaxError%28message%20%7C%7C%20%22Not%20enough%20arguments.%22%29;%0A%09%7D%0A%7D;%0A%0Afunction%20assertType%28object,%20type,%20message%29%20%7B%0A%09if%20%28type%20%26%26%20%28typeof%20type%20==%20%22function%22%20%3F%20!instanceOf%28object,%20type%29%20:%20typeof%20object%20!=%20type%29%29%20%7B%0A%09%09throw%20new%20TypeError%28message%20%7C%7C%20%22Invalid%20type.%22%29;%0A%09%7D%0A%7D;%0A%0A//%20=========================================================================%0A//%20lang/core.js%0A//%20=========================================================================%0A%0Afunction%20assignID%28object%29%20%7B%0A%09//%20Assign%20a%20unique%20ID%20to%20an%20object.%0A%09if%20%28!object.base2ID%29%20object.base2ID%20=%20%22b2_%22%20+%20_ID++;%0A%09return%20object.base2ID;%0A%7D;%0A%0Afunction%20copy%28object%29%20%7B%0A%09var%20fn%20=%20function%28%29%7B%7D;%0A%09fn.prototype%20=%20object;%0A%09return%20new%20fn;%0A%7D;%0A%0A//%20String/RegExp.%0A%0Afunction%20format%28string%29%20%7B%0A%09//%20Replace%20%25n%20with%20arguments%5Bn%5D.%0A%09//%20e.g.%20format%28%22%251%20%252%253%20%252a%20%251%253%22,%20%22she%22,%20%22se%22,%20%22lls%22%29;%0A%09//%20==%3E%20%22she%20sells%20sea%20shells%22%0A%09//%20Only%20%251%20-%20%259%20supported.%0A%09var%20args%20=%20arguments;%0A%09var%20_FORMAT%20=%20new%20RegExp%28%22%25%28%5B1-%22%20+%20arguments.length%20+%20%22%5D%29%22,%20%22g%22%29;%0A%09return%20String%28string%29.replace%28_FORMAT,%20function%28match,%20index%29%20%7B%0A%09%09return%20index%20%3C%20args.length%20%3F%20args%5Bindex%5D%20:%20match;%0A%09%7D%29;%0A%7D;%0A%0Afunction%20match%28string,%20expression%29%20%7B%0A%09//%20Same%20as%20String.match%28%29%20except%20that%20this%20function%20will%20return%20an%20empty%20%0A%09//%20array%20if%20there%20is%20no%20match.%0A%09return%20String%28string%29.match%28expression%29%20%7C%7C%20%5B%5D;%0A%7D;%0A%0Afunction%20rescape%28string%29%20%7B%0A%09//%20Make%20a%20string%20safe%20for%20creating%20a%20RegExp.%0A%09return%20String%28string%29.replace%28_RESCAPE,%20%22%5C%5C$1%22%29;%0A%7D;%0A%0A//%20http://blog.stevenlevithan.com/archives/faster-trim-javascript%0Afunction%20trim%28string%29%20%7B%0A%09return%20String%28string%29.replace%28_LTRIM,%20%22%22%29.replace%28_RTRIM,%20%22%22%29;%0A%7D;%0A%0A//%20=========================================================================%0A//%20lang/functional.js%0A//%20=========================================================================%0A%0Afunction%20Undefined%28%29%20%7B%0A%09return%20undefined;%0A%7D;%0A%0Afunction%20K%28k%29%20%7B%0A%09return%20k;%0A%7D;%0A%0Afunction%20bind%28fn,%20context%29%20%7B%0A%09var%20args%20=%20slice%28arguments,%202%29;%0A%09function%20_bind%28%29%20%7B%0A%09%09return%20fn.apply%28context,%20args.concat%28slice%28arguments%29%29%29;%0A%09%7D;%0A%09_bind._cloneID%20=%20assignID%28fn%29;%0A%09return%20_bind;%0A%7D;%0A%0Afunction%20delegate%28fn,%20context%29%20%7B%0A%09function%20_delegate%28%29%20%7B%0A%09%09return%20fn.apply%28context,%20%5Bthis%5D.concat%28slice%28arguments%29%29%29;%0A%09%7D;%0A%09return%20_delegate;%0A%7D;%0A%0Afunction%20partial%28fn%29%20%7B%0A%09var%20args%20=%20slice%28arguments,%201%29;%0A%09function%20_partial%28%29%20%7B%0A%09%09return%20fn.apply%28this,%20args.concat%28slice%28arguments%29%29%29;%0A%09%7D;%0A%09return%20_partial;%0A%7D;%0A%0Afunction%20unbind%28fn%29%20%7B%0A%09function%20_unbind%28context%29%20%7B%0A%09%09return%20fn.apply%28context,%20slice%28arguments,%201%29%29;%0A%09%7D;%0A%09return%20_unbind;%0A%7D;%0A%0A//%20=========================================================================%0A//%20base2/init.js%0A//%20=========================================================================%0A%0Abase2.exports%20=%20%22Base,Abstract,Module,Enumerable,Array2,Hash,Collection,RegGrp,Namespace,%22%20+%0A%09%22K,Undefined,assert,assertArity,assertType,assignID,base,bind,copy,delegate,detect,extend,forEach,format,instanceOf,match,partial,rescape,slice,trim,unbind%22;%0A%0A//%20Firefox%27s%20reduce%20does%20not%20support%20fourth%20argument.%0AArray2.reduce%20=%20Enumerable.reduce;%0A%0Abase2%20=%20new%20Namespace%28this,%20base2%29;%0Aeval%28this.exports%29;%0A%0Abase2.base%20=%20base;%0Abase2.extend%20=%20extend;%0A%0AforEach%20%28Enumerable,%20function%28method,%20name%29%20%7B%0A%09if%20%28!Module%5Bname%5D%29%20base2.addName%28name,%20bind%28method,%20Enumerable%29%29;%0A%7D%29;%0A%0A%7D;%20////////////////////%20%20END:%20CLOSURE%20%20/////////////////////////////////////%0A%0A/*%0A%09Packer%20version%203.0%20%28beta%209%29%20-%20copyright%202004-2007,%20Dean%20Edwards%0A%09http://www.opensource.org/licenses/mit-license%0A*/%0A%0Aeval%28base2.namespace%29;%0A%0Avar%20IGNORE%20=%20RegGrp.IGNORE;%0Avar%20REMOVE%20=%20%22%22;%0Avar%20SPACE%20=%20%22%20%22;%0Avar%20WORDS%20=%20/%5Cw+/g;%0A%0Avar%20Packer%20=%20Base.extend%28%7B%0A%09minify:%20function%28script%29%20%7B%0A%09%09script%20=%20script.replace%28Packer.CONTINUE,%20%22%22%29;%0A%09%09script%20=%20Packer.data.exec%28script%29;%0A%09%09script%20=%20Packer.whitespace.exec%28script%29;%0A%09%09script%20=%20Packer.clean.exec%28script%29;%0A%09%09return%20script;%0A%09%7D,%0A%09%0A%09pack:%20function%28script,%20base62,%20shrink%29%20%7B%0A%09%09script%20=%20this.minify%28script%20+%20%22%5Cn%22%29;%0A%09%09if%20%28shrink%29%20script%20=%20this._shrinkVariables%28script%29;%0A%09%09if%20%28base62%29%20script%20=%20this._base62Encode%28script%29;%09%0A%09%09return%20script;%0A%09%7D,%0A%09%0A%09_base62Encode:%20function%28script%29%20%7B%0A%09%09var%20words%20=%20new%20Words%28script%29;%0A%09%09var%20encode%20=%20function%28word%29%20%7B%0A%09%09%09return%20words.fetch%28word%29.encoded;%0A%09%09%7D;%0A%09%09%0A%09%09/*%20build%20the%20packed%20script%20*/%0A%09%09%0A%09%09var%20p%20=%20this._escape%28script.replace%28WORDS,%20encode%29%29;%09%09%0A%09%09var%20a%20=%20Math.min%28Math.max%28words.count%28%29,%202%29,%2062%29;%09%09%0A%09%09var%20c%20=%20words.count%28%29;%09%09%0A%09%09var%20k%20=%20words;%0A%09%09var%20e%20=%20Packer%5B%22ENCODE%22%20+%20%28a%20%3E%2010%20%3F%20a%20%3E%2036%20%3F%2062%20:%2036%20:%2010%29%5D;%0A%09%09var%20r%20=%20a%20%3E%2010%20%3F%20%22e%28c%29%22%20:%20%22c%22;%0A%09%09%0A%09%09//%20the%20whole%20thing%0A%09%09return%20format%28Packer.UNPACK,%20p,a,c,k,e,r%29;%0A%09%7D,%0A%09%0A%09_escape:%20function%28script%29%20%7B%0A%09%09//%20single%20quotes%20wrap%20the%20final%20string%20so%20escape%20them%0A%09%09//%20also%20escape%20new%20lines%20required%20by%20conditional%20comments%0A%09%09return%20script.replace%28/%28%5B%5C%5C%27%5D%29/g,%20%22%5C%5C$1%22%29.replace%28/%5B%5Cr%5Cn%5D+/g,%20%22%5C%5Cn%22%29;%0A%09%7D,%0A%09%0A%09_shrinkVariables:%20function%28script%29%20%7B%0A%09%09//%20Windows%20Scripting%20Host%20cannot%20do%20regexp.test%28%29%20on%20global%20regexps.%0A%09%09var%20global%20=%20function%28regexp%29%20%7B%0A%09%09%09//%20This%20function%20creates%20a%20global%20version%20of%20the%20passed%20regexp.%0A%09%09%09return%20new%20RegExp%28regexp.source,%20%22g%22%29;%0A%09%09%7D;%0A%09%09%0A%09%09var%20data%20=%20%5B%5D;%20//%20encoded%20strings%20and%20regular%20expressions%0A%09%09var%20REGEXP%20=%20/%5E%5B%5E%27%22%5D%5C//;%0A%09%09var%20store%20=%20function%28string%29%20%7B%0A%09%09%09var%20replacement%20=%20%22%23%22%20+%20data.length;%0A%09%09%09if%20%28REGEXP.test%28string%29%29%20%7B%0A%09%09%09%09replacement%20=%20string.charAt%280%29%20+%20replacement;%0A%09%09%09%09string%20=%20string.slice%281%29;%0A%09%09%09%7D%0A%09%09%09data.push%28string%29;%0A%09%09%09return%20replacement;%0A%09%09%7D;%0A%09%09%0A%09%09//%20Base52%20encoding%20%28a-Z%29%0A%09%09var%20encode52%20=%20function%28c%29%20%7B%0A%09%09%09return%20%28c%20%3C%2052%20%3F%20%27%27%20:%20arguments.callee%28parseInt%28c%20/%2052%29%29%29%20+%0A%09%09%09%09%28%28c%20=%20c%20%25%2052%29%20%3E%2025%20%3F%20String.fromCharCode%28c%20+%2039%29%20:%20String.fromCharCode%28c%20+%2097%29%29;%0A%09%09%7D;%0A%09%09%09%09%0A%09%09//%20identify%20blocks,%20particularly%20identify%20function%20blocks%20%28which%20define%20scope%29%0A%09%09var%20BLOCK%20=%20/%28function%5Cs*%5B%5Cw$%5D*%5Cs*%5C%28%5Cs*%28%5B%5E%5C%29%5D*%29%5Cs*%5C%29%5Cs*%29%3F%28%5C%7B%28%5B%5E%7B%7D%5D*%29%5C%7D%29/;%0A%09%09var%20VAR_%20=%20/var%5Cs+/g;%0A%09%09var%20VAR_NAME%20=%20/var%5Cs+%5B%5Cw$%5D+/g;%0A%09%09var%20COMMA%20=%20/%5Cs*,%5Cs*/;%0A%09%09var%20blocks%20=%20%5B%5D;%20//%20store%20program%20blocks%20%28anything%20between%20braces%20%7B%7D%29%0A%09%09//%20encoder%20for%20program%20blocks%0A%09%09var%20encode%20=%20function%28block,%20func,%20args%29%20%7B%0A%09%09%09if%20%28func%29%20%7B%20//%20the%20block%20is%20a%20function%20block%0A%09%09%09%0A%09%09%09%09//%20decode%20the%20function%20block%20%28THIS%20IS%20THE%20IMPORTANT%20BIT%29%0A%09%09%09%09//%20We%20are%20retrieving%20all%20sub-blocks%20and%20will%20re-parse%20them%20in%20light%0A%09%09%09%09//%20of%20newly%20shrunk%20variables%0A%09%09%09%09block%20=%20decode%28block%29;%0A%09%09%09%09%0A%09%09%09%09//%20create%20the%20list%20of%20variable%20and%20argument%20names%20%0A%09%09%09%09var%20vars%20=%20match%28block,%20VAR_NAME%29.join%28%22,%22%29.replace%28VAR_,%20%22%22%29;%0A%09%09%09%09var%20ids%20=%20Array2.combine%28args.split%28COMMA%29.concat%28vars.split%28COMMA%29%29%29;%0A%09%09%09%09%0A%09%09%09%09//%20process%20each%20identifier%0A%09%09%09%09var%20count%20=%200,%20shortId;%0A%09%09%09%09forEach%20%28ids,%20function%28id%29%20%7B%0A%09%09%09%09%09id%20=%20trim%28id%29;%0A%09%09%09%09%09if%20%28id%20%26%26%20id.length%20%3E%201%29%20%7B%20//%20%3E%201%20char%0A%09%09%09%09%09%09id%20=%20rescape%28id%29;%0A%09%09%09%09%09%09//%20find%20the%20next%20free%20short%20name%20%28check%20everything%20in%20the%20current%20scope%29%0A%09%09%09%09%09%09do%20shortId%20=%20encode52%28count++%29;%0A%09%09%09%09%09%09while%20%28new%20RegExp%28%22%5B%5E%5C%5Cw$.%5D%22%20+%20shortId%20+%20%22%5B%5E%5C%5Cw$:%5D%22%29.test%28block%29%29;%0A%09%09%09%09%09%09//%20replace%20the%20long%20name%20with%20the%20short%20name%0A%09%09%09%09%09%09var%20reg%20=%20new%20RegExp%28%22%28%5B%5E%5C%5Cw$.%5D%29%22%20+%20id%20+%20%22%28%5B%5E%5C%5Cw$:%5D%29%22%29;%0A%09%09%09%09%09%09while%20%28reg.test%28block%29%29%20block%20=%20block.replace%28global%28reg%29,%20%22$1%22%20+%20shortId%20+%20%22$2%22%29;%0A%09%09%09%09%09%09var%20reg%20=%20new%20RegExp%28%22%28%5B%5E%7B,%5C%5Cw$.%5D%29%22%20+%20id%20+%20%22:%22,%20%22g%22%29;%0A%09%09%09%09%09%09block%20=%20block.replace%28reg,%20%22$1%22%20+%20shortId%20+%20%22:%22%29;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%29;%0A%09%09%09%7D%0A%09%09%09var%20replacement%20=%20%22~%22%20+%20blocks.length%20+%20%22~%22;%0A%09%09%09blocks.push%28block%29;%0A%09%09%09return%20replacement;%0A%09%09%7D;%0A%09%09%0A%09%09//%20decoder%20for%20program%20blocks%0A%09%09var%20ENCODED%20=%20/~%28%5Cd+%29~/;%0A%09%09var%20decode%20=%20function%28script%29%20%7B%0A%09%09%09while%20%28ENCODED.test%28script%29%29%20%7B%0A%09%09%09%09script%20=%20script.replace%28global%28ENCODED%29,%20function%28match,%20index%29%20%7B%0A%09%09%09%09%09return%20blocks%5Bindex%5D;%0A%09%09%09%09%7D%29;%0A%09%09%09%7D%0A%09%09%09return%20script;%0A%09%09%7D;%0A%09%09%0A%09%09//%20encode%20strings%20and%20regular%20expressions%0A%09%09script%20=%20Packer.data.exec%28script,%20store%29;%0A%09%09%0A%09%09//%20remove%20closures%20%28this%20is%20for%20base2%20namespaces%20only%29%0A%09%09script%20=%20script.replace%28/new%20function%5C%28_%5C%29%5Cs*%5C%7B/g,%20%22%7B;%23;%22%29;%0A%09%09%0A%09%09//%20encode%20blocks,%20as%20we%20encode%20we%20replace%20variable%20and%20argument%20names%0A%09%09while%20%28BLOCK.test%28script%29%29%20%7B%0A%09%09%09script%20=%20script.replace%28global%28BLOCK%29,%20encode%29;%0A%09%09%7D%0A%09%09%0A%09%09//%20put%20the%20blocks%20back%0A%09%09script%20=%20decode%28script%29;%0A%09%09%0A%09%09//%20put%20back%20the%20closure%20%28for%20base2%20namespaces%20only%29%0A%09%09script%20=%20script.replace%28/%5C%7B;%23;/g,%20%22new%20function%28_%29%7B%22%29;%0A%09%09%0A%09%09//%20put%20strings%20and%20regular%20expressions%20back%0A%09%09script%20=%20script.replace%28/%23%28%5Cd+%29/g,%20function%28match,%20index%29%20%7B%09%09%0A%09%09%09return%20data%5Bindex%5D;%0A%09%09%7D%29;%0A%09%09%0A%09%09return%20script;%0A%09%7D%0A%7D,%20%7B%0A%09CONTINUE:%20/%5C%5C%5Cr%3F%5Cn/g,%0A%09%0A%09ENCODE10:%20%22String%22,%0A%09ENCODE36:%20%22function%28c%29%7Breturn%20c.toString%28a%29%7D%22,%0A%09ENCODE62:%20%22function%28c%29%7Breturn%28c%3Ca%3F%27%27:e%28parseInt%28c/a%29%29%29+%28%28c=c%25a%29%3E35%3FString.fromCharCode%28c+29%29:c.toString%2836%29%29%7D%22,%0A%09%0A%09UNPACK:%20%22eval%28function%28p,a,c,k,e,r%29%7Be=%255;if%28!%27%27.replace%28/%5E/,String%29%29%7Bwhile%28c--%29r%5B%256%5D=k%5Bc%5D%22%20+%0A%09%20%20%20%20%20%20%20%20%22%7C%7C%256;k=%5Bfunction%28e%29%7Breturn%20r%5Be%5D%7D%5D;e=function%28%29%7Breturn%27%5C%5C%5C%5Cw+%27%7D;c=1%7D;while%28c--%29if%28k%5Bc%5D%29p=p.%22%20+%0A%09%09%09%22replace%28new%20RegExp%28%27%5C%5C%5C%5Cb%27+e%28c%29+%27%5C%5C%5C%5Cb%27,%27g%27%29,k%5Bc%5D%29;return%20p%7D%28%27%251%27,%252,%253,%27%254%27.split%28%27%7C%27%29,0,%7B%7D%29%29%22,%0A%09%0A%09init:%20function%28%29%20%7B%0A%09%09this.data%20=%20reduce%28this.data,%20function%28data,%20replacement,%20expression%29%20%7B%0A%09%09%09data.store%28this.javascript.exec%28expression%29,%20replacement%29;%0A%09%09%09return%20data;%0A%09%09%7D,%20new%20RegGrp,%20this%29;%0A%09%09this.clean%20=%20this.data.union%28this.clean%29;%0A%09%09this.whitespace%20=%20this.data.union%28this.whitespace%29;%0A%09%7D,%0A%09%0A%09clean:%20%7B%0A%09%09%22%5C%5C%28%5C%5Cs*;%5C%5Cs*;%5C%5Cs*%5C%5C%29%22:%20%22%28;;%29%22,%20//%20for%20%28;;%29%20loops%0A%09%09%22throw%5B%5E%7D;%5D+%5B%7D;%5D%22:%20IGNORE,%20//%20a%20safari%201.3%20bug%0A%09%09%22;+%5C%5Cs*%28%5B%7D;%5D%29%22:%20%22$1%22%0A%09%7D,%0A%09%0A%09data:%20%7B%0A%09%09//%20strings%0A%09%09%22STRING1%22:%20IGNORE,%0A%09%09%27STRING2%27:%20IGNORE,%0A%09%09%22CONDITIONAL%22:%20IGNORE,%20//%20conditional%20comments%0A%09%09%22%28COMMENT1%29%5C%5Cn%5C%5Cs*%28REGEXP%29%3F%22:%20%22%5Cn$3%22,%0A%09%09%22%28COMMENT2%29%5C%5Cs*%28REGEXP%29%3F%22:%20%22%20$3%22,%0A%09%09%22%28%5B%5C%5C%5B%28%5C%5C%5E=,%7B%7D:;%26%7C!*%3F%5D%29%5C%5Cs*%28REGEXP%29%22:%20%22$1$2%22%0A%09%7D,%0A%09%0A%09javascript:%20new%20RegGrp%28%7B%0A%09%09COMMENT1:%20%20%20%20/%28%5C/%5C/%7C;;;%29%5B%5E%5Cn%5D*/.source,%0A%09%09COMMENT2:%20%20%20%20/%5C/%5C*%5B%5E*%5D*%5C*+%28%5B%5E%5C/%5D%5B%5E*%5D*%5C*+%29*%5C//.source,%0A%09%09CONDITIONAL:%20/%5C/%5C*@%7C@%5C*%5C/%7C%5C/%5C/@%5B%5E%5Cn%5D*%5Cn/.source,%0A%09%09REGEXP:%20%20%20%20%20%20/%5C/%28%5C%5C%5B%5C/%5C%5C%5D%7C%5B%5E*%5C/%5D%29%28%5C%5C.%7C%5B%5E%5C/%5Cn%5C%5C%5D%29*%5C/%5Bgim%5D*/.source,%0A%09%09STRING1:%20%20%20%20%20/%27%28%5C%5C.%7C%5B%5E%27%5C%5C%5D%29*%27/.source,%0A%09%09STRING2:%20%20%20%20%20/%22%28%5C%5C.%7C%5B%5E%22%5C%5C%5D%29*%22/.source%0A%09%7D%29,%0A%09%0A%09whitespace:%20%7B%0A%09%09%22%28%5C%5Cd%29%5C%5Cs+%28%5C%5C.%5C%5Cs*%5Ba-z%5C%5C$_%5C%5C%5B%28%5D%29%22:%20%22$1%20$2%22,%20//%20http://dean.edwards.name/weblog/2007/04/packer3/%23comment84066%0A%09%09%22%28%5B+-%5D%29%5C%5Cs+%28%5B+-%5D%29%22:%20%22$1%20$2%22,%20//%20c%20=%20a++%20+b;%0A%09%09%22%5C%5Cb%5C%5Cs+%5C%5C$%5C%5Cs+%5C%5Cb%22:%20%22%20$%20%22,%20//%20var%20$%20in%0A%09%09%22%5C%5C$%5C%5Cs+%5C%5Cb%22:%20%22$%20%22,%20//%20object$%20in%0A%09%09%22%5C%5Cb%5C%5Cs+%5C%5C$%22:%20%22%20$%22,%20//%20return%20$object%0A%09%09%22%5C%5Cb%5C%5Cs+%5C%5Cb%22:%20SPACE,%0A%09%09%22%5C%5Cs+%22:%20REMOVE%0A%09%7D%0A%7D%29;%0A%0A%0A/*%20%3Chttp://dean.edwards.name/packer/Words.js%3E%20*/%0A%0Avar%20Words%20=%20Collection.extend%28%7B%0A%09constructor:%20function%28script%29%20%7B%0A%09%09this.base%28%29;%0A%09%09forEach%20%28script.match%28WORDS%29,%20this.add,%20this%29;%0A%09%09this.encode%28%29;%0A%09%7D,%0A%09%0A%09add:%20function%28word%29%20%7B%0A%09%09if%20%28!this.exists%28word%29%29%20this.base%28word%29;%0A%09%09word%20=%20this.fetch%28word%29;%0A%09%09word.count++;%0A%09%09return%20word;%0A%09%7D,%0A%09%0A%09encode:%20function%28%29%20%7B%0A%09%09//%20sort%20by%20frequency%0A%09%09this.sort%28function%28word1,%20word2%29%20%7B%0A%09%09%09return%20word2.count%20-%20word1.count;%0A%09%09%7D%29;%0A%09%09%0A%09%09eval%28%22var%20a=62,e=%22%20+%20Packer.ENCODE62%29;%0A%09%09var%20encode%20=%20e;%09%09%0A%09%09var%20encoded%20=%20new%20Collection;%20//%20a%20dictionary%20of%20base62%20-%3E%20base10%0A%09%09var%20count%20=%20this.count%28%29;%0A%09%09for%20%28var%20i%20=%200;%20i%20%3C%20count;%20i++%29%20%7B%0A%09%09%09encoded.store%28encode%28i%29,%20i%29;%0A%09%09%7D%0A%09%09%0A%09%09var%20empty%20=%20function%28%29%20%7Breturn%20%22%22%7D;%0A%09%09var%20index%20=%200;%0A%09%09forEach%20%28this,%20function%28word%29%20%7B%0A%09%09%09if%20%28encoded.exists%28word%29%29%20%7B%0A%09%09%09%09word.index%20=%20encoded.fetch%28word%29;%0A%09%09%09%09word.toString%20=%20empty;%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09while%20%28this.exists%28encode%28index%29%29%29%20index++;%0A%09%09%09%09word.index%20=%20index++;%0A%09%09%09%7D%0A%09%09%09word.encoded%20=%20encode%28word.index%29;%0A%09%09%7D,%20this%29;%0A%09%09%0A%09%09//%20sort%20by%20encoding%0A%09%09this.sort%28function%28word1,%20word2%29%20%7B%0A%09%09%09return%20word1.index%20-%20word2.index;%0A%09%09%7D%29;%0A%09%7D,%0A%09%0A%09values:%20function%28%29%20%7B%0A%09%09var%20l%20=%20%5B%5D;%0A%09%09this.forEach%28function%28value%29%20%7B%0A%09%09%09l.push%28value%29;%0A%09%09%7D%29;%0A%09%09return%20l;%0A%09%7D,%0A%09%0A%09toString:%20function%28%29%20%7B%0A%09%09return%20this.values%28%29.join%28%22%7C%22%29;%0A%09%7D%0A%7D,%20%7B%0A%09Item:%20%7B%0A%09%09constructor:%20function%28word%29%20%7B%0A%09%09%09this.toString%20=%20function%28%29%20%7Breturn%20word%7D;%0A%09%09%7D,%0A%09%09%0A%09%09count:%200,%0A%09%09encoded:%20%22%22,%0A%09%09index:%20-1%0A%09%7D%0A%7D%29;%0A%3C/script%3E

License

[5] Same as Perl. Alternatively, you can select MPL/GPL/LGPL. For more details, see the license terms included in the bookmarklet code itself.

Notes