diff --git a/scripts/1.html b/scripts/1.html deleted file mode 100644 index caf493c..0000000 --- a/scripts/1.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - ST01 - - - - - - - -
- - - diff --git a/scripts/DSC_0032.JPG b/scripts/DSC_0032.JPG deleted file mode 100755 index b220e37..0000000 Binary files a/scripts/DSC_0032.JPG and /dev/null differ diff --git a/scripts/lib/cceditorapp.js b/scripts/lib/cceditorapp.js deleted file mode 100644 index 131f270..0000000 --- a/scripts/lib/cceditorapp.js +++ /dev/null @@ -1 +0,0 @@ -var cceditorapp=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e,n){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),s=i||r||o,a=s&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),d=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),m=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),g=/Android/.test(t),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=m||/Mac/.test(e),x=/\bCrOS\b/.test(t),b=/win/i.test(e),w=d&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var C=y&&(c||d&&(null==w||w<12.11)),_=n||s&&a>=9;function k(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S,T=function(t,e){var n=t.className,i=k(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function M(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function A(t,e){return M(t).appendChild(e)}function L(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}m?P=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(P=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null};function R(t,e){for(var n=0;n=e)return i+Math.min(s,e-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=e)return i}}var V=[""];function X(t){for(;V.length<=t;)V.push(K(V)+" ");return V[t]}function K(t){return t[t.length-1]}function Y(t,e){for(var n=[],i=0;i"€"&&(t.toUpperCase()!=t.toLowerCase()||Z.test(t))}function et(t,e){return e?!!(e.source.indexOf("\\w")>-1&&tt(t))||e.test(t):tt(t)}function nt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var it=/[\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 rt(t){return t.charCodeAt(0)>=768&&it.test(t)}function ot(t,e,n){for(;(n<0?e>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 i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e=t.first&&en?mt(n,at(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?mt(t.line,e):n<0?mt(t.line,0):t}(e,at(t,e.line).text.length)}function _t(t,e){for(var n=[],i=0;i=e:o.to>e);(i||(i=[])).push(new Tt(s,o.from,l?null:o.to))}}return i}(n,r,s),l=function(t,e,n){var i;if(t)for(var r=0;r=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from0&&a)for(var b=0;b=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?gt(c.to,n)>=0:gt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?gt(c.from,i)<=0:gt(c.from,i)<0)))return!0}}}function Rt(t){for(var e;e=Ft(t);)t=e.find(-1,!0).line;return t}function Bt(t,e){var n=at(t,e),i=Rt(n);return n==i?e:dt(i)}function jt(t,e){if(e>t.lastLine())return e;var n,i=at(t,e);if(!qt(t,i))return e;for(;n=Wt(i);)i=n.find(1,!0).line;return dt(i)+1}function qt(t,e){var n=St&&e.markedSpans;if(n)for(var i=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}var Xt=null;function Kt(t,e,n){var i;Xt=null;for(var r=0;re)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:Xt=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:Xt=r)}return null!=i?i:Xt}var Yt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,r=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function a(t,e,n){this.level=t,this.from=e,this.to=n}return function(l,c){var u,d="ltr"==c?"L":"R";if(0==l.length||"ltr"==c&&!n.test(l))return!1;for(var h=l.length,f=[],p=0;pt.text.length?null:i}function Zt(t,e,n){var i=Jt(t,e.ch,n);return null==i?null:new mt(e.line,i,n<0?"after":"before")}function te(t,e,n,i,r){if(t){var o=Qt(n,e.doc.direction);if(o){var s,a=r<0?K(o):o[0],l=r<0==(1==a.level),c=l?"after":"before";if(a.level>0){var u=Pn(e,n);s=r<0?n.text.length-1:0;var d=Hn(e,u,s).top;s=st(function(t){return Hn(e,u,t).top==d},r<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=Jt(n,s,1))}else s=r<0?a.to:a.from;return new mt(i,s,c)}}return new mt(i,r<0?n.text.length:0,r<0?"before":"after")}function ee(t,e,n,i){var r=Qt(e,t.doc.direction);if(!r)return Zt(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Kt(r,n.ch,n.sticky),s=r[o];if("ltr"==t.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&h>=u.begin)){var f=d?"before":"after";return new mt(n.line,h,f)}}var p=function(t,e,i){for(var o=function(t,e){return e?new mt(n.line,l(t,1),"before"):new mt(n.line,t,"after")};t>=0&&t0==(1!=s.level),c=a?i.begin:l(i.end,-1);if(s.from<=c&&c0?u.end:l(u.begin,-1);return null==g||i>0&&g==e.text.length||!(m=p(i>0?0:r.length-1,i,c(g)))?null:m}var ne=[],ie=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var i=t._handlers||(t._handlers={});i[e]=(i[e]||ne).concat(n)}};function re(t,e){return t._handlers&&t._handlers[e]||ne}function oe(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var i=t._handlers,r=i&&i[e];if(r){var o=R(r,n);o>-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function se(t,e){var n=re(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function ue(t){t.prototype.on=function(t,e){ie(this,t,e)},t.prototype.off=function(t,e){oe(this,t,e)}}function de(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function he(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function fe(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function pe(t){de(t),he(t)}function me(t){return t.target||t.srcElement}function ge(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var ve,ye,xe=function(){if(s&&a<9)return!1;var t=L("div");return"draggable"in t||"dragDrop"in t}();function be(t){if(null==ve){var e=L("span","​");A(t,L("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(ve=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=ve?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function we(t){if(null!=ye)return ye;var e=A(t,document.createTextNode("AخA")),n=S(e,0,1).getBoundingClientRect(),i=S(e,1,2).getBoundingClientRect();return M(t),!(!n||n.left==n.right)&&(ye=i.right-n.right<3)}var Ce,_e=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],i=t.length;e<=i;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},ke=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)},Se="oncopy"in(Ce=L("div"))||(Ce.setAttribute("oncopy","return;"),"function"==typeof Ce.oncopy),Te=null,Me={},Ae={};function Le(t){if("string"==typeof t&&Ae.hasOwnProperty(t))t=Ae[t];else if(t&&"string"==typeof t.name&&Ae.hasOwnProperty(t.name)){var e=Ae[t.name];"string"==typeof e&&(e={name:e}),(t=J(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Le("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Le("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ie(t,e){e=Le(e);var n=Me[e.name];if(!n)return Ie(t,"text/plain");var i=n(t,e);if(Ee.hasOwnProperty(e.name)){var r=Ee[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)i[s]=e.modeProps[s];return i}var Ee={};function De(t,e){var n=Ee.hasOwnProperty(t)?Ee[t]:Ee[t]={};F(e,n)}function Ne(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Oe(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 Pe(t,e,n){return!t.startState||t.startState(e,n)}var He=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};He.prototype.eol=function(){return this.pos>=this.string.length},He.prototype.sol=function(){return this.pos==this.lineStart},He.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},He.prototype.next=function(){if(this.pose},He.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},He.prototype.skipToEnd=function(){this.pos=this.string.length},He.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},He.prototype.backUp=function(t){this.pos-=t},He.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(r(o)==r(t))return!1!==e&&(this.pos+=t.length),!0},He.prototype.current=function(){return this.string.slice(this.start,this.pos)},He.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},He.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)};var Fe=function(t,e){this.state=t,this.lookAhead=e},We=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0};function ze(t,e,n,i){var r=[t.state.modeGen],o={};Xe(t,e.text,t.doc.mode,n,function(t,e){return r.push(t,e)},o,i);for(var s=n.state,a=function(i){var s=t.state.overlays[i],a=1,l=0;n.state=!0,Xe(t,e.text,s.mode,n,function(t,e){for(var n=a;lt&&r.splice(a,1,t,r[a+1],i),a+=2,l=Math.min(t,i)}if(e)if(s.opaque)r.splice(n,a-n,t,"overlay "+e),a=n+2;else for(;nt.options.maxHighlightLength&&Ne(t.doc.mode,i.state),o=ze(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),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))}return e.styles}function Be(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new We(i,!0,e);var o=function(t,e,n){for(var i,r,o=t.doc,s=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>s;--a){if(a<=o.first)return o.first;var l=at(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof Fe?c.lookAhead:0)<=o.modeFrontier))return a;var u=W(l.text,null,t.options.tabSize);(null==r||i>u)&&(r=a-1,i=u)}return r}(t,e,n),s=o>i.first&&at(i,o-1).stateAfter,a=s?We.fromSaved(i,s,o):new We(i,Pe(i.mode),o);return i.iter(o,e,function(n){je(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&ie.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}We.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},We.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},We.fromSaved=function(t,e,n){return e instanceof Fe?new We(t,Ne(t.mode,e.state),n,e.lookAhead):new We(t,Ne(t.mode,e),n)},We.prototype.save=function(t){var e=!1!==t?Ne(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Fe(e,this.maxLookAhead):e};var Ue=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Ge(t,e,n,i){var r,o=t.doc,s=o.mode;e=Ct(o,e);var a,l=at(o,e.line),c=Be(t,e.line,n),u=new He(l.text,t.options.tabSize,c);for(i&&(a=[]);(i||u.post.options.maxHighlightLength?(a=!1,s&&je(t,e,i,d.pos),d.pos=e.length,l=null):l=Ve($e(n,d,i.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c1&&!/ /.test(t))return t;for(var n=e,i="",r=0;rc&&d.from<=c);h++);if(d.to>=u)return t(n,i,r,o,s,a,l);t(n,i.slice(0,d.to-c),r,o,null,a,l),o=null,i=i.slice(d.to-c),c=d.to}}}function on(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function sn(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var s,a,l,c,u,d,h,f=r.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=d=a="",h=null,v=1/0;for(var y=[],x=void 0,b=0;bp||C.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&w.from==p&&(u+=" "+C.startStyle),C.endStyle&&w.to==v&&(x||(x=[])).push(C.endStyle,w.to),C.title&&!d&&(d=C.title),C.collapsed&&(!h||Pt(h.marker,C)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(x)for(var _=0;_=f)break;for(var S=Math.min(f,v);;){if(g){var T=p+g.length;if(!h){var M=T>S?g.slice(0,S-p):g;e.addToken(e,M,s?s+l:l,u,p+M.length==v?c:"",d,a)}if(T>=S){g=g.slice(S-p),p=S;break}p=T,u=""}g=r.slice(o,o=n[m++]),s=Ze(n[m++],e.cm.options)}}else for(var A=1;An)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Nn(t,e,n,i){return Hn(t,Pn(t,e),n,i)}function On(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&e2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,i){var r,o=zn(e.map,n,i),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&rt(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*i,bottom:e.bottom*i}}(t.display.measure,r))}else{var f;c>0&&(d=i="right"),r=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!c&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+ii(t.display),top:p.top,bottom:p.bottom}:Wn}for(var m=r.top-e.rect.top,g=r.bottom-e.rect.top,v=(m+g)/2,y=e.view.measure.heights,x=0;xe)&&(r=(o=l-a)-1,e>=l&&(s="right")),null!=r){if(i=t[c+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)i=t[2+(c-=3)],s="left";if("right"==n&&r==l-a)for(;c=0&&(n=t[r]).left==n.right;r--);return n}function Bn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(t,e,n){var i=a[e],r=i.level%2!=0;return s(n?t-1:t,r!=n)}var d=Kt(a,l,c),h=Xt,f=u(l,d,"before"==c);return null!=h&&(f.other=u(l,h,"before"!=c)),f}function Yn(t,e){var n=0;e=Ct(t.doc,e),t.options.lineWrapping||(n=ii(t.display)*e.ch);var i=at(t.doc,e.line),r=Ut(i)+Tn(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Qn(t,e,n,i,r){var o=mt(t,e,n);return o.xRel=r,i&&(o.outside=!0),o}function Jn(t,e,n){var i=t.doc;if((n+=t.display.viewOffset)<0)return Qn(i.first,0,null,!0,-1);var r=ht(i,n),o=i.first+i.size-1;if(r>o)return Qn(i.first+i.size-1,at(i,o).text.length,null,!0,1);e<0&&(e=0);for(var s=at(i,r);;){var a=ei(t,s,r,e,n),l=Wt(s),c=l&&l.find(0,!0);if(!l||!(a.ch>c.from.ch||a.ch==c.from.ch&&a.xRel>0))return a;r=dt(s=c.to.line)}}function Zn(t,e,n,i){var r=function(i){return Gn(t,e,Hn(t,n,i),"line")},o=e.text.length,s=st(function(t){return r(t-1).bottom<=i},o,0);return o=st(function(t){return r(t).top>i},s,o),{begin:s,end:o}}function ti(t,e,n,i){var r=Gn(t,e,Hn(t,n,i),"line").top;return Zn(t,e,n,r)}function ei(t,e,n,i,r){r-=Ut(e);var o,s=0,a=e.text.length,l=Pn(t,e),c=Qt(e,t.doc.direction);if(c){var u;t.options.lineWrapping&&(u=Zn(t,e,l,r),s=u.begin,a=u.end),o=new mt(n,Math.floor(s+(a-s)/2));var d,h,f=Kn(t,o,"line",e,l).left,p=f1){var x=Math.abs(m-d)/g;g=Math.min(g,Math.ceil(Math.abs(m)/x)),p=m<0?1:-1}}while(0!=m&&(g>1||p<0!=m<0&&Math.abs(m)<=Math.abs(d)));if(Math.abs(m)>Math.abs(d)){if(m<0==d<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=h}}else{var b=st(function(n){var o=Gn(t,e,Hn(t,l,n),"line");return o.top>r?(a=Math.min(n,a),!0):!(o.bottom<=r)&&(o.left>i||!(o.rightw.right?1:0,o}function ni(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Fn){Fn=L("pre");for(var e=0;e<49;++e)Fn.appendChild(document.createTextNode("x")),Fn.appendChild(L("br"));Fn.appendChild(document.createTextNode("x"))}A(t.measure,Fn);var n=Fn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),M(t.measure),n||1}function ii(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=L("span","xxxxxxxxxx"),n=L("pre",[e]);A(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function ri(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[t.options.gutters[s]]=o.offsetLeft+o.clientLeft+r,i[t.options.gutters[s]]=o.clientWidth;return{fixedPos:oi(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function oi(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function si(t){var e=ni(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/ii(t.display)-3);return function(r){if(qt(t.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,i=0;i=t.display.viewTo||a.to().linee||e==n&&s.to==e)&&(i(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr"),r=!0)}r||i(e,n,"ltr")}(Qt(u,r.direction),n||0,null==i?d:i,function(t,e,r){var u,f,p,m=h(t,"left");if(t==e)u=m,f=p=m.left;else{if(u=h(e-1,"right"),"rtl"==r){var g=m;m=u,u=g}f=m.left,p=u.right}null==n&&0==t&&(f=a),u.top-m.top>3&&(c(f,m.top,null,m.bottom),f=a,m.bottoms.bottom||u.bottom==s.bottom&&u.right>s.right)&&(s=u),f0?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function mi(t){t.state.focused||(t.display.input.focus(),vi(t))}function gi(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,yi(t))},100)}function vi(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(se(t,"focus",t,e),t.state.focused=!0,N(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),pi(t))}function yi(t,e){t.state.delayingBlurEvent||(t.state.focused&&(se(t,"blur",t,e),t.state.focused=!1,T(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function xi(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i.005||u<-.005)&&(ut(r.line,o),bi(r.line),r.rest))for(var d=0;d=s&&(o=ht(e,Ut(at(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Ci(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=oi(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",s=0;so&&(e.bottom=e.top+o);var a=t.doc.height+Mn(n),l=e.topa-i;if(e.topr+o){var u=Math.min(e.top,(c?a:e.bottom)-o);u!=r&&(s.scrollTop=u)}var d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,h=In(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>h;return f&&(e.right=e.left+h),e.left<10?s.scrollLeft=0:e.lefth+d-3&&(s.scrollLeft=e.right+(f?0:10)-h),s}function Si(t,e){null!=e&&(Ai(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Ti(t){Ai(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Mi(t,e,n){null==e&&null==n||Ai(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Ai(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Yn(t,e.from),i=Yn(t,e.to);Li(t,n,i,e.margin)}}function Li(t,e,n,i){var r=ki(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});Mi(t,r.scrollLeft,r.scrollTop)}function Ii(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||ar(t,{top:e}),Ei(t,e,!0),n&&ar(t),nr(t,100))}function Ei(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Di(t,e,n,i){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Ci(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Ni(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Mn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Ln(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Oi=function(t,e,n){this.cm=n;var i=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(i),t(r),ie(i,"scroll",function(){i.clientHeight&&e(i.scrollTop,"vertical")}),ie(r,"scroll",function(){r.clientWidth&&e(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Oi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},Oi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Oi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Oi.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},Oi.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,function i(){var r=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,i)})},Oi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Pi=function(){};function Hi(t,e){e||(e=Ni(t));var n=t.display.barWidth,i=t.display.barHeight;Fi(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&xi(t),Fi(t,Ni(t)),n=t.display.barWidth,i=t.display.barHeight}function Fi(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Pi.prototype.update=function(){return{bottom:0,right:0}},Pi.prototype.setScrollLeft=function(){},Pi.prototype.setScrollTop=function(){},Pi.prototype.clear=function(){};var Wi={native:Oi,null:Pi};function zi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&T(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Wi[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ie(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?Di(t,e):Ii(t,e)},t),t.display.scrollbars.addClass&&N(t.display.wrapper,t.display.scrollbars.addClass)}var Ri=0;function Bi(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ri},e=t.curOp,cn?cn.ops.push(e):e.ownsGroup=cn={ops:[e],delayedCallbacks:[]}}function ji(t){var e=t.curOp;!function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new rr(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function $i(t){var e=t.cm,n=e.display;t.updatedDisplay&&xi(e),t.barMeasure=Ni(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Nn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Ln(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-In(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection(t.focus))}function Ui(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft1&&(s=!0)),null!=c.scrollLeft&&(Di(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(s=!0)),!s)break}return r}(e,Ct(i,t.scrollToPos.from),Ct(i,t.scrollToPos.to),t.scrollToPos.margin);!function(t,e){if(!ae(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=L("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Tn(t.display))+"px;\n height: "+(e.bottom-e.top+Ln(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}(e,r)}var o=t.maybeHiddenMarkers,s=t.maybeUnhiddenMarkers;if(o)for(var a=0;ae)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)St&&Bt(t.doc,e)r.viewFrom?Zi(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)Zi(t);else if(e<=r.viewFrom){var o=tr(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):Zi(t)}else if(n>=r.viewTo){var s=tr(t,e,e,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):Zi(t)}else{var a=tr(t,e,e,-1),l=tr(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(ln(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):Zi(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=i.viewTo)){var o=i.view[ci(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==R(s,n)&&s.push(n)}}}function Zi(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function tr(t,e,n,i){var r,o=ci(t,e),s=t.display.view;if(!St||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(o==s.length-1)return null;r=a+s[o].size-e,o++}else r=a-e;e+=r,n+=r}for(;Bt(t.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function er(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo)){var n=+new Date+t.options.workTime,i=Be(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(i.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?Ne(e.mode,i.state):null,l=ze(t,o,i,!0);a&&(i.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hn)return nr(t,t.options.workDelay),!0}),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&Vi(t,function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==er(t))return!1;_i(t)&&(Zi(t),e.dims=ri(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),s=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),St&&(o=Bt(t.doc,o),s=jt(t.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var i=t.display;0==i.view.length||e>=i.viewTo||n<=i.viewFrom?(i.view=ln(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=ln(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,ci(t,n)))),i.viewTo=n}(t,o,s),n.viewOffset=Ut(at(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=er(t);if(!a&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=D();if(!e||!E(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&E(t.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(t);return c>4&&(n.lineDiv.style.display="none"),function(t,e,n){var i=t.display,r=t.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=i.view,u=i.viewFrom,d=0;d-1&&(f=!1),fn(t,h,u,n)),f&&(M(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(pt(t.options,u)))),s=h.node.nextSibling}else{var p=bn(t,h,u,n);o.insertBefore(p,s)}u+=h.size}for(;s;)s=a(s)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=D()&&(t.activeElt.focus(),t.anchorNode&&E(document.body,t.anchorNode)&&E(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(u),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,nr(t,400)),n.updateLineNumbers=null,!0}function sr(t,e){for(var n=e.viewport,i=!0;(i&&t.options.lineWrapping&&e.oldDisplayWidth!=In(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Mn(t.display)-En(t),n.top)}),e.visible=wi(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&or(t,e);i=!1){xi(t);var r=Ni(t);ui(t),Hi(t,r),cr(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function ar(t,e){var n=new rr(t,e);if(or(t,n)){xi(t),sr(t,n);var i=Ni(t);ui(t),Hi(t,i),cr(t,i),n.finish()}}function lr(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function cr(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Ln(t)+"px"}function ur(t){var e=t.display.gutters,n=t.options.gutters;M(e);for(var i=0;i-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}rr.prototype.signal=function(t,e){ce(t,e)&&this.events.push(arguments)},rr.prototype.finish=function(){for(var t=0;ta.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&c||o&&u){if(o&&y&&l)t:for(var h=e.target,f=s.view;h!=a;h=h.parentNode)for(var p=0;p=0&>(t,i.to())<=0)return n}return-1};var yr=function(t,e){this.anchor=t,this.head=e};function xr(t,e){var n=t[e];t.sort(function(t,e){return gt(t.from(),e.from())}),e=R(t,n);for(var i=1;i=0){var s=bt(o.from(),r.from()),a=xt(o.to(),r.to()),l=o.empty()?r.from()==r.head:o.from()==o.head;i<=e&&--e,t.splice(--i,2,new yr(l?a:s,l?s:a))}}return new vr(t,e)}function br(t,e){return new vr([new yr(t,e||t)],0)}function wr(t){return t.text?mt(t.from.line+t.text.length-1,K(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Cr(t,e){if(gt(t,e.from)<0)return t;if(gt(t,e.to)<=0)return wr(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=wr(e).ch-e.to.ch),mt(n,i)}function _r(t,e){for(var n=[],i=0;i1&&t.remove(a.line+1,p-1),t.insert(a.line+1,v)}dn(t,"change",t,e)}function Lr(t,e,n){!function t(i,r,o){if(i.linked)for(var s=0;sa-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(Or(t.done),K(t.done)):t.done.length&&!K(t.done).ranges?K(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),K(t.done)):void 0}(r,r.lastOp==i)))s=K(o.changes),0==gt(e.from,e.to)&&0==gt(e.from,s.to)?s.to=wr(e):o.changes.push(Nr(t,e));else{var l=K(r.done);for(l&&l.ranges||Fr(t.sel,r.done),o={changes:[Nr(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,s||se(t,"historyAdded")}function Hr(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,K(r.done),e))?r.done[r.done.length-1]=e:Fr(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&Or(r.undone)}function Fr(t,e){var n=K(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Wr(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o})}function zr(t){if(!t)return null;for(var e,n=0;n-1&&(K(a)[d]=c[d],delete c[d])}}}return i}function jr(t,e,n,i){if(i){var r=t.anchor;if(n){var o=gt(e,r)<0;o!=gt(n,r)<0?(r=e,e=n):o!=gt(e,n)<0&&(e=n)}return new yr(r,e)}return new yr(n||e,e)}function qr(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Xr(t,new vr([jr(t.sel.primary(),e,n,r)],0),i)}function $r(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:a.to>e.ch))){if(r&&(se(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var c=l.find(i<0?1:-1),u=void 0;if((i<0?l.inclusiveRight:l.inclusiveLeft)&&(c=eo(t,c,-i,c&&c.line==e.line?o:null)),c&&c.line==e.line&&(u=gt(c,n))&&(i<0?u<0:u>0))return Zr(t,c,e,i,r)}var d=l.find(i<0?-1:1);return(i<0?l.inclusiveLeft:l.inclusiveRight)&&(d=eo(t,d,i,d.line==e.line?o:null)),d?Zr(t,d,e,i,r):null}}return e}function to(t,e,n,i,r){var o=i||1,s=Zr(t,e,n,o,r)||!r&&Zr(t,e,n,o,!0)||Zr(t,e,n,-o,r)||!r&&Zr(t,e,n,-o,!0);return s||(t.cantEdit=!0,mt(t.first,0))}function eo(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?Ct(t,mt(e.line-1)):null:n>0&&e.ch==(i||at(t,e.line)).text.length?e.line0)){var u=[l,1],d=gt(c.from,a.from),h=gt(c.to,a.to);(d<0||!s.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(h>0||!s.inclusiveRight&&!h)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}(t,e.from,e.to);if(i)for(var r=i.length-1;r>=0;--r)oo(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text});else oo(t,e)}}function oo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=gt(e.from,e.to)){var n=_r(t,e);Pr(t,e,n,t.cm?t.cm.curOp.id:NaN),lo(t,e,n,Lt(t,e));var i=[];Lr(t,function(t,n){n||-1!=R(i,t.history)||(fo(t.history,e),i.push(t.history)),lo(t,e,null,Lt(t,e))})}}function so(t,e,n){if(!t.cm||!t.cm.state.suppressEdits||n){for(var i,r=t.history,o=t.sel,s="undo"==e?r.done:r.undone,a="undo"==e?r.undone:r.done,l=0;l=0;--h){var f=d(h);if(f)return f.v}}}}function ao(t,e){if(0!=e&&(t.first+=e,t.sel=new vr(Y(t.sel.ranges,function(t){return new yr(mt(t.anchor.line+e,t.anchor.ch),mt(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){Qi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lineo&&(e={from:e.from,to:mt(o,at(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=lt(t,e.from,e.to),n||(n=_r(t,e)),t.cm?function(t,e,n){var i=t.doc,r=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=dt(Rt(at(i,o.line))),i.iter(l,s.line+1,function(t){if(t==r.maxLine)return a=!0,!0})),i.sel.contains(e.from,e.to)>-1&&le(t),Ar(i,e,n,si(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,function(t){var e=Gt(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)}),a&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;i--){var r=at(t,i).stateAfter;if(r&&(!(r instanceof Fe)||i+r.lookAhead1||!(this.children[0]instanceof mo))){var a=[];this.collapse(a),this.children=[new mo(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var s=r.lines.length%25+25,a=s;a10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=I("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(zt(t,e.line,e,n,o)||e.line!=n.line&&zt(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");St=!0}o.addToHistory&&Pr(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,c=t.cm;if(t.iter(l,n.line+1,function(t){c&&o.collapsed&&!c.options.lineWrapping&&Rt(t)==c.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&ut(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new Tt(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&t.iter(e.line,n.line+1,function(e){qt(t,e)&&ut(e,0)}),o.clearOnEnter&&ie(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(kt=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++xo,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)Qi(c,e.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=e.line;u<=n.line;u++)Ji(c,u,"text");o.atomic&&Qr(c.doc),dn(c,"markerAdded",c,o)}return o}bo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Bi(t),ce(this,"clear")){var n=this.find();n&&dn(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Qi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Qr(t.doc)),t&&dn(t,"markerCleared",t,this,i,r),e&&ji(t),this.parent&&this.parent.clear()}},bo.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)ro(this,i[l]);a?Vr(this,a):this.cm&&Ti(this.cm)}),undo:Yi(function(){so(this,"undo")}),redo:Yi(function(){so(this,"redo")}),undoSelection:Yi(function(){so(this,"undo",!0)}),redoSelection:Yi(function(){so(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=Ct(this,t),e=Ct(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var i=0;it)return e=t,!0;t-=o,++n}),Ct(this,mt(n,e))},indexFromPos:function(t){var e=(t=Ct(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var u=t.dataTransfer.getData("Text");if(u){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),Kr(e.doc,br(n,n)),d)for(var h=0;h=0;e--)co(t.doc,"",i[e].from,i[e].to,"+delete");Ti(t)})}Wo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wo.default=y?Wo.macDefault:Wo.pcDefault;var Vo={selectAll:no,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),q)},killLine:function(t){return Go(t,function(e){if(e.empty()){var n=at(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new mt(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),mt(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var s=at(t.doc,r.line-1).text;s&&(r=new mt(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),mt(r.line-1,s.length-1),r,"+transpose"))}n.push(new yr(r,r))}t.setSelections(n)})},newlineAndIndent:function(t){return Vi(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i-1&&(gt((r=c.ranges[r]).from(),e)<0||e.xRel>0)&&(gt(r.to(),e)>0||e.xRel<0)?function(t,e,n,i){var r=t.display,o=!1,c=Xi(t,function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,oe(document,"mouseup",c),oe(document,"mousemove",u),oe(r.scroller,"dragstart",d),oe(r.scroller,"drop",c),o||(de(e),i.addNew||qr(t.doc,n,null,null,i.extend),l||s&&9==a?setTimeout(function(){document.body.focus(),r.input.focus()},20):r.input.focus())}),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return o=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ie(document,"mouseup",c),ie(document,"mousemove",u),ie(r.scroller,"dragstart",d),ie(r.scroller,"drop",c),gi(t),setTimeout(function(){return r.input.focus()},20)}(t,i,e,o):function(t,e,n,i){var r=t.display,o=t.doc;de(e);var s,a,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(a=o.sel.contains(n),s=a>-1?c[a]:new yr(n,n)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(s=new yr(n,n)),n=li(t,e,!0,!0),a=-1;else{var u=ls(t,n,i.unit);s=i.extend?jr(s,u.anchor,u.head,i.extend):u}i.addNew?-1==a?(a=c.length,Xr(o,xr(c.concat([s]),a),{scroll:!1,origin:"*mouse"})):c.length>1&&c[a].empty()&&"char"==i.unit&&!i.extend?(Xr(o,xr(c.slice(0,a).concat(c.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Ur(o,a,s,$):(a=0,Xr(o,new vr([s],0),$),l=o.sel);var d=n,h=r.wrapper.getBoundingClientRect(),f=0;function p(e){var c=++f,u=li(t,e,!0,"rectangle"==i.unit);if(u)if(0!=gt(u,d)){t.curOp.focus=D(),function(e){if(0!=gt(d,e))if(d=e,"rectangle"==i.unit){for(var r=[],c=t.options.tabSize,u=W(at(o,n.line).text,n.ch,c),h=W(at(o,e.line).text,e.ch,c),f=Math.min(u,h),p=Math.max(u,h),m=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));m<=g;m++){var v=at(o,m).text,y=G(v,f,c);f==p?r.push(new yr(mt(m,y),mt(m,y))):v.length>y&&r.push(new yr(mt(m,y),mt(m,G(v,p,c))))}r.length||r.push(new yr(n,n)),Xr(o,xr(l.ranges.slice(0,a).concat(r),a),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var x,b=s,w=ls(t,e,i.unit),C=b.anchor;gt(w.anchor,C)>0?(x=w.head,C=bt(b.from(),w.anchor)):(x=w.anchor,C=xt(b.to(),w.head));var _=l.ranges.slice(0);_[a]=new yr(Ct(o,C),x),Xr(o,xr(_,a),$)}}(u);var m=wi(r,o);(u.line>=m.to||u.lineh.bottom?20:0;g&&setTimeout(Xi(t,function(){f==c&&(r.scroller.scrollTop+=g,p(e))}),50)}}function m(e){t.state.selectingText=!1,f=1/0,de(e),r.input.focus(),oe(document,"mousemove",g),oe(document,"mouseup",v),o.history.lastSelOrigin=null}var g=Xi(t,function(t){ge(t)?p(t):m(t)}),v=Xi(t,m);t.state.selectingText=v,ie(document,"mousemove",g),ie(document,"mouseup",v)}(t,i,e,o)}(e,i,o,t):me(t)==n.scroller&&de(t):2==r?(i&&qr(e.doc,i),setTimeout(function(){return n.input.focus()},20)):3==r&&(_?ds(e,t):gi(e)))}}function ls(t,e,n){if("char"==n)return new yr(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new yr(mt(e.line,0),Ct(t.doc,mt(e.line+1,0)));var i=n(t,e);return new yr(i.from,i.to)}function cs(t,e,n,i){var r,o;try{r=e.clientX,o=e.clientY}catch(e){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&de(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!ce(t,n))return fe(e);o-=a.top-s.viewOffset;for(var l=0;l=r){var u=ht(t.doc,o),d=t.options.gutters[l];return se(t,n,t,u,d,e),fe(e)}}}function us(t,e){return cs(t,e,"gutterClick",!0)}function ds(t,e){Sn(t.display,e)||function(t,e){return!!ce(t,"gutterContextMenu")&&cs(t,e,"gutterContextMenu",!1)}(t,e)||ae(t,e,"contextmenu")||t.display.input.onContextMenu(e)}function hs(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qn(t)}ss.prototype.compare=function(t,e,n){return this.time+400>t&&0==gt(e,this.pos)&&n==this.button};var fs={toString:function(){return"CodeMirror.Init"}},ps={},ms={};function gs(t){ur(t),Qi(t),Ci(t)}function vs(t,e,n){var i=n&&n!=fs;if(!e!=!i){var r=t.display.dragFunctions,o=e?ie:oe;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function ys(t){t.options.lineWrapping?(N(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(T(t.display.wrapper,"CodeMirror-wrap"),Vt(t)),ai(t),Qi(t),qn(t),setTimeout(function(){return Hi(t)},100)}function xs(t,e){var i=this;if(!(this instanceof xs))return new xs(t,e);this.options=e=e?F(e):{},F(ps,e,!1),dr(e);var r=e.value;"string"==typeof r&&(r=new To(r,e.mode,null,e.lineSeparator,e.direction)),this.doc=r;var o=new xs.inputStyles[e.inputStyle](this),c=this.display=new function(t,e,i){var r=this;this.input=i,r.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=I("div",null,"CodeMirror-code"),r.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=L("div",null,"CodeMirror-cursors"),r.measure=L("div",null,"CodeMirror-measure"),r.lineMeasure=L("div",null,"CodeMirror-measure"),r.lineSpace=I("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var o=I("div",[r.lineSpace],"CodeMirror-lines");r.mover=L("div",[o],null,"position: relative"),r.sizer=L("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=L("div",null,null,"position: absolute; height: "+B+"px; width: 1px;"),r.gutters=L("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=L("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=L("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),s&&a<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),l||n&&v||(r.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(r.wrapper):t(r.wrapper)),r.viewFrom=r.viewTo=e.first,r.reportedViewFrom=r.reportedViewTo=e.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,i.init(r)}(t,r,o);for(var u in c.wrapper.CodeMirror=this,ur(this),hs(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},e.autofocus&&!v&&c.input.focus(),s&&a<11&&setTimeout(function(){return i.display.input.reset(!0)},20),function(t){var e=t.display;ie(e.scroller,"mousedown",Xi(t,as)),ie(e.scroller,"dblclick",s&&a<11?Xi(t,function(e){if(!ae(t,e)){var n=li(t,e);if(n&&!us(t,e)&&!Sn(t.display,e)){de(e);var i=t.findWordAt(n);qr(t.doc,i.anchor,i.head)}}}):function(e){return ae(t,e)||de(e)}),_||ie(e.scroller,"contextmenu",function(e){return ds(t,e)});var n,i={end:0};function r(){e.activeTouch&&(n=setTimeout(function(){return e.activeTouch=null},1e3),(i=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,i=e.top-t.top;return n*n+i*i>400}ie(e.scroller,"touchstart",function(r){if(!ae(t,r)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(r)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}}),ie(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),ie(e.scroller,"touchend",function(n){var i=e.activeTouch;if(i&&!Sn(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var s,a=t.coordsChar(e.activeTouch,"page");s=!i.prev||o(i,i.prev)?new yr(a,a):!i.prev.prev||o(i,i.prev.prev)?t.findWordAt(a):new yr(mt(a.line,0),Ct(t.doc,mt(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),de(n)}r()}),ie(e.scroller,"touchcancel",r),ie(e.scroller,"scroll",function(){e.scroller.clientHeight&&(Ii(t,e.scroller.scrollTop),Di(t,e.scroller.scrollLeft,!0),se(t,"scroll",t))}),ie(e.scroller,"mousewheel",function(e){return gr(t,e)}),ie(e.scroller,"DOMMouseScroll",function(e){return gr(t,e)}),ie(e.wrapper,"scroll",function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(e){ae(t,e)||pe(e)},over:function(e){ae(t,e)||(function(t,e){var n=li(t,e);if(n){var i=document.createDocumentFragment();hi(t,n,i),t.display.dragCursor||(t.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),A(t.display.dragCursor,i)}}(t,e),pe(e))},start:function(e){return function(t,e){if(s&&(!t.state.draggingText||+new Date-Mo<100))pe(e);else if(!ae(t,e)&&!Sn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!h)){var n=L("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(t,e)},drop:Xi(t,Ao),leave:function(e){ae(t,e)||Lo(t)}};var l=e.input.getField();ie(l,"keyup",function(e){return ns.call(t,e)}),ie(l,"keydown",Xi(t,es)),ie(l,"keypress",Xi(t,is)),ie(l,"focus",function(e){return vi(t,e)}),ie(l,"blur",function(e){return yi(t,e)})}(this),Do(),Bi(this),this.curOp.forceUpdate=!0,Ir(this,r),e.autofocus&&!v||this.hasFocus()?setTimeout(H(vi,this),20):yi(this),ms)ms.hasOwnProperty(u)&&ms[u](i,e[u],fs);_i(this),e.finishInit&&e.finishInit(this);for(var f=0;f150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?W(at(o,e-1).text,null,s):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/s);f;--f)h+=s,d+="\t";if(h1)if(Cs&&Cs.text.join("\n")==e){if(i.ranges.length%Cs.text.length==0){c=[];for(var u=0;u=0;d--){var h=i.ranges[d],f=h.from(),p=h.to();h.empty()&&(n&&n>0?f=mt(f.line,f.ch-n):t.state.overwrite&&!a?p=mt(p.line,Math.min(at(o,p.line).text.length,p.ch+K(l).length)):Cs&&Cs.lineWise&&Cs.text.join("\n")==e&&(f=p=mt(f.line,0))),s=t.curOp.updateInput;var m={from:f,to:p,text:c?c[d%c.length]:l,origin:r||(a?"paste":t.state.cutIncoming?"cut":"+input")};ro(t.doc,m),dn(t,"inputRead",t,m)}e&&!a&&Ts(t,e),Ti(t),t.curOp.updateInput=s,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function Ss(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Vi(e,function(){return ks(e,n,0,null,"paste")}),!0}function Ts(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=ws(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(at(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=ws(t,r.head.line,"smart"));s&&dn(t,"electricInput",t,r.head.line)}}}function Ms(t){for(var e=[],n=[],i=0;i=t.first+t.size||(e=new mt(s,e.ch,e.sticky),!(a=at(t,s)))))return!1;e=te(r,t.cm,a,e.line,n)}else e=o;return!0}if("char"==i)l();else if("column"==i)l(!0);else if("word"==i||"group"==i)for(var c=null,u="group"==i,d=t.cm&&t.cm.getHelper(e,"wordChars"),h=!0;!(n<0)||l(!h);h=!1){var f=a.text.charAt(e.ch)||"\n",p=et(f,d)?"w":u&&"\n"==f?"n":!u||/\s/.test(f)?null:"p";if(!u||h||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),e.sticky="after");break}if(p&&(c=p),n>0&&!l(!h))break}var m=to(t,e,o,s,!0);return vt(o,m)&&(m.hitSide=!0),m}function Es(t,e,n,i){var r,o,s=t.doc,a=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ni(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;(o=Jn(t,a,r)).outside;){if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var Ds=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ns(t,e){var n=On(t,e.line);if(!n||n.hidden)return null;var i=at(t.doc,e.line),r=Dn(n,i,e.line),o=Qt(i,t.doc.direction),s="left";if(o){var a=Kt(o,e.ch);s=a%2?"right":"left"}var l=zn(r.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function Os(t,e){return e&&(t.bad=!0),t}function Ps(t,e,n){var i;if(e==t.display.lineDiv){if(!(i=t.display.lineDiv.childNodes[n]))return Os(t.clipPos(mt(t.display.viewTo-1)),!0);e=null,n=0}else for(i=e;;i=i.parentNode){if(!i||i==t.display.lineDiv)return null;if(i.parentNode&&i.parentNode==t.display.lineDiv)break}for(var r=0;r=e.display.viewTo||o.line=e.display.viewFrom&&Ns(e,r)||{node:l[0].measure.map[2],offset:0},u=o.linei.firstLine()&&(s=mt(s.line-1,at(i.doc,s.line-1).length)),a.ch==at(i.doc,a.line).text.length&&a.liner.viewTo-1)return!1;s.line==r.viewFrom||0==(t=ci(i,s.line))?(e=dt(r.view[0].line),n=r.view[0].node):(e=dt(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=ci(i,a.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=dt(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var d=i.doc.splitLines(function(t,e,n,i,r){var o="",s=!1,a=t.doc.lineSeparator();function l(){s&&(o+=a,s=!1)}function c(t){t&&(l(),o+=t)}function u(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(null!=n)return void c(n||e.textContent.replace(/\u200b/g,""));var o,d=e.getAttribute("cm-marker");if(d){var h=t.findMarks(mt(i,0),mt(r+1,0),(m=+d,function(t){return t.id==m}));return void(h.length&&(o=h[0].find())&&c(lt(t.doc,o.from,o.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var f=/^(pre|div|p)$/i.test(e.nodeName);f&&l();for(var p=0;p1&&h.length>1;)if(K(d)==K(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),e++}for(var f=0,p=0,m=d[0],g=h[0],v=Math.min(m.length,g.length);fs.ch&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=mt(e,f),C=mt(l,h.length?K(h).length-p:0);return d.length>1||d[0]||gt(w,C)?(co(i.doc,d,w,C,"+input"),!0):void 0},Ds.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ds.prototype.reset=function(){this.forceCompositionEnd()},Ds.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ds.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},Ds.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Vi(this.cm,function(){return Qi(t.cm)})},Ds.prototype.setUneditable=function(t){t.contentEditable="false"},Ds.prototype.onKeyPress=function(t){0!=t.charCode&&(t.preventDefault(),this.cm.isReadOnly()||Xi(this.cm,ks)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Ds.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Ds.prototype.onContextMenu=function(){},Ds.prototype.resetPosition=function(){},Ds.prototype.needsContentAttribute=!0;var Fs=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Fs.prototype.init=function(t){var e=this,n=this,i=this.cm,r=this.wrapper=Ls(),o=this.textarea=r.firstChild;function l(t){if(!ae(i,t)){if(i.somethingSelected())_s({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Ms(i);_s({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,q):(n.prevInput="",o.value=e.text.join("\n"),P(o))}"cut"==t.type&&(i.state.cutIncoming=!0)}}t.wrapper.insertBefore(r,t.wrapper.firstChild),m&&(o.style.width="0px"),ie(o,"input",function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()}),ie(o,"paste",function(t){ae(i,t)||Ss(t,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),ie(o,"cut",l),ie(o,"copy",l),ie(t.scroller,"paste",function(e){Sn(t,e)||ae(i,e)||(i.state.pasteIncoming=!0,n.focus())}),ie(t.lineSpace,"selectstart",function(e){Sn(t,e)||de(e)}),ie(o,"compositionstart",function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ie(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Fs.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=di(t);if(t.options.moveInputWithCursor){var r=Kn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},Fs.prototype.showSelection=function(t){var e=this.cm,n=e.display;A(n.cursorDiv,t.cursors),A(n.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Fs.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&P(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},Fs.prototype.getField=function(){return this.textarea},Fs.prototype.supportsTouch=function(){return!1},Fs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(t){}},Fs.prototype.blur=function(){this.textarea.blur()},Fs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Fs.prototype.receivedFocus=function(){this.slowPoll()},Fs.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},Fs.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,function n(){var i=e.poll();i||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))})},Fs.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||ke(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Fs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Fs.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},Fs.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea,o=li(n,t),c=i.scroller.scrollTop;if(o&&!d){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Xi(n,Xr)(n.doc,br(o),q);var h=r.style.cssText,f=e.wrapper.style.cssText;e.wrapper.style.cssText="position: absolute";var p,m=e.wrapper.getBoundingClientRect();if(r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-m.top-5)+"px; left: "+(t.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(p=window.scrollY),i.input.focus(),l&&window.scrollTo(null,p),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=!0,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&v(),_){pe(t);var g=function(){oe(window,"mouseup",g),setTimeout(y,20)};ie(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=r.selectionStart){var t=n.somethingSelected(),o="​"+(t?r.value:"");r.value="⇚",r.value=o,e.prevInput=t?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending=!1,e.wrapper.style.cssText=f,r.style.cssText=h,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart){(!s||s&&a<9)&&v();var t=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==e.prevInput?Xi(n,no)(n):t++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Fs.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},Fs.prototype.setUneditable=function(){},Fs.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,i,r,o){t.defaults[n]=i,r&&(e[n]=o?function(t,e,n){n!=fs&&r(t,e,n)}:r)}t.defineOption=n,t.Init=fs,n("value","",function(t,e){return t.setValue(e)},!0),n("mode",null,function(t,e){t.doc.modeOption=e,Sr(t)},!0),n("indentUnit",2,Sr,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(t){Tr(t),qn(t),Qi(t)},!0),n("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter(function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(-1==o)break;r=o+e.length,n.push(mt(i,o))}i++});for(var r=n.length-1;r>=0;r--)co(t.doc,e,n[r],mt(n[r].line,n[r].ch+e.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=fs&&t.refresh()}),n("specialCharPlaceholder",en,function(t){return t.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),n("rtlMoveVisually",!b),n("wholeLineUpdateBefore",!0),n("theme","default",function(t){hs(t),gs(t)},!0),n("keyMap","default",function(t,e,n){var i=Uo(e),r=n!=fs&&Uo(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ys,!0),n("gutters",[],function(t){dr(t.options),gs(t)},!0),n("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?oi(t.display)+"px":"0",t.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(t){return Hi(t)},!0),n("scrollbarStyle","native",function(t){zi(t),Hi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),n("lineNumbers",!1,function(t){dr(t.options),gs(t)},!0),n("firstLineNumber",1,gs,!0),n("lineNumberFormatter",function(t){return t},gs,!0),n("showCursorWhenSelecting",!1,ui,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("readOnly",!1,function(t,e){"nocursor"==e&&(yi(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),n("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),n("dragDrop",!0,vs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ui,!0),n("singleCursorHeightPerLine",!0,ui,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Tr,!0),n("addModeClass",!1,Tr,!0),n("pollInterval",100),n("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),n("historyEventDelay",1250),n("viewportMargin",10,function(t){return t.refresh()},!0),n("maxHighlightLength",1e4,Tr,!0),n("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),n("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),n("autofocus",null),n("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0)}(xs),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var i=this.options,r=i[t];i[t]==n&&"mode"!=t||(i[t]=n,e.hasOwnProperty(t)&&Xi(this,e[t])(this,n,r),se(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Uo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nn&&(ws(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&Ti(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&Ur(this.doc,i,new yr(o,c[i].to()),q)}}}),getTokenAt:function(t,e){return Ge(this,t,e)},getLineTokens:function(t,e){return Ge(this,mt(t),e,!0)},getTokenTypeAt:function(t){t=Ct(this.doc,t);var e,n=Re(this,at(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]o&&(t=o,r=!0),i=at(this.doc,t)}else i=t;return Gn(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-Ut(i):0)},defaultTextHeight:function(){return ni(this.display)},defaultCharWidth:function(){return ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o,s,a,l=this.display,c=(t=Kn(this,Ct(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==i)c=t.top;else if("above"==i||"near"==i){var d=Math.max(l.wrapper.clientHeight,this.doc.height),h=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>d)&&t.top>e.offsetHeight?c=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=d&&(c=t.bottom),u+e.offsetWidth>h&&(u=h-e.offsetWidth)}e.style.top=c+"px",e.style.left=e.style.right="","right"==r?(u=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?u=0:"middle"==r&&(u=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(o=this,s={left:u,top:c,right:u+e.offsetWidth,bottom:c+e.offsetHeight},null!=(a=ki(o,s)).scrollTop&&Ii(o,a.scrollTop),null!=a.scrollLeft&&Di(o,a.scrollLeft))},triggerOnKeyDown:Ki(es),triggerOnKeyPress:Ki(is),triggerOnKeyUp:ns,triggerOnMouseDown:Ki(as),execCommand:function(t){if(Vo.hasOwnProperty(t))return Vo[t].call(null,this)},triggerElectric:Ki(function(t){Ts(this,t)}),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var o=Ct(this.doc,t),s=0;s0&&a(n.charAt(i-1));)--i;for(;r.5)&&ai(this),se(this,"refresh",this)}),swapDoc:Ki(function(t){var e=this.doc;return e.cm=null,Ir(this,t),qn(this),this.display.input.reset(),Mi(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,dn(this,"swapDoc",this,e),e}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ue(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}(xs);var Ws,zs="iter insert remove copy getEditor constructor".split(" ");for(var Rs in To.prototype)To.prototype.hasOwnProperty(Rs)&&R(zs,Rs)<0&&(xs.prototype[Rs]=function(t){return function(){return t.apply(this.doc,arguments)}}(To.prototype[Rs]));return ue(To),xs.inputStyles={textarea:Fs,contenteditable:Ds},xs.defineMode=function(t){xs.defaults.mode||"null"==t||(xs.defaults.mode=t),function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Me[t]=e}.apply(this,arguments)},xs.defineMIME=function(t,e){Ae[t]=e},xs.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),xs.defineMIME("text/plain","null"),xs.defineExtension=function(t,e){xs.prototype[t]=e},xs.defineDocExtension=function(t,e){To.prototype[t]=e},xs.fromTextArea=function(t,e){if((e=e?F(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=D();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=a.getValue()}var r;if(t.form&&(ie(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var o=t.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(t){}}e.finishInit=function(e){e.save=i,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,i(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(oe(t.form,"submit",i),"function"==typeof t.form.submit&&(t.form.submit=r))}},t.style.display="none";var a=xs(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return a},(Ws=xs).off=oe,Ws.on=ie,Ws.wheelEventPixels=mr,Ws.Doc=To,Ws.splitLines=_e,Ws.countColumn=W,Ws.findColumn=G,Ws.isWordChar=tt,Ws.Pass=j,Ws.signal=se,Ws.Line=Ke,Ws.changeEnd=wr,Ws.scrollbarModel=Wi,Ws.Pos=mt,Ws.cmpPos=gt,Ws.modes=Me,Ws.mimeModes=Ae,Ws.resolveMode=Le,Ws.getMode=Ie,Ws.modeExtensions=Ee,Ws.extendMode=De,Ws.copyState=Ne,Ws.startState=Pe,Ws.innerMode=Oe,Ws.commands=Vo,Ws.keyMap=Wo,Ws.keyName=$o,Ws.isModifierKey=jo,Ws.lookupKey=Bo,Ws.normalizeKeyMap=Ro,Ws.StringStream=He,Ws.SharedTextMarker=Co,Ws.TextMarker=bo,Ws.LineWidget=vo,Ws.e_preventDefault=de,Ws.e_stopPropagation=he,Ws.e_stop=pe,Ws.addClass=N,Ws.contains=E,Ws.rmClass=T,Ws.keyNames=Oo,xs.version="5.28.0",xs}()},function(t,e,n){var i,r,o={},s=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),a=function(t){var e={};return function(t){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t){return document.querySelector(t)}.call(this,t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),l=null,c=0,u=[],d=n(22);function h(t,e){for(var n=0;n=0&&u.splice(e,1)}function g(t){var e=document.createElement("style");return t.attrs.type="text/css",v(e,t.attrs),p(t,e),e}function v(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function y(t,e){var n,i,r,o;if(e.transform&&t.css){if(!(o=e.transform(t.css)))return function(){};t.css=o}if(e.singleton){var s=c++;n=l||(l=g(e)),i=w.bind(null,n,s,!1),r=w.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",v(e,t.attrs),p(t,e),e}(e),i=function(t,e,n){var i=n.css,r=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||o)&&(i=d(i));r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([i],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,e),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),i=function(t,e){var n=e.css,i=e.media;i&&t.setAttribute("media",i);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){m(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return h(n,e),function(t){for(var i=[],r=0;r0&&e-1 in t)}_.fn=_.prototype={jquery:"3.3.1",constructor:_,length:0,toArray:function(){return l.call(this)},get:function(t){return null==t?l.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+H+")"+H+"*"),$=new RegExp("="+H+"*([^\\]'\"]*?)"+H+"*\\]","g"),U=new RegExp(z),G=new RegExp("^"+F+"$"),V={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+H+"?|("+H+")|.)","ig"),tt=function(t,e,n){var i="0x"+e-65536;return i!=i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,nt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},it=function(){h()},rt=yt(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{D.apply(L=N.call(w.childNodes),w.childNodes),L[w.childNodes.length].nodeType}catch(t){D={apply:L.length?function(t,e){E.apply(t,N.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function ot(t,e,i,r){var o,a,c,u,d,p,v,y=e&&e.ownerDocument,C=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==C&&9!==C&&11!==C)return i;if(!r&&((e?e.ownerDocument||e:w)!==f&&h(e),e=e||f,m)){if(11!==C&&(d=Q.exec(t)))if(o=d[1]){if(9===C){if(!(c=e.getElementById(o)))return i;if(c.id===o)return i.push(c),i}else if(y&&(c=y.getElementById(o))&&x(e,c)&&c.id===o)return i.push(c),i}else{if(d[2])return D.apply(i,e.getElementsByTagName(t)),i;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return D.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!T[t+" "]&&(!g||!g.test(t))){if(1!==C)y=e,v=t;else if("object"!==e.nodeName.toLowerCase()){for((u=e.getAttribute("id"))?u=u.replace(et,nt):e.setAttribute("id",u=b),a=(p=s(t)).length;a--;)p[a]="#"+u+" "+vt(p[a]);v=p.join(","),y=J.test(t)&&mt(e.parentNode)||e}if(v)try{return D.apply(i,y.querySelectorAll(v)),i}catch(t){}finally{u===b&&e.removeAttribute("id")}}}return l(t.replace(B,"$1"),e,i,r)}function st(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function at(t){return t[b]=!0,t}function lt(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ct(t,e){for(var n=t.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=e}function ut(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function dt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function ft(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&rt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function pt(t){return at(function(e){return e=+e,at(function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=ot.support={},o=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},h=ot.setDocument=function(t){var e,r,s=t?t.ownerDocument||t:w;return s!==f&&9===s.nodeType&&s.documentElement?(p=(f=s).documentElement,m=!o(f),w!==f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",it,!1):r.attachEvent&&r.attachEvent("onunload",it)),n.attributes=lt(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=lt(function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(f.getElementsByClassName),n.getById=lt(function(t){return p.appendChild(t).id=b,!f.getElementsByName||!f.getElementsByName(b).length}),n.getById?(i.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(Z,tt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Y.test(f.querySelectorAll))&&(lt(function(t){p.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+H+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+H+"*(?:value|"+P+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]")}),lt(function(t){t.innerHTML="";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+H+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=Y.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&<(function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),v.push("!=",z)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Y.test(p.compareDocumentPosition),x=e||Y.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},M=e?function(t,e){if(t===e)return d=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t===f||t.ownerDocument===w&&x(w,t)?-1:e===f||e.ownerDocument===w&&x(w,e)?1:u?O(u,t)-O(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,s=[t],a=[e];if(!r||!o)return t===f?-1:e===f?1:r?-1:o?1:u?O(u,t)-O(u,e):0;if(r===o)return ut(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?ut(s[i],a[i]):s[i]===w?-1:a[i]===w?1:0},f):f},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==f&&h(t),e=e.replace($,"='$1']"),n.matchesSelector&&m&&!T[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return ot(e,f,null,[t]).length>0},ot.contains=function(t,e){return(t.ownerDocument||t)!==f&&h(t),x(t,e)},ot.attr=function(t,e){(t.ownerDocument||t)!==f&&h(t);var r=i.attrHandle[e.toLowerCase()],o=r&&A.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},ot.escape=function(t){return(t+"").replace(et,nt)},ot.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ot.uniqueSort=function(t){var e,i=[],r=0,o=0;if(d=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(M),d){for(;e=t[o++];)e===t[o]&&(r=i.push(o));for(;r--;)t.splice(i[r],1)}return u=null,t},r=ot.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(i=ot.selectors={cacheLength:50,createPseudo:at,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,tt),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ot.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ot.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return V.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&U.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+H+")"+t+"("+H+"|$)"))&&k(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(i){var r=ot.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(R," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,h,f,p,m=o!==s?"nextSibling":"previousSibling",g=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a,x=!1;if(g){if(o){for(;m;){for(h=e;h=h[m];)if(a?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?g.firstChild:g.lastChild],s&&y){for(x=(f=(c=(u=(d=(h=g)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===C&&c[1])&&c[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(x=f=0)||p.pop();)if(1===h.nodeType&&++x&&h===e){u[t]=[C,f,x];break}}else if(y&&(x=f=(c=(u=(d=(h=e)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===C&&c[1]),!1===x)for(;(h=++f&&h&&h[m]||(x=f=0)||p.pop())&&((a?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++x||(y&&((u=(d=h[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]=[C,x]),h!==e)););return(x-=r)===i||x%i==0&&x/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||ot.error("unsupported pseudo: "+t);return r[b]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?at(function(t,n){for(var i,o=r(t,e),s=o.length;s--;)t[i=O(t,o[s])]=!(n[i]=o[s])}):function(t){return r(t,0,n)}):r}},pseudos:{not:at(function(t){var e=[],n=[],i=a(t.replace(B,"$1"));return i[b]?at(function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:at(function(t){return function(e){return ot(t,e).length>0}}),contains:at(function(t){return t=t.replace(Z,tt),function(e){return(e.textContent||e.innerText||r(e)).indexOf(t)>-1}}),lang:at(function(t){return G.test(t||"")||ot.error("unsupported lang: "+t),t=t.replace(Z,tt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:ft(!1),disabled:ft(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return K.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:pt(function(){return[0]}),last:pt(function(t,e){return[e-1]}),eq:pt(function(t,e,n){return[n<0?n+e:n]}),even:pt(function(t,e){for(var n=0;n=0;)t.push(i);return t}),gt:pt(function(t,e,n){for(var i=n<0?n+e:n;++i1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function bt(t,e,n,i,r){for(var o,s=[],a=0,l=t.length,c=null!=e;a-1&&(o[c]=!(s[c]=d))}}else v=bt(v===s?v.splice(p,v.length):v),r?r(null,s,v,l):D.apply(s,v)})}function Ct(t){for(var e,n,r,o=t.length,s=i.relative[t[0].type],a=s||i.relative[" "],l=s?1:0,u=yt(function(t){return t===e},a,!0),d=yt(function(t){return O(e,t)>-1},a,!0),h=[function(t,n,i){var r=!s&&(i||n!==c)||((e=n).nodeType?u(t,n,i):d(t,n,i));return e=null,r}];l1&&xt(h),l>1&&vt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(B,"$1"),n,l0,r=t.length>0,o=function(o,s,a,l,u){var d,p,g,v=0,y="0",x=o&&[],b=[],w=c,_=o||r&&i.find.TAG("*",u),k=C+=null==w?1:Math.random()||.1,S=_.length;for(u&&(c=s===f||s||u);y!==S&&null!=(d=_[y]);y++){if(r&&d){for(p=0,s||d.ownerDocument===f||(h(d),a=!m);g=t[p++];)if(g(d,s||f,a)){l.push(d);break}u&&(C=k)}n&&((d=!g&&d)&&v--,o&&x.push(d))}if(v+=y,n&&y!==v){for(p=0;g=e[p++];)g(x,b,s,a);if(o){if(v>0)for(;y--;)x[y]||b[y]||(b[y]=I.call(l));b=bt(b)}D.apply(l,b),u&&!o&&b.length>0&&v+e.length>1&&ot.uniqueSort(l)}return u&&(C=k,c=w),x};return n?at(o):o}(o,r))).selector=t}return a},l=ot.select=function(t,e,n,r){var o,l,c,u,d,h="function"==typeof t&&t,f=!r&&s(t=h.selector||t);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&m&&i.relative[l[1].type]){if(!(e=(i.find.ID(c.matches[0].replace(Z,tt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=V.needsContext.test(t)?0:l.length;o--&&(c=l[o],!i.relative[u=c.type]);)if((d=i.find[u])&&(r=d(c.matches[0].replace(Z,tt),J.test(l[0].type)&&mt(e.parentNode)||e))){if(l.splice(o,1),!(t=r.length&&vt(l)))return D.apply(n,r),n;break}}return(h||a(t,f))(r,e,!m,n,!e||J.test(t)&&mt(e.parentNode)||e),n},n.sortStable=b.split("").sort(M).join("")===b,n.detectDuplicates=!!d,h(),n.sortDetached=lt(function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))}),lt(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||ct("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&<(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ct("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),lt(function(t){return null==t.getAttribute("disabled")})||ct(P,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),ot}(n);_.find=T,_.expr=T.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=T.uniqueSort,_.text=T.getText,_.isXMLDoc=T.isXML,_.contains=T.contains,_.escapeSelector=T.escape;var M=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&_(t).is(n))break;i.push(t)}return i},A=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},L=_.expr.match.needsContext;function I(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var E=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(t,e,n){return y(e)?_.grep(t,function(t,i){return!!e.call(t,i,t)!==n}):e.nodeType?_.grep(t,function(t){return t===e!==n}):"string"!=typeof e?_.grep(t,function(t){return d.call(e,t)>-1!==n}):_.filter(e,t,n)}_.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?_.find.matchesSelector(i,t)?[i]:[]:_.find.matches(t,_.grep(e,function(t){return 1===t.nodeType}))},_.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(_(t).filter(function(){for(e=0;e1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(D(this,t||[],!1))},not:function(t){return this.pushStack(D(this,t||[],!0))},is:function(t){return!!D(this,"string"==typeof t&&L.test(t)?_(t):t||[],!1).length}});var N,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||N,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:O.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:s,!0)),E.test(i[1])&&_.isPlainObject(e))for(i in e)y(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=s.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,N=_(s);var P=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function F(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&_.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?d.call(_(t),this[0]):d.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return M(t,"parentNode")},parentsUntil:function(t,e,n){return M(t,"parentNode",n)},next:function(t){return F(t,"nextSibling")},prev:function(t){return F(t,"previousSibling")},nextAll:function(t){return M(t,"nextSibling")},prevAll:function(t){return M(t,"previousSibling")},nextUntil:function(t,e,n){return M(t,"nextSibling",n)},prevUntil:function(t,e,n){return M(t,"previousSibling",n)},siblings:function(t){return A((t.parentNode||{}).firstChild,t)},children:function(t){return A(t.firstChild)},contents:function(t){return I(t,"iframe")?t.contentDocument:(I(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},function(t,e){_.fn[t]=function(n,i){var r=_.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=_.filter(i,r)),this.length>1&&(H[t]||_.uniqueSort(r),P.test(t)&&r.reverse()),this.pushStack(r)}});var W=/[^\x20\t\r\n\f]+/g;function z(t){return t}function R(t){throw t}function B(t,e,n,i){var r;try{t&&y(r=t.promise)?r.call(t).done(e).fail(n):t&&y(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return _.each(t.match(W)||[],function(t,n){e[n]=!0}),e}(t):_.extend({},t);var e,n,i,r,o=[],s=[],a=-1,l=function(){for(r=r||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--}),this},has:function(t){return t?_.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return _.Deferred(function(n){_.each(e,function(e,i){var r=y(t[i[4]])&&t[i[4]];o[i[1]](function(){var t=r&&r.apply(this,arguments);t&&y(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(t,i,r){var o=0;function s(t,e,i,r){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(t=o&&(i!==R&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?u():(_.Deferred.getStackHook&&(u.stackTrace=_.Deferred.getStackHook()),n.setTimeout(u))}}return _.Deferred(function(n){e[0][3].add(s(0,n,y(r)?r:z,n.notifyWith)),e[1][3].add(s(0,n,y(t)?t:z)),e[2][3].add(s(0,n,y(i)?i:R))}).promise()},promise:function(t){return null!=t?_.extend(t,r):r}},o={};return _.each(e,function(t,n){var s=n[2],a=n[5];r[n[1]]=s.add,a&&s.add(function(){i=a},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith}),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=l.call(arguments),o=_.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?l.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(B(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||y(r[n]&&r[n].then)))return o.then();for(;n--;)B(r[n],s(n),o.reject);return o.promise()}});var j=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&j.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){n.setTimeout(function(){throw t})};var q=_.Deferred();function $(){s.removeEventListener("DOMContentLoaded",$),n.removeEventListener("load",$),_.ready()}_.fn.ready=function(t){return q.then(t).catch(function(t){_.readyException(t)}),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||q.resolveWith(s,[_]))}}),_.ready.then=q.then,"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(_.ready):(s.addEventListener("DOMContentLoaded",$),n.addEventListener("load",$));var U=function(t,e,n,i,r,o,s){var a=0,l=t.length,c=null==n;if("object"===C(n))for(a in r=!0,n)U(t,e,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,y(i)||(s=!0),c&&(s?(e.call(t,i),e=null):(c=e,e=function(t,e,n){return c.call(_(t),n)})),e))for(;a1,null,!0)},removeData:function(t){return this.each(function(){Z.remove(this,t)})}}),_.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=J.get(t,e),n&&(!i||Array.isArray(n)?i=J.access(t,e,_.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),i=n.length,r=n.shift(),o=_._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,function(){_.dequeue(t,e)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:_.Callbacks("once memory").add(function(){J.remove(t,[e+"queue",n])})})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]+)/i,pt=/^$|^module$|\/(?:java|ecma)script/i,mt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function gt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&I(t,e)?_.merge([t],n):n}function vt(t,e){for(var n=0,i=t.length;n-1)r&&r.push(o);else if(c=_.contains(o.ownerDocument,o),s=gt(d.appendChild(o),"script"),c&&vt(s),n)for(u=0;o=s[u++];)pt.test(o.type||"")&&n.push(o);return d}yt=s.createDocumentFragment().appendChild(s.createElement("div")),(xt=s.createElement("input")).setAttribute("type","radio"),xt.setAttribute("checked","checked"),xt.setAttribute("name","t"),yt.appendChild(xt),v.checkClone=yt.cloneNode(!0).cloneNode(!0).lastChild.checked,yt.innerHTML="",v.noCloneChecked=!!yt.cloneNode(!0).lastChild.defaultValue;var Ct=s.documentElement,_t=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,St=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function Mt(){return!1}function At(){try{return s.activeElement}catch(t){}}function Lt(t,e,n,i,r,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Lt(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Mt;else if(!r)return t;return 1===o&&(s=r,(r=function(t){return _().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=_.guid++)),t.each(function(){_.event.add(this,e,r,i,n)})}_.event={global:{},add:function(t,e,n,i,r){var o,s,a,l,c,u,d,h,f,p,m,g=J.get(t);if(g)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&_.find.matchesSelector(Ct,r),n.guid||(n.guid=_.guid++),(l=g.events)||(l=g.events={}),(s=g.handle)||(s=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(W)||[""]).length;c--;)f=m=(a=St.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(d=_.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=_.event.special[f]||{},u=_.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&_.expr.match.needsContext.test(r),namespace:p.join(".")},o),(h=l[f])||((h=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,i,p,s)||t.addEventListener&&t.addEventListener(f,s)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,u):h.push(u),_.event.global[f]=!0)},remove:function(t,e,n,i,r){var o,s,a,l,c,u,d,h,f,p,m,g=J.hasData(t)&&J.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(W)||[""]).length;c--;)if(f=m=(a=St.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=_.event.special[f]||{},h=l[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)u=h[o],!r&&m!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(t,u));s&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||_.removeEvent(t,f,g.handle),delete l[f])}else for(f in l)_.event.remove(t,f+e[c],n,i,!0);_.isEmptyObject(l)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,s,a=_.event.fix(t),l=new Array(arguments.length),c=(J.get(this,"events")||{})[a.type]||[],u=_.event.special[a.type]||{};for(l[0]=a,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],s={},n=0;n-1:_.find(r,this,null,[c]).length),s[r]&&o.push(i);o.length&&a.push({elem:c,handlers:o})}return c=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,Et=/\s*$/g;function Ot(t,e){return I(t,"table")&&I(11!==e.nodeType?e:e.firstChild,"tr")&&_(t).children("tbody")[0]||t}function Pt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ht(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ft(t,e){var n,i,r,o,s,a,l,c;if(1===e.nodeType){if(J.hasData(t)&&(o=J.access(t),s=J.set(e,o),c=o.events))for(r in delete s.handle,s.events={},c)for(n=0,i=c[r].length;n1&&"string"==typeof p&&!v.checkClone&&Dt.test(p))return t.each(function(r){var o=t.eq(r);m&&(e[0]=p.call(this,r,o.html())),Wt(o,e,n,i)});if(h&&(o=(r=wt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=(s=_.map(gt(r,"script"),Pt)).length;d")},clone:function(t,e,n){var i,r,o,s,a,l,c,u=t.cloneNode(!0),d=_.contains(t.ownerDocument,t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||_.isXMLDoc(t)))for(s=gt(u),i=0,r=(o=gt(t)).length;i0&&vt(s,!d&>(t,"script")),u},cleanData:function(t){for(var e,n,i,r=_.event.special,o=0;void 0!==(n=t[o]);o++)if(Y(n)){if(e=n[J.expando]){if(e.events)for(i in e.events)r[i]?_.event.remove(n,i):_.removeEvent(n,i,e.handle);n[J.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),_.fn.extend({detach:function(t){return zt(this,t,!0)},remove:function(t){return zt(this,t)},text:function(t){return U(this,function(t){return void 0===t?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Wt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ot(this,t).appendChild(t)})},prepend:function(){return Wt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ot(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Wt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Wt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(gt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return _.clone(this,t,e)})},html:function(t){return U(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Et.test(t)&&!mt[(ft.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))),l}function te(t,e,n){var i=Bt(t),r=qt(t,e,i),o="border-box"===_.css(t,"boxSizing",!1,i),s=o;if(Rt.test(r)){if(!n)return r;r="auto"}return s=s&&(v.boxSizingReliable()||r===t.style[e]),("auto"===r||!parseFloat(r)&&"inline"===_.css(t,"display",!1,i))&&(r=t["offset"+e[0].toUpperCase()+e.slice(1)],s=!0),(r=parseFloat(r)||0)+Zt(t,e,n||(o?"border":"content"),s,i,r)+"px"}function ee(t,e,n,i,r){return new ee.prototype.init(t,e,n,i,r)}_.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=K(e),l=Gt.test(e),c=t.style;if(l||(e=Qt(a)),s=_.cssHooks[e]||_.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:c[e];"string"===(o=typeof n)&&(r=rt.exec(n))&&r[1]&&(n=lt(t,e,r),o="number"),null!=n&&n==n&&("number"===o&&(n+=r&&r[3]||(_.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,i){var r,o,s,a=K(e);return Gt.test(e)||(e=Qt(a)),(s=_.cssHooks[e]||_.cssHooks[a])&&"get"in s&&(r=s.get(t,!0,n)),void 0===r&&(r=qt(t,e,i)),"normal"===r&&e in Xt&&(r=Xt[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),_.each(["height","width"],function(t,e){_.cssHooks[e]={get:function(t,n,i){if(n)return!Ut.test(_.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?te(t,e,i):at(t,Vt,function(){return te(t,e,i)})},set:function(t,n,i){var r,o=Bt(t),s="border-box"===_.css(t,"boxSizing",!1,o),a=i&&Zt(t,e,i,s,o);return s&&v.scrollboxSize()===o.position&&(a-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-Zt(t,e,"border",!1,o)-.5)),a&&(r=rt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=_.css(t,e)),Jt(0,n,a)}}}),_.cssHooks.marginLeft=$t(v.reliableMarginLeft,function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-at(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(t,e){_.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+ot[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(_.cssHooks[t+e].set=Jt)}),_.fn.extend({css:function(t,e){return U(this,function(t,e,n){var i,r,o={},s=0;if(Array.isArray(e)){for(i=Bt(t),r=e.length;s1)}}),_.Tween=ee,ee.prototype={constructor:ee,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var t=ee.propHooks[this.prop];return t&&t.get?t.get(this):ee.propHooks._default.get(this)},run:function(t){var e,n=ee.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ee.propHooks._default.set(this),this}},ee.prototype.init.prototype=ee.prototype,ee.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[_.cssProps[t.prop]]&&!_.cssHooks[t.prop]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},ee.propHooks.scrollTop=ee.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=ee.prototype.init,_.fx.step={};var ne,ie,re=/^(?:toggle|show|hide)$/,oe=/queueHooks$/;function se(){ie&&(!1===s.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(se):n.setTimeout(se,_.fx.interval),_.fx.tick())}function ae(){return n.setTimeout(function(){ne=void 0}),ne=Date.now()}function le(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=ot[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function ce(t,e,n){for(var i,r=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),o=0,s=r.length;o1)},removeAttr:function(t){return this.each(function(){_.removeAttr(this,t)})}}),_.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?_.prop(t,e,n):(1===o&&_.isXMLDoc(t)||(r=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?de:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=_.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&I(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(W);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),de={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(t,e){var n=he[e]||_.find.attr;he[e]=function(t,e,i){var r,o,s=e.toLowerCase();return i||(o=he[s],he[s]=r,r=null!=n(t,e,i)?s:null,he[s]=o),r}});var fe=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;function me(t){return(t.match(W)||[]).join(" ")}function ge(t){return t.getAttribute&&t.getAttribute("class")||""}function ve(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(W)||[]}_.fn.extend({prop:function(t,e){return U(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[_.propFix[t]||t]})}}),_.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(t)||(e=_.propFix[e]||e,r=_.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):fe.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(t){var e,n,i,r,o,s,a,l=0;if(y(t))return this.each(function(e){_(this).addClass(t.call(this,e,ge(this)))});if((e=ve(t)).length)for(;n=this[l++];)if(r=ge(n),i=1===n.nodeType&&" "+me(r)+" "){for(s=0;o=e[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(a=me(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,o,s,a,l=0;if(y(t))return this.each(function(e){_(this).removeClass(t.call(this,e,ge(this)))});if(!arguments.length)return this.attr("class","");if((e=ve(t)).length)for(;n=this[l++];)if(r=ge(n),i=1===n.nodeType&&" "+me(r)+" "){for(s=0;o=e[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(a=me(i))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):y(t)?this.each(function(n){_(this).toggleClass(t.call(this,n,ge(this),e),e)}):this.each(function(){var e,r,o,s;if(i)for(r=0,o=_(this),s=ve(t);e=s[r++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ge(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))})},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+me(ge(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;_.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=y(t),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,_(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=_.map(r,function(t){return null==t?"":t+""})),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))})):r?(e=_.valHooks[r.type]||_.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(ye,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:me(_.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?o+1:r.length;for(i=o<0?l:s?o:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},v.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),v.focusin="onfocusin"in n;var xe=/^(?:focusinfocus|focusoutblur)$/,be=function(t){t.stopPropagation()};_.extend(_.event,{trigger:function(t,e,i,r){var o,a,l,c,u,d,h,f,m=[i||s],g=p.call(t,"type")?t.type:t,v=p.call(t,"namespace")?t.namespace.split("."):[];if(a=f=l=i=i||s,3!==i.nodeType&&8!==i.nodeType&&!xe.test(g+_.event.triggered)&&(g.indexOf(".")>-1&&(g=(v=g.split(".")).shift(),v.sort()),u=g.indexOf(":")<0&&"on"+g,(t=t[_.expando]?t:new _.Event(g,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:_.makeArray(e,[t]),h=_.event.special[g]||{},r||!h.trigger||!1!==h.trigger.apply(i,e))){if(!r&&!h.noBubble&&!x(i)){for(c=h.delegateType||g,xe.test(c+g)||(a=a.parentNode);a;a=a.parentNode)m.push(a),l=a;l===(i.ownerDocument||s)&&m.push(l.defaultView||l.parentWindow||n)}for(o=0;(a=m[o++])&&!t.isPropagationStopped();)f=a,t.type=o>1?c:h.bindType||g,(d=(J.get(a,"events")||{})[t.type]&&J.get(a,"handle"))&&d.apply(a,e),(d=u&&a[u])&&d.apply&&Y(a)&&(t.result=d.apply(a,e),!1===t.result&&t.preventDefault());return t.type=g,r||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(m.pop(),e)||!Y(i)||u&&y(i[g])&&!x(i)&&((l=i[u])&&(i[u]=null),_.event.triggered=g,t.isPropagationStopped()&&f.addEventListener(g,be),i[g](),t.isPropagationStopped()&&f.removeEventListener(g,be),_.event.triggered=void 0,l&&(i[u]=l)),t.result}},simulate:function(t,e,n){var i=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(i,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each(function(){_.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}}),v.focusin||_.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){_.event.simulate(e,t.target,_.event.fix(t))};_.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=J.access(i,e);r||i.addEventListener(t,n,!0),J.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=J.access(i,e)-1;r?J.access(i,e,r):(i.removeEventListener(t,n,!0),J.remove(i,e))}}});var we=n.location,Ce=Date.now(),_e=/\?/;_.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+t),e};var ke=/\[\]$/,Se=/\r?\n/g,Te=/^(?:submit|button|image|reset|file)$/i,Me=/^(?:input|select|textarea|keygen)/i;function Ae(t,e,n,i){var r;if(Array.isArray(e))_.each(e,function(e,r){n||ke.test(t)?i(t,r):Ae(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)});else if(n||"object"!==C(e))i(t,e);else for(r in e)Ae(t+"["+r+"]",e[r],n,i)}_.param=function(t,e){var n,i=[],r=function(t,e){var n=y(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,function(){r(this.name,this.value)});else for(n in t)Ae(n,t[n],e,r);return i.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&Me.test(this.nodeName)&&!Te.test(t)&&(this.checked||!ht.test(t))}).map(function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(t){return{name:e.name,value:t.replace(Se,"\r\n")}}):{name:e.name,value:n.replace(Se,"\r\n")}}).get()}});var Le=/%20/g,Ie=/#.*$/,Ee=/([?&])_=[^&]*/,De=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ne=/^(?:GET|HEAD)$/,Oe=/^\/\//,Pe={},He={},Fe="*/".concat("*"),We=s.createElement("a");function ze(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(W)||[];if(y(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Re(t,e,n,i){var r={},o=t===He;function s(a){var l;return r[a]=!0,_.each(t[a]||[],function(t,a){var c=a(e,n,i);return"string"!=typeof c||o||r[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),s(c),!1)}),l}return s(e.dataTypes[0])||!r["*"]&&s("*")}function Be(t,e){var n,i,r=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&_.extend(!0,t,i),t}We.href=we.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:we.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(we.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Fe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Be(Be(t,_.ajaxSettings),e):Be(_.ajaxSettings,t)},ajaxPrefilter:ze(Pe),ajaxTransport:ze(He),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,r,o,a,l,c,u,d,h,f,p=_.ajaxSetup({},e),m=p.context||p,g=p.context&&(m.nodeType||m.jquery)?_(m):_.event,v=_.Deferred(),y=_.Callbacks("once memory"),x=p.statusCode||{},b={},w={},C="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(u){if(!a)for(a={};e=De.exec(o);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)k.always(t[k.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||C;return i&&i.abort(e),S(0,e),this}};if(v.promise(k),p.url=((t||p.url||we.href)+"").replace(Oe,we.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(W)||[""],null==p.crossDomain){c=s.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=We.protocol+"//"+We.host!=c.protocol+"//"+c.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=_.param(p.data,p.traditional)),Re(Pe,p,e,k),u)return k;for(h in(d=_.event&&p.global)&&0==_.active++&&_.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ne.test(p.type),r=p.url.replace(Ie,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Le,"+")):(f=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(_e.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Ee,"$1"),f=(_e.test(r)?"&":"?")+"_="+Ce+++f),p.url=r+f),p.ifModified&&(_.lastModified[r]&&k.setRequestHeader("If-Modified-Since",_.lastModified[r]),_.etag[r]&&k.setRequestHeader("If-None-Match",_.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Fe+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(m,k,p)||u))return k.abort();if(C="abort",y.add(p.complete),k.done(p.success),k.fail(p.error),i=Re(He,p,e,k)){if(k.readyState=1,d&&g.trigger("ajaxSend",[k,p]),u)return k;p.async&&p.timeout>0&&(l=n.setTimeout(function(){k.abort("timeout")},p.timeout));try{u=!1,i.send(b,S)}catch(t){if(u)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,s,a){var c,h,f,b,w,C=e;u||(u=!0,l&&n.clearTimeout(l),i=void 0,o=a||"",k.readyState=t>0?4:0,c=t>=200&&t<300||304===t,s&&(b=function(t,e,n){for(var i,r,o,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,k,s)),b=function(t,e,n,i){var r,o,s,a,l,c={},u=t.dataTypes.slice();if(u[1])for(s in t.converters)c[s.toLowerCase()]=t.converters[s];for(o=u.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=c[l+" "+o]||c["* "+o]))for(r in c)if((a=r.split(" "))[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[r]:!0!==c[r]&&(o=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,b,k,c),c?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(_.lastModified[r]=w),(w=k.getResponseHeader("etag"))&&(_.etag[r]=w)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=b.state,h=b.data,c=!(f=b.error))):(f=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(e||C)+"",c?v.resolveWith(m,[h,C,k]):v.rejectWith(m,[k,C,f]),k.statusCode(x),x=void 0,d&&g.trigger(c?"ajaxSuccess":"ajaxError",[k,p,c?h:f]),y.fireWith(m,[k,C]),d&&(g.trigger("ajaxComplete",[k,p]),--_.active||_.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],function(t,e){_[e]=function(t,n,i,r){return y(n)&&(r=r||i,i=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:r,data:n,success:i},_.isPlainObject(t)&&t))}}),_._evalUrl=function(t){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(y(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return y(t)?this.each(function(e){_(this).wrapInner(t.call(this,e))}):this.each(function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=y(t);return this.each(function(n){_(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var je={0:200,1223:204},qe=_.ajaxSettings.xhr();v.cors=!!qe&&"withCredentials"in qe,v.ajax=qe=!!qe,_.ajaxTransport(function(t){var e,i;if(v.cors||qe&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(je[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){e&&i()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),_.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),_.ajaxTransport("script",function(t){var e,n;if(t.crossDomain)return{send:function(i,r){e=_(" - - - - - - - - - - - - - diff --git a/scripts/lib/mlevans-leaflet-hash.zip/test/spec/hash.js b/scripts/lib/mlevans-leaflet-hash.zip/test/spec/hash.js deleted file mode 100644 index 4360fd9..0000000 --- a/scripts/lib/mlevans-leaflet-hash.zip/test/spec/hash.js +++ /dev/null @@ -1,68 +0,0 @@ -describe("L.Hash", function() { - - var map; - - mocha.ignoreLeaks(); - - beforeEach(function() { - map = new L.Map(document.createElement('div')); - }); - - it('sets a hash when the map is moved', function() { - var hash = L.hash(map); - map.setView([51.505, -0.09], 13); - expect(location.hash).to.be('#13/51.5050/-0.0900'); - }); - - it('uses a hash set initially on the page', function(done) { - location.hash = '#13/10/40'; - var hash = L.hash(map); - window.setTimeout(function() { - expect(Math.round(map.getCenter().lat)).to.be(10); - expect(Math.round(map.getCenter().lng)).to.be(40); - done(); - }, 200); - }); - - it('responds to a hash change after an initial hash is set', function(done) { - map.setView([51.505, -0.09], 13); - location.hash = '#13/20/40'; - var hash = L.hash(map); - window.setTimeout(function() { - expect(Math.round(map.getCenter().lat)).to.be(20); - expect(Math.round(map.getCenter().lng)).to.be(40); - done(); - }, 200); - }); - - it('does not acknowledge a junk hash', function(done) { - var hash = L.hash(map); - map.setView([51, 2], 13); - location.hash = '#foo'; - window.setTimeout(function() { - expect(Math.round(map.getCenter().lat)).to.eql(51); - expect(Math.round(map.getCenter().lng)).to.eql(2); - done(); - }, 200); - }); - - it('unbinds events when removed', function() { - location.hash = ''; - var hash = L.hash(map); - map.removeControl(hash); - map.setView([51.505, -0.09], 13); - expect(location.hash).to.be(''); - }); - - it('parses a hash', function() { - var parsed = L.Hash.parseHash('#13/20/40'); - expect(parsed.zoom).to.be(13); - expect(parsed.center).to.be.a(L.LatLng); - expect(parsed.center).to.eql({lat: 20, lng: 40}); - }); - - it('formats a hash', function() { - map.setView([51, 2], 13); - expect(L.Hash.formatHash(map)).to.be('#13/51.0000/2.0000'); - }); -}); diff --git a/scripts/lib/srt.css b/scripts/lib/srt.css deleted file mode 100644 index 5bb12c2..0000000 --- a/scripts/lib/srt.css +++ /dev/null @@ -1,41 +0,0 @@ -body { - color: gray; - background: white; -} -body.subtitle > * { - display: none; -} -body.subtitle .title { - display: none; -} -body.subtitle .title.active { - display: block; -} -.title.active { - padding-top: 5px; - padding-bottom: 5px; - display: block; - color: black; - /*background: white;*/ -} -#controls { - position: absolute; - right: 0; top: 0; -} -body.subtitle #controls { - display: block; -} -/* -a.symbol { - display: inline-block; - width: 19px; - height: 30px; - -} -a.symbol.video { - background-image: url(/icons/playsymbol.png); -} -a.symbol.scans { - background-image: url(/icons/leafletmarker.png); -} -*/ \ No newline at end of file diff --git a/scripts/lib/srt.js b/scripts/lib/srt.js deleted file mode 100644 index 54c2a6c..0000000 --- a/scripts/lib/srt.js +++ /dev/null @@ -1,15 +0,0 @@ -document.addEventListener("DOMContentLoaded", function () { - // subtitles - var b = document.createElement("button"), - c = document.createElement("div"); - c.appendChild(b); - b.innerHTML = "toggle"; - b.addEventListener("click", function () { - document.body.classList.toggle("subtitle"); - }); - - document.body.append(c); - c.id = "controls"; - - -}) diff --git a/scripts/map.js b/scripts/map.js deleted file mode 100644 index ad8a2be..0000000 --- a/scripts/map.js +++ /dev/null @@ -1,266 +0,0 @@ -function init_map (max_zoom, abovepages, layoutpages) { - -var cell_width = 320, - cell_height = 209; - -if (abovepages === undefined) { abovepages = [] } - -var map = L.map('map', { - maxZoom: max_zoom || 9, - minZoom: 0, - zoom: 0, - crs: L.CRS.Simple, - center: new L.LatLng(0,0) -}); - - -var markers = [ - { - "id": "t1", - "y": -23.0, - "zoom": 2, - "x": 156.3 - }, - { - "id": "t13", - "y": -9.938, - "zoom": 7, - "x": 7.078 - }, - { - "id": "t24", - "y": -10.016, - "zoom": 6, - "x": 312.891 - }, - { - "id": "t25", - "y": -9.922, - "zoom": 6, - "x": 17.156 - }, - { - "id": "t27", - "y": -9.891, - "zoom": 6, - "x": 25.078 - }, - { - "id": "t30", - "y": -10.031, - "zoom": 6, - "x": 44.969 - }, - { - "id": "t31", - "y": -10.094, - "zoom": 6, - "x": 52.719 - }, - { - "id": "t34", - "y": -9.906, - "zoom": 6, - "x": 94.922 - }, - { - "id": "t36", - "y": -9.859, - "zoom": 6, - "x": 117.063 - }, - { - "id": "t37", - "y": -9.859, - "zoom": 6, - "x": 134.938 - }, - { - "id": "t38", - "y": -9.859, - "zoom": 6, - "x": 137.359 - }, - { - "id": "t39", - "y": -9.938, - "zoom": 6, - "x": 145.047 - }, - { - "id": "t41", - "y": -9.859, - "zoom": 6, - "x": 155.0 - }, - { - "id": "t42", - "y": -9.969, - "zoom": 6, - "x": 172.578 - }, - { - "id": "t43", - "y": -9.953, - "zoom": 6, - "x": 176.906 - }, - { - "id": "t44", - "y": -3.484, - "zoom": 6, - "x": 174.953 - }, - { - "id": "t45", - "y": -10.063, - "zoom": 6, - "x": 185.156 - }, - { - "id": "t47", - "y": -11.438, - "zoom": 6, - "x": 195.953 - }, - { - "id": "t48", - "y": -10.188, - "zoom": 6, - "x": 204.969 - }, - { - "id": "t50", - "y": -9.938, - "zoom": 6, - "x": 217.156 - }, - { - "id": "t51", - "y": -9.922, - "zoom": 6, - "x": 223.094 - }, - { - "id": "t52", - "y": -9.984, - "zoom": 6, - "x": 242.922 - }, - { - "id": "t53", - "y": -9.984, - "zoom": 6, - "x": 246.875 - }, - { - "id": "t54", - "y": -9.984, - "zoom": 6, - "x": 297.094 - }, - { - "id": "t55", - "y": -9.875, - "zoom": 6, - "x": 302.813 - }, - { - "id": "t56", - "y": -9.844, - "zoom": 6, - "x": 307.094 - }, - { - "id": "t57", - "y": -12.0, - "zoom": 9, - "x": 308.0391 - }, - { - "id": "t62", - "y": -10.328, - "zoom": 6, - "x": 313.219 - } -]; -// console.log("[map].markers", markers); -var allmarkers = []; -markers.forEach(function (m) { - var marker = L.marker([m.y, m.x]).on("click", function (e) { - //console.log("marker click", m.id, e, this) - window.parent.postMessage({msg: "mapclick", id: m.id}, "*") - }); - allmarkers.push(marker); -}) -var markers_layer = L.layerGroup(allmarkers); - -var request = new XMLHttpRequest(); -request.open('GET', 'tiles.json', true); - -var hash = new L.Hash(map); - -function is_above_page (item) { - var m = /^_DSC(\d+)\.png/.exec(item.name); - if (m) { - var pn = parseInt(m[1]), - pni = abovepages.indexOf(pn); - // console.log("AP", pn, pni); - return (abovepages.indexOf(pn) != -1) - } -} - -request.onload = function() { - if (request.status >= 200 && request.status < 400) { - // Success! - var data = JSON.parse(request.responseText); - // console.log("data", data); - var pelts = []; - var above_spread = false; - var x = 0, - y = 0, - items = data['@graph']; - for (var i=0, l=items.length; i - - - ST01 - - - - - - - - -
- - - - diff --git a/scripts/tileimages-ld b/scripts/tileimages-ld deleted file mode 100644 index 12319a9..0000000 --- a/scripts/tileimages-ld +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function -from PIL import Image -import re, sys, json, os - -try: - from urllib import quote as urlquote # Python 2.X -except ImportError: - from urllib.parse import quote as urlquote # Python 3+ - - -def fitbox (boxw, boxh, w, h): - rw = boxw - rh = int(rw * (float(h) / w)) - if (rh >= boxh): - rh = boxh - rw = int(rh * (float(w) / h)) - return rw, rh - -def tile_image (im, maxz=0, tilew=256, tileh=256, base=".", template="z{0[z]}y{0[y]}x{0[x]}.jpg", bgcolor=(0,0,0), margin_right=0, margin_bottom=0): - z = 0 - boxw, boxh = tilew, tileh - - alpha = bgcolor != None # not template.endswith("jpg") - - while True: - rw, rh = fitbox(boxw, boxh, im.size[0], im.size[1]) - rim = im.resize((rw-margin_right, rh-margin_bottom), Image.ANTIALIAS) - if bgcolor: - tim = Image.new("RGB", (boxw, boxh), bgcolor) - tim.paste(rim, (0, 0)) - else: - tim = Image.new("RGBA", (boxw, boxh)) - tim.paste(rim, (0, 0)) - - rows, cols = 2**z, 2**z - for r in range(rows): - for c in range(cols): - ix = c*tilew - iy = r*tileh - cim = tim.crop((ix, iy, ix+tilew, iy+tileh)) - op = base + template.format({'z':z, 'x':c, 'y':r}) - # if not alpha: - # cim = cim.convert("RGB") - cim.save(op) - - z += 1 - if z>maxz: - break - boxw *= 2 - boxh *= 2 - -def expand_template (x): - return re.sub(r"{(\w+?)}", "{0[\\1]}", x) - -if __name__ == "__main__": - from argparse import ArgumentParser - - ap = ArgumentParser("Generate image tiles and output JSON for a collection of images") - ap.add_argument("input", nargs="+") - - ap.add_argument("--basepath", default=".") - ap.add_argument("--baseuri", default="") - - ap.add_argument("--tilespath", default="tiles", help="name of path to create in the same folder as the original") - ap.add_argument("--tilewidth", type=int, default=256) - ap.add_argument("--tileheight", type=int, default=256) - ap.add_argument("--zoom", type=int, default=3) - ap.add_argument("--tilename", default="z{z}y{y}x{x}.png") - ap.add_argument("--force", default=False, action="store_true") - - args = ap.parse_args() - - """ - leafygal format: {id: original, tiles: "template", name: filename} - """ - - tilenamex = expand_template(args.tilename) - #bgcolor = (0, 0, 0) - bgcolor = None - items = [] - - for imgpath in args.input: - parent = os.path.split(imgpath)[0] - basename = os.path.basename(imgpath) - path = os.path.join(parent, args.tilespath, basename) - item = { - 'id': urlquote(imgpath), - 'name': basename, - 'tiles': os.path.join(path, args.tilename) - } - tile0 = os.path.join(path, tilenamex.format({'x': 0, 'y': 0, 'z': 0})) - items.append(item) - if not os.path.exists(tile0) or args.force: - print ("Tiling {0}".format(imgpath), file=sys.stderr) - try: - im = Image.open(imgpath) - try: - os.makedirs(path) - except OSError: - pass - tile_image(im, args.zoom, args.tilewidth, args.tileheight, path+"/", tilenamex, bgcolor) - # tiles.append(t) - - except IOError as e: - print ("Missing {0}, skipping".format(n), file=sys.stderr) - items = items[:-1] - - data = { - '@context': { - 'id': '@id', - 'aa': 'http://activearchives.org/terms', - 'name': 'aa:filename', - 'tiles': 'aa:tiles' - }, - '@graph': items - } - print (json.dumps(data, indent=2)) diff --git a/scripts/tiles.json b/scripts/tiles.json deleted file mode 100644 index b25e2a1..0000000 --- a/scripts/tiles.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "@context": { - "id": "@id", - "aa": "http://activearchives.org/terms", - "name": "aa:filename", - "tiles": "aa:tiles" - }, - "@graph": [ - { - "id": "images/page-0.jpg", - "name": "page-0.jpg", - "tiles": "images/tiles/page-0.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-10.jpg", - "name": "page-10.jpg", - "tiles": "images/tiles/page-10.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-11.jpg", - "name": "page-11.jpg", - "tiles": "images/tiles/page-11.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-12.jpg", - "name": "page-12.jpg", - "tiles": "images/tiles/page-12.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-13.jpg", - "name": "page-13.jpg", - "tiles": "images/tiles/page-13.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-14.jpg", - "name": "page-14.jpg", - "tiles": "images/tiles/page-14.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-15.jpg", - "name": "page-15.jpg", - "tiles": "images/tiles/page-15.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-16.jpg", - "name": "page-16.jpg", - "tiles": "images/tiles/page-16.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-17.jpg", - "name": "page-17.jpg", - "tiles": "images/tiles/page-17.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-18.jpg", - "name": "page-18.jpg", - "tiles": "images/tiles/page-18.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-19.jpg", - "name": "page-19.jpg", - "tiles": "images/tiles/page-19.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-1.jpg", - "name": "page-1.jpg", - "tiles": "images/tiles/page-1.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-20.jpg", - "name": "page-20.jpg", - "tiles": "images/tiles/page-20.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-21.jpg", - "name": "page-21.jpg", - "tiles": "images/tiles/page-21.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-22.jpg", - "name": "page-22.jpg", - "tiles": "images/tiles/page-22.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-23.jpg", - "name": "page-23.jpg", - "tiles": "images/tiles/page-23.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-24.jpg", - "name": "page-24.jpg", - "tiles": "images/tiles/page-24.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-25.jpg", - "name": "page-25.jpg", - "tiles": "images/tiles/page-25.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-26.jpg", - "name": "page-26.jpg", - "tiles": "images/tiles/page-26.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-27.jpg", - "name": "page-27.jpg", - "tiles": "images/tiles/page-27.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-28.jpg", - "name": "page-28.jpg", - "tiles": "images/tiles/page-28.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-29.jpg", - "name": "page-29.jpg", - "tiles": "images/tiles/page-29.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-2.jpg", - "name": "page-2.jpg", - "tiles": "images/tiles/page-2.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-30.jpg", - "name": "page-30.jpg", - "tiles": "images/tiles/page-30.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-3.jpg", - "name": "page-3.jpg", - "tiles": "images/tiles/page-3.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-4.jpg", - "name": "page-4.jpg", - "tiles": "images/tiles/page-4.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-5.jpg", - "name": "page-5.jpg", - "tiles": "images/tiles/page-5.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-6.jpg", - "name": "page-6.jpg", - "tiles": "images/tiles/page-6.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-7.jpg", - "name": "page-7.jpg", - "tiles": "images/tiles/page-7.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-8.jpg", - "name": "page-8.jpg", - "tiles": "images/tiles/page-8.jpg/z{z}y{y}x{x}.png" - }, - { - "id": "images/page-9.jpg", - "name": "page-9.jpg", - "tiles": "images/tiles/page-9.jpg/z{z}y{y}x{x}.png" - } - ] -}