├── backend
├── oembed.json
└── node_server.js
├── js
├── templates
│ ├── widget.ms
│ └── feed.ms
├── client.js
└── lib
│ ├── mustache.js
│ ├── sammy.js
│ ├── html-sanitizer-minified.js
│ └── jquery.js
├── gadgets
├── hello_world.xml
├── sample-pubsub-publisher.xml
└── sample-pubsub-subscriber.xml
├── callback.html
└── index.html
/backend/oembed.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "type": "rich",
4 | "width": 425,
5 | "height": 344,
6 | "html": "foo"
7 | }
--------------------------------------------------------------------------------
/js/templates/widget.ms:
--------------------------------------------------------------------------------
1 | {{{widget}}}
2 |
3 |
4 |
5 |
6 |
7 | Feed
--------------------------------------------------------------------------------
/gadgets/hello_world.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/callback.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/js/templates/feed.ms:
--------------------------------------------------------------------------------
1 |
5 |
6 |
18 |
19 | notification
20 | Widget
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/gadgets/sample-pubsub-publisher.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
24 |
25 |
26 |
28 | function publish() {
29 | var message = Math.random();
30 | gadgets.pubsub.publish("random-number", message);
31 | document.getElementById("output").innerHTML = message;
32 | }
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | ]]>
41 |
42 |
43 |
--------------------------------------------------------------------------------
/backend/node_server.js:
--------------------------------------------------------------------------------
1 | // needs socket.io install with: npm install socket.io
2 | var sys = require('sys'),
3 | url = require('url'),
4 | qs = require('querystring'),
5 | io = require('socket.io'),
6 | http = require('http'),
7 | server,
8 | ioServer,
9 | ioSendFunction;
10 |
11 | server = http.createServer(function (req, res) {
12 | var parsedUrl = url.parse(req.url);
13 | res.writeHead(200, {
14 | 'Content-Type': 'text/plain',
15 | 'Access-Control-Allow-Origin': '*'
16 | });
17 | if (req.method == "POST") {
18 | sys.puts('received post');
19 | var buffer = [];
20 | req.on("data", function(chunk) {
21 | sys.puts(chunk);
22 | buffer.push(chunk);
23 | });
24 | req.on("end", function() {
25 | sys.puts('end post');
26 | if (ioSendFunction) {
27 | ioSendFunction(buffer.join(''));
28 | }
29 | res.end();
30 | });
31 |
32 | } else if (typeof(parsedUrl['query']) != "undefined") {
33 | sys.puts('received get');
34 | var params = qs.parse(parsedUrl['query']);
35 | if (typeof(params['hub.challenge']) != "undefined") {
36 | sys.puts(params['hub.mode']);
37 | sys.puts('got challenge' + params['hub.challenge']);
38 | res.write(params['hub.challenge']);
39 | }
40 | res.end();
41 | }
42 | });
43 |
44 | server.listen(8000);
45 |
46 | sys.puts('Server running at http://127.0.0.1:8000/');
47 |
48 |
49 | ioServer = io.listen(server);
50 |
51 | ioServer.on('connection', function(client){
52 | client.send('hello');
53 | ioSendFunction = function(text) {
54 | client.send(text);
55 | }
56 |
57 | client.on('message', function(message){
58 | });
59 |
60 | client.on('disconnect', function(){
61 | });
62 | });
63 |
64 |
--------------------------------------------------------------------------------
/gadgets/sample-pubsub-subscriber.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
24 |
25 |
26 |
28 | function callback(sender, message) {
29 | document.getElementById("output").innerHTML =
30 | "message : " + gadgets.util.escapeString(message + "") + "
" +
31 | "sender : " + gadgets.util.escapeString(sender);
32 | }
33 |
34 | function subscribe() {
35 | gadgets.pubsub.subscribe("random-number", callback);
36 | }
37 |
38 | function unsubscribe() {
39 | gadgets.pubsub.unsubscribe("random-number");
40 | document.getElementById("output").innerHTML = "";
41 | }
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | ]]>
51 |
52 |
53 |
--------------------------------------------------------------------------------
/js/client.js:
--------------------------------------------------------------------------------
1 | var feed = [];
2 | var app = Sammy('#main', function() {
3 | this.use(Sammy.Mustache, 'ms');
4 | this.get('#/', function() {
5 | this.trigger('getFeed');
6 | });
7 | this.get('#Login', function() {
8 | var consumerKey = '2e70313dfb8a673a1ad84f441595b38e';
9 | window.open('http://status.net.xyz:8061/index.php/api/oauth2/authorize?response_toke=token&client_id=' + consumerKey);
10 | });
11 | this.post('#Post', function() {
12 | var that = this;
13 | $.ajax({
14 | url: 'http://status.net.xyz:8061/index.php/api/statuses/update.json?oauth_token=' + oauth2.authParameters['access_token'],
15 | type: 'POST',
16 | data: {
17 | 'status': that.params['post']
18 | },
19 | success: function() {
20 | that.redirect('#/');
21 | }
22 | });
23 | });
24 | this.get('#Widget', function() {
25 | var that = this;
26 | $.ajax({
27 | url: 'http://localhost:8062/statusnet_js_client/backend/oembed.json',
28 | success: function(result) {
29 | that.widget = html_sanitize(result.html);
30 | that.partial('js/templates/widget.ms');
31 | }
32 | });
33 | });
34 | this.bind('changed', function() {
35 | if ($('#gadget-chrome-0').length > 0) {
36 | container.init();
37 | container.renderGadgets();
38 | }
39 | resolveEmbeds();
40 | });
41 | this.bind('getFeed', function() {
42 | oauth2.retrieveAccessToken();
43 | if (! oauth2.authParameters || ! oauth2.authParameters['access_token']) {
44 | this.redirect('#Login');
45 | return;
46 | }
47 | var that = this;
48 | $.ajax({
49 | url: 'http://status.net.xyz:8061/index.php/api/statuses/home_timeline.json?oauth_token=' + oauth2.authParameters['access_token'],
50 | success: function(response) {
51 | feed = response;
52 | that.trigger('renderFeed');
53 | that.trigger('connect');
54 | }
55 | });
56 | });
57 | this.bind('renderFeed', function() {
58 | this.feed = feed;
59 | this.partial('js/templates/feed.ms');
60 | });
61 | this.bind('connect', function() {
62 | var that = this;
63 | var socket = new io.Socket('127.0.0.1', {port: 8000, rememberTransport: false});
64 | socket.connect();
65 | socket.on('message', function(obj){
66 | if (obj === 'hello') {
67 | return;
68 | }
69 | xmlDoc=$(obj);
70 | xmlDoc.find('entry').each(function() {
71 | feed = [{
72 | 'statusnet_html': $(this).find('content').text(),
73 | 'created_at': $(this).find('published').text(),
74 | 'user': {
75 | 'name': xmlDoc.find('author').find('poco\\:displayName').text()
76 | }
77 | }].concat(feed);
78 | window.webkitNotifications.createNotification(null, 'New message', $(this).find('content').text()).show();
79 | that.trigger('renderFeed');
80 | });
81 | });
82 |
83 | socket.on('connect', function(){
84 | console.log('connected');
85 | that.trigger('subscribe');
86 | });
87 | socket.on('disconnect', function(){console.log('disconnected');});
88 | socket.on('reconnect', function(){console.log('reconnected');});
89 | });
90 | this.bind('subscribe', function() {
91 | console.log('subscribe to feed');
92 | var feed = 'http://status.net.xyz:8061/index.php/api/statuses/user_timeline/3.atom';
93 | var hub = 'http://status.net.xyz:8061/index.php/main/push/hub';
94 | $.ajax({
95 | url: hub,
96 | type: 'POST',
97 | data: {
98 | 'hub.topic': feed,
99 | 'hub.callback': 'http://127.0.0.1:8000/',
100 | 'hub.mode': 'subscribe',
101 | 'hub.verify': 'async'
102 | },
103 | success: function(response) {
104 | console.log(response);
105 | }
106 | });
107 | });
108 | });
109 |
110 | jQuery(function() {
111 | app.run('#/');
112 | });
113 |
114 | var oauth2 = {
115 | authParameters: {},
116 | storeAccessToken : function(fragment) {
117 | fragment = fragment.split('+').join('%252b');
118 | fragment = fragment.split('&');
119 | for (var i = 0; i < fragment.length; i++) {
120 | var ix = fragment[i].indexOf('=');
121 | if (ix > 0) {
122 | oauth2.authParameters[fragment[i].substr(0, ix)] = decodeURIComponent(fragment[i].substr(ix + 1));
123 | }
124 | }
125 | localStorage.setItem("access_token", oauth2.authParameters['access_token']);
126 | app.trigger('getFeed');
127 | },
128 | retrieveAccessToken: function() {
129 | oauth2.authParameters['access_token'] = localStorage.getItem("access_token");
130 | }
131 | }
132 |
133 |
134 |
135 | var container = {};
136 |
137 | container.gadgetSpecUrls = [
138 | 'http://localhost:8062/statusnet_js_client/gadgets/hello_world.xml',
139 | 'http://localhost:8062/statusnet_js_client/gadgets/sample-pubsub-publisher.xml',
140 | 'http://localhost:8062/statusnet_js_client/gadgets/sample-pubsub-subscriber.xml'
141 | ];
142 |
143 | container.LayoutManager = function() {
144 | shindig.LayoutManager.call(this);
145 | };
146 |
147 | container.LayoutManager.inherits(shindig.LayoutManager);
148 |
149 | container.LayoutManager.prototype.getGadgetChrome = function(gadget) {
150 | var chromeId = 'gadget-chrome-' + gadget.id;
151 | return chromeId ? document.getElementById(chromeId) : null;
152 | };
153 |
154 | container.init = function() {
155 | gadgets.pubsubrouter.init(function(id) {
156 | var gadgetId = shindig.container.gadgetService.getGadgetIdFromModuleId(id);
157 | var gadget = shindig.container.getGadget(gadgetId);
158 | return gadget.specUrl;
159 | }, {
160 | onSubscribe: function(sender, channel) {
161 | console.log(sender + " subscribes to channel '" + channel + "'");
162 | // return true to reject the request.
163 | return false;
164 | },
165 | onUnsubscribe: function(sender, channel) {
166 | console.log(sender + " unsubscribes from channel '" + channel + "'");
167 | // return true to reject the request.
168 | return false;
169 | },
170 | onPublish: function(sender, channel, message) {
171 | console.log(sender + " publishes '" + message + "' to channel '" + channel + "'");
172 | // return true to reject the request.
173 | return false;
174 | }
175 | });
176 | shindig.container.layoutManager = new container.LayoutManager();
177 | };
178 |
179 | container.renderGadgets = function() {
180 | shindig.container.setParentUrl("http://" + window.location.host + "/");
181 | for (var i = 0; i < container.gadgetSpecUrls.length; ++i) {
182 | var gadget = shindig.container.createGadget(
183 | {debug:1,specUrl: container.gadgetSpecUrls[i], title: "Gadget"});
184 | gadget.setServerBase('http://localhost:8080/gadgets/');
185 | shindig.container.addGadget(gadget);
186 | shindig.container.renderGadget(gadget);
187 |
188 | }
189 | };
190 |
--------------------------------------------------------------------------------
/js/lib/mustache.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 |
3 | if (!window.Mustache) {
4 |
5 | /*
6 | mustache.js — Logic-less templates in JavaScript
7 |
8 | See http://mustache.github.com/ for more info.
9 | */
10 |
11 | var Mustache = function() {
12 | var Renderer = function() {};
13 |
14 | Renderer.prototype = {
15 | otag: "{{",
16 | ctag: "}}",
17 | pragmas: {},
18 | buffer: [],
19 | pragmas_implemented: {
20 | "IMPLICIT-ITERATOR": true
21 | },
22 | context: {},
23 |
24 | render: function(template, context, partials, in_recursion) {
25 | // reset buffer & set context
26 | if(!in_recursion) {
27 | this.context = context;
28 | this.buffer = []; // TODO: make this non-lazy
29 | }
30 |
31 | // fail fast
32 | if(!this.includes("", template)) {
33 | if(in_recursion) {
34 | return template;
35 | } else {
36 | this.send(template);
37 | return;
38 | }
39 | }
40 |
41 | template = this.render_pragmas(template);
42 | var html = this.render_section(template, context, partials);
43 | if(in_recursion) {
44 | return this.render_tags(html, context, partials, in_recursion);
45 | }
46 |
47 | this.render_tags(html, context, partials, in_recursion);
48 | },
49 |
50 | /*
51 | Sends parsed lines
52 | */
53 | send: function(line) {
54 | if(line != "") {
55 | this.buffer.push(line);
56 | }
57 | },
58 |
59 | /*
60 | Looks for %PRAGMAS
61 | */
62 | render_pragmas: function(template) {
63 | // no pragmas
64 | if(!this.includes("%", template)) {
65 | return template;
66 | }
67 |
68 | var that = this;
69 | var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
70 | this.ctag);
71 | return template.replace(regex, function(match, pragma, options) {
72 | if(!that.pragmas_implemented[pragma]) {
73 | throw({message:
74 | "This implementation of mustache doesn't understand the '" +
75 | pragma + "' pragma"});
76 | }
77 | that.pragmas[pragma] = {};
78 | if(options) {
79 | var opts = options.split("=");
80 | that.pragmas[pragma][opts[0]] = opts[1];
81 | }
82 | return "";
83 | // ignore unknown pragmas silently
84 | });
85 | },
86 |
87 | /*
88 | Tries to find a partial in the curent scope and render it
89 | */
90 | render_partial: function(name, context, partials) {
91 | name = this.trim(name);
92 | if(!partials || partials[name] === undefined) {
93 | throw({message: "unknown_partial '" + name + "'"});
94 | }
95 | if(typeof(context[name]) != "object") {
96 | return this.render(partials[name], context, partials, true);
97 | }
98 | return this.render(partials[name], context[name], partials, true);
99 | },
100 |
101 | /*
102 | Renders inverted (^) and normal (#) sections
103 | */
104 | render_section: function(template, context, partials) {
105 | if(!this.includes("#", template) && !this.includes("^", template)) {
106 | return template;
107 | }
108 |
109 | var that = this;
110 | // CSW - Added "+?" so it finds the tighest bound, not the widest
111 | var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
112 | "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag +
113 | "\\s*", "mg");
114 |
115 | // for each {{#foo}}{{/foo}} section do...
116 | return template.replace(regex, function(match, type, name, content) {
117 | var value = that.find(name, context);
118 | if(type == "^") { // inverted section
119 | if(!value || that.is_array(value) && value.length === 0) {
120 | // false or empty list, render it
121 | return that.render(content, context, partials, true);
122 | } else {
123 | return "";
124 | }
125 | } else if(type == "#") { // normal section
126 | if(that.is_array(value)) { // Enumerable, Let's loop!
127 | return that.map(value, function(row) {
128 | return that.render(content, that.create_context(row),
129 | partials, true);
130 | }).join("");
131 | } else if(that.is_object(value)) { // Object, Use it as subcontext!
132 | return that.render(content, that.create_context(value),
133 | partials, true);
134 | } else if(typeof value === "function") {
135 | // higher order section
136 | return value.call(context, content, function(text) {
137 | return that.render(text, context, partials, true);
138 | });
139 | } else if(value) { // boolean section
140 | return that.render(content, context, partials, true);
141 | } else {
142 | return "";
143 | }
144 | }
145 | });
146 | },
147 |
148 | /*
149 | Replace {{foo}} and friends with values from our view
150 | */
151 | render_tags: function(template, context, partials, in_recursion) {
152 | // tit for tat
153 | var that = this;
154 |
155 | var new_regex = function() {
156 | return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" +
157 | that.ctag + "+", "g");
158 | };
159 |
160 | var regex = new_regex();
161 | var tag_replace_callback = function(match, operator, name) {
162 | switch(operator) {
163 | case "!": // ignore comments
164 | return "";
165 | case "=": // set new delimiters, rebuild the replace regexp
166 | that.set_delimiters(name);
167 | regex = new_regex();
168 | return "";
169 | case ">": // render partial
170 | return that.render_partial(name, context, partials);
171 | case "{": // the triple mustache is unescaped
172 | return that.find(name, context);
173 | default: // escape the value
174 | return that.escape(that.find(name, context));
175 | }
176 | };
177 | var lines = template.split("\n");
178 | for(var i = 0; i < lines.length; i++) {
179 | lines[i] = lines[i].replace(regex, tag_replace_callback, this);
180 | if(!in_recursion) {
181 | this.send(lines[i]);
182 | }
183 | }
184 |
185 | if(in_recursion) {
186 | return lines.join("\n");
187 | }
188 | },
189 |
190 | set_delimiters: function(delimiters) {
191 | var dels = delimiters.split(" ");
192 | this.otag = this.escape_regex(dels[0]);
193 | this.ctag = this.escape_regex(dels[1]);
194 | },
195 |
196 | escape_regex: function(text) {
197 | // thank you Simon Willison
198 | if(!arguments.callee.sRE) {
199 | var specials = [
200 | '/', '.', '*', '+', '?', '|',
201 | '(', ')', '[', ']', '{', '}', '\\'
202 | ];
203 | arguments.callee.sRE = new RegExp(
204 | '(\\' + specials.join('|\\') + ')', 'g'
205 | );
206 | }
207 | return text.replace(arguments.callee.sRE, '\\$1');
208 | },
209 |
210 | /*
211 | find `name` in current `context`. That is find me a value
212 | from the view object
213 | */
214 | find: function(name, context) {
215 | name = this.trim(name);
216 |
217 | // Checks whether a value is thruthy or false or 0
218 | function is_kinda_truthy(bool) {
219 | return bool === false || bool === 0 || bool;
220 | }
221 |
222 | var value;
223 | if(is_kinda_truthy(context[name])) {
224 | value = context[name];
225 | } else if(is_kinda_truthy(this.context[name])) {
226 | value = this.context[name];
227 | }
228 |
229 | if(typeof value === "function") {
230 | return value.apply(context);
231 | }
232 | if(value !== undefined) {
233 | return value;
234 | }
235 | // silently ignore unkown variables
236 | return "";
237 | },
238 |
239 | // Utility methods
240 |
241 | /* includes tag */
242 | includes: function(needle, haystack) {
243 | return haystack.indexOf(this.otag + needle) != -1;
244 | },
245 |
246 | /*
247 | Does away with nasty characters
248 | */
249 | escape: function(s) {
250 | s = String(s === null ? "" : s);
251 | return s.replace(/&(?!\w+;)|["<>\\]/g, function(s) {
252 | switch(s) {
253 | case "&": return "&";
254 | case "\\": return "\\\\";
255 | case '"': return '\"';
256 | case "<": return "<";
257 | case ">": return ">";
258 | default: return s;
259 | }
260 | });
261 | },
262 |
263 | // by @langalex, support for arrays of strings
264 | create_context: function(_context) {
265 | if(this.is_object(_context)) {
266 | return _context;
267 | } else {
268 | var iterator = ".";
269 | if(this.pragmas["IMPLICIT-ITERATOR"]) {
270 | iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
271 | }
272 | var ctx = {};
273 | ctx[iterator] = _context;
274 | return ctx;
275 | }
276 | },
277 |
278 | is_object: function(a) {
279 | return a && typeof a == "object";
280 | },
281 |
282 | is_array: function(a) {
283 | return Object.prototype.toString.call(a) === '[object Array]';
284 | },
285 |
286 | /*
287 | Gets rid of leading and trailing whitespace
288 | */
289 | trim: function(s) {
290 | return s.replace(/^\s*|\s*$/g, "");
291 | },
292 |
293 | /*
294 | Why, why, why? Because IE. Cry, cry cry.
295 | */
296 | map: function(array, fn) {
297 | if (typeof array.map == "function") {
298 | return array.map(fn);
299 | } else {
300 | var r = [];
301 | var l = array.length;
302 | for(var i = 0; i < l; i++) {
303 | r.push(fn(array[i]));
304 | }
305 | return r;
306 | }
307 | }
308 | };
309 |
310 | return({
311 | name: "mustache.js",
312 | version: "0.3.1-dev",
313 |
314 | /*
315 | Turns a template and view into HTML
316 | */
317 | to_html: function(template, view, partials, send_fun) {
318 | var renderer = new Renderer();
319 | if(send_fun) {
320 | renderer.send = send_fun;
321 | }
322 | renderer.render(template, view, partials);
323 | if(!send_fun) {
324 | return renderer.buffer.join("\n");
325 | }
326 | }
327 | });
328 | }();
329 |
330 | } // Ensure Mustache
331 |
332 | Sammy = Sammy || {};
333 |
334 | // Sammy.Mustache provides a quick way of using mustache style templates in your app.
335 | // The plugin itself includes the awesome mustache.js lib created and maintained by Jan Lehnardt
336 | // at http://github.com/janl/mustache.js
337 | //
338 | // Mustache is a clever templating system that relys on double brackets {{}} for interpolation.
339 | // For full details on syntax check out the original Ruby implementation created by Chris Wanstrath at
340 | // http://github.com/defunkt/mustache
341 | //
342 | // By default using Sammy.Mustache in your app adds the mustache() method to the EventContext
343 | // prototype. However, just like Sammy.Template you can change the default name of the method
344 | // by passing a second argument (e.g. you could use the ms() as the method alias so that all the template
345 | // files could be in the form file.ms instead of file.mustache)
346 | //
347 | // ### Example #1
348 | //
349 | // The template (mytemplate.ms):
350 | //
351 | // \{\{title\}\}
352 | //
353 | // Hey, {{name}}! Welcome to Mustache!
354 | //
355 | // The app:
356 | //
357 | // var $.app = $.sammy(function() {
358 | // // include the plugin and alias mustache() to ms()
359 | // this.use(Sammy.Mustache, 'ms');
360 | //
361 | // this.get('#/hello/:name', function() {
362 | // // set local vars
363 | // this.title = 'Hello!'
364 | // this.name = this.params.name;
365 | // // render the template and pass it through mustache
366 | // this.partial('mytemplate.ms');
367 | // });
368 | //
369 | // });
370 | //
371 | // If I go to #/hello/AQ in the browser, Sammy will render this to the body:
372 | //
373 | // Hello!
374 | //
375 | // Hey, AQ! Welcome to Mustache!
376 | //
377 | //
378 | // ### Example #2 - Mustache partials
379 | //
380 | // The template (mytemplate.ms)
381 | //
382 | // Hey, {{name}}! {{>hello_friend}}
383 | //
384 | //
385 | // The partial (mypartial.ms)
386 | //
387 | // Say hello to your friend {{friend}}!
388 | //
389 | // The app:
390 | //
391 | // var $.app = $.sammy(function() {
392 | // // include the plugin and alias mustache() to ms()
393 | // this.use(Sammy.Mustache, 'ms');
394 | //
395 | // this.get('#/hello/:name/to/:friend', function() {
396 | // var context = this;
397 | //
398 | // // fetch mustache-partial first
399 | // $.get('mypartial.ms', function(response){
400 | // context.partials = response;
401 | //
402 | // // set local vars
403 | // context.name = this.params.name;
404 | // context.hello_friend = {name: this.params.friend};
405 | //
406 | // // render the template and pass it through mustache
407 | // context.partial('mytemplate.ms');
408 | // });
409 | // });
410 | //
411 | // });
412 | //
413 | // If I go to #/hello/AQ/to/dP in the browser, Sammy will render this to the body:
414 | //
415 | // Hey, AQ! Say hello to your friend dP!
416 | //
417 | // Note: You dont have to include the mustache.js file on top of the plugin as the plugin
418 | // includes the full source.
419 | //
420 | Sammy.Mustache = function(app, method_alias) {
421 |
422 | // *Helper* Uses Mustache.js to parse a template and interpolate and work with the passed data
423 | //
424 | // ### Arguments
425 | //
426 | // * `template` A String template. {{}} Tags are evaluated and interpolated by Mustache.js
427 | // * `data` An Object containing the replacement values for the template.
428 | // data is extended with the EventContext allowing you to call its methods within the template.
429 | // * `partials` An Object containing one or more partials (String templates
430 | // that are called from the main template).
431 | //
432 | var mustache = function(template, data, partials) {
433 | data = $.extend({}, this, data);
434 | partials = $.extend({}, data.partials, partials);
435 | return Mustache.to_html(template, data, partials);
436 | };
437 |
438 | // set the default method name/extension
439 | if (!method_alias) method_alias = 'mustache';
440 | app.helper(method_alias, mustache);
441 |
442 | };
443 |
444 | })(jQuery);
--------------------------------------------------------------------------------
/js/lib/sammy.js:
--------------------------------------------------------------------------------
1 | // -- Sammy.js -- /sammy.js
2 | // http://sammyjs.org
3 | // Version: 0.6.3
4 | // Built: 2011-01-27 10:31:14 -0800
5 | (function(h,j){var o,g="([^/]+)",k=/:([\w\d]+)/g,l=/\?([^#]*)$/,c=function(p){return Array.prototype.slice.call(p)},d=function(p){return Object.prototype.toString.call(p)==="[object Function]"},m=function(p){return Object.prototype.toString.call(p)==="[object Array]"},i=function(p){return decodeURIComponent(p.replace(/\+/g," "))},b=encodeURIComponent,f=function(p){return String(p).replace(/&(?!\w+;)/g,"&").replace(//g,">").replace(/"/g,""")},n=function(p){return function(q,r){return this.route.apply(this,[p,q,r])}},a={},e=[];o=function(){var q=c(arguments),r,p;o.apps=o.apps||{};if(q.length===0||q[0]&&d(q[0])){return o.apply(o,["body"].concat(q))}else{if(typeof(p=q.shift())=="string"){r=o.apps[p]||new o.Application();r.element_selector=p;if(q.length>0){h.each(q,function(s,t){r.use(t)})}if(r.element_selector!=p){delete o.apps[p]}o.apps[r.element_selector]=r;return r}}};o.VERSION="0.6.3";o.addLogger=function(p){e.push(p)};o.log=function(){var p=c(arguments);p.unshift("["+Date()+"]");h.each(e,function(r,q){q.apply(o,p)})};if(typeof j.console!="undefined"){if(d(j.console.log.apply)){o.addLogger(function(){j.console.log.apply(j.console,arguments)})}else{o.addLogger(function(){j.console.log(arguments)})}}else{if(typeof console!="undefined"){o.addLogger(function(){console.log.apply(console,arguments)})}}h.extend(o,{makeArray:c,isFunction:d,isArray:m});o.Object=function(p){return h.extend(this,p||{})};h.extend(o.Object.prototype,{escapeHTML:f,h:f,toHash:function(){var p={};h.each(this,function(r,q){if(!d(q)){p[r]=q}});return p},toHTML:function(){var p="";h.each(this,function(r,q){if(!d(q)){p+=""+r+" "+q+"
"}});return p},keys:function(p){var q=[];for(var r in this){if(!d(this[r])||!p){q.push(r)}}return q},has:function(p){return this[p]&&h.trim(this[p].toString())!=""},join:function(){var q=c(arguments);var p=q.shift();return q.join(p)},log:function(){o.log.apply(o,arguments)},toString:function(p){var q=[];h.each(this,function(s,r){if(!d(r)||p){q.push('"'+s+'": '+r.toString())}});return"Sammy.Object: {"+q.join(",")+"}"}});o.HashLocationProxy=function(q,p){this.app=q;this.is_native=false;this._startPolling(p)};o.HashLocationProxy.prototype={bind:function(){var p=this,q=this.app;h(j).bind("hashchange."+this.app.eventNamespace(),function(s,r){if(p.is_native===false&&!r){o.log("native hash change exists, using");p.is_native=true;j.clearInterval(o.HashLocationProxy._interval)}q.trigger("location-changed")});if(!o.HashLocationProxy._bindings){o.HashLocationProxy._bindings=0}o.HashLocationProxy._bindings++},unbind:function(){h(j).unbind("hashchange."+this.app.eventNamespace());o.HashLocationProxy._bindings--;if(o.HashLocationProxy._bindings<=0){j.clearInterval(o.HashLocationProxy._interval)}},getLocation:function(){var p=j.location.toString().match(/^[^#]*(#.+)$/);return p?p[1]:""},setLocation:function(p){return(j.location=p)},_startPolling:function(r){var q=this;if(!o.HashLocationProxy._interval){if(!r){r=10}var p=function(){var s=q.getLocation();if(!o.HashLocationProxy._last_location||s!=o.HashLocationProxy._last_location){j.setTimeout(function(){h(j).trigger("hashchange",[true])},13)}o.HashLocationProxy._last_location=s};p();o.HashLocationProxy._interval=j.setInterval(p,r)}}};o.Application=function(p){var q=this;this.routes={};this.listeners=new o.Object({});this.arounds=[];this.befores=[];this.namespace=(new Date()).getTime()+"-"+parseInt(Math.random()*1000,10);this.context_prototype=function(){o.EventContext.apply(this,arguments)};this.context_prototype.prototype=new o.EventContext();if(d(p)){p.apply(this,[this])}if(!this._location_proxy){this.setLocationProxy(new o.HashLocationProxy(this,this.run_interval_every))}if(this.debug){this.bindToAllEvents(function(s,r){q.log(q.toString(),s.cleaned_type,r||{})})}};o.Application.prototype=h.extend({},o.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:false,element_selector:"body",debug:false,raise_errors:false,run_interval_every:50,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(p){return p?h(this.element_selector).find(p):h(this.element_selector)},use:function(){var p=c(arguments),r=p.shift(),q=r||"";try{p.unshift(this);if(typeof r=="string"){q="Sammy."+r;r=o[r]}r.apply(this,p)}catch(s){if(typeof r==="undefined"){this.error("Plugin Error: called use() but plugin ("+q.toString()+") is not defined",s)}else{if(!d(r)){this.error("Plugin Error: called use() but '"+q.toString()+"' is not a function",s)}else{this.error("Plugin Error",s)}}}return this},setLocationProxy:function(p){var q=this._location_proxy;this._location_proxy=p;if(this.isRunning()){if(q){q.unbind()}this._location_proxy.bind()}},route:function(t,q,v){var s=this,u=[],p,r;if(!v&&d(q)){q=t;v=q;t="any"}t=t.toLowerCase();if(q.constructor==String){k.lastIndex=0;while((r=k.exec(q))!==null){u.push(r[1])}q=new RegExp("^"+q.replace(k,g)+"$")}if(typeof v=="string"){v=s[v]}p=function(w){var x={verb:w,path:q,callback:v,param_names:u};s.routes[w]=s.routes[w]||[];s.routes[w].push(x)};if(t==="any"){h.each(this.ROUTE_VERBS,function(x,w){p(w)})}else{p(t)}return this},get:n("get"),post:n("post"),put:n("put"),del:n("delete"),any:n("any"),mapRoutes:function(q){var p=this;h.each(q,function(r,s){p.route.apply(p,s)});return this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(p,r,t){var s=this;if(typeof t=="undefined"){t=r}var q=function(){var w,u,v;w=arguments[0];v=arguments[1];if(v&&v.context){u=v.context;delete v.context}else{u=new s.context_prototype(s,"bind",w.type,v,w.target)}w.cleaned_type=w.type.replace(s.eventNamespace(),"");t.apply(u,[w,v])};if(!this.listeners[p]){this.listeners[p]=[]}this.listeners[p].push(q);if(this.isRunning()){this._listen(p,q)}return this},trigger:function(p,q){this.$element().trigger([p,this.eventNamespace()].join("."),[q]);return this},refresh:function(){this.last_location=null;this.trigger("location-changed");return this},before:function(p,q){if(d(p)){q=p;p={}}this.befores.push([p,q]);return this},after:function(p){return this.bind("event-context-after",p)},around:function(p){this.arounds.push(p);return this},isRunning:function(){return this._running},helpers:function(p){h.extend(this.context_prototype.prototype,p);return this},helper:function(p,q){this.context_prototype.prototype[p]=q;return this},run:function(p){if(this.isRunning()){return false}var q=this;h.each(this.listeners.toHash(),function(r,s){h.each(s,function(u,t){q._listen(r,t)})});this.trigger("run",{start_url:p});this._running=true;this.last_location=null;if(this.getLocation()==""&&typeof p!="undefined"){this.setLocation(p)}this._checkLocation();this._location_proxy.bind();this.bind("location-changed",function(){q._checkLocation()});this.bind("submit",function(s){var r=q._checkFormSubmission(h(s.target).closest("form"));return(r===false)?s.preventDefault():false});h(j).bind("beforeunload",function(){q.unload()});return this.trigger("changed")},unload:function(){if(!this.isRunning()){return false}var p=this;this.trigger("unload");this._location_proxy.unbind();this.$element().unbind("submit").removeClass(p.eventNamespace());h.each(this.listeners.toHash(),function(q,r){h.each(r,function(t,s){p._unlisten(q,s)})});this._running=false;return this},bindToAllEvents:function(q){var p=this;h.each(this.APP_EVENTS,function(r,s){p.bind(s,q)});h.each(this.listeners.keys(true),function(s,r){if(p.APP_EVENTS.indexOf(r)==-1){p.bind(r,q)}});return this},routablePath:function(p){return p.replace(l,"")},lookupRoute:function(s,q){var r=this,p=false;this.trigger("lookup-route",{verb:s,path:q});if(typeof this.routes[s]!="undefined"){h.each(this.routes[s],function(u,t){if(r.routablePath(q).match(t.path)){p=t;return false}})}return p},runRoute:function(r,E,t,w){var s=this,C=this.lookupRoute(r,E),q,z,u,y,D,A,x,B,p;this.log("runRoute",[r,E].join(" "));this.trigger("run-route",{verb:r,path:E,params:t});if(typeof t=="undefined"){t={}}h.extend(t,this._parseQueryString(E));if(C){this.trigger("route-found",{route:C});if((B=C.path.exec(this.routablePath(E)))!==null){B.shift();h.each(B,function(F,G){if(C.param_names[F]){t[C.param_names[F]]=i(G)}else{if(!t.splat){t.splat=[]}t.splat.push(i(G))}})}q=new this.context_prototype(this,r,E,t,w);u=this.arounds.slice(0);D=this.befores.slice(0);x=[q].concat(t.splat);z=function(){var F;while(D.length>0){A=D.shift();if(s.contextMatchesOptions(q,A[0])){F=A[1].apply(q,[q]);if(F===false){return false}}}s.last_route=C;q.trigger("event-context-before",{context:q});F=C.callback.apply(q,x);q.trigger("event-context-after",{context:q});return F};h.each(u.reverse(),function(F,G){var H=z;z=function(){return G.apply(q,[H])}});try{p=z()}catch(v){this.error(["500 Error",r,E].join(" "),v)}return p}else{return this.notFound(r,E)}},contextMatchesOptions:function(s,u,q){var r=u;if(typeof r==="undefined"||r=={}){return true}if(typeof q==="undefined"){q=true}if(typeof r==="string"||d(r.test)){r={path:r}}if(r.only){return this.contextMatchesOptions(s,r.only,true)}else{if(r.except){return this.contextMatchesOptions(s,r.except,false)}}var p=true,t=true;if(r.path){if(d(r.path.test)){p=r.path.test(s.path)}else{p=(r.path.toString()===s.path)}}if(r.verb){t=r.verb===s.verb}return q?(t&&p):!(t&&p)},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(p){return this._location_proxy.setLocation(p)},swap:function(p){return this.$element().html(p)},templateCache:function(p,q){if(typeof q!="undefined"){return a[p]=q}else{return a[p]}},clearTemplateCache:function(){return a={}},notFound:function(r,q){var p=this.error(["404 Not Found",r,q].join(" "));return(r==="get")?p:true},error:function(q,p){if(!p){p=new Error()}p.message=[q,p.message].join(" ");this.trigger("error",{message:p.message,error:p});if(this.raise_errors){throw (p)}else{this.log(p.message,p)}},_checkLocation:function(){var p,q;p=this.getLocation();if(!this.last_location||this.last_location[0]!="get"||this.last_location[1]!=p){this.last_location=["get",p];q=this.runRoute("get",p)}return q},_getFormVerb:function(r){var q=h(r),s,p;p=q.find('input[name="_method"]');if(p.length>0){s=p.val()}if(!s){s=q[0].getAttribute("method")}if(!s||s==""){s="get"}return h.trim(s.toString().toLowerCase())},_checkFormSubmission:function(r){var p,s,u,t,q;this.trigger("check-form-submission",{form:r});p=h(r);s=p.attr("action");u=this._getFormVerb(p);this.log("_checkFormSubmission",p,s,u);if(u==="get"){this.setLocation(s+"?"+this._serializeFormParams(p));q=false}else{t=h.extend({},this._parseFormParams(p));q=this.runRoute(u,s,t,r.get(0))}return(typeof q=="undefined")?false:q},_serializeFormParams:function(q){var s="",p=q.serializeArray(),r;if(p.length>0){s=this._encodeFormPair(p[0].name,p[0].value);for(r=1;r
0){this.then(this.callbacks.shift())}},load:function(p,q,s){var r=this;return this.then(function(){var t,u,w,v;if(d(q)){s=q;q={}}else{q=h.extend({},q)}if(s){this.then(s)}if(typeof p==="string"){w=(p.match(/\.json$/)||q.json);t=((w&&q.cache===true)||q.cache!==false);r.next_engine=r.event_context.engineFor(p);delete q.cache;delete q.json;if(q.engine){r.next_engine=q.engine;delete q.engine}if(t&&(u=this.event_context.app.templateCache(p))){return u}this.wait();h.ajax(h.extend({url:p,data:{},dataType:w?"json":null,type:"get",success:function(x){if(t){r.event_context.app.templateCache(p,x)}r.next(x)}},q));return false}else{if(p.nodeType){return p.innerHTML}if(p.selector){r.next_engine=p.attr("data-engine");if(q.clone===false){return p.remove()[0].innerHTML.toString()}else{return p[0].innerHTML.toString()}}}})},render:function(p,q,r){if(d(p)&&!q){return this.then(p)}else{if(!q&&this.content){q=this.content}return this.load(p).interpolate(q,p).then(r)}},partial:function(p,q){return this.render(p,q).swap()},send:function(){var r=this,q=c(arguments),p=q.shift();if(m(q[0])){q=q[0]}return this.then(function(s){q.push(function(t){r.next(t)});r.wait();p.apply(p,q);return false})},collect:function(t,s,p){var r=this;var q=function(){if(d(t)){s=t;t=this.content}var u=[],v=false;h.each(t,function(w,y){var x=s.apply(r,[w,y]);if(x.jquery&&x.length==1){x=x[0];v=true}u.push(x);return x});return v?u:u.join("")};return p?q():this.then(q)},renderEach:function(p,q,r,s){if(m(q)){s=r;r=q;q=null}return this.load(p).then(function(u){var t=this;if(!r){r=m(this.previous_content)?this.previous_content:[]}if(s){h.each(r,function(v,x){var y={},w=this.next_engine||p;q?(y[q]=x):(y=x);s(x,t.event_context.interpolate(u,y,w))})}else{return this.collect(r,function(v,x){var y={},w=this.next_engine||p;q?(y[q]=x):(y=x);return this.event_context.interpolate(u,y,w)},true)}})},interpolate:function(s,r,p){var q=this;return this.then(function(u,t){if(!s&&t){s=t}if(this.next_engine){r=this.next_engine;this.next_engine=false}var v=q.event_context.interpolate(u,s,r);return p?t+v:v})},swap:function(){return this.then(function(p){this.event_context.swap(p)}).trigger("changed",{})},appendTo:function(p){return this.then(function(q){h(p).append(q)}).trigger("changed",{})},prependTo:function(p){return this.then(function(q){h(p).prepend(q)}).trigger("changed",{})},replace:function(p){return this.then(function(q){h(p).html(q)}).trigger("changed",{})},trigger:function(p,q){return this.then(function(r){if(typeof q=="undefined"){q={content:r}}this.event_context.trigger(p,q)})}});o.EventContext=function(t,s,q,r,p){this.app=t;this.verb=s;this.path=q;this.params=new o.Object(r);this.target=p};o.EventContext.prototype=h.extend({},o.Object.prototype,{$element:function(){return this.app.$element(c(arguments).shift())},engineFor:function(r){var q=this,p;if(d(r)){return r}r=(r||q.app.template_engine).toString();if((p=r.match(/\.([^\.]+)$/))){r=p[1]}if(r&&d(q[r])){return q[r]}if(q.app.template_engine){return this.engineFor(q.app.template_engine)}return function(s,t){return s}},interpolate:function(q,r,p){return this.engineFor(p).apply(this,[q,r])},render:function(p,q,r){return new o.RenderContext(this).render(p,q,r)},renderEach:function(p,q,r,s){return new o.RenderContext(this).renderEach(p,q,r,s)},load:function(p,q,r){return new o.RenderContext(this).load(p,q,r)},partial:function(p,q){return new o.RenderContext(this).partial(p,q)},send:function(){var p=new o.RenderContext(this);return p.send.apply(p,arguments)},redirect:function(){var r,q=c(arguments),p=this.app.getLocation();if(q.length>1){q.unshift("/");r=this.join.apply(this,q)}else{r=q[0]}this.trigger("redirect",{to:r});this.app.last_location=[this.verb,this.path];this.app.setLocation(r);if(p==r){this.app.trigger("location-changed")}},trigger:function(p,q){if(typeof q=="undefined"){q={}}if(!q.context){q.context=this}return this.app.trigger(p,q)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(p){return this.app.swap(p)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(p){return h.parseJSON(p)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}});h.sammy=j.Sammy=o})(jQuery,window);
--------------------------------------------------------------------------------
/js/lib/html-sanitizer-minified.js:
--------------------------------------------------------------------------------
1 | {var css={'properties':(function(){var s=['|left|center|right','|top|center|bottom','#(?:[\\da-f]{3}){1,2}|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|rgb\\(\\s*(?:-?\\d+|0|[+\\-]?\\d+(?:\\.\\d+)?%)\\s*,\\s*(?:-?\\d+|0|[+\\-]?\\d+(?:\\.\\d+)?%)\\s*,\\s*(?:-?\\d+|0|[+\\-]?\\d+(?:\\.\\d+)?%)\\)','[+\\-]?\\d+(?:\\.\\d+)?(?:[cem]m|ex|in|p[ctx])','\\d+(?:\\.\\d+)?(?:[cem]m|ex|in|p[ctx])','none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset','[+\\-]?\\d+(?:\\.\\d+)?%','\\d+(?:\\.\\d+)?%','url\\(\"[^()\\\\\"\\r\\n]+\"\\)','repeat-x|repeat-y|(?:repeat|space|round|no-repeat)(?:\\s+(?:repeat|space|round|no-repeat)){0,2}'],c=[RegExp('^\\s*(?:\\s*(?:0|'+s[3]+'|'+s[6]+')){1,2}\\s*$','i'),RegExp('^\\s*(?:\\s*(?:0|'+s[3]+'|'+s[6]+')){1,4}(?:\\s*\\/(?:\\s*(?:0|'+s[3]+'|'+s[6]+')){1,4})?\\s*$','i'),RegExp('^\\s*(?:\\s*none|(?:(?:\\s*(?:'+s[2]+')\\s+(?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*inset)?|(?:\\s*inset)?\\s+(?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*(?:'+s[2]+'))?)\\s*,)*(?:\\s*(?:'+s[2]+')\\s+(?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*inset)?|(?:\\s*inset)?\\s+(?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*(?:'+s[2]+'))?))\\s*$','i'),RegExp('^\\s*(?:'+s[2]+'|transparent|inherit)\\s*$','i'),RegExp('^\\s*(?:'+s[5]+'|inherit)\\s*$','i'),RegExp('^\\s*(?:thin|medium|thick|0|'+s[3]+'|inherit)\\s*$','i'),RegExp('^\\s*(?:(?:thin|medium|thick|0|'+s[3]+'|'+s[5]+'|'+s[2]+'|transparent|inherit)(?:\\s+(?:thin|medium|thick|0|'+s[3]+')|\\s+(?:'+s[5]+')|\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent|\\s+inherit){0,2}|inherit)\\s*$','i'),/^\s*(?:none|inherit)\s*$/i,RegExp('^\\s*(?:'+s[8]+'|none|inherit)\\s*$','i'),RegExp('^\\s*(?:0|'+s[3]+'|'+s[6]+'|auto|inherit)\\s*$','i'),RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|none|inherit|auto)\\s*$','i'),RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|inherit|auto)\\s*$','i'),/^\s*(?:0(?:\.\d+)?|\.\d+|1(?:\.0+)?|inherit)\s*$/i,RegExp('^\\s*(?:(?:'+s[2]+'|invert|inherit|'+s[5]+'|thin|medium|thick|0|'+s[3]+')(?:\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+invert|\\s+inherit|\\s+(?:'+s[5]+'|inherit)|\\s+(?:thin|medium|thick|0|'+s[3]+'|inherit)){0,2}|inherit)\\s*$','i'),RegExp('^\\s*(?:'+s[2]+'|invert|inherit)\\s*$','i'),/^\s*(?:visible|hidden|scroll|auto|no-display|no-content)\s*$/i,RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|inherit)\\s*$','i'),/^\s*(?:auto|always|avoid|left|right|inherit)\s*$/i,RegExp('^\\s*(?:0|[+\\-]?\\d+(?:\\.\\d+)?m?s|'+s[6]+'|inherit)\\s*$','i'),/^\s*(?:0|[+\-]?\d+(?:\.\d+)?|inherit)\s*$/i,/^\s*(?:clip|ellipsis)\s*$/i,RegExp('^\\s*(?:normal|0|'+s[3]+'|inherit)\\s*$','i')];return{'-moz-border-radius':c[1],'-moz-border-radius-bottomleft':c[0],'-moz-border-radius-bottomright':c[0],'-moz-border-radius-topleft':c[0],'-moz-border-radius-topright':c[0],'-moz-box-shadow':c[2],'-moz-opacity':c[12],'-moz-outline':c[13],'-moz-outline-color':c[14],'-moz-outline-style':c[4],'-moz-outline-width':c[5],'-o-text-overflow':c[20],'-webkit-border-bottom-left-radius':c[0],'-webkit-border-bottom-right-radius':c[0],'-webkit-border-radius':c[1],'-webkit-border-radius-bottom-left':c[0],'-webkit-border-radius-bottom-right':c[0],'-webkit-border-radius-top-left':c[0],'-webkit-border-radius-top-right':c[0],'-webkit-border-top-left-radius':c[0],'-webkit-border-top-right-radius':c[0],'-webkit-box-shadow':c[2],'azimuth':/^\s*(?:0|[+\-]?\d+(?:\.\d+)?(?:g?rad|deg)|(?:left-side|far-left|left|center-left|center|center-right|right|far-right|right-side|behind)(?:\s+(?:left-side|far-left|left|center-left|center|center-right|right|far-right|right-side|behind))?|leftwards|rightwards|inherit)\s*$/i,'background':RegExp('^\\s*(?:\\s*(?:'+s[8]+'|none|(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?)(?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|'+s[9]+'|scroll|fixed|local|(?:border|padding|content)-box)(?:\\s*'+s[8]+'|\\s+none|(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)){1,2})(?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|\\s+repeat-x|\\s+repeat-y|(?:\\s+(?:repeat|space|round|no-repeat)){1,2}|\\s+(?:scroll|fixed|local)|\\s+(?:border|padding|content)-box){0,4}\\s*,)*\\s*(?:'+s[2]+'|transparent|inherit|'+s[8]+'|none|(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?)(?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|'+s[9]+'|scroll|fixed|local|(?:border|padding|content)-box)(?:\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent|\\s+inherit|\\s*'+s[8]+'|\\s+none|(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)){1,2})(?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|\\s+repeat-x|\\s+repeat-y|(?:\\s+(?:repeat|space|round|no-repeat)){1,2}|\\s+(?:scroll|fixed|local)|\\s+(?:border|padding|content)-box){0,5}\\s*$','i'),'background-attachment':/^\s*(?:scroll|fixed|local)(?:\s*,\s*(?:scroll|fixed|local))*\s*$/i,'background-color':c[3],'background-image':RegExp('^\\s*(?:'+s[8]+'|none)(?:\\s*,\\s*(?:'+s[8]+'|none))*\\s*$','i'),'background-position':RegExp('^\\s*(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?)(?:\\s*,\\s*(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?))*\\s*$','i'),'background-repeat':RegExp('^\\s*(?:'+s[9]+')(?:\\s*,\\s*(?:'+s[9]+'))*\\s*$','i'),'border':RegExp('^\\s*(?:(?:thin|medium|thick|0|'+s[3]+'|'+s[5]+'|'+s[2]+'|transparent)(?:\\s+(?:thin|medium|thick|0|'+s[3]+')|\\s+(?:'+s[5]+')|\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent){0,2}|inherit)\\s*$','i'),'border-bottom':c[6],'border-bottom-color':c[3],'border-bottom-left-radius':c[0],'border-bottom-right-radius':c[0],'border-bottom-style':c[4],'border-bottom-width':c[5],'border-collapse':/^\s*(?:collapse|separate|inherit)\s*$/i,'border-color':RegExp('^\\s*(?:(?:'+s[2]+'|transparent)(?:\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent){0,4}|inherit)\\s*$','i'),'border-left':c[6],'border-left-color':c[3],'border-left-style':c[4],'border-left-width':c[5],'border-radius':c[1],'border-right':c[6],'border-right-color':c[3],'border-right-style':c[4],'border-right-width':c[5],'border-spacing':RegExp('^\\s*(?:(?:\\s*(?:0|'+s[3]+')){1,2}|\\s*inherit)\\s*$','i'),'border-style':RegExp('^\\s*(?:(?:'+s[5]+')(?:\\s+(?:'+s[5]+')){0,4}|inherit)\\s*$','i'),'border-top':c[6],'border-top-color':c[3],'border-top-left-radius':c[0],'border-top-right-radius':c[0],'border-top-style':c[4],'border-top-width':c[5],'border-width':RegExp('^\\s*(?:(?:thin|medium|thick|0|'+s[3]+')(?:\\s+(?:thin|medium|thick|0|'+s[3]+')){0,4}|inherit)\\s*$','i'),'bottom':c[9],'box-shadow':c[2],'caption-side':/^\s*(?:top|bottom|inherit)\s*$/i,'clear':/^\s*(?:none|left|right|both|inherit)\s*$/i,'clip':RegExp('^\\s*(?:rect\\(\\s*(?:0|'+s[3]+'|auto)\\s*,\\s*(?:0|'+s[3]+'|auto)\\s*,\\s*(?:0|'+s[3]+'|auto)\\s*,\\s*(?:0|'+s[3]+'|auto)\\)|auto|inherit)\\s*$','i'),'color':RegExp('^\\s*(?:'+s[2]+'|inherit)\\s*$','i'),'counter-increment':c[7],'counter-reset':c[7],'cue':RegExp('^\\s*(?:(?:'+s[8]+'|none|inherit)(?:\\s*'+s[8]+'|\\s+none|\\s+inherit)?|inherit)\\s*$','i'),'cue-after':c[8],'cue-before':c[8],'cursor':RegExp('^\\s*(?:(?:\\s*'+s[8]+'\\s*,)*\\s*(?:auto|crosshair|default|pointer|move|e-resize|ne-resize|nw-resize|n-resize|se-resize|sw-resize|s-resize|w-resize|text|wait|help|progress|all-scroll|col-resize|hand|no-drop|not-allowed|row-resize|vertical-text)|\\s*inherit)\\s*$','i'),'direction':/^\s*(?:ltr|rtl|inherit)\s*$/i,'display':/^\s*(?:inline|block|list-item|run-in|inline-block|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|none|inherit|-moz-inline-box|-moz-inline-stack)\s*$/i,'elevation':/^\s*(?:0|[+\-]?\d+(?:\.\d+)?(?:g?rad|deg)|below|level|above|higher|lower|inherit)\s*$/i,'empty-cells':/^\s*(?:show|hide|inherit)\s*$/i,'filter':RegExp('^\\s*(?:\\s*alpha\\(\\s*opacity\\s*=\\s*(?:0|'+s[6]+'|[+\\-]?\\d+(?:\\.\\d+)?)\\))+\\s*$','i'),'float':/^\s*(?:left|right|none|inherit)\s*$/i,'font':RegExp('^\\s*(?:(?:normal|italic|oblique|inherit|small-caps|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)(?:\\s+(?:normal|italic|oblique|inherit|small-caps|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)){0,2}\\s+(?:xx-small|x-small|small|medium|large|x-large|xx-large|(?:small|larg)er|0|'+s[4]+'|'+s[7]+'|inherit)(?:\\s*\\/\\s*(?:normal|0|\\d+(?:\\.\\d+)?|'+s[4]+'|'+s[7]+'|inherit))?(?:(?:\\s*\"\\w(?:[\\w-]*\\w)(?:\\s+\\w([\\w-]*\\w))*\"|\\s+(?:serif|sans-serif|cursive|fantasy|monospace))(?:\\s*,\\s*(?:\"\\w(?:[\\w-]*\\w)(?:\\s+\\w([\\w-]*\\w))*\"|serif|sans-serif|cursive|fantasy|monospace))*|\\s+inherit)|caption|icon|menu|message-box|small-caption|status-bar|inherit)\\s*$','i'),'font-family':/^\s*(?:(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|serif|sans-serif|cursive|fantasy|monospace)(?:\s*,\s*(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|serif|sans-serif|cursive|fantasy|monospace))*|inherit)\s*$/i,'font-size':RegExp('^\\s*(?:xx-small|x-small|small|medium|large|x-large|xx-large|(?:small|larg)er|0|'+s[4]+'|'+s[7]+'|inherit)\\s*$','i'),'font-stretch':/^\s*(?:normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded)\s*$/i,'font-style':/^\s*(?:normal|italic|oblique|inherit)\s*$/i,'font-variant':/^\s*(?:normal|small-caps|inherit)\s*$/i,'font-weight':/^\s*(?:normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)\s*$/i,'height':c[9],'left':c[9],'letter-spacing':c[21],'line-height':RegExp('^\\s*(?:normal|0|\\d+(?:\\.\\d+)?|'+s[4]+'|'+s[7]+'|inherit)\\s*$','i'),'list-style':RegExp('^\\s*(?:(?:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none|inherit|inside|outside|'+s[8]+')(?:\\s+(?:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none|inherit)|\\s+(?:inside|outside|inherit)|\\s*'+s[8]+'|\\s+none|\\s+inherit){0,2}|inherit)\\s*$','i'),'list-style-image':c[8],'list-style-position':/^\s*(?:inside|outside|inherit)\s*$/i,'list-style-type':/^\s*(?:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none|inherit)\s*$/i,'margin':RegExp('^\\s*(?:(?:0|'+s[3]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[3]+'|'+s[6]+'|auto)){0,4}|inherit)\\s*$','i'),'margin-bottom':c[9],'margin-left':c[9],'margin-right':c[9],'margin-top':c[9],'max-height':c[10],'max-width':c[10],'min-height':c[11],'min-width':c[11],'opacity':c[12],'outline':c[13],'outline-color':c[14],'outline-style':c[4],'outline-width':c[5],'overflow':/^\s*(?:visible|hidden|scroll|auto|inherit)\s*$/i,'overflow-x':c[15],'overflow-y':c[15],'padding':RegExp('^\\s*(?:(?:\\s*(?:0|'+s[4]+'|'+s[7]+')){1,4}|\\s*inherit)\\s*$','i'),'padding-bottom':c[16],'padding-left':c[16],'padding-right':c[16],'padding-top':c[16],'page-break-after':c[17],'page-break-before':c[17],'page-break-inside':/^\s*(?:avoid|auto|inherit)\s*$/i,'pause':RegExp('^\\s*(?:(?:\\s*(?:0|[+\\-]?\\d+(?:\\.\\d+)?m?s|'+s[6]+')){1,2}|\\s*inherit)\\s*$','i'),'pause-after':c[18],'pause-before':c[18],'pitch':/^\s*(?:0|\d+(?:\.\d+)?k?Hz|x-low|low|medium|high|x-high|inherit)\s*$/i,'pitch-range':c[19],'play-during':RegExp('^\\s*(?:'+s[8]+'\\s*(?:mix|repeat)(?:\\s+(?:mix|repeat))?|auto|none|inherit)\\s*$','i'),'position':/^\s*(?:static|relative|absolute|inherit)\s*$/i,'quotes':c[7],'richness':c[19],'right':c[9],'speak':/^\s*(?:normal|none|spell-out|inherit)\s*$/i,'speak-header':/^\s*(?:once|always|inherit)\s*$/i,'speak-numeral':/^\s*(?:digits|continuous|inherit)\s*$/i,'speak-punctuation':/^\s*(?:code|none|inherit)\s*$/i,'speech-rate':/^\s*(?:0|[+\-]?\d+(?:\.\d+)?|x-slow|slow|medium|fast|x-fast|faster|slower|inherit)\s*$/i,'stress':c[19],'table-layout':/^\s*(?:auto|fixed|inherit)\s*$/i,'text-align':/^\s*(?:left|right|center|justify|inherit)\s*$/i,'text-decoration':/^\s*(?:none|(?:underline|overline|line-through|blink)(?:\s+(?:underline|overline|line-through|blink)){0,3}|inherit)\s*$/i,'text-indent':RegExp('^\\s*(?:0|'+s[3]+'|'+s[6]+'|inherit)\\s*$','i'),'text-overflow':c[20],'text-shadow':c[2],'text-transform':/^\s*(?:capitalize|uppercase|lowercase|none|inherit)\s*$/i,'text-wrap':/^\s*(?:normal|unrestricted|none|suppress)\s*$/i,'top':c[9],'unicode-bidi':/^\s*(?:normal|embed|bidi-override|inherit)\s*$/i,'vertical-align':RegExp('^\\s*(?:baseline|sub|super|top|text-top|middle|bottom|text-bottom|0|'+s[6]+'|'+s[3]+'|inherit)\\s*$','i'),'visibility':/^\s*(?:visible|hidden|collapse|inherit)\s*$/i,'voice-family':/^\s*(?:(?:\s*(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|male|female|child)\s*,)*\s*(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|male|female|child)|\s*inherit)\s*$/i,'volume':RegExp('^\\s*(?:0|\\d+(?:\\.\\d+)?|'+s[7]+'|silent|x-soft|soft|medium|loud|x-loud|inherit)\\s*$','i'),'white-space':/^\s*(?:normal|pre|nowrap|pre-wrap|pre-line|inherit|-o-pre-wrap|-moz-pre-wrap|-pre-wrap)\s*$/i,'width':RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|auto|inherit)\\s*$','i'),'word-spacing':c[21],'word-wrap':/^\s*(?:normal|break-word)\s*$/i,'z-index':/^\s*(?:auto|-?\d+|inherit)\s*$/i,'zoom':RegExp('^\\s*(?:normal|0|\\d+(?:\\.\\d+)?|'+s[7]+')\\s*$','i')}})(),'alternates':{'MozBoxShadow':['boxShadow'],'WebkitBoxShadow':['boxShadow'],'float':['cssFloat','styleFloat']},'HISTORY_INSENSITIVE_STYLE_WHITELIST':{'display':true,'filter':true,'float':true,'height':true,'left':true,'opacity':true,'overflow':true,'position':true,'right':true,'top':true,'visibility':true,'width':true,'padding-left':true,'padding-right':true,'padding-top':true,'padding-bottom':true}},html,html4;html4={},html4
2 | .atype={'NONE':0,'URI':1,'URI_FRAGMENT':11,'SCRIPT':2,'STYLE':3,'ID':4,'IDREF':5,'IDREFS':6,'GLOBAL_NAME':7,'LOCAL_NAME':8,'CLASSES':9,'FRAME_TARGET':10},html4
3 | .ATTRIBS={'*::class':9,'*::dir':0,'*::id':4,'*::lang':0,'*::onclick':2,'*::ondblclick':2,'*::onkeydown':2,'*::onkeypress':2,'*::onkeyup':2,'*::onload':2,'*::onmousedown':2,'*::onmousemove':2,'*::onmouseout':2,'*::onmouseover':2,'*::onmouseup':2,'*::style':3,'*::title':0,'a::accesskey':0,'a::coords':0,'a::href':1,'a::hreflang':0,'a::name':7,'a::onblur':2,'a::onfocus':2,'a::rel':0,'a::rev':0,'a::shape':0,'a::tabindex':0,'a::target':10,'a::type':0,'area::accesskey':0,'area::alt':0,'area::coords':0,'area::href':1,'area::nohref':0,'area::onblur':2,'area::onfocus':2,'area::shape':0,'area::tabindex':0,'area::target':10,'bdo::dir':0,'blockquote::cite':1,'br::clear':0,'button::accesskey':0,'button::disabled':0,'button::name':8,'button::onblur':2,'button::onfocus':2,'button::tabindex':0,'button::type':0,'button::value':0,'caption::align':0,'col::align':0,'col::char':0,'col::charoff':0,'col::span':0,'col::valign':0,'col::width':0,'colgroup::align':0,'colgroup::char':0,'colgroup::charoff':0,'colgroup::span':0,'colgroup::valign':0,'colgroup::width':0,'del::cite':1,'del::datetime':0,'dir::compact':0,'div::align':0,'dl::compact':0,'font::color':0,'font::face':0,'font::size':0,'form::accept':0,'form::action':1,'form::autocomplete':0,'form::enctype':0,'form::method':0,'form::name':7,'form::onreset':2,'form::onsubmit':2,'form::target':10,'h1::align':0,'h2::align':0,'h3::align':0,'h4::align':0,'h5::align':0,'h6::align':0,'hr::align':0,'hr::noshade':0,'hr::size':0,'hr::width':0,'iframe::align':0,'iframe::frameborder':0,'iframe::height':0,'iframe::marginheight':0,'iframe::marginwidth':0,'iframe::width':0,'img::align':0,'img::alt':0,'img::border':0,'img::height':0,'img::hspace':0,'img::ismap':0,'img::name':7,'img::src':1,'img::usemap':11,'img::vspace':0,'img::width':0,'input::accept':0,'input::accesskey':0,'input::align':0,'input::alt':0,'input::autocomplete':0,'input::checked':0,'input::disabled':0,'input::ismap':0,'input::maxlength':0,'input::name':8,'input::onblur':2,'input::onchange':2,'input::onfocus':2,'input::onselect':2,'input::readonly':0,'input::size':0,'input::src':1,'input::tabindex':0,'input::type':0,'input::usemap':11,'input::value':0,'ins::cite':1,'ins::datetime':0,'label::accesskey':0,'label::for':5,'label::onblur':2,'label::onfocus':2,'legend::accesskey':0,'legend::align':0,'li::type':0,'li::value':0,'map::name':7,'menu::compact':0,'ol::compact':0,'ol::start':0,'ol::type':0,'optgroup::disabled':0,'optgroup::label':0,'option::disabled':0,'option::label':0,'option::selected':0,'option::value':0,'p::align':0,'pre::width':0,'q::cite':1,'select::disabled':0,'select::multiple':0,'select::name':8,'select::onblur':2,'select::onchange':2,'select::onfocus':2,'select::size':0,'select::tabindex':0,'table::align':0,'table::bgcolor':0,'table::border':0,'table::cellpadding':0,'table::cellspacing':0,'table::frame':0,'table::rules':0,'table::summary':0,'table::width':0,'tbody::align':0,'tbody::char':0,'tbody::charoff':0,'tbody::valign':0,'td::abbr':0,'td::align':0,'td::axis':0,'td::bgcolor':0,'td::char':0,'td::charoff':0,'td::colspan':0,'td::headers':6,'td::height':0,'td::nowrap':0,'td::rowspan':0,'td::scope':0,'td::valign':0,'td::width':0,'textarea::accesskey':0,'textarea::cols':0,'textarea::disabled':0,'textarea::name':8,'textarea::onblur':2,'textarea::onchange':2,'textarea::onfocus':2,'textarea::onselect':2,'textarea::readonly':0,'textarea::rows':0,'textarea::tabindex':0,'tfoot::align':0,'tfoot::char':0,'tfoot::charoff':0,'tfoot::valign':0,'th::abbr':0,'th::align':0,'th::axis':0,'th::bgcolor':0,'th::char':0,'th::charoff':0,'th::colspan':0,'th::headers':6,'th::height':0,'th::nowrap':0,'th::rowspan':0,'th::scope':0,'th::valign':0,'th::width':0,'thead::align':0,'thead::char':0,'thead::charoff':0,'thead::valign':0,'tr::align':0,'tr::bgcolor':0,'tr::char':0,'tr::charoff':0,'tr::valign':0,'ul::compact':0,'ul::type':0},html4
4 | .eflags={'OPTIONAL_ENDTAG':1,'EMPTY':2,'CDATA':4,'RCDATA':8,'UNSAFE':16,'FOLDABLE':32,'SCRIPT':64,'STYLE':128},html4
5 | .ELEMENTS={'a':0,'abbr':0,'acronym':0,'address':0,'applet':16,'area':2,'b':0,'base':18,'basefont':18,'bdo':0,'big':0,'blockquote':0,'body':49,'br':2,'button':0,'caption':0,'center':0,'cite':0,'code':0,'col':2,'colgroup':1,'dd':1,'del':0,'dfn':0,'dir':0,'div':0,'dl':0,'dt':1,'em':0,'fieldset':0,'font':0,'form':0,'frame':18,'frameset':16,'h1':0,'h2':0,'h3':0,'h4':0,'h5':0,'h6':0,'head':49,'hr':2,'html':49,'i':0,'iframe':4,'img':2,'input':2,'ins':0,'isindex':18,'kbd':0,'label':0,'legend':0,'li':1,'link':18,'map':0,'menu':0,'meta':18,'noframes':20,'noscript':20,'object':16,'ol':0,'optgroup':0,'option':1,'p':1,'param':18,'pre':0,'q':0,'s':0,'samp':0,'script':84,'select':0,'small':0,'span':0,'strike':0,'strong':0,'style':148,'sub':0,'sup':0,'table':0,'tbody':1,'td':1,'textarea':8,'tfoot':1,'th':1,'thead':1,'title':24,'tr':1,'tt':0,'u':0,'ul':0,'var':0},html=(function(){var
6 | ENTITIES,INSIDE_TAG_TOKEN,OUTSIDE_TAG_TOKEN,ampRe,decimalEscapeRe,entityRe,eqRe,gtRe,hexEscapeRe,lcase,looseAmpRe,ltRe,nulRe,quotRe;'script'==='SCRIPT'.toLowerCase()?(lcase=function(s){return s.toLowerCase()}):(lcase=function(s){return s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0)|32)})}),ENTITIES={'lt':'<','gt':'>','amp':'&','nbsp':'\xa0','quot':'\"','apos':'\''},decimalEscapeRe=/^#(\d+)$/,hexEscapeRe=/^#x([0-9A-Fa-f]+)$/;function
7 | lookupEntity(name){var m;return name=lcase(name),ENTITIES.hasOwnProperty(name)?ENTITIES[name]:(m=name.match(decimalEscapeRe),m?String.fromCharCode(parseInt(m[1],10)):(m=name.match(hexEscapeRe))?String.fromCharCode(parseInt(m[1],16)):'')}function
8 | decodeOneEntity(_,name){return lookupEntity(name)}nulRe=/\0/g;function stripNULs(s){return s.replace(nulRe,'')}entityRe=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g;function
9 | unescapeEntities(s){return s.replace(entityRe,decodeOneEntity)}ampRe=/&/g,looseAmpRe=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,ltRe=//g,quotRe=/\"/g,eqRe=/\=/g;function
10 | escapeAttrib(s){return s.replace(ampRe,'&').replace(ltRe,'<').replace(gtRe,'>').replace(quotRe,'"').replace(eqRe,'=')}function
11 | normalizeRCData(rcdata){return rcdata.replace(looseAmpRe,'&$1').replace(ltRe,'<').replace(gtRe,'>')}INSIDE_TAG_TOKEN=new
12 | RegExp('^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|\'[^\']*\'|(?=[a-z][a-z-]*\\s*=)|[^>\"\'\\s]*))?)|(/?>)|.[^a-z\\s>]*)','i'),OUTSIDE_TAG_TOKEN=new
13 | RegExp('^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);||]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))','i');function
14 | makeSaxParser(handler){return function parse(htmlText,param){var attribName,attribs,dataEnd,decodedValue,eflags,encodedValue,htmlLower,inTag,m,openTag,tagName;htmlText=String(htmlText),htmlLower=null,inTag=false,attribs=[],tagName=void
15 | 0,eflags=void 0,openTag=void 0,handler.startDoc&&handler.startDoc(param);while(htmlText){m=htmlText.match(inTag?INSIDE_TAG_TOKEN:OUTSIDE_TAG_TOKEN),htmlText=htmlText.substring(m[0].length);if(inTag){if(m[1]){attribName=lcase(m[1]);if(m[2]){encodedValue=m[3];switch(encodedValue.charCodeAt(0)){case
16 | 34:case 39:encodedValue=encodedValue.substring(1,encodedValue.length-1)}decodedValue=unescapeEntities(stripNULs(encodedValue))}else
17 | decodedValue=attribName;attribs.push(attribName,decodedValue)}else if(m[4])eflags!==void
18 | 0&&(openTag?handler.startTag&&handler.startTag(tagName,attribs,param):handler.endTag&&handler.endTag(tagName,param)),openTag&&eflags&(html4
19 | .eflags.CDATA|html4 .eflags.RCDATA)&&(htmlLower===null?(htmlLower=lcase(htmlText)):(htmlLower=htmlLower.substring(htmlLower.length-htmlText.length)),dataEnd=htmlLower.indexOf(''+tagName),dataEnd<0&&(dataEnd=htmlText.length),eflags&html4
20 | .eflags.CDATA?handler.cdata&&handler.cdata(htmlText.substring(0,dataEnd),param):handler.rcdata&&handler.rcdata(normalizeRCData(htmlText.substring(0,dataEnd)),param),htmlText=htmlText.substring(dataEnd)),tagName=eflags=openTag=void
21 | 0,attribs.length=0,inTag=false}else if(m[1])handler.pcdata&&handler.pcdata(m[0],param);else
22 | if(m[3])openTag=!m[2],inTag=true,tagName=lcase(m[3]),eflags=html4 .ELEMENTS.hasOwnProperty(tagName)?html4
23 | .ELEMENTS[tagName]:void 0;else if(m[4])handler.pcdata&&handler.pcdata(m[4],param);else
24 | if(m[5]){if(handler.pcdata)switch(m[5]){case'<':handler.pcdata('<',param);break;case'>':handler.pcdata('>',param);break;default:handler.pcdata('&',param)}}}handler.endDoc&&handler.endDoc(param)}}return{'normalizeRCData':normalizeRCData,'escapeAttrib':escapeAttrib,'unescapeEntities':unescapeEntities,'makeSaxParser':makeSaxParser}})(),html.makeHtmlSanitizer=function(sanitizeAttributes){var
25 | ignoring,stack;return html.makeSaxParser({'startDoc':function(_){stack=[],ignoring=false},'startTag':function(tagName,attribs,out){var
26 | attribName,eflags,i,n,value;if(ignoring)return;if(!html4 .ELEMENTS.hasOwnProperty(tagName))return;eflags=html4
27 | .ELEMENTS[tagName];if(eflags&html4 .eflags.FOLDABLE)return;else if(eflags&html4 .eflags.UNSAFE)return ignoring=!(eflags&html4
28 | .eflags.EMPTY),void 0;attribs=sanitizeAttributes(tagName,attribs);if(attribs){eflags&html4
29 | .eflags.EMPTY||stack.push(tagName),out.push('<',tagName);for(i=0,n=attribs.length;i')}},'endTag':function(tagName,out){var
31 | eflags,i,index,stackEl;if(ignoring)return ignoring=false,void 0;if(!html4 .ELEMENTS.hasOwnProperty(tagName))return;eflags=html4
32 | .ELEMENTS[tagName];if(!(eflags&(html4 .eflags.UNSAFE|html4 .eflags.EMPTY|html4 .eflags.FOLDABLE))){if(eflags&html4
33 | .eflags.OPTIONAL_ENDTAG)for(index=stack.length;--index>=0;){stackEl=stack[index];if(stackEl===tagName)break;if(!(html4
34 | .ELEMENTS[stackEl]&html4 .eflags.OPTIONAL_ENDTAG))return}else for(index=stack.length;--index>=0;)if(stack[index]===tagName)break;if(index<0)return;for(i=stack.length;--i>index;)stackEl=stack[i],html4
35 | .ELEMENTS[stackEl]&html4 .eflags.OPTIONAL_ENDTAG||out.push('',stackEl,'>');stack.length=index,out.push('',tagName,'>')}},'pcdata':function(text,out){ignoring||out.push(text)},'rcdata':function(text,out){ignoring||out.push(text)},'cdata':function(text,out){ignoring||out.push(text)},'endDoc':function(out){var
36 | i;for(i=stack.length;--i>=0;)out.push('',stack[i],'>');stack.length=0}})};function
37 | html_sanitize(htmlText,opt_uriPolicy,opt_nmTokenPolicy){var out=[];return html.makeHtmlSanitizer(function
38 | sanitizeAttribs(tagName,attribs){var attribKey,attribName,atype,i,value;for(i=0;i").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;ic)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e==="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;ca";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,j=g?b[d.expando]:d.expando;if(!h[j])return;if(c){var k=e?h[j][f]:h[j];if(k){delete k[c];if(!i(k))return}}if(e){delete h[j][f];if(!i(h[j]))return}var l=h[j][f];d.support.deleteExpando||h!=a?delete h[j]:h[j]=null,l?(h[j]={},g||(h[j].toJSON=d.noop),h[j][f]=l):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!=="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(var g=c;g0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/",""],legend:[1,""],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div","
"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a!=="string"||X.test(a)||!d.support.leadingWhitespace&&S.test(a)||Z[(U.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(T,"<$1>$2>");try{for(var c=0,e=this.length;c1&&l0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||W.test(i)){if(typeof i==="string"){i=i.replace(T,"<$1>$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/