function collapse(e){var t,e=e.target,n=e.parentNode.getElementsByClassName("collapsible");n.length&&("none"===(n=n[0]).style.display?(t=n.parentNode.getElementsByClassName("ellipsis")[0],n.parentNode.removeChild(t),n.style.display=""):(n.style.display="none",(t=document.createElement("span")).className="ellipsis",t.innerHTML=" … ",n.parentNode.insertBefore(t,n)),e.innerHTML="-"===e.innerHTML?"+":"-")}function addCollapser(e){var t;"LI"===e.nodeName&&((t=document.createElement("div")).className="collapser",t.innerHTML="-",t.addEventListener("click",collapse,!1),e.insertBefore(t,e.firstChild))}function jsonView(e,t){if(this.debug=!1,-1!==e.indexOf("#"))this.idType="id",this.id=e.replace("#","");else{if(-1===e.indexOf("."))return void(this.debug&&console.log("Can't find that element"));this.idType="class",this.id=e.replace(".","")}if(this.data=document.getElementById(this.id).innerHTML,-1!==t.indexOf("#"))this.targetType="id",this.target=t.replace("#","");else{if(-1===e.indexOf("."))return void(this.debug&&console.log("Can't find the target element"));this.targetType="class",this.target=t.replace(".","")}/^\(.*)\<\/pre\>$/.test(this.data)&&(this.debug&&console.log("JSONView: data is wrapped in
...
, stripping HTML..."),this.data=this.data.replace(/<(?:.|\s)*?>/g,""));var e=/^[\s\u200B\uFEFF]*([\w$\[\]\.]+)[\s\u200B\uFEFF]*\([\s\u200B\uFEFF]*([\[{][\s\S]*[\]}])[\s\u200B\uFEFF]*\);?[\s\u200B\uFEFF]*$/,t=/^\s*([\[\{].*[\}\]])\s*$/.test(this.data),n=e.test(this.data);if(this.debug&&console.log("JSONView: is_json="+t+" is_jsonp="+n),t||n){function a(){}this.debug&&console.log("JSONView: sexytime!"),a.prototype={htmlEncode:function(e){return null!=e?e.toString().replace(/&/g,"&").replace(/"/g,""").replace(//g,">"):""},decorateWithSpan:function(e,t){return''+this.htmlEncode(e)+""},valueToHTML:function(e){var t=typeof e,n="";return null===e?n+=this.decorateWithSpan("null","null"):e&&e.constructor===Array?n+=this.arrayToHTML(e):"object"==t?n+=this.objectToHTML(e):"number"==t?n+=this.decorateWithSpan(e,"num"):"string"==t?/^(http|https):\/\/[^\s]+$/.test(e)?n+=''+this.htmlEncode(e)+"":n+=this.decorateWithSpan('"'+e+'"',"string"):"boolean"==t&&(n+=this.decorateWithSpan(e,"bool")),n},arrayToHTML:function(e){var t,n='[]",n=a?n:"[ ]"},objectToHTML:function(e){var t,n='{}",n=a?n:"{ }"},jsonToHTML:function(e,t,n){var a="";return t?a=a+'
'+t+' (
':a+='
',a=a+this.valueToHTML(e)+"
",t&&(a+='
)
'),this.toHTML(a,n)},errorPage:function(e,t,n){var a='
Error parsing JSON: '+e.message+"
",a=(a+="

"+e.stack+":

")+('
'+this.htmlEncode(t)+"
");return this.toHTML(a,n+" - Error")},toHTML:function(e){return e}},this.jsonFormatter=new a;var t="",n="",r="",e=e.exec(this.data),n=e&&3===e.length?(this.debug&&console.log("THIS IS JSONp"),r=e[1],e[2]):(this.debug&&console.log("Vanilla JSON"),this.data);this.debug&&console.log(n);try{var i=JSON.parse(n);if(!i)throw"There was no object!";t=this.jsonFormatter.jsonToHTML(i,r)}catch(e){this.debug&&console.log(e),t=this.jsonFormatter.errorPage(e,this.data)}for(var o,e="",l=(void 0!==this.targetType&&(this.idType=this.targetType,this.id=this.target),"class"===this.idType?(o=document.getElementsByClassName(this.id))&&(o.className+=o.className?" jsonViewOutput":"jsonViewOutput",o.innerHTML=e+t):"id"===this.idType&&((o=document.getElementById(this.id))&&(o.className+=o.className?" jsonViewOutput":"jsonViewOutput",o.innerHTML=e+t),o.innerHTML=e+t),document.getElementsByClassName("collapsible")),s=l.length,u=0;ut.max))&&e.val("")}),this};var e,t,a={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:NaN},n={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:NaN,maxDecimalPlaces:NaN,maxPreDecimalPlaces:NaN,max:NaN,min:NaN},i={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},o={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},l=(e="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_",(e+=" ")+"¬€£¦"),s=",",u=".",p=function(){var e,t="0123456789".split(""),n={},a=0;for(a=0;ai.max)||(r=e+t,(i=n).min&&!(0=a.maxLength||!(0<=a.allow.indexOf(n)||a.allowSpace&&" "==n)&&(a.blacklistSet.contains(n)||!a.allowNumeric&&p[n]||!a.allowUpper&&(r=(c=n).toUpperCase(),i=c.toLowerCase(),c==r)&&r!=i||!a.allowLower&&(r=(c=n).toUpperCase(),i=c.toLowerCase(),c==i)&&r!=i||!a.allowCaseless&&(c=n).toUpperCase()==c.toLowerCase()||!a.allowLatin&&d.contains(n)||!a.allowOtherCharSets&&!p[n]&&!d.contains(n))||l.push(u)}return l.join("")}function w(e,t){if("string"!=typeof e)return e;for(var n=e.split(""),a=[],r=0,r=0;r=i.captureLength&&n!=e.text||t&&(n.length>=i.captureLength||i.allowSubmit)||0==n.length&&e.text)&&(e.text=n,e.cb.call(e.el,n))},t)}))}return this.each(function(){t(this)})}});