jsonbinpack
Version:
A space-efficient schema-driven binary JSON serialization format based on JSON Schema
1 lines • 271 kB
JavaScript
!function r(i,o,l){function u(e,t){if(!o[e]){if(!i[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(a)return a(e,!0);throw(n=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",n}n=o[e]={exports:{}},i[e][0].call(n.exports,function(t){return u(i[e][1][t]||t)},n,n.exports,r,i,o,l)}return o[e].exports}for(var a="function"==typeof require&&require,t=0;t<l.length;t++)u(l[t]);return u}({1:[function(t,e,w){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){t[r=void 0===r?n:r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},x=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},C=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),l=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)l.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return l},S=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(w,"__esModule",{value:!0}),w.qualify=w.summarize=w.JSONStatsSizeQualifier=w.analyze=void 0;function _(t){return JSON.parse(JSON.stringify(t))}var L=n(t("lodash")),k=t("../lib/json"),T={byteSize:0,height:0,largestLevel:1,duplicatedKeys:0,duplicatedValues:0,keys:{count:0,byteSize:0},values:{numeric:{count:0,byteSize:0},textual:{count:0,byteSize:0},boolean:{count:0,byteSize:0},structural:{count:0,byteSize:0}}};w.analyze=function(t,e,n,r,i,o){var l,u,a,s;void 0===e&&(e=0),void 0===n&&(n=_(T)),void 0===r&&(r=new Set),void 0===o&&(o=[]),(i=void 0===i?[]:i).push(_(t)),n.byteSize=Math.max(n.byteSize,k.getJSONSize(t)),o[e]=null!==(c=o[e])&&void 0!==c?c:0,n.height=Math.max(n.height,e);var c=k.getJSONTypeCategory(k.getJSONType(t));if(n.values[c].count+=1,"object"!=typeof t||Array.isArray(t)||null===t)if(Array.isArray(t)){n.values.structural.byteSize+=2+t.length-Math.min(t.length,1);try{for(var f=x(t),h=f.next();!h.done;h=f.next()){var p=h.value;w.analyze(p,e+1,n,r,i,o)}}catch(t){a={error:t}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}}else{var d=k.getJSONSize(t);n.values[c].byteSize+=d,o[e]+=d}else{d=Object.keys(t).length;n.values.structural.byteSize+=2+2*d-Math.min(d,1);try{for(var g=x(Object.entries(t)),v=g.next();!v.done;v=g.next()){var m=C(v.value,2),y=m[0],b=m[1];r.add(y),n.keys.count+=1,n.keys.byteSize+=k.getJSONSize(y),w.analyze(b,e+1,n,r,i,o)}}catch(t){l={error:t}}finally{try{v&&!v.done&&(u=g.return)&&u.call(g)}finally{if(l)throw l.error}}}return n.largestLevel=o.lastIndexOf(Math.max.apply(Math,S([],C(o))))+1,n.duplicatedKeys=n.keys.count-r.size,n.duplicatedValues=0===e?n.values.numeric.count+n.values.textual.count+n.values.boolean.count+n.values.structural.count-L.uniqWith(i,L.isEqual).length:0,n};function o(t,e){return 0===t?0:100*e/t}var l;(t=l=w.JSONStatsSizeQualifier||(w.JSONStatsSizeQualifier={})).tiny="tier 1 minified < 100 bytes",t.small="tier 2 minified >= 100 < 1000 bytes",t.large="tier 3 minified >= 1000 bytes";w.summarize=function(t){var e,n=t.values.numeric.count+t.values.textual.count+t.values.boolean.count+t.values.structural.count,r=o(n,t.values.structural.count)*o(t.byteSize,t.values.structural.byteSize),i=o(n,t.keys.count)*o(t.byteSize,t.keys.byteSize);return{size:(e=t.byteSize)<100?l.tiny:e<1e3?l.small:l.large,keysRedundancy:o(t.keys.count,t.duplicatedKeys),valuesRedundancy:o(n,t.duplicatedValues),nestingWeight:t.height*(t.largestLevel-1),numericWeight:o(1e4,o(n,t.values.numeric.count)*o(t.byteSize,t.values.numeric.byteSize)),textualWeight:o(1e4,o(n,t.values.textual.count)*o(t.byteSize,t.values.textual.byteSize)),booleanWeight:o(1e4,o(n,t.values.boolean.count)*o(t.byteSize,t.values.boolean.byteSize)),structuralWeight:o(2e4,r+i)}};w.qualify=function(t){var e=[t.size];return t.numericWeight>=t.textualWeight&&t.numericWeight>=t.booleanWeight?e.push("numeric"):t.textualWeight>=t.numericWeight&&t.textualWeight>=t.booleanWeight?e.push("textual"):e.push("boolean"),25<=t.valuesRedundancy?e.push("redundant"):e.push("non-redundant"),t.nestingWeight<10?e.push("flat"):e.push("nested"),e}},{"../lib/json":2,lodash:8}],2:[function(t,e,i){!function(r){!function(){"use strict";var e,n,t;Object.defineProperty(i,"__esModule",{value:!0}),i.getJSONSize=i.getJSONTypeCategory=i.getJSONType=i.JSONTypeCategory=i.JSONType=void 0,(t=e=i.JSONType||(i.JSONType={})).number="number",t.boolean="boolean",t.string="string",t.null="null",t.object="object",t.array="array",(t=n=i.JSONTypeCategory||(i.JSONTypeCategory={})).numeric="numeric",t.textual="textual",t.boolean="boolean",t.structural="structural";i.getJSONType=function(t){return"boolean"==typeof t?e.boolean:"number"==typeof t?e.number:"string"==typeof t?e.string:Array.isArray(t)?e.array:null===t?e.null:e.object};i.getJSONTypeCategory=function(t){return t===e.boolean||t===e.null?n.boolean:t===e.string?n.textual:t===e.number?n.numeric:n.structural};i.getJSONSize=function(t){return r.byteLength(JSON.stringify(t),"utf8")}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:5}],3:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var r=r(t("codemirror")),i=t("../contrib/jsonstats"),t=document.getElementById("editor");if(null===t)throw new Error("Editor element does not exist");var o=r.default(t,{lineNumbers:!0,value:JSON.stringify({tags:[],tz:-25200,days:[1,1,2,1],coord:[-90.0715,29.951],data:[{name:"ox03",staff:!0},{name:null,staff:!1,extra:{info:""}},{name:"ox03",staff:!0},{}]},null,2),theme:"idea",mode:"json"}),t=document.getElementById("analyze");if(null===t)throw new Error("Button element does not exist");var l=document.getElementById("analyze-values-structural-count"),u=document.getElementById("analyze-values-structural-bytesize"),a=document.getElementById("analyze-values-numeric-count"),s=document.getElementById("analyze-values-numeric-bytesize"),c=document.getElementById("analyze-values-boolean-count"),f=document.getElementById("analyze-values-boolean-bytesize"),h=document.getElementById("analyze-values-textual-count"),p=document.getElementById("analyze-values-textual-bytesize"),d=document.getElementById("analyze-keys-count"),g=document.getElementById("analyze-keys-bytesize"),v=document.getElementById("analyze-largest-level"),m=document.getElementById("analyze-height"),y=document.getElementById("analyze-duplicated-keys"),b=document.getElementById("analyze-duplicated-values"),w=document.getElementById("analyze-bytesize");if(null===l||null===u||null===a||null===s||null===c||null===f||null===h||null===p||null===d||null===g||null===v||null===m||null===y||null===b||null===w)throw new Error("Not all analyze elements exist");var x=document.getElementById("summary-size"),C=document.getElementById("summary-keys-redundancy"),S=document.getElementById("summary-values-redundancy"),_=document.getElementById("summary-nesting-weight"),L=document.getElementById("summary-numeric-weight"),k=document.getElementById("summary-textual-weight"),T=document.getElementById("summary-boolean-weight"),M=document.getElementById("summary-structural-weight");if(null===x||null===C||null===S||null===_||null===L||null===k||null===T||null===M)throw new Error("Not all summary elements exist");var A=document.getElementById("qualifiers");if(null===A)throw new Error("The qualifiers container does not exist");function O(t){return t[0].toUpperCase()+t.slice(1)}function N(t){t=function(t){try{return JSON.parse(t)}catch(t){throw t instanceof SyntaxError&&document.querySelectorAll(".error-modal").forEach(function(t){t.classList.remove("hidden")}),t}}(t),t=i.analyze(t),w.innerHTML=String(t.byteSize),y.innerHTML=String(t.duplicatedKeys),b.innerHTML=String(t.duplicatedValues),m.innerHTML=String(t.height),v.innerHTML=String(t.largestLevel),d.innerHTML=String(t.keys.count),g.innerHTML=String(t.keys.byteSize),a.innerHTML=String(t.values.numeric.count),s.innerHTML=String(t.values.numeric.byteSize),c.innerHTML=String(t.values.boolean.count),f.innerHTML=String(t.values.boolean.byteSize),h.innerHTML=String(t.values.textual.count),p.innerHTML=String(t.values.textual.byteSize),l.innerHTML=String(t.values.structural.count),u.innerHTML=String(t.values.structural.byteSize),t=i.summarize(t),x.innerHTML=t.size,_.innerHTML=String(t.nestingWeight),C.innerHTML=t.keysRedundancy.toFixed(4),S.innerHTML=t.valuesRedundancy.toFixed(4),L.innerHTML=t.numericWeight.toFixed(4),k.innerHTML=t.textualWeight.toFixed(4),T.innerHTML=t.booleanWeight.toFixed(4),M.innerHTML=t.structuralWeight.toFixed(4),A.innerHTML=i.qualify(t).map(O).join(", ")}t.addEventListener("click",function(){var t=o.getValue();N(t)});t=document.getElementById("close-modal");if(null===t)throw new Error("Modal button element does not exist");t.addEventListener("click",function(){document.querySelectorAll(".error-modal").forEach(function(t){t.classList.add("hidden")})}),N(o.getValue())},{"../contrib/jsonstats":1,codemirror:6}],4:[function(t,e,n){"use strict";n.byteLength=function(t){var e=c(t),t=e[0],e=e[1];return 3*(t+e)/4-e},n.toByteArray=function(t){var e,n,r=c(t),i=r[0],r=r[1],o=new s(function(t,e){return 3*(t+e)/4-e}(i,r)),l=0,u=0<r?i-4:i;for(n=0;n<u;n+=4)e=a[t.charCodeAt(n)]<<18|a[t.charCodeAt(n+1)]<<12|a[t.charCodeAt(n+2)]<<6|a[t.charCodeAt(n+3)],o[l++]=e>>16&255,o[l++]=e>>8&255,o[l++]=255&e;2===r&&(e=a[t.charCodeAt(n)]<<2|a[t.charCodeAt(n+1)]>>4,o[l++]=255&e);1===r&&(e=a[t.charCodeAt(n)]<<10|a[t.charCodeAt(n+1)]<<4|a[t.charCodeAt(n+2)]>>2,o[l++]=e>>8&255,o[l++]=255&e);return o},n.fromByteArray=function(t){for(var e,n=t.length,r=n%3,i=[],o=0,l=n-r;o<l;o+=16383)i.push(function(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(function(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}(r));return i.join("")}(t,o,l<o+16383?l:o+16383));1==r?(e=t[n-1],i.push(u[e>>2]+u[e<<4&63]+"==")):2==r&&(e=(t[n-2]<<8)+t[n-1],i.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"="));return i.join("")};for(var u=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i<o;++i)u[i]=r[i],a[r.charCodeAt(i)]=i;function c(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return[t=-1===t?e:t,t===e?0:4-t%4]}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],5:[function(N,t,E){!function(t){!function(){"use strict";var u=N("base64-js"),o=N("ieee754");E.Buffer=f,E.SlowBuffer=function(t){+t!=t&&(t=0);return f.alloc(+t)},E.INSPECT_MAX_BYTES=50;var e=2147483647;function i(t){if(e<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');t=new Uint8Array(t);return t.__proto__=f.prototype,t}function f(t,e,n){if("number"!=typeof t)return r(t,e,n);if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}function r(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|h(t,e),r=i(n),e=r.write(t,e);e!==n&&(r=r.slice(0,e));return r}(t,e);if(ArrayBuffer.isView(t))return s(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(A(t,ArrayBuffer)||t&&A(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');n=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n);return n.__proto__=f.prototype,n}(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return f.from(r,e,n);r=function(t){if(f.isBuffer(t)){var e=0|c(t.length),n=i(e);return 0===n.length?n:(t.copy(n,0,0,e),n)}if(void 0!==t.length)return"number"!=typeof t.length||O(t.length)?i(0):s(t);if("Buffer"===t.type&&Array.isArray(t.data))return s(t.data)}(t);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return l(t),i(t<0?0:0|c(t))}function s(t){for(var e=t.length<0?0:0|c(t.length),n=i(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function c(t){if(e<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e.toString(16)+" bytes");return 0|t}function h(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||A(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=2<arguments.length&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return T(t).length;default:if(i)return r?-1:k(t).length;e=(""+e).toLowerCase(),i=!0}}function n(t,e,n){var r,i,o,l=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,n){var r=t.length;(!e||e<0)&&(e=0);(!n||n<0||r<n)&&(n=r);for(var i="",o=e;o<n;++o)i+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[o]);return i}(this,e,n);case"utf8":case"utf-8":return y(this,e,n);case"ascii":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}(this,e,n);case"latin1":case"binary":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}(this,e,n);case"base64":return r=this,o=n,0===(i=e)&&o===r.length?u.fromByteArray(r):u.fromByteArray(r.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,e,n);default:if(l)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),l=!0}}function p(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function d(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),(n=(n=O(n=+n)?i?0:t.length-1:n)<0?t.length+n:n)>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=f.from(e,r)),f.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){var o=1,l=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;l/=o=2,u/=2,n/=2}function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i)for(var s=-1,c=n;c<l;c++)if(a(t,c)===a(e,-1===s?0:c-s)){if(c-(s=-1===s?c:s)+1===u)return s*o}else-1!==s&&(c-=c-s),s=-1;else for(c=n=l<n+u?l-u:n;0<=c;c--){for(var f=!0,h=0;h<u;h++)if(a(t,c+h)!==a(e,h)){f=!1;break}if(f)return c}return-1}function v(t,e,n,r){return M(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function m(t,e,n,r){return M(function(t,e){for(var n,r,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,r=r%256,i.push(r),i.push(n);return i}(e,t.length-n),t,n,r)}function y(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,l,u,a,s=t[i],c=null,f=239<s?4:223<s?3:191<s?2:1;if(i+f<=n)switch(f){case 1:s<128&&(c=s);break;case 2:128==(192&(o=t[i+1]))&&127<(a=(31&s)<<6|63&o)&&(c=a);break;case 3:o=t[i+1],l=t[i+2],128==(192&o)&&128==(192&l)&&2047<(a=(15&s)<<12|(63&o)<<6|63&l)&&(a<55296||57343<a)&&(c=a);break;case 4:o=t[i+1],l=t[i+2],u=t[i+3],128==(192&o)&&128==(192&l)&&128==(192&u)&&65535<(a=(15&s)<<18|(63&o)<<12|(63&l)<<6|63&u)&&a<1114112&&(c=a)}null===c?(c=65533,f=1):65535<c&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(t){var e=t.length;if(e<=b)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=b));return n}(r)}E.kMaxLength=e,(f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),f.poolSize=8192,f.from=r,f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,f.alloc=function(t,e,n){return e=e,n=n,l(t=t),!(t<=0)&&void 0!==e?"string"==typeof n?i(t).fill(e,n):i(t).fill(e):i(t)},f.allocUnsafe=a,f.allocUnsafeSlow=a,f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(A(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),A(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);if(void 0===e)for(i=e=0;i<t.length;++i)e+=t[i].length;for(var n=f.allocUnsafe(e),r=0,i=0;i<t.length;++i){var o=t[i];if(A(o,Uint8Array)&&(o=f.from(o)),!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},f.byteLength=h,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},f.prototype.toLocaleString=f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?y(this,0,t):n.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",e=E.INSPECT_MAX_BYTES,t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();return this.length>e&&(t+=" ... "),"<Buffer "+t+">"},f.prototype.compare=function(t,e,n,r,i){if(A(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),(e=void 0===e?0:e)<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=e)return 0;if(i<=r)return-1;if(n<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),l=(n>>>=0)-(e>>>=0),u=Math.min(o,l),a=this.slice(r,i),s=t.slice(e,n),c=0;c<u;++c)if(a[c]!==s[c]){o=a[c],l=s[c];break}return o<l?-1:l<o?1:0},f.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},f.prototype.indexOf=function(t,e,n){return d(this,t,e,n,!0)},f.prototype.lastIndexOf=function(t,e,n){return d(this,t,e,n,!1)},f.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||i<n)&&(n=i),0<t.length&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o,l,u,a=!1;;)switch(r){case"hex":return function(t,e,n,r){n=Number(n)||0;var i=t.length-n;(!r||i<(r=Number(r)))&&(r=i),(i=e.length)/2<r&&(r=i/2);for(var o=0;o<r;++o){var l=parseInt(e.substr(2*o,2),16);if(O(l))return o;t[n+o]=l}return o}(this,t,e,n);case"utf8":case"utf-8":return l=e,u=n,M(k(t,(o=this).length-l),o,l,u);case"ascii":return v(this,t,e,n);case"latin1":case"binary":return v(this,t,e,n);case"base64":return o=this,l=e,u=n,M(T(t),o,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var b=4096;function w(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(n<t+e)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,n,r,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function C(t,e,n,r){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function S(t,e,n,r,i){return e=+e,n>>>=0,i||C(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function _(t,e,n,r,i){return e=+e,n>>>=0,i||C(t,0,n,8),o.write(t,e,n,r,52,8),n+8}f.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n);e=this.subarray(t,e=e<t?t:e);return e.__proto__=f.prototype,e},f.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},f.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=this[t+--e],i=1;0<e&&(i*=256);)r+=this[t+--e]*i;return r},f.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return(i*=128)<=r&&(r-=Math.pow(2,8*e)),r},f.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=e,i=1,o=this[t+--r];0<r&&(i*=256);)o+=this[t+--r]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);t=this[t]|this[t+1]<<8;return 32768&t?4294901760|t:t},f.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);t=this[t+1]|this[t]<<8;return 32768&t?4294901760|t:t},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||x(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},f.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||x(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+n},f.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,n,r){t=+t,e>>>=0,r||x(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,l=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===l&&0!==this[e+i-1]&&(l=1),this[e+i]=(t/o>>0)-l&255;return e+n},f.prototype.writeIntBE=function(t,e,n,r){t=+t,e>>>=0,r||x(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,l=0;for(this[e+i]=255&t;0<=--i&&(o*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/o>>0)-l&255;return e+n},f.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},f.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,n){return S(this,t,e,!0,n)},f.prototype.writeFloatBE=function(t,e,n){return S(this,t,e,!1,n)},f.prototype.writeDoubleLE=function(t,e,n){return _(this,t,e,!0,n)},f.prototype.writeDoubleBE=function(t,e,n){return _(this,t,e,!1,n)},f.prototype.copy=function(t,e,n,r){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n=n||0,r||0===r||(r=this.length),e>=t.length&&(e=t.length),(r=0<r&&r<n?n:r)===n)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var i=(r=t.length-e<r-n?t.length-e+n:r)-n;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,n,r);else if(this===t&&n<e&&e<r)for(var o=i-1;0<=o;--o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,r),e);return i},f.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!f.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var i;1===t.length&&(i=t.charCodeAt(0),("utf8"===r&&i<128||"latin1"===r)&&(t=i))}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(t=t||0))for(o=e;o<n;++o)this[o]=t;else{var l=f.isBuffer(t)?t:f.from(t,r),u=l.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=l[o%u]}return this};var L=/[^+/0-9A-Za-z-_]/g;function k(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],l=0;l<r;++l){if(55295<(n=t.charCodeAt(l))&&n<57344){if(!i){if(56319<n){-1<(e-=3)&&o.push(239,191,189);continue}if(l+1===r){-1<(e-=3)&&o.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(e-=3)&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,n<128){if(--e<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function T(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function A(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function O(t){return t!=t}}.call(this)}.call(this,N("buffer").Buffer)},{"base64-js":4,buffer:5,ieee754:7}],6:[function(t,e,n){var r,i;r=this,i=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,h=/gecko\/\d/i.test(t),n=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),i=/Edge\/(\d+)/.exec(t),w=n||r||i,m=w&&(n?document.documentMode||6:+(i||r)[1]),p=!i&&/WebKit\//.test(t),r=p&&/Qt\/\d+\.\d+/.test(t),o=!i&&/Chrome\//.test(t),d=/Opera\//.test(t),c=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),s=/PhantomJS/.test(t),u=c&&(/Mobile\/\w+/.test(t)||2<navigator.maxTouchPoints),a=/Android/.test(t),f=u||a||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),g=u||/Mac/.test(e),v=/\bCrOS\b/.test(t),y=/win/i.test(e),t=d&&t.match(/Version\/(\d*\.\d*)/);(t=t&&Number(t[1]))&&15<=t&&(p=!(d=!1));var b=g&&(r||d&&(null==t||t<12.11)),x=h||w&&9<=m;function C(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S=function(t,e){var n=t.className,r=C(e).exec(n);r&&(e=n.slice(r.index+r[0].length),t.className=n.slice(0,r.index)+(e?r[1]+e:""))};function _(t){for(var e=t.childNodes.length;0<e;--e)t.removeChild(t.firstChild);return t}function L(t,e){return _(t).appendChild(e)}function T(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function k(t,e,n,r){r=T(t,e,n,r);return r.setAttribute("role","presentation"),r}function M(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if((e=11==e.nodeType?e.host:e)==t)return!0}while(e=e.parentNode)}function A(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function O(t,e){var n=t.className;C(e).test(n)||(t.className+=(n?" ":"")+e)}function N(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!C(n[r]).test(e)&&(e+=" "+n[r]);return e}var E=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r},W=function(t){t.select()};function z(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function I(t,e,n){for(var r in e=e||{},t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function D(t,e,n,r,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=r||0,l=i||0;;){var u=t.indexOf("\t",o);if(u<0||e<=u)return l+(e-o);l+=u-o,l+=n-l%n,o=u+1}}u?W=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:w&&(W=function(t){try{t.select()}catch(t){}});var B=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};function R(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}B.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},B.prototype.set=function(t,e){this.f=e;e=+new Date+t;(!this.id||e<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=e)};var H=50,F={toString:function(){return"CodeMirror.Pass"}},P={scroll:!1},j={origin:"*mouse"},U={origin:"+move"};function G(t,e,n){for(var r=0,i=0;;){var o=t.indexOf("\t",r),l=(o=-1==o?t.length:o)-r;if(o==t.length||e<=i+l)return r+Math.min(l,e-i);if(i+=o-r,r=o+1,e<=(i+=n-i%n))return r}}var V=[""];function K(t){for(;V.length<=t;)V.push(q(V)+" ");return V[t]}function q(t){return t[t.length-1]}function $(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function X(){}function Y(t,e){t=Object.create?Object.create(t):(X.prototype=t,new X);return e&&I(e,t),t}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Z(t){return/\w/.test(t)||""<t&&(t.toUpperCase()!=t.toLowerCase()||J.test(t))}function Q(t,e){return e?!!(-1<e.source.indexOf("\\w")&&Z(t))||e.test(t):Z(t)}function tt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return;return 1}var et=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function nt(t){return 768<=t.charCodeAt(0)&&et.test(t)}function rt(t,e,n){for(;(n<0?0<e:e<t.length)&&nt(t.charAt(e));)e+=n;return e}function it(t,e,n){for(var r=n<e?-1:1;;){if(e==n)return e;var i=(e+n)/2,i=r<0?Math.ceil(i):Math.floor(i);if(i==e)return t(i)?e:n;t(i)?n=i:e=i+r}}var ot=null;function lt(t,e,n){var r;ot=null;for(var i=0;i<t.length;++i){var o=t[i];if(o.from<e&&o.to>e)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:ot=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:ot=i)}return null!=r?r:ot}var ut,at,st,ct,ft,ht,pt,dt=(ut="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",at="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",st=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ct=/[stwN]/,ft=/[LRr]/,ht=/[Lb1n]/,pt=/[1n]/,function(t,e){var n="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!st.test(t))return!1;for(var r,i=t.length,o=[],l=0;l<i;++l)o.push((r=t.charCodeAt(l))<=247?ut.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?at.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L");for(var u=0,a=n;u<i;++u){var s=o[u];"m"==s?o[u]=a:a=s}for(var c=0,f=n;c<i;++c){var h=o[c];"1"==h&&"r"==f?o[c]="n":ft.test(h)&&"r"==(f=h)&&(o[c]="R")}for(var p=1,d=o[0];p<i-1;++p){var g=o[p];"+"==g&&"1"==d&&"1"==o[p+1]?o[p]="1":","!=g||d!=o[p+1]||"1"!=d&&"n"!=d||(o[p]=d),d=g}for(var v=0;v<i;++v){var m=o[v];if(","==m)o[v]="N";else if("%"==m){for(var y=void 0,y=v+1;y<i&&"%"==o[y];++y);for(var b=v&&"!"==o[v-1]||y<i&&"1"==o[y]?"1":"N",w=v;w<y;++w)o[w]=b;v=y-1}}for(var x=0,C=n;x<i;++x){var S=o[x];"L"==C&&"1"==S?o[x]="L":ft.test(S)&&(C=S)}for(var _=0;_<i;++_)if(ct.test(o[_])){for(var L=void 0,L=_+1;L<i&&ct.test(o[L]);++L);for(var k="L"==(_?o[_-1]:n),T=k==("L"==(L<i?o[L]:n))?k?"L":"R":n,M=_;M<L;++M)o[M]=T;_=L-1}for(var A,O=[],N=0;N<i;)if(ht.test(o[N])){var E=N;for(++N;N<i&&ht.test(o[N]);++N);O.push(new gt(0,E,N))}else{var W=N,z=O.length,I="rtl"==e?1:0;for(++N;N<i&&"L"!=o[N];++N);for(var D=W;D<N;)if(pt.test(o[D])){W<D&&(O.splice(z,0,new gt(1,W,D)),z+=I);var B=D;for(++D;D<N&&pt.test(o[D]);++D);O.splice(z,0,new gt(2,B,D)),z+=I,W=D}else++D;W<N&&O.splice(z,0,new gt(1,W,N))}return"ltr"==e&&(1==O[0].level&&(A=t.match(/^\s+/))&&(O[0].from=A[0].length,O.unshift(new gt(0,0,A[0].length))),1==q(O).level&&(A=t.match(/\s+$/))&&(q(O).to-=A[0].length,O.push(new gt(0,i-A[0].length,i)))),"rtl"==e?O.reverse():O});function gt(t,e,n){this.level=t,this.from=e,this.to=n}function vt(t,e){var n=t.order;return n=null==n?t.order=dt(t.text,e):n}var mt=[],yt=function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):(t=t._handlers||(t._handlers={}))[e]=(t[e]||mt).concat(n)};function bt(t,e){return t._handlers&&t._handlers[e]||mt}function wt(t,e,n){var r;t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?t.detachEvent("on"+e,n):!(t=(r=t._handlers)&&r[e])||-1<(n=R(t,n))&&(r[e]=t.slice(0,n).concat(t.slice(n+1)))}function xt(t,e){var n=bt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ct(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),xt(t,n||e.type,t,e),Mt(e)||e.codemirrorIgnore}function St(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==R(n,e[r])&&n.push(e[r])}function _t(t,e){return 0<bt(t,e).length}function Lt(t){t.prototype.on=function(t,e){yt(this,t,e)},t.prototype.off=function(t,e){wt(this,t,e)}}function kt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Tt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Mt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function At(t){kt(t),Tt(t)}function Ot(t){return t.target||t.srcElement}function Nt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),e=g&&t.ctrlKey&&1==e?3:e}var Et,Wt,zt=function(){if(w&&m<9)return!1;var t=T("div");return"draggable"in t||"dragDrop"in t}();var It=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),e+=l+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Dt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Bt="oncopy"in(r=T("div"))||(r.setAttribute("oncopy","return;"),"function"==typeof r.oncopy),Rt=null;var Ht={},Ft={};function Pt(t){if("string"==typeof t&&Ft.hasOwnProperty(t))t=Ft[t];else if(t&&"string"==typeof t.name&&Ft.hasOwnProperty(t.name)){var e=Ft[t.name];(t=Y(e="string"==typeof e?{name:e}:e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Pt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Pt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function jt(t,e){e=Pt(e);var n=Ht[e.name];if(!n)return jt(t,"text/plain");var r=n(t,e);if(Ut.hasOwnProperty(e.name)){var i,o=Ut[e.name];for(i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var l in e.modeProps)r[l]=e.modeProps[l];return r}var Ut={};function Gt(t,e){I(e,Ut.hasOwnProperty(t)?Ut[t]:Ut[t]={})}function Vt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n,r={};for(n in e){var i=e[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Kt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function qt(t,e,n){return!t.startState||t.startState(e,n)}var $t=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e<o){n=i;break}e-=o}return n.lines[e]}function Yt(t,e,n){var r=[],i=e.line;return t.iter(e.line,n.line+1,function(t){t=t.text;i==n.line&&(t=t.slice(0,n.ch)),i==e.line&&(t=t.slice(e.ch)),r.push(t),++i}),r}function Jt(t,e,n){var r=[];return t.iter(e,n,function(t){r.push(t.text)}),r}function Zt(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function Qt(t){if(null==t.parent)return null;for(var e=t.parent,n=R(e.lines,t),r=e.parent;r;r=(e=r).parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function te(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(e<o){t=i;continue t}e-=o,n+=i.chunkSize()}return n}while(!t.lines);for(var l=0;l<t.lines.length;++l){var u=t.lines[l].height;if(e<u)break;e-=u}return n+l}function ee(t,e){return e>=t.first&&e<t.first+t.size}function ne(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function re(t,e,n){if(void 0===n&&(n=null),!(this instanceof re))return new re(t,e,n);this.line=t,this.ch=e,this.sticky=n}function ie(t,e){return t.line-e.line||t.ch-e.ch}function oe(t,e){return t.sticky==e.sticky&&0==ie(t,e)}function le(t){return re(t.line,t.ch)}function ue(t,e){return ie(t,e)<0?e:t}function ae(t,e){return ie(t,e)<0?t:e}function se(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function ce(t,e){if(e.line<t.first)return re(t.first,0);var n=t.first+t.size-1;return e.line>n?re(n,Xt(t,n).text.length):(t=Xt(t,(n=e).line).text.length,null==(e=n.ch)||t<e?re(n.line,t):e<0?re(n.line,0):n)}function fe(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=ce(t,e[r]);return n}$t.prototype.eol=function(){return this.pos>=this.string.length},$t.prototype.sol=function(){return this.pos==this.lineStart},$t.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$t.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$t.prototype.eat=function(t){var e=this.string.charAt(this.pos),t="string"==typeof t?e==t:e&&(t.test?t.test(e):t(e));if(t)return++this.pos,e},$t.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},$t.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},$t.prototype.skipToEnd=function(){this.pos=this.string.length},$t.prototype.skipTo=function(t){t=this.string.indexOf(t,this.pos);if(-1<t)return this.pos=t,!0},$t.prototype.backUp=function(t){this.pos-=t},$t.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=D(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?D(this.string,this.lineStart,this.tabSize):0)},$t.prototype.indentation=function(){return D(this.string,null,this.tabSize)-(this.lineStart?D(this.string,this.lineStart,this.tabSize):0)},$t.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&0<r.index?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}r=function(t){return n?t.toLowerCase():t};if(r(this.string.substr(this.pos,t.length))==r(t))return!1!==e&&(this.pos+=t.length),!0},$t.prototype.current=function(){return this.string.slice(this.start,this.pos)},$t.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},$t.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},$t.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var he=function(t,e){this.state=t,this.lookAhead=e},pe=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function de(e,n,r,t){var a=[e.state.modeGen],i={};Se(e,n.text,e.doc.mode,r,function(t,e){return a.push(t,e)},i,t);for(var s=r.state,o=0;o<e.state.overlays.length;++o)!function(t){r.baseTokens=a;var o=e.state.overlays[t],l=1,u=0;r.state=!0,Se(e,n.text,o.mode,r,function(t,e){for(var n=l;u<t;){var r=a[l];t<r&&a.splice(l,1,t,a[l+1],r),l+=2,u=Math.min(t,r)}if(e)if(o.opaque)a.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var i=a[n+1];a[n+1]=(i?i+" ":"")+"overlay "+e}},i),r.state=s,r.baseTokens=null,r.baseTokenPos=1}(o);return{styles:a,classes:i.bgClass||i.textClass?i:null}}function ge(t,e,n){var r,i,o;return e.styles&&e.styles[0]==t.state.modeGen||(r=ve(t,Qt(e)),i=e.text.length>t.options.maxHighlightLength&&Vt(t.doc.mode,r.state),o=de(t,e,r),i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))),e.styles}function ve(n,r,t){var e=n.doc,i=n.display;if(!e.mode.startState)return new pe(e,!0,r);var o=function(t,e,n){for(var r,i,o=t.doc,l=n?-1:e-(t.doc.mode.innerMode?1e3:100),u=e;l<u;--u){if(u<=o.first)return o.first;var a=Xt(o,u-1),s=a.stateAfter;if(s&&(!n||u+(s instanceof he?s.lookAhead:0)<=o.modeFrontier))return u;a=D(a.text,null,t.options.tabSize);(null==i||a<r)&&(i=u-1,r=a)}return i}(n,r,t),l=o>e.first&&Xt(e,o-1).stateAfter,u=l?pe.fromSaved(e,l,o):new pe(e,qt(e.mode),o);return e.iter(o,r,function(t){me(n,t.text,u);var e=u.line;t.stateAfter=e==r-1||e%5==0||e>=i.viewFrom&&e<i.viewTo?u.save():null,u.nextLine()}),t&&(e.modeFrontier=u.line),u}function me(t,e,n,r){var i=t.doc.mode,o=new $t(e,t.options.tabSize,n);for(o.start=o.pos=r||0,""==e&&ye(i,n.state);!o.eol();)be(i,o,n.state),o.start=o.pos}function ye(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){e=Kt(t,e);return e.mode.blankLine?e.mode.blankLine(e.state):void 0}}function be(t,e,n,r){for(var i=0;i<10;i++){r&&(r[0]=Kt(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}pe.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},pe.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},pe.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead-