/*!
 * QUnit 1.17.1
 * http://qunitjs.com/
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2015-01-20T19:39Z
 */

/*
 * Javascript Diff Algorithm
 *  By John Resig (http://ejohn.org/)
 *  Modified by Chu Alan "sprite"
 *
 * Released under the MIT license.
 *
 * More Info:
 *  http://ejohn.org/projects/javascript-diff-algorithm/
 *
 * Usage: QUnit.diff(expected, actual)
 *
 * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the  quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
 */

!function(e){function t(){var e,t;y.autorun=!0,y.previousModule&&f("moduleDone",{name:y.previousModule.name,tests:y.previousModule.tests,failed:y.moduleStats.bad,passed:y.moduleStats.all-y.moduleStats.bad,total:y.moduleStats.all,runtime:I()-y.moduleStats.started}),delete y.previousModule,e=I()-y.started,t=y.stats.all-y.stats.bad,f("done",{failed:y.stats.bad,passed:t,total:y.stats.all,runtime:e})}function n(e,t){t=void 0===t?4:t;var n,r,s;if(e.stacktrace)return e.stacktrace.split("\n")[t+3];if(e.stack){if(n=e.stack.split("\n"),/^error$/i.test(n[0])&&n.shift(),E){for(r=[],s=t;s<n.length&&n[s].indexOf(E)===-1;s++)r.push(n[s]);if(r.length)return r.join("\n")}return n[t]}if(e.sourceURL){if(/qunit.js$/.test(e.sourceURL))return;return e.sourceURL+":"+e.line}}function r(e){var t=new Error;if(!t.stack)try{throw t}catch(e){t=e}return n(t,e)}function s(e,t){if("array"!==w.objectType(e))y.queue.push(e),y.autorun&&!y.blocking&&o(t);else for(;e.length;)s(e.shift())}function o(e){function n(){o(e)}var r=I();for(y.depth=(y.depth||0)+1;y.queue.length&&!y.blocking;){if(!(!L.setTimeout||y.updateRate<=0||I()-r<y.updateRate)){N(n,13);break}y.current&&(y.current.usedAsync=!1),y.queue.shift()()}y.depth--,!e||y.blocking||y.queue.length||0!==y.depth||t()}function i(){var e,t,n=[];if(!y.started){for(y.started=I(),h(),""===y.modules[0].name&&0===y.modules[0].tests.length&&y.modules.shift(),e=0,t=y.modules.length;e<t;e++)n.push({name:y.modules[e].name,tests:y.modules[e].tests});f("begin",{totalTests:g.count,modules:n})}y.blocking=!1,o(!0)}function a(){C=!0,L.setTimeout?N(function(){y.current&&y.current.semaphore>0||(y.timeout&&M(y.timeout),i())},13):i()}function u(){y.blocking=!0,y.testTimeout&&L.setTimeout&&(M(y.timeout),y.timeout=N(function(){if(!y.current)throw new Error("Test timed out");y.current.semaphore=0,w.pushFailure("Test timed out",r(2)),a()},y.testTimeout))}function l(){if(y.pollution=[],y.noglobals)for(var t in e)if(T.call(e,t)){if(/^qunit-test-output/.test(t))continue;y.pollution.push(t)}}function c(){var e,t,n=y.pollution;l(),e=d(y.pollution,n),e.length>0&&w.pushFailure("Introduced global variable(s): "+e.join(", ")),t=d(n,y.pollution),t.length>0&&w.pushFailure("Deleted global variable(s): "+t.join(", "))}function d(e,t){var n,r,s=e.slice();for(n=0;n<s.length;n++)for(r=0;r<t.length;r++)if(s[n]===t[r]){s.splice(n,1),n--;break}return s}function p(t,n,r){for(var s in n)T.call(n,s)&&("constructor"===s&&t===e||(void 0===n[s]?delete t[s]:r&&"undefined"!=typeof t[s]||(t[s]=n[s])));return t}function f(e,t){var n,r,s;for(s=y.callbacks[e],n=0,r=s.length;n<r;n++)s[n](t)}function h(){var t,n;for(t in x)w[t]!==x[t]&&(n=w[t],w[t]=x[t],w[t](n),e.console&&e.console.warn&&e.console.warn("QUnit."+t+" was replaced with a new value.\nPlease, check out the documentation on how to apply logging callbacks.\nReference: http://api.qunitjs.com/category/callbacks/"))}function m(e,t){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function g(e){var t,n;for(++g.count,p(this,e),this.assertions=[],this.semaphore=0,this.usedAsync=!1,this.module=y.currentModule,this.stack=r(3),t=0,n=this.module.tests;t<n.length;t++)this.module.tests[t].name===this.testName&&(this.testName+=" ");this.testId=v(this.module.name,this.testName),this.module.tests.push({name:this.testName,testId:this.testId}),e.skip?(this.callback=function(){},this.async=!1,this.expected=0):this.assert=new b(this)}function v(e,t){for(var n,r=0,s=0,o=e+""+t,i=o.length;r<i;r++)s=(s<<5)-s+o.charCodeAt(r),s|=0;return n=(4294967296+s).toString(16),n.length<8&&(n="0000000"+n),n.slice(-8)}function b(e){this.test=e}var w,y,q,x={},E=(r(0)||"").replace(/(:\d+)+\)?/,"").replace(/.+\//,""),k=Object.prototype.toString,T=Object.prototype.hasOwnProperty,S=e.Date,I=S.now||function(){return(new S).getTime()},j=!1,C=!1,N=e.setTimeout,M=e.clearTimeout,L={document:void 0!==e.document,setTimeout:void 0!==e.setTimeout,sessionStorage:function(){var e="qunit-test-string";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}()},U=function(e){var t,n,r=e.toString();return"[object"===r.substring(0,7)?(t=e.name?e.name.toString():"Error",n=e.message?e.message.toString():"",t&&n?t+": "+n:t?t:n?n:"Error"):r},H=function(e){var t,n,r=w.is("array",e)?[]:{};for(t in e)T.call(e,t)&&(n=e[t],r[t]=n===Object(n)?H(n):n);return r};w={},y={queue:[],blocking:!0,reorder:!0,altertitle:!0,scrolltop:!0,requireExpects:!1,urlConfig:[{id:"hidepassed",label:"Hide passed tests",tooltip:"Only show tests and assertions that fail. Stored as query-strings."},{id:"noglobals",label:"Check for Globals",tooltip:"Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings."},{id:"notrycatch",label:"No try-catch",tooltip:"Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings."}],modules:[],currentModule:{name:"",tests:[]},callbacks:{}},y.modules.push(y.currentModule),function(){var t,n,r=e.location||{search:"",protocol:"file:"},s=r.search.slice(1).split("&"),o=s.length,i={};if(s[0])for(t=0;t<o;t++)n=s[t].split("="),n[0]=decodeURIComponent(n[0]),n[1]=!n[1]||decodeURIComponent(n[1]),i[n[0]]?i[n[0]]=[].concat(i[n[0]],n[1]):i[n[0]]=n[1];if(i.filter===!0&&delete i.filter,w.urlParams=i,y.filter=i.filter,y.testId=[],i.testId)for(i.testId=[].concat(i.testId),t=0;t<i.testId.length;t++)y.testId.push(i.testId[t]);w.isLocal="file:"===r.protocol}(),p(w,{module:function(e,t){var n={name:e,testEnvironment:t,tests:[]};t&&t.setup&&(t.beforeEach=t.setup,delete t.setup),t&&t.teardown&&(t.afterEach=t.teardown,delete t.teardown),y.modules.push(n),y.currentModule=n},asyncTest:function(e,t,n){2===arguments.length&&(n=t,t=null),w.test(e,t,n,!0)},test:function(e,t,n,r){var s;2===arguments.length&&(n=t,t=null),s=new g({testName:e,expected:t,async:r,callback:n}),s.queue()},skip:function(e){var t=new g({testName:e,skip:!0});t.queue()},start:function(e){var t=j;if(y.current){if(y.current.semaphore-=e||1,y.current.semaphore>0)return;if(y.current.semaphore<0)return y.current.semaphore=0,void w.pushFailure("Called start() while already started (test's semaphore was 0 already)",r(2))}else{if(j=!0,C)throw new Error("Called start() outside of a test context while already started");if(t||e>1)throw new Error("Called start() outside of a test context too many times");if(y.autostart)throw new Error("Called start() outside of a test context when QUnit.config.autostart was true");if(!y.pageLoaded)return void(y.autostart=!0)}a()},stop:function(e){if(!y.current)throw new Error("Called stop() outside of a test context");y.current.semaphore+=e||1,u()},config:y,is:function(e,t){return w.objectType(t)===e},objectType:function(e){if("undefined"==typeof e)return"undefined";if(null===e)return"null";var t=k.call(e).match(/^\[object\s(.*)\]$/),n=t&&t[1]||"";switch(n){case"Number":return isNaN(e)?"nan":"number";case"String":case"Boolean":case"Array":case"Date":case"RegExp":case"Function":return n.toLowerCase()}return"object"==typeof e?"object":void 0},extend:p,load:function(){y.pageLoaded=!0,p(y,{stats:{all:0,bad:0},moduleStats:{all:0,bad:0},started:0,updateRate:1e3,autostart:!0,filter:""},!0),y.blocking=!1,y.autostart&&a()}}),function(){function e(e){var t=function(t){if("function"!==w.objectType(t))throw new Error("QUnit logging methods require a callback function as their first parameters.");y.callbacks[e].push(t)};return x[e]=t,t}var t,n,r,s=["begin","done","log","testStart","testDone","moduleStart","moduleDone"];for(t=0,n=s.length;t<n;t++)r=s[t],"undefined"===w.objectType(y.callbacks[r])&&(y.callbacks[r]=[]),w[r]=e(r)}(),q=e.onerror,e.onerror=function(e,t,n){var r=!1;if(q&&(r=q(e,t,n)),r!==!0){if(w.config.current){if(w.config.current.ignoreGlobalErrors)return!0;w.pushFailure(e,t+":"+n)}else w.test("global failure",p(function(){w.pushFailure(e,t+":"+n)},{validTest:!0}));return!1}return r},g.count=0,g.prototype={before:function(){this.module===y.previousModule&&T.call(y,"previousModule")||(T.call(y,"previousModule")&&f("moduleDone",{name:y.previousModule.name,tests:y.previousModule.tests,failed:y.moduleStats.bad,passed:y.moduleStats.all-y.moduleStats.bad,total:y.moduleStats.all,runtime:I()-y.moduleStats.started}),y.previousModule=this.module,y.moduleStats={all:0,bad:0,started:I()},f("moduleStart",{name:this.module.name,tests:this.module.tests})),y.current=this,this.testEnvironment=p({},this.module.testEnvironment),delete this.testEnvironment.beforeEach,delete this.testEnvironment.afterEach,this.started=I(),f("testStart",{name:this.testName,module:this.module.name,testId:this.testId}),y.pollution||l()},run:function(){var e;if(y.current=this,this.async&&w.stop(),this.callbackStarted=I(),y.notrycatch)return e=this.callback.call(this.testEnvironment,this.assert),void this.resolvePromise(e);try{e=this.callback.call(this.testEnvironment,this.assert),this.resolvePromise(e)}catch(e){this.pushFailure("Died on test #"+(this.assertions.length+1)+" "+this.stack+": "+(e.message||e),n(e,0)),l(),y.blocking&&w.start()}},after:function(){c()},queueHook:function(e,t){var r,s=this;return function(){if(y.current=s,y.notrycatch)return r=e.call(s.testEnvironment,s.assert),void s.resolvePromise(r,t);try{r=e.call(s.testEnvironment,s.assert),s.resolvePromise(r,t)}catch(e){s.pushFailure(t+" failed on "+s.testName+": "+(e.message||e),n(e,0))}}},hooks:function(e){var t=[];return this.skip?t:(this.module.testEnvironment&&"function"===w.objectType(this.module.testEnvironment[e])&&t.push(this.queueHook(this.module.testEnvironment[e],e)),t)},finish:function(){y.current=this,y.requireExpects&&null===this.expected?this.pushFailure("Expected number of assertions to be defined, but expect() was not called.",this.stack):null!==this.expected&&this.expected!==this.assertions.length?this.pushFailure("Expected "+this.expected+" assertions, but "+this.assertions.length+" were run",this.stack):null!==this.expected||this.assertions.length||this.pushFailure("Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.",this.stack);var e,t=0;for(this.runtime=I()-this.started,y.stats.all+=this.assertions.length,y.moduleStats.all+=this.assertions.length,e=0;e<this.assertions.length;e++)this.assertions[e].result||(t++,y.stats.bad++,y.moduleStats.bad++);f("testDone",{name:this.testName,module:this.module.name,skipped:!!this.skip,failed:t,passed:this.assertions.length-t,total:this.assertions.length,runtime:this.runtime,assertions:this.assertions,testId:this.testId,duration:this.runtime}),w.reset(),y.current=void 0},queue:function(){function e(){s([function(){n.before()},n.hooks("beforeEach"),function(){n.run()},n.hooks("afterEach").reverse(),function(){n.after()},function(){n.finish()}])}var t,n=this;this.valid()&&(t=w.config.reorder&&L.sessionStorage&&+sessionStorage.getItem("qunit-test-"+this.module.name+"-"+this.testName),t?e():s(e,!0))},push:function(e,t,n,s){var o,i={module:this.module.name,name:this.testName,result:e,message:s,actual:t,expected:n,testId:this.testId,runtime:I()-this.started};e||(o=r(),o&&(i.source=o)),f("log",i),this.assertions.push({result:!!e,message:s})},pushFailure:function(e,t,n){if(!this instanceof g)throw new Error("pushFailure() assertion outside test context, was "+r(2));var s={module:this.module.name,name:this.testName,result:!1,message:e||"error",actual:n||null,testId:this.testId,runtime:I()-this.started};t&&(s.source=t),f("log",s),this.assertions.push({result:!1,message:e})},resolvePromise:function(e,t){var r,s,o=this;null!=e&&(r=e.then,"function"===w.objectType(r)&&(w.stop(),r.call(e,w.start,function(e){s="Promise rejected "+(t?t.replace(/Each$/,""):"during")+" "+o.testName+": "+(e.message||e),o.pushFailure(s,n(e,0)),l(),w.start()})))},valid:function(){var e,t=y.filter,n=w.urlParams.module&&w.urlParams.module.toLowerCase(),r=(this.module.name+": "+this.testName).toLowerCase();return!(!this.callback||!this.callback.validTest)||!(y.testId.length>0&&m(this.testId,y.testId)<0)&&(!(n&&(!this.module.name||this.module.name.toLowerCase()!==n))&&(!t||(e="!"!==t.charAt(0),e||(t=t.toLowerCase().slice(1)),r.indexOf(t)!==-1?e:!e)))}},w.reset=function(){if("undefined"!=typeof e){var t=L.document&&document.getElementById&&document.getElementById("qunit-fixture");t&&(t.innerHTML=y.fixture)}},w.pushFailure=function(){if(!w.config.current)throw new Error("pushFailure() assertion outside test context, in "+r(2));var e=w.config.current;return e.pushFailure.apply(e,arguments)},w.assert=b.prototype={expect:function(e){return 1!==arguments.length?this.test.expected:void(this.test.expected=e)},async:function(){var e=this.test,t=!1;return e.semaphore+=1,e.usedAsync=!0,u(),function(){t?e.pushFailure("Called the callback returned from `assert.async` more than once",r(2)):(e.semaphore-=1,t=!0,a())}},push:function(){var e=this,t=e instanceof b&&e.test||w.config.current;if(!t)throw new Error("assertion outside test context, in "+r(2));return t.usedAsync===!0&&0===t.semaphore&&t.pushFailure("Assertion after the final `assert.async` was resolved",r(2)),e instanceof b||(e=t.assert),e.test.push.apply(e.test,arguments)},ok:function(e,t){t=t||(e?"okay":"failed, expected argument to be truthy, was: "+w.dump.parse(e)),this.push(!!e,e,!0,t)},equal:function(e,t,n){this.push(t==e,e,t,n)},notEqual:function(e,t,n){this.push(t!=e,e,t,n)},propEqual:function(e,t,n){e=H(e),t=H(t),this.push(w.equiv(e,t),e,t,n)},notPropEqual:function(e,t,n){e=H(e),t=H(t),this.push(!w.equiv(e,t),e,t,n)},deepEqual:function(e,t,n){this.push(w.equiv(e,t),e,t,n)},notDeepEqual:function(e,t,n){this.push(!w.equiv(e,t),e,t,n)},strictEqual:function(e,t,n){this.push(t===e,e,t,n)},notStrictEqual:function(e,t,n){this.push(t!==e,e,t,n)},throws:function(e,t,n){var r,s,o=t,i=!1;null==n&&"string"==typeof t&&(n=t,t=null),this.test.ignoreGlobalErrors=!0;try{e.call(this.test.testEnvironment)}catch(e){r=e}this.test.ignoreGlobalErrors=!1,r?(s=w.objectType(t),t?"regexp"===s?i=t.test(U(r)):"string"===s?i=t===U(r):"function"===s&&r instanceof t?i=!0:"object"===s?i=r instanceof t.constructor&&r.name===t.name&&r.message===t.message:"function"===s&&t.call({},r)===!0&&(o=null,i=!0):(i=!0,o=null),this.push(i,r,o,n)):this.test.pushFailure(n,null,"No exception was thrown.")}},function(){b.prototype.raises=b.prototype.throws}(),w.equiv=function(){function e(e,t,n){var r=w.objectType(e);if(r)return"function"===w.objectType(t[r])?t[r].apply(t,n):t[r]}var t,n=[],r=[],s=[],o=Object.getPrototypeOf||function(e){return e.__proto__},i=function(){function e(e,t){return e instanceof t.constructor||t instanceof e.constructor?t==e:t===e}return{string:e,boolean:e,number:e,null:e,undefined:e,nan:function(e){return isNaN(e)},date:function(e,t){return"date"===w.objectType(e)&&t.valueOf()===e.valueOf()},regexp:function(e,t){return"regexp"===w.objectType(e)&&t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky},function:function(){var e=n[n.length-1];return e!==Object&&"undefined"!=typeof e},array:function(e,n){var o,i,a,u,l,c;if("array"!==w.objectType(e))return!1;if(a=n.length,a!==e.length)return!1;for(r.push(n),s.push(e),o=0;o<a;o++){for(u=!1,i=0;i<r.length;i++)if(l=r[i]===n[o],c=s[i]===e[o],l||c){if(!(n[o]===e[o]||l&&c))return r.pop(),s.pop(),!1;u=!0}if(!u&&!t(n[o],e[o]))return r.pop(),s.pop(),!1}return r.pop(),s.pop(),!0},object:function(e,i){var a,u,l,c,d,p=!0,f=[],h=[];if(i.constructor!==e.constructor&&!(null===o(i)&&o(e)===Object.prototype||null===o(e)&&o(i)===Object.prototype))return!1;n.push(i.constructor),r.push(i),s.push(e);for(a in i){for(l=!1,u=0;u<r.length;u++)if(c=r[u]===i[a],d=s[u]===e[a],c||d){if(!(i[a]===e[a]||c&&d)){p=!1;break}l=!0}if(f.push(a),!l&&!t(i[a],e[a])){p=!1;break}}r.pop(),s.pop(),n.pop();for(a in e)h.push(a);return p&&t(f.sort(),h.sort())}}}();return t=function(){var n=[].slice.apply(arguments);return n.length<2||function(t,n){return t===n||null!==t&&null!==n&&"undefined"!=typeof t&&"undefined"!=typeof n&&w.objectType(t)===w.objectType(n)&&e(t,i,[n,t])}(n[0],n[1])&&t.apply(this,n.splice(1,n.length-1))}}(),w.dump=function(){function e(e){return'"'+e.toString().replace(/"/g,'\\"')+'"'}function t(e){return e+""}function n(e,t,n){var r=o.separator(),s=o.indent(),i=o.indent(1);return t.join&&(t=t.join(","+r+i)),t?[e,i+t,s+n].join(r):e+n}function r(e,t){var r=e.length,s=new Array(r);if(o.maxDepth&&o.depth>o.maxDepth)return"[object Array]";for(this.up();r--;)s[r]=this.parse(e[r],void 0,t);return this.down(),n("[",s,"]")}var s=/^function (\w+)/,o={parse:function(e,t,n){n=n||[];var r,s,o,i=m(e,n);return i!==-1?"recursion("+(i-n.length)+")":(t=t||this.typeOf(e),s=this.parsers[t],o=typeof s,"function"===o?(n.push(e),r=s.call(this,e,n),n.pop(),r):"string"===o?s:this.parsers.error)},typeOf:function(e){var t;return t=null===e?"null":"undefined"==typeof e?"undefined":w.is("regexp",e)?"regexp":w.is("date",e)?"date":w.is("function",e)?"function":void 0!==e.setInterval&&void 0!==e.document&&void 0===e.nodeType?"window":9===e.nodeType?"document":e.nodeType?"node":"[object Array]"===k.call(e)||"number"==typeof e.length&&void 0!==e.item&&(e.length?e.item(0)===e[0]:null===e.item(0)&&void 0===e[0])?"array":e.constructor===Error.prototype.constructor?"error":typeof e},separator:function(){return this.multiline?this.HTML?"<br />":"\n":this.HTML?"&#160;":" "},indent:function(e){if(!this.multiline)return"";var t=this.indentChar;return this.HTML&&(t=t.replace(/\t/g,"   ").replace(/ /g,"&#160;")),new Array(this.depth+(e||0)).join(t)},up:function(e){this.depth+=e||1},down:function(e){this.depth-=e||1},setParser:function(e,t){this.parsers[e]=t},quote:e,literal:t,join:n,depth:1,maxDepth:5,parsers:{window:"[Window]",document:"[Document]",error:function(e){return'Error("'+e.message+'")'},unknown:"[Unknown]",null:"null",undefined:"undefined",function:function(e){var t="function",r="name"in e?e.name:(s.exec(e)||[])[1];return r&&(t+=" "+r),t+="( ",t=[t,o.parse(e,"functionArgs"),"){"].join(""),n(t,o.parse(e,"functionCode"),"}")},array:r,nodelist:r,arguments:r,object:function(e,t){var r,s,i,a,u,l=[];if(o.maxDepth&&o.depth>o.maxDepth)return"[object Object]";o.up(),r=[];for(s in e)r.push(s);u=["message","name"];for(a in u)s=u[a],s in e&&!(s in r)&&r.push(s);for(r.sort(),a=0;a<r.length;a++)s=r[a],i=e[s],l.push(o.parse(s,"key")+": "+o.parse(i,void 0,t));return o.down(),n("{",l,"}")},node:function(e){var t,n,r,s=o.HTML?"&lt;":"<",i=o.HTML?"&gt;":">",a=e.nodeName.toLowerCase(),u=s+a,l=e.attributes;if(l)for(n=0,t=l.length;n<t;n++)r=l[n].nodeValue,r&&"inherit"!==r&&(u+=" "+l[n].nodeName+"="+o.parse(r,"attribute"));return u+=i,3!==e.nodeType&&4!==e.nodeType||(u+=e.nodeValue),u+s+"/"+a+i},functionArgs:function(e){var t,n=e.length;if(!n)return"";for(t=new Array(n);n--;)t[n]=String.fromCharCode(97+n);return" "+t.join(", ")+" "},key:e,functionCode:"[code]",attribute:e,string:e,date:e,regexp:t,number:t,boolean:t},HTML:!1,indentChar:"  ",multiline:!0};return o}(),w.jsDump=w.dump,"undefined"!=typeof e&&(!function(){function e(e){return function(){var t=new b(w.config.current);e.apply(t,arguments)}}var t,n=b.prototype;for(t in n)w[t]=e(n[t])}(),function(){var t,n,r=["test","module","expect","asyncTest","start","stop","ok","equal","notEqual","propEqual","notPropEqual","deepEqual","notDeepEqual","strictEqual","notStrictEqual","throws"];for(t=0,n=r.length;t<n;t++)e[r[t]]=w[r[t]]}(),e.QUnit=w),"undefined"!=typeof module&&module&&module.exports&&(module.exports=w,module.exports.QUnit=w),"undefined"!=typeof exports&&exports&&(exports.QUnit=w)}(function(){return this}()),QUnit.diff=function(){function e(e,n){var r,s={},o={};for(r=0;r<n.length;r++)t.call(s,n[r])||(s[n[r]]={rows:[],o:null}),s[n[r]].rows.push(r);for(r=0;r<e.length;r++)t.call(o,e[r])||(o[e[r]]={rows:[],n:null}),o[e[r]].rows.push(r);for(r in s)t.call(s,r)&&1===s[r].rows.length&&t.call(o,r)&&1===o[r].rows.length&&(n[s[r].rows[0]]={text:n[s[r].rows[0]],row:o[r].rows[0]},e[o[r].rows[0]]={text:e[o[r].rows[0]],row:s[r].rows[0]});for(r=0;r<n.length-1;r++)null!=n[r].text&&null==n[r+1].text&&n[r].row+1<e.length&&null==e[n[r].row+1].text&&n[r+1]==e[n[r].row+1]&&(n[r+1]={text:n[r+1],row:n[r].row+1},e[n[r].row+1]={text:e[n[r].row+1],row:r+1});for(r=n.length-1;r>0;r--)null!=n[r].text&&null==n[r-1].text&&n[r].row>0&&null==e[n[r].row-1].text&&n[r-1]==e[n[r].row-1]&&(n[r-1]={text:n[r-1],row:n[r].row-1},e[n[r].row-1]={text:e[n[r].row-1],row:r-1});return{o:e,n:n}}var t=Object.prototype.hasOwnProperty;return function(t,n){t=t.replace(/\s+$/,""),n=n.replace(/\s+$/,"");var r,s,o="",i=e(""===t?[]:t.split(/\s+/),""===n?[]:n.split(/\s+/)),a=t.match(/\s+/g),u=n.match(/\s+/g);if(null==a?a=[" "]:a.push(" "),null==u?u=[" "]:u.push(" "),0===i.n.length)for(r=0;r<i.o.length;r++)o+="<del>"+i.o[r]+a[r]+"</del>";else{if(null==i.n[0].text)for(n=0;n<i.o.length&&null==i.o[n].text;n++)o+="<del>"+i.o[n]+a[n]+"</del>";for(r=0;r<i.n.length;r++)if(null==i.n[r].text)o+="<ins>"+i.n[r]+u[r]+"</ins>";else{for(s="",n=i.n[r].row+1;n<i.o.length&&null==i.o[n].text;n++)s+="<del>"+i.o[n]+a[n]+"</del>";o+=" "+i.n[r].text+u[r]+s}}return o}}(),function(){function e(e){return e?(e+="",e.replace(/['"<>&]/g,function(e){switch(e){case"'":return"&#039;";case'"':return"&quot;";case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;"}})):""}function t(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)}function n(e,n,r){for(var s=e.length;s--;)t(e[s],n,r)}function r(e,t){return(" "+e.className+" ").indexOf(" "+t+" ")>=0}function s(e,t){r(e,t)||(e.className+=(e.className?" ":"")+t)}function o(e,t){r(e,t)?i(e,t):s(e,t)}function i(e,t){for(var n=" "+e.className+" ";n.indexOf(" "+t+" ")>=0;)n=n.replace(" "+t+" "," ");e.className="function"==typeof n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function a(e){return I.document&&document.getElementById&&document.getElementById(e)}function u(){var t,n,r,s,o,i=!1,a=T.urlConfig.length,u="";for(t=0;t<a;t++)if(r=T.urlConfig[t],"string"==typeof r&&(r={id:r,label:r}),s=e(r.id),o=e(r.tooltip),void 0===T[r.id]&&(T[r.id]=QUnit.urlParams[r.id]),r.value&&"string"!=typeof r.value){if(u+="<label for='qunit-urlconfig-"+s+"' title='"+o+"'>"+r.label+": </label><select id='qunit-urlconfig-"+s+"' name='"+s+"' title='"+o+"'><option></option>",QUnit.is("array",r.value))for(n=0;n<r.value.length;n++)s=e(r.value[n]),u+="<option value='"+s+"'"+(T[r.id]===r.value[n]?(i=!0)&&" selected='selected'":"")+">"+s+"</option>";else for(n in r.value)S.call(r.value,n)&&(u+="<option value='"+e(n)+"'"+(T[r.id]===n?(i=!0)&&" selected='selected'":"")+">"+e(r.value[n])+"</option>");T[r.id]&&!i&&(s=e(T[r.id]),u+="<option value='"+s+"' selected='selected' disabled='disabled'>"+s+"</option>"),u+="</select>"}else u+="<input id='qunit-urlconfig-"+s+"' name='"+s+"' type='checkbox'"+(r.value?" value='"+e(r.value)+"'":"")+(T[r.id]?" checked='checked'":"")+" title='"+o+"' /><label for='qunit-urlconfig-"+s+"' title='"+o+"'>"+r.label+"</label>";return u}function l(){var e,t,n=this,r={};t="selectedIndex"in n?n.options[n.selectedIndex].value||void 0:n.checked?n.defaultValue||!0:void 0,r[n.name]=t,e=c(r),"hidepassed"===n.name&&"replaceState"in window.history?(T[n.name]=t||!1,t?s(a("qunit-tests"),"hidepass"):i(a("qunit-tests"),"hidepass"),window.history.replaceState(null,"",e)):window.location=e}function c(e){var t,n="?";e=QUnit.extend(QUnit.extend({},QUnit.urlParams),e);for(t in e)if(S.call(e,t)){if(void 0===e[t])continue;n+=encodeURIComponent(t),e[t]!==!0&&(n+="="+encodeURIComponent(e[t])),n+="&"}return location.protocol+"//"+location.host+location.pathname+n.slice(0,-1)}function d(){var e=a("qunit-modulefilter"),t=decodeURIComponent(e.options[e.selectedIndex].value),n=a("qunit-filter-input").value;window.location=c({module:""===t?void 0:t,filter:""===n?void 0:n,testId:void 0})}function p(){var e=document.createElement("span");return e.innerHTML=u(),s(e,"qunit-url-config"),n(e.getElementsByTagName("input"),"click",l),n(e.getElementsByTagName("select"),"change",l),e}function f(){var e=document.createElement("form"),n=document.createElement("label"),r=document.createElement("input"),o=document.createElement("button");return s(e,"qunit-filter"),n.innerHTML="Filter: ",r.type="text",r.value=T.filter||"",r.name="filter",r.id="qunit-filter-input",o.innerHTML="Go",n.appendChild(r),e.appendChild(n),e.appendChild(o),t(e,"submit",function(e){return d(),e&&e.preventDefault&&e.preventDefault(),!1}),e}function h(){var t,n="";if(!j.length)return!1;for(j.sort(function(e,t){return e.localeCompare(t)}),n+="<label for='qunit-modulefilter'>Module: </label><select id='qunit-modulefilter' name='modulefilter'><option value='' "+(void 0===QUnit.urlParams.module?"selected='selected'":"")+">< All Modules ></option>",t=0;t<j.length;t++)n+="<option value='"+e(encodeURIComponent(j[t]))+"' "+(QUnit.urlParams.module===j[t]?"selected='selected'":"")+">"+e(j[t])+"</option>";return n+="</select>"}function m(){var e=a("qunit-testrunner-toolbar"),n=document.createElement("span"),r=h();return!(!e||!r)&&(n.setAttribute("id","qunit-modulefilter-container"),n.innerHTML=r,t(n.lastChild,"change",d),void e.appendChild(n))}function g(){var e=a("qunit-testrunner-toolbar");e&&(e.appendChild(p()),e.appendChild(f()))}function v(){var e=a("qunit-header");e&&(e.innerHTML="<a href='"+c({filter:void 0,module:void 0,testId:void 0})+"'>"+e.innerHTML+"</a> ")}function b(){var e=a("qunit-banner");e&&(e.className="")}function w(){var e=a("qunit-tests"),t=a("qunit-testresult");t&&t.parentNode.removeChild(t),e&&(e.innerHTML="",t=document.createElement("p"),t.id="qunit-testresult",t.className="result",e.parentNode.insertBefore(t,e),t.innerHTML="Running...<br />&#160;")}function y(){var e=a("qunit-fixture");e&&(T.fixture=e.innerHTML)}function q(){var e=a("qunit-userAgent");e&&(e.innerHTML="",e.appendChild(document.createTextNode(navigator.userAgent)))}function x(e){var t,n,r,s,o,i;for(t=0,n=e.length;t<n;t++)for(i=e[t],i.name&&j.push(i.name),r=0,s=i.tests.length;r<s;r++)o=i.tests[r],E(o.name,o.testId,i.name)}function E(e,t,n){var r,s,o,i,u=a("qunit-tests");u&&(r=document.createElement("strong"),r.innerHTML=k(e,n),s=document.createElement("a"),s.innerHTML="Rerun",s.href=c({testId:t}),o=document.createElement("li"),o.appendChild(r),o.appendChild(s),o.id="qunit-test-output-"+t,i=document.createElement("ol"),i.className="qunit-assert-list",o.appendChild(i),u.appendChild(o))}function k(t,n){var r="";return n&&(r="<span class='module-name'>"+e(n)+"</span>: "),r+="<span class='test-name'>"+e(t)+"</span>"}if(QUnit.init=function(){var t,n,r,s,o=QUnit.config;o.stats={all:0,bad:0},o.moduleStats={all:0,bad:0},o.started=0,o.updateRate=1e3,o.blocking=!1,o.autostart=!0,o.autorun=!1,o.filter="",o.queue=[],"undefined"!=typeof window&&(s=a("qunit"),s&&(s.innerHTML="<h1 id='qunit-header'>"+e(document.title)+"</h1><h2 id='qunit-banner'></h2><div id='qunit-testrunner-toolbar'></div><h2 id='qunit-userAgent'></h2><ol id='qunit-tests'></ol>"),t=a("qunit-tests"),n=a("qunit-banner"),r=a("qunit-testresult"),t&&(t.innerHTML=""),n&&(n.className=""),r&&r.parentNode.removeChild(r),t&&(r=document.createElement("p"),r.id="qunit-testresult",r.className="result",t.parentNode.insertBefore(r,t),r.innerHTML="Running...<br />&#160;"))},"undefined"!=typeof window){var T=QUnit.config,S=Object.prototype.hasOwnProperty,I={document:void 0!==window.document,sessionStorage:function(){var e="qunit-test-string";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}()},j=[];QUnit.begin(function(t){var n=a("qunit");y(),n&&(n.innerHTML="<h1 id='qunit-header'>"+e(document.title)+"</h1><h2 id='qunit-banner'></h2><div id='qunit-testrunner-toolbar'></div><h2 id='qunit-userAgent'></h2><ol id='qunit-tests'></ol>"),v(),b(),w(),q(),g(),x(t.modules),m(),n&&T.hidepassed&&s(n.lastChild,"hidepass")}),QUnit.done(function(e){var t,n,r=a("qunit-banner"),s=a("qunit-tests"),o=["Tests completed in ",e.runtime," milliseconds.<br />","<span class='passed'>",e.passed,"</span> assertions of <span class='total'>",e.total,"</span> passed, <span class='failed'>",e.failed,"</span> failed."].join("");if(r&&(r.className=e.failed?"qunit-fail":"qunit-pass"),s&&(a("qunit-testresult").innerHTML=o),T.altertitle&&I.document&&document.title&&(document.title=[e.failed?"✖":"✔",document.title.replace(/^[\u2714\u2716] /i,"")].join(" ")),T.reorder&&I.sessionStorage&&0===e.failed)for(t=0;t<sessionStorage.length;t++)n=sessionStorage.key(t++),0===n.indexOf("qunit-test-")&&sessionStorage.removeItem(n);T.scrolltop&&window.scrollTo&&window.scrollTo(0,0)}),QUnit.testStart(function(e){var t,n;n=a("qunit-test-output-"+e.testId),n?n.className="running":E(e.name,e.testId,e.module),t=a("qunit-testresult"),t&&(t.innerHTML="Running: <br />"+k(e.name,e.module))}),QUnit.log(function(t){var n,r,s,o,i,u=a("qunit-test-output-"+t.testId);u&&(s=e(t.message)||(t.result?"okay":"failed"),s="<span class='test-message'>"+s+"</span>",s+="<span class='runtime'>@ "+t.runtime+" ms</span>",!t.result&&S.call(t,"expected")?(o=e(QUnit.dump.parse(t.expected)),i=e(QUnit.dump.parse(t.actual)),s+="<table><tr class='test-expected'><th>Expected: </th><td><pre>"+o+"</pre></td></tr>",i!==o&&(s+="<tr class='test-actual'><th>Result: </th><td><pre>"+i+"</pre></td></tr><tr class='test-diff'><th>Diff: </th><td><pre>"+QUnit.diff(o,i)+"</pre></td></tr>"),t.source&&(s+="<tr class='test-source'><th>Source: </th><td><pre>"+e(t.source)+"</pre></td></tr>"),s+="</table>"):!t.result&&t.source&&(s+="<table><tr class='test-source'><th>Source: </th><td><pre>"+e(t.source)+"</pre></td></tr></table>"),n=u.getElementsByTagName("ol")[0],r=document.createElement("li"),r.className=t.result?"pass":"fail",r.innerHTML=s,n.appendChild(r))}),QUnit.testDone(function(e){var n,r,i,u,l,c,d,p,f=a("qunit-tests");f&&(i=a("qunit-test-output-"+e.testId),u=i.getElementsByTagName("ol")[0],l=e.passed,c=e.failed,T.reorder&&I.sessionStorage&&(c?sessionStorage.setItem("qunit-test-"+e.module+"-"+e.name,c):sessionStorage.removeItem("qunit-test-"+e.module+"-"+e.name)),0===c&&s(u,"qunit-collapsed"),n=i.firstChild,d=c?"<b class='failed'>"+c+"</b>, <b class='passed'>"+l+"</b>, ":"",n.innerHTML+=" <b class='counts'>("+d+e.assertions.length+")</b>",e.skipped?(i.className="skipped",p=document.createElement("em"),p.className="qunit-skipped-label",p.innerHTML="skipped",i.insertBefore(p,n)):(t(n,"click",function(){o(u,"qunit-collapsed")}),i.className=c?"fail":"pass",r=document.createElement("span"),r.className="runtime",r.innerHTML=e.runtime+" ms",i.insertBefore(r,u)))}),I.document&&"complete"!==document.readyState||(T.pageLoaded=!0,T.autorun=!0),I.document&&t(window,"load",QUnit.load)}}();