diff --git a/background.js b/background.js new file mode 100644 index 0000000..b5ed7d9 --- /dev/null +++ b/background.js @@ -0,0 +1,7 @@ +chrome.runtime.onMessage.addListener( + function(request, sender, sendResponse) { + console.log("Message from content: " + request); + chrome.pageAction.show(sender.tab.id); + sendResponse({text: "ok"}); + } +); diff --git a/codemirror-compressed.js b/codemirror-compressed.js new file mode 100644 index 0000000..bb498f8 --- /dev/null +++ b/codemirror-compressed.js @@ -0,0 +1,19 @@ +/* CodeMirror - Minified & Bundled + Generated on 9/6/2014 with http://codemirror.net/doc/compress.html + Version: HEAD + + CodeMirror Library: + - codemirror.js + Modes: + - javascript.js + - ntriples.js + - sparql.js + - turtle.js + - xml.js + */ + +!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function w(a,b){if(!(this instanceof w))return new w(a,b);this.options=b=b||{},Dg(Yd,b,!1),K(b);var c=b.value;"string"==typeof c&&(c=new xf(c,b.mode)),this.doc=c;var f=this.display=new x(a,c);f.wrapper.CodeMirror=this,G(this),E(this),b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),b.autofocus&&!o&&Pc(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new tg},d&&11>e&&setTimeout(Eg(Oc,this,!0),20),Sc(this),Xg();var g=this;yc(this,function(){g.curOp.forceUpdate=!0,Bf(g,c),b.autofocus&&!o||Qg()==f.input?setTimeout(Eg(ud,g),20):vd(g);for(var a in Zd)Zd.hasOwnProperty(a)&&Zd[a](g,b[a],_d);for(var d=0;de&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),n&&(g.style.width="0px"),f||(c.scroller.draggable=!0),k&&(c.inputDiv.style.height="1px",c.inputDiv.style.position="absolute"),d&&8>e&&(c.scrollbarH.style.minHeight=c.scrollbarV.style.minWidth="18px"),a.appendChild?a.appendChild(c.wrapper):a(c.wrapper),c.viewFrom=c.viewTo=b.first,c.view=[],c.externalMeasured=null,c.viewOffset=0,c.lastSizeC=0,c.updateLineNumbers=null,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.prevInput="",c.alignWidgets=!1,c.pollingFast=!1,c.poll=new tg,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.inaccurateSelection=!1,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null}function y(a){a.doc.mode=w.getMode(a.options,a.doc.modeOption),z(a)}function z(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Rb(a,100),a.state.modeGen++,a.curOp&&Ec(a)}function A(a){a.options.lineWrapping?(Tg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth=""):(Sg(a.display.wrapper,"CodeMirror-wrap"),J(a)),C(a),Ec(a),hc(a),setTimeout(function(){N(a)},100)}function B(a){var b=tc(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/uc(a.display)-3);return function(e){if(Te(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;gb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function K(a){var b=Ag(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function L(a){return a.display.scroller.clientHeight-a.display.wrapper.clientHeightb.clientWidth;f&&b.scrollWidth<=b.clientWidth+1&&d>0&&!b.hScrollbarTakesSpace&&(f=!1);var g=e>b.clientHeight;if(g?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=f?d+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,e-b.clientHeight+(b.barHeight||c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0"),f?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=g?d+"px":"0",c.scrollbarH.firstChild.style.width=b.scrollWidth-b.clientWidth+(b.barWidth||c.scrollbarH.clientWidth)+"px"):(c.scrollbarH.style.display="",c.scrollbarH.firstChild.style.width="0"),f&&g?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=d+"px"):c.scrollbarFiller.style.display="",f&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display="",!a.state.checkedOverlayScrollbar&&b.clientHeight>0){if(0===d){var h=p&&!l?"12px":"18px";c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=h;var i=function(b){bg(b)!=c.scrollbarV&&bg(b)!=c.scrollbarH&&zc(a,Wc)(b)};dg(c.scrollbarV,"mousedown",i),dg(c.scrollbarH,"mousedown",i)}a.state.checkedOverlayScrollbar=!0}}function O(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Vb(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=Hf(b,d),g=Hf(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;if(f>h)return{from:h,to:Hf(b,If(Cf(b,h))+a.wrapper.clientHeight)};if(Math.min(i,b.lastLine())>=g)return{from:Hf(b,If(Cf(b,i))-a.wrapper.clientHeight),to:i}}return{from:f,to:Math.max(g,f+1)}}function P(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=S(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;gk.clientWidth&&k.scrollWidth=a.display.viewFrom&&h.to<=a.display.viewTo)break}return a.display.updateLineNumbers=null,g&&(ig(a,"update",a),(a.display.viewFrom!=d||a.display.viewTo!=e)&&ig(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo)),g}function U(a,b,c){var d=a.display,e=a.doc;if(!d.wrapper.offsetWidth)return Gc(a),void 0;if(!(!c&&b.from>=d.viewFrom&&b.to<=d.viewTo&&0==Kc(a))){Q(a)&&Gc(a);var f=$(a),g=e.first+e.size,h=Math.max(b.from-a.options.viewportMargin,e.first),i=Math.min(g,b.to+a.options.viewportMargin);d.viewFromi&&d.viewTo-i<20&&(i=Math.min(g,d.viewTo)),v&&(h=Re(a.doc,h),i=Se(a.doc,i));var j=h!=d.viewFrom||i!=d.viewTo||d.lastSizeC!=d.wrapper.clientHeight;Jc(a,h,i),d.viewOffset=If(Cf(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var k=Kc(a);if(j||0!=k||c){var l=Qg();return k>4&&(d.lineDiv.style.display="none"),_(a,d.updateLineNumbers,f),k>4&&(d.lineDiv.style.display=""),l&&Qg()!=l&&l.offsetHeight&&l.focus(),Ng(d.cursorDiv),Ng(d.selectionDiv),j&&(d.lastSizeC=d.wrapper.clientHeight,Rb(a,400)),Y(a),!0}}}function V(a){var b=a.display,c=_b(a,b.maxLine,b.maxLine.text.length).left;b.maxLineChanged=!1;var d=Math.max(0,c+3),e=Math.max(0,b.sizer.offsetLeft+d+og-b.scroller.clientWidth);b.sizer.style.minWidth=d+"px",ee){var i=g.node.offsetTop+g.node.offsetHeight;h=i-c,c=i}else{var j=g.node.getBoundingClientRect();h=j.bottom-j.top}var k=g.line.height-h;if(2>h&&(h=tc(b)),(k>.001||-.001>k)&&(Ff(g.line,h),Z(g.line),g.rest))for(var l=0;l=b&&m.lineNumber;m.changes&&(Ag(m.changes,"gutter")>-1&&(o=!1),ab(a,m,k,c)),o&&(Ng(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(R(a.options,k)))),h=m.node.nextSibling}else{var n=ib(a,m,k,c);g.insertBefore(n,h)}k+=m.size}for(;h;)h=i(h)}function ab(a,b,c,d){for(var e=0;ee&&(a.node.style.zIndex=2)),a.node}function cb(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=bb(a);a.background=c.insertBefore(Lg("div",null,b),c.firstChild)}}function db(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):lf(a,b)}function eb(a,b){var c=b.text.className,d=db(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,fb(b)):c&&(b.text.className=c)}function fb(a){cb(a),a.line.wrapClass?bb(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function gb(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);var e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=bb(b),g=b.gutter=f.insertBefore(Lg("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px"),b.text);if(!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Lg("div",R(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),e)for(var h=0;h=0){var g=qb(f.from(),e.from()),h=pb(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new sb(i?h:g,i?g:h))}}return new rb(a,b)}function ub(a,b){return new rb([new sb(a,b||a)],0)}function vb(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function wb(a,b){if(b.linec?mb(c,Cf(a,c).text.length):xb(b,Cf(a,b.line).text.length)}function xb(a,b){var c=a.ch;return null==c||c>b?mb(a.line,b):0>c?mb(a.line,0):a}function yb(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&(fg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==nb(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?wb(a,mb(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),b=Math.round(b),d=Math.round(d),f.appendChild(Lg("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?i-a:c)+"px; height: "+(d-b)+"px"))}function k(b,c,d){function m(c,d){return mc(a,mb(b,c),"div",f,d)}var k,l,f=Cf(e,b),g=f.text.length;return ih(Jf(f),c||0,null==d?g:d,function(a,b,e){var n,o,p,f=m(a,"left");if(a==b)n=f,o=p=f.left;else{if(n=m(b-1,"right"),"rtl"==e){var q=f;f=n,n=q}o=f.left,p=n.right}null==c&&0==a&&(o=h),n.top-f.top>3&&(j(o,f.top,null,f.bottom),o=h,f.bottoml.bottom||n.bottom==l.bottom&&n.right>l.right)&&(l=n),h+1>o&&(o=h),j(o,n.top,p-o,n.bottom)}),{start:k,end:l}}var d=a.display,e=a.doc,f=document.createDocumentFragment(),g=Xb(a.display),h=g.left,i=d.lineSpace.offsetWidth-g.right,l=b.from(),m=b.to();if(l.line==m.line)k(l.line,l.ch,m.ch);else{var n=Cf(e,l.line),o=Cf(e,m.line),p=Pe(n)==Pe(o),q=k(l.line,l.ch,p?n.text.length+1:null).end,r=k(m.line,p?0:null,m.ch).start;p&&(q.top0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Rb(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=fe(b.mode,Ub(a,b.frontier));yc(a,function(){b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(e){if(b.frontier>=a.display.viewFrom){var f=e.styles,g=ef(a,e,d,!0);e.styles=g.styles,g.classes?e.styleClasses=g.classes:e.styleClasses&&(e.styleClasses=null);for(var h=!f||f.length!=e.styles.length,i=0;!h&&ic?(Rb(a,a.options.workDelay),!0):void 0})})}}function Tb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=Cf(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=ug(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Ub(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Tb(a,b,c),g=f>d.first&&Cf(d,f-1).stateAfter;return g=g?fe(d.mode,g):ge(d.mode),d.iter(f,b,function(c){gf(a,c.text,g);var h=f==b-1||0==f%5||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Zb(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function $b(a,b){b=Pe(b);var c=Gf(b),d=a.display.externalMeasured=new Cc(a.doc,b,c);d.lineN=c;var e=d.built=lf(a,d);return d.text=e.pre,Og(a.display.lineMeasure,e.pre),d}function _b(a,b,c,d){return cc(a,bc(a,b),c,d)}function ac(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bc?(i=0,j=1,k="left"):n>c?(i=c-m,j=i+1):(l==g.length-3||c==n&&g[l+3]>c)&&(j=n-m,i=j-1,c>=n&&(k="right")),null!=i){if(h=g[l+2],m==n&&f==(h.insertLeft?"left":"right")&&(k=f),"left"==f&&0==i)for(;l&&g[l-2]==g[l-3]&&g[l-1].insertLeft;)h=g[(l-=3)+2],k="left";if("right"==f&&i==n-m)for(;lm+j&&Kg(b.line.text.charAt(m+j));)++j;if(d&&9>e&&0==i&&j==n-m)o=h.parentNode.getBoundingClientRect();else if(d&&a.options.lineWrapping){var p=Mg(h,i,j).getClientRects();o=p.length?p["right"==f?p.length-1:0]:dc}else o=Mg(h,i,j).getBoundingClientRect()||dc}else{i>0&&(k=f="right");var p;o=a.options.lineWrapping&&(p=h.getClientRects()).length>1?p["right"==f?p.length-1:0]:h.getBoundingClientRect()}if(d&&9>e&&!i&&(!o||!o.left&&!o.right)){var q=h.parentNode.getClientRects()[0];o=q?{left:q.left,right:q.left+uc(a.display),top:q.top,bottom:q.bottom}:dc}for(var r=o.top-b.rect.top,s=o.bottom-b.rect.top,t=(r+s)/2,u=b.view.measure.heights,l=0;lc.from?g(a-1):g(a,d)}d=d||Cf(a.doc,b.line),e||(e=bc(a,d));var i=Jf(d),j=b.ch;if(!i)return g(j);var k=rh(i,j),l=h(j,k);return null!=qh&&(l.other=h(j,qh)),l}function oc(a,b){var c=0,b=wb(a.doc,b);a.options.lineWrapping||(c=uc(a.display)*b.ch);var d=Cf(a.doc,b.line),e=If(d)+Vb(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function pc(a,b,c,d){var e=mb(a,b);return e.xRel=d,c&&(e.outside=!0),e}function qc(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return pc(d.first,0,!0,-1);var e=Hf(d,c),f=d.first+d.size-1;if(e>f)return pc(d.first+d.size-1,Cf(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Cf(d,e);;){var h=rc(a,g,e,b,c),i=Ne(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=Gf(g=j.to.line)}}function rc(a,b,c,d,e){function j(d){var e=nc(a,mb(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:fq)return pc(c,n,r,1);for(;;){if(k?n==m||n==th(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Kg(b.text.charAt(s));)++s;var u=pc(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=th(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l=v):(m=w,o=y,p=g,l-=v)}}function tc(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==sc){sc=Lg("pre");for(var b=0;49>b;++b)sc.appendChild(document.createTextNode("x")),sc.appendChild(Lg("br"));sc.appendChild(document.createTextNode("x"))}Og(a.measure,sc);var c=sc.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Ng(a.measure),c||1}function uc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Lg("span","xxxxxxxxxx"),c=Lg("pre",[b]);Og(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function wc(a){a.curOp={viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++vc},hg++||(gg=[])}function xc(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&J(a),b.viewChanged||b.forceUpdate||null!=b.scrollTop||b.scrollToPos&&(b.scrollToPos.from.line=d.viewTo)||d.maxLineChanged&&a.options.lineWrapping){var e=T(a,{top:b.scrollTop,ensure:b.scrollToPos},b.forceUpdate);a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)}if(!e&&b.selectionChanged&&Nb(a),e||b.startHeight==a.doc.height||N(a),null==d.wheelStartX||null==b.scrollTop&&null==b.scrollLeft&&!b.scrollToPos||(d.wheelStartX=d.wheelStartY=null),null!=b.scrollTop&&d.scroller.scrollTop!=b.scrollTop){var f=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,b.scrollTop));d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=f}if(null!=b.scrollLeft&&d.scroller.scrollLeft!=b.scrollLeft){var g=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,b.scrollLeft));d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g,P(a)}if(b.scrollToPos){var h=Md(a,wb(a.doc,b.scrollToPos.from),wb(a.doc,b.scrollToPos.to),b.scrollToPos.margin);b.scrollToPos.isCursor&&a.state.focused&&Ld(a,h)}b.selectionChanged&&Qb(a),a.state.focused&&b.updateInput&&Oc(a,b.typing);var i=b.maybeHiddenMarkers,j=b.maybeUnhiddenMarkers;if(i)for(var k=0;kf;f=e){var g=new Cc(a.doc,Cf(a.doc,f),f);e=f+g.size,d.push(g)}return d}function Ec(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)v&&Re(a.doc,b)e.viewFrom?Gc(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Gc(a);else if(b<=e.viewFrom){var f=Ic(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Gc(a)}else if(c>=e.viewTo){var f=Ic(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Gc(a)}else{var g=Ic(a,b,b,-1),h=Ic(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Dc(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Gc(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[Hc(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Ag(g,c)&&g.push(c)}}}function Gc(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Hc(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function Ic(a,b,c,d){var f,e=Hc(a,b),g=a.display.view;if(!v||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var h=0,i=a.display.viewFrom;e>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(e==g.length-1)return null;f=i+g[e].size-b,e++}else f=i-b;b+=f,c+=f}for(;Re(a.doc,c)!=c;){if(e==(0>d?0:g.length-1))return null;c+=d*g[e-(0>d?1:0)].size,e+=d}return{index:e,lineN:c}}function Jc(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Dc(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Dc(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,Hc(a,c)))),d.viewTo=c}function Kc(a){for(var b=a.display.view,c=0,d=0;d=9&&a.display.inputHasSelection===g)return Oc(a),!1;var h=!a.curOp;h&&wc(a),a.display.shift=!1,8203!=g.charCodeAt(0)||f.sel!=a.display.selForContextMenu||c||(c="\u200b");for(var i=0,j=Math.min(c.length,g.length);j>i&&c.charCodeAt(i)==g.charCodeAt(i);)++i;for(var k=g.slice(i),l=eh(k),m=a.state.pasteIncoming&&l.length>1&&f.sel.ranges.length==l.length,n=f.sel.ranges.length-1;n>=0;n--){var o=f.sel.ranges[n],p=o.from(),q=o.to();i-1){Sd(a,o.head.line,"smart");break}}else if(t.electricInput){var v=yd(s);t.electricInput.test(Cf(f,v.line).text.slice(0,v.ch))&&Sd(a,o.head.line,"smart")}}}return Qd(a),a.curOp.updateInput=r,a.curOp.typing=!0,g.length>1e3||g.indexOf("\n")>-1?b.value=a.display.prevInput="":a.display.prevInput=g,h&&xc(a),a.state.pasteIncoming=a.state.cutIncoming=!1,!0}function Oc(a,b){var c,f,g=a.doc;if(a.somethingSelected()){a.display.prevInput="";var h=g.sel.primary();c=gh&&(h.to().line-h.from().line>100||(f=a.getSelection()).length>1e3);var i=c?"-":f||a.getSelection();a.display.input.value=i,a.state.focused&&zg(a.display.input),d&&e>=9&&(a.display.inputHasSelection=i)}else b||(a.display.prevInput=a.display.input.value="",d&&e>=9&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=c}function Pc(a){"nocursor"==a.options.readOnly||o&&Qg()==a.display.input||a.display.input.focus()}function Qc(a){a.state.focused||(Pc(a),ud(a))}function Rc(a){return a.options.readOnly||a.doc.cantEdit}function Sc(a){function c(){a.state.focused&&setTimeout(Eg(Pc,a),0)}function g(b){kg(a,b)||ag(b)}function h(c){if(a.somethingSelected())b.inaccurateSelection&&(b.prevInput="",b.inaccurateSelection=!1,b.input.value=a.getSelection(),zg(b.input));else{for(var d="",e=[],f=0;fe?dg(b.scroller,"dblclick",zc(a,function(b){if(!kg(a,b)){var c=Vc(a,b);if(c&&!bd(a,b)&&!Uc(a.display,b)){Zf(b);var d=Xd(a,c);Bb(a.doc,d.anchor,d.head)}}})):dg(b.scroller,"dblclick",function(b){kg(a,b)||Zf(b)}),dg(b.lineSpace,"selectstart",function(a){Uc(b,a)||Zf(a)}),t||dg(b.scroller,"contextmenu",function(b){wd(a,b)}),dg(b.scroller,"scroll",function(){b.scroller.clientHeight&&(fd(a,b.scroller.scrollTop),gd(a,b.scroller.scrollLeft,!0),fg(a,"scroll",a))}),dg(b.scrollbarV,"scroll",function(){b.scroller.clientHeight&&fd(a,b.scrollbarV.scrollTop)}),dg(b.scrollbarH,"scroll",function(){b.scroller.clientHeight&&gd(a,b.scrollbarH.scrollLeft)}),dg(b.scroller,"mousewheel",function(b){jd(a,b)}),dg(b.scroller,"DOMMouseScroll",function(b){jd(a,b)}),dg(b.scrollbarH,"mousedown",c),dg(b.scrollbarV,"mousedown",c),dg(b.wrapper,"scroll",function(){b.wrapper.scrollTop=b.wrapper.scrollLeft=0}),dg(b.input,"keyup",zc(a,sd)),dg(b.input,"input",function(){d&&e>=9&&a.display.inputHasSelection&&(a.display.inputHasSelection=null),Mc(a)}),dg(b.input,"keydown",zc(a,qd)),dg(b.input,"keypress",zc(a,td)),dg(b.input,"focus",Eg(ud,a)),dg(b.input,"blur",Eg(vd,a)),a.options.dragDrop&&(dg(b.scroller,"dragstart",function(b){ed(a,b)}),dg(b.scroller,"dragenter",g),dg(b.scroller,"dragover",g),dg(b.scroller,"drop",zc(a,dd))),dg(b.scroller,"paste",function(c){Uc(b,c)||(a.state.pasteIncoming=!0,Pc(a),Mc(a))}),dg(b.input,"paste",function(){if(f&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var c=b.input.selectionStart,d=b.input.selectionEnd;b.input.value+="$",b.input.selectionStart=c,b.input.selectionEnd=d,a.state.fakedLastChar=!0}a.state.pasteIncoming=!0,Mc(a)}),dg(b.input,"cut",h),dg(b.input,"copy",h),k&&dg(b.sizer,"mouseup",function(){Qg()==b.input&&b.input.blur(),Pc(a)})}function Tc(a){var b=a.display;b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,a.setSize()}function Uc(a,b){for(var c=bg(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Vc(a,b,c,d){var e=a.display;if(!c){var f=bg(b);if(f==e.scrollbarH||f==e.scrollbarV||f==e.scrollbarFiller||f==e.gutterFiller)return null}var g,h,i=e.lineSpace.getBoundingClientRect();try{g=b.clientX-i.left,h=b.clientY-i.top}catch(b){return null}var k,j=qc(a,g,h);if(d&&1==j.xRel&&(k=Cf(a.doc,j.line).text).length==j.ch){var l=ug(k,k.length,a.options.tabSize)-k.length;j=mb(j.line,Math.max(0,Math.round((g-Xb(a.display).left)/uc(a.display))-l))}return j}function Wc(a){if(!kg(this,a)){var b=this,c=b.display;if(c.shift=a.shiftKey,Uc(c,a))return f||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)),void 0;if(!bd(b,a)){var d=Vc(b,a);switch(window.focus(),cg(a)){case 1:d?Zc(b,a,d):bg(a)==c.scroller&&Zf(a);break;case 2:f&&(b.state.lastMiddleDown=+new Date),d&&Bb(b.doc,d),setTimeout(Eg(Pc,b),20),Zf(a);break;case 3:t&&wd(b,a)}}}}function Zc(a,b,c){setTimeout(Eg(Qc,a),0);var e,d=+new Date;Yc&&Yc.time>d-400&&0==nb(Yc.pos,c)?e="triple":Xc&&Xc.time>d-400&&0==nb(Xc.pos,c)?(e="double",Yc={time:d,pos:c}):(e="single",Xc={time:d,pos:c});var f=a.doc.sel,g=p?b.metaKey:b.ctrlKey;a.options.dragDrop&&Zg&&!Rc(a)&&"single"==e&&f.contains(c)>-1&&f.somethingSelected()?$c(a,b,c,g):_c(a,b,c,e,g)}function $c(a,b,c,g){var h=a.display,i=zc(a,function(j){f&&(h.scroller.draggable=!1),a.state.draggingText=!1,eg(document,"mouseup",i),eg(h.scroller,"drop",i),Math.abs(b.clientX-j.clientX)+Math.abs(b.clientY-j.clientY)<10&&(Zf(j),g||Bb(a.doc,c),Pc(a),d&&9==e&&setTimeout(function(){document.body.focus(),Pc(a)},20))});f&&(h.scroller.draggable=!0),a.state.draggingText=i,h.scroller.dragDrop&&h.scroller.dragDrop(),dg(document,"mouseup",i),dg(h.scroller,"drop",i)}function _c(a,b,c,d,e){function n(b){if(0!=nb(m,b))if(m=b,"rect"==d){for(var e=[],f=a.options.tabSize,k=ug(Cf(g,c.line).text,c.ch,f),l=ug(Cf(g,b.line).text,b.ch,f),n=Math.min(k,l),o=Math.max(k,l),p=Math.min(c.line,b.line),q=Math.min(a.lastLine(),Math.max(c.line,b.line));q>=p;p++){var r=Cf(g,p).text,s=vg(r,n,f);n==o?e.push(new sb(mb(p,s),mb(p,s))):r.length>s&&e.push(new sb(mb(p,s),mb(p,vg(r,o,f))))}e.length||e.push(new sb(c,c)),Hb(g,tb(j.ranges.slice(0,i).concat(e),i),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=h,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=Xd(a,b);else var w=new sb(mb(b.line,0),wb(g,mb(b.line+1,0)));nb(w.anchor,u)>0?(v=w.head,u=qb(t.from(),w.anchor)):(v=w.anchor,u=pb(t.to(),w.head))}var e=j.ranges.slice(0);e[i]=new sb(wb(g,u),v),Hb(g,tb(e,i),rg)}}function q(b){var c=++p,e=Vc(a,b,!0,"rect"==d);if(e)if(0!=nb(e,m)){Qc(a),n(e);var h=O(f,g);(e.line>=h.to||e.lineo.bottom?20:0;i&&setTimeout(zc(a,function(){p==c&&(f.scroller.scrollTop+=i,q(b))}),50)}}function r(b){p=1/0,Zf(b),Pc(a),eg(document,"mousemove",s),eg(document,"mouseup",t),g.history.lastSelOrigin=null}var f=a.display,g=a.doc;Zf(b);var h,i,j=g.sel;if(e&&!b.shiftKey?(i=g.sel.contains(c),h=i>-1?g.sel.ranges[i]:new sb(c,c)):h=g.sel.primary(),b.altKey)d="rect",e||(h=new sb(c,c)),c=Vc(a,b,!0,!0),i=-1;else if("double"==d){var k=Xd(a,c);h=a.display.shift||g.extend?Ab(g,h,k.anchor,k.head):k}else if("triple"==d){var l=new sb(mb(c.line,0),wb(g,mb(c.line+1,0)));h=a.display.shift||g.extend?Ab(g,h,l.anchor,l.head):l}else h=Ab(g,h,c);e?i>-1?Db(g,i,h,rg):(i=g.sel.ranges.length,Hb(g,tb(g.sel.ranges.concat([h]),i),{scroll:!1,origin:"*mouse"})):(i=0,Hb(g,new rb([h],0),rg),j=g.sel);var m=c,o=f.wrapper.getBoundingClientRect(),p=0,s=zc(a,function(a){cg(a)?q(a):r(a)}),t=zc(a,r);dg(document,"mousemove",s),dg(document,"mouseup",t)}function ad(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Zf(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!mg(a,c))return _f(b);g-=i.top-h.viewOffset;for(var j=0;j=f){var l=Hf(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),_f(b)}}}function bd(a,b){return ad(a,b,"gutterClick",!0,ig)}function dd(a){var b=this;if(!kg(b,a)&&!Uc(b.display,a)){Zf(a),d&&(cd=+new Date);var c=Vc(b,a,!0),e=a.dataTransfer.files;if(c&&!Rc(b))if(e&&e.length&&window.FileReader&&window.File)for(var f=e.length,g=Array(f),h=0,i=function(a,d){var e=new FileReader;e.onload=zc(b,function(){if(g[d]=e.result,++h==f){c=wb(b.doc,c);var a={from:c,to:c,text:eh(g.join("\n")),origin:"paste"};Ed(b.doc,a),Gb(b.doc,ub(c,yd(a)))}}),e.readAsText(a)},j=0;f>j;++j)i(e[j],j);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),setTimeout(Eg(Pc,b),20),void 0;try{var g=a.dataTransfer.getData("Text");if(g){if(b.state.draggingText&&!(p?a.metaKey:a.ctrlKey))var k=b.listSelections();if(Ib(b.doc,ub(c,c)),k)for(var j=0;jh.clientWidth||e&&h.scrollHeight>h.clientHeight){if(e&&p&&f)a:for(var j=c.target,k=g.view;j!=h;j=j.parentNode)for(var l=0;lm?n=Math.max(0,n+m-50):o=Math.min(b.doc.height,o+m+50),T(b,{top:n,bottom:o})}20>hd&&(null==g.wheelStartX?(g.wheelStartX=h.scrollLeft,g.wheelStartY=h.scrollTop,g.wheelDX=d,g.wheelDY=e,setTimeout(function(){if(null!=g.wheelStartX){var a=h.scrollLeft-g.wheelStartX,b=h.scrollTop-g.wheelStartY,c=b&&g.wheelDY&&b/g.wheelDY||a&&g.wheelDX&&a/g.wheelDX;g.wheelStartX=g.wheelStartY=null,c&&(id=(id*hd+c)/(hd+1),++hd)}},200)):(g.wheelDX+=d,g.wheelDY+=e))}}function kd(a,b,c){if("string"==typeof b&&(b=he[b],!b))return!1;a.display.pollingFast&&Nc(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{Rc(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=pg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function ld(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function nd(a,b){var c=je(a.options.keyMap),d=c.auto;clearTimeout(md),d&&!le(b)&&(md=setTimeout(function(){je(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,D(a))},50));var e=me(b,!0),f=!1;if(!e)return!1;var g=ld(a);return f=b.shiftKey?ke("Shift-"+e,g,function(b){return kd(a,b,!0)})||ke(e,g,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?kd(a,b):void 0}):ke(e,g,function(b){return kd(a,b)}),f&&(Zf(b),Qb(a),ig(a,"keyHandled",a,e,b)),f}function od(a,b,c){var d=ke("'"+c+"'",ld(a),function(b){return kd(a,b,!0)});return d&&(Zf(b),Qb(a),ig(a,"keyHandled",a,"'"+c+"'",b)),d}function qd(a){var b=this;if(Qc(b),!kg(b,a)){d&&11>e&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var f=nd(b,a);i&&(pd=f?c:null,!f&&88==c&&!gh&&(p?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||rd(b)}}function rd(a){function c(a){18!=a.keyCode&&a.altKey||(Sg(b,"CodeMirror-crosshair"),eg(document,"keyup",c),eg(document,"mouseover",c))}var b=a.display.lineDiv;Tg(b,"CodeMirror-crosshair"),dg(document,"keyup",c),dg(document,"mouseover",c)}function sd(a){kg(this,a)||16==a.keyCode&&(this.doc.sel.shift=!1)}function td(a){var b=this;if(!(kg(b,a)||a.ctrlKey||p&&a.metaKey)){var c=a.keyCode,f=a.charCode;if(i&&c==pd)return pd=null,Zf(a),void 0;if(!(i&&(!a.which||a.which<10)||k)||!nd(b,a)){var g=String.fromCharCode(null==f?c:f);od(b,a,g)||(d&&e>=9&&(b.display.inputHasSelection=null),Mc(b))}}}function ud(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(fg(a,"focus",a),a.state.focused=!0,Tg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(Oc(a),f&&setTimeout(Eg(Oc,a,!0),0))),Lc(a),Qb(a))}function vd(a){a.state.focused&&(fg(a,"blur",a),a.state.focused=!1,Sg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150)}function wd(a,b){function k(){if(null!=c.input.selectionStart){var b=a.somethingSelected(),d=c.input.value="\u200b"+(b?c.input.value:"");c.prevInput=b?"":"\u200b",c.input.selectionStart=1,c.input.selectionEnd=d.length,c.selForContextMenu=a.doc.sel}}function l(){if(c.inputDiv.style.position="relative",c.input.style.cssText=j,d&&9>e&&(c.scrollbarV.scrollTop=c.scroller.scrollTop=g),Lc(a),null!=c.input.selectionStart){(!d||d&&9>e)&&k();var b=0,f=function(){c.selForContextMenu==a.doc.sel&&0==c.input.selectionStart?zc(a,he.selectAll)(a):b++<10?c.detectingSelectAll=setTimeout(f,500):Oc(a)};c.detectingSelectAll=setTimeout(f,200)}}if(!kg(a,b,"contextmenu")){var c=a.display;if(!Uc(c,b)&&!xd(a,b)){var f=Vc(a,b),g=c.scroller.scrollTop;if(f&&!i){var h=a.options.resetSelectionOnContextMenu;h&&-1==a.doc.sel.contains(f)&&zc(a,Hb)(a.doc,ub(f),qg);var j=c.input.style.cssText;if(c.inputDiv.style.position="absolute",c.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: "+(d?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Pc(a),Oc(a),a.somethingSelected()||(c.input.value=c.prevInput=" "),c.selForContextMenu=a.doc.sel,clearTimeout(c.detectingSelectAll),d&&e>=9&&k(),t){ag(b);var m=function(){eg(window,"mouseup",m),setTimeout(l,20)};dg(window,"mouseup",m)}else setTimeout(l,50)}}}}function xd(a,b){return mg(a,"gutterContextMenu")?ad(a,b,"gutterContextMenu",!1,fg):!1}function zd(a,b){if(nb(a,b.from)<0)return a;if(nb(a,b.to)<=0)return yd(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=yd(b).ch-b.to.ch),mb(c,d)}function Ad(a,b){for(var c=[],d=0;d=0;--e)Fd(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Fd(a,b)}}function Fd(a,b){if(1!=b.text.length||""!=b.text[0]||0!=nb(b.from,b.to)){var c=Ad(a,b);Of(a,b,c,a.cm?a.cm.curOp.id:0/0),Id(a,b,c,Ce(a,b));var d=[];Af(a,function(a,c){c||-1!=Ag(d,a.history)||(Yf(a.history,b),d.push(a.history)),Id(a,b,null,Ce(a,b))})}}function Gd(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var e,d=a.history,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,i=0;i=0;--i){var l=e.changes[i];if(l.origin=b,k&&!Dd(a,l,!1))return g.length=0,void 0;j.push(Lf(a,l));var m=i?Ad(a,l,null):yg(g);Id(a,l,m,Ee(a,l)),!i&&a.cm&&a.cm.scrollIntoView(l);var n=[];Af(a,function(a,b){b||-1!=Ag(n,a.history)||(Yf(a.history,l),n.push(a.history)),Id(a,l,null,Ee(a,l))})}}}}function Hd(a,b){if(0!=b&&(a.first+=b,a.sel=new rb(Bg(a.sel.ranges,function(a){return new sb(mb(a.anchor.line+b,a.anchor.ch),mb(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Ec(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;da.lastLine())){if(b.from.linef&&(b={from:b.from,to:mb(f,Cf(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Df(a,b.from,b.to),c||(c=Ad(a,b,null)),a.cm?Jd(a.cm,b,d):tf(a,b,d),Ib(a,c,qg)}}function Jd(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=Gf(Pe(Cf(d,f.line))),d.iter(i,g.line+1,function(a){return a==e.maxLine?(h=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&lg(a),tf(d,b,c,B(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,function(a){var b=I(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,f.line),Rb(a,400);var j=b.text.length-(g.line-f.line)-1;f.line!=g.line||1!=b.text.length||sf(a.doc,b)?Ec(a,f.line,g.line+1,j):Fc(a,f.line,"text");var k=mg(a,"changes"),l=mg(a,"change");if(l||k){var m={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin};l&&ig(a,"change",a,m),k&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(m)}a.display.selForContextMenu=null}function Kd(a,b,c,d,e){if(d||(d=c),nb(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=eh(b)),Ed(a,{from:c,to:d,text:b,origin:e})}function Ld(a,b){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!m){var f=Lg("div","\u200b",null,"position: absolute; top: "+(b.top-c.viewOffset-Vb(a.display))+"px; height: "+(b.bottom-b.top+og)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}function Md(a,b,c,d){for(null==d&&(d=0);;){var e=!1,f=nc(a,b),g=c&&c!=b?nc(a,c):f,h=Od(a,Math.min(f.left,g.left),Math.min(f.top,g.top)-d,Math.max(f.left,g.left),Math.max(f.bottom,g.bottom)+d),i=a.doc.scrollTop,j=a.doc.scrollLeft;if(null!=h.scrollTop&&(fd(a,h.scrollTop),Math.abs(a.doc.scrollTop-i)>1&&(e=!0)),null!=h.scrollLeft&&(gd(a,h.scrollLeft),Math.abs(a.doc.scrollLeft-j)>1&&(e=!0)),!e)return f}}function Nd(a,b,c,d,e){var f=Od(a,b,c,d,e);null!=f.scrollTop&&fd(a,f.scrollTop),null!=f.scrollLeft&&gd(a,f.scrollLeft)}function Od(a,b,c,d,e){var f=a.display,g=tc(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=f.scroller.clientHeight-og,j={},k=a.doc.height+Wb(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=f.scroller.clientWidth-og;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return o+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>p+o-3&&(j.scrollLeft=d+10-p),j}function Pd(a,b,c){(null!=b||null!=c)&&Rd(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Qd(a){Rd(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?mb(b.line,b.ch-1):b,d=mb(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Rd(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=oc(a,b.from),d=oc(a,b.to),e=Od(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Sd(a,b,c,d){var f,e=a.doc;null==c&&(c="add"),"smart"==c&&(a.doc.mode.indent?f=Ub(a,b):c="prev");var g=a.options.tabSize,h=Cf(e,b),i=ug(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var k,j=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==pg)){if(!d)return;c="prev"}}else k=0,c="not";"prev"==c?k=b>e.first?ug(Cf(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c?k=i-a.options.indentUnit:"number"==typeof c&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";if(k>m&&(l+=xg(k-m)),l!=j)Kd(a.doc,l,mb(b,0),mb(b,j.length),"+input");else for(var n=0;n=0;b--)Kd(a.doc,"",d[b].from,d[b].to,"+delete");Qd(a)})}function Vd(a,b,c,d,e){function k(){var b=f+c;return b=a.first+a.size?j=!1:(f=b,i=Cf(a,b))}function l(a){var b=(e?th:uh)(i,g,c,!0);if(null==b){if(a||!k())return j=!1;g=e?(0>c?mh:lh)(i):0>c?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=Cf(a,f),j=!0;if("char"==d)l();else if("column"==d)l(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||l(!p);p=!1){var q=i.text.charAt(g)||"\n",r=Hg(q,o)?"w":n&&"\n"==q?"n":!n||/\s/.test(q)?null:"p";if(!n||p||r||(r="s"),m&&m!=r){0>c&&(c=1,l());break}if(r&&(m=r),c>0&&!l(!p))break}var s=Mb(a,mb(f,g),h,!0);return j||(s.hitSide=!0),s}function Wd(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*tc(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=qc(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function Xd(a,b){var c=a.doc,d=Cf(c,b.line).text,e=b.ch,f=b.ch;if(d){var g=a.getHelper(b,"wordChars");(b.xRel<0||f==d.length)&&e?--e:++f;for(var h=d.charAt(e),i=Hg(h,g)?function(a){return Hg(a,g)}:/\s/.test(h)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Hg(a)};e>0&&i(d.charAt(e-1));)--e;for(;f0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Lg("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.widgetNode.ignoreEvents=!0),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(Oe(a,b.line,b,c,f)||b.line!=c.line&&Oe(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");v=!0}f.addToHistory&&Of(a,{from:b,to:c,origin:"markText"},a.sel,0/0);var j,h=b.line,i=a.cm;if(a.iter(h,c.line+1,function(a){i&&f.collapsed&&!i.options.lineWrapping&&Pe(a)==i.display.maxLine&&(j=!0),f.collapsed&&h!=b.line&&Ff(a,0),ze(a,new we(f,h==b.line?b.ch:null,h==c.line?c.ch:null)),++h}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Te(a,b)&&Ff(b,0)}),f.clearOnEnter&&dg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(u=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++pe,f.atomic=!0),i){if(j&&(i.curOp.updateMaxLine=!0),f.collapsed)Ec(i,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle)for(var k=b.line;k<=c.line;k++)Fc(i,k,"text");f.atomic&&Kb(i.doc),ig(i,"markerAdded",i,f)}return f}function se(a,b,c,d,e){d=Dg(d),d.shared=!1;var f=[qe(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Af(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(qe(a,wb(a,b),wb(a,c),d,e));for(var i=0;i=b:f.to>b);(e||(e=[])).push(new we(g,f.from,i?null:f.to))}}return e}function Be(a,b,c){if(a)for(var e,d=0;d=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;ll;++l)o.push(q);o.push(i)}return o}function De(a){for(var b=0;b0)){var k=[i,1],l=nb(j.from,h.from),m=nb(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function Ge(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(nb(j.to,c)||Je(i.marker)-Ie(e))>0||k>=0&&(nb(j.from,d)||Ie(i.marker)-Je(e))<0))return!0}}}function Pe(a){for(var b;b=Me(a);)a=b.find(-1,!0).line;return a}function Qe(a){for(var b,c;b=Ne(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function Re(a,b){var c=Cf(a,b),d=Pe(c);return c==d?b:Gf(d)}function Se(a,b){if(b>a.lastLine())return b;var d,c=Cf(a,b);if(!Te(a,c))return b;for(;d=Ne(c);)c=d.find(1,!0).line;return Gf(c)+1}function Te(a,b){var c=v&&b.markedSpans;if(c)for(var d,e=0;ed;d++){var e=a.token(b,c);if(b.pos>b.start)return e}throw new Error("Mode "+a.name+" failed to advance stream.")}function df(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var l,i=0,j=null,k=new ne(b,a.options.tabSize);for(""==b&&af(bf(c,d),f);!k.eol();){if(k.pos>a.options.maxHighlightLength?(h=!1,g&&gf(a,b,d,k.pos),k.pos=b.length,l=null):l=af(cf(c,k,d),f),a.options.addModeClass){var m=w.innerMode(c,d).mode.name;m&&(l="m-"+(l?m+" "+l:m))}h&&j==l||(ij;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function ff(a,b){if(!b.styles||b.styles[0]!=a.state.modeGen){var c=ef(a,b,b.stateAfter=Ub(a,Gf(b)));b.styles=c.styles,c.classes?b.styleClasses=c.classes:b.styleClasses&&(b.styleClasses=null)}return b.styles}function gf(a,b,c,d){var e=a.doc.mode,f=new ne(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&bf(e,c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)cf(e,f,c),f.start=f.pos}function kf(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?jf:hf;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function lf(a,b){var c=Lg("span",null,null,f?"padding-right: .1px":null),e={pre:Lg("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var g=0;g<=(b.rest?b.rest.length:0);g++){var i,h=g?b.rest[g-1]:b.line;e.pos=0,e.addToken=nf,(d||f)&&a.getOption("lineWrapping")&&(e.addToken=of(e.addToken)),dh(a.display.measure)&&(i=Jf(h))&&(e.addToken=pf(e.addToken,i)),e.map=[],rf(h,e,ff(a,h)),h.styleClasses&&(h.styleClasses.bgClass&&(e.bgClass=Ug(h.styleClasses.bgClass,e.bgClass||"")),h.styleClasses.textClass&&(e.textClass=Ug(h.styleClasses.textClass,e.textClass||""))),0==e.map.length&&e.map.push(0,0,e.content.appendChild(bh(a.display.measure))),0==g?(b.measure.map=e.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(e.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return fg(a,"renderLine",a,b.line,e.pre),e.pre.className&&(e.textClass=Ug(e.pre.className,e.textClass||"")),e}function mf(a){var b=Lg("span","\u2022","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b}function nf(a,b,c,f,g,h){if(b){var i=a.cm.options.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(b.slice(l,l+n));d&&9>e?k.appendChild(Lg("span",[o])):k.appendChild(o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Lg("span",xg(q),"cm-tab"));a.col+=q}else{var o=a.cm.options.specialCharPlaceholder(m[0]);d&&9>e?k.appendChild(Lg("span",[o])):k.appendChild(o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,k),d&&9>e&&(j=!0),a.pos+=b.length}if(c||f||g||j){var r=c||"";f&&(r+=f),g&&(r+=g);var s=Lg("span",[k],r);return h&&(s.title=h),a.content.appendChild(s)}a.content.appendChild(k)}}function of(a){function b(a){for(var b=" ",c=0;ci&&l.from<=i)break}if(l.to>=j)return a(c,d,e,f,g,h);a(c,d.slice(0,l.to-i),e,f,null,h),f=null,d=d.slice(l.to-i),i=l.to}}}function qf(a,b,c,d){var e=!d&&c.widgetNode;e&&(a.map.push(a.pos,a.pos+b,e),a.content.appendChild(e)),a.pos+=b}function rf(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var k,m,n,o,p,q,h=e.length,i=0,g=1,j="",l=0;;){if(l==i){m=n=o=p="",q=null,l=1/0;for(var r=[],s=0;si)?(null!=t.to&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||Ke(q.marker,u)<0)&&(q=t)):t.from>i&&l>t.from&&(l=t.from),"bookmark"==u.type&&t.from==i&&u.widgetNode&&r.push(u)}if(q&&(q.from||0)==i&&(qf(b,(null==q.to?h+1:q.to)-i,q.marker,null==q.from),null==q.to))return;if(!q&&r.length)for(var s=0;s=h)break;for(var v=Math.min(h,l);;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=kf(c[g++],b.cm.options)}}else for(var g=1;g1&&a.remove(g.line+1,n-1),a.insert(g.line+1,p)}ig(a,"change",a,b)}function uf(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function Df(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Ef(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function Ff(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function Gf(a){if(null==a.parent)return null;for(var b=a.parent,c=Ag(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function Hf(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function If(a){a=Pe(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),yg(a.done)):void 0}function Of(a,b,c,d){var e=a.history;e.undone.length=0;var g,f=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(g=Nf(e,e.lastOp==d))){var h=yg(g.changes);0==nb(b.from,b.to)&&0==nb(b.from,h.to)?h.to=yd(b):g.changes.push(Lf(a,b))}else{var i=yg(e.done);for(i&&i.ranges||Rf(a.sel,e.done),g={changes:[Lf(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=f,e.lastOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||fg(a,"historyAdded")}function Pf(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function Qf(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||Pf(a,f,yg(e.done),b))?e.done[e.done.length-1]=b:Rf(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastOp=c,d&&d.clearRedo!==!1&&Mf(e.undone)}function Rf(a,b){var c=yg(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Sf(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function Tf(a){if(!a)return null;for(var c,b=0;b-1&&(yg(h)[l]=j[l],delete j[l])}}}return e}function Wf(a,b,c,d){c0}function ng(a){a.prototype.on=function(a,b){dg(this,a,b)},a.prototype.off=function(a,b){eg(this,a,b)}}function tg(){this.id=null}function vg(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function xg(a){for(;wg.length<=a;)wg.push(yg(wg)+" ");return wg[a]}function yg(a){return a[a.length-1]}function Ag(a,b){for(var c=0;c-1&&Gg(a)?!0:b.test(a):Gg(a)}function Ig(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Kg(a){return a.charCodeAt(0)>=768&&Jg.test(a)}function Lg(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild);return a}function Og(a,b){return Ng(a).appendChild(b)}function Pg(a,b){if(a.contains)return a.contains(b);for(;b=b.parentNode;)if(b==a)return!0}function Qg(){return document.activeElement}function Rg(a){return new RegExp("\\b"+a+"\\b\\s*")}function Sg(a,b){var c=Rg(b);c.test(a.className)&&(a.className=a.className.replace(c,""))}function Tg(a,b){Rg(b).test(a.className)||(a.className+=" "+b)}function Ug(a,b){for(var c=a.split(" "),d=0;d2&&d&&8>e)}return ah?Lg("span","\u200b"):Lg("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function dh(a){if(null!=ch)return ch;var b=Og(a,document.createTextNode("A\u062eA")),c=Mg(b,0,1).getBoundingClientRect();if(c.left==c.right)return!1;var d=Mg(b,1,2).getBoundingClientRect();return ch=d.right-c.right<3}function ih(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;fb||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function jh(a){return a.level%2?a.to:a.from}function kh(a){return a.level%2?a.from:a.to}function lh(a){var b=Jf(a);return b?jh(b[0]):0}function mh(a){var b=Jf(a);return b?kh(yg(b)):a.text.length}function nh(a,b){var c=Cf(a.doc,b),d=Pe(c);d!=c&&(b=Gf(d));var e=Jf(d),f=e?e[0].level%2?mh(d):lh(d):0;return mb(b,f)}function oh(a,b){for(var c,d=Cf(a.doc,b);c=Ne(d);)d=c.find(1,!0).line,b=null;var e=Jf(d),f=e?e[0].level%2?lh(d):mh(d):d.text.length;return mb(null==b?Gf(d):b,f)}function ph(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function rh(a,b){qh=null;for(var d,c=0;cb)return c;if(e.from==b||e.to==b){if(null!=d)return ph(a,e.level,a[d].level)?(e.from!=e.to&&(qh=d),c):(e.from!=e.to&&(qh=c),d);d=c}}return d}function sh(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Kg(a.text.charAt(b)));return b}function th(a,b,c,d){var e=Jf(a);if(!e)return uh(a,b,c,d);for(var f=rh(e,b),g=e[f],h=sh(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?sh(a,g.to,-1,d):sh(a,g.from,1,d)}}function uh(a,b,c,d){var e=b+c;if(d)for(;e>0&&Kg(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),d=b||c,e=d&&(b?document.documentMode||6:c[1]),f=/WebKit\//.test(navigator.userAgent),g=f&&/Qt\/\d+\.\d+/.test(navigator.userAgent),h=/Chrome\//.test(navigator.userAgent),i=/Opera\//.test(navigator.userAgent),j=/Apple Computer/.test(navigator.vendor),k=/KHTML\//.test(navigator.userAgent),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),m=/PhantomJS/.test(navigator.userAgent),n=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),o=n||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),p=n||/Mac/.test(navigator.platform),q=/win/i.test(navigator.platform),r=i&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);r&&(r=Number(r[1])),r&&r>=15&&(i=!1,f=!0);var s=p&&(g||i&&(null==r||12.11>r)),t=a||d&&e>=9,u=!1,v=!1,mb=w.Pos=function(a,b){return this instanceof mb?(this.line=a,this.ch=b,void 0):new mb(a,b)},nb=w.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch};rb.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&nb(a,d.to())<=0)return c}return-1}},sb.prototype={from:function(){return qb(this.anchor,this.head)},to:function(){return pb(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var sc,Xc,Yc,dc={left:0,right:0,top:0,bottom:0},vc=0,cd=0,hd=0,id=null;d?id=-.53:a?id=15:h?id=-.7:j&&(id=-1/3);var md,pd=null,yd=w.changeEnd=function(a){return a.text?mb(a.from.line+a.text.length-1,yg(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};w.prototype={constructor:w,focus:function(){window.focus(),Pc(this),Mc(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Zd.hasOwnProperty(a)&&zc(this,Zd[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(Sd(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Qd(this));else{var f=Math.max(c,e.from().line),g=e.to();c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var h=f;c>h;++h)Sd(this,h,a)}}}),getTokenAt:function(a,b){var c=this.doc;a=wb(c,a);for(var d=Ub(this,a.line,b),e=this.doc.mode,f=Cf(c,a.line),g=new ne(f.text,this.options.tabSize);g.pos>1;if((g?b[2*g-1]:0)>=e)d=g;else{if(!(b[2*g+1]h?f:0==h?null:f.slice(0,h-1)},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?w.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!ee.hasOwnProperty(b))return ee;var d=ee[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;fd&&(a=d,c=!0);var e=Cf(this.doc,a);return kc(this,e,{top:0,left:0},b||"page").top+(c?this.doc.height-If(e):0)},defaultTextHeight:function(){return tc(this.display)},defaultCharWidth:function(){return uc(this.display)},setGutterMarker:Ac(function(a,b,c){return Td(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Ig(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Ac(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Fc(b,d,"gutter"),Ig(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineWidget:Ac(function(a,b,c){return Ye(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!yb(this.doc,a))return null;var b=a;if(a=Cf(this.doc,a),!a)return null}else{var b=Gf(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=nc(this,wb(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Nd(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Ac(qd),triggerOnKeyPress:Ac(td),triggerOnKeyUp:Ac(sd),execCommand:function(a){return he.hasOwnProperty(a)?he[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=wb(this.doc,a);b>f&&(g=Vd(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Ac(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Vd(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},sg)}),deleteH:Ac(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Ud(this,function(c){var e=Vd(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=wb(this.doc,a);b>g;++g){var i=nc(this,h,"div");if(null==f?f=i.left:i.left=f,h=Wd(this,i,e,c),h.hitSide)break}return h},moveV:Ac(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=nc(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Wd(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Pd(c,null,mc(c,i,"div").top-h.top),i},sg),e.length)for(var g=0;g.5)&&C(this),fg(this,"refresh",this)}),swapDoc:Ac(function(a){var b=this.doc;return b.cm=null,Bf(this,a),hc(this),Oc(this),this.scrollTo(a.scrollLeft,a.scrollTop),ig(this,"swapDoc",this,b),b +}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ng(w);var Yd=w.defaults={},Zd=w.optionHandlers={},_d=w.Init={toString:function(){return"CodeMirror.Init"}};$d("value","",function(a,b){a.setValue(b)},!0),$d("mode",null,function(a,b){a.doc.modeOption=b,y(a)},!0),$d("indentUnit",2,y,!0),$d("indentWithTabs",!1),$d("smartIndent",!0),$d("tabSize",4,function(a){z(a),hc(a),Ec(a)},!0),$d("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),a.refresh()},!0),$d("specialCharPlaceholder",mf,function(a){a.refresh()},!0),$d("electricChars",!0),$d("rtlMoveVisually",!q),$d("wholeLineUpdateBefore",!0),$d("theme","default",function(a){E(a),F(a)},!0),$d("keyMap","default",D),$d("extraKeys",null),$d("lineWrapping",!1,A,!0),$d("gutters",[],function(a){K(a.options),F(a)},!0),$d("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?S(a.display)+"px":"0",a.refresh()},!0),$d("coverGutterNextToScrollbar",!1,N,!0),$d("lineNumbers",!1,function(a){K(a.options),F(a)},!0),$d("firstLineNumber",1,F,!0),$d("lineNumberFormatter",function(a){return a},F,!0),$d("showCursorWhenSelecting",!1,Nb,!0),$d("resetSelectionOnContextMenu",!0),$d("readOnly",!1,function(a,b){"nocursor"==b?(vd(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||Oc(a))}),$d("disableInput",!1,function(a,b){b||Oc(a)},!0),$d("dragDrop",!0),$d("cursorBlinkRate",530),$d("cursorScrollMargin",0),$d("cursorHeight",1,Nb,!0),$d("singleCursorHeightPerLine",!0,Nb,!0),$d("workTime",100),$d("workDelay",100),$d("flattenSpans",!0,z,!0),$d("addModeClass",!1,z,!0),$d("pollInterval",100),$d("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),$d("historyEventDelay",1250),$d("viewportMargin",10,function(a){a.refresh()},!0),$d("maxHighlightLength",1e4,z,!0),$d("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),$d("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),$d("autofocus",null);var ae=w.modes={},be=w.mimeModes={};w.defineMode=function(a,b){if(w.defaults.mode||"null"==a||(w.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;c0)e=new mb(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),mb(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Cf(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+"\n"+g.charAt(g.length-1),mb(e.line-1,g.length-1),mb(e.line,1),"+transpose")}c.push(new sb(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){yc(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),Qd(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},ie=w.keyMap={};ie.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"},ie.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","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"},ie.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","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":"delLineLeft","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]},ie.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"},ie["default"]=p?ie.macDefault:ie.pcDefault;var ke=w.lookupKey=function(a,b,c){function d(b){b=je(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0;g=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var oe=w.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a};ng(oe),oe.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&wc(a),mg(this,"clear")){var c=this.find();c&&ig(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Ec(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Kb(a.doc)),a&&ig(a,"markerCleared",a,this),b&&xc(a),this.parent&&this.parent.clear()}},oe.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;ec;++c){var e=this.lines[c];this.height-=e.height,_e(e),ig(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},vf.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof uf))){var h=[];this.collapse(h),this.children=[new uf(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new uf(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new vf(b);if(a.parent){a.size-=c.size,a.height-=c.height;var e=Ag(a.parent.children,a);a.parent.children.splice(e+1,0,c)}else{var d=new vf(a.children);d.parent=a,a.children=[d,c],a=d}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var wf=0,xf=w.Doc=function(a,b,c){if(!(this instanceof xf))return new xf(a,b,c);null==c&&(c=0),vf.call(this,[new uf([new Ze("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=mb(c,0);this.sel=ub(d),this.history=new Kf(null),this.id=++wf,this.modeOption=b,"string"==typeof a&&(a=eh(a)),tf(this,{from:d,to:d,text:a}),Hb(this,ub(d),qg)};xf.prototype=Cg(vf.prototype,{constructor:xf,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)Ed(this,d[f]);h?Gb(this,h):this.cm&&Qd(this.cm)}),undo:Bc(function(){Gd(this,"undo")}),redo:Bc(function(){Gd(this,"redo")}),undoSelection:Bc(function(){Gd(this,"undo",!0)}),redoSelection:Bc(function(){Gd(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=wb(this,a),b=wb(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;hi.to||null==i.from&&e!=a.line||e==b.line&&i.from>b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=e,++c,void 0)}),wb(this,mb(c,b))},indexFromPos:function(a){a=wb(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},wg=[""],zg=function(a){a.select()};n?zg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:d&&(zg=function(a){try{a.select()}catch(b){}}),[].indexOf&&(Ag=function(a,b){return a.indexOf(b)}),[].map&&(Bg=function(a,b){return a.map(b)});var Mg,Fg=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Gg=w.isWordChar=function(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||Fg.test(a))},Jg=/[\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]/;Mg=document.createRange?function(a,b,c){var d=document.createRange();return d.setEnd(a,c),d.setStart(a,b),d}:function(a,b,c){var d=document.body.createTextRange();return d.moveToElementText(a.parentNode),d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d},d&&11>e&&(Qg=function(){try{return document.activeElement}catch(a){return document.body}});var $g,ah,ch,Wg=!1,Zg=function(){if(d&&9>e)return!1;var a=Lg("div");return"draggable"in a||"dragDrop"in a}(),eh=w.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},fh=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},gh=function(){var a=Lg("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),hh={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};w.keyNames=hh,function(){for(var a=0;10>a;a++)hh[a+48]=hh[a+96]=String(a);for(var a=65;90>=a;a++)hh[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)hh[a+111]=hh[a+63235]="F"+a}();var qh,vh=function(){function c(c){return 247>=c?a.charAt(c):c>=1424&&1524>=c?"R":c>=1536&&1773>=c?b.charAt(c-1536):c>=1774&&2220>=c?"r":c>=8192&&8203>=c?"w":8204==c?"b":"L"}function j(a,b,c){this.level=a,this.from=b,this.to=c}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L"; +return function(a){if(!d.test(a))return!1;for(var m,b=a.length,k=[],l=0;b>l;++l)k.push(m=c(a.charCodeAt(l)));for(var l=0,n=i;b>l;++l){var m=k[l];"m"==m?k[l]=n:n=m}for(var l=0,o=i;b>l;++l){var m=k[l];"1"==m&&"r"==o?k[l]="n":f.test(m)&&(o=m,"r"==m&&(k[l]="R"))}for(var l=1,n=k[0];b-1>l;++l){var m=k[l];"+"==m&&"1"==n&&"1"==k[l+1]?k[l]="1":","!=m||n!=k[l+1]||"1"!=n&&"n"!=n||(k[l]=n),n=m}for(var l=0;b>l;++l){var m=k[l];if(","==m)k[l]="N";else if("%"==m){for(var p=l+1;b>p&&"%"==k[p];++p);for(var q=l&&"!"==k[l-1]||b>p&&"1"==k[p]?"1":"N",r=l;p>r;++r)k[r]=q;l=p-1}}for(var l=0,o=i;b>l;++l){var m=k[l];"L"==o&&"1"==m?k[l]="L":f.test(m)&&(o=m)}for(var l=0;b>l;++l)if(e.test(k[l])){for(var p=l+1;b>p&&e.test(k[p]);++p);for(var s="L"==(l?k[l-1]:i),t="L"==(b>p?k[p]:i),q=s||t?"L":"R",r=l;p>r;++r)k[r]=q;l=p-1}for(var v,u=[],l=0;b>l;)if(g.test(k[l])){var w=l;for(++l;b>l&&g.test(k[l]);++l);u.push(new j(0,w,l))}else{var x=l,y=u.length;for(++l;b>l&&"L"!=k[l];++l);for(var r=x;l>r;)if(h.test(k[r])){r>x&&u.splice(y,0,new j(1,x,r));var z=r;for(++r;l>r&&h.test(k[r]);++r);u.splice(y,0,new j(2,z,r)),x=r}else++r;l>x&&u.splice(y,0,new j(1,x,l))}return 1==u[0].level&&(v=a.match(/^\s+/))&&(u[0].from=v[0].length,u.unshift(new j(0,0,v[0].length))),1==yg(u).level&&(v=a.match(/\s+$/))&&(yg(u).to-=v[0].length,u.push(new j(0,b-v[0].length,b))),u[0].level!=yg(u).level&&u.push(new j(u[0].level,b,b)),u}}();return w.version="4.2.1",w}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("javascript",function(b,c){function l(a){for(var c,b=!1,d=!1;null!=(c=a.next());){if(!b){if("/"==c&&!d)return;"["==c?d=!0:d&&"]"==c&&(d=!1)}b=!b&&"\\"==c}}function o(a,b,c){return m=a,n=c,b}function p(a,b){var c=a.next();if('"'==c||"'"==c)return b.tokenize=q(c),b.tokenize(a,b);if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==c&&a.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return o(c);if("="==c&&a.eat(">"))return o("=>","operator");if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),o("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==c)return a.eat("*")?(b.tokenize=r,r(a,b)):a.eat("/")?(a.skipToEnd(),o("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(l(a),a.eatWhile(/[gimy]/),o("regexp","string-2")):(a.eatWhile(j),o("operator","operator",a.current()));if("`"==c)return b.tokenize=s,s(a,b);if("#"==c)return a.skipToEnd(),o("error","error");if(j.test(c))return a.eatWhile(j),o("operator","operator",a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),e=i.propertyIsEnumerable(d)&&i[d];return e&&"."!=b.lastType?o(e.type,e.style,d):o("variable","variable",d)}function q(a){return function(b,c){var e,d=!1;if(f&&"@"==b.peek()&&b.match(k))return c.tokenize=p,o("jsonld-keyword","meta");for(;null!=(e=b.next())&&(e!=a||d);)d=!d&&"\\"==e;return d||(c.tokenize=p),o("string","string")}}function r(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=p;break}c="*"==d}return o("comment","comment")}function s(a,b){for(var d,c=!1;null!=(d=a.next());){if(!c&&("`"==d||"$"==d&&a.eat("{"))){b.tokenize=p;break}c=!c&&"\\"==d}return o("quasi","string-2",a.current())}function u(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(0>c)){for(var d=0,e=!1,f=c-1;f>=0;--f){var g=a.string.charAt(f),h=t.indexOf(g);if(h>=0&&3>h){if(!d){++f;break}if(0==--d)break}else if(h>=3&&6>h)++d;else if(/[$\w]/.test(g))e=!0;else if(e&&!d){++f;break}}e&&!d&&(b.fatArrowAt=f)}}function w(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function x(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function y(a,b,c,d,e){var f=a.cc;for(z.state=a,z.stream=e,z.marked=null,z.cc=f,z.style=b,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var h=f.length?f.pop():g?K:J;if(h(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return z.marked?z.marked:"variable"==c&&x(a,d)?"variable-2":b}}}function A(){for(var a=arguments.length-1;a>=0;a--)z.cc.push(arguments[a])}function B(){return A.apply(null,arguments),!0}function C(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var d=z.state;if(d.context){if(z.marked="def",b(d.localVars))return;d.localVars={name:a,next:d.localVars}}else{if(b(d.globalVars))return;c.globalVars&&(d.globalVars={name:a,next:d.globalVars})}}function E(){z.state.context={prev:z.state.context,vars:z.state.localVars},z.state.localVars=D}function F(){z.state.localVars=z.state.context.vars,z.state.context=z.state.context.prev}function G(a,b){var c=function(){var c=z.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new w(d,z.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function H(){var a=z.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function I(a){function b(c){return c==a?B():";"==a?A():B(b)}return b}function J(a,b){return"var"==a?B(G("vardef",b.length),db,I(";"),H):"keyword a"==a?B(G("form"),K,J,H):"keyword b"==a?B(G("form"),J,H):"{"==a?B(G("}"),ab,H):";"==a?B():"if"==a?("else"==z.state.lexical.info&&z.state.cc[z.state.cc.length-1]==H&&z.state.cc.pop()(),B(G("form"),K,J,H,ib)):"function"==a?B(ob):"for"==a?B(G("form"),jb,J,H):"variable"==a?B(G("stat"),V):"switch"==a?B(G("form"),K,G("}","switch"),I("{"),ab,H,H):"case"==a?B(K,I(":")):"default"==a?B(I(":")):"catch"==a?B(G("form"),E,I("("),pb,I(")"),J,H,F):"module"==a?B(G("form"),E,ub,F,H):"class"==a?B(G("form"),qb,H):"export"==a?B(G("form"),vb,H):"import"==a?B(G("form"),wb,H):A(G("stat"),K,I(";"),H)}function K(a){return M(a,!1)}function L(a){return M(a,!0)}function M(a,b){if(z.state.fatArrowAt==z.stream.start){var c=b?U:T;if("("==a)return B(E,G(")"),$(eb,")"),H,I("=>"),c,F);if("variable"==a)return A(E,eb,I("=>"),c,F)}var d=b?Q:P;return v.hasOwnProperty(a)?B(d):"function"==a?B(ob,d):"keyword c"==a?B(b?O:N):"("==a?B(G(")"),N,Bb,I(")"),H,d):"operator"==a||"spread"==a?B(b?L:K):"["==a?B(G("]"),zb,H,d):"{"==a?_(X,"}",null,d):"quasi"==a?A(R,d):B()}function N(a){return a.match(/[;\}\)\],]/)?A():A(K)}function O(a){return a.match(/[;\}\)\],]/)?A():A(L)}function P(a,b){return","==a?B(K):Q(a,b,!1)}function Q(a,b,c){var d=0==c?P:Q,e=0==c?K:L;return"=>"==b?B(E,c?U:T,F):"operator"==a?/\+\+|--/.test(b)?B(d):"?"==b?B(K,I(":"),e):B(e):"quasi"==a?A(R,d):";"!=a?"("==a?_(L,")","call",d):"."==a?B(W,d):"["==a?B(G("]"),N,I("]"),H,d):void 0:void 0}function R(a,b){return"quasi"!=a?A():"${"!=b.slice(b.length-2)?B(R):B(K,S)}function S(a){return"}"==a?(z.marked="string-2",z.state.tokenize=s,B(R)):void 0}function T(a){return u(z.stream,z.state),"{"==a?A(J):A(K)}function U(a){return u(z.stream,z.state),"{"==a?A(J):A(L)}function V(a){return":"==a?B(H,J):A(P,I(";"),H)}function W(a){return"variable"==a?(z.marked="property",B()):void 0}function X(a,b){return"variable"==a||"keyword"==z.style?(z.marked="property","get"==b||"set"==b?B(Y):B(Z)):"number"==a||"string"==a?(z.marked=f?"property":z.style+" property",B(Z)):"jsonld-keyword"==a?B(Z):"["==a?B(K,I("]"),Z):void 0}function Y(a){return"variable"!=a?A(Z):(z.marked="property",B(ob))}function Z(a){return":"==a?B(L):"("==a?A(ob):void 0}function $(a,b){function c(d){if(","==d){var e=z.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),B(a,c)}return d==b?B():B(I(b))}return function(d){return d==b?B():A(a,c)}}function _(a,b,c){for(var d=3;d!?|~^]/,k=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,t="([{}])",v={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},z={state:null,column:null,marked:null,cc:null},D={name:"this",next:{name:"arguments"}};return H.lex=!0,{startState:function(a){var b={tokenize:p,lastType:"sof",cc:[],lexical:new w((a||0)-d,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented:0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),u(a,b)),b.tokenize!=r&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==m?c:(b.lastType="operator"!=m||"++"!=n&&"--"!=n?m:"incdec",y(b,c,m,n,a))},indent:function(b,f){if(b.tokenize==r)return a.Pass;if(b.tokenize!=p)return 0;var g=f&&f.charAt(0),h=b.lexical;if(!/^\s*else\b/.test(f))for(var i=b.cc.length-1;i>=0;--i){var j=b.cc[i];if(j==H)h=h.prev;else if(j!=ib)break}"stat"==h.type&&"}"==g&&(h=h.prev),e&&")"==h.type&&"stat"==h.prev.type&&(h=h.prev);var k=h.type,l=g==k;return"vardef"==k?h.indented+("operator"==b.lastType||","==b.lastType?h.info+1:0):"form"==k&&"{"==g?h.indented:"form"==k?h.indented+d:"stat"==k?h.indented+("operator"==b.lastType||","==b.lastType?e||d:0):"switch"!=h.info||l||0==c.doubleIndentSwitch?h.align?h.column+(l?0:1):h.indented+(l?0:d):h.indented+(/^(?:case|default)\b/.test(f)?d:2*d)},electricChars:":{}",blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",lineComment:g?null:"//",fold:"brace",helperType:g?"json":"javascript",jsonldMode:f,jsonMode:g}}),a.registerHelper("wordChars","javascript",/[\\w$]/),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("ntriples",function(){function b(b,c){var e,d=b.location;e=d==a.PRE_SUBJECT&&"<"==c?a.WRITING_SUB_URI:d==a.PRE_SUBJECT&&"_"==c?a.WRITING_BNODE_URI:d==a.PRE_PRED&&"<"==c?a.WRITING_PRED_URI:d==a.PRE_OBJ&&"<"==c?a.WRITING_OBJ_URI:d==a.PRE_OBJ&&"_"==c?a.WRITING_OBJ_BNODE:d==a.PRE_OBJ&&'"'==c?a.WRITING_OBJ_LITERAL:d==a.WRITING_SUB_URI&&">"==c?a.PRE_PRED:d==a.WRITING_BNODE_URI&&" "==c?a.PRE_PRED:d==a.WRITING_PRED_URI&&">"==c?a.PRE_OBJ:d==a.WRITING_OBJ_URI&&">"==c?a.POST_OBJ:d==a.WRITING_OBJ_BNODE&&" "==c?a.POST_OBJ:d==a.WRITING_OBJ_LITERAL&&'"'==c?a.POST_OBJ:d==a.WRITING_LIT_LANG&&" "==c?a.POST_OBJ:d==a.WRITING_LIT_TYPE&&">"==c?a.POST_OBJ:d==a.WRITING_OBJ_LITERAL&&"@"==c?a.WRITING_LIT_LANG:d==a.WRITING_OBJ_LITERAL&&"^"==c?a.WRITING_LIT_TYPE:" "!=c||d!=a.PRE_SUBJECT&&d!=a.PRE_PRED&&d!=a.PRE_OBJ&&d!=a.POST_OBJ?d==a.POST_OBJ&&"."==c?a.PRE_SUBJECT:a.ERROR:d,b.location=e}var a={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:a.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(a,c){var d=a.next();if("<"==d){b(c,d);var e="";return a.eatWhile(function(a){return"#"!=a&&">"!=a?(e+=a,!0):!1}),c.uris.push(e),a.match("#",!1)?"variable":(a.next(),b(c,">"),"variable")}if("#"==d){var f="";return a.eatWhile(function(a){return">"!=a&&" "!=a?(f+=a,!0):!1}),c.anchors.push(f),"variable-2"}if(">"==d)return b(c,">"),"variable";if("_"==d){b(c,d);var g="";return a.eatWhile(function(a){return" "!=a?(g+=a,!0):!1}),c.bnodes.push(g),a.next(),b(c," "),"builtin"}if('"'==d)return b(c,d),a.eatWhile(function(a){return'"'!=a}),a.next(),"@"!=a.peek()&&"^"!=a.peek()&&b(c,'"'),"string";if("@"==d){b(c,"@");var h="";return a.eatWhile(function(a){return" "!=a?(h+=a,!0):!1}),c.langs.push(h),a.next(),b(c," "),"string-2"}if("^"==d){a.next(),b(c,"^");var i="";return a.eatWhile(function(a){return">"!=a?(i+=a,!0):!1}),c.types.push(i),a.next(),b(c,">"),"variable"}" "==d&&b(c,d),"."==d&&b(c,d)}}}),a.defineMIME("text/n-triples","ntriples")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("sparql",function(a){function d(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function h(a,b){var d=a.next();if(c=null,"$"==d||"?"==d)return a.match(/^[\w\d]*/),"variable-2";if("<"!=d||a.match(/^[\s\u00a0=]/,!1)){if('"'==d||"'"==d)return b.tokenize=i(d),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(d))return c=d,null;if("#"==d)return a.skipToEnd(),"comment";if(g.test(d))return a.eatWhile(g),null;if(":"==d)return a.eatWhile(/[\w\d\._\-]/),"atom";if(a.eatWhile(/[_\w\d]/),a.eat(":"))return a.eatWhile(/[\w\d_\-]/),"atom";var h=a.current();return e.test(h)?null:f.test(h)?"keyword":"variable"}return a.match(/^[^\s\u00a0>]*>?/),"atom"}function i(a){return function(b,c){for(var e,d=!1;null!=(e=b.next());){if(e==a&&!d){c.tokenize=h;break}d=!d&&"\\"==e}return"string"}}function j(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function k(a){a.indent=a.context.indent,a.context=a.context.prev}var c,b=a.indentUnit,e=d(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","a"]),f=d(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","data","copy","to","move","add","create","drop","clear","load"]),g=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:h,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var d=b.tokenize(a,b);if("comment"!=d&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==c)j(b,")",a.column());else if("["==c)j(b,"]",a.column());else if("{"==c)j(b,"}",a.column());else if(/[\]\}\)]/.test(c)){for(;b.context&&"pattern"==b.context.type;)k(b);b.context&&c==b.context.type&&k(b)}else"."==c&&b.context&&"pattern"==b.context.type?k(b):/atom|string|variable/.test(d)&&b.context&&(/[\}\]]/.test(b.context.type)?j(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return d},indent:function(a,c){var d=c&&c.charAt(0),e=a.context;if(/[\]\}]/.test(d))for(;e&&"pattern"==e.type;)e=e.prev;var f=e&&d==e.type;return e?"pattern"==e.type?e.col:e.align?e.col+(f?0:1):e.indent+(f?0:b):0}}}),a.defineMIME("application/x-sparql-query","sparql")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("turtle",function(a){function d(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function h(a,b){var d=a.next();if(c=null,"<"==d&&!a.match(/^[\s\u00a0=]/,!1))return a.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==d||"'"==d)return b.tokenize=i(d),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(d))return c=d,null;if("#"==d)return a.skipToEnd(),"comment";if(g.test(d))return a.eatWhile(g),null;if(":"==d)return"operator";if(a.eatWhile(/[_\w\d]/),":"==a.peek())return"variable-3";var h=a.current();return f.test(h)?"meta":d>="A"&&"Z">=d?"comment":"keyword";var h}function i(a){return function(b,c){for(var e,d=!1;null!=(e=b.next());){if(e==a&&!d){c.tokenize=h;break}d=!d&&"\\"==e}return"string"}}function j(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function k(a){a.indent=a.context.indent,a.context=a.context.prev}var c,b=a.indentUnit,f=(d([]),d(["@prefix","@base","a"])),g=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:h,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var d=b.tokenize(a,b);if("comment"!=d&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==c)j(b,")",a.column());else if("["==c)j(b,"]",a.column());else if("{"==c)j(b,"}",a.column());else if(/[\]\}\)]/.test(c)){for(;b.context&&"pattern"==b.context.type;)k(b);b.context&&c==b.context.type&&k(b)}else"."==c&&b.context&&"pattern"==b.context.type?k(b):/atom|string|variable/.test(d)&&b.context&&(/[\}\]]/.test(b.context.type)?j(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return d},indent:function(a,c){var d=c&&c.charAt(0),e=a.context;if(/[\]\}]/.test(d))for(;e&&"pattern"==e.type;)e=e.prev;var f=e&&d==e.type;return e?"pattern"==e.type?e.col:e.align?e.col+(f?0:1):e.indent+(f?0:b):0}}}),a.defineMIME("text/turtle","turtle")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("xml",function(b,c){function k(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d)return a.eat("!")?a.eat("[")?a.match("CDATA[")?c(n("atom","]]>")):null:a.match("--")?c(n("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(o(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=n("meta","?>"),"meta"):(i=a.eat("/")?"closeTag":"openTag",b.tokenize=l,"tag bracket");if("&"==d){var e;return e=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),e?"atom":"error"}return a.eatWhile(/[^&<]/),null}function l(a,b){var c=a.next();if(">"==c||"/"==c&&a.eat(">"))return b.tokenize=k,i=">"==c?"endTag":"selfcloseTag","tag bracket";if("="==c)return i="equals",null;if("<"==c){b.tokenize=k,b.state=s,b.tagName=b.tagStart=null;var d=b.tokenize(a,b);return d?d+" tag error":"tag error"}return/[\'\"]/.test(c)?(b.tokenize=m(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function m(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=l;break}return"string"};return b.isInAttribute=!0,b}function n(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=k;break}c.next()}return a}}function o(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=o(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=k;break}return c.tokenize=o(a-1),c.tokenize(b,c)}}return"meta"}}function p(a,b,c){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=c,(g.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function q(a){a.context&&(a.context=a.context.prev)}function r(a,b){for(var c;;){if(!a.context)return;if(c=a.context.tagName,!g.contextGrabbers.hasOwnProperty(c)||!g.contextGrabbers[c].hasOwnProperty(b))return;q(a)}}function s(a,b,c){return"openTag"==a?(c.tagStart=b.column(),t):"closeTag"==a?u:s}function t(a,b,c){return"word"==a?(c.tagName=b.current(),j="tag",x):(j="error",t)}function u(a,b,c){if("word"==a){var d=b.current();return c.context&&c.context.tagName!=d&&g.implicitlyClosed.hasOwnProperty(c.context.tagName)&&q(c),c.context&&c.context.tagName==d?(j="tag",v):(j="tag error",w)}return j="error",w}function v(a,b,c){return"endTag"!=a?(j="error",v):(q(c),s)}function w(a,b,c){return j="error",v(a,b,c)}function x(a,b,c){if("word"==a)return j="attribute",y;if("endTag"==a||"selfcloseTag"==a){var d=c.tagName,e=c.tagStart;return c.tagName=c.tagStart=null,"selfcloseTag"==a||g.autoSelfClosers.hasOwnProperty(d)?r(c,d):(r(c,d),c.context=new p(c,d,e==c.indented)),s}return j="error",x}function y(a,b,c){return"equals"==a?z:(g.allowMissing||(j="error"),x(a,b,c))}function z(a,b,c){return"string"==a?A:"word"==a&&g.allowUnquoted?(j="string",x):(j="error",x(a,b,c))}function A(a,b,c){return"string"==a?A:x(a,b,c)}var d=b.indentUnit,e=c.multilineTagIndentFactor||1,f=c.multilineTagIndentPastTag;null==f&&(f=!0);var i,j,g=c.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},h=c.alignCDATA;return{startState:function(){return{tokenize:k,state:s,indented:0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;i=null;var c=b.tokenize(a,b);return(c||i)&&"comment"!=c&&(j=null,b.state=b.state(i||c,a,b),j&&(c="error"==j?c+" error":j)),c},indent:function(b,c,i){var j=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+d;if(j&&j.noIndent)return a.Pass;if(b.tokenize!=l&&b.tokenize!=k)return i?i.match(/^(\s*)/)[0].length:0;if(b.tagName)return f?b.tagStart+b.tagName.length+2:b.tagStart+d*e;if(h&&/$/,blockCommentStart:"",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml"}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})}); \ No newline at end of file diff --git a/codemirror.css b/codemirror.css new file mode 100644 index 0000000..098a317 --- /dev/null +++ b/codemirror.css @@ -0,0 +1,272 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; +} +.CodeMirror-scroll { + /* Set scrolling behaviour here */ + overflow: auto; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +/* CURSOR */ + +.CodeMirror div.CodeMirror-cursor { + border-left: 1px solid black; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { + width: auto; + border: 0; + background: #7e7; +} +/* Can style cursor different in overwrite (non-insert) mode */ +div.CodeMirror-overwrite div.CodeMirror-cursor {} + +.cm-tab { display: inline-block; } + +.CodeMirror-ruler { + border-left: 1px solid #ccc; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + line-height: 1; + position: relative; + overflow: hidden; + background: white; + color: black; +} + +.CodeMirror-scroll { + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actuall scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; +} +.CodeMirror-gutter-filler { + left: 0; bottom: 0; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + padding-bottom: 30px; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding-bottom: 30px; + margin-bottom: -32px; + display: inline-block; + /* Hack to make IE7 behave */ + *zoom:1; + *display:inline; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} + +.CodeMirror-lines { + cursor: text; +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + overflow: auto; +} + +.CodeMirror-widget {} + +.CodeMirror-wrap .CodeMirror-scroll { + overflow-x: hidden; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} +.CodeMirror-measure pre { position: static; } + +.CodeMirror div.CodeMirror-cursor { + position: absolute; + border-right: none; + width: 0; +} + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 1; +} +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } + +.cm-searching { + background: #ffa; + background: rgba(255, 255, 0, .4); +} + +/* IE7 hack to prevent it from returning funny offsetTops on the spans */ +.CodeMirror span { *vertical-align: text-bottom; } + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} diff --git a/contentscript.js b/contentscript.js new file mode 100644 index 0000000..f95781d --- /dev/null +++ b/contentscript.js @@ -0,0 +1,50 @@ +function peelBackRdf(data) { + $('body').prepend('
'); + $('#code').text(data); + var cm = CodeMirror.fromTextArea($('#code')[0], { + mode: "xml", + readOnly: "nocursor" + }); + $('#target').fold({ + directory: "chrome-extension://" + chrome.runtime.id + }); +} + +var res = document.evaluate("//link[(@rel = 'alternate') or (@rel = 'meta')]", document.head, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) + +var rdfUrl = null; + +for (var i=0; i < res.snapshotLength; i++) { + if (res.snapshotItem(i).type == "application/rdf+xml") { + console.log("Found link rel=(alternate|meta) type=application/rdf+xml"); + rdfUrl = res.snapshotItem(i).href; // relative + chrome.runtime.sendMessage({type: 'rdf+xml'}, function(response) { + console.log(response.text); + }); + break; + } +} + +if (rdfUrl == null) { // Try fetching current page as RDF + $.ajax(document.URL, { + accepts: { text: 'application/rdf+xml' }, + dataType: 'text', + success: function(data, textStatus, res) { + var ct = res.getResponseHeader('Content-Type'); + if ((ct != null) && (ct.slice(0, 'application/rdf+xml'.length) == 'application/rdf+xml')) { + chrome.runtime.sendMessage({type: 'rdf+xml'}, function(response) { + console.log(response.text); + }); + peelBackRdf(data); + } + } + }); +} else { + $.ajax(rdfUrl, { + accepts: { text: 'application/rdf+xml' }, + dataType: 'text', + success: function(data, textStatus, res) { + peelBackRdf(data); + } + }); +} diff --git a/custom.css b/custom.css new file mode 100644 index 0000000..6a593fe --- /dev/null +++ b/custom.css @@ -0,0 +1,18 @@ +#target { + text-align: left; + width: 100%; + height: 100%; +} + +#turn_wrapper { + z-index: 100; +} + +.CodeMirror-code pre { + box-shadow: none; +} + +.CodeMirror { + height: 800px; + width: 800px; +} \ No newline at end of file diff --git a/fold.png b/fold.png new file mode 100644 index 0000000..a6c25ff --- /dev/null +++ b/fold.png Binary files differ diff --git a/jquery-ui.min.js b/jquery-ui.min.js new file mode 100644 index 0000000..a95a9d2 --- /dev/null +++ b/jquery-ui.min.js @@ -0,0 +1,125 @@ +/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { function c(b, c) { var e = b.nodeName.toLowerCase(); if ("area" === e) { var f = b.parentNode, g = f.name, h; return !b.href || !g || f.nodeName.toLowerCase() !== "map" ? !1 : (h = a("img[usemap=#" + g + "]")[0], !!h && d(h)) } return (/input|select|textarea|button|object/.test(e) ? !b.disabled : "a" == e ? b.href || c : c) && d(b) } function d(b) { return !a(b).parents().andSelf().filter(function () { return a.curCSS(this, "visibility") === "hidden" || a.expr.filters.hidden(this) }).length } a.ui = a.ui || {}; if (a.ui.version) return; a.extend(a.ui, { version: "1.8.24", keyCode: { ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91} }), a.fn.extend({ propAttr: a.fn.prop || a.fn.attr, _focus: a.fn.focus, focus: function (b, c) { return typeof b == "number" ? this.each(function () { var d = this; setTimeout(function () { a(d).focus(), c && c.call(d) }, b) }) : this._focus.apply(this, arguments) }, scrollParent: function () { var b; return a.browser.msie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? b = this.parents().filter(function () { return /(relative|absolute|fixed)/.test(a.curCSS(this, "position", 1)) && /(auto|scroll)/.test(a.curCSS(this, "overflow", 1) + a.curCSS(this, "overflow-y", 1) + a.curCSS(this, "overflow-x", 1)) }).eq(0) : b = this.parents().filter(function () { return /(auto|scroll)/.test(a.curCSS(this, "overflow", 1) + a.curCSS(this, "overflow-y", 1) + a.curCSS(this, "overflow-x", 1)) }).eq(0), /fixed/.test(this.css("position")) || !b.length ? a(document) : b }, zIndex: function (c) { if (c !== b) return this.css("zIndex", c); if (this.length) { var d = a(this[0]), e, f; while (d.length && d[0] !== document) { e = d.css("position"); if (e === "absolute" || e === "relative" || e === "fixed") { f = parseInt(d.css("zIndex"), 10); if (!isNaN(f) && f !== 0) return f } d = d.parent() } } return 0 }, disableSelection: function () { return this.bind((a.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (a) { a.preventDefault() }) }, enableSelection: function () { return this.unbind(".ui-disableSelection") } }), a("").outerWidth(1).jquery || a.each(["Width", "Height"], function (c, d) { function h(b, c, d, f) { return a.each(e, function () { c -= parseFloat(a.curCSS(b, "padding" + this, !0)) || 0, d && (c -= parseFloat(a.curCSS(b, "border" + this + "Width", !0)) || 0), f && (c -= parseFloat(a.curCSS(b, "margin" + this, !0)) || 0) }), c } var e = d === "Width" ? ["Left", "Right"] : ["Top", "Bottom"], f = d.toLowerCase(), g = { innerWidth: a.fn.innerWidth, innerHeight: a.fn.innerHeight, outerWidth: a.fn.outerWidth, outerHeight: a.fn.outerHeight }; a.fn["inner" + d] = function (c) { return c === b ? g["inner" + d].call(this) : this.each(function () { a(this).css(f, h(this, c) + "px") }) }, a.fn["outer" + d] = function (b, c) { return typeof b != "number" ? g["outer" + d].call(this, b) : this.each(function () { a(this).css(f, h(this, b, !0, c) + "px") }) } }), a.extend(a.expr[":"], { data: a.expr.createPseudo ? a.expr.createPseudo(function (b) { return function (c) { return !!a.data(c, b) } }) : function (b, c, d) { return !!a.data(b, d[3]) }, focusable: function (b) { return c(b, !isNaN(a.attr(b, "tabindex"))) }, tabbable: function (b) { var d = a.attr(b, "tabindex"), e = isNaN(d); return (e || d >= 0) && c(b, !e) } }), a(function () { var b = document.body, c = b.appendChild(c = document.createElement("div")); c.offsetHeight, a.extend(c.style, { minHeight: "100px", height: "auto", padding: 0, borderWidth: 0 }), a.support.minHeight = c.offsetHeight === 100, a.support.selectstart = "onselectstart" in c, b.removeChild(c).style.display = "none" }), a.curCSS || (a.curCSS = a.css), a.extend(a.ui, { plugin: { add: function (b, c, d) { var e = a.ui[b].prototype; for (var f in d) e.plugins[f] = e.plugins[f] || [], e.plugins[f].push([c, d[f]]) }, call: function (a, b, c) { var d = a.plugins[b]; if (!d || !a.element[0].parentNode) return; for (var e = 0; e < d.length; e++) a.options[d[e][0]] && d[e][1].apply(a.element, c) } }, contains: function (a, b) { return document.compareDocumentPosition ? a.compareDocumentPosition(b) & 16 : a !== b && a.contains(b) }, hasScroll: function (b, c) { if (a(b).css("overflow") === "hidden") return !1; var d = c && c === "left" ? "scrollLeft" : "scrollTop", e = !1; return b[d] > 0 ? !0 : (b[d] = 1, e = b[d] > 0, b[d] = 0, e) }, isOverAxis: function (a, b, c) { return a > b && a < b + c }, isOver: function (b, c, d, e, f, g) { return a.ui.isOverAxis(b, d, f) && a.ui.isOverAxis(c, e, g) } }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.widget.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { if (a.cleanData) { var c = a.cleanData; a.cleanData = function (b) { for (var d = 0, e; (e = b[d]) != null; d++) try { a(e).triggerHandler("remove") } catch (f) { } c(b) } } else { var d = a.fn.remove; a.fn.remove = function (b, c) { return this.each(function () { return c || (!b || a.filter(b, [this]).length) && a("*", this).add([this]).each(function () { try { a(this).triggerHandler("remove") } catch (b) { } }), d.call(a(this), b, c) }) } } a.widget = function (b, c, d) { var e = b.split(".")[0], f; b = b.split(".")[1], f = e + "-" + b, d || (d = c, c = a.Widget), a.expr[":"][f] = function (c) { return !!a.data(c, b) }, a[e] = a[e] || {}, a[e][b] = function (a, b) { arguments.length && this._createWidget(a, b) }; var g = new c; g.options = a.extend(!0, {}, g.options), a[e][b].prototype = a.extend(!0, g, { namespace: e, widgetName: b, widgetEventPrefix: a[e][b].prototype.widgetEventPrefix || b, widgetBaseClass: f }, d), a.widget.bridge(b, a[e][b]) }, a.widget.bridge = function (c, d) { a.fn[c] = function (e) { var f = typeof e == "string", g = Array.prototype.slice.call(arguments, 1), h = this; return e = !f && g.length ? a.extend.apply(null, [!0, e].concat(g)) : e, f && e.charAt(0) === "_" ? h : (f ? this.each(function () { var d = a.data(this, c), f = d && a.isFunction(d[e]) ? d[e].apply(d, g) : d; if (f !== d && f !== b) return h = f, !1 }) : this.each(function () { var b = a.data(this, c); b ? b.option(e || {})._init() : a.data(this, c, new d(e, this)) }), h) } }, a.Widget = function (a, b) { arguments.length && this._createWidget(a, b) }, a.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: !1 }, _createWidget: function (b, c) { a.data(c, this.widgetName, this), this.element = a(c), this.options = a.extend(!0, {}, this.options, this._getCreateOptions(), b); var d = this; this.element.bind("remove." + this.widgetName, function () { d.destroy() }), this._create(), this._trigger("create"), this._init() }, _getCreateOptions: function () { return a.metadata && a.metadata.get(this.element[0])[this.widgetName] }, _create: function () { }, _init: function () { }, destroy: function () { this.element.unbind("." + this.widgetName).removeData(this.widgetName), this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass + "-disabled " + "ui-state-disabled") }, widget: function () { return this.element }, option: function (c, d) { var e = c; if (arguments.length === 0) return a.extend({}, this.options); if (typeof c == "string") { if (d === b) return this.options[c]; e = {}, e[c] = d } return this._setOptions(e), this }, _setOptions: function (b) { var c = this; return a.each(b, function (a, b) { c._setOption(a, b) }), this }, _setOption: function (a, b) { return this.options[a] = b, a === "disabled" && this.widget()[b ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled" + " " + "ui-state-disabled").attr("aria-disabled", b), this }, enable: function () { return this._setOption("disabled", !1) }, disable: function () { return this._setOption("disabled", !0) }, _trigger: function (b, c, d) { var e, f, g = this.options[b]; d = d || {}, c = a.Event(c), c.type = (b === this.widgetEventPrefix ? b : this.widgetEventPrefix + b).toLowerCase(), c.target = this.element[0], f = c.originalEvent; if (f) for (e in f) e in c || (c[e] = f[e]); return this.element.trigger(c, d), !(a.isFunction(g) && g.call(this.element[0], c, d) === !1 || c.isDefaultPrevented()) } } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.mouse.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { var c = !1; a(document).mouseup(function (a) { c = !1 }), a.widget("ui.mouse", { options: { cancel: ":input,option", distance: 1, delay: 0 }, _mouseInit: function () { var b = this; this.element.bind("mousedown." + this.widgetName, function (a) { return b._mouseDown(a) }).bind("click." + this.widgetName, function (c) { if (!0 === a.data(c.target, b.widgetName + ".preventClickEvent")) return a.removeData(c.target, b.widgetName + ".preventClickEvent"), c.stopImmediatePropagation(), !1 }), this.started = !1 }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && a(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate) }, _mouseDown: function (b) { if (c) return; this._mouseStarted && this._mouseUp(b), this._mouseDownEvent = b; var d = this, e = b.which == 1, f = typeof this.options.cancel == "string" && b.target.nodeName ? a(b.target).closest(this.options.cancel).length : !1; if (!e || f || !this._mouseCapture(b)) return !0; this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { d.mouseDelayMet = !0 }, this.options.delay)); if (this._mouseDistanceMet(b) && this._mouseDelayMet(b)) { this._mouseStarted = this._mouseStart(b) !== !1; if (!this._mouseStarted) return b.preventDefault(), !0 } return !0 === a.data(b.target, this.widgetName + ".preventClickEvent") && a.removeData(b.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (a) { return d._mouseMove(a) }, this._mouseUpDelegate = function (a) { return d._mouseUp(a) }, a(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), b.preventDefault(), c = !0, !0 }, _mouseMove: function (b) { return !a.browser.msie || document.documentMode >= 9 || !!b.button ? this._mouseStarted ? (this._mouseDrag(b), b.preventDefault()) : (this._mouseDistanceMet(b) && this._mouseDelayMet(b) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, b) !== !1, this._mouseStarted ? this._mouseDrag(b) : this._mouseUp(b)), !this._mouseStarted) : this._mouseUp(b) }, _mouseUp: function (b) { return a(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, b.target == this._mouseDownEvent.target && a.data(b.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(b)), !1 }, _mouseDistanceMet: function (a) { return Math.max(Math.abs(this._mouseDownEvent.pageX - a.pageX), Math.abs(this._mouseDownEvent.pageY - a.pageY)) >= this.options.distance }, _mouseDelayMet: function (a) { return this.mouseDelayMet }, _mouseStart: function (a) { }, _mouseDrag: function (a) { }, _mouseStop: function (a) { }, _mouseCapture: function (a) { return !0 } }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.position.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.ui = a.ui || {}; var c = /left|center|right/, d = /top|center|bottom/, e = "center", f = {}, g = a.fn.position, h = a.fn.offset; a.fn.position = function (b) { if (!b || !b.of) return g.apply(this, arguments); b = a.extend({}, b); var h = a(b.of), i = h[0], j = (b.collision || "flip").split(" "), k = b.offset ? b.offset.split(" ") : [0, 0], l, m, n; return i.nodeType === 9 ? (l = h.width(), m = h.height(), n = { top: 0, left: 0 }) : i.setTimeout ? (l = h.width(), m = h.height(), n = { top: h.scrollTop(), left: h.scrollLeft() }) : i.preventDefault ? (b.at = "left top", l = m = 0, n = { top: b.of.pageY, left: b.of.pageX }) : (l = h.outerWidth(), m = h.outerHeight(), n = h.offset()), a.each(["my", "at"], function () { var a = (b[this] || "").split(" "); a.length === 1 && (a = c.test(a[0]) ? a.concat([e]) : d.test(a[0]) ? [e].concat(a) : [e, e]), a[0] = c.test(a[0]) ? a[0] : e, a[1] = d.test(a[1]) ? a[1] : e, b[this] = a }), j.length === 1 && (j[1] = j[0]), k[0] = parseInt(k[0], 10) || 0, k.length === 1 && (k[1] = k[0]), k[1] = parseInt(k[1], 10) || 0, b.at[0] === "right" ? n.left += l : b.at[0] === e && (n.left += l / 2), b.at[1] === "bottom" ? n.top += m : b.at[1] === e && (n.top += m / 2), n.left += k[0], n.top += k[1], this.each(function () { var c = a(this), d = c.outerWidth(), g = c.outerHeight(), h = parseInt(a.curCSS(this, "marginLeft", !0)) || 0, i = parseInt(a.curCSS(this, "marginTop", !0)) || 0, o = d + h + (parseInt(a.curCSS(this, "marginRight", !0)) || 0), p = g + i + (parseInt(a.curCSS(this, "marginBottom", !0)) || 0), q = a.extend({}, n), r; b.my[0] === "right" ? q.left -= d : b.my[0] === e && (q.left -= d / 2), b.my[1] === "bottom" ? q.top -= g : b.my[1] === e && (q.top -= g / 2), f.fractions || (q.left = Math.round(q.left), q.top = Math.round(q.top)), r = { left: q.left - h, top: q.top - i }, a.each(["left", "top"], function (c, e) { a.ui.position[j[c]] && a.ui.position[j[c]][e](q, { targetWidth: l, targetHeight: m, elemWidth: d, elemHeight: g, collisionPosition: r, collisionWidth: o, collisionHeight: p, offset: k, my: b.my, at: b.at }) }), a.fn.bgiframe && c.bgiframe(), c.offset(a.extend(q, { using: b.using })) }) }, a.ui.position = { fit: { left: function (b, c) { var d = a(window), e = c.collisionPosition.left + c.collisionWidth - d.width() - d.scrollLeft(); b.left = e > 0 ? b.left - e : Math.max(b.left - c.collisionPosition.left, b.left) }, top: function (b, c) { var d = a(window), e = c.collisionPosition.top + c.collisionHeight - d.height() - d.scrollTop(); b.top = e > 0 ? b.top - e : Math.max(b.top - c.collisionPosition.top, b.top) } }, flip: { left: function (b, c) { if (c.at[0] === e) return; var d = a(window), f = c.collisionPosition.left + c.collisionWidth - d.width() - d.scrollLeft(), g = c.my[0] === "left" ? -c.elemWidth : c.my[0] === "right" ? c.elemWidth : 0, h = c.at[0] === "left" ? c.targetWidth : -c.targetWidth, i = -2 * c.offset[0]; b.left += c.collisionPosition.left < 0 ? g + h + i : f > 0 ? g + h + i : 0 }, top: function (b, c) { if (c.at[1] === e) return; var d = a(window), f = c.collisionPosition.top + c.collisionHeight - d.height() - d.scrollTop(), g = c.my[1] === "top" ? -c.elemHeight : c.my[1] === "bottom" ? c.elemHeight : 0, h = c.at[1] === "top" ? c.targetHeight : -c.targetHeight, i = -2 * c.offset[1]; b.top += c.collisionPosition.top < 0 ? g + h + i : f > 0 ? g + h + i : 0 } } }, a.offset.setOffset || (a.offset.setOffset = function (b, c) { /static/.test(a.curCSS(b, "position")) && (b.style.position = "relative"); var d = a(b), e = d.offset(), f = parseInt(a.curCSS(b, "top", !0), 10) || 0, g = parseInt(a.curCSS(b, "left", !0), 10) || 0, h = { top: c.top - e.top + f, left: c.left - e.left + g }; "using" in c ? c.using.call(b, h) : d.css(h) }, a.fn.offset = function (b) { var c = this[0]; return !c || !c.ownerDocument ? null : b ? a.isFunction(b) ? this.each(function (c) { a(this).offset(b.call(this, c, a(this).offset())) }) : this.each(function () { a.offset.setOffset(this, b) }) : h.call(this) }), a.curCSS || (a.curCSS = a.css), function () { var b = document.getElementsByTagName("body")[0], c = document.createElement("div"), d, e, g, h, i; d = document.createElement(b ? "div" : "body"), g = { visibility: "hidden", width: 0, height: 0, border: 0, margin: 0, background: "none" }, b && a.extend(g, { position: "absolute", left: "-1000px", top: "-1000px" }); for (var j in g) d.style[j] = g[j]; d.appendChild(c), e = b || document.documentElement, e.insertBefore(d, e.firstChild), c.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;", h = a(c).offset(function (a, b) { return b }).offset(), d.innerHTML = "", e.removeChild(d), i = h.top + h.left + (b ? 2e3 : 0), f.fractions = i > 21 && i < 22 } () })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.draggable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.widget("ui.draggable", a.ui.mouse, { widgetEventPrefix: "drag", options: { addClasses: !0, appendTo: "parent", axis: !1, connectToSortable: !1, containment: !1, cursor: "auto", cursorAt: !1, grid: !1, handle: !1, helper: "original", iframeFix: !1, opacity: !1, refreshPositions: !1, revert: !1, revertDuration: 500, scope: "default", scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, snap: !1, snapMode: "both", snapTolerance: 20, stack: !1, zIndex: !1 }, _create: function () { this.options.helper == "original" && !/^(?:r|a|f)/.test(this.element.css("position")) && (this.element[0].style.position = "relative"), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._mouseInit() }, destroy: function () { if (!this.element.data("draggable")) return; return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._mouseDestroy(), this }, _mouseCapture: function (b) { var c = this.options; return this.helper || c.disabled || a(b.target).is(".ui-resizable-handle") ? !1 : (this.handle = this._getHandle(b), this.handle ? (c.iframeFix && a(c.iframeFix === !0 ? "iframe" : c.iframeFix).each(function () { a('
').css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1e3 }).css(a(this).offset()).appendTo("body") }), !0) : !1) }, _mouseStart: function (b) { var c = this.options; return this.helper = this._createHelper(b), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), a.ui.ddmanager && (a.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(), this.offset = this.positionAbs = this.element.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, a.extend(this.offset, { click: { left: b.pageX - this.offset.left, top: b.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.originalPosition = this.position = this._generatePosition(b), this.originalPageX = b.pageX, this.originalPageY = b.pageY, c.cursorAt && this._adjustOffsetFromHelper(c.cursorAt), c.containment && this._setContainment(), this._trigger("start", b) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), a.ui.ddmanager && !c.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, b), this._mouseDrag(b, !0), a.ui.ddmanager && a.ui.ddmanager.dragStart(this, b), !0) }, _mouseDrag: function (b, c) { this.position = this._generatePosition(b), this.positionAbs = this._convertPositionTo("absolute"); if (!c) { var d = this._uiHash(); if (this._trigger("drag", b, d) === !1) return this._mouseUp({}), !1; this.position = d.position } if (!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left + "px"; if (!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top + "px"; return a.ui.ddmanager && a.ui.ddmanager.drag(this, b), !1 }, _mouseStop: function (b) { var c = !1; a.ui.ddmanager && !this.options.dropBehaviour && (c = a.ui.ddmanager.drop(this, b)), this.dropped && (c = this.dropped, this.dropped = !1); var d = this.element[0], e = !1; while (d && (d = d.parentNode)) d == document && (e = !0); if (!e && this.options.helper === "original") return !1; if (this.options.revert == "invalid" && !c || this.options.revert == "valid" && c || this.options.revert === !0 || a.isFunction(this.options.revert) && this.options.revert.call(this.element, c)) { var f = this; a(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { f._trigger("stop", b) !== !1 && f._clear() }) } else this._trigger("stop", b) !== !1 && this._clear(); return !1 }, _mouseUp: function (b) { return a("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }), a.ui.ddmanager && a.ui.ddmanager.dragStop(this, b), a.ui.mouse.prototype._mouseUp.call(this, b) }, cancel: function () { return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this }, _getHandle: function (b) { var c = !this.options.handle || !a(this.options.handle, this.element).length ? !0 : !1; return a(this.options.handle, this.element).find("*").andSelf().each(function () { this == b.target && (c = !0) }), c }, _createHelper: function (b) { var c = this.options, d = a.isFunction(c.helper) ? a(c.helper.apply(this.element[0], [b])) : c.helper == "clone" ? this.element.clone().removeAttr("id") : this.element; return d.parents("body").length || d.appendTo(c.appendTo == "parent" ? this.element[0].parentNode : c.appendTo), d[0] != this.element[0] && !/(fixed|absolute)/.test(d.css("position")) && d.css("position", "absolute"), d }, _adjustOffsetFromHelper: function (b) { typeof b == "string" && (b = b.split(" ")), a.isArray(b) && (b = { left: +b[0], top: +b[1] || 0 }), "left" in b && (this.offset.click.left = b.left + this.margins.left), "right" in b && (this.offset.click.left = this.helperProportions.width - b.right + this.margins.left), "top" in b && (this.offset.click.top = b.top + this.margins.top), "bottom" in b && (this.offset.click.top = this.helperProportions.height - b.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var b = this.offsetParent.offset(); this.cssPosition == "absolute" && this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0]) && (b.left += this.scrollParent.scrollLeft(), b.top += this.scrollParent.scrollTop()); if (this.offsetParent[0] == document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie) b = { top: 0, left: 0 }; return { top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var a = this.element.position(); return { top: a.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: a.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} } return { top: 0, left: 0} }, _cacheMargins: function () { this.margins = { left: parseInt(this.element.css("marginLeft"), 10) || 0, top: parseInt(this.element.css("marginTop"), 10) || 0, right: parseInt(this.element.css("marginRight"), 10) || 0, bottom: parseInt(this.element.css("marginBottom"), 10) || 0} }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight()} }, _setContainment: function () { var b = this.options; b.containment == "parent" && (b.containment = this.helper[0].parentNode); if (b.containment == "document" || b.containment == "window") this.containment = [b.containment == "document" ? 0 : a(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, b.containment == "document" ? 0 : a(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, (b.containment == "document" ? 0 : a(window).scrollLeft()) + a(b.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (b.containment == "document" ? 0 : a(window).scrollTop()) + (a(b.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; if (!/^(document|window|parent)$/.test(b.containment) && b.containment.constructor != Array) { var c = a(b.containment), d = c[0]; if (!d) return; var e = c.offset(), f = a(d).css("overflow") != "hidden"; this.containment = [(parseInt(a(d).css("borderLeftWidth"), 10) || 0) + (parseInt(a(d).css("paddingLeft"), 10) || 0), (parseInt(a(d).css("borderTopWidth"), 10) || 0) + (parseInt(a(d).css("paddingTop"), 10) || 0), (f ? Math.max(d.scrollWidth, d.offsetWidth) : d.offsetWidth) - (parseInt(a(d).css("borderLeftWidth"), 10) || 0) - (parseInt(a(d).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (f ? Math.max(d.scrollHeight, d.offsetHeight) : d.offsetHeight) - (parseInt(a(d).css("borderTopWidth"), 10) || 0) - (parseInt(a(d).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relative_container = c } else b.containment.constructor == Array && (this.containment = b.containment) }, _convertPositionTo: function (b, c) { c || (c = this.position); var d = b == "absolute" ? 1 : -1, e = this.options, f = this.cssPosition == "absolute" && (this.scrollParent[0] == document || !a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, g = /(html|body)/i.test(f[0].tagName); return { top: c.top + this.offset.relative.top * d + this.offset.parent.top * d - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : g ? 0 : f.scrollTop()) * d), left: c.left + this.offset.relative.left * d + this.offset.parent.left * d - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : g ? 0 : f.scrollLeft()) * d)} }, _generatePosition: function (b) { var c = this.options, d = this.cssPosition == "absolute" && (this.scrollParent[0] == document || !a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, e = /(html|body)/i.test(d[0].tagName), f = b.pageX, g = b.pageY; if (this.originalPosition) { var h; if (this.containment) { if (this.relative_container) { var i = this.relative_container.offset(); h = [this.containment[0] + i.left, this.containment[1] + i.top, this.containment[2] + i.left, this.containment[3] + i.top] } else h = this.containment; b.pageX - this.offset.click.left < h[0] && (f = h[0] + this.offset.click.left), b.pageY - this.offset.click.top < h[1] && (g = h[1] + this.offset.click.top), b.pageX - this.offset.click.left > h[2] && (f = h[2] + this.offset.click.left), b.pageY - this.offset.click.top > h[3] && (g = h[3] + this.offset.click.top) } if (c.grid) { var j = c.grid[1] ? this.originalPageY + Math.round((g - this.originalPageY) / c.grid[1]) * c.grid[1] : this.originalPageY; g = h ? j - this.offset.click.top < h[1] || j - this.offset.click.top > h[3] ? j - this.offset.click.top < h[1] ? j + c.grid[1] : j - c.grid[1] : j : j; var k = c.grid[0] ? this.originalPageX + Math.round((f - this.originalPageX) / c.grid[0]) * c.grid[0] : this.originalPageX; f = h ? k - this.offset.click.left < h[0] || k - this.offset.click.left > h[2] ? k - this.offset.click.left < h[0] ? k + c.grid[0] : k - c.grid[0] : k : k } } return { top: g - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : e ? 0 : d.scrollTop()), left: f - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : e ? 0 : d.scrollLeft())} }, _clear: function () { this.helper.removeClass("ui-draggable-dragging"), this.helper[0] != this.element[0] && !this.cancelHelperRemoval && this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1 }, _trigger: function (b, c, d) { return d = d || this._uiHash(), a.ui.plugin.call(this, b, [c, d]), b == "drag" && (this.positionAbs = this._convertPositionTo("absolute")), a.Widget.prototype._trigger.call(this, b, c, d) }, plugins: {}, _uiHash: function (a) { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs} } }), a.extend(a.ui.draggable, { version: "1.8.24" }), a.ui.plugin.add("draggable", "connectToSortable", { start: function (b, c) { var d = a(this).data("draggable"), e = d.options, f = a.extend({}, c, { item: d.element }); d.sortables = [], a(e.connectToSortable).each(function () { var c = a.data(this, "sortable"); c && !c.options.disabled && (d.sortables.push({ instance: c, shouldRevert: c.options.revert }), c.refreshPositions(), c._trigger("activate", b, f)) }) }, stop: function (b, c) { var d = a(this).data("draggable"), e = a.extend({}, c, { item: d.element }); a.each(d.sortables, function () { this.instance.isOver ? (this.instance.isOver = 0, d.cancelHelperRemoval = !0, this.instance.cancelHelperRemoval = !1, this.shouldRevert && (this.instance.options.revert = !0), this.instance._mouseStop(b), this.instance.options.helper = this.instance.options._helper, d.options.helper == "original" && this.instance.currentItem.css({ top: "auto", left: "auto" })) : (this.instance.cancelHelperRemoval = !1, this.instance._trigger("deactivate", b, e)) }) }, drag: function (b, c) { var d = a(this).data("draggable"), e = this, f = function (b) { var c = this.offset.click.top, d = this.offset.click.left, e = this.positionAbs.top, f = this.positionAbs.left, g = b.height, h = b.width, i = b.top, j = b.left; return a.ui.isOver(e + c, f + d, i, j, g, h) }; a.each(d.sortables, function (f) { this.instance.positionAbs = d.positionAbs, this.instance.helperProportions = d.helperProportions, this.instance.offset.click = d.offset.click, this.instance._intersectsWith(this.instance.containerCache) ? (this.instance.isOver || (this.instance.isOver = 1, this.instance.currentItem = a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item", !0), this.instance.options._helper = this.instance.options.helper, this.instance.options.helper = function () { return c.helper[0] }, b.target = this.instance.currentItem[0], this.instance._mouseCapture(b, !0), this.instance._mouseStart(b, !0, !0), this.instance.offset.click.top = d.offset.click.top, this.instance.offset.click.left = d.offset.click.left, this.instance.offset.parent.left -= d.offset.parent.left - this.instance.offset.parent.left, this.instance.offset.parent.top -= d.offset.parent.top - this.instance.offset.parent.top, d._trigger("toSortable", b), d.dropped = this.instance.element, d.currentItem = d.element, this.instance.fromOutside = d), this.instance.currentItem && this.instance._mouseDrag(b)) : this.instance.isOver && (this.instance.isOver = 0, this.instance.cancelHelperRemoval = !0, this.instance.options.revert = !1, this.instance._trigger("out", b, this.instance._uiHash(this.instance)), this.instance._mouseStop(b, !0), this.instance.options.helper = this.instance.options._helper, this.instance.currentItem.remove(), this.instance.placeholder && this.instance.placeholder.remove(), d._trigger("fromSortable", b), d.dropped = !1) }) } }), a.ui.plugin.add("draggable", "cursor", { start: function (b, c) { var d = a("body"), e = a(this).data("draggable").options; d.css("cursor") && (e._cursor = d.css("cursor")), d.css("cursor", e.cursor) }, stop: function (b, c) { var d = a(this).data("draggable").options; d._cursor && a("body").css("cursor", d._cursor) } }), a.ui.plugin.add("draggable", "opacity", { start: function (b, c) { var d = a(c.helper), e = a(this).data("draggable").options; d.css("opacity") && (e._opacity = d.css("opacity")), d.css("opacity", e.opacity) }, stop: function (b, c) { var d = a(this).data("draggable").options; d._opacity && a(c.helper).css("opacity", d._opacity) } }), a.ui.plugin.add("draggable", "scroll", { start: function (b, c) { var d = a(this).data("draggable"); d.scrollParent[0] != document && d.scrollParent[0].tagName != "HTML" && (d.overflowOffset = d.scrollParent.offset()) }, drag: function (b, c) { var d = a(this).data("draggable"), e = d.options, f = !1; if (d.scrollParent[0] != document && d.scrollParent[0].tagName != "HTML") { if (!e.axis || e.axis != "x") d.overflowOffset.top + d.scrollParent[0].offsetHeight - b.pageY < e.scrollSensitivity ? d.scrollParent[0].scrollTop = f = d.scrollParent[0].scrollTop + e.scrollSpeed : b.pageY - d.overflowOffset.top < e.scrollSensitivity && (d.scrollParent[0].scrollTop = f = d.scrollParent[0].scrollTop - e.scrollSpeed); if (!e.axis || e.axis != "y") d.overflowOffset.left + d.scrollParent[0].offsetWidth - b.pageX < e.scrollSensitivity ? d.scrollParent[0].scrollLeft = f = d.scrollParent[0].scrollLeft + e.scrollSpeed : b.pageX - d.overflowOffset.left < e.scrollSensitivity && (d.scrollParent[0].scrollLeft = f = d.scrollParent[0].scrollLeft - e.scrollSpeed) } else { if (!e.axis || e.axis != "x") b.pageY - a(document).scrollTop() < e.scrollSensitivity ? f = a(document).scrollTop(a(document).scrollTop() - e.scrollSpeed) : a(window).height() - (b.pageY - a(document).scrollTop()) < e.scrollSensitivity && (f = a(document).scrollTop(a(document).scrollTop() + e.scrollSpeed)); if (!e.axis || e.axis != "y") b.pageX - a(document).scrollLeft() < e.scrollSensitivity ? f = a(document).scrollLeft(a(document).scrollLeft() - e.scrollSpeed) : a(window).width() - (b.pageX - a(document).scrollLeft()) < e.scrollSensitivity && (f = a(document).scrollLeft(a(document).scrollLeft() + e.scrollSpeed)) } f !== !1 && a.ui.ddmanager && !e.dropBehaviour && a.ui.ddmanager.prepareOffsets(d, b) } }), a.ui.plugin.add("draggable", "snap", { start: function (b, c) { var d = a(this).data("draggable"), e = d.options; d.snapElements = [], a(e.snap.constructor != String ? e.snap.items || ":data(draggable)" : e.snap).each(function () { var b = a(this), c = b.offset(); this != d.element[0] && d.snapElements.push({ item: this, width: b.outerWidth(), height: b.outerHeight(), top: c.top, left: c.left }) }) }, drag: function (b, c) { var d = a(this).data("draggable"), e = d.options, f = e.snapTolerance, g = c.offset.left, h = g + d.helperProportions.width, i = c.offset.top, j = i + d.helperProportions.height; for (var k = d.snapElements.length - 1; k >= 0; k--) { var l = d.snapElements[k].left, m = l + d.snapElements[k].width, n = d.snapElements[k].top, o = n + d.snapElements[k].height; if (!(l - f < g && g < m + f && n - f < i && i < o + f || l - f < g && g < m + f && n - f < j && j < o + f || l - f < h && h < m + f && n - f < i && i < o + f || l - f < h && h < m + f && n - f < j && j < o + f)) { d.snapElements[k].snapping && d.options.snap.release && d.options.snap.release.call(d.element, b, a.extend(d._uiHash(), { snapItem: d.snapElements[k].item })), d.snapElements[k].snapping = !1; continue } if (e.snapMode != "inner") { var p = Math.abs(n - j) <= f, q = Math.abs(o - i) <= f, r = Math.abs(l - h) <= f, s = Math.abs(m - g) <= f; p && (c.position.top = d._convertPositionTo("relative", { top: n - d.helperProportions.height, left: 0 }).top - d.margins.top), q && (c.position.top = d._convertPositionTo("relative", { top: o, left: 0 }).top - d.margins.top), r && (c.position.left = d._convertPositionTo("relative", { top: 0, left: l - d.helperProportions.width }).left - d.margins.left), s && (c.position.left = d._convertPositionTo("relative", { top: 0, left: m }).left - d.margins.left) } var t = p || q || r || s; if (e.snapMode != "outer") { var p = Math.abs(n - i) <= f, q = Math.abs(o - j) <= f, r = Math.abs(l - g) <= f, s = Math.abs(m - h) <= f; p && (c.position.top = d._convertPositionTo("relative", { top: n, left: 0 }).top - d.margins.top), q && (c.position.top = d._convertPositionTo("relative", { top: o - d.helperProportions.height, left: 0 }).top - d.margins.top), r && (c.position.left = d._convertPositionTo("relative", { top: 0, left: l }).left - d.margins.left), s && (c.position.left = d._convertPositionTo("relative", { top: 0, left: m - d.helperProportions.width }).left - d.margins.left) } !d.snapElements[k].snapping && (p || q || r || s || t) && d.options.snap.snap && d.options.snap.snap.call(d.element, b, a.extend(d._uiHash(), { snapItem: d.snapElements[k].item })), d.snapElements[k].snapping = p || q || r || s || t } } }), a.ui.plugin.add("draggable", "stack", { start: function (b, c) { var d = a(this).data("draggable").options, e = a.makeArray(a(d.stack)).sort(function (b, c) { return (parseInt(a(b).css("zIndex"), 10) || 0) - (parseInt(a(c).css("zIndex"), 10) || 0) }); if (!e.length) return; var f = parseInt(e[0].style.zIndex) || 0; a(e).each(function (a) { this.style.zIndex = f + a }), this[0].style.zIndex = f + e.length } }), a.ui.plugin.add("draggable", "zIndex", { start: function (b, c) { var d = a(c.helper), e = a(this).data("draggable").options; d.css("zIndex") && (e._zIndex = d.css("zIndex")), d.css("zIndex", e.zIndex) }, stop: function (b, c) { var d = a(this).data("draggable").options; d._zIndex && a(c.helper).css("zIndex", d._zIndex) } }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.droppable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.widget("ui.droppable", { widgetEventPrefix: "drop", options: { accept: "*", activeClass: !1, addClasses: !0, greedy: !1, hoverClass: !1, scope: "default", tolerance: "intersect" }, _create: function () { var b = this.options, c = b.accept; this.isover = 0, this.isout = 1, this.accept = a.isFunction(c) ? c : function (a) { return a.is(c) }, this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }, a.ui.ddmanager.droppables[b.scope] = a.ui.ddmanager.droppables[b.scope] || [], a.ui.ddmanager.droppables[b.scope].push(this), b.addClasses && this.element.addClass("ui-droppable") }, destroy: function () { var b = a.ui.ddmanager.droppables[this.options.scope]; for (var c = 0; c < b.length; c++) b[c] == this && b.splice(c, 1); return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"), this }, _setOption: function (b, c) { b == "accept" && (this.accept = a.isFunction(c) ? c : function (a) { return a.is(c) }), a.Widget.prototype._setOption.apply(this, arguments) }, _activate: function (b) { var c = a.ui.ddmanager.current; this.options.activeClass && this.element.addClass(this.options.activeClass), c && this._trigger("activate", b, this.ui(c)) }, _deactivate: function (b) { var c = a.ui.ddmanager.current; this.options.activeClass && this.element.removeClass(this.options.activeClass), c && this._trigger("deactivate", b, this.ui(c)) }, _over: function (b) { var c = a.ui.ddmanager.current; if (!c || (c.currentItem || c.element)[0] == this.element[0]) return; this.accept.call(this.element[0], c.currentItem || c.element) && (this.options.hoverClass && this.element.addClass(this.options.hoverClass), this._trigger("over", b, this.ui(c))) }, _out: function (b) { var c = a.ui.ddmanager.current; if (!c || (c.currentItem || c.element)[0] == this.element[0]) return; this.accept.call(this.element[0], c.currentItem || c.element) && (this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("out", b, this.ui(c))) }, _drop: function (b, c) { var d = c || a.ui.ddmanager.current; if (!d || (d.currentItem || d.element)[0] == this.element[0]) return !1; var e = !1; return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function () { var b = a.data(this, "droppable"); if (b.options.greedy && !b.options.disabled && b.options.scope == d.options.scope && b.accept.call(b.element[0], d.currentItem || d.element) && a.ui.intersect(d, a.extend(b, { offset: b.element.offset() }), b.options.tolerance)) return e = !0, !1 }), e ? !1 : this.accept.call(this.element[0], d.currentItem || d.element) ? (this.options.activeClass && this.element.removeClass(this.options.activeClass), this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("drop", b, this.ui(d)), this.element) : !1 }, ui: function (a) { return { draggable: a.currentItem || a.element, helper: a.helper, position: a.position, offset: a.positionAbs} } }), a.extend(a.ui.droppable, { version: "1.8.24" }), a.ui.intersect = function (b, c, d) { if (!c.offset) return !1; var e = (b.positionAbs || b.position.absolute).left, f = e + b.helperProportions.width, g = (b.positionAbs || b.position.absolute).top, h = g + b.helperProportions.height, i = c.offset.left, j = i + c.proportions.width, k = c.offset.top, l = k + c.proportions.height; switch (d) { case "fit": return i <= e && f <= j && k <= g && h <= l; case "intersect": return i < e + b.helperProportions.width / 2 && f - b.helperProportions.width / 2 < j && k < g + b.helperProportions.height / 2 && h - b.helperProportions.height / 2 < l; case "pointer": var m = (b.positionAbs || b.position.absolute).left + (b.clickOffset || b.offset.click).left, n = (b.positionAbs || b.position.absolute).top + (b.clickOffset || b.offset.click).top, o = a.ui.isOver(n, m, k, i, c.proportions.height, c.proportions.width); return o; case "touch": return (g >= k && g <= l || h >= k && h <= l || g < k && h > l) && (e >= i && e <= j || f >= i && f <= j || e < i && f > j); default: return !1 } }, a.ui.ddmanager = { current: null, droppables: { "default": [] }, prepareOffsets: function (b, c) { var d = a.ui.ddmanager.droppables[b.options.scope] || [], e = c ? c.type : null, f = (b.currentItem || b.element).find(":data(droppable)").andSelf(); g: for (var h = 0; h < d.length; h++) { if (d[h].options.disabled || b && !d[h].accept.call(d[h].element[0], b.currentItem || b.element)) continue; for (var i = 0; i < f.length; i++) if (f[i] == d[h].element[0]) { d[h].proportions.height = 0; continue g } d[h].visible = d[h].element.css("display") != "none"; if (!d[h].visible) continue; e == "mousedown" && d[h]._activate.call(d[h], c), d[h].offset = d[h].element.offset(), d[h].proportions = { width: d[h].element[0].offsetWidth, height: d[h].element[0].offsetHeight} } }, drop: function (b, c) { var d = !1; return a.each(a.ui.ddmanager.droppables[b.options.scope] || [], function () { if (!this.options) return; !this.options.disabled && this.visible && a.ui.intersect(b, this, this.options.tolerance) && (d = this._drop.call(this, c) || d), !this.options.disabled && this.visible && this.accept.call(this.element[0], b.currentItem || b.element) && (this.isout = 1, this.isover = 0, this._deactivate.call(this, c)) }), d }, dragStart: function (b, c) { b.element.parents(":not(body,html)").bind("scroll.droppable", function () { b.options.refreshPositions || a.ui.ddmanager.prepareOffsets(b, c) }) }, drag: function (b, c) { b.options.refreshPositions && a.ui.ddmanager.prepareOffsets(b, c), a.each(a.ui.ddmanager.droppables[b.options.scope] || [], function () { if (this.options.disabled || this.greedyChild || !this.visible) return; var d = a.ui.intersect(b, this, this.options.tolerance), e = !d && this.isover == 1 ? "isout" : d && this.isover == 0 ? "isover" : null; if (!e) return; var f; if (this.options.greedy) { var g = this.options.scope, h = this.element.parents(":data(droppable)").filter(function () { return a.data(this, "droppable").options.scope === g }); h.length && (f = a.data(h[0], "droppable"), f.greedyChild = e == "isover" ? 1 : 0) } f && e == "isover" && (f.isover = 0, f.isout = 1, f._out.call(f, c)), this[e] = 1, this[e == "isout" ? "isover" : "isout"] = 0, this[e == "isover" ? "_over" : "_out"].call(this, c), f && e == "isout" && (f.isout = 0, f.isover = 1, f._over.call(f, c)) }) }, dragStop: function (b, c) { b.element.parents(":not(body,html)").unbind("scroll.droppable"), b.options.refreshPositions || a.ui.ddmanager.prepareOffsets(b, c) } } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.resizable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.widget("ui.resizable", a.ui.mouse, { widgetEventPrefix: "resize", options: { alsoResize: !1, animate: !1, animateDuration: "slow", animateEasing: "swing", aspectRatio: !1, autoHide: !1, containment: !1, ghost: !1, grid: !1, handles: "e,s,se", helper: !1, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 1e3 }, _create: function () { var b = this, c = this.options; this.element.addClass("ui-resizable"), a.extend(this, { _aspectRatio: !!c.aspectRatio, aspectRatio: c.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: c.helper || c.ghost || c.animate ? c.helper || "ui-resizable-helper" : null }), this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i) && (this.element.wrap(a('
').css({ position: this.element.css("position"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css("top"), left: this.element.css("left") })), this.element = this.element.parent().data("resizable", this.element.data("resizable")), this.elementIsWrapper = !0, this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }), this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0 }), this.originalResizeStyle = this.originalElement.css("resize"), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" })), this.originalElement.css({ margin: this.originalElement.css("margin") }), this._proportionallyResize()), this.handles = c.handles || (a(".ui-resizable-handle", this.element).length ? { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw"} : "e,s,se"); if (this.handles.constructor == String) { this.handles == "all" && (this.handles = "n,e,s,w,se,sw,ne,nw"); var d = this.handles.split(","); this.handles = {}; for (var e = 0; e < d.length; e++) { var f = a.trim(d[e]), g = "ui-resizable-" + f, h = a('
'); h.css({ zIndex: c.zIndex }), "se" == f && h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[f] = ".ui-resizable-" + f, this.element.append(h) } } this._renderAxis = function (b) { b = b || this.element; for (var c in this.handles) { this.handles[c].constructor == String && (this.handles[c] = a(this.handles[c], this.element).show()); if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { var d = a(this.handles[c], this.element), e = 0; e = /sw|ne|nw|se|n|s/.test(c) ? d.outerHeight() : d.outerWidth(); var f = ["padding", /ne|nw|n/.test(c) ? "Top" : /se|sw|s/.test(c) ? "Bottom" : /^e$/.test(c) ? "Right" : "Left"].join(""); b.css(f, e), this._proportionallyResize() } if (!a(this.handles[c]).length) continue } }, this._renderAxis(this.element), this._handles = a(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function () { if (!b.resizing) { if (this.className) var a = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); b.axis = a && a[1] ? a[1] : "se" } }), c.autoHide && (this._handles.hide(), a(this.element).addClass("ui-resizable-autohide").hover(function () { if (c.disabled) return; a(this).removeClass("ui-resizable-autohide"), b._handles.show() }, function () { if (c.disabled) return; b.resizing || (a(this).addClass("ui-resizable-autohide"), b._handles.hide()) })), this._mouseInit() }, destroy: function () { this._mouseDestroy(); var b = function (b) { a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove() }; if (this.elementIsWrapper) { b(this.element); var c = this.element; c.after(this.originalElement.css({ position: c.css("position"), width: c.outerWidth(), height: c.outerHeight(), top: c.css("top"), left: c.css("left") })).remove() } return this.originalElement.css("resize", this.originalResizeStyle), b(this.originalElement), this }, _mouseCapture: function (b) { var c = !1; for (var d in this.handles) a(this.handles[d])[0] == b.target && (c = !0); return !this.options.disabled && c }, _mouseStart: function (b) { var d = this.options, e = this.element.position(), f = this.element; this.resizing = !0, this.documentScroll = { top: a(document).scrollTop(), left: a(document).scrollLeft() }, (f.is(".ui-draggable") || /absolute/.test(f.css("position"))) && f.css({ position: "absolute", top: e.top, left: e.left }), this._renderProxy(); var g = c(this.helper.css("left")), h = c(this.helper.css("top")); d.containment && (g += a(d.containment).scrollLeft() || 0, h += a(d.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = { left: g, top: h }, this.size = this._helper ? { width: f.outerWidth(), height: f.outerHeight()} : { width: f.width(), height: f.height() }, this.originalSize = this._helper ? { width: f.outerWidth(), height: f.outerHeight()} : { width: f.width(), height: f.height() }, this.originalPosition = { left: g, top: h }, this.sizeDiff = { width: f.outerWidth() - f.width(), height: f.outerHeight() - f.height() }, this.originalMousePosition = { left: b.pageX, top: b.pageY }, this.aspectRatio = typeof d.aspectRatio == "number" ? d.aspectRatio : this.originalSize.width / this.originalSize.height || 1; var i = a(".ui-resizable-" + this.axis).css("cursor"); return a("body").css("cursor", i == "auto" ? this.axis + "-resize" : i), f.addClass("ui-resizable-resizing"), this._propagate("start", b), !0 }, _mouseDrag: function (b) { var c = this.helper, d = this.options, e = {}, f = this, g = this.originalMousePosition, h = this.axis, i = b.pageX - g.left || 0, j = b.pageY - g.top || 0, k = this._change[h]; if (!k) return !1; var l = k.apply(this, [b, i, j]), m = a.browser.msie && a.browser.version < 7, n = this.sizeDiff; this._updateVirtualBoundaries(b.shiftKey); if (this._aspectRatio || b.shiftKey) l = this._updateRatio(l, b); return l = this._respectSize(l, b), this._propagate("resize", b), c.css({ top: this.position.top + "px", left: this.position.left + "px", width: this.size.width + "px", height: this.size.height + "px" }), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), this._updateCache(l), this._trigger("resize", b, this.ui()), !1 }, _mouseStop: function (b) { this.resizing = !1; var c = this.options, d = this; if (this._helper) { var e = this._proportionallyResizeElements, f = e.length && /textarea/i.test(e[0].nodeName), g = f && a.ui.hasScroll(e[0], "left") ? 0 : d.sizeDiff.height, h = f ? 0 : d.sizeDiff.width, i = { width: d.helper.width() - h, height: d.helper.height() - g }, j = parseInt(d.element.css("left"), 10) + (d.position.left - d.originalPosition.left) || null, k = parseInt(d.element.css("top"), 10) + (d.position.top - d.originalPosition.top) || null; c.animate || this.element.css(a.extend(i, { top: k, left: j })), d.helper.height(d.size.height), d.helper.width(d.size.width), this._helper && !c.animate && this._proportionallyResize() } return a("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", b), this._helper && this.helper.remove(), !1 }, _updateVirtualBoundaries: function (a) { var b = this.options, c, e, f, g, h; h = { minWidth: d(b.minWidth) ? b.minWidth : 0, maxWidth: d(b.maxWidth) ? b.maxWidth : Infinity, minHeight: d(b.minHeight) ? b.minHeight : 0, maxHeight: d(b.maxHeight) ? b.maxHeight : Infinity }; if (this._aspectRatio || a) c = h.minHeight * this.aspectRatio, f = h.minWidth / this.aspectRatio, e = h.maxHeight * this.aspectRatio, g = h.maxWidth / this.aspectRatio, c > h.minWidth && (h.minWidth = c), f > h.minHeight && (h.minHeight = f), e < h.maxWidth && (h.maxWidth = e), g < h.maxHeight && (h.maxHeight = g); this._vBoundaries = h }, _updateCache: function (a) { var b = this.options; this.offset = this.helper.offset(), d(a.left) && (this.position.left = a.left), d(a.top) && (this.position.top = a.top), d(a.height) && (this.size.height = a.height), d(a.width) && (this.size.width = a.width) }, _updateRatio: function (a, b) { var c = this.options, e = this.position, f = this.size, g = this.axis; return d(a.height) ? a.width = a.height * this.aspectRatio : d(a.width) && (a.height = a.width / this.aspectRatio), g == "sw" && (a.left = e.left + (f.width - a.width), a.top = null), g == "nw" && (a.top = e.top + (f.height - a.height), a.left = e.left + (f.width - a.width)), a }, _respectSize: function (a, b) { var c = this.helper, e = this._vBoundaries, f = this._aspectRatio || b.shiftKey, g = this.axis, h = d(a.width) && e.maxWidth && e.maxWidth < a.width, i = d(a.height) && e.maxHeight && e.maxHeight < a.height, j = d(a.width) && e.minWidth && e.minWidth > a.width, k = d(a.height) && e.minHeight && e.minHeight > a.height; j && (a.width = e.minWidth), k && (a.height = e.minHeight), h && (a.width = e.maxWidth), i && (a.height = e.maxHeight); var l = this.originalPosition.left + this.originalSize.width, m = this.position.top + this.size.height, n = /sw|nw|w/.test(g), o = /nw|ne|n/.test(g); j && n && (a.left = l - e.minWidth), h && n && (a.left = l - e.maxWidth), k && o && (a.top = m - e.minHeight), i && o && (a.top = m - e.maxHeight); var p = !a.width && !a.height; return p && !a.left && a.top ? a.top = null : p && !a.top && a.left && (a.left = null), a }, _proportionallyResize: function () { var b = this.options; if (!this._proportionallyResizeElements.length) return; var c = this.helper || this.element; for (var d = 0; d < this._proportionallyResizeElements.length; d++) { var e = this._proportionallyResizeElements[d]; if (!this.borderDif) { var f = [e.css("borderTopWidth"), e.css("borderRightWidth"), e.css("borderBottomWidth"), e.css("borderLeftWidth")], g = [e.css("paddingTop"), e.css("paddingRight"), e.css("paddingBottom"), e.css("paddingLeft")]; this.borderDif = a.map(f, function (a, b) { var c = parseInt(a, 10) || 0, d = parseInt(g[b], 10) || 0; return c + d }) } if (!a.browser.msie || !a(c).is(":hidden") && !a(c).parents(":hidden").length) e.css({ height: c.height() - this.borderDif[0] - this.borderDif[2] || 0, width: c.width() - this.borderDif[1] - this.borderDif[3] || 0 }); else continue } }, _renderProxy: function () { var b = this.element, c = this.options; this.elementOffset = b.offset(); if (this._helper) { this.helper = this.helper || a('
'); var d = a.browser.msie && a.browser.version < 7, e = d ? 1 : 0, f = d ? 2 : -1; this.helper.addClass(this._helper).css({ width: this.element.outerWidth() + f, height: this.element.outerHeight() + f, position: "absolute", left: this.elementOffset.left - e + "px", top: this.elementOffset.top - e + "px", zIndex: ++c.zIndex }), this.helper.appendTo("body").disableSelection() } else this.helper = this.element }, _change: { e: function (a, b, c) { return { width: this.originalSize.width + b} }, w: function (a, b, c) { var d = this.options, e = this.originalSize, f = this.originalPosition; return { left: f.left + b, width: e.width - b} }, n: function (a, b, c) { var d = this.options, e = this.originalSize, f = this.originalPosition; return { top: f.top + c, height: e.height - c} }, s: function (a, b, c) { return { height: this.originalSize.height + c} }, se: function (b, c, d) { return a.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [b, c, d])) }, sw: function (b, c, d) { return a.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [b, c, d])) }, ne: function (b, c, d) { return a.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [b, c, d])) }, nw: function (b, c, d) { return a.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [b, c, d])) } }, _propagate: function (b, c) { a.ui.plugin.call(this, b, [c, this.ui()]), b != "resize" && this._trigger(b, c, this.ui()) }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition} } }), a.extend(a.ui.resizable, { version: "1.8.24" }), a.ui.plugin.add("resizable", "alsoResize", { start: function (b, c) { var d = a(this).data("resizable"), e = d.options, f = function (b) { a(b).each(function () { var b = a(this); b.data("resizable-alsoresize", { width: parseInt(b.width(), 10), height: parseInt(b.height(), 10), left: parseInt(b.css("left"), 10), top: parseInt(b.css("top"), 10) }) }) }; typeof e.alsoResize == "object" && !e.alsoResize.parentNode ? e.alsoResize.length ? (e.alsoResize = e.alsoResize[0], f(e.alsoResize)) : a.each(e.alsoResize, function (a) { f(a) }) : f(e.alsoResize) }, resize: function (b, c) { var d = a(this).data("resizable"), e = d.options, f = d.originalSize, g = d.originalPosition, h = { height: d.size.height - f.height || 0, width: d.size.width - f.width || 0, top: d.position.top - g.top || 0, left: d.position.left - g.left || 0 }, i = function (b, d) { a(b).each(function () { var b = a(this), e = a(this).data("resizable-alsoresize"), f = {}, g = d && d.length ? d : b.parents(c.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; a.each(g, function (a, b) { var c = (e[b] || 0) + (h[b] || 0); c && c >= 0 && (f[b] = c || null) }), b.css(f) }) }; typeof e.alsoResize == "object" && !e.alsoResize.nodeType ? a.each(e.alsoResize, function (a, b) { i(a, b) }) : i(e.alsoResize) }, stop: function (b, c) { a(this).removeData("resizable-alsoresize") } }), a.ui.plugin.add("resizable", "animate", { stop: function (b, c) { var d = a(this).data("resizable"), e = d.options, f = d._proportionallyResizeElements, g = f.length && /textarea/i.test(f[0].nodeName), h = g && a.ui.hasScroll(f[0], "left") ? 0 : d.sizeDiff.height, i = g ? 0 : d.sizeDiff.width, j = { width: d.size.width - i, height: d.size.height - h }, k = parseInt(d.element.css("left"), 10) + (d.position.left - d.originalPosition.left) || null, l = parseInt(d.element.css("top"), 10) + (d.position.top - d.originalPosition.top) || null; d.element.animate(a.extend(j, l && k ? { top: l, left: k} : {}), { duration: e.animateDuration, easing: e.animateEasing, step: function () { var c = { width: parseInt(d.element.css("width"), 10), height: parseInt(d.element.css("height"), 10), top: parseInt(d.element.css("top"), 10), left: parseInt(d.element.css("left"), 10) }; f && f.length && a(f[0]).css({ width: c.width, height: c.height }), d._updateCache(c), d._propagate("resize", b) } }) } }), a.ui.plugin.add("resizable", "containment", { start: function (b, d) { var e = a(this).data("resizable"), f = e.options, g = e.element, h = f.containment, i = h instanceof a ? h.get(0) : /parent/.test(h) ? g.parent().get(0) : h; if (!i) return; e.containerElement = a(i); if (/document/.test(h) || h == document) e.containerOffset = { left: 0, top: 0 }, e.containerPosition = { left: 0, top: 0 }, e.parentData = { element: a(document), left: 0, top: 0, width: a(document).width(), height: a(document).height() || document.body.parentNode.scrollHeight }; else { var j = a(i), k = []; a(["Top", "Right", "Left", "Bottom"]).each(function (a, b) { k[a] = c(j.css("padding" + b)) }), e.containerOffset = j.offset(), e.containerPosition = j.position(), e.containerSize = { height: j.innerHeight() - k[3], width: j.innerWidth() - k[1] }; var l = e.containerOffset, m = e.containerSize.height, n = e.containerSize.width, o = a.ui.hasScroll(i, "left") ? i.scrollWidth : n, p = a.ui.hasScroll(i) ? i.scrollHeight : m; e.parentData = { element: i, left: l.left, top: l.top, width: o, height: p} } }, resize: function (b, c) { var d = a(this).data("resizable"), e = d.options, f = d.containerSize, g = d.containerOffset, h = d.size, i = d.position, j = d._aspectRatio || b.shiftKey, k = { top: 0, left: 0 }, l = d.containerElement; l[0] != document && /static/.test(l.css("position")) && (k = g), i.left < (d._helper ? g.left : 0) && (d.size.width = d.size.width + (d._helper ? d.position.left - g.left : d.position.left - k.left), j && (d.size.height = d.size.width / d.aspectRatio), d.position.left = e.helper ? g.left : 0), i.top < (d._helper ? g.top : 0) && (d.size.height = d.size.height + (d._helper ? d.position.top - g.top : d.position.top), j && (d.size.width = d.size.height * d.aspectRatio), d.position.top = d._helper ? g.top : 0), d.offset.left = d.parentData.left + d.position.left, d.offset.top = d.parentData.top + d.position.top; var m = Math.abs((d._helper ? d.offset.left - k.left : d.offset.left - k.left) + d.sizeDiff.width), n = Math.abs((d._helper ? d.offset.top - k.top : d.offset.top - g.top) + d.sizeDiff.height), o = d.containerElement.get(0) == d.element.parent().get(0), p = /relative|absolute/.test(d.containerElement.css("position")); o && p && (m -= d.parentData.left), m + d.size.width >= d.parentData.width && (d.size.width = d.parentData.width - m, j && (d.size.height = d.size.width / d.aspectRatio)), n + d.size.height >= d.parentData.height && (d.size.height = d.parentData.height - n, j && (d.size.width = d.size.height * d.aspectRatio)) }, stop: function (b, c) { var d = a(this).data("resizable"), e = d.options, f = d.position, g = d.containerOffset, h = d.containerPosition, i = d.containerElement, j = a(d.helper), k = j.offset(), l = j.outerWidth() - d.sizeDiff.width, m = j.outerHeight() - d.sizeDiff.height; d._helper && !e.animate && /relative/.test(i.css("position")) && a(this).css({ left: k.left - h.left - g.left, width: l, height: m }), d._helper && !e.animate && /static/.test(i.css("position")) && a(this).css({ left: k.left - h.left - g.left, width: l, height: m }) } }), a.ui.plugin.add("resizable", "ghost", { start: function (b, c) { var d = a(this).data("resizable"), e = d.options, f = d.size; d.ghost = d.originalElement.clone(), d.ghost.css({ opacity: .25, display: "block", position: "relative", height: f.height, width: f.width, margin: 0, left: 0, top: 0 }).addClass("ui-resizable-ghost").addClass(typeof e.ghost == "string" ? e.ghost : ""), d.ghost.appendTo(d.helper) }, resize: function (b, c) { var d = a(this).data("resizable"), e = d.options; d.ghost && d.ghost.css({ position: "relative", height: d.size.height, width: d.size.width }) }, stop: function (b, c) { var d = a(this).data("resizable"), e = d.options; d.ghost && d.helper && d.helper.get(0).removeChild(d.ghost.get(0)) } }), a.ui.plugin.add("resizable", "grid", { resize: function (b, c) { var d = a(this).data("resizable"), e = d.options, f = d.size, g = d.originalSize, h = d.originalPosition, i = d.axis, j = e._aspectRatio || b.shiftKey; e.grid = typeof e.grid == "number" ? [e.grid, e.grid] : e.grid; var k = Math.round((f.width - g.width) / (e.grid[0] || 1)) * (e.grid[0] || 1), l = Math.round((f.height - g.height) / (e.grid[1] || 1)) * (e.grid[1] || 1); /^(se|s|e)$/.test(i) ? (d.size.width = g.width + k, d.size.height = g.height + l) : /^(ne)$/.test(i) ? (d.size.width = g.width + k, d.size.height = g.height + l, d.position.top = h.top - l) : /^(sw)$/.test(i) ? (d.size.width = g.width + k, d.size.height = g.height + l, d.position.left = h.left - k) : (d.size.width = g.width + k, d.size.height = g.height + l, d.position.top = h.top - l, d.position.left = h.left - k) } }); var c = function (a) { return parseInt(a, 10) || 0 }, d = function (a) { return !isNaN(parseInt(a, 10)) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.selectable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.widget("ui.selectable", a.ui.mouse, { options: { appendTo: "body", autoRefresh: !0, distance: 0, filter: "*", tolerance: "touch" }, _create: function () { var b = this; this.element.addClass("ui-selectable"), this.dragged = !1; var c; this.refresh = function () { c = a(b.options.filter, b.element[0]), c.addClass("ui-selectee"), c.each(function () { var b = a(this), c = b.offset(); a.data(this, "selectable-item", { element: this, $element: b, left: c.left, top: c.top, right: c.left + b.outerWidth(), bottom: c.top + b.outerHeight(), startselected: !1, selected: b.hasClass("ui-selected"), selecting: b.hasClass("ui-selecting"), unselecting: b.hasClass("ui-unselecting") }) }) }, this.refresh(), this.selectees = c.addClass("ui-selectee"), this._mouseInit(), this.helper = a("
") }, destroy: function () { return this.selectees.removeClass("ui-selectee").removeData("selectable-item"), this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"), this._mouseDestroy(), this }, _mouseStart: function (b) { var c = this; this.opos = [b.pageX, b.pageY]; if (this.options.disabled) return; var d = this.options; this.selectees = a(d.filter, this.element[0]), this._trigger("start", b), a(d.appendTo).append(this.helper), this.helper.css({ left: b.clientX, top: b.clientY, width: 0, height: 0 }), d.autoRefresh && this.refresh(), this.selectees.filter(".ui-selected").each(function () { var d = a.data(this, "selectable-item"); d.startselected = !0, !b.metaKey && !b.ctrlKey && (d.$element.removeClass("ui-selected"), d.selected = !1, d.$element.addClass("ui-unselecting"), d.unselecting = !0, c._trigger("unselecting", b, { unselecting: d.element })) }), a(b.target).parents().andSelf().each(function () { var d = a.data(this, "selectable-item"); if (d) { var e = !b.metaKey && !b.ctrlKey || !d.$element.hasClass("ui-selected"); return d.$element.removeClass(e ? "ui-unselecting" : "ui-selected").addClass(e ? "ui-selecting" : "ui-unselecting"), d.unselecting = !e, d.selecting = e, d.selected = e, e ? c._trigger("selecting", b, { selecting: d.element }) : c._trigger("unselecting", b, { unselecting: d.element }), !1 } }) }, _mouseDrag: function (b) { var c = this; this.dragged = !0; if (this.options.disabled) return; var d = this.options, e = this.opos[0], f = this.opos[1], g = b.pageX, h = b.pageY; if (e > g) { var i = g; g = e, e = i } if (f > h) { var i = h; h = f, f = i } return this.helper.css({ left: e, top: f, width: g - e, height: h - f }), this.selectees.each(function () { var i = a.data(this, "selectable-item"); if (!i || i.element == c.element[0]) return; var j = !1; d.tolerance == "touch" ? j = !(i.left > g || i.right < e || i.top > h || i.bottom < f) : d.tolerance == "fit" && (j = i.left > e && i.right < g && i.top > f && i.bottom < h), j ? (i.selected && (i.$element.removeClass("ui-selected"), i.selected = !1), i.unselecting && (i.$element.removeClass("ui-unselecting"), i.unselecting = !1), i.selecting || (i.$element.addClass("ui-selecting"), i.selecting = !0, c._trigger("selecting", b, { selecting: i.element }))) : (i.selecting && ((b.metaKey || b.ctrlKey) && i.startselected ? (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.$element.addClass("ui-selected"), i.selected = !0) : (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.startselected && (i.$element.addClass("ui-unselecting"), i.unselecting = !0), c._trigger("unselecting", b, { unselecting: i.element }))), i.selected && !b.metaKey && !b.ctrlKey && !i.startselected && (i.$element.removeClass("ui-selected"), i.selected = !1, i.$element.addClass("ui-unselecting"), i.unselecting = !0, c._trigger("unselecting", b, { unselecting: i.element }))) }), !1 }, _mouseStop: function (b) { var c = this; this.dragged = !1; var d = this.options; return a(".ui-unselecting", this.element[0]).each(function () { var d = a.data(this, "selectable-item"); d.$element.removeClass("ui-unselecting"), d.unselecting = !1, d.startselected = !1, c._trigger("unselected", b, { unselected: d.element }) }), a(".ui-selecting", this.element[0]).each(function () { var d = a.data(this, "selectable-item"); d.$element.removeClass("ui-selecting").addClass("ui-selected"), d.selecting = !1, d.selected = !0, d.startselected = !0, c._trigger("selected", b, { selected: d.element }) }), this._trigger("stop", b), this.helper.remove(), !1 } }), a.extend(a.ui.selectable, { version: "1.8.24" }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.sortable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.widget("ui.sortable", a.ui.mouse, { widgetEventPrefix: "sort", ready: !1, options: { appendTo: "parent", axis: !1, connectWith: !1, containment: !1, cursor: "auto", cursorAt: !1, dropOnEmpty: !0, forcePlaceholderSize: !1, forceHelperSize: !1, grid: !1, handle: !1, helper: "original", items: "> *", opacity: !1, placeholder: !1, revert: !1, scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1e3 }, _create: function () { var a = this.options; this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = this.items.length ? a.axis === "x" || /left|right/.test(this.items[0].item.css("float")) || /inline|table-cell/.test(this.items[0].item.css("display")) : !1, this.offset = this.element.offset(), this._mouseInit(), this.ready = !0 }, destroy: function () { a.Widget.prototype.destroy.call(this), this.element.removeClass("ui-sortable ui-sortable-disabled"), this._mouseDestroy(); for (var b = this.items.length - 1; b >= 0; b--) this.items[b].item.removeData(this.widgetName + "-item"); return this }, _setOption: function (b, c) { b === "disabled" ? (this.options[b] = c, this.widget()[c ? "addClass" : "removeClass"]("ui-sortable-disabled")) : a.Widget.prototype._setOption.apply(this, arguments) }, _mouseCapture: function (b, c) { var d = this; if (this.reverting) return !1; if (this.options.disabled || this.options.type == "static") return !1; this._refreshItems(b); var e = null, f = this, g = a(b.target).parents().each(function () { if (a.data(this, d.widgetName + "-item") == f) return e = a(this), !1 }); a.data(b.target, d.widgetName + "-item") == f && (e = a(b.target)); if (!e) return !1; if (this.options.handle && !c) { var h = !1; a(this.options.handle, e).find("*").andSelf().each(function () { this == b.target && (h = !0) }); if (!h) return !1 } return this.currentItem = e, this._removeCurrentsFromItems(), !0 }, _mouseStart: function (b, c, d) { var e = this.options, f = this; this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(b), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, a.extend(this.offset, { click: { left: b.pageX - this.offset.left, top: b.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(b), this.originalPageX = b.pageX, this.originalPageY = b.pageY, e.cursorAt && this._adjustOffsetFromHelper(e.cursorAt), this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }, this.helper[0] != this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), e.containment && this._setContainment(), e.cursor && (a("body").css("cursor") && (this._storedCursor = a("body").css("cursor")), a("body").css("cursor", e.cursor)), e.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", e.opacity)), e.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", e.zIndex)), this.scrollParent[0] != document && this.scrollParent[0].tagName != "HTML" && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", b, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(); if (!d) for (var g = this.containers.length - 1; g >= 0; g--) this.containers[g]._trigger("activate", b, f._uiHash(this)); return a.ui.ddmanager && (a.ui.ddmanager.current = this), a.ui.ddmanager && !e.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, b), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(b), !0 }, _mouseDrag: function (b) { this.position = this._generatePosition(b), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs); if (this.options.scroll) { var c = this.options, d = !1; this.scrollParent[0] != document && this.scrollParent[0].tagName != "HTML" ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - b.pageY < c.scrollSensitivity ? this.scrollParent[0].scrollTop = d = this.scrollParent[0].scrollTop + c.scrollSpeed : b.pageY - this.overflowOffset.top < c.scrollSensitivity && (this.scrollParent[0].scrollTop = d = this.scrollParent[0].scrollTop - c.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - b.pageX < c.scrollSensitivity ? this.scrollParent[0].scrollLeft = d = this.scrollParent[0].scrollLeft + c.scrollSpeed : b.pageX - this.overflowOffset.left < c.scrollSensitivity && (this.scrollParent[0].scrollLeft = d = this.scrollParent[0].scrollLeft - c.scrollSpeed)) : (b.pageY - a(document).scrollTop() < c.scrollSensitivity ? d = a(document).scrollTop(a(document).scrollTop() - c.scrollSpeed) : a(window).height() - (b.pageY - a(document).scrollTop()) < c.scrollSensitivity && (d = a(document).scrollTop(a(document).scrollTop() + c.scrollSpeed)), b.pageX - a(document).scrollLeft() < c.scrollSensitivity ? d = a(document).scrollLeft(a(document).scrollLeft() - c.scrollSpeed) : a(window).width() - (b.pageX - a(document).scrollLeft()) < c.scrollSensitivity && (d = a(document).scrollLeft(a(document).scrollLeft() + c.scrollSpeed))), d !== !1 && a.ui.ddmanager && !c.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, b) } this.positionAbs = this._convertPositionTo("absolute"); if (!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left + "px"; if (!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top + "px"; for (var e = this.items.length - 1; e >= 0; e--) { var f = this.items[e], g = f.item[0], h = this._intersectsWithPointer(f); if (!h) continue; if (f.instance !== this.currentContainer) continue; if (g != this.currentItem[0] && this.placeholder[h == 1 ? "next" : "prev"]()[0] != g && !a.ui.contains(this.placeholder[0], g) && (this.options.type == "semi-dynamic" ? !a.ui.contains(this.element[0], g) : !0)) { this.direction = h == 1 ? "down" : "up"; if (this.options.tolerance == "pointer" || this._intersectsWithSides(f)) this._rearrange(b, f); else break; this._trigger("change", b, this._uiHash()); break } } return this._contactContainers(b), a.ui.ddmanager && a.ui.ddmanager.drag(this, b), this._trigger("sort", b, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 }, _mouseStop: function (b, c) { if (!b) return; a.ui.ddmanager && !this.options.dropBehaviour && a.ui.ddmanager.drop(this, b); if (this.options.revert) { var d = this, e = d.placeholder.offset(); d.reverting = !0, a(this.helper).animate({ left: e.left - this.offset.parent.left - d.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), top: e.top - this.offset.parent.top - d.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) }, parseInt(this.options.revert, 10) || 500, function () { d._clear(b) }) } else this._clear(b, c); return !1 }, cancel: function () { var b = this; if (this.dragging) { this._mouseUp({ target: null }), this.options.helper == "original" ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show(); for (var c = this.containers.length - 1; c >= 0; c--) this.containers[c]._trigger("deactivate", null, b._uiHash(this)), this.containers[c].containerCache.over && (this.containers[c]._trigger("out", null, b._uiHash(this)), this.containers[c].containerCache.over = 0) } return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.options.helper != "original" && this.helper && this.helper[0].parentNode && this.helper.remove(), a.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null }), this.domPosition.prev ? a(this.domPosition.prev).after(this.currentItem) : a(this.domPosition.parent).prepend(this.currentItem)), this }, serialize: function (b) { var c = this._getItemsAsjQuery(b && b.connected), d = []; return b = b || {}, a(c).each(function () { var c = (a(b.item || this).attr(b.attribute || "id") || "").match(b.expression || /(.+)[-=_](.+)/); c && d.push((b.key || c[1] + "[]") + "=" + (b.key && b.expression ? c[1] : c[2])) }), !d.length && b.key && d.push(b.key + "="), d.join("&") }, toArray: function (b) { var c = this._getItemsAsjQuery(b && b.connected), d = []; return b = b || {}, c.each(function () { d.push(a(b.item || this).attr(b.attribute || "id") || "") }), d }, _intersectsWith: function (a) { var b = this.positionAbs.left, c = b + this.helperProportions.width, d = this.positionAbs.top, e = d + this.helperProportions.height, f = a.left, g = f + a.width, h = a.top, i = h + a.height, j = this.offset.click.top, k = this.offset.click.left, l = d + j > h && d + j < i && b + k > f && b + k < g; return this.options.tolerance == "pointer" || this.options.forcePointerForContainers || this.options.tolerance != "pointer" && this.helperProportions[this.floating ? "width" : "height"] > a[this.floating ? "width" : "height"] ? l : f < b + this.helperProportions.width / 2 && c - this.helperProportions.width / 2 < g && h < d + this.helperProportions.height / 2 && e - this.helperProportions.height / 2 < i }, _intersectsWithPointer: function (b) { var c = this.options.axis === "x" || a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, b.top, b.height), d = this.options.axis === "y" || a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, b.left, b.width), e = c && d, f = this._getDragVerticalDirection(), g = this._getDragHorizontalDirection(); return e ? this.floating ? g && g == "right" || f == "down" ? 2 : 1 : f && (f == "down" ? 2 : 1) : !1 }, _intersectsWithSides: function (b) { var c = a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, b.top + b.height / 2, b.height), d = a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, b.left + b.width / 2, b.width), e = this._getDragVerticalDirection(), f = this._getDragHorizontalDirection(); return this.floating && f ? f == "right" && d || f == "left" && !d : e && (e == "down" && c || e == "up" && !c) }, _getDragVerticalDirection: function () { var a = this.positionAbs.top - this.lastPositionAbs.top; return a != 0 && (a > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var a = this.positionAbs.left - this.lastPositionAbs.left; return a != 0 && (a > 0 ? "right" : "left") }, refresh: function (a) { return this._refreshItems(a), this.refreshPositions(), this }, _connectWith: function () { var a = this.options; return a.connectWith.constructor == String ? [a.connectWith] : a.connectWith }, _getItemsAsjQuery: function (b) { var c = this, d = [], e = [], f = this._connectWith(); if (f && b) for (var g = f.length - 1; g >= 0; g--) { var h = a(f[g]); for (var i = h.length - 1; i >= 0; i--) { var j = a.data(h[i], this.widgetName); j && j != this && !j.options.disabled && e.push([a.isFunction(j.options.items) ? j.options.items.call(j.element) : a(j.options.items, j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), j]) } } e.push([a.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : a(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]); for (var g = e.length - 1; g >= 0; g--) e[g][0].each(function () { d.push(this) }); return a(d) }, _removeCurrentsFromItems: function () { var a = this.currentItem.find(":data(" + this.widgetName + "-item)"); for (var b = 0; b < this.items.length; b++) for (var c = 0; c < a.length; c++) a[c] == this.items[b].item[0] && this.items.splice(b, 1) }, _refreshItems: function (b) { this.items = [], this.containers = [this]; var c = this.items, d = this, e = [[a.isFunction(this.options.items) ? this.options.items.call(this.element[0], b, { item: this.currentItem }) : a(this.options.items, this.element), this]], f = this._connectWith(); if (f && this.ready) for (var g = f.length - 1; g >= 0; g--) { var h = a(f[g]); for (var i = h.length - 1; i >= 0; i--) { var j = a.data(h[i], this.widgetName); j && j != this && !j.options.disabled && (e.push([a.isFunction(j.options.items) ? j.options.items.call(j.element[0], b, { item: this.currentItem }) : a(j.options.items, j.element), j]), this.containers.push(j)) } } for (var g = e.length - 1; g >= 0; g--) { var k = e[g][1], l = e[g][0]; for (var i = 0, m = l.length; i < m; i++) { var n = a(l[i]); n.data(this.widgetName + "-item", k), c.push({ item: n, instance: k, width: 0, height: 0, left: 0, top: 0 }) } } }, refreshPositions: function (b) { this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); for (var c = this.items.length - 1; c >= 0; c--) { var d = this.items[c]; if (d.instance != this.currentContainer && this.currentContainer && d.item[0] != this.currentItem[0]) continue; var e = this.options.toleranceElement ? a(this.options.toleranceElement, d.item) : d.item; b || (d.width = e.outerWidth(), d.height = e.outerHeight()); var f = e.offset(); d.left = f.left, d.top = f.top } if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (var c = this.containers.length - 1; c >= 0; c--) { var f = this.containers[c].element.offset(); this.containers[c].containerCache.left = f.left, this.containers[c].containerCache.top = f.top, this.containers[c].containerCache.width = this.containers[c].element.outerWidth(), this.containers[c].containerCache.height = this.containers[c].element.outerHeight() } return this }, _createPlaceholder: function (b) { var c = b || this, d = c.options; if (!d.placeholder || d.placeholder.constructor == String) { var e = d.placeholder; d.placeholder = { element: function () { var b = a(document.createElement(c.currentItem[0].nodeName)).addClass(e || c.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; return e || (b.style.visibility = "hidden"), b }, update: function (a, b) { if (e && !d.forcePlaceholderSize) return; b.height() || b.height(c.currentItem.innerHeight() - parseInt(c.currentItem.css("paddingTop") || 0, 10) - parseInt(c.currentItem.css("paddingBottom") || 0, 10)), b.width() || b.width(c.currentItem.innerWidth() - parseInt(c.currentItem.css("paddingLeft") || 0, 10) - parseInt(c.currentItem.css("paddingRight") || 0, 10)) } } } c.placeholder = a(d.placeholder.element.call(c.element, c.currentItem)), c.currentItem.after(c.placeholder), d.placeholder.update(c, c.placeholder) }, _contactContainers: function (b) { var c = null, d = null; for (var e = this.containers.length - 1; e >= 0; e--) { if (a.ui.contains(this.currentItem[0], this.containers[e].element[0])) continue; if (this._intersectsWith(this.containers[e].containerCache)) { if (c && a.ui.contains(this.containers[e].element[0], c.element[0])) continue; c = this.containers[e], d = e } else this.containers[e].containerCache.over && (this.containers[e]._trigger("out", b, this._uiHash(this)), this.containers[e].containerCache.over = 0) } if (!c) return; if (this.containers.length === 1) this.containers[d]._trigger("over", b, this._uiHash(this)), this.containers[d].containerCache.over = 1; else if (this.currentContainer != this.containers[d]) { var f = 1e4, g = null, h = this.positionAbs[this.containers[d].floating ? "left" : "top"]; for (var i = this.items.length - 1; i >= 0; i--) { if (!a.ui.contains(this.containers[d].element[0], this.items[i].item[0])) continue; var j = this.containers[d].floating ? this.items[i].item.offset().left : this.items[i].item.offset().top; Math.abs(j - h) < f && (f = Math.abs(j - h), g = this.items[i], this.direction = j - h > 0 ? "down" : "up") } if (!g && !this.options.dropOnEmpty) return; this.currentContainer = this.containers[d], g ? this._rearrange(b, g, null, !0) : this._rearrange(b, null, this.containers[d].element, !0), this._trigger("change", b, this._uiHash()), this.containers[d]._trigger("change", b, this._uiHash(this)), this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[d]._trigger("over", b, this._uiHash(this)), this.containers[d].containerCache.over = 1 } }, _createHelper: function (b) { var c = this.options, d = a.isFunction(c.helper) ? a(c.helper.apply(this.element[0], [b, this.currentItem])) : c.helper == "clone" ? this.currentItem.clone() : this.currentItem; return d.parents("body").length || a(c.appendTo != "parent" ? c.appendTo : this.currentItem[0].parentNode)[0].appendChild(d[0]), d[0] == this.currentItem[0] && (this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }), (d[0].style.width == "" || c.forceHelperSize) && d.width(this.currentItem.width()), (d[0].style.height == "" || c.forceHelperSize) && d.height(this.currentItem.height()), d }, _adjustOffsetFromHelper: function (b) { typeof b == "string" && (b = b.split(" ")), a.isArray(b) && (b = { left: +b[0], top: +b[1] || 0 }), "left" in b && (this.offset.click.left = b.left + this.margins.left), "right" in b && (this.offset.click.left = this.helperProportions.width - b.right + this.margins.left), "top" in b && (this.offset.click.top = b.top + this.margins.top), "bottom" in b && (this.offset.click.top = this.helperProportions.height - b.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var b = this.offsetParent.offset(); this.cssPosition == "absolute" && this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0]) && (b.left += this.scrollParent.scrollLeft(), b.top += this.scrollParent.scrollTop()); if (this.offsetParent[0] == document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie) b = { top: 0, left: 0 }; return { top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var a = this.currentItem.position(); return { top: a.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: a.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} } return { top: 0, left: 0} }, _cacheMargins: function () { this.margins = { left: parseInt(this.currentItem.css("marginLeft"), 10) || 0, top: parseInt(this.currentItem.css("marginTop"), 10) || 0} }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight()} }, _setContainment: function () { var b = this.options; b.containment == "parent" && (b.containment = this.helper[0].parentNode); if (b.containment == "document" || b.containment == "window") this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a(b.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (a(b.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; if (!/^(document|window|parent)$/.test(b.containment)) { var c = a(b.containment)[0], d = a(b.containment).offset(), e = a(c).css("overflow") != "hidden"; this.containment = [d.left + (parseInt(a(c).css("borderLeftWidth"), 10) || 0) + (parseInt(a(c).css("paddingLeft"), 10) || 0) - this.margins.left, d.top + (parseInt(a(c).css("borderTopWidth"), 10) || 0) + (parseInt(a(c).css("paddingTop"), 10) || 0) - this.margins.top, d.left + (e ? Math.max(c.scrollWidth, c.offsetWidth) : c.offsetWidth) - (parseInt(a(c).css("borderLeftWidth"), 10) || 0) - (parseInt(a(c).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, d.top + (e ? Math.max(c.scrollHeight, c.offsetHeight) : c.offsetHeight) - (parseInt(a(c).css("borderTopWidth"), 10) || 0) - (parseInt(a(c).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top] } }, _convertPositionTo: function (b, c) { c || (c = this.position); var d = b == "absolute" ? 1 : -1, e = this.options, f = this.cssPosition == "absolute" && (this.scrollParent[0] == document || !a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, g = /(html|body)/i.test(f[0].tagName); return { top: c.top + this.offset.relative.top * d + this.offset.parent.top * d - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : g ? 0 : f.scrollTop()) * d), left: c.left + this.offset.relative.left * d + this.offset.parent.left * d - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : g ? 0 : f.scrollLeft()) * d)} }, _generatePosition: function (b) { var c = this.options, d = this.cssPosition == "absolute" && (this.scrollParent[0] == document || !a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, e = /(html|body)/i.test(d[0].tagName); this.cssPosition == "relative" && (this.scrollParent[0] == document || this.scrollParent[0] == this.offsetParent[0]) && (this.offset.relative = this._getRelativeOffset()); var f = b.pageX, g = b.pageY; if (this.originalPosition) { this.containment && (b.pageX - this.offset.click.left < this.containment[0] && (f = this.containment[0] + this.offset.click.left), b.pageY - this.offset.click.top < this.containment[1] && (g = this.containment[1] + this.offset.click.top), b.pageX - this.offset.click.left > this.containment[2] && (f = this.containment[2] + this.offset.click.left), b.pageY - this.offset.click.top > this.containment[3] && (g = this.containment[3] + this.offset.click.top)); if (c.grid) { var h = this.originalPageY + Math.round((g - this.originalPageY) / c.grid[1]) * c.grid[1]; g = this.containment ? h - this.offset.click.top < this.containment[1] || h - this.offset.click.top > this.containment[3] ? h - this.offset.click.top < this.containment[1] ? h + c.grid[1] : h - c.grid[1] : h : h; var i = this.originalPageX + Math.round((f - this.originalPageX) / c.grid[0]) * c.grid[0]; f = this.containment ? i - this.offset.click.left < this.containment[0] || i - this.offset.click.left > this.containment[2] ? i - this.offset.click.left < this.containment[0] ? i + c.grid[0] : i - c.grid[0] : i : i } } return { top: g - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (a.browser.safari && this.cssPosition == "fixed" ? 0 : this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : e ? 0 : d.scrollTop()), left: f - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (a.browser.safari && this.cssPosition == "fixed" ? 0 : this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : e ? 0 : d.scrollLeft())} }, _rearrange: function (a, b, c, d) { c ? c[0].appendChild(this.placeholder[0]) : b.item[0].parentNode.insertBefore(this.placeholder[0], this.direction == "down" ? b.item[0] : b.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; var e = this, f = this.counter; window.setTimeout(function () { f == e.counter && e.refreshPositions(!d) }, 0) }, _clear: function (b, c) { this.reverting = !1; var d = [], e = this; !this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null; if (this.helper[0] == this.currentItem[0]) { for (var f in this._storedCSS) if (this._storedCSS[f] == "auto" || this._storedCSS[f] == "static") this._storedCSS[f] = ""; this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else this.currentItem.show(); this.fromOutside && !c && d.push(function (a) { this._trigger("receive", a, this._uiHash(this.fromOutside)) }), (this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !c && d.push(function (a) { this._trigger("update", a, this._uiHash()) }), this !== this.currentContainer && (c || (d.push(function (a) { this._trigger("remove", a, this._uiHash()) }), d.push(function (a) { return function (b) { a._trigger("receive", b, this._uiHash(this)) } } .call(this, this.currentContainer)), d.push(function (a) { return function (b) { a._trigger("update", b, this._uiHash(this)) } } .call(this, this.currentContainer)))); for (var f = this.containers.length - 1; f >= 0; f--) c || d.push(function (a) { return function (b) { a._trigger("deactivate", b, this._uiHash(this)) } } .call(this, this.containers[f])), this.containers[f].containerCache.over && (d.push(function (a) { return function (b) { a._trigger("out", b, this._uiHash(this)) } } .call(this, this.containers[f])), this.containers[f].containerCache.over = 0); this._storedCursor && a("body").css("cursor", this._storedCursor), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", this._storedZIndex == "auto" ? "" : this._storedZIndex), this.dragging = !1; if (this.cancelHelperRemoval) { if (!c) { this._trigger("beforeStop", b, this._uiHash()); for (var f = 0; f < d.length; f++) d[f].call(this, b); this._trigger("stop", b, this._uiHash()) } return this.fromOutside = !1, !1 } c || this._trigger("beforeStop", b, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] != this.currentItem[0] && this.helper.remove(), this.helper = null; if (!c) { for (var f = 0; f < d.length; f++) d[f].call(this, b); this._trigger("stop", b, this._uiHash()) } return this.fromOutside = !1, !0 }, _trigger: function () { a.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uiHash: function (b) { var c = b || this; return { helper: c.helper, placeholder: c.placeholder || a([]), position: c.position, originalPosition: c.originalPosition, offset: c.positionAbs, item: c.currentItem, sender: b ? b.element : null} } }), a.extend(a.ui.sortable, { version: "1.8.24" }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.accordion.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.widget("ui.accordion", { options: { active: 0, animated: "slide", autoHeight: !0, clearStyle: !1, collapsible: !1, event: "click", fillSpace: !1, header: "> li > :first-child,> :not(li):even", icons: { header: "ui-icon-triangle-1-e", headerSelected: "ui-icon-triangle-1-s" }, navigation: !1, navigationFilter: function () { return this.href.toLowerCase() === location.href.toLowerCase() } }, _create: function () { var b = this, c = b.options; b.running = 0, b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"), b.headers = b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion", function () { if (c.disabled) return; a(this).addClass("ui-state-hover") }).bind("mouseleave.accordion", function () { if (c.disabled) return; a(this).removeClass("ui-state-hover") }).bind("focus.accordion", function () { if (c.disabled) return; a(this).addClass("ui-state-focus") }).bind("blur.accordion", function () { if (c.disabled) return; a(this).removeClass("ui-state-focus") }), b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); if (c.navigation) { var d = b.element.find("a").filter(c.navigationFilter).eq(0); if (d.length) { var e = d.closest(".ui-accordion-header"); e.length ? b.active = e : b.active = d.closest(".ui-accordion-content").prev() } } b.active = b._findActive(b.active || c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"), b.active.next().addClass("ui-accordion-content-active"), b._createIcons(), b.resize(), b.element.attr("role", "tablist"), b.headers.attr("role", "tab").bind("keydown.accordion", function (a) { return b._keydown(a) }).next().attr("role", "tabpanel"), b.headers.not(b.active || "").attr({ "aria-expanded": "false", "aria-selected": "false", tabIndex: -1 }).next().hide(), b.active.length ? b.active.attr({ "aria-expanded": "true", "aria-selected": "true", tabIndex: 0 }) : b.headers.eq(0).attr("tabIndex", 0), a.browser.safari || b.headers.find("a").attr("tabIndex", -1), c.event && b.headers.bind(c.event.split(" ").join(".accordion ") + ".accordion", function (a) { b._clickHandler.call(b, a, this), a.preventDefault() }) }, _createIcons: function () { var b = this.options; b.icons && (a("").addClass("ui-icon " + b.icons.header).prependTo(this.headers), this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected), this.element.addClass("ui-accordion-icons")) }, _destroyIcons: function () { this.headers.children(".ui-icon").remove(), this.element.removeClass("ui-accordion-icons") }, destroy: function () { var b = this.options; this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"), this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"), this.headers.find("a").removeAttr("tabIndex"), this._destroyIcons(); var c = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled"); return (b.autoHeight || b.fillHeight) && c.css("height", ""), a.Widget.prototype.destroy.call(this) }, _setOption: function (b, c) { a.Widget.prototype._setOption.apply(this, arguments), b == "active" && this.activate(c), b == "icons" && (this._destroyIcons(), c && this._createIcons()), b == "disabled" && this.headers.add(this.headers.next())[c ? "addClass" : "removeClass"]("ui-accordion-disabled ui-state-disabled") }, _keydown: function (b) { if (this.options.disabled || b.altKey || b.ctrlKey) return; var c = a.ui.keyCode, d = this.headers.length, e = this.headers.index(b.target), f = !1; switch (b.keyCode) { case c.RIGHT: case c.DOWN: f = this.headers[(e + 1) % d]; break; case c.LEFT: case c.UP: f = this.headers[(e - 1 + d) % d]; break; case c.SPACE: case c.ENTER: this._clickHandler({ target: b.target }, b.target), b.preventDefault() } return f ? (a(b.target).attr("tabIndex", -1), a(f).attr("tabIndex", 0), f.focus(), !1) : !0 }, resize: function () { var b = this.options, c; if (b.fillSpace) { if (a.browser.msie) { var d = this.element.parent().css("overflow"); this.element.parent().css("overflow", "hidden") } c = this.element.parent().height(), a.browser.msie && this.element.parent().css("overflow", d), this.headers.each(function () { c -= a(this).outerHeight(!0) }), this.headers.next().each(function () { a(this).height(Math.max(0, c - a(this).innerHeight() + a(this).height())) }).css("overflow", "auto") } else b.autoHeight && (c = 0, this.headers.next().each(function () { c = Math.max(c, a(this).height("").height()) }).height(c)); return this }, activate: function (a) { this.options.active = a; var b = this._findActive(a)[0]; return this._clickHandler({ target: b }, b), this }, _findActive: function (b) { return b ? typeof b == "number" ? this.headers.filter(":eq(" + b + ")") : this.headers.not(this.headers.not(b)) : b === !1 ? a([]) : this.headers.filter(":eq(0)") }, _clickHandler: function (b, c) { var d = this.options; if (d.disabled) return; if (!b.target) { if (!d.collapsible) return; this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header), this.active.next().addClass("ui-accordion-content-active"); var e = this.active.next(), f = { options: d, newHeader: a([]), oldHeader: d.active, newContent: a([]), oldContent: e }, g = this.active = a([]); this._toggle(g, e, f); return } var h = a(b.currentTarget || c), i = h[0] === this.active[0]; d.active = d.collapsible && i ? !1 : this.headers.index(h); if (this.running || !d.collapsible && i) return; var j = this.active, g = h.next(), e = this.active.next(), f = { options: d, newHeader: i && d.collapsible ? a([]) : h, oldHeader: this.active, newContent: i && d.collapsible ? a([]) : g, oldContent: e }, k = this.headers.index(this.active[0]) > this.headers.index(h[0]); this.active = i ? a([]) : h, this._toggle(g, e, f, i, k), j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header), i || (h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected), h.next().addClass("ui-accordion-content-active")); return }, _toggle: function (b, c, d, e, f) { var g = this, h = g.options; g.toShow = b, g.toHide = c, g.data = d; var i = function () { if (!g) return; return g._completed.apply(g, arguments) }; g._trigger("changestart", null, g.data), g.running = c.size() === 0 ? b.size() : c.size(); if (h.animated) { var j = {}; h.collapsible && e ? j = { toShow: a([]), toHide: c, complete: i, down: f, autoHeight: h.autoHeight || h.fillSpace} : j = { toShow: b, toHide: c, complete: i, down: f, autoHeight: h.autoHeight || h.fillSpace }, h.proxied || (h.proxied = h.animated), h.proxiedDuration || (h.proxiedDuration = h.duration), h.animated = a.isFunction(h.proxied) ? h.proxied(j) : h.proxied, h.duration = a.isFunction(h.proxiedDuration) ? h.proxiedDuration(j) : h.proxiedDuration; var k = a.ui.accordion.animations, l = h.duration, m = h.animated; m && !k[m] && !a.easing[m] && (m = "slide"), k[m] || (k[m] = function (a) { this.slide(a, { easing: m, duration: l || 700 }) }), k[m](j) } else h.collapsible && e ? b.toggle() : (c.hide(), b.show()), i(!0); c.prev().attr({ "aria-expanded": "false", "aria-selected": "false", tabIndex: -1 }).blur(), b.prev().attr({ "aria-expanded": "true", "aria-selected": "true", tabIndex: 0 }).focus() }, _completed: function (a) { this.running = a ? 0 : --this.running; if (this.running) return; this.options.clearStyle && this.toShow.add(this.toHide).css({ height: "", overflow: "" }), this.toHide.removeClass("ui-accordion-content-active"), this.toHide.length && (this.toHide.parent()[0].className = this.toHide.parent()[0].className), this._trigger("change", null, this.data) } }), a.extend(a.ui.accordion, { version: "1.8.24", animations: { slide: function (b, c) { b = a.extend({ easing: "swing", duration: 300 }, b, c); if (!b.toHide.size()) { b.toShow.animate({ height: "show", paddingTop: "show", paddingBottom: "show" }, b); return } if (!b.toShow.size()) { b.toHide.animate({ height: "hide", paddingTop: "hide", paddingBottom: "hide" }, b); return } var d = b.toShow.css("overflow"), e = 0, f = {}, g = {}, h = ["height", "paddingTop", "paddingBottom"], i, j = b.toShow; i = j[0].style.width, j.width(j.parent().width() - parseFloat(j.css("paddingLeft")) - parseFloat(j.css("paddingRight")) - (parseFloat(j.css("borderLeftWidth")) || 0) - (parseFloat(j.css("borderRightWidth")) || 0)), a.each(h, function (c, d) { g[d] = "hide"; var e = ("" + a.css(b.toShow[0], d)).match(/^([\d+-.]+)(.*)$/); f[d] = { value: e[1], unit: e[2] || "px"} }), b.toShow.css({ height: 0, overflow: "hidden" }).show(), b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g, { step: function (a, c) { c.prop == "height" && (e = c.end - c.start === 0 ? 0 : (c.now - c.start) / (c.end - c.start)), b.toShow[0].style[c.prop] = e * f[c.prop].value + f[c.prop].unit }, duration: b.duration, easing: b.easing, complete: function () { b.autoHeight || b.toShow.css("height", ""), b.toShow.css({ width: i, overflow: d }), b.complete() } }) }, bounceslide: function (a) { this.slide(a, { easing: a.down ? "easeOutBounce" : "swing", duration: a.down ? 1e3 : 200 }) } } }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.autocomplete.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { var c = 0; a.widget("ui.autocomplete", { options: { appendTo: "body", autoFocus: !1, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null }, pending: 0, _create: function () { var b = this, c = this.element[0].ownerDocument, d; this.isMultiLine = this.element.is("textarea"), this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off").attr({ role: "textbox", "aria-autocomplete": "list", "aria-haspopup": "true" }).bind("keydown.autocomplete", function (c) { if (b.options.disabled || b.element.propAttr("readOnly")) return; d = !1; var e = a.ui.keyCode; switch (c.keyCode) { case e.PAGE_UP: b._move("previousPage", c); break; case e.PAGE_DOWN: b._move("nextPage", c); break; case e.UP: b._keyEvent("previous", c); break; case e.DOWN: b._keyEvent("next", c); break; case e.ENTER: case e.NUMPAD_ENTER: b.menu.active && (d = !0, c.preventDefault()); case e.TAB: if (!b.menu.active) return; b.menu.select(c); break; case e.ESCAPE: b.element.val(b.term), b.close(c); break; default: clearTimeout(b.searching), b.searching = setTimeout(function () { b.term != b.element.val() && (b.selectedItem = null, b.search(null, c)) }, b.options.delay) } }).bind("keypress.autocomplete", function (a) { d && (d = !1, a.preventDefault()) }).bind("focus.autocomplete", function () { if (b.options.disabled) return; b.selectedItem = null, b.previous = b.element.val() }).bind("blur.autocomplete", function (a) { if (b.options.disabled) return; clearTimeout(b.searching), b.closing = setTimeout(function () { b.close(a), b._change(a) }, 150) }), this._initSource(), this.menu = a("
    ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo || "body", c)[0]).mousedown(function (c) { var d = b.menu.element[0]; a(c.target).closest(".ui-menu-item").length || setTimeout(function () { a(document).one("mousedown", function (c) { c.target !== b.element[0] && c.target !== d && !a.ui.contains(d, c.target) && b.close() }) }, 1), setTimeout(function () { clearTimeout(b.closing) }, 13) }).menu({ focus: function (a, c) { var d = c.item.data("item.autocomplete"); !1 !== b._trigger("focus", a, { item: d }) && /^key/.test(a.originalEvent.type) && b.element.val(d.value) }, selected: function (a, d) { var e = d.item.data("item.autocomplete"), f = b.previous; b.element[0] !== c.activeElement && (b.element.focus(), b.previous = f, setTimeout(function () { b.previous = f, b.selectedItem = e }, 1)), !1 !== b._trigger("select", a, { item: e }) && b.element.val(e.value), b.term = b.element.val(), b.close(a), b.selectedItem = e }, blur: function (a, c) { b.menu.element.is(":visible") && b.element.val() !== b.term && b.element.val(b.term) } }).zIndex(this.element.zIndex() + 1).css({ top: 0, left: 0 }).hide().data("menu"), a.fn.bgiframe && this.menu.element.bgiframe(), b.beforeunloadHandler = function () { b.element.removeAttr("autocomplete") }, a(window).bind("beforeunload", b.beforeunloadHandler) }, destroy: function () { this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"), this.menu.element.remove(), a(window).unbind("beforeunload", this.beforeunloadHandler), a.Widget.prototype.destroy.call(this) }, _setOption: function (b, c) { a.Widget.prototype._setOption.apply(this, arguments), b === "source" && this._initSource(), b === "appendTo" && this.menu.element.appendTo(a(c || "body", this.element[0].ownerDocument)[0]), b === "disabled" && c && this.xhr && this.xhr.abort() }, _initSource: function () { var b = this, c, d; a.isArray(this.options.source) ? (c = this.options.source, this.source = function (b, d) { d(a.ui.autocomplete.filter(c, b.term)) }) : typeof this.options.source == "string" ? (d = this.options.source, this.source = function (c, e) { b.xhr && b.xhr.abort(), b.xhr = a.ajax({ url: d, data: c, dataType: "json", success: function (a, b) { e(a) }, error: function () { e([]) } }) }) : this.source = this.options.source }, search: function (a, b) { a = a != null ? a : this.element.val(), this.term = this.element.val(); if (a.length < this.options.minLength) return this.close(b); clearTimeout(this.closing); if (this._trigger("search", b) === !1) return; return this._search(a) }, _search: function (a) { this.pending++, this.element.addClass("ui-autocomplete-loading"), this.source({ term: a }, this._response()) }, _response: function () { var a = this, b = ++c; return function (d) { b === c && a.__response(d), a.pending--, a.pending || a.element.removeClass("ui-autocomplete-loading") } }, __response: function (a) { !this.options.disabled && a && a.length ? (a = this._normalize(a), this._suggest(a), this._trigger("open")) : this.close() }, close: function (a) { clearTimeout(this.closing), this.menu.element.is(":visible") && (this.menu.element.hide(), this.menu.deactivate(), this._trigger("close", a)) }, _change: function (a) { this.previous !== this.element.val() && this._trigger("change", a, { item: this.selectedItem }) }, _normalize: function (b) { return b.length && b[0].label && b[0].value ? b : a.map(b, function (b) { return typeof b == "string" ? { label: b, value: b} : a.extend({ label: b.label || b.value, value: b.value || b.label }, b) }) }, _suggest: function (b) { var c = this.menu.element.empty().zIndex(this.element.zIndex() + 1); this._renderMenu(c, b), this.menu.deactivate(), this.menu.refresh(), c.show(), this._resizeMenu(), c.position(a.extend({ of: this.element }, this.options.position)), this.options.autoFocus && this.menu.next(new a.Event("mouseover")) }, _resizeMenu: function () { var a = this.menu.element; a.outerWidth(Math.max(a.width("").outerWidth() + 1, this.element.outerWidth())) }, _renderMenu: function (b, c) { var d = this; a.each(c, function (a, c) { d._renderItem(b, c) }) }, _renderItem: function (b, c) { return a("
  • ").data("item.autocomplete", c).append(a("
    ").text(c.label)).appendTo(b) }, _move: function (a, b) { if (!this.menu.element.is(":visible")) { this.search(null, b); return } if (this.menu.first() && /^previous/.test(a) || this.menu.last() && /^next/.test(a)) { this.element.val(this.term), this.menu.deactivate(); return } this.menu[a](b) }, widget: function () { return this.menu.element }, _keyEvent: function (a, b) { if (!this.isMultiLine || this.menu.element.is(":visible")) this._move(a, b), b.preventDefault() } }), a.extend(a.ui.autocomplete, { escapeRegex: function (a) { return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") }, filter: function (b, c) { var d = new RegExp(a.ui.autocomplete.escapeRegex(c), "i"); return a.grep(b, function (a) { return d.test(a.label || a.value || a) }) } }) })(jQuery), function (a) { a.widget("ui.menu", { _create: function () { var b = this; this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({ role: "listbox", "aria-activedescendant": "ui-active-menuitem" }).click(function (c) { if (!a(c.target).closest(".ui-menu-item a").length) return; c.preventDefault(), b.select(c) }), this.refresh() }, refresh: function () { var b = this, c = this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role", "menuitem"); c.children("a").addClass("ui-corner-all").attr("tabindex", -1).mouseenter(function (c) { b.activate(c, a(this).parent()) }).mouseleave(function () { b.deactivate() }) }, activate: function (a, b) { this.deactivate(); if (this.hasScroll()) { var c = b.offset().top - this.element.offset().top, d = this.element.scrollTop(), e = this.element.height(); c < 0 ? this.element.scrollTop(d + c) : c >= e && this.element.scrollTop(d + c - e + b.height()) } this.active = b.eq(0).children("a").addClass("ui-state-hover").attr("id", "ui-active-menuitem").end(), this._trigger("focus", a, { item: b }) }, deactivate: function () { if (!this.active) return; this.active.children("a").removeClass("ui-state-hover").removeAttr("id"), this._trigger("blur"), this.active = null }, next: function (a) { this.move("next", ".ui-menu-item:first", a) }, previous: function (a) { this.move("prev", ".ui-menu-item:last", a) }, first: function () { return this.active && !this.active.prevAll(".ui-menu-item").length }, last: function () { return this.active && !this.active.nextAll(".ui-menu-item").length }, move: function (a, b, c) { if (!this.active) { this.activate(c, this.element.children(b)); return } var d = this.active[a + "All"](".ui-menu-item").eq(0); d.length ? this.activate(c, d) : this.activate(c, this.element.children(b)) }, nextPage: function (b) { if (this.hasScroll()) { if (!this.active || this.last()) { this.activate(b, this.element.children(".ui-menu-item:first")); return } var c = this.active.offset().top, d = this.element.height(), e = this.element.children(".ui-menu-item").filter(function () { var b = a(this).offset().top - c - d + a(this).height(); return b < 10 && b > -10 }); e.length || (e = this.element.children(".ui-menu-item:last")), this.activate(b, e) } else this.activate(b, this.element.children(".ui-menu-item").filter(!this.active || this.last() ? ":first" : ":last")) }, previousPage: function (b) { if (this.hasScroll()) { if (!this.active || this.first()) { this.activate(b, this.element.children(".ui-menu-item:last")); return } var c = this.active.offset().top, d = this.element.height(), e = this.element.children(".ui-menu-item").filter(function () { var b = a(this).offset().top - c + d - a(this).height(); return b < 10 && b > -10 }); e.length || (e = this.element.children(".ui-menu-item:first")), this.activate(b, e) } else this.activate(b, this.element.children(".ui-menu-item").filter(!this.active || this.first() ? ":last" : ":first")) }, hasScroll: function () { return this.element.height() < this.element[a.fn.prop ? "prop" : "attr"]("scrollHeight") }, select: function (a) { this._trigger("selected", a, { item: this.active }) } }) } (jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.button.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { var c, d, e, f, g = "ui-button ui-widget ui-state-default ui-corner-all", h = "ui-state-hover ui-state-active ", i = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", j = function () { var b = a(this).find(":ui-button"); setTimeout(function () { b.button("refresh") }, 1) }, k = function (b) { var c = b.name, d = b.form, e = a([]); return c && (d ? e = a(d).find("[name='" + c + "']") : e = a("[name='" + c + "']", b.ownerDocument).filter(function () { return !this.form })), e }; a.widget("ui.button", { options: { disabled: null, text: !0, label: null, icons: { primary: null, secondary: null} }, _create: function () { this.element.closest("form").unbind("reset.button").bind("reset.button", j), typeof this.options.disabled != "boolean" ? this.options.disabled = !!this.element.propAttr("disabled") : this.element.propAttr("disabled", this.options.disabled), this._determineButtonType(), this.hasTitle = !!this.buttonElement.attr("title"); var b = this, h = this.options, i = this.type === "checkbox" || this.type === "radio", l = "ui-state-hover" + (i ? "" : " ui-state-active"), m = "ui-state-focus"; h.label === null && (h.label = this.buttonElement.html()), this.buttonElement.addClass(g).attr("role", "button").bind("mouseenter.button", function () { if (h.disabled) return; a(this).addClass("ui-state-hover"), this === c && a(this).addClass("ui-state-active") }).bind("mouseleave.button", function () { if (h.disabled) return; a(this).removeClass(l) }).bind("click.button", function (a) { h.disabled && (a.preventDefault(), a.stopImmediatePropagation()) }), this.element.bind("focus.button", function () { b.buttonElement.addClass(m) }).bind("blur.button", function () { b.buttonElement.removeClass(m) }), i && (this.element.bind("change.button", function () { if (f) return; b.refresh() }), this.buttonElement.bind("mousedown.button", function (a) { if (h.disabled) return; f = !1, d = a.pageX, e = a.pageY }).bind("mouseup.button", function (a) { if (h.disabled) return; if (d !== a.pageX || e !== a.pageY) f = !0 })), this.type === "checkbox" ? this.buttonElement.bind("click.button", function () { if (h.disabled || f) return !1; a(this).toggleClass("ui-state-active"), b.buttonElement.attr("aria-pressed", b.element[0].checked) }) : this.type === "radio" ? this.buttonElement.bind("click.button", function () { if (h.disabled || f) return !1; a(this).addClass("ui-state-active"), b.buttonElement.attr("aria-pressed", "true"); var c = b.element[0]; k(c).not(c).map(function () { return a(this).button("widget")[0] }).removeClass("ui-state-active").attr("aria-pressed", "false") }) : (this.buttonElement.bind("mousedown.button", function () { if (h.disabled) return !1; a(this).addClass("ui-state-active"), c = this, a(document).one("mouseup", function () { c = null }) }).bind("mouseup.button", function () { if (h.disabled) return !1; a(this).removeClass("ui-state-active") }).bind("keydown.button", function (b) { if (h.disabled) return !1; (b.keyCode == a.ui.keyCode.SPACE || b.keyCode == a.ui.keyCode.ENTER) && a(this).addClass("ui-state-active") }).bind("keyup.button", function () { a(this).removeClass("ui-state-active") }), this.buttonElement.is("a") && this.buttonElement.keyup(function (b) { b.keyCode === a.ui.keyCode.SPACE && a(this).click() })), this._setOption("disabled", h.disabled), this._resetButton() }, _determineButtonType: function () { this.element.is(":checkbox") ? this.type = "checkbox" : this.element.is(":radio") ? this.type = "radio" : this.element.is("input") ? this.type = "input" : this.type = "button"; if (this.type === "checkbox" || this.type === "radio") { var a = this.element.parents().filter(":last"), b = "label[for='" + this.element.attr("id") + "']"; this.buttonElement = a.find(b), this.buttonElement.length || (a = a.length ? a.siblings() : this.element.siblings(), this.buttonElement = a.filter(b), this.buttonElement.length || (this.buttonElement = a.find(b))), this.element.addClass("ui-helper-hidden-accessible"); var c = this.element.is(":checked"); c && this.buttonElement.addClass("ui-state-active"), this.buttonElement.attr("aria-pressed", c) } else this.buttonElement = this.element }, widget: function () { return this.buttonElement }, destroy: function () { this.element.removeClass("ui-helper-hidden-accessible"), this.buttonElement.removeClass(g + " " + h + " " + i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()), this.hasTitle || this.buttonElement.removeAttr("title"), a.Widget.prototype.destroy.call(this) }, _setOption: function (b, c) { a.Widget.prototype._setOption.apply(this, arguments); if (b === "disabled") { c ? this.element.propAttr("disabled", !0) : this.element.propAttr("disabled", !1); return } this._resetButton() }, refresh: function () { var b = this.element.is(":disabled"); b !== this.options.disabled && this._setOption("disabled", b), this.type === "radio" ? k(this.element[0]).each(function () { a(this).is(":checked") ? a(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true") : a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false") }) : this.type === "checkbox" && (this.element.is(":checked") ? this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true") : this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false")) }, _resetButton: function () { if (this.type === "input") { this.options.label && this.element.val(this.options.label); return } var b = this.buttonElement.removeClass(i), c = a("", this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(), d = this.options.icons, e = d.primary && d.secondary, f = []; d.primary || d.secondary ? (this.options.text && f.push("ui-button-text-icon" + (e ? "s" : d.primary ? "-primary" : "-secondary")), d.primary && b.prepend(""), d.secondary && b.append(""), this.options.text || (f.push(e ? "ui-button-icons-only" : "ui-button-icon-only"), this.hasTitle || b.attr("title", c))) : f.push("ui-button-text-only"), b.addClass(f.join(" ")) } }), a.widget("ui.buttonset", { options: { items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" }, _create: function () { this.element.addClass("ui-buttonset") }, _init: function () { this.refresh() }, _setOption: function (b, c) { b === "disabled" && this.buttons.button("option", b, c), a.Widget.prototype._setOption.apply(this, arguments) }, refresh: function () { var b = this.element.css("direction") === "rtl"; this.buttons = this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function () { return a(this).button("widget")[0] }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b ? "ui-corner-right" : "ui-corner-left").end().filter(":last").addClass(b ? "ui-corner-left" : "ui-corner-right").end().end() }, destroy: function () { this.element.removeClass("ui-buttonset"), this.buttons.map(function () { return a(this).button("widget")[0] }).removeClass("ui-corner-left ui-corner-right").end().button("destroy"), a.Widget.prototype.destroy.call(this) } }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.dialog.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { var c = "ui-dialog ui-widget ui-widget-content ui-corner-all ", d = { buttons: !0, height: !0, maxHeight: !0, maxWidth: !0, minHeight: !0, minWidth: !0, width: !0 }, e = { maxHeight: !0, maxWidth: !0, minHeight: !0, minWidth: !0 }; a.widget("ui.dialog", { options: { autoOpen: !0, buttons: {}, closeOnEscape: !0, closeText: "close", dialogClass: "", draggable: !0, hide: null, height: "auto", maxHeight: !1, maxWidth: !1, minHeight: 150, minWidth: 150, modal: !1, position: { my: "center", at: "center", collision: "fit", using: function (b) { var c = a(this).css(b).offset().top; c < 0 && a(this).css("top", b.top - c) } }, resizable: !0, show: null, stack: !0, title: "", width: 300, zIndex: 1e3 }, _create: function () { this.originalTitle = this.element.attr("title"), typeof this.originalTitle != "string" && (this.originalTitle = ""), this.options.title = this.options.title || this.originalTitle; var b = this, d = b.options, e = d.title || " ", f = a.ui.dialog.getTitleId(b.element), g = (b.uiDialog = a("
    ")).appendTo(document.body).hide().addClass(c + d.dialogClass).css({ zIndex: d.zIndex }).attr("tabIndex", -1).css("outline", 0).keydown(function (c) { d.closeOnEscape && !c.isDefaultPrevented() && c.keyCode && c.keyCode === a.ui.keyCode.ESCAPE && (b.close(c), c.preventDefault()) }).attr({ role: "dialog", "aria-labelledby": f }).mousedown(function (a) { b.moveToTop(!1, a) }), h = b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g), i = (b.uiDialogTitlebar = a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), j = a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", "button").hover(function () { j.addClass("ui-state-hover") }, function () { j.removeClass("ui-state-hover") }).focus(function () { j.addClass("ui-state-focus") }).blur(function () { j.removeClass("ui-state-focus") }).click(function (a) { return b.close(a), !1 }).appendTo(i), k = (b.uiDialogTitlebarCloseText = a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j), l = a("").addClass("ui-dialog-title").attr("id", f).html(e).prependTo(i); a.isFunction(d.beforeclose) && !a.isFunction(d.beforeClose) && (d.beforeClose = d.beforeclose), i.find("*").add(i).disableSelection(), d.draggable && a.fn.draggable && b._makeDraggable(), d.resizable && a.fn.resizable && b._makeResizable(), b._createButtons(d.buttons), b._isOpen = !1, a.fn.bgiframe && g.bgiframe() }, _init: function () { this.options.autoOpen && this.open() }, destroy: function () { var a = this; return a.overlay && a.overlay.destroy(), a.uiDialog.hide(), a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"), a.uiDialog.remove(), a.originalTitle && a.element.attr("title", a.originalTitle), a }, widget: function () { return this.uiDialog }, close: function (b) { var c = this, d, e; if (!1 === c._trigger("beforeClose", b)) return; return c.overlay && c.overlay.destroy(), c.uiDialog.unbind("keypress.ui-dialog"), c._isOpen = !1, c.options.hide ? c.uiDialog.hide(c.options.hide, function () { c._trigger("close", b) }) : (c.uiDialog.hide(), c._trigger("close", b)), a.ui.dialog.overlay.resize(), c.options.modal && (d = 0, a(".ui-dialog").each(function () { this !== c.uiDialog[0] && (e = a(this).css("z-index"), isNaN(e) || (d = Math.max(d, e))) }), a.ui.dialog.maxZ = d), c }, isOpen: function () { return this._isOpen }, moveToTop: function (b, c) { var d = this, e = d.options, f; return e.modal && !b || !e.stack && !e.modal ? d._trigger("focus", c) : (e.zIndex > a.ui.dialog.maxZ && (a.ui.dialog.maxZ = e.zIndex), d.overlay && (a.ui.dialog.maxZ += 1, d.overlay.$el.css("z-index", a.ui.dialog.overlay.maxZ = a.ui.dialog.maxZ)), f = { scrollTop: d.element.scrollTop(), scrollLeft: d.element.scrollLeft() }, a.ui.dialog.maxZ += 1, d.uiDialog.css("z-index", a.ui.dialog.maxZ), d.element.attr(f), d._trigger("focus", c), d) }, open: function () { if (this._isOpen) return; var b = this, c = b.options, d = b.uiDialog; return b.overlay = c.modal ? new a.ui.dialog.overlay(b) : null, b._size(), b._position(c.position), d.show(c.show), b.moveToTop(!0), c.modal && d.bind("keydown.ui-dialog", function (b) { if (b.keyCode !== a.ui.keyCode.TAB) return; var c = a(":tabbable", this), d = c.filter(":first"), e = c.filter(":last"); if (b.target === e[0] && !b.shiftKey) return d.focus(1), !1; if (b.target === d[0] && b.shiftKey) return e.focus(1), !1 }), a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(), b._isOpen = !0, b._trigger("open"), b }, _createButtons: function (b) { var c = this, d = !1, e = a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"), f = a("
    ").addClass("ui-dialog-buttonset").appendTo(e); c.uiDialog.find(".ui-dialog-buttonpane").remove(), typeof b == "object" && b !== null && a.each(b, function () { return !(d = !0) }), d && (a.each(b, function (b, d) { d = a.isFunction(d) ? { click: d, text: b} : d; var e = a('').click(function () { d.click.apply(c.element[0], arguments) }).appendTo(f); a.each(d, function (a, b) { if (a === "click") return; a in e ? e[a](b) : e.attr(a, b) }), a.fn.button && e.button() }), e.appendTo(c.uiDialog)) }, _makeDraggable: function () { function f(a) { return { position: a.position, offset: a.offset} } var b = this, c = b.options, d = a(document), e; b.uiDialog.draggable({ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", handle: ".ui-dialog-titlebar", containment: "document", start: function (d, g) { e = c.height === "auto" ? "auto" : a(this).height(), a(this).height(a(this).height()).addClass("ui-dialog-dragging"), b._trigger("dragStart", d, f(g)) }, drag: function (a, c) { b._trigger("drag", a, f(c)) }, stop: function (g, h) { c.position = [h.position.left - d.scrollLeft(), h.position.top - d.scrollTop()], a(this).removeClass("ui-dialog-dragging").height(e), b._trigger("dragStop", g, f(h)), a.ui.dialog.overlay.resize() } }) }, _makeResizable: function (c) { function h(a) { return { originalPosition: a.originalPosition, originalSize: a.originalSize, position: a.position, size: a.size} } c = c === b ? this.options.resizable : c; var d = this, e = d.options, f = d.uiDialog.css("position"), g = typeof c == "string" ? c : "n,e,s,w,se,sw,ne,nw"; d.uiDialog.resizable({ cancel: ".ui-dialog-content", containment: "document", alsoResize: d.element, maxWidth: e.maxWidth, maxHeight: e.maxHeight, minWidth: e.minWidth, minHeight: d._minHeight(), handles: g, start: function (b, c) { a(this).addClass("ui-dialog-resizing"), d._trigger("resizeStart", b, h(c)) }, resize: function (a, b) { d._trigger("resize", a, h(b)) }, stop: function (b, c) { a(this).removeClass("ui-dialog-resizing"), e.height = a(this).height(), e.width = a(this).width(), d._trigger("resizeStop", b, h(c)), a.ui.dialog.overlay.resize() } }).css("position", f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se") }, _minHeight: function () { var a = this.options; return a.height === "auto" ? a.minHeight : Math.min(a.minHeight, a.height) }, _position: function (b) { var c = [], d = [0, 0], e; if (b) { if (typeof b == "string" || typeof b == "object" && "0" in b) c = b.split ? b.split(" ") : [b[0], b[1]], c.length === 1 && (c[1] = c[0]), a.each(["left", "top"], function (a, b) { +c[a] === c[a] && (d[a] = c[a], c[a] = b) }), b = { my: c.join(" "), at: c.join(" "), offset: d.join(" ") }; b = a.extend({}, a.ui.dialog.prototype.options.position, b) } else b = a.ui.dialog.prototype.options.position; e = this.uiDialog.is(":visible"), e || this.uiDialog.show(), this.uiDialog.css({ top: 0, left: 0 }).position(a.extend({ of: window }, b)), e || this.uiDialog.hide() }, _setOptions: function (b) { var c = this, f = {}, g = !1; a.each(b, function (a, b) { c._setOption(a, b), a in d && (g = !0), a in e && (f[a] = b) }), g && this._size(), this.uiDialog.is(":data(resizable)") && this.uiDialog.resizable("option", f) }, _setOption: function (b, d) { var e = this, f = e.uiDialog; switch (b) { case "beforeclose": b = "beforeClose"; break; case "buttons": e._createButtons(d); break; case "closeText": e.uiDialogTitlebarCloseText.text("" + d); break; case "dialogClass": f.removeClass(e.options.dialogClass).addClass(c + d); break; case "disabled": d ? f.addClass("ui-dialog-disabled") : f.removeClass("ui-dialog-disabled"); break; case "draggable": var g = f.is(":data(draggable)"); g && !d && f.draggable("destroy"), !g && d && e._makeDraggable(); break; case "position": e._position(d); break; case "resizable": var h = f.is(":data(resizable)"); h && !d && f.resizable("destroy"), h && typeof d == "string" && f.resizable("option", "handles", d), !h && d !== !1 && e._makeResizable(d); break; case "title": a(".ui-dialog-title", e.uiDialogTitlebar).html("" + (d || " ")) } a.Widget.prototype._setOption.apply(e, arguments) }, _size: function () { var b = this.options, c, d, e = this.uiDialog.is(":visible"); this.element.show().css({ width: "auto", minHeight: 0, height: 0 }), b.minWidth > b.width && (b.width = b.minWidth), c = this.uiDialog.css({ height: "auto", width: b.width }).height(), d = Math.max(0, b.minHeight - c); if (b.height === "auto") if (a.support.minHeight) this.element.css({ minHeight: d, height: "auto" }); else { this.uiDialog.show(); var f = this.element.css("height", "auto").height(); e || this.uiDialog.hide(), this.element.height(Math.max(f, d)) } else this.element.height(Math.max(b.height - c, 0)); this.uiDialog.is(":data(resizable)") && this.uiDialog.resizable("option", "minHeight", this._minHeight()) } }), a.extend(a.ui.dialog, { version: "1.8.24", uuid: 0, maxZ: 0, getTitleId: function (a) { var b = a.attr("id"); return b || (this.uuid += 1, b = this.uuid), "ui-dialog-title-" + b }, overlay: function (b) { this.$el = a.ui.dialog.overlay.create(b) } }), a.extend(a.ui.dialog.overlay, { instances: [], oldInstances: [], maxZ: 0, events: a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), function (a) { return a + ".dialog-overlay" }).join(" "), create: function (b) { this.instances.length === 0 && (setTimeout(function () { a.ui.dialog.overlay.instances.length && a(document).bind(a.ui.dialog.overlay.events, function (b) { if (a(b.target).zIndex() < a.ui.dialog.overlay.maxZ) return !1 }) }, 1), a(document).bind("keydown.dialog-overlay", function (c) { b.options.closeOnEscape && !c.isDefaultPrevented() && c.keyCode && c.keyCode === a.ui.keyCode.ESCAPE && (b.close(c), c.preventDefault()) }), a(window).bind("resize.dialog-overlay", a.ui.dialog.overlay.resize)); var c = (this.oldInstances.pop() || a("
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({ width: this.width(), height: this.height() }); return a.fn.bgiframe && c.bgiframe(), this.instances.push(c), c }, destroy: function (b) { var c = a.inArray(b, this.instances); c != -1 && this.oldInstances.push(this.instances.splice(c, 1)[0]), this.instances.length === 0 && a([document, window]).unbind(".dialog-overlay"), b.remove(); var d = 0; a.each(this.instances, function () { d = Math.max(d, this.css("z-index")) }), this.maxZ = d }, height: function () { var b, c; return a.browser.msie && a.browser.version < 7 ? (b = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), c = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight), b < c ? a(window).height() + "px" : b + "px") : a(document).height() + "px" }, width: function () { var b, c; return a.browser.msie ? (b = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), c = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth), b < c ? a(window).width() + "px" : b + "px") : a(document).width() + "px" }, resize: function () { var b = a([]); a.each(a.ui.dialog.overlay.instances, function () { b = b.add(this) }), b.css({ width: 0, height: 0 }).css({ width: a.ui.dialog.overlay.width(), height: a.ui.dialog.overlay.height() }) } }), a.extend(a.ui.dialog.overlay.prototype, { destroy: function () { a.ui.dialog.overlay.destroy(this.$el) } }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.slider.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { var c = 5; a.widget("ui.slider", a.ui.mouse, { widgetEventPrefix: "slide", options: { animate: !1, distance: 0, max: 100, min: 0, orientation: "horizontal", range: !1, step: 1, value: 0, values: null }, _create: function () { var b = this, d = this.options, e = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"), f = "", g = d.values && d.values.length || 1, h = []; this._keySliding = !1, this._mouseSliding = !1, this._animateOff = !0, this._handleIndex = null, this._detectOrientation(), this._mouseInit(), this.element.addClass("ui-slider ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all" + (d.disabled ? " ui-slider-disabled ui-disabled" : "")), this.range = a([]), d.range && (d.range === !0 && (d.values || (d.values = [this._valueMin(), this._valueMin()]), d.values.length && d.values.length !== 2 && (d.values = [d.values[0], d.values[0]])), this.range = a("
    ").appendTo(this.element).addClass("ui-slider-range ui-widget-header" + (d.range === "min" || d.range === "max" ? " ui-slider-range-" + d.range : ""))); for (var i = e.length; i < g; i += 1) h.push(f); this.handles = e.add(a(h.join("")).appendTo(b.element)), this.handle = this.handles.eq(0), this.handles.add(this.range).filter("a").click(function (a) { a.preventDefault() }).hover(function () { d.disabled || a(this).addClass("ui-state-hover") }, function () { a(this).removeClass("ui-state-hover") }).focus(function () { d.disabled ? a(this).blur() : (a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"), a(this).addClass("ui-state-focus")) }).blur(function () { a(this).removeClass("ui-state-focus") }), this.handles.each(function (b) { a(this).data("index.ui-slider-handle", b) }), this.handles.keydown(function (d) { var e = a(this).data("index.ui-slider-handle"), f, g, h, i; if (b.options.disabled) return; switch (d.keyCode) { case a.ui.keyCode.HOME: case a.ui.keyCode.END: case a.ui.keyCode.PAGE_UP: case a.ui.keyCode.PAGE_DOWN: case a.ui.keyCode.UP: case a.ui.keyCode.RIGHT: case a.ui.keyCode.DOWN: case a.ui.keyCode.LEFT: d.preventDefault(); if (!b._keySliding) { b._keySliding = !0, a(this).addClass("ui-state-active"), f = b._start(d, e); if (f === !1) return } } i = b.options.step, b.options.values && b.options.values.length ? g = h = b.values(e) : g = h = b.value(); switch (d.keyCode) { case a.ui.keyCode.HOME: h = b._valueMin(); break; case a.ui.keyCode.END: h = b._valueMax(); break; case a.ui.keyCode.PAGE_UP: h = b._trimAlignValue(g + (b._valueMax() - b._valueMin()) / c); break; case a.ui.keyCode.PAGE_DOWN: h = b._trimAlignValue(g - (b._valueMax() - b._valueMin()) / c); break; case a.ui.keyCode.UP: case a.ui.keyCode.RIGHT: if (g === b._valueMax()) return; h = b._trimAlignValue(g + i); break; case a.ui.keyCode.DOWN: case a.ui.keyCode.LEFT: if (g === b._valueMin()) return; h = b._trimAlignValue(g - i) } b._slide(d, e, h) }).keyup(function (c) { var d = a(this).data("index.ui-slider-handle"); b._keySliding && (b._keySliding = !1, b._stop(c, d), b._change(c, d), a(this).removeClass("ui-state-active")) }), this._refreshValue(), this._animateOff = !1 }, destroy: function () { return this.handles.remove(), this.range.remove(), this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"), this._mouseDestroy(), this }, _mouseCapture: function (b) { var c = this.options, d, e, f, g, h, i, j, k, l; return c.disabled ? !1 : (this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }, this.elementOffset = this.element.offset(), d = { x: b.pageX, y: b.pageY }, e = this._normValueFromMouse(d), f = this._valueMax() - this._valueMin() + 1, h = this, this.handles.each(function (b) { var c = Math.abs(e - h.values(b)); f > c && (f = c, g = a(this), i = b) }), c.range === !0 && this.values(1) === c.min && (i += 1, g = a(this.handles[i])), j = this._start(b, i), j === !1 ? !1 : (this._mouseSliding = !0, h._handleIndex = i, g.addClass("ui-state-active").focus(), k = g.offset(), l = !a(b.target).parents().andSelf().is(".ui-slider-handle"), this._clickOffset = l ? { left: 0, top: 0} : { left: b.pageX - k.left - g.width() / 2, top: b.pageY - k.top - g.height() / 2 - (parseInt(g.css("borderTopWidth"), 10) || 0) - (parseInt(g.css("borderBottomWidth"), 10) || 0) + (parseInt(g.css("marginTop"), 10) || 0) }, this.handles.hasClass("ui-state-hover") || this._slide(b, i, e), this._animateOff = !0, !0)) }, _mouseStart: function (a) { return !0 }, _mouseDrag: function (a) { var b = { x: a.pageX, y: a.pageY }, c = this._normValueFromMouse(b); return this._slide(a, this._handleIndex, c), !1 }, _mouseStop: function (a) { return this.handles.removeClass("ui-state-active"), this._mouseSliding = !1, this._stop(a, this._handleIndex), this._change(a, this._handleIndex), this._handleIndex = null, this._clickOffset = null, this._animateOff = !1, !1 }, _detectOrientation: function () { this.orientation = this.options.orientation === "vertical" ? "vertical" : "horizontal" }, _normValueFromMouse: function (a) { var b, c, d, e, f; return this.orientation === "horizontal" ? (b = this.elementSize.width, c = a.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)) : (b = this.elementSize.height, c = a.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)), d = c / b, d > 1 && (d = 1), d < 0 && (d = 0), this.orientation === "vertical" && (d = 1 - d), e = this._valueMax() - this._valueMin(), f = this._valueMin() + d * e, this._trimAlignValue(f) }, _start: function (a, b) { var c = { handle: this.handles[b], value: this.value() }; return this.options.values && this.options.values.length && (c.value = this.values(b), c.values = this.values()), this._trigger("start", a, c) }, _slide: function (a, b, c) { var d, e, f; this.options.values && this.options.values.length ? (d = this.values(b ? 0 : 1), this.options.values.length === 2 && this.options.range === !0 && (b === 0 && c > d || b === 1 && c < d) && (c = d), c !== this.values(b) && (e = this.values(), e[b] = c, f = this._trigger("slide", a, { handle: this.handles[b], value: c, values: e }), d = this.values(b ? 0 : 1), f !== !1 && this.values(b, c, !0))) : c !== this.value() && (f = this._trigger("slide", a, { handle: this.handles[b], value: c }), f !== !1 && this.value(c)) }, _stop: function (a, b) { var c = { handle: this.handles[b], value: this.value() }; this.options.values && this.options.values.length && (c.value = this.values(b), c.values = this.values()), this._trigger("stop", a, c) }, _change: function (a, b) { if (!this._keySliding && !this._mouseSliding) { var c = { handle: this.handles[b], value: this.value() }; this.options.values && this.options.values.length && (c.value = this.values(b), c.values = this.values()), this._trigger("change", a, c) } }, value: function (a) { if (arguments.length) { this.options.value = this._trimAlignValue(a), this._refreshValue(), this._change(null, 0); return } return this._value() }, values: function (b, c) { var d, e, f; if (arguments.length > 1) { this.options.values[b] = this._trimAlignValue(c), this._refreshValue(), this._change(null, b); return } if (!arguments.length) return this._values(); if (!a.isArray(arguments[0])) return this.options.values && this.options.values.length ? this._values(b) : this.value(); d = this.options.values, e = arguments[0]; for (f = 0; f < d.length; f += 1) d[f] = this._trimAlignValue(e[f]), this._change(null, f); this._refreshValue() }, _setOption: function (b, c) { var d, e = 0; a.isArray(this.options.values) && (e = this.options.values.length), a.Widget.prototype._setOption.apply(this, arguments); switch (b) { case "disabled": c ? (this.handles.filter(".ui-state-focus").blur(), this.handles.removeClass("ui-state-hover"), this.handles.propAttr("disabled", !0), this.element.addClass("ui-disabled")) : (this.handles.propAttr("disabled", !1), this.element.removeClass("ui-disabled")); break; case "orientation": this._detectOrientation(), this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation), this._refreshValue(); break; case "value": this._animateOff = !0, this._refreshValue(), this._change(null, 0), this._animateOff = !1; break; case "values": this._animateOff = !0, this._refreshValue(); for (d = 0; d < e; d += 1) this._change(null, d); this._animateOff = !1 } }, _value: function () { var a = this.options.value; return a = this._trimAlignValue(a), a }, _values: function (a) { var b, c, d; if (arguments.length) return b = this.options.values[a], b = this._trimAlignValue(b), b; c = this.options.values.slice(); for (d = 0; d < c.length; d += 1) c[d] = this._trimAlignValue(c[d]); return c }, _trimAlignValue: function (a) { if (a <= this._valueMin()) return this._valueMin(); if (a >= this._valueMax()) return this._valueMax(); var b = this.options.step > 0 ? this.options.step : 1, c = (a - this._valueMin()) % b, d = a - c; return Math.abs(c) * 2 >= b && (d += c > 0 ? b : -b), parseFloat(d.toFixed(5)) }, _valueMin: function () { return this.options.min }, _valueMax: function () { return this.options.max }, _refreshValue: function () { var b = this.options.range, c = this.options, d = this, e = this._animateOff ? !1 : c.animate, f, g = {}, h, i, j, k; this.options.values && this.options.values.length ? this.handles.each(function (b, i) { f = (d.values(b) - d._valueMin()) / (d._valueMax() - d._valueMin()) * 100, g[d.orientation === "horizontal" ? "left" : "bottom"] = f + "%", a(this).stop(1, 1)[e ? "animate" : "css"](g, c.animate), d.options.range === !0 && (d.orientation === "horizontal" ? (b === 0 && d.range.stop(1, 1)[e ? "animate" : "css"]({ left: f + "%" }, c.animate), b === 1 && d.range[e ? "animate" : "css"]({ width: f - h + "%" }, { queue: !1, duration: c.animate })) : (b === 0 && d.range.stop(1, 1)[e ? "animate" : "css"]({ bottom: f + "%" }, c.animate), b === 1 && d.range[e ? "animate" : "css"]({ height: f - h + "%" }, { queue: !1, duration: c.animate }))), h = f }) : (i = this.value(), j = this._valueMin(), k = this._valueMax(), f = k !== j ? (i - j) / (k - j) * 100 : 0, g[d.orientation === "horizontal" ? "left" : "bottom"] = f + "%", this.handle.stop(1, 1)[e ? "animate" : "css"](g, c.animate), b === "min" && this.orientation === "horizontal" && this.range.stop(1, 1)[e ? "animate" : "css"]({ width: f + "%" }, c.animate), b === "max" && this.orientation === "horizontal" && this.range[e ? "animate" : "css"]({ width: 100 - f + "%" }, { queue: !1, duration: c.animate }), b === "min" && this.orientation === "vertical" && this.range.stop(1, 1)[e ? "animate" : "css"]({ height: f + "%" }, c.animate), b === "max" && this.orientation === "vertical" && this.range[e ? "animate" : "css"]({ height: 100 - f + "%" }, { queue: !1, duration: c.animate })) } }), a.extend(a.ui.slider, { version: "1.8.24" }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.tabs.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { function e() { return ++c } function f() { return ++d } var c = 0, d = 0; a.widget("ui.tabs", { options: { add: null, ajaxOptions: null, cache: !1, cookie: null, collapsible: !1, disable: null, disabled: [], enable: null, event: "click", fx: null, idPrefix: "ui-tabs-", load: null, panelTemplate: "
    ", remove: null, select: null, show: null, spinner: "Loading…", tabTemplate: "
  • #{label}
  • " }, _create: function () { this._tabify(!0) }, _setOption: function (a, b) { if (a == "selected") { if (this.options.collapsible && b == this.options.selected) return; this.select(b) } else this.options[a] = b, this._tabify() }, _tabId: function (a) { return a.title && a.title.replace(/\s/g, "_").replace(/[^\w\u00c0-\uFFFF-]/g, "") || this.options.idPrefix + e() }, _sanitizeSelector: function (a) { return a.replace(/:/g, "\\:") }, _cookie: function () { var b = this.cookie || (this.cookie = this.options.cookie.name || "ui-tabs-" + f()); return a.cookie.apply(null, [b].concat(a.makeArray(arguments))) }, _ui: function (a, b) { return { tab: a, panel: b, index: this.anchors.index(a)} }, _cleanup: function () { this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function () { var b = a(this); b.html(b.data("label.tabs")).removeData("label.tabs") }) }, _tabify: function (c) { function m(b, c) { b.css("display", ""), !a.support.opacity && c.opacity && b[0].style.removeAttribute("filter") } var d = this, e = this.options, f = /^#.+/; this.list = this.element.find("ol,ul").eq(0), this.lis = a(" > li:has(a[href])", this.list), this.anchors = this.lis.map(function () { return a("a", this)[0] }), this.panels = a([]), this.anchors.each(function (b, c) { var g = a(c).attr("href"), h = g.split("#")[0], i; h && (h === location.toString().split("#")[0] || (i = a("base")[0]) && h === i.href) && (g = c.hash, c.href = g); if (f.test(g)) d.panels = d.panels.add(d.element.find(d._sanitizeSelector(g))); else if (g && g !== "#") { a.data(c, "href.tabs", g), a.data(c, "load.tabs", g.replace(/#.*$/, "")); var j = d._tabId(c); c.href = "#" + j; var k = d.element.find("#" + j); k.length || (k = a(e.panelTemplate).attr("id", j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b - 1] || d.list), k.data("destroy.tabs", !0)), d.panels = d.panels.add(k) } else e.disabled.push(b) }), c ? (this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"), this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"), this.lis.addClass("ui-state-default ui-corner-top"), this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"), e.selected === b ? (location.hash && this.anchors.each(function (a, b) { if (b.hash == location.hash) return e.selected = a, !1 }), typeof e.selected != "number" && e.cookie && (e.selected = parseInt(d._cookie(), 10)), typeof e.selected != "number" && this.lis.filter(".ui-tabs-selected").length && (e.selected = this.lis.index(this.lis.filter(".ui-tabs-selected"))), e.selected = e.selected || (this.lis.length ? 0 : -1)) : e.selected === null && (e.selected = -1), e.selected = e.selected >= 0 && this.anchors[e.selected] || e.selected < 0 ? e.selected : 0, e.disabled = a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"), function (a, b) { return d.lis.index(a) }))).sort(), a.inArray(e.selected, e.disabled) != -1 && e.disabled.splice(a.inArray(e.selected, e.disabled), 1), this.panels.addClass("ui-tabs-hide"), this.lis.removeClass("ui-tabs-selected ui-state-active"), e.selected >= 0 && this.anchors.length && (d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"), this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"), d.element.queue("tabs", function () { d._trigger("show", null, d._ui(d.anchors[e.selected], d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0])) }), this.load(e.selected)), a(window).bind("unload", function () { d.lis.add(d.anchors).unbind(".tabs"), d.lis = d.anchors = d.panels = null })) : e.selected = this.lis.index(this.lis.filter(".ui-tabs-selected")), this.element[e.collapsible ? "addClass" : "removeClass"]("ui-tabs-collapsible"), e.cookie && this._cookie(e.selected, e.cookie); for (var g = 0, h; h = this.lis[g]; g++) a(h)[a.inArray(g, e.disabled) != -1 && !a(h).hasClass("ui-tabs-selected") ? "addClass" : "removeClass"]("ui-state-disabled"); e.cache === !1 && this.anchors.removeData("cache.tabs"), this.lis.add(this.anchors).unbind(".tabs"); if (e.event !== "mouseover") { var i = function (a, b) { b.is(":not(.ui-state-disabled)") && b.addClass("ui-state-" + a) }, j = function (a, b) { b.removeClass("ui-state-" + a) }; this.lis.bind("mouseover.tabs", function () { i("hover", a(this)) }), this.lis.bind("mouseout.tabs", function () { j("hover", a(this)) }), this.anchors.bind("focus.tabs", function () { i("focus", a(this).closest("li")) }), this.anchors.bind("blur.tabs", function () { j("focus", a(this).closest("li")) }) } var k, l; e.fx && (a.isArray(e.fx) ? (k = e.fx[0], l = e.fx[1]) : k = l = e.fx); var n = l ? function (b, c) { a(b).closest("li").addClass("ui-tabs-selected ui-state-active"), c.hide().removeClass("ui-tabs-hide").animate(l, l.duration || "normal", function () { m(c, l), d._trigger("show", null, d._ui(b, c[0])) }) } : function (b, c) { a(b).closest("li").addClass("ui-tabs-selected ui-state-active"), c.removeClass("ui-tabs-hide"), d._trigger("show", null, d._ui(b, c[0])) }, o = k ? function (a, b) { b.animate(k, k.duration || "normal", function () { d.lis.removeClass("ui-tabs-selected ui-state-active"), b.addClass("ui-tabs-hide"), m(b, k), d.element.dequeue("tabs") }) } : function (a, b, c) { d.lis.removeClass("ui-tabs-selected ui-state-active"), b.addClass("ui-tabs-hide"), d.element.dequeue("tabs") }; this.anchors.bind(e.event + ".tabs", function () { var b = this, c = a(b).closest("li"), f = d.panels.filter(":not(.ui-tabs-hide)"), g = d.element.find(d._sanitizeSelector(b.hash)); if (c.hasClass("ui-tabs-selected") && !e.collapsible || c.hasClass("ui-state-disabled") || c.hasClass("ui-state-processing") || d.panels.filter(":animated").length || d._trigger("select", null, d._ui(this, g[0])) === !1) return this.blur(), !1; e.selected = d.anchors.index(this), d.abort(); if (e.collapsible) { if (c.hasClass("ui-tabs-selected")) return e.selected = -1, e.cookie && d._cookie(e.selected, e.cookie), d.element.queue("tabs", function () { o(b, f) }).dequeue("tabs"), this.blur(), !1; if (!f.length) return e.cookie && d._cookie(e.selected, e.cookie), d.element.queue("tabs", function () { n(b, g) }), d.load(d.anchors.index(this)), this.blur(), !1 } e.cookie && d._cookie(e.selected, e.cookie); if (g.length) f.length && d.element.queue("tabs", function () { o(b, f) }), d.element.queue("tabs", function () { n(b, g) }), d.load(d.anchors.index(this)); else throw "jQuery UI Tabs: Mismatching fragment identifier."; a.browser.msie && this.blur() }), this.anchors.bind("click.tabs", function () { return !1 }) }, _getIndex: function (a) { return typeof a == "string" && (a = this.anchors.index(this.anchors.filter("[href$='" + a + "']"))), a }, destroy: function () { var b = this.options; return this.abort(), this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"), this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"), this.anchors.each(function () { var b = a.data(this, "href.tabs"); b && (this.href = b); var c = a(this).unbind(".tabs"); a.each(["href", "load", "cache"], function (a, b) { c.removeData(b + ".tabs") }) }), this.lis.unbind(".tabs").add(this.panels).each(function () { a.data(this, "destroy.tabs") ? a(this).remove() : a(this).removeClass(["ui-state-default", "ui-corner-top", "ui-tabs-selected", "ui-state-active", "ui-state-hover", "ui-state-focus", "ui-state-disabled", "ui-tabs-panel", "ui-widget-content", "ui-corner-bottom", "ui-tabs-hide"].join(" ")) }), b.cookie && this._cookie(null, b.cookie), this }, add: function (c, d, e) { e === b && (e = this.anchors.length); var f = this, g = this.options, h = a(g.tabTemplate.replace(/#\{href\}/g, c).replace(/#\{label\}/g, d)), i = c.indexOf("#") ? this._tabId(a("a", h)[0]) : c.replace("#", ""); h.addClass("ui-state-default ui-corner-top").data("destroy.tabs", !0); var j = f.element.find("#" + i); return j.length || (j = a(g.panelTemplate).attr("id", i).data("destroy.tabs", !0)), j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"), e >= this.lis.length ? (h.appendTo(this.list), j.appendTo(this.list[0].parentNode)) : (h.insertBefore(this.lis[e]), j.insertBefore(this.panels[e])), g.disabled = a.map(g.disabled, function (a, b) { return a >= e ? ++a : a }), this._tabify(), this.anchors.length == 1 && (g.selected = 0, h.addClass("ui-tabs-selected ui-state-active"), j.removeClass("ui-tabs-hide"), this.element.queue("tabs", function () { f._trigger("show", null, f._ui(f.anchors[0], f.panels[0])) }), this.load(0)), this._trigger("add", null, this._ui(this.anchors[e], this.panels[e])), this }, remove: function (b) { b = this._getIndex(b); var c = this.options, d = this.lis.eq(b).remove(), e = this.panels.eq(b).remove(); return d.hasClass("ui-tabs-selected") && this.anchors.length > 1 && this.select(b + (b + 1 < this.anchors.length ? 1 : -1)), c.disabled = a.map(a.grep(c.disabled, function (a, c) { return a != b }), function (a, c) { return a >= b ? --a : a }), this._tabify(), this._trigger("remove", null, this._ui(d.find("a")[0], e[0])), this }, enable: function (b) { b = this._getIndex(b); var c = this.options; if (a.inArray(b, c.disabled) == -1) return; return this.lis.eq(b).removeClass("ui-state-disabled"), c.disabled = a.grep(c.disabled, function (a, c) { return a != b }), this._trigger("enable", null, this._ui(this.anchors[b], this.panels[b])), this }, disable: function (a) { a = this._getIndex(a); var b = this, c = this.options; return a != c.selected && (this.lis.eq(a).addClass("ui-state-disabled"), c.disabled.push(a), c.disabled.sort(), this._trigger("disable", null, this._ui(this.anchors[a], this.panels[a]))), this }, select: function (a) { a = this._getIndex(a); if (a == -1) if (this.options.collapsible && this.options.selected != -1) a = this.options.selected; else return this; return this.anchors.eq(a).trigger(this.options.event + ".tabs"), this }, load: function (b) { b = this._getIndex(b); var c = this, d = this.options, e = this.anchors.eq(b)[0], f = a.data(e, "load.tabs"); this.abort(); if (!f || this.element.queue("tabs").length !== 0 && a.data(e, "cache.tabs")) { this.element.dequeue("tabs"); return } this.lis.eq(b).addClass("ui-state-processing"); if (d.spinner) { var g = a("span", e); g.data("label.tabs", g.html()).html(d.spinner) } return this.xhr = a.ajax(a.extend({}, d.ajaxOptions, { url: f, success: function (f, g) { c.element.find(c._sanitizeSelector(e.hash)).html(f), c._cleanup(), d.cache && a.data(e, "cache.tabs", !0), c._trigger("load", null, c._ui(c.anchors[b], c.panels[b])); try { d.ajaxOptions.success(f, g) } catch (h) { } }, error: function (a, f, g) { c._cleanup(), c._trigger("load", null, c._ui(c.anchors[b], c.panels[b])); try { d.ajaxOptions.error(a, f, b, e) } catch (g) { } } })), c.element.dequeue("tabs"), this }, abort: function () { return this.element.queue([]), this.panels.stop(!1, !0), this.element.queue("tabs", this.element.queue("tabs").splice(-2, 2)), this.xhr && (this.xhr.abort(), delete this.xhr), this._cleanup(), this }, url: function (a, b) { return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs", b), this }, length: function () { return this.anchors.length } }), a.extend(a.ui.tabs, { version: "1.8.24" }), a.extend(a.ui.tabs.prototype, { rotation: null, rotate: function (a, b) { var c = this, d = this.options, e = c._rotate || (c._rotate = function (b) { clearTimeout(c.rotation), c.rotation = setTimeout(function () { var a = d.selected; c.select(++a < c.anchors.length ? a : 0) }, a), b && b.stopPropagation() }), f = c._unrotate || (c._unrotate = b ? function (a) { e() } : function (a) { a.clientX && c.rotate(null) }); return a ? (this.element.bind("tabsshow", e), this.anchors.bind(d.event + ".tabs", f), e()) : (clearTimeout(c.rotation), this.element.unbind("tabsshow", e), this.anchors.unbind(d.event + ".tabs", f), delete this._rotate, delete this._unrotate), this } }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.datepicker.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function ($, undefined) { function Datepicker() { this.debug = !1, this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = "ui-datepicker-div", this._inlineClass = "ui-datepicker-inline", this._appendClass = "ui-datepicker-append", this._triggerClass = "ui-datepicker-trigger", this._dialogClass = "ui-datepicker-dialog", this._disableClass = "ui-datepicker-disabled", this._unselectableClass = "ui-datepicker-unselectable", this._currentClass = "ui-datepicker-current-day", this._dayOverClass = "ui-datepicker-days-cell-over", this.regional = [], this.regional[""] = { closeText: "Done", prevText: "Prev", nextText: "Next", currentText: "Today", monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], weekHeader: "Wk", dateFormat: "mm/dd/yy", firstDay: 0, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" }, this._defaults = { showOn: "focus", showAnim: "fadeIn", showOptions: {}, defaultDate: null, appendText: "", buttonText: "...", buttonImage: "", buttonImageOnly: !1, hideIfNoPrevNext: !1, navigationAsDateFormat: !1, gotoCurrent: !1, changeMonth: !1, changeYear: !1, yearRange: "c-10:c+10", showOtherMonths: !1, selectOtherMonths: !1, showWeek: !1, calculateWeek: this.iso8601Week, shortYearCutoff: "+10", minDate: null, maxDate: null, duration: "fast", beforeShowDay: null, beforeShow: null, onSelect: null, onChangeMonthYear: null, onClose: null, numberOfMonths: 1, showCurrentAtPos: 0, stepMonths: 1, stepBigMonths: 12, altField: "", altFormat: "", constrainInput: !0, showButtonPanel: !1, autoSize: !1, disabled: !1 }, $.extend(this._defaults, this.regional[""]), this.dpDiv = bindHover($('
    ')) } function bindHover(a) { var b = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; return a.bind("mouseout", function (a) { var c = $(a.target).closest(b); if (!c.length) return; c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover") }).bind("mouseover", function (c) { var d = $(c.target).closest(b); if ($.datepicker._isDisabledDatepicker(instActive.inline ? a.parent()[0] : instActive.input[0]) || !d.length) return; d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), d.addClass("ui-state-hover"), d.hasClass("ui-datepicker-prev") && d.addClass("ui-datepicker-prev-hover"), d.hasClass("ui-datepicker-next") && d.addClass("ui-datepicker-next-hover") }) } function extendRemove(a, b) { $.extend(a, b); for (var c in b) if (b[c] == null || b[c] == undefined) a[c] = b[c]; return a } function isArray(a) { return a && ($.browser.safari && typeof a == "object" && a.length || a.constructor && a.constructor.toString().match(/\Array\(\)/)) } $.extend($.ui, { datepicker: { version: "1.8.24"} }); var PROP_NAME = "datepicker", dpuuid = (new Date).getTime(), instActive; $.extend(Datepicker.prototype, { markerClassName: "hasDatepicker", maxRows: 4, log: function () { this.debug && console.log.apply("", arguments) }, _widgetDatepicker: function () { return this.dpDiv }, setDefaults: function (a) { return extendRemove(this._defaults, a || {}), this }, _attachDatepicker: function (target, settings) { var inlineSettings = null; for (var attrName in this._defaults) { var attrValue = target.getAttribute("date:" + attrName); if (attrValue) { inlineSettings = inlineSettings || {}; try { inlineSettings[attrName] = eval(attrValue) } catch (err) { inlineSettings[attrName] = attrValue } } } var nodeName = target.nodeName.toLowerCase(), inline = nodeName == "div" || nodeName == "span"; target.id || (this.uuid += 1, target.id = "dp" + this.uuid); var inst = this._newInst($(target), inline); inst.settings = $.extend({}, settings || {}, inlineSettings || {}), nodeName == "input" ? this._connectDatepicker(target, inst) : inline && this._inlineDatepicker(target, inst) }, _newInst: function (a, b) { var c = a[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1"); return { id: c, input: a, selectedDay: 0, selectedMonth: 0, selectedYear: 0, drawMonth: 0, drawYear: 0, inline: b, dpDiv: b ? bindHover($('
    ')) : this.dpDiv} }, _connectDatepicker: function (a, b) { var c = $(a); b.append = $([]), b.trigger = $([]); if (c.hasClass(this.markerClassName)) return; this._attachments(c, b), c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", function (a, c, d) { b.settings[c] = d }).bind("getData.datepicker", function (a, c) { return this._get(b, c) }), this._autoSize(b), $.data(a, PROP_NAME, b), b.settings.disabled && this._disableDatepicker(a) }, _attachments: function (a, b) { var c = this._get(b, "appendText"), d = this._get(b, "isRTL"); b.append && b.append.remove(), c && (b.append = $('' + c + ""), a[d ? "before" : "after"](b.append)), a.unbind("focus", this._showDatepicker), b.trigger && b.trigger.remove(); var e = this._get(b, "showOn"); (e == "focus" || e == "both") && a.focus(this._showDatepicker); if (e == "button" || e == "both") { var f = this._get(b, "buttonText"), g = this._get(b, "buttonImage"); b.trigger = $(this._get(b, "buttonImageOnly") ? $("").addClass(this._triggerClass).attr({ src: g, alt: f, title: f }) : $('').addClass(this._triggerClass).html(g == "" ? f : $("").attr({ src: g, alt: f, title: f }))), a[d ? "before" : "after"](b.trigger), b.trigger.click(function () { return $.datepicker._datepickerShowing && $.datepicker._lastInput == a[0] ? $.datepicker._hideDatepicker() : $.datepicker._datepickerShowing && $.datepicker._lastInput != a[0] ? ($.datepicker._hideDatepicker(), $.datepicker._showDatepicker(a[0])) : $.datepicker._showDatepicker(a[0]), !1 }) } }, _autoSize: function (a) { if (this._get(a, "autoSize") && !a.inline) { var b = new Date(2009, 11, 20), c = this._get(a, "dateFormat"); if (c.match(/[DM]/)) { var d = function (a) { var b = 0, c = 0; for (var d = 0; d < a.length; d++) a[d].length > b && (b = a[d].length, c = d); return c }; b.setMonth(d(this._get(a, c.match(/MM/) ? "monthNames" : "monthNamesShort"))), b.setDate(d(this._get(a, c.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - b.getDay()) } a.input.attr("size", this._formatDate(a, b).length) } }, _inlineDatepicker: function (a, b) { var c = $(a); if (c.hasClass(this.markerClassName)) return; c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker", function (a, c, d) { b.settings[c] = d }).bind("getData.datepicker", function (a, c) { return this._get(b, c) }), $.data(a, PROP_NAME, b), this._setDate(b, this._getDefaultDate(b), !0), this._updateDatepicker(b), this._updateAlternate(b), b.settings.disabled && this._disableDatepicker(a), b.dpDiv.css("display", "block") }, _dialogDatepicker: function (a, b, c, d, e) { var f = this._dialogInst; if (!f) { this.uuid += 1; var g = "dp" + this.uuid; this._dialogInput = $(''), this._dialogInput.keydown(this._doKeyDown), $("body").append(this._dialogInput), f = this._dialogInst = this._newInst(this._dialogInput, !1), f.settings = {}, $.data(this._dialogInput[0], PROP_NAME, f) } extendRemove(f.settings, d || {}), b = b && b.constructor == Date ? this._formatDate(f, b) : b, this._dialogInput.val(b), this._pos = e ? e.length ? e : [e.pageX, e.pageY] : null; if (!this._pos) { var h = document.documentElement.clientWidth, i = document.documentElement.clientHeight, j = document.documentElement.scrollLeft || document.body.scrollLeft, k = document.documentElement.scrollTop || document.body.scrollTop; this._pos = [h / 2 - 100 + j, i / 2 - 150 + k] } return this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), f.settings.onSelect = c, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), $.blockUI && $.blockUI(this.dpDiv), $.data(this._dialogInput[0], PROP_NAME, f), this }, _destroyDatepicker: function (a) { var b = $(a), c = $.data(a, PROP_NAME); if (!b.hasClass(this.markerClassName)) return; var d = a.nodeName.toLowerCase(); $.removeData(a, PROP_NAME), d == "input" ? (c.append.remove(), c.trigger.remove(), b.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)) : (d == "div" || d == "span") && b.removeClass(this.markerClassName).empty() }, _enableDatepicker: function (a) { var b = $(a), c = $.data(a, PROP_NAME); if (!b.hasClass(this.markerClassName)) return; var d = a.nodeName.toLowerCase(); if (d == "input") a.disabled = !1, c.trigger.filter("button").each(function () { this.disabled = !1 }).end().filter("img").css({ opacity: "1.0", cursor: "" }); else if (d == "div" || d == "span") { var e = b.children("." + this._inlineClass); e.children().removeClass("ui-state-disabled"), e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled") } this._disabledInputs = $.map(this._disabledInputs, function (b) { return b == a ? null : b }) }, _disableDatepicker: function (a) { var b = $(a), c = $.data(a, PROP_NAME); if (!b.hasClass(this.markerClassName)) return; var d = a.nodeName.toLowerCase(); if (d == "input") a.disabled = !0, c.trigger.filter("button").each(function () { this.disabled = !0 }).end().filter("img").css({ opacity: "0.5", cursor: "default" }); else if (d == "div" || d == "span") { var e = b.children("." + this._inlineClass); e.children().addClass("ui-state-disabled"), e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled", "disabled") } this._disabledInputs = $.map(this._disabledInputs, function (b) { return b == a ? null : b }), this._disabledInputs[this._disabledInputs.length] = a }, _isDisabledDatepicker: function (a) { if (!a) return !1; for (var b = 0; b < this._disabledInputs.length; b++) if (this._disabledInputs[b] == a) return !0; return !1 }, _getInst: function (a) { try { return $.data(a, PROP_NAME) } catch (b) { throw "Missing instance data for this datepicker" } }, _optionDatepicker: function (a, b, c) { var d = this._getInst(a); if (arguments.length == 2 && typeof b == "string") return b == "defaults" ? $.extend({}, $.datepicker._defaults) : d ? b == "all" ? $.extend({}, d.settings) : this._get(d, b) : null; var e = b || {}; typeof b == "string" && (e = {}, e[b] = c); if (d) { this._curInst == d && this._hideDatepicker(); var f = this._getDateDatepicker(a, !0), g = this._getMinMaxDate(d, "min"), h = this._getMinMaxDate(d, "max"); extendRemove(d.settings, e), g !== null && e.dateFormat !== undefined && e.minDate === undefined && (d.settings.minDate = this._formatDate(d, g)), h !== null && e.dateFormat !== undefined && e.maxDate === undefined && (d.settings.maxDate = this._formatDate(d, h)), this._attachments($(a), d), this._autoSize(d), this._setDate(d, f), this._updateAlternate(d), this._updateDatepicker(d) } }, _changeDatepicker: function (a, b, c) { this._optionDatepicker(a, b, c) }, _refreshDatepicker: function (a) { var b = this._getInst(a); b && this._updateDatepicker(b) }, _setDateDatepicker: function (a, b) { var c = this._getInst(a); c && (this._setDate(c, b), this._updateDatepicker(c), this._updateAlternate(c)) }, _getDateDatepicker: function (a, b) { var c = this._getInst(a); return c && !c.inline && this._setDateFromField(c, b), c ? this._getDate(c) : null }, _doKeyDown: function (a) { var b = $.datepicker._getInst(a.target), c = !0, d = b.dpDiv.is(".ui-datepicker-rtl"); b._keyEvent = !0; if ($.datepicker._datepickerShowing) switch (a.keyCode) { case 9: $.datepicker._hideDatepicker(), c = !1; break; case 13: var e = $("td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", b.dpDiv); e[0] && $.datepicker._selectDay(a.target, b.selectedMonth, b.selectedYear, e[0]); var f = $.datepicker._get(b, "onSelect"); if (f) { var g = $.datepicker._formatDate(b); f.apply(b.input ? b.input[0] : null, [g, b]) } else $.datepicker._hideDatepicker(); return !1; case 27: $.datepicker._hideDatepicker(); break; case 33: $.datepicker._adjustDate(a.target, a.ctrlKey ? -$.datepicker._get(b, "stepBigMonths") : -$.datepicker._get(b, "stepMonths"), "M"); break; case 34: $.datepicker._adjustDate(a.target, a.ctrlKey ? +$.datepicker._get(b, "stepBigMonths") : +$.datepicker._get(b, "stepMonths"), "M"); break; case 35: (a.ctrlKey || a.metaKey) && $.datepicker._clearDate(a.target), c = a.ctrlKey || a.metaKey; break; case 36: (a.ctrlKey || a.metaKey) && $.datepicker._gotoToday(a.target), c = a.ctrlKey || a.metaKey; break; case 37: (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, d ? 1 : -1, "D"), c = a.ctrlKey || a.metaKey, a.originalEvent.altKey && $.datepicker._adjustDate(a.target, a.ctrlKey ? -$.datepicker._get(b, "stepBigMonths") : -$.datepicker._get(b, "stepMonths"), "M"); break; case 38: (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, -7, "D"), c = a.ctrlKey || a.metaKey; break; case 39: (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, d ? -1 : 1, "D"), c = a.ctrlKey || a.metaKey, a.originalEvent.altKey && $.datepicker._adjustDate(a.target, a.ctrlKey ? +$.datepicker._get(b, "stepBigMonths") : +$.datepicker._get(b, "stepMonths"), "M"); break; case 40: (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, 7, "D"), c = a.ctrlKey || a.metaKey; break; default: c = !1 } else a.keyCode == 36 && a.ctrlKey ? $.datepicker._showDatepicker(this) : c = !1; c && (a.preventDefault(), a.stopPropagation()) }, _doKeyPress: function (a) { var b = $.datepicker._getInst(a.target); if ($.datepicker._get(b, "constrainInput")) { var c = $.datepicker._possibleChars($.datepicker._get(b, "dateFormat")), d = String.fromCharCode(a.charCode == undefined ? a.keyCode : a.charCode); return a.ctrlKey || a.metaKey || d < " " || !c || c.indexOf(d) > -1 } }, _doKeyUp: function (a) { var b = $.datepicker._getInst(a.target); if (b.input.val() != b.lastVal) try { var c = $.datepicker.parseDate($.datepicker._get(b, "dateFormat"), b.input ? b.input.val() : null, $.datepicker._getFormatConfig(b)); c && ($.datepicker._setDateFromField(b), $.datepicker._updateAlternate(b), $.datepicker._updateDatepicker(b)) } catch (d) { $.datepicker.log(d) } return !0 }, _showDatepicker: function (a) { a = a.target || a, a.nodeName.toLowerCase() != "input" && (a = $("input", a.parentNode)[0]); if ($.datepicker._isDisabledDatepicker(a) || $.datepicker._lastInput == a) return; var b = $.datepicker._getInst(a); $.datepicker._curInst && $.datepicker._curInst != b && ($.datepicker._curInst.dpDiv.stop(!0, !0), b && $.datepicker._datepickerShowing && $.datepicker._hideDatepicker($.datepicker._curInst.input[0])); var c = $.datepicker._get(b, "beforeShow"), d = c ? c.apply(a, [a, b]) : {}; if (d === !1) return; extendRemove(b.settings, d), b.lastVal = null, $.datepicker._lastInput = a, $.datepicker._setDateFromField(b), $.datepicker._inDialog && (a.value = ""), $.datepicker._pos || ($.datepicker._pos = $.datepicker._findPos(a), $.datepicker._pos[1] += a.offsetHeight); var e = !1; $(a).parents().each(function () { return e |= $(this).css("position") == "fixed", !e }), e && $.browser.opera && ($.datepicker._pos[0] -= document.documentElement.scrollLeft, $.datepicker._pos[1] -= document.documentElement.scrollTop); var f = { left: $.datepicker._pos[0], top: $.datepicker._pos[1] }; $.datepicker._pos = null, b.dpDiv.empty(), b.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" }), $.datepicker._updateDatepicker(b), f = $.datepicker._checkOffset(b, f, e), b.dpDiv.css({ position: $.datepicker._inDialog && $.blockUI ? "static" : e ? "fixed" : "absolute", display: "none", left: f.left + "px", top: f.top + "px" }); if (!b.inline) { var g = $.datepicker._get(b, "showAnim"), h = $.datepicker._get(b, "duration"), i = function () { var a = b.dpDiv.find("iframe.ui-datepicker-cover"); if (!!a.length) { var c = $.datepicker._getBorders(b.dpDiv); a.css({ left: -c[0], top: -c[1], width: b.dpDiv.outerWidth(), height: b.dpDiv.outerHeight() }) } }; b.dpDiv.zIndex($(a).zIndex() + 1), $.datepicker._datepickerShowing = !0, $.effects && $.effects[g] ? b.dpDiv.show(g, $.datepicker._get(b, "showOptions"), h, i) : b.dpDiv[g || "show"](g ? h : null, i), (!g || !h) && i(), b.input.is(":visible") && !b.input.is(":disabled") && b.input.focus(), $.datepicker._curInst = b } }, _updateDatepicker: function (a) { var b = this; b.maxRows = 4; var c = $.datepicker._getBorders(a.dpDiv); instActive = a, a.dpDiv.empty().append(this._generateHTML(a)), this._attachHandlers(a); var d = a.dpDiv.find("iframe.ui-datepicker-cover"); !d.length || d.css({ left: -c[0], top: -c[1], width: a.dpDiv.outerWidth(), height: a.dpDiv.outerHeight() }), a.dpDiv.find("." + this._dayOverClass + " a").mouseover(); var e = this._getNumberOfMonths(a), f = e[1], g = 17; a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), f > 1 && a.dpDiv.addClass("ui-datepicker-multi-" + f).css("width", g * f + "em"), a.dpDiv[(e[0] != 1 || e[1] != 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi"), a.dpDiv[(this._get(a, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), a == $.datepicker._curInst && $.datepicker._datepickerShowing && a.input && a.input.is(":visible") && !a.input.is(":disabled") && a.input[0] != document.activeElement && a.input.focus(); if (a.yearshtml) { var h = a.yearshtml; setTimeout(function () { h === a.yearshtml && a.yearshtml && a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml), h = a.yearshtml = null }, 0) } }, _getBorders: function (a) { var b = function (a) { return { thin: 1, medium: 2, thick: 3}[a] || a }; return [parseFloat(b(a.css("border-left-width"))), parseFloat(b(a.css("border-top-width")))] }, _checkOffset: function (a, b, c) { var d = a.dpDiv.outerWidth(), e = a.dpDiv.outerHeight(), f = a.input ? a.input.outerWidth() : 0, g = a.input ? a.input.outerHeight() : 0, h = document.documentElement.clientWidth + (c ? 0 : $(document).scrollLeft()), i = document.documentElement.clientHeight + (c ? 0 : $(document).scrollTop()); return b.left -= this._get(a, "isRTL") ? d - f : 0, b.left -= c && b.left == a.input.offset().left ? $(document).scrollLeft() : 0, b.top -= c && b.top == a.input.offset().top + g ? $(document).scrollTop() : 0, b.left -= Math.min(b.left, b.left + d > h && h > d ? Math.abs(b.left + d - h) : 0), b.top -= Math.min(b.top, b.top + e > i && i > e ? Math.abs(e + g) : 0), b }, _findPos: function (a) { var b = this._getInst(a), c = this._get(b, "isRTL"); while (a && (a.type == "hidden" || a.nodeType != 1 || $.expr.filters.hidden(a))) a = a[c ? "previousSibling" : "nextSibling"]; var d = $(a).offset(); return [d.left, d.top] }, _hideDatepicker: function (a) { var b = this._curInst; if (!b || a && b != $.data(a, PROP_NAME)) return; if (this._datepickerShowing) { var c = this._get(b, "showAnim"), d = this._get(b, "duration"), e = function () { $.datepicker._tidyDialog(b) }; $.effects && $.effects[c] ? b.dpDiv.hide(c, $.datepicker._get(b, "showOptions"), d, e) : b.dpDiv[c == "slideDown" ? "slideUp" : c == "fadeIn" ? "fadeOut" : "hide"](c ? d : null, e), c || e(), this._datepickerShowing = !1; var f = this._get(b, "onClose"); f && f.apply(b.input ? b.input[0] : null, [b.input ? b.input.val() : "", b]), this._lastInput = null, this._inDialog && (this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }), $.blockUI && ($.unblockUI(), $("body").append(this.dpDiv))), this._inDialog = !1 } }, _tidyDialog: function (a) { a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar") }, _checkExternalClick: function (a) { if (!$.datepicker._curInst) return; var b = $(a.target), c = $.datepicker._getInst(b[0]); (b[0].id != $.datepicker._mainDivId && b.parents("#" + $.datepicker._mainDivId).length == 0 && !b.hasClass($.datepicker.markerClassName) && !b.closest("." + $.datepicker._triggerClass).length && $.datepicker._datepickerShowing && (!$.datepicker._inDialog || !$.blockUI) || b.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != c) && $.datepicker._hideDatepicker() }, _adjustDate: function (a, b, c) { var d = $(a), e = this._getInst(d[0]); if (this._isDisabledDatepicker(d[0])) return; this._adjustInstDate(e, b + (c == "M" ? this._get(e, "showCurrentAtPos") : 0), c), this._updateDatepicker(e) }, _gotoToday: function (a) { var b = $(a), c = this._getInst(b[0]); if (this._get(c, "gotoCurrent") && c.currentDay) c.selectedDay = c.currentDay, c.drawMonth = c.selectedMonth = c.currentMonth, c.drawYear = c.selectedYear = c.currentYear; else { var d = new Date; c.selectedDay = d.getDate(), c.drawMonth = c.selectedMonth = d.getMonth(), c.drawYear = c.selectedYear = d.getFullYear() } this._notifyChange(c), this._adjustDate(b) }, _selectMonthYear: function (a, b, c) { var d = $(a), e = this._getInst(d[0]); e["selected" + (c == "M" ? "Month" : "Year")] = e["draw" + (c == "M" ? "Month" : "Year")] = parseInt(b.options[b.selectedIndex].value, 10), this._notifyChange(e), this._adjustDate(d) }, _selectDay: function (a, b, c, d) { var e = $(a); if ($(d).hasClass(this._unselectableClass) || this._isDisabledDatepicker(e[0])) return; var f = this._getInst(e[0]); f.selectedDay = f.currentDay = $("a", d).html(), f.selectedMonth = f.currentMonth = b, f.selectedYear = f.currentYear = c, this._selectDate(a, this._formatDate(f, f.currentDay, f.currentMonth, f.currentYear)) }, _clearDate: function (a) { var b = $(a), c = this._getInst(b[0]); this._selectDate(b, "") }, _selectDate: function (a, b) { var c = $(a), d = this._getInst(c[0]); b = b != null ? b : this._formatDate(d), d.input && d.input.val(b), this._updateAlternate(d); var e = this._get(d, "onSelect"); e ? e.apply(d.input ? d.input[0] : null, [b, d]) : d.input && d.input.trigger("change"), d.inline ? this._updateDatepicker(d) : (this._hideDatepicker(), this._lastInput = d.input[0], typeof d.input[0] != "object" && d.input.focus(), this._lastInput = null) }, _updateAlternate: function (a) { var b = this._get(a, "altField"); if (b) { var c = this._get(a, "altFormat") || this._get(a, "dateFormat"), d = this._getDate(a), e = this.formatDate(c, d, this._getFormatConfig(a)); $(b).each(function () { $(this).val(e) }) } }, noWeekends: function (a) { var b = a.getDay(); return [b > 0 && b < 6, ""] }, iso8601Week: function (a) { var b = new Date(a.getTime()); b.setDate(b.getDate() + 4 - (b.getDay() || 7)); var c = b.getTime(); return b.setMonth(0), b.setDate(1), Math.floor(Math.round((c - b) / 864e5) / 7) + 1 }, parseDate: function (a, b, c) { if (a == null || b == null) throw "Invalid arguments"; b = typeof b == "object" ? b.toString() : b + ""; if (b == "") return null; var d = (c ? c.shortYearCutoff : null) || this._defaults.shortYearCutoff; d = typeof d != "string" ? d : (new Date).getFullYear() % 100 + parseInt(d, 10); var e = (c ? c.dayNamesShort : null) || this._defaults.dayNamesShort, f = (c ? c.dayNames : null) || this._defaults.dayNames, g = (c ? c.monthNamesShort : null) || this._defaults.monthNamesShort, h = (c ? c.monthNames : null) || this._defaults.monthNames, i = -1, j = -1, k = -1, l = -1, m = !1, n = function (b) { var c = s + 1 < a.length && a.charAt(s + 1) == b; return c && s++, c }, o = function (a) { var c = n(a), d = a == "@" ? 14 : a == "!" ? 20 : a == "y" && c ? 4 : a == "o" ? 3 : 2, e = new RegExp("^\\d{1," + d + "}"), f = b.substring(r).match(e); if (!f) throw "Missing number at position " + r; return r += f[0].length, parseInt(f[0], 10) }, p = function (a, c, d) { var e = $.map(n(a) ? d : c, function (a, b) { return [[b, a]] }).sort(function (a, b) { return -(a[1].length - b[1].length) }), f = -1; $.each(e, function (a, c) { var d = c[1]; if (b.substr(r, d.length).toLowerCase() == d.toLowerCase()) return f = c[0], r += d.length, !1 }); if (f != -1) return f + 1; throw "Unknown name at position " + r }, q = function () { if (b.charAt(r) != a.charAt(s)) throw "Unexpected literal at position " + r; r++ }, r = 0; for (var s = 0; s < a.length; s++) if (m) a.charAt(s) == "'" && !n("'") ? m = !1 : q(); else switch (a.charAt(s)) { case "d": k = o("d"); break; case "D": p("D", e, f); break; case "o": l = o("o"); break; case "m": j = o("m"); break; case "M": j = p("M", g, h); break; case "y": i = o("y"); break; case "@": var t = new Date(o("@")); i = t.getFullYear(), j = t.getMonth() + 1, k = t.getDate(); break; case "!": var t = new Date((o("!") - this._ticksTo1970) / 1e4); i = t.getFullYear(), j = t.getMonth() + 1, k = t.getDate(); break; case "'": n("'") ? q() : m = !0; break; default: q() } if (r < b.length) throw "Extra/unparsed characters found in date: " + b.substring(r); i == -1 ? i = (new Date).getFullYear() : i < 100 && (i += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (i <= d ? 0 : -100)); if (l > -1) { j = 1, k = l; do { var u = this._getDaysInMonth(i, j - 1); if (k <= u) break; j++, k -= u } while (!0) } var t = this._daylightSavingAdjust(new Date(i, j - 1, k)); if (t.getFullYear() != i || t.getMonth() + 1 != j || t.getDate() != k) throw "Invalid date"; return t }, ATOM: "yy-mm-dd", COOKIE: "D, dd M yy", ISO_8601: "yy-mm-dd", RFC_822: "D, d M y", RFC_850: "DD, dd-M-y", RFC_1036: "D, d M y", RFC_1123: "D, d M yy", RFC_2822: "D, d M yy", RSS: "D, d M y", TICKS: "!", TIMESTAMP: "@", W3C: "yy-mm-dd", _ticksTo1970: (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)) * 24 * 60 * 60 * 1e7, formatDate: function (a, b, c) { if (!b) return ""; var d = (c ? c.dayNamesShort : null) || this._defaults.dayNamesShort, e = (c ? c.dayNames : null) || this._defaults.dayNames, f = (c ? c.monthNamesShort : null) || this._defaults.monthNamesShort, g = (c ? c.monthNames : null) || this._defaults.monthNames, h = function (b) { var c = m + 1 < a.length && a.charAt(m + 1) == b; return c && m++, c }, i = function (a, b, c) { var d = "" + b; if (h(a)) while (d.length < c) d = "0" + d; return d }, j = function (a, b, c, d) { return h(a) ? d[b] : c[b] }, k = "", l = !1; if (b) for (var m = 0; m < a.length; m++) if (l) a.charAt(m) == "'" && !h("'") ? l = !1 : k += a.charAt(m); else switch (a.charAt(m)) { case "d": k += i("d", b.getDate(), 2); break; case "D": k += j("D", b.getDay(), d, e); break; case "o": k += i("o", Math.round(((new Date(b.getFullYear(), b.getMonth(), b.getDate())).getTime() - (new Date(b.getFullYear(), 0, 0)).getTime()) / 864e5), 3); break; case "m": k += i("m", b.getMonth() + 1, 2); break; case "M": k += j("M", b.getMonth(), f, g); break; case "y": k += h("y") ? b.getFullYear() : (b.getYear() % 100 < 10 ? "0" : "") + b.getYear() % 100; break; case "@": k += b.getTime(); break; case "!": k += b.getTime() * 1e4 + this._ticksTo1970; break; case "'": h("'") ? k += "'" : l = !0; break; default: k += a.charAt(m) } return k }, _possibleChars: function (a) { var b = "", c = !1, d = function (b) { var c = e + 1 < a.length && a.charAt(e + 1) == b; return c && e++, c }; for (var e = 0; e < a.length; e++) if (c) a.charAt(e) == "'" && !d("'") ? c = !1 : b += a.charAt(e); else switch (a.charAt(e)) { case "d": case "m": case "y": case "@": b += "0123456789"; break; case "D": case "M": return null; case "'": d("'") ? b += "'" : c = !0; break; default: b += a.charAt(e) } return b }, _get: function (a, b) { return a.settings[b] !== undefined ? a.settings[b] : this._defaults[b] }, _setDateFromField: function (a, b) { if (a.input.val() == a.lastVal) return; var c = this._get(a, "dateFormat"), d = a.lastVal = a.input ? a.input.val() : null, e, f; e = f = this._getDefaultDate(a); var g = this._getFormatConfig(a); try { e = this.parseDate(c, d, g) || f } catch (h) { this.log(h), d = b ? "" : d } a.selectedDay = e.getDate(), a.drawMonth = a.selectedMonth = e.getMonth(), a.drawYear = a.selectedYear = e.getFullYear(), a.currentDay = d ? e.getDate() : 0, a.currentMonth = d ? e.getMonth() : 0, a.currentYear = d ? e.getFullYear() : 0, this._adjustInstDate(a) }, _getDefaultDate: function (a) { return this._restrictMinMax(a, this._determineDate(a, this._get(a, "defaultDate"), new Date)) }, _determineDate: function (a, b, c) { var d = function (a) { var b = new Date; return b.setDate(b.getDate() + a), b }, e = function (b) { try { return $.datepicker.parseDate($.datepicker._get(a, "dateFormat"), b, $.datepicker._getFormatConfig(a)) } catch (c) { } var d = (b.toLowerCase().match(/^c/) ? $.datepicker._getDate(a) : null) || new Date, e = d.getFullYear(), f = d.getMonth(), g = d.getDate(), h = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, i = h.exec(b); while (i) { switch (i[2] || "d") { case "d": case "D": g += parseInt(i[1], 10); break; case "w": case "W": g += parseInt(i[1], 10) * 7; break; case "m": case "M": f += parseInt(i[1], 10), g = Math.min(g, $.datepicker._getDaysInMonth(e, f)); break; case "y": case "Y": e += parseInt(i[1], 10), g = Math.min(g, $.datepicker._getDaysInMonth(e, f)) } i = h.exec(b) } return new Date(e, f, g) }, f = b == null || b === "" ? c : typeof b == "string" ? e(b) : typeof b == "number" ? isNaN(b) ? c : d(b) : new Date(b.getTime()); return f = f && f.toString() == "Invalid Date" ? c : f, f && (f.setHours(0), f.setMinutes(0), f.setSeconds(0), f.setMilliseconds(0)), this._daylightSavingAdjust(f) }, _daylightSavingAdjust: function (a) { return a ? (a.setHours(a.getHours() > 12 ? a.getHours() + 2 : 0), a) : null }, _setDate: function (a, b, c) { var d = !b, e = a.selectedMonth, f = a.selectedYear, g = this._restrictMinMax(a, this._determineDate(a, b, new Date)); a.selectedDay = a.currentDay = g.getDate(), a.drawMonth = a.selectedMonth = a.currentMonth = g.getMonth(), a.drawYear = a.selectedYear = a.currentYear = g.getFullYear(), (e != a.selectedMonth || f != a.selectedYear) && !c && this._notifyChange(a), this._adjustInstDate(a), a.input && a.input.val(d ? "" : this._formatDate(a)) }, _getDate: function (a) { var b = !a.currentYear || a.input && a.input.val() == "" ? null : this._daylightSavingAdjust(new Date(a.currentYear, a.currentMonth, a.currentDay)); return b }, _attachHandlers: function (a) { var b = this._get(a, "stepMonths"), c = "#" + a.id.replace(/\\\\/g, "\\"); a.dpDiv.find("[data-handler]").map(function () { var a = { prev: function () { window["DP_jQuery_" + dpuuid].datepicker._adjustDate(c, -b, "M") }, next: function () { window["DP_jQuery_" + dpuuid].datepicker._adjustDate(c, +b, "M") }, hide: function () { window["DP_jQuery_" + dpuuid].datepicker._hideDatepicker() }, today: function () { window["DP_jQuery_" + dpuuid].datepicker._gotoToday(c) }, selectDay: function () { return window["DP_jQuery_" + dpuuid].datepicker._selectDay(c, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this), !1 }, selectMonth: function () { return window["DP_jQuery_" + dpuuid].datepicker._selectMonthYear(c, this, "M"), !1 }, selectYear: function () { return window["DP_jQuery_" + dpuuid].datepicker._selectMonthYear(c, this, "Y"), !1 } }; $(this).bind(this.getAttribute("data-event"), a[this.getAttribute("data-handler")]) }) }, _generateHTML: function (a) { var b = new Date; b = this._daylightSavingAdjust(new Date(b.getFullYear(), b.getMonth(), b.getDate())); var c = this._get(a, "isRTL"), d = this._get(a, "showButtonPanel"), e = this._get(a, "hideIfNoPrevNext"), f = this._get(a, "navigationAsDateFormat"), g = this._getNumberOfMonths(a), h = this._get(a, "showCurrentAtPos"), i = this._get(a, "stepMonths"), j = g[0] != 1 || g[1] != 1, k = this._daylightSavingAdjust(a.currentDay ? new Date(a.currentYear, a.currentMonth, a.currentDay) : new Date(9999, 9, 9)), l = this._getMinMaxDate(a, "min"), m = this._getMinMaxDate(a, "max"), n = a.drawMonth - h, o = a.drawYear; n < 0 && (n += 12, o--); if (m) { var p = this._daylightSavingAdjust(new Date(m.getFullYear(), m.getMonth() - g[0] * g[1] + 1, m.getDate())); p = l && p < l ? l : p; while (this._daylightSavingAdjust(new Date(o, n, 1)) > p) n--, n < 0 && (n = 11, o--) } a.drawMonth = n, a.drawYear = o; var q = this._get(a, "prevText"); q = f ? this.formatDate(q, this._daylightSavingAdjust(new Date(o, n - i, 1)), this._getFormatConfig(a)) : q; var r = this._canAdjustMonth(a, -1, o, n) ? '' + q + "" : e ? "" : '' + q + "", s = this._get(a, "nextText"); s = f ? this.formatDate(s, this._daylightSavingAdjust(new Date(o, n + i, 1)), this._getFormatConfig(a)) : s; var t = this._canAdjustMonth(a, 1, o, n) ? '' + s + "" : e ? "" : '' + s + "", u = this._get(a, "currentText"), v = this._get(a, "gotoCurrent") && a.currentDay ? k : b; u = f ? this.formatDate(u, v, this._getFormatConfig(a)) : u; var w = a.inline ? "" : '", x = d ? '
    ' + (c ? w : "") + (this._isInRange(a, v) ? '" : "") + (c ? "" : w) + "
    " : "", y = parseInt(this._get(a, "firstDay"), 10); y = isNaN(y) ? 0 : y; var z = this._get(a, "showWeek"), A = this._get(a, "dayNames"), B = this._get(a, "dayNamesShort"), C = this._get(a, "dayNamesMin"), D = this._get(a, "monthNames"), E = this._get(a, "monthNamesShort"), F = this._get(a, "beforeShowDay"), G = this._get(a, "showOtherMonths"), H = this._get(a, "selectOtherMonths"), I = this._get(a, "calculateWeek") || this.iso8601Week, J = this._getDefaultDate(a), K = ""; for (var L = 0; L < g[0]; L++) { var M = ""; this.maxRows = 4; for (var N = 0; N < g[1]; N++) { var O = this._daylightSavingAdjust(new Date(o, n, a.selectedDay)), P = " ui-corner-all", Q = ""; if (j) { Q += '
    ' + (/all|left/.test(P) && L == 0 ? c ? t : r : "") + (/all|right/.test(P) && L == 0 ? c ? r : t : "") + this._generateMonthYearHeader(a, n, o, l, m, L > 0 || N > 0, D, E) + '
    ' + ""; var R = z ? '" : ""; for (var S = 0; S < 7; S++) { var T = (S + y) % 7; R += "= 5 ? ' class="ui-datepicker-week-end"' : "") + ">" + '' + C[T] + "" } Q += R + ""; var U = this._getDaysInMonth(o, n); o == a.selectedYear && n == a.selectedMonth && (a.selectedDay = Math.min(a.selectedDay, U)); var V = (this._getFirstDayOfMonth(o, n) - y + 7) % 7, W = Math.ceil((V + U) / 7), X = j ? this.maxRows > W ? this.maxRows : W : W; this.maxRows = X; var Y = this._daylightSavingAdjust(new Date(o, n, 1 - V)); for (var Z = 0; Z < X; Z++) { Q += ""; var _ = z ? '" : ""; for (var S = 0; S < 7; S++) { var ba = F ? F.apply(a.input ? a.input[0] : null, [Y]) : [!0, ""], bb = Y.getMonth() != n, bc = bb && !H || !ba[0] || l && Y < l || m && Y > m; _ += '", Y.setDate(Y.getDate() + 1), Y = this._daylightSavingAdjust(Y) } Q += _ + "" } n++, n > 11 && (n = 0, o++), Q += "
    ' + this._get(a, "weekHeader") + "
    ' + this._get(a, "calculateWeek")(Y) + "" + (bb && !G ? " " : bc ? '' + Y.getDate() + "" : '' + Y.getDate() + "") + "
    " + (j ? "" + (g[0] > 0 && N == g[1] - 1 ? '
    ' : "") : ""), M += Q } K += M } return K += x + ($.browser.msie && parseInt($.browser.version, 10) < 7 && !a.inline ? '' : ""), a._keyEvent = !1, K }, _generateMonthYearHeader: function (a, b, c, d, e, f, g, h) { var i = this._get(a, "changeMonth"), j = this._get(a, "changeYear"), k = this._get(a, "showMonthAfterYear"), l = '
    ', m = ""; if (f || !i) m += '' + g[b] + ""; else { var n = d && d.getFullYear() == c, o = e && e.getFullYear() == c; m += '" } k || (l += m + (f || !i || !j ? " " : "")); if (!a.yearshtml) { a.yearshtml = ""; if (f || !j) l += '' + c + ""; else { var q = this._get(a, "yearRange").split(":"), r = (new Date).getFullYear(), s = function (a) { var b = a.match(/c[+-].*/) ? c + parseInt(a.substring(1), 10) : a.match(/[+-].*/) ? r + parseInt(a, 10) : parseInt(a, 10); return isNaN(b) ? r : b }, t = s(q[0]), u = Math.max(t, s(q[1] || "")); t = d ? Math.max(t, d.getFullYear()) : t, u = e ? Math.min(u, e.getFullYear()) : u, a.yearshtml += '", l += a.yearshtml, a.yearshtml = null } } return l += this._get(a, "yearSuffix"), k && (l += (f || !i || !j ? " " : "") + m), l += "
    ", l }, _adjustInstDate: function (a, b, c) { var d = a.drawYear + (c == "Y" ? b : 0), e = a.drawMonth + (c == "M" ? b : 0), f = Math.min(a.selectedDay, this._getDaysInMonth(d, e)) + (c == "D" ? b : 0), g = this._restrictMinMax(a, this._daylightSavingAdjust(new Date(d, e, f))); a.selectedDay = g.getDate(), a.drawMonth = a.selectedMonth = g.getMonth(), a.drawYear = a.selectedYear = g.getFullYear(), (c == "M" || c == "Y") && this._notifyChange(a) }, _restrictMinMax: function (a, b) { var c = this._getMinMaxDate(a, "min"), d = this._getMinMaxDate(a, "max"), e = c && b < c ? c : b; return e = d && e > d ? d : e, e }, _notifyChange: function (a) { var b = this._get(a, "onChangeMonthYear"); b && b.apply(a.input ? a.input[0] : null, [a.selectedYear, a.selectedMonth + 1, a]) }, _getNumberOfMonths: function (a) { var b = this._get(a, "numberOfMonths"); return b == null ? [1, 1] : typeof b == "number" ? [1, b] : b }, _getMinMaxDate: function (a, b) { return this._determineDate(a, this._get(a, b + "Date"), null) }, _getDaysInMonth: function (a, b) { return 32 - this._daylightSavingAdjust(new Date(a, b, 32)).getDate() }, _getFirstDayOfMonth: function (a, b) { return (new Date(a, b, 1)).getDay() }, _canAdjustMonth: function (a, b, c, d) { var e = this._getNumberOfMonths(a), f = this._daylightSavingAdjust(new Date(c, d + (b < 0 ? b : e[0] * e[1]), 1)); return b < 0 && f.setDate(this._getDaysInMonth(f.getFullYear(), f.getMonth())), this._isInRange(a, f) }, _isInRange: function (a, b) { var c = this._getMinMaxDate(a, "min"), d = this._getMinMaxDate(a, "max"); return (!c || b.getTime() >= c.getTime()) && (!d || b.getTime() <= d.getTime()) }, _getFormatConfig: function (a) { var b = this._get(a, "shortYearCutoff"); return b = typeof b != "string" ? b : (new Date).getFullYear() % 100 + parseInt(b, 10), { shortYearCutoff: b, dayNamesShort: this._get(a, "dayNamesShort"), dayNames: this._get(a, "dayNames"), monthNamesShort: this._get(a, "monthNamesShort"), monthNames: this._get(a, "monthNames")} }, _formatDate: function (a, b, c, d) { b || (a.currentDay = a.selectedDay, a.currentMonth = a.selectedMonth, a.currentYear = a.selectedYear); var e = b ? typeof b == "object" ? b : this._daylightSavingAdjust(new Date(d, c, b)) : this._daylightSavingAdjust(new Date(a.currentYear, a.currentMonth, a.currentDay)); return this.formatDate(this._get(a, "dateFormat"), e, this._getFormatConfig(a)) } }), $.fn.datepicker = function (a) { if (!this.length) return this; $.datepicker.initialized || ($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv), $.datepicker.initialized = !0); var b = Array.prototype.slice.call(arguments, 1); return typeof a != "string" || a != "isDisabled" && a != "getDate" && a != "widget" ? a == "option" && arguments.length == 2 && typeof arguments[1] == "string" ? $.datepicker["_" + a + "Datepicker"].apply($.datepicker, [this[0]].concat(b)) : this.each(function () { typeof a == "string" ? $.datepicker["_" + a + "Datepicker"].apply($.datepicker, [this].concat(b)) : $.datepicker._attachDatepicker(this, a) }) : $.datepicker["_" + a + "Datepicker"].apply($.datepicker, [this[0]].concat(b)) }, $.datepicker = new Datepicker, $.datepicker.initialized = !1, $.datepicker.uuid = (new Date).getTime(), $.datepicker.version = "1.8.24", window["DP_jQuery_" + dpuuid] = $ })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.progressbar.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.widget("ui.progressbar", { options: { value: 0, max: 100 }, min: 0, _create: function () { this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({ role: "progressbar", "aria-valuemin": this.min, "aria-valuemax": this.options.max, "aria-valuenow": this._value() }), this.valueDiv = a("
    ").appendTo(this.element), this.oldValue = this._value(), this._refreshValue() }, destroy: function () { this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"), this.valueDiv.remove(), a.Widget.prototype.destroy.apply(this, arguments) }, value: function (a) { return a === b ? this._value() : (this._setOption("value", a), this) }, _setOption: function (b, c) { b === "value" && (this.options.value = c, this._refreshValue(), this._value() === this.options.max && this._trigger("complete")), a.Widget.prototype._setOption.apply(this, arguments) }, _value: function () { var a = this.options.value; return typeof a != "number" && (a = 0), Math.min(this.options.max, Math.max(this.min, a)) }, _percentage: function () { return 100 * this._value() / this.options.max }, _refreshValue: function () { var a = this.value(), b = this._percentage(); this.oldValue !== a && (this.oldValue = a, this._trigger("change")), this.valueDiv.toggle(a > this.min).toggleClass("ui-corner-right", a === this.options.max).width(b.toFixed(0) + "%"), this.element.attr("aria-valuenow", a) } }), a.extend(a.ui.progressbar, { version: "1.8.24" }) })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +jQuery.effects || function (a, b) { function c(b) { var c; return b && b.constructor == Array && b.length == 3 ? b : (c = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b)) ? [parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10)] : (c = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b)) ? [parseFloat(c[1]) * 2.55, parseFloat(c[2]) * 2.55, parseFloat(c[3]) * 2.55] : (c = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b)) ? [parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16)] : (c = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b)) ? [parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16)] : (c = /rgba\(0, 0, 0, 0\)/.exec(b)) ? e.transparent : e[a.trim(b).toLowerCase()] } function d(b, d) { var e; do { e = (a.curCSS || a.css)(b, d); if (e != "" && e != "transparent" || a.nodeName(b, "body")) break; d = "backgroundColor" } while (b = b.parentNode); return c(e) } function h() { var a = document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle, b = {}, c, d; if (a && a.length && a[0] && a[a[0]]) { var e = a.length; while (e--) c = a[e], typeof a[c] == "string" && (d = c.replace(/\-(\w)/g, function (a, b) { return b.toUpperCase() }), b[d] = a[c]) } else for (c in a) typeof a[c] == "string" && (b[c] = a[c]); return b } function i(b) { var c, d; for (c in b) d = b[c], (d == null || a.isFunction(d) || c in g || /scrollbar/.test(c) || !/color/i.test(c) && isNaN(parseFloat(d))) && delete b[c]; return b } function j(a, b) { var c = { _: 0 }, d; for (d in b) a[d] != b[d] && (c[d] = b[d]); return c } function k(b, c, d, e) { typeof b == "object" && (e = c, d = null, c = b, b = c.effect), a.isFunction(c) && (e = c, d = null, c = {}); if (typeof c == "number" || a.fx.speeds[c]) e = d, d = c, c = {}; return a.isFunction(d) && (e = d, d = null), c = c || {}, d = d || c.duration, d = a.fx.off ? 0 : typeof d == "number" ? d : d in a.fx.speeds ? a.fx.speeds[d] : a.fx.speeds._default, e = e || c.complete, [b, c, d, e] } function l(b) { return !b || typeof b == "number" || a.fx.speeds[b] ? !0 : typeof b == "string" && !a.effects[b] ? !0 : !1 } a.effects = {}, a.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderColor", "color", "outlineColor"], function (b, e) { a.fx.step[e] = function (a) { a.colorInit || (a.start = d(a.elem, e), a.end = c(a.end), a.colorInit = !0), a.elem.style[e] = "rgb(" + Math.max(Math.min(parseInt(a.pos * (a.end[0] - a.start[0]) + a.start[0], 10), 255), 0) + "," + Math.max(Math.min(parseInt(a.pos * (a.end[1] - a.start[1]) + a.start[1], 10), 255), 0) + "," + Math.max(Math.min(parseInt(a.pos * (a.end[2] - a.start[2]) + a.start[2], 10), 255), 0) + ")" } }); var e = { aqua: [0, 255, 255], azure: [240, 255, 255], beige: [245, 245, 220], black: [0, 0, 0], blue: [0, 0, 255], brown: [165, 42, 42], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkviolet: [148, 0, 211], fuchsia: [255, 0, 255], gold: [255, 215, 0], green: [0, 128, 0], indigo: [75, 0, 130], khaki: [240, 230, 140], lightblue: [173, 216, 230], lightcyan: [224, 255, 255], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightyellow: [255, 255, 224], lime: [0, 255, 0], magenta: [255, 0, 255], maroon: [128, 0, 0], navy: [0, 0, 128], olive: [128, 128, 0], orange: [255, 165, 0], pink: [255, 192, 203], purple: [128, 0, 128], violet: [128, 0, 128], red: [255, 0, 0], silver: [192, 192, 192], white: [255, 255, 255], yellow: [255, 255, 0], transparent: [255, 255, 255] }, f = ["add", "remove", "toggle"], g = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; a.effects.animateClass = function (b, c, d, e) { return a.isFunction(d) && (e = d, d = null), this.queue(function () { var g = a(this), k = g.attr("style") || " ", l = i(h.call(this)), m, n = g.attr("class") || ""; a.each(f, function (a, c) { b[c] && g[c + "Class"](b[c]) }), m = i(h.call(this)), g.attr("class", n), g.animate(j(l, m), { queue: !1, duration: c, easing: d, complete: function () { a.each(f, function (a, c) { b[c] && g[c + "Class"](b[c]) }), typeof g.attr("style") == "object" ? (g.attr("style").cssText = "", g.attr("style").cssText = k) : g.attr("style", k), e && e.apply(this, arguments), a.dequeue(this) } }) }) }, a.fn.extend({ _addClass: a.fn.addClass, addClass: function (b, c, d, e) { return c ? a.effects.animateClass.apply(this, [{ add: b }, c, d, e]) : this._addClass(b) }, _removeClass: a.fn.removeClass, removeClass: function (b, c, d, e) { return c ? a.effects.animateClass.apply(this, [{ remove: b }, c, d, e]) : this._removeClass(b) }, _toggleClass: a.fn.toggleClass, toggleClass: function (c, d, e, f, g) { return typeof d == "boolean" || d === b ? e ? a.effects.animateClass.apply(this, [d ? { add: c} : { remove: c }, e, f, g]) : this._toggleClass(c, d) : a.effects.animateClass.apply(this, [{ toggle: c }, d, e, f]) }, switchClass: function (b, c, d, e, f) { return a.effects.animateClass.apply(this, [{ add: c, remove: b }, d, e, f]) } }), a.extend(a.effects, { version: "1.8.24", save: function (a, b) { for (var c = 0; c < b.length; c++) b[c] !== null && a.data("ec.storage." + b[c], a[0].style[b[c]]) }, restore: function (a, b) { for (var c = 0; c < b.length; c++) b[c] !== null && a.css(b[c], a.data("ec.storage." + b[c])) }, setMode: function (a, b) { return b == "toggle" && (b = a.is(":hidden") ? "show" : "hide"), b }, getBaseline: function (a, b) { var c, d; switch (a[0]) { case "top": c = 0; break; case "middle": c = .5; break; case "bottom": c = 1; break; default: c = a[0] / b.height } switch (a[1]) { case "left": d = 0; break; case "center": d = .5; break; case "right": d = 1; break; default: d = a[1] / b.width } return { x: d, y: c} }, createWrapper: function (b) { if (b.parent().is(".ui-effects-wrapper")) return b.parent(); var c = { width: b.outerWidth(!0), height: b.outerHeight(!0), "float": b.css("float") }, d = a("
    ").addClass("ui-effects-wrapper").css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), e = document.activeElement; try { e.id } catch (f) { e = document.body } return b.wrap(d), (b[0] === e || a.contains(b[0], e)) && a(e).focus(), d = b.parent(), b.css("position") == "static" ? (d.css({ position: "relative" }), b.css({ position: "relative" })) : (a.extend(c, { position: b.css("position"), zIndex: b.css("z-index") }), a.each(["top", "left", "bottom", "right"], function (a, d) { c[d] = b.css(d), isNaN(parseInt(c[d], 10)) && (c[d] = "auto") }), b.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" })), d.css(c).show() }, removeWrapper: function (b) { var c, d = document.activeElement; return b.parent().is(".ui-effects-wrapper") ? (c = b.parent().replaceWith(b), (b[0] === d || a.contains(b[0], d)) && a(d).focus(), c) : b }, setTransition: function (b, c, d, e) { return e = e || {}, a.each(c, function (a, c) { var f = b.cssUnit(c); f[0] > 0 && (e[c] = f[0] * d + f[1]) }), e } }), a.fn.extend({ effect: function (b, c, d, e) { var f = k.apply(this, arguments), g = { options: f[1], duration: f[2], callback: f[3] }, h = g.options.mode, i = a.effects[b]; return a.fx.off || !i ? h ? this[h](g.duration, g.callback) : this.each(function () { g.callback && g.callback.call(this) }) : i.call(this, g) }, _show: a.fn.show, show: function (a) { if (l(a)) return this._show.apply(this, arguments); var b = k.apply(this, arguments); return b[1].mode = "show", this.effect.apply(this, b) }, _hide: a.fn.hide, hide: function (a) { if (l(a)) return this._hide.apply(this, arguments); var b = k.apply(this, arguments); return b[1].mode = "hide", this.effect.apply(this, b) }, __toggle: a.fn.toggle, toggle: function (b) { if (l(b) || typeof b == "boolean" || a.isFunction(b)) return this.__toggle.apply(this, arguments); var c = k.apply(this, arguments); return c[1].mode = "toggle", this.effect.apply(this, c) }, cssUnit: function (b) { var c = this.css(b), d = []; return a.each(["em", "px", "%", "pt"], function (a, b) { c.indexOf(b) > 0 && (d = [parseFloat(c), b]) }), d } }); var m = {}; a.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (a, b) { m[b] = function (b) { return Math.pow(b, a + 2) } }), a.extend(m, { Sine: function (a) { return 1 - Math.cos(a * Math.PI / 2) }, Circ: function (a) { return 1 - Math.sqrt(1 - a * a) }, Elastic: function (a) { return a === 0 || a === 1 ? a : -Math.pow(2, 8 * (a - 1)) * Math.sin(((a - 1) * 80 - 7.5) * Math.PI / 15) }, Back: function (a) { return a * a * (3 * a - 2) }, Bounce: function (a) { var b, c = 4; while (a < ((b = Math.pow(2, --c)) - 1) / 11); return 1 / Math.pow(4, 3 - c) - 7.5625 * Math.pow((b * 3 - 2) / 22 - a, 2) } }), a.each(m, function (b, c) { a.easing["easeIn" + b] = c, a.easing["easeOut" + b] = function (a) { return 1 - c(1 - a) }, a.easing["easeInOut" + b] = function (a) { return a < .5 ? c(a * 2) / 2 : c(a * -2 + 2) / -2 + 1 } }) } (jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.blind.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.blind = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right"], e = a.effects.setMode(c, b.options.mode || "hide"), f = b.options.direction || "vertical"; a.effects.save(c, d), c.show(); var g = a.effects.createWrapper(c).css({ overflow: "hidden" }), h = f == "vertical" ? "height" : "width", i = f == "vertical" ? g.height() : g.width(); e == "show" && g.css(h, 0); var j = {}; j[h] = e == "show" ? i : 0, g.animate(j, b.duration, b.options.easing, function () { e == "hide" && c.hide(), a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(c[0], arguments), c.dequeue() }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.bounce.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.bounce = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right"], e = a.effects.setMode(c, b.options.mode || "effect"), f = b.options.direction || "up", g = b.options.distance || 20, h = b.options.times || 5, i = b.duration || 250; /show|hide/.test(e) && d.push("opacity"), a.effects.save(c, d), c.show(), a.effects.createWrapper(c); var j = f == "up" || f == "down" ? "top" : "left", k = f == "up" || f == "left" ? "pos" : "neg", g = b.options.distance || (j == "top" ? c.outerHeight(!0) / 3 : c.outerWidth(!0) / 3); e == "show" && c.css("opacity", 0).css(j, k == "pos" ? -g : g), e == "hide" && (g = g / (h * 2)), e != "hide" && h--; if (e == "show") { var l = { opacity: 1 }; l[j] = (k == "pos" ? "+=" : "-=") + g, c.animate(l, i / 2, b.options.easing), g = g / 2, h-- } for (var m = 0; m < h; m++) { var n = {}, p = {}; n[j] = (k == "pos" ? "-=" : "+=") + g, p[j] = (k == "pos" ? "+=" : "-=") + g, c.animate(n, i / 2, b.options.easing).animate(p, i / 2, b.options.easing), g = e == "hide" ? g * 2 : g / 2 } if (e == "hide") { var l = { opacity: 0 }; l[j] = (k == "pos" ? "-=" : "+=") + g, c.animate(l, i / 2, b.options.easing, function () { c.hide(), a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(this, arguments) }) } else { var n = {}, p = {}; n[j] = (k == "pos" ? "-=" : "+=") + g, p[j] = (k == "pos" ? "+=" : "-=") + g, c.animate(n, i / 2, b.options.easing).animate(p, i / 2, b.options.easing, function () { a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(this, arguments) }) } c.queue("fx", function () { c.dequeue() }), c.dequeue() }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.clip.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.clip = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right", "height", "width"], e = a.effects.setMode(c, b.options.mode || "hide"), f = b.options.direction || "vertical"; a.effects.save(c, d), c.show(); var g = a.effects.createWrapper(c).css({ overflow: "hidden" }), h = c[0].tagName == "IMG" ? g : c, i = { size: f == "vertical" ? "height" : "width", position: f == "vertical" ? "top" : "left" }, j = f == "vertical" ? h.height() : h.width(); e == "show" && (h.css(i.size, 0), h.css(i.position, j / 2)); var k = {}; k[i.size] = e == "show" ? j : 0, k[i.position] = e == "show" ? 0 : j / 2, h.animate(k, { queue: !1, duration: b.duration, easing: b.options.easing, complete: function () { e == "hide" && c.hide(), a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(c[0], arguments), c.dequeue() } }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.drop.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.drop = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right", "opacity"], e = a.effects.setMode(c, b.options.mode || "hide"), f = b.options.direction || "left"; a.effects.save(c, d), c.show(), a.effects.createWrapper(c); var g = f == "up" || f == "down" ? "top" : "left", h = f == "up" || f == "left" ? "pos" : "neg", i = b.options.distance || (g == "top" ? c.outerHeight(!0) / 2 : c.outerWidth(!0) / 2); e == "show" && c.css("opacity", 0).css(g, h == "pos" ? -i : i); var j = { opacity: e == "show" ? 1 : 0 }; j[g] = (e == "show" ? h == "pos" ? "+=" : "-=" : h == "pos" ? "-=" : "+=") + i, c.animate(j, { queue: !1, duration: b.duration, easing: b.options.easing, complete: function () { e == "hide" && c.hide(), a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(this, arguments), c.dequeue() } }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.explode.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.explode = function (b) { return this.queue(function () { var c = b.options.pieces ? Math.round(Math.sqrt(b.options.pieces)) : 3, d = b.options.pieces ? Math.round(Math.sqrt(b.options.pieces)) : 3; b.options.mode = b.options.mode == "toggle" ? a(this).is(":visible") ? "hide" : "show" : b.options.mode; var e = a(this).show().css("visibility", "hidden"), f = e.offset(); f.top -= parseInt(e.css("marginTop"), 10) || 0, f.left -= parseInt(e.css("marginLeft"), 10) || 0; var g = e.outerWidth(!0), h = e.outerHeight(!0); for (var i = 0; i < c; i++) for (var j = 0; j < d; j++) e.clone().appendTo("body").wrap("
    ").css({ position: "absolute", visibility: "visible", left: -j * (g / d), top: -i * (h / c) }).parent().addClass("ui-effects-explode").css({ position: "absolute", overflow: "hidden", width: g / d, height: h / c, left: f.left + j * (g / d) + (b.options.mode == "show" ? (j - Math.floor(d / 2)) * (g / d) : 0), top: f.top + i * (h / c) + (b.options.mode == "show" ? (i - Math.floor(c / 2)) * (h / c) : 0), opacity: b.options.mode == "show" ? 0 : 1 }).animate({ left: f.left + j * (g / d) + (b.options.mode == "show" ? 0 : (j - Math.floor(d / 2)) * (g / d)), top: f.top + i * (h / c) + (b.options.mode == "show" ? 0 : (i - Math.floor(c / 2)) * (h / c)), opacity: b.options.mode == "show" ? 1 : 0 }, b.duration || 500); setTimeout(function () { b.options.mode == "show" ? e.css({ visibility: "visible" }) : e.css({ visibility: "visible" }).hide(), b.callback && b.callback.apply(e[0]), e.dequeue(), a("div.ui-effects-explode").remove() }, b.duration || 500) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fade.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.fade = function (b) { return this.queue(function () { var c = a(this), d = a.effects.setMode(c, b.options.mode || "hide"); c.animate({ opacity: d }, { queue: !1, duration: b.duration, easing: b.options.easing, complete: function () { b.callback && b.callback.apply(this, arguments), c.dequeue() } }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fold.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.fold = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right"], e = a.effects.setMode(c, b.options.mode || "hide"), f = b.options.size || 15, g = !!b.options.horizFirst, h = b.duration ? b.duration / 2 : a.fx.speeds._default / 2; a.effects.save(c, d), c.show(); var i = a.effects.createWrapper(c).css({ overflow: "hidden" }), j = e == "show" != g, k = j ? ["width", "height"] : ["height", "width"], l = j ? [i.width(), i.height()] : [i.height(), i.width()], m = /([0-9]+)%/.exec(f); m && (f = parseInt(m[1], 10) / 100 * l[e == "hide" ? 0 : 1]), e == "show" && i.css(g ? { height: 0, width: f} : { height: f, width: 0 }); var n = {}, p = {}; n[k[0]] = e == "show" ? l[0] : f, p[k[1]] = e == "show" ? l[1] : 0, i.animate(n, h, b.options.easing).animate(p, h, b.options.easing, function () { e == "hide" && c.hide(), a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(c[0], arguments), c.dequeue() }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.highlight.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.highlight = function (b) { return this.queue(function () { var c = a(this), d = ["backgroundImage", "backgroundColor", "opacity"], e = a.effects.setMode(c, b.options.mode || "show"), f = { backgroundColor: c.css("backgroundColor") }; e == "hide" && (f.opacity = 0), a.effects.save(c, d), c.show().css({ backgroundImage: "none", backgroundColor: b.options.color || "#ffff99" }).animate(f, { queue: !1, duration: b.duration, easing: b.options.easing, complete: function () { e == "hide" && c.hide(), a.effects.restore(c, d), e == "show" && !a.support.opacity && this.style.removeAttribute("filter"), b.callback && b.callback.apply(this, arguments), c.dequeue() } }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.pulsate.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.pulsate = function (b) { return this.queue(function () { var c = a(this), d = a.effects.setMode(c, b.options.mode || "show"), e = (b.options.times || 5) * 2 - 1, f = b.duration ? b.duration / 2 : a.fx.speeds._default / 2, g = c.is(":visible"), h = 0; g || (c.css("opacity", 0).show(), h = 1), (d == "hide" && g || d == "show" && !g) && e--; for (var i = 0; i < e; i++) c.animate({ opacity: h }, f, b.options.easing), h = (h + 1) % 2; c.animate({ opacity: h }, f, b.options.easing, function () { h == 0 && c.hide(), b.callback && b.callback.apply(this, arguments) }), c.queue("fx", function () { c.dequeue() }).dequeue() }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.scale.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.puff = function (b) { return this.queue(function () { var c = a(this), d = a.effects.setMode(c, b.options.mode || "hide"), e = parseInt(b.options.percent, 10) || 150, f = e / 100, g = { height: c.height(), width: c.width() }; a.extend(b.options, { fade: !0, mode: d, percent: d == "hide" ? e : 100, from: d == "hide" ? g : { height: g.height * f, width: g.width * f} }), c.effect("scale", b.options, b.duration, b.callback), c.dequeue() }) }, a.effects.scale = function (b) { return this.queue(function () { var c = a(this), d = a.extend(!0, {}, b.options), e = a.effects.setMode(c, b.options.mode || "effect"), f = parseInt(b.options.percent, 10) || (parseInt(b.options.percent, 10) == 0 ? 0 : e == "hide" ? 0 : 100), g = b.options.direction || "both", h = b.options.origin; e != "effect" && (d.origin = h || ["middle", "center"], d.restore = !0); var i = { height: c.height(), width: c.width() }; c.from = b.options.from || (e == "show" ? { height: 0, width: 0} : i); var j = { y: g != "horizontal" ? f / 100 : 1, x: g != "vertical" ? f / 100 : 1 }; c.to = { height: i.height * j.y, width: i.width * j.x }, b.options.fade && (e == "show" && (c.from.opacity = 0, c.to.opacity = 1), e == "hide" && (c.from.opacity = 1, c.to.opacity = 0)), d.from = c.from, d.to = c.to, d.mode = e, c.effect("size", d, b.duration, b.callback), c.dequeue() }) }, a.effects.size = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"], e = ["position", "top", "bottom", "left", "right", "overflow", "opacity"], f = ["width", "height", "overflow"], g = ["fontSize"], h = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], i = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"], j = a.effects.setMode(c, b.options.mode || "effect"), k = b.options.restore || !1, l = b.options.scale || "both", m = b.options.origin, n = { height: c.height(), width: c.width() }; c.from = b.options.from || n, c.to = b.options.to || n; if (m) { var p = a.effects.getBaseline(m, n); c.from.top = (n.height - c.from.height) * p.y, c.from.left = (n.width - c.from.width) * p.x, c.to.top = (n.height - c.to.height) * p.y, c.to.left = (n.width - c.to.width) * p.x } var q = { from: { y: c.from.height / n.height, x: c.from.width / n.width }, to: { y: c.to.height / n.height, x: c.to.width / n.width} }; if (l == "box" || l == "both") q.from.y != q.to.y && (d = d.concat(h), c.from = a.effects.setTransition(c, h, q.from.y, c.from), c.to = a.effects.setTransition(c, h, q.to.y, c.to)), q.from.x != q.to.x && (d = d.concat(i), c.from = a.effects.setTransition(c, i, q.from.x, c.from), c.to = a.effects.setTransition(c, i, q.to.x, c.to)); (l == "content" || l == "both") && q.from.y != q.to.y && (d = d.concat(g), c.from = a.effects.setTransition(c, g, q.from.y, c.from), c.to = a.effects.setTransition(c, g, q.to.y, c.to)), a.effects.save(c, k ? d : e), c.show(), a.effects.createWrapper(c), c.css("overflow", "hidden").css(c.from); if (l == "content" || l == "both") h = h.concat(["marginTop", "marginBottom"]).concat(g), i = i.concat(["marginLeft", "marginRight"]), f = d.concat(h).concat(i), c.find("*[width]").each(function () { var c = a(this); k && a.effects.save(c, f); var d = { height: c.height(), width: c.width() }; c.from = { height: d.height * q.from.y, width: d.width * q.from.x }, c.to = { height: d.height * q.to.y, width: d.width * q.to.x }, q.from.y != q.to.y && (c.from = a.effects.setTransition(c, h, q.from.y, c.from), c.to = a.effects.setTransition(c, h, q.to.y, c.to)), q.from.x != q.to.x && (c.from = a.effects.setTransition(c, i, q.from.x, c.from), c.to = a.effects.setTransition(c, i, q.to.x, c.to)), c.css(c.from), c.animate(c.to, b.duration, b.options.easing, function () { k && a.effects.restore(c, f) }) }); c.animate(c.to, { queue: !1, duration: b.duration, easing: b.options.easing, complete: function () { c.to.opacity === 0 && c.css("opacity", c.from.opacity), j == "hide" && c.hide(), a.effects.restore(c, k ? d : e), a.effects.removeWrapper(c), b.callback && b.callback.apply(this, arguments), c.dequeue() } }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.shake.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.shake = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right"], e = a.effects.setMode(c, b.options.mode || "effect"), f = b.options.direction || "left", g = b.options.distance || 20, h = b.options.times || 3, i = b.duration || b.options.duration || 140; a.effects.save(c, d), c.show(), a.effects.createWrapper(c); var j = f == "up" || f == "down" ? "top" : "left", k = f == "up" || f == "left" ? "pos" : "neg", l = {}, m = {}, n = {}; l[j] = (k == "pos" ? "-=" : "+=") + g, m[j] = (k == "pos" ? "+=" : "-=") + g * 2, n[j] = (k == "pos" ? "-=" : "+=") + g * 2, c.animate(l, i, b.options.easing); for (var p = 1; p < h; p++) c.animate(m, i, b.options.easing).animate(n, i, b.options.easing); c.animate(m, i, b.options.easing).animate(l, i / 2, b.options.easing, function () { a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(this, arguments) }), c.queue("fx", function () { c.dequeue() }), c.dequeue() }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.slide.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.slide = function (b) { return this.queue(function () { var c = a(this), d = ["position", "top", "bottom", "left", "right"], e = a.effects.setMode(c, b.options.mode || "show"), f = b.options.direction || "left"; a.effects.save(c, d), c.show(), a.effects.createWrapper(c).css({ overflow: "hidden" }); var g = f == "up" || f == "down" ? "top" : "left", h = f == "up" || f == "left" ? "pos" : "neg", i = b.options.distance || (g == "top" ? c.outerHeight(!0) : c.outerWidth(!0)); e == "show" && c.css(g, h == "pos" ? isNaN(i) ? "-" + i : -i : i); var j = {}; j[g] = (e == "show" ? h == "pos" ? "+=" : "-=" : h == "pos" ? "-=" : "+=") + i, c.animate(j, { queue: !1, duration: b.duration, easing: b.options.easing, complete: function () { e == "hide" && c.hide(), a.effects.restore(c, d), a.effects.removeWrapper(c), b.callback && b.callback.apply(this, arguments), c.dequeue() } }) }) } })(jQuery); ; /*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.transfer.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function (a, b) { a.effects.transfer = function (b) { return this.queue(function () { var c = a(this), d = a(b.options.to), e = d.offset(), f = { top: e.top, left: e.left, height: d.innerHeight(), width: d.innerWidth() }, g = c.offset(), h = a('
    ').appendTo(document.body).addClass(b.options.className).css({ top: g.top, left: g.left, height: c.innerHeight(), width: c.innerWidth(), position: "absolute" }).animate(f, b.duration, b.options.easing, function () { h.remove(), b.callback && b.callback.apply(c[0], arguments), c.dequeue() }) }) } })(jQuery); ; \ No newline at end of file diff --git a/jquery.min.js b/jquery.min.js new file mode 100644 index 0000000..a1576f7 --- /dev/null +++ b/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v1.8.2 jquery.com | jquery.org/license */ +(function (a, b) { function G(a) { var b = F[a] = {}; return p.each(a.split(s), function (a, c) { b[c] = !0 }), b } function J(a, c, d) { if (d === b && a.nodeType === 1) { var e = "data-" + c.replace(I, "-$1").toLowerCase(); d = a.getAttribute(e); if (typeof d == "string") { try { d = d === "true" ? !0 : d === "false" ? !1 : d === "null" ? null : +d + "" === d ? +d : H.test(d) ? p.parseJSON(d) : d } catch (f) { } p.data(a, c, d) } else d = b } return d } function K(a) { var b; for (b in a) { if (b === "data" && p.isEmptyObject(a[b])) continue; if (b !== "toJSON") return !1 } return !0 } function ba() { return !1 } function bb() { return !0 } function bh(a) { return !a || !a.parentNode || a.parentNode.nodeType === 11 } function bi(a, b) { do a = a[b]; while (a && a.nodeType !== 1); return a } function bj(a, b, c) { b = b || 0; if (p.isFunction(b)) return p.grep(a, function (a, d) { var e = !!b.call(a, d, a); return e === c }); if (b.nodeType) return p.grep(a, function (a, d) { return a === b === c }); if (typeof b == "string") { var d = p.grep(a, function (a) { return a.nodeType === 1 }); if (be.test(b)) return p.filter(b, d, !c); b = p.filter(b, d) } return p.grep(a, function (a, d) { return p.inArray(a, b) >= 0 === c }) } function bk(a) { var b = bl.split("|"), c = a.createDocumentFragment(); if (c.createElement) while (b.length) c.createElement(b.pop()); return c } function bC(a, b) { return a.getElementsByTagName(b)[0] || a.appendChild(a.ownerDocument.createElement(b)) } function bD(a, b) { if (b.nodeType !== 1 || !p.hasData(a)) return; var c, d, e, f = p._data(a), g = p._data(b, f), h = f.events; if (h) { delete g.handle, g.events = {}; for (c in h) for (d = 0, e = h[c].length; d < e; d++) p.event.add(b, c, h[c][d]) } g.data && (g.data = p.extend({}, g.data)) } function bE(a, b) { var c; if (b.nodeType !== 1) return; b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase(), c === "object" ? (b.parentNode && (b.outerHTML = a.outerHTML), p.support.html5Clone && a.innerHTML && !p.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : c === "input" && bv.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : c === "option" ? b.selected = a.defaultSelected : c === "input" || c === "textarea" ? b.defaultValue = a.defaultValue : c === "script" && b.text !== a.text && (b.text = a.text), b.removeAttribute(p.expando) } function bF(a) { return typeof a.getElementsByTagName != "undefined" ? a.getElementsByTagName("*") : typeof a.querySelectorAll != "undefined" ? a.querySelectorAll("*") : [] } function bG(a) { bv.test(a.type) && (a.defaultChecked = a.checked) } function bY(a, b) { if (b in a) return b; var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = bW.length; while (e--) { b = bW[e] + c; if (b in a) return b } return d } function bZ(a, b) { return a = b || a, p.css(a, "display") === "none" || !p.contains(a.ownerDocument, a) } function b$(a, b) { var c, d, e = [], f = 0, g = a.length; for (; f < g; f++) { c = a[f]; if (!c.style) continue; e[f] = p._data(c, "olddisplay"), b ? (!e[f] && c.style.display === "none" && (c.style.display = ""), c.style.display === "" && bZ(c) && (e[f] = p._data(c, "olddisplay", cc(c.nodeName)))) : (d = bH(c, "display"), !e[f] && d !== "none" && p._data(c, "olddisplay", d)) } for (f = 0; f < g; f++) { c = a[f]; if (!c.style) continue; if (!b || c.style.display === "none" || c.style.display === "") c.style.display = b ? e[f] || "" : "none" } return a } function b_(a, b, c) { var d = bP.exec(b); return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b } function ca(a, b, c, d) { var e = c === (d ? "border" : "content") ? 4 : b === "width" ? 1 : 0, f = 0; for (; e < 4; e += 2) c === "margin" && (f += p.css(a, c + bV[e], !0)), d ? (c === "content" && (f -= parseFloat(bH(a, "padding" + bV[e])) || 0), c !== "margin" && (f -= parseFloat(bH(a, "border" + bV[e] + "Width")) || 0)) : (f += parseFloat(bH(a, "padding" + bV[e])) || 0, c !== "padding" && (f += parseFloat(bH(a, "border" + bV[e] + "Width")) || 0)); return f } function cb(a, b, c) { var d = b === "width" ? a.offsetWidth : a.offsetHeight, e = !0, f = p.support.boxSizing && p.css(a, "boxSizing") === "border-box"; if (d <= 0 || d == null) { d = bH(a, b); if (d < 0 || d == null) d = a.style[b]; if (bQ.test(d)) return d; e = f && (p.support.boxSizingReliable || d === a.style[b]), d = parseFloat(d) || 0 } return d + ca(a, b, c || (f ? "border" : "content"), e) + "px" } function cc(a) { if (bS[a]) return bS[a]; var b = p("<" + a + ">").appendTo(e.body), c = b.css("display"); b.remove(); if (c === "none" || c === "") { bI = e.body.appendChild(bI || p.extend(e.createElement("iframe"), { frameBorder: 0, width: 0, height: 0 })); if (!bJ || !bI.createElement) bJ = (bI.contentWindow || bI.contentDocument).document, bJ.write(""), bJ.close(); b = bJ.body.appendChild(bJ.createElement(a)), c = bH(b, "display"), e.body.removeChild(bI) } return bS[a] = c, c } function ci(a, b, c, d) { var e; if (p.isArray(b)) p.each(b, function (b, e) { c || ce.test(a) ? d(a, e) : ci(a + "[" + (typeof e == "object" ? b : "") + "]", e, c, d) }); else if (!c && p.type(b) === "object") for (e in b) ci(a + "[" + e + "]", b[e], c, d); else d(a, b) } function cz(a) { return function (b, c) { typeof b != "string" && (c = b, b = "*"); var d, e, f, g = b.toLowerCase().split(s), h = 0, i = g.length; if (p.isFunction(c)) for (; h < i; h++) d = g[h], f = /^\+/.test(d), f && (d = d.substr(1) || "*"), e = a[d] = a[d] || [], e[f ? "unshift" : "push"](c) } } function cA(a, c, d, e, f, g) { f = f || c.dataTypes[0], g = g || {}, g[f] = !0; var h, i = a[f], j = 0, k = i ? i.length : 0, l = a === cv; for (; j < k && (l || !h); j++) h = i[j](c, d, e), typeof h == "string" && (!l || g[h] ? h = b : (c.dataTypes.unshift(h), h = cA(a, c, d, e, h, g))); return (l || !h) && !g["*"] && (h = cA(a, c, d, e, "*", g)), h } function cB(a, c) { var d, e, f = p.ajaxSettings.flatOptions || {}; for (d in c) c[d] !== b && ((f[d] ? a : e || (e = {}))[d] = c[d]); e && p.extend(!0, a, e) } function cC(a, c, d) { var e, f, g, h, i = a.contents, j = a.dataTypes, k = a.responseFields; for (f in k) f in d && (c[k[f]] = d[f]); while (j[0] === "*") j.shift(), e === b && (e = a.mimeType || c.getResponseHeader("content-type")); if (e) for (f in i) if (i[f] && i[f].test(e)) { j.unshift(f); break } if (j[0] in d) g = j[0]; else { for (f in d) { if (!j[0] || a.converters[f + " " + j[0]]) { g = f; break } h || (h = f) } g = g || h } if (g) return g !== j[0] && j.unshift(g), d[g] } function cD(a, b) { var c, d, e, f, g = a.dataTypes.slice(), h = g[0], i = {}, j = 0; a.dataFilter && (b = a.dataFilter(b, a.dataType)); if (g[1]) for (c in a.converters) i[c.toLowerCase()] = a.converters[c]; for (; e = g[++j]; ) if (e !== "*") { if (h !== "*" && h !== e) { c = i[h + " " + e] || i["* " + e]; if (!c) for (d in i) { f = d.split(" "); if (f[1] === e) { c = i[h + " " + f[0]] || i["* " + f[0]]; if (c) { c === !0 ? c = i[d] : i[d] !== !0 && (e = f[0], g.splice(j--, 0, e)); break } } } if (c !== !0) if (c && a["throws"]) b = c(b); else try { b = c(b) } catch (k) { return { state: "parsererror", error: c ? k : "No conversion from " + h + " to " + e} } } h = e } return { state: "success", data: b} } function cL() { try { return new a.XMLHttpRequest } catch (b) { } } function cM() { try { return new a.ActiveXObject("Microsoft.XMLHTTP") } catch (b) { } } function cU() { return setTimeout(function () { cN = b }, 0), cN = p.now() } function cV(a, b) { p.each(b, function (b, c) { var d = (cT[b] || []).concat(cT["*"]), e = 0, f = d.length; for (; e < f; e++) if (d[e].call(a, b, c)) return }) } function cW(a, b, c) { var d, e = 0, f = 0, g = cS.length, h = p.Deferred().always(function () { delete i.elem }), i = function () { var b = cN || cU(), c = Math.max(0, j.startTime + j.duration - b), d = 1 - (c / j.duration || 0), e = 0, f = j.tweens.length; for (; e < f; e++) j.tweens[e].run(d); return h.notifyWith(a, [j, d, c]), d < 1 && f ? c : (h.resolveWith(a, [j]), !1) }, j = h.promise({ elem: a, props: p.extend({}, b), opts: p.extend(!0, { specialEasing: {} }, c), originalProperties: b, originalOptions: c, startTime: cN || cU(), duration: c.duration, tweens: [], createTween: function (b, c, d) { var e = p.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); return j.tweens.push(e), e }, stop: function (b) { var c = 0, d = b ? j.tweens.length : 0; for (; c < d; c++) j.tweens[c].run(1); return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this } }), k = j.props; cX(k, j.opts.specialEasing); for (; e < g; e++) { d = cS[e].call(j, a, k, j.opts); if (d) return d } return cV(j, k), p.isFunction(j.opts.start) && j.opts.start.call(a, j), p.fx.timer(p.extend(i, { anim: j, queue: j.opts.queue, elem: a })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) } function cX(a, b) { var c, d, e, f, g; for (c in a) { d = p.camelCase(c), e = b[d], f = a[c], p.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = p.cssHooks[d]; if (g && "expand" in g) { f = g.expand(f), delete a[d]; for (c in f) c in a || (a[c] = f[c], b[c] = e) } else b[d] = e } } function cY(a, b, c) { var d, e, f, g, h, i, j, k, l = this, m = a.style, n = {}, o = [], q = a.nodeType && bZ(a); c.queue || (j = p._queueHooks(a, "fx"), j.unqueued == null && (j.unqueued = 0, k = j.empty.fire, j.empty.fire = function () { j.unqueued || k() }), j.unqueued++, l.always(function () { l.always(function () { j.unqueued--, p.queue(a, "fx").length || j.empty.fire() }) })), a.nodeType === 1 && ("height" in b || "width" in b) && (c.overflow = [m.overflow, m.overflowX, m.overflowY], p.css(a, "display") === "inline" && p.css(a, "float") === "none" && (!p.support.inlineBlockNeedsLayout || cc(a.nodeName) === "inline" ? m.display = "inline-block" : m.zoom = 1)), c.overflow && (m.overflow = "hidden", p.support.shrinkWrapBlocks || l.done(function () { m.overflow = c.overflow[0], m.overflowX = c.overflow[1], m.overflowY = c.overflow[2] })); for (d in b) { f = b[d]; if (cP.exec(f)) { delete b[d]; if (f === (q ? "hide" : "show")) continue; o.push(d) } } g = o.length; if (g) { h = p._data(a, "fxshow") || p._data(a, "fxshow", {}), q ? p(a).show() : l.done(function () { p(a).hide() }), l.done(function () { var b; p.removeData(a, "fxshow", !0); for (b in n) p.style(a, b, n[b]) }); for (d = 0; d < g; d++) e = o[d], i = l.createTween(e, q ? h[e] : 0), n[e] = h[e] || p.style(a, e), e in h || (h[e] = i.start, q && (i.end = i.start, i.start = e === "width" || e === "height" ? 1 : 0)) } } function cZ(a, b, c, d, e) { return new cZ.prototype.init(a, b, c, d, e) } function c$(a, b) { var c, d = { height: a }, e = 0; b = b ? 1 : 0; for (; e < 4; e += 2 - b) c = bV[e], d["margin" + c] = d["padding" + c] = a; return b && (d.opacity = d.width = a), d } function da(a) { return p.isWindow(a) ? a : a.nodeType === 9 ? a.defaultView || a.parentWindow : !1 } var c, d, e = a.document, f = a.location, g = a.navigator, h = a.jQuery, i = a.$, j = Array.prototype.push, k = Array.prototype.slice, l = Array.prototype.indexOf, m = Object.prototype.toString, n = Object.prototype.hasOwnProperty, o = String.prototype.trim, p = function (a, b) { return new p.fn.init(a, b, c) }, q = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, r = /\S/, s = /\s+/, t = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, u = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, v = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, w = /^[\],:{}\s]*$/, x = /(?:^|:|,)(?:\s*\[)+/g, y = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, z = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, A = /^-ms-/, B = /-([\da-z])/gi, C = function (a, b) { return (b + "").toUpperCase() }, D = function () { e.addEventListener ? (e.removeEventListener("DOMContentLoaded", D, !1), p.ready()) : e.readyState === "complete" && (e.detachEvent("onreadystatechange", D), p.ready()) }, E = {}; p.fn = p.prototype = { constructor: p, init: function (a, c, d) { var f, g, h, i; if (!a) return this; if (a.nodeType) return this.context = this[0] = a, this.length = 1, this; if (typeof a == "string") { a.charAt(0) === "<" && a.charAt(a.length - 1) === ">" && a.length >= 3 ? f = [null, a, null] : f = u.exec(a); if (f && (f[1] || !c)) { if (f[1]) return c = c instanceof p ? c[0] : c, i = c && c.nodeType ? c.ownerDocument || c : e, a = p.parseHTML(f[1], i, !0), v.test(f[1]) && p.isPlainObject(c) && this.attr.call(a, c, !0), p.merge(this, a); g = e.getElementById(f[2]); if (g && g.parentNode) { if (g.id !== f[2]) return d.find(a); this.length = 1, this[0] = g } return this.context = e, this.selector = a, this } return !c || c.jquery ? (c || d).find(a) : this.constructor(c).find(a) } return p.isFunction(a) ? d.ready(a) : (a.selector !== b && (this.selector = a.selector, this.context = a.context), p.makeArray(a, this)) }, selector: "", jquery: "1.8.2", length: 0, size: function () { return this.length }, toArray: function () { return k.call(this) }, get: function (a) { return a == null ? this.toArray() : a < 0 ? this[this.length + a] : this[a] }, pushStack: function (a, b, c) { var d = p.merge(this.constructor(), a); return d.prevObject = this, d.context = this.context, b === "find" ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")"), d }, each: function (a, b) { return p.each(this, a, b) }, ready: function (a) { return p.ready.promise().done(a), this }, eq: function (a) { return a = +a, a === -1 ? this.slice(a) : this.slice(a, a + 1) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, slice: function () { return this.pushStack(k.apply(this, arguments), "slice", k.call(arguments).join(",")) }, map: function (a) { return this.pushStack(p.map(this, function (b, c) { return a.call(b, c, b) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: j, sort: [].sort, splice: [].splice }, p.fn.init.prototype = p.fn, p.extend = p.fn.extend = function () { var a, c, d, e, f, g, h = arguments[0] || {}, i = 1, j = arguments.length, k = !1; typeof h == "boolean" && (k = h, h = arguments[1] || {}, i = 2), typeof h != "object" && !p.isFunction(h) && (h = {}), j === i && (h = this, --i); for (; i < j; i++) if ((a = arguments[i]) != null) for (c in a) { d = h[c], e = a[c]; if (h === e) continue; k && e && (p.isPlainObject(e) || (f = p.isArray(e))) ? (f ? (f = !1, g = d && p.isArray(d) ? d : []) : g = d && p.isPlainObject(d) ? d : {}, h[c] = p.extend(k, g, e)) : e !== b && (h[c] = e) } return h }, p.extend({ noConflict: function (b) { return a.$ === p && (a.$ = i), b && a.jQuery === p && (a.jQuery = h), p }, isReady: !1, readyWait: 1, holdReady: function (a) { a ? p.readyWait++ : p.ready(!0) }, ready: function (a) { if (a === !0 ? --p.readyWait : p.isReady) return; if (!e.body) return setTimeout(p.ready, 1); p.isReady = !0; if (a !== !0 && --p.readyWait > 0) return; d.resolveWith(e, [p]), p.fn.trigger && p(e).trigger("ready").off("ready") }, isFunction: function (a) { return p.type(a) === "function" }, isArray: Array.isArray || function (a) { return p.type(a) === "array" }, isWindow: function (a) { return a != null && a == a.window }, isNumeric: function (a) { return !isNaN(parseFloat(a)) && isFinite(a) }, type: function (a) { return a == null ? String(a) : E[m.call(a)] || "object" }, isPlainObject: function (a) { if (!a || p.type(a) !== "object" || a.nodeType || p.isWindow(a)) return !1; try { if (a.constructor && !n.call(a, "constructor") && !n.call(a.constructor.prototype, "isPrototypeOf")) return !1 } catch (c) { return !1 } var d; for (d in a); return d === b || n.call(a, d) }, isEmptyObject: function (a) { var b; for (b in a) return !1; return !0 }, error: function (a) { throw new Error(a) }, parseHTML: function (a, b, c) { var d; return !a || typeof a != "string" ? null : (typeof b == "boolean" && (c = b, b = 0), b = b || e, (d = v.exec(a)) ? [b.createElement(d[1])] : (d = p.buildFragment([a], b, c ? null : []), p.merge([], (d.cacheable ? p.clone(d.fragment) : d.fragment).childNodes))) }, parseJSON: function (b) { if (!b || typeof b != "string") return null; b = p.trim(b); if (a.JSON && a.JSON.parse) return a.JSON.parse(b); if (w.test(b.replace(y, "@").replace(z, "]").replace(x, ""))) return (new Function("return " + b))(); p.error("Invalid JSON: " + b) }, parseXML: function (c) { var d, e; if (!c || typeof c != "string") return null; try { a.DOMParser ? (e = new DOMParser, d = e.parseFromString(c, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(c)) } catch (f) { d = b } return (!d || !d.documentElement || d.getElementsByTagName("parsererror").length) && p.error("Invalid XML: " + c), d }, noop: function () { }, globalEval: function (b) { b && r.test(b) && (a.execScript || function (b) { a.eval.call(a, b) })(b) }, camelCase: function (a) { return a.replace(A, "ms-").replace(B, C) }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() }, each: function (a, c, d) { var e, f = 0, g = a.length, h = g === b || p.isFunction(a); if (d) { if (h) { for (e in a) if (c.apply(a[e], d) === !1) break } else for (; f < g; ) if (c.apply(a[f++], d) === !1) break } else if (h) { for (e in a) if (c.call(a[e], e, a[e]) === !1) break } else for (; f < g; ) if (c.call(a[f], f, a[f++]) === !1) break; return a }, trim: o && !o.call(" ") ? function (a) { return a == null ? "" : o.call(a) } : function (a) { return a == null ? "" : (a + "").replace(t, "") }, makeArray: function (a, b) { var c, d = b || []; return a != null && (c = p.type(a), a.length == null || c === "string" || c === "function" || c === "regexp" || p.isWindow(a) ? j.call(d, a) : p.merge(d, a)), d }, inArray: function (a, b, c) { var d; if (b) { if (l) return l.call(b, a, c); d = b.length, c = c ? c < 0 ? Math.max(0, d + c) : c : 0; for (; c < d; c++) if (c in b && b[c] === a) return c } return -1 }, merge: function (a, c) { var d = c.length, e = a.length, f = 0; if (typeof d == "number") for (; f < d; f++) a[e++] = c[f]; else while (c[f] !== b) a[e++] = c[f++]; return a.length = e, a }, grep: function (a, b, c) { var d, e = [], f = 0, g = a.length; c = !!c; for (; f < g; f++) d = !!b(a[f], f), c !== d && e.push(a[f]); return e }, map: function (a, c, d) { var e, f, g = [], h = 0, i = a.length, j = a instanceof p || i !== b && typeof i == "number" && (i > 0 && a[0] && a[i - 1] || i === 0 || p.isArray(a)); if (j) for (; h < i; h++) e = c(a[h], h, d), e != null && (g[g.length] = e); else for (f in a) e = c(a[f], f, d), e != null && (g[g.length] = e); return g.concat.apply([], g) }, guid: 1, proxy: function (a, c) { var d, e, f; return typeof c == "string" && (d = a[c], c = a, a = d), p.isFunction(a) ? (e = k.call(arguments, 2), f = function () { return a.apply(c, e.concat(k.call(arguments))) }, f.guid = a.guid = a.guid || p.guid++, f) : b }, access: function (a, c, d, e, f, g, h) { var i, j = d == null, k = 0, l = a.length; if (d && typeof d == "object") { for (k in d) p.access(a, c, k, d[k], 1, g, e); f = 1 } else if (e !== b) { i = h === b && p.isFunction(e), j && (i ? (i = c, c = function (a, b, c) { return i.call(p(a), c) }) : (c.call(a, e), c = null)); if (c) for (; k < l; k++) c(a[k], d, i ? e.call(a[k], k, c(a[k], d)) : e, h); f = 1 } return f ? a : j ? c.call(a) : l ? c(a[0], d) : g }, now: function () { return (new Date).getTime() } }), p.ready.promise = function (b) { if (!d) { d = p.Deferred(); if (e.readyState === "complete") setTimeout(p.ready, 1); else if (e.addEventListener) e.addEventListener("DOMContentLoaded", D, !1), a.addEventListener("load", p.ready, !1); else { e.attachEvent("onreadystatechange", D), a.attachEvent("onload", p.ready); var c = !1; try { c = a.frameElement == null && e.documentElement } catch (f) { } c && c.doScroll && function g() { if (!p.isReady) { try { c.doScroll("left") } catch (a) { return setTimeout(g, 50) } p.ready() } } () } } return d.promise(b) }, p.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (a, b) { E["[object " + b + "]"] = b.toLowerCase() }), c = p(e); var F = {}; p.Callbacks = function (a) { a = typeof a == "string" ? F[a] || G(a) : p.extend({}, a); var c, d, e, f, g, h, i = [], j = !a.once && [], k = function (b) { c = a.memory && b, d = !0, h = f || 0, f = 0, g = i.length, e = !0; for (; i && h < g; h++) if (i[h].apply(b[0], b[1]) === !1 && a.stopOnFalse) { c = !1; break } e = !1, i && (j ? j.length && k(j.shift()) : c ? i = [] : l.disable()) }, l = { add: function () { if (i) { var b = i.length; (function d(b) { p.each(b, function (b, c) { var e = p.type(c); e === "function" && (!a.unique || !l.has(c)) ? i.push(c) : c && c.length && e !== "string" && d(c) }) })(arguments), e ? g = i.length : c && (f = b, k(c)) } return this }, remove: function () { return i && p.each(arguments, function (a, b) { var c; while ((c = p.inArray(b, i, c)) > -1) i.splice(c, 1), e && (c <= g && g--, c <= h && h--) }), this }, has: function (a) { return p.inArray(a, i) > -1 }, empty: function () { return i = [], this }, disable: function () { return i = j = c = b, this }, disabled: function () { return !i }, lock: function () { return j = b, c || l.disable(), this }, locked: function () { return !j }, fireWith: function (a, b) { return b = b || [], b = [a, b.slice ? b.slice() : b], i && (!d || j) && (e ? j.push(b) : k(b)), this }, fire: function () { return l.fireWith(this, arguments), this }, fired: function () { return !!d } }; return l }, p.extend({ Deferred: function (a) { var b = [["resolve", "done", p.Callbacks("once memory"), "resolved"], ["reject", "fail", p.Callbacks("once memory"), "rejected"], ["notify", "progress", p.Callbacks("memory")]], c = "pending", d = { state: function () { return c }, always: function () { return e.done(arguments).fail(arguments), this }, then: function () { var a = arguments; return p.Deferred(function (c) { p.each(b, function (b, d) { var f = d[0], g = a[b]; e[d[1]](p.isFunction(g) ? function () { var a = g.apply(this, arguments); a && p.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f + "With"](this === e ? c : this, [a]) } : c[f]) }), a = null }).promise() }, promise: function (a) { return a != null ? p.extend(a, d) : d } }, e = {}; return d.pipe = d.then, p.each(b, function (a, f) { var g = f[2], h = f[3]; d[f[1]] = g.add, h && g.add(function () { c = h }, b[a ^ 1][2].disable, b[2][2].lock), e[f[0]] = g.fire, e[f[0] + "With"] = g.fireWith }), d.promise(e), a && a.call(e, e), e }, when: function (a) { var b = 0, c = k.call(arguments), d = c.length, e = d !== 1 || a && p.isFunction(a.promise) ? d : 0, f = e === 1 ? a : p.Deferred(), g = function (a, b, c) { return function (d) { b[a] = this, c[a] = arguments.length > 1 ? k.call(arguments) : d, c === h ? f.notifyWith(b, c) : --e || f.resolveWith(b, c) } }, h, i, j; if (d > 1) { h = new Array(d), i = new Array(d), j = new Array(d); for (; b < d; b++) c[b] && p.isFunction(c[b].promise) ? c[b].promise().done(g(b, j, c)).fail(f.reject).progress(g(b, i, h)) : --e } return e || f.resolveWith(j, c), f.promise() } }), p.support = function () { var b, c, d, f, g, h, i, j, k, l, m, n = e.createElement("div"); n.setAttribute("className", "t"), n.innerHTML = "
    a", c = n.getElementsByTagName("*"), d = n.getElementsByTagName("a")[0], d.style.cssText = "top:1px;float:left;opacity:.5"; if (!c || !c.length) return {}; f = e.createElement("select"), g = f.appendChild(e.createElement("option")), h = n.getElementsByTagName("input")[0], b = { leadingWhitespace: n.firstChild.nodeType === 3, tbody: !n.getElementsByTagName("tbody").length, htmlSerialize: !!n.getElementsByTagName("link").length, style: /top/.test(d.getAttribute("style")), hrefNormalized: d.getAttribute("href") === "/a", opacity: /^0.5/.test(d.style.opacity), cssFloat: !!d.style.cssFloat, checkOn: h.value === "on", optSelected: g.selected, getSetAttribute: n.className !== "t", enctype: !!e.createElement("form").enctype, html5Clone: e.createElement("nav").cloneNode(!0).outerHTML !== "<:nav>", boxModel: e.compatMode === "CSS1Compat", submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0, boxSizingReliable: !0, pixelPosition: !1 }, h.checked = !0, b.noCloneChecked = h.cloneNode(!0).checked, f.disabled = !0, b.optDisabled = !g.disabled; try { delete n.test } catch (o) { b.deleteExpando = !1 } !n.addEventListener && n.attachEvent && n.fireEvent && (n.attachEvent("onclick", m = function () { b.noCloneEvent = !1 }), n.cloneNode(!0).fireEvent("onclick"), n.detachEvent("onclick", m)), h = e.createElement("input"), h.value = "t", h.setAttribute("type", "radio"), b.radioValue = h.value === "t", h.setAttribute("checked", "checked"), h.setAttribute("name", "t"), n.appendChild(h), i = e.createDocumentFragment(), i.appendChild(n.lastChild), b.checkClone = i.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = h.checked, i.removeChild(h), i.appendChild(n); if (n.attachEvent) for (k in { submit: !0, change: !0, focusin: !0 }) j = "on" + k, l = j in n, l || (n.setAttribute(j, "return;"), l = typeof n[j] == "function"), b[k + "Bubbles"] = l; return p(function () { var c, d, f, g, h = "padding:0;margin:0;border:0;display:block;overflow:hidden;", i = e.getElementsByTagName("body")[0]; if (!i) return; c = e.createElement("div"), c.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", i.insertBefore(c, i.firstChild), d = e.createElement("div"), c.appendChild(d), d.innerHTML = "
    t
    ", f = d.getElementsByTagName("td"), f[0].style.cssText = "padding:0;margin:0;border:0;display:none", l = f[0].offsetHeight === 0, f[0].style.display = "", f[1].style.display = "none", b.reliableHiddenOffsets = l && f[0].offsetHeight === 0, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", b.boxSizing = d.offsetWidth === 4, b.doesNotIncludeMarginInBodyOffset = i.offsetTop !== 1, a.getComputedStyle && (b.pixelPosition = (a.getComputedStyle(d, null) || {}).top !== "1%", b.boxSizingReliable = (a.getComputedStyle(d, null) || { width: "4px" }).width === "4px", g = e.createElement("div"), g.style.cssText = d.style.cssText = h, g.style.marginRight = g.style.width = "0", d.style.width = "1px", d.appendChild(g), b.reliableMarginRight = !parseFloat((a.getComputedStyle(g, null) || {}).marginRight)), typeof d.style.zoom != "undefined" && (d.innerHTML = "", d.style.cssText = h + "width:1px;padding:1px;display:inline;zoom:1", b.inlineBlockNeedsLayout = d.offsetWidth === 3, d.style.display = "block", d.style.overflow = "visible", d.innerHTML = "
    ", d.firstChild.style.width = "5px", b.shrinkWrapBlocks = d.offsetWidth !== 3, c.style.zoom = 1), i.removeChild(c), c = d = f = g = null }), i.removeChild(n), c = d = f = g = h = i = n = null, b } (); var H = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, I = /([A-Z])/g; p.extend({ cache: {}, deletedIds: [], uuid: 0, expando: "jQuery" + (p.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (a) { return a = a.nodeType ? p.cache[a[p.expando]] : a[p.expando], !!a && !K(a) }, data: function (a, c, d, e) { if (!p.acceptData(a)) return; var f, g, h = p.expando, i = typeof c == "string", j = a.nodeType, k = j ? p.cache : a, l = j ? a[h] : a[h] && h; if ((!l || !k[l] || !e && !k[l].data) && i && d === b) return; l || (j ? a[h] = l = p.deletedIds.pop() || p.guid++ : l = h), k[l] || (k[l] = {}, j || (k[l].toJSON = p.noop)); if (typeof c == "object" || typeof c == "function") e ? k[l] = p.extend(k[l], c) : k[l].data = p.extend(k[l].data, c); return f = k[l], e || (f.data || (f.data = {}), f = f.data), d !== b && (f[p.camelCase(c)] = d), i ? (g = f[c], g == null && (g = f[p.camelCase(c)])) : g = f, g }, removeData: function (a, b, c) { if (!p.acceptData(a)) return; var d, e, f, g = a.nodeType, h = g ? p.cache : a, i = g ? a[p.expando] : p.expando; if (!h[i]) return; if (b) { d = c ? h[i] : h[i].data; if (d) { p.isArray(b) || (b in d ? b = [b] : (b = p.camelCase(b), b in d ? b = [b] : b = b.split(" "))); for (e = 0, f = b.length; e < f; e++) delete d[b[e]]; if (!(c ? K : p.isEmptyObject)(d)) return } } if (!c) { delete h[i].data; if (!K(h[i])) return } g ? p.cleanData([a], !0) : p.support.deleteExpando || h != h.window ? delete h[i] : h[i] = null }, _data: function (a, b, c) { return p.data(a, b, c, !0) }, acceptData: function (a) { var b = a.nodeName && p.noData[a.nodeName.toLowerCase()]; return !b || b !== !0 && a.getAttribute("classid") === b } }), p.fn.extend({ data: function (a, c) { var d, e, f, g, h, i = this[0], j = 0, k = null; if (a === b) { if (this.length) { k = p.data(i); if (i.nodeType === 1 && !p._data(i, "parsedAttrs")) { f = i.attributes; for (h = f.length; j < h; j++) g = f[j].name, g.indexOf("data-") || (g = p.camelCase(g.substring(5)), J(i, g, k[g])); p._data(i, "parsedAttrs", !0) } } return k } return typeof a == "object" ? this.each(function () { p.data(this, a) }) : (d = a.split(".", 2), d[1] = d[1] ? "." + d[1] : "", e = d[1] + "!", p.access(this, function (c) { if (c === b) return k = this.triggerHandler("getData" + e, [d[0]]), k === b && i && (k = p.data(i, a), k = J(i, a, k)), k === b && d[1] ? this.data(d[0]) : k; d[1] = c, this.each(function () { var b = p(this); b.triggerHandler("setData" + e, d), p.data(this, a, c), b.triggerHandler("changeData" + e, d) }) }, null, c, arguments.length > 1, null, !1)) }, removeData: function (a) { return this.each(function () { p.removeData(this, a) }) } }), p.extend({ queue: function (a, b, c) { var d; if (a) return b = (b || "fx") + "queue", d = p._data(a, b), c && (!d || p.isArray(c) ? d = p._data(a, b, p.makeArray(c)) : d.push(c)), d || [] }, dequeue: function (a, b) { b = b || "fx"; var c = p.queue(a, b), d = c.length, e = c.shift(), f = p._queueHooks(a, b), g = function () { p.dequeue(a, b) }; e === "inprogress" && (e = c.shift(), d--), e && (b === "fx" && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire() }, _queueHooks: function (a, b) { var c = b + "queueHooks"; return p._data(a, c) || p._data(a, c, { empty: p.Callbacks("once memory").add(function () { p.removeData(a, b + "queue", !0), p.removeData(a, c, !0) }) }) } }), p.fn.extend({ queue: function (a, c) { var d = 2; return typeof a != "string" && (c = a, a = "fx", d--), arguments.length < d ? p.queue(this[0], a) : c === b ? this : this.each(function () { var b = p.queue(this, a, c); p._queueHooks(this, a), a === "fx" && b[0] !== "inprogress" && p.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { p.dequeue(this, a) }) }, delay: function (a, b) { return a = p.fx ? p.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, c) { var d, e = 1, f = p.Deferred(), g = this, h = this.length, i = function () { --e || f.resolveWith(g, [g]) }; typeof a != "string" && (c = a, a = b), a = a || "fx"; while (h--) d = p._data(g[h], a + "queueHooks"), d && d.empty && (e++, d.empty.add(i)); return i(), f.promise(c) } }); var L, M, N, O = /[\t\r\n]/g, P = /\r/g, Q = /^(?:button|input)$/i, R = /^(?:button|input|object|select|textarea)$/i, S = /^a(?:rea|)$/i, T = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, U = p.support.getSetAttribute; p.fn.extend({ attr: function (a, b) { return p.access(this, p.attr, a, b, arguments.length > 1) }, removeAttr: function (a) { return this.each(function () { p.removeAttr(this, a) }) }, prop: function (a, b) { return p.access(this, p.prop, a, b, arguments.length > 1) }, removeProp: function (a) { return a = p.propFix[a] || a, this.each(function () { try { this[a] = b, delete this[a] } catch (c) { } }) }, addClass: function (a) { var b, c, d, e, f, g, h; if (p.isFunction(a)) return this.each(function (b) { p(this).addClass(a.call(this, b, this.className)) }); if (a && typeof a == "string") { b = a.split(s); for (c = 0, d = this.length; c < d; c++) { e = this[c]; if (e.nodeType === 1) if (!e.className && b.length === 1) e.className = a; else { f = " " + e.className + " "; for (g = 0, h = b.length; g < h; g++) f.indexOf(" " + b[g] + " ") < 0 && (f += b[g] + " "); e.className = p.trim(f) } } } return this }, removeClass: function (a) { var c, d, e, f, g, h, i; if (p.isFunction(a)) return this.each(function (b) { p(this).removeClass(a.call(this, b, this.className)) }); if (a && typeof a == "string" || a === b) { c = (a || "").split(s); for (h = 0, i = this.length; h < i; h++) { e = this[h]; if (e.nodeType === 1 && e.className) { d = (" " + e.className + " ").replace(O, " "); for (f = 0, g = c.length; f < g; f++) while (d.indexOf(" " + c[f] + " ") >= 0) d = d.replace(" " + c[f] + " ", " "); e.className = a ? p.trim(d) : "" } } } return this }, toggleClass: function (a, b) { var c = typeof a, d = typeof b == "boolean"; return p.isFunction(a) ? this.each(function (c) { p(this).toggleClass(a.call(this, c, this.className, b), b) }) : this.each(function () { if (c === "string") { var e, f = 0, g = p(this), h = b, i = a.split(s); while (e = i[f++]) h = d ? h : !g.hasClass(e), g[h ? "addClass" : "removeClass"](e) } else if (c === "undefined" || c === "boolean") this.className && p._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : p._data(this, "__className__") || "" }) }, hasClass: function (a) { var b = " " + a + " ", c = 0, d = this.length; for (; c < d; c++) if (this[c].nodeType === 1 && (" " + this[c].className + " ").replace(O, " ").indexOf(b) >= 0) return !0; return !1 }, val: function (a) { var c, d, e, f = this[0]; if (!arguments.length) { if (f) return c = p.valHooks[f.type] || p.valHooks[f.nodeName.toLowerCase()], c && "get" in c && (d = c.get(f, "value")) !== b ? d : (d = f.value, typeof d == "string" ? d.replace(P, "") : d == null ? "" : d); return } return e = p.isFunction(a), this.each(function (d) { var f, g = p(this); if (this.nodeType !== 1) return; e ? f = a.call(this, d, g.val()) : f = a, f == null ? f = "" : typeof f == "number" ? f += "" : p.isArray(f) && (f = p.map(f, function (a) { return a == null ? "" : a + "" })), c = p.valHooks[this.type] || p.valHooks[this.nodeName.toLowerCase()]; if (!c || !("set" in c) || c.set(this, f, "value") === b) this.value = f }) } }), p.extend({ valHooks: { option: { get: function (a) { var b = a.attributes.value; return !b || b.specified ? a.value : a.text } }, select: { get: function (a) { var b, c, d, e, f = a.selectedIndex, g = [], h = a.options, i = a.type === "select-one"; if (f < 0) return null; c = i ? f : 0, d = i ? f + 1 : h.length; for (; c < d; c++) { e = h[c]; if (e.selected && (p.support.optDisabled ? !e.disabled : e.getAttribute("disabled") === null) && (!e.parentNode.disabled || !p.nodeName(e.parentNode, "optgroup"))) { b = p(e).val(); if (i) return b; g.push(b) } } return i && !g.length && h.length ? p(h[f]).val() : g }, set: function (a, b) { var c = p.makeArray(b); return p(a).find("option").each(function () { this.selected = p.inArray(p(this).val(), c) >= 0 }), c.length || (a.selectedIndex = -1), c } } }, attrFn: {}, attr: function (a, c, d, e) { var f, g, h, i = a.nodeType; if (!a || i === 3 || i === 8 || i === 2) return; if (e && p.isFunction(p.fn[c])) return p(a)[c](d); if (typeof a.getAttribute == "undefined") return p.prop(a, c, d); h = i !== 1 || !p.isXMLDoc(a), h && (c = c.toLowerCase(), g = p.attrHooks[c] || (T.test(c) ? M : L)); if (d !== b) { if (d === null) { p.removeAttr(a, c); return } return g && "set" in g && h && (f = g.set(a, d, c)) !== b ? f : (a.setAttribute(c, d + ""), d) } return g && "get" in g && h && (f = g.get(a, c)) !== null ? f : (f = a.getAttribute(c), f === null ? b : f) }, removeAttr: function (a, b) { var c, d, e, f, g = 0; if (b && a.nodeType === 1) { d = b.split(s); for (; g < d.length; g++) e = d[g], e && (c = p.propFix[e] || e, f = T.test(e), f || p.attr(a, e, ""), a.removeAttribute(U ? e : c), f && c in a && (a[c] = !1)) } }, attrHooks: { type: { set: function (a, b) { if (Q.test(a.nodeName) && a.parentNode) p.error("type property can't be changed"); else if (!p.support.radioValue && b === "radio" && p.nodeName(a, "input")) { var c = a.value; return a.setAttribute("type", b), c && (a.value = c), b } } }, value: { get: function (a, b) { return L && p.nodeName(a, "button") ? L.get(a, b) : b in a ? a.value : null }, set: function (a, b, c) { if (L && p.nodeName(a, "button")) return L.set(a, b, c); a.value = b } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (a, c, d) { var e, f, g, h = a.nodeType; if (!a || h === 3 || h === 8 || h === 2) return; return g = h !== 1 || !p.isXMLDoc(a), g && (c = p.propFix[c] || c, f = p.propHooks[c]), d !== b ? f && "set" in f && (e = f.set(a, d, c)) !== b ? e : a[c] = d : f && "get" in f && (e = f.get(a, c)) !== null ? e : a[c] }, propHooks: { tabIndex: { get: function (a) { var c = a.getAttributeNode("tabindex"); return c && c.specified ? parseInt(c.value, 10) : R.test(a.nodeName) || S.test(a.nodeName) && a.href ? 0 : b } }} }), M = { get: function (a, c) { var d, e = p.prop(a, c); return e === !0 || typeof e != "boolean" && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b }, set: function (a, b, c) { var d; return b === !1 ? p.removeAttr(a, c) : (d = p.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())), c } }, U || (N = { name: !0, id: !0, coords: !0 }, L = p.valHooks.button = { get: function (a, c) { var d; return d = a.getAttributeNode(c), d && (N[c] ? d.value !== "" : d.specified) ? d.value : b }, set: function (a, b, c) { var d = a.getAttributeNode(c); return d || (d = e.createAttribute(c), a.setAttributeNode(d)), d.value = b + "" } }, p.each(["width", "height"], function (a, b) { p.attrHooks[b] = p.extend(p.attrHooks[b], { set: function (a, c) { if (c === "") return a.setAttribute(b, "auto"), c } }) }), p.attrHooks.contenteditable = { get: L.get, set: function (a, b, c) { b === "" && (b = "false"), L.set(a, b, c) } }), p.support.hrefNormalized || p.each(["href", "src", "width", "height"], function (a, c) { p.attrHooks[c] = p.extend(p.attrHooks[c], { get: function (a) { var d = a.getAttribute(c, 2); return d === null ? b : d } }) }), p.support.style || (p.attrHooks.style = { get: function (a) { return a.style.cssText.toLowerCase() || b }, set: function (a, b) { return a.style.cssText = b + "" } }), p.support.optSelected || (p.propHooks.selected = p.extend(p.propHooks.selected, { get: function (a) { var b = a.parentNode; return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null } })), p.support.enctype || (p.propFix.enctype = "encoding"), p.support.checkOn || p.each(["radio", "checkbox"], function () { p.valHooks[this] = { get: function (a) { return a.getAttribute("value") === null ? "on" : a.value } } }), p.each(["radio", "checkbox"], function () { p.valHooks[this] = p.extend(p.valHooks[this], { set: function (a, b) { if (p.isArray(b)) return a.checked = p.inArray(p(a).val(), b) >= 0 } }) }); var V = /^(?:textarea|input|select)$/i, W = /^([^\.]*|)(?:\.(.+)|)$/, X = /(?:^|\s)hover(\.\S+|)\b/, Y = /^key/, Z = /^(?:mouse|contextmenu)|click/, $ = /^(?:focusinfocus|focusoutblur)$/, _ = function (a) { return p.event.special.hover ? a : a.replace(X, "mouseenter$1 mouseleave$1") }; p.event = { add: function (a, c, d, e, f) { var g, h, i, j, k, l, m, n, o, q, r; if (a.nodeType === 3 || a.nodeType === 8 || !c || !d || !(g = p._data(a))) return; d.handler && (o = d, d = o.handler, f = o.selector), d.guid || (d.guid = p.guid++), i = g.events, i || (g.events = i = {}), h = g.handle, h || (g.handle = h = function (a) { return typeof p != "undefined" && (!a || p.event.triggered !== a.type) ? p.event.dispatch.apply(h.elem, arguments) : b }, h.elem = a), c = p.trim(_(c)).split(" "); for (j = 0; j < c.length; j++) { k = W.exec(c[j]) || [], l = k[1], m = (k[2] || "").split(".").sort(), r = p.event.special[l] || {}, l = (f ? r.delegateType : r.bindType) || l, r = p.event.special[l] || {}, n = p.extend({ type: l, origType: k[1], data: e, handler: d, guid: d.guid, selector: f, needsContext: f && p.expr.match.needsContext.test(f), namespace: m.join(".") }, o), q = i[l]; if (!q) { q = i[l] = [], q.delegateCount = 0; if (!r.setup || r.setup.call(a, e, m, h) === !1) a.addEventListener ? a.addEventListener(l, h, !1) : a.attachEvent && a.attachEvent("on" + l, h) } r.add && (r.add.call(a, n), n.handler.guid || (n.handler.guid = d.guid)), f ? q.splice(q.delegateCount++, 0, n) : q.push(n), p.event.global[l] = !0 } a = null }, global: {}, remove: function (a, b, c, d, e) { var f, g, h, i, j, k, l, m, n, o, q, r = p.hasData(a) && p._data(a); if (!r || !(m = r.events)) return; b = p.trim(_(b || "")).split(" "); for (f = 0; f < b.length; f++) { g = W.exec(b[f]) || [], h = i = g[1], j = g[2]; if (!h) { for (h in m) p.event.remove(a, h + b[f], c, d, !0); continue } n = p.event.special[h] || {}, h = (d ? n.delegateType : n.bindType) || h, o = m[h] || [], k = o.length, j = j ? new RegExp("(^|\\.)" + j.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; for (l = 0; l < o.length; l++) q = o[l], (e || i === q.origType) && (!c || c.guid === q.guid) && (!j || j.test(q.namespace)) && (!d || d === q.selector || d === "**" && q.selector) && (o.splice(l--, 1), q.selector && o.delegateCount--, n.remove && n.remove.call(a, q)); o.length === 0 && k !== o.length && ((!n.teardown || n.teardown.call(a, j, r.handle) === !1) && p.removeEvent(a, h, r.handle), delete m[h]) } p.isEmptyObject(m) && (delete r.handle, p.removeData(a, "events", !0)) }, customEvent: { getData: !0, setData: !0, changeData: !0 }, trigger: function (c, d, f, g) { if (!f || f.nodeType !== 3 && f.nodeType !== 8) { var h, i, j, k, l, m, n, o, q, r, s = c.type || c, t = []; if ($.test(s + p.event.triggered)) return; s.indexOf("!") >= 0 && (s = s.slice(0, -1), i = !0), s.indexOf(".") >= 0 && (t = s.split("."), s = t.shift(), t.sort()); if ((!f || p.event.customEvent[s]) && !p.event.global[s]) return; c = typeof c == "object" ? c[p.expando] ? c : new p.Event(s, c) : new p.Event(s), c.type = s, c.isTrigger = !0, c.exclusive = i, c.namespace = t.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + t.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, m = s.indexOf(":") < 0 ? "on" + s : ""; if (!f) { h = p.cache; for (j in h) h[j].events && h[j].events[s] && p.event.trigger(c, d, h[j].handle.elem, !0); return } c.result = b, c.target || (c.target = f), d = d != null ? p.makeArray(d) : [], d.unshift(c), n = p.event.special[s] || {}; if (n.trigger && n.trigger.apply(f, d) === !1) return; q = [[f, n.bindType || s]]; if (!g && !n.noBubble && !p.isWindow(f)) { r = n.delegateType || s, k = $.test(r + s) ? f : f.parentNode; for (l = f; k; k = k.parentNode) q.push([k, r]), l = k; l === (f.ownerDocument || e) && q.push([l.defaultView || l.parentWindow || a, r]) } for (j = 0; j < q.length && !c.isPropagationStopped(); j++) k = q[j][0], c.type = q[j][1], o = (p._data(k, "events") || {})[c.type] && p._data(k, "handle"), o && o.apply(k, d), o = m && k[m], o && p.acceptData(k) && o.apply && o.apply(k, d) === !1 && c.preventDefault(); return c.type = s, !g && !c.isDefaultPrevented() && (!n._default || n._default.apply(f.ownerDocument, d) === !1) && (s !== "click" || !p.nodeName(f, "a")) && p.acceptData(f) && m && f[s] && (s !== "focus" && s !== "blur" || c.target.offsetWidth !== 0) && !p.isWindow(f) && (l = f[m], l && (f[m] = null), p.event.triggered = s, f[s](), p.event.triggered = b, l && (f[m] = l)), c.result } return }, dispatch: function (c) { c = p.event.fix(c || a.event); var d, e, f, g, h, i, j, l, m, n, o = (p._data(this, "events") || {})[c.type] || [], q = o.delegateCount, r = k.call(arguments), s = !c.exclusive && !c.namespace, t = p.event.special[c.type] || {}, u = []; r[0] = c, c.delegateTarget = this; if (t.preDispatch && t.preDispatch.call(this, c) === !1) return; if (q && (!c.button || c.type !== "click")) for (f = c.target; f != this; f = f.parentNode || this) if (f.disabled !== !0 || c.type !== "click") { h = {}, j = []; for (d = 0; d < q; d++) l = o[d], m = l.selector, h[m] === b && (h[m] = l.needsContext ? p(m, this).index(f) >= 0 : p.find(m, this, null, [f]).length), h[m] && j.push(l); j.length && u.push({ elem: f, matches: j }) } o.length > q && u.push({ elem: this, matches: o.slice(q) }); for (d = 0; d < u.length && !c.isPropagationStopped(); d++) { i = u[d], c.currentTarget = i.elem; for (e = 0; e < i.matches.length && !c.isImmediatePropagationStopped(); e++) { l = i.matches[e]; if (s || !c.namespace && !l.namespace || c.namespace_re && c.namespace_re.test(l.namespace)) c.data = l.data, c.handleObj = l, g = ((p.event.special[l.origType] || {}).handle || l.handler).apply(i.elem, r), g !== b && (c.result = g, g === !1 && (c.preventDefault(), c.stopPropagation())) } } return t.postDispatch && t.postDispatch.call(this, c), c.result }, props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { return a.which == null && (a.which = b.charCode != null ? b.charCode : b.keyCode), a } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, c) { var d, f, g, h = c.button, i = c.fromElement; return a.pageX == null && c.clientX != null && (d = a.target.ownerDocument || e, f = d.documentElement, g = d.body, a.pageX = c.clientX + (f && f.scrollLeft || g && g.scrollLeft || 0) - (f && f.clientLeft || g && g.clientLeft || 0), a.pageY = c.clientY + (f && f.scrollTop || g && g.scrollTop || 0) - (f && f.clientTop || g && g.clientTop || 0)), !a.relatedTarget && i && (a.relatedTarget = i === a.target ? c.toElement : i), !a.which && h !== b && (a.which = h & 1 ? 1 : h & 2 ? 3 : h & 4 ? 2 : 0), a } }, fix: function (a) { if (a[p.expando]) return a; var b, c, d = a, f = p.event.fixHooks[a.type] || {}, g = f.props ? this.props.concat(f.props) : this.props; a = p.Event(d); for (b = g.length; b; ) c = g[--b], a[c] = d[c]; return a.target || (a.target = d.srcElement || e), a.target.nodeType === 3 && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, f.filter ? f.filter(a, d) : a }, special: { load: { noBubble: !0 }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function (a, b, c) { p.isWindow(this) && (this.onbeforeunload = c) }, teardown: function (a, b) { this.onbeforeunload === b && (this.onbeforeunload = null) } } }, simulate: function (a, b, c, d) { var e = p.extend(new p.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? p.event.trigger(e, null, b) : p.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, p.event.handle = p.event.dispatch, p.removeEvent = e.removeEventListener ? function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) } : function (a, b, c) { var d = "on" + b; a.detachEvent && (typeof a[d] == "undefined" && (a[d] = null), a.detachEvent(d, c)) }, p.Event = function (a, b) { if (this instanceof p.Event) a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? bb : ba) : this.type = a, b && p.extend(this, b), this.timeStamp = a && a.timeStamp || p.now(), this[p.expando] = !0; else return new p.Event(a, b) }, p.Event.prototype = { preventDefault: function () { this.isDefaultPrevented = bb; var a = this.originalEvent; if (!a) return; a.preventDefault ? a.preventDefault() : a.returnValue = !1 }, stopPropagation: function () { this.isPropagationStopped = bb; var a = this.originalEvent; if (!a) return; a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0 }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = bb, this.stopPropagation() }, isDefaultPrevented: ba, isPropagationStopped: ba, isImmediatePropagationStopped: ba }, p.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (a, b) { p.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c, d = this, e = a.relatedTarget, f = a.handleObj, g = f.selector; if (!e || e !== d && !p.contains(d, e)) a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b; return c } } }), p.support.submitBubbles || (p.event.special.submit = { setup: function () { if (p.nodeName(this, "form")) return !1; p.event.add(this, "click._submit keypress._submit", function (a) { var c = a.target, d = p.nodeName(c, "input") || p.nodeName(c, "button") ? c.form : b; d && !p._data(d, "_submit_attached") && (p.event.add(d, "submit._submit", function (a) { a._submit_bubble = !0 }), p._data(d, "_submit_attached", !0)) }) }, postDispatch: function (a) { a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && p.event.simulate("submit", this.parentNode, a, !0)) }, teardown: function () { if (p.nodeName(this, "form")) return !1; p.event.remove(this, "._submit") } }), p.support.changeBubbles || (p.event.special.change = { setup: function () { if (V.test(this.nodeName)) { if (this.type === "checkbox" || this.type === "radio") p.event.add(this, "propertychange._change", function (a) { a.originalEvent.propertyName === "checked" && (this._just_changed = !0) }), p.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1), p.event.simulate("change", this, a, !0) }); return !1 } p.event.add(this, "beforeactivate._change", function (a) { var b = a.target; V.test(b.nodeName) && !p._data(b, "_change_attached") && (p.event.add(b, "change._change", function (a) { this.parentNode && !a.isSimulated && !a.isTrigger && p.event.simulate("change", this.parentNode, a, !0) }), p._data(b, "_change_attached", !0)) }) }, handle: function (a) { var b = a.target; if (this !== b || a.isSimulated || a.isTrigger || b.type !== "radio" && b.type !== "checkbox") return a.handleObj.handler.apply(this, arguments) }, teardown: function () { return p.event.remove(this, "._change"), !V.test(this.nodeName) } }), p.support.focusinBubbles || p.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var c = 0, d = function (a) { p.event.simulate(b, a.target, p.event.fix(a), !0) }; p.event.special[b] = { setup: function () { c++ === 0 && e.addEventListener(a, d, !0) }, teardown: function () { --c === 0 && e.removeEventListener(a, d, !0) } } }), p.fn.extend({ on: function (a, c, d, e, f) { var g, h; if (typeof a == "object") { typeof c != "string" && (d = d || c, c = b); for (h in a) this.on(h, c, d, a[h], f); return this } d == null && e == null ? (e = c, d = c = b) : e == null && (typeof c == "string" ? (e = d, d = b) : (e = d, d = c, c = b)); if (e === !1) e = ba; else if (!e) return this; return f === 1 && (g = e, e = function (a) { return p().off(a), g.apply(this, arguments) }, e.guid = g.guid || (g.guid = p.guid++)), this.each(function () { p.event.add(this, a, e, d, c) }) }, one: function (a, b, c, d) { return this.on(a, b, c, d, 1) }, off: function (a, c, d) { var e, f; if (a && a.preventDefault && a.handleObj) return e = a.handleObj, p(a.delegateTarget).off(e.namespace ? e.origType + "." + e.namespace : e.origType, e.selector, e.handler), this; if (typeof a == "object") { for (f in a) this.off(f, c, a[f]); return this } if (c === !1 || typeof c == "function") d = c, c = b; return d === !1 && (d = ba), this.each(function () { p.event.remove(this, a, d, c) }) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, live: function (a, b, c) { return p(this.context).on(a, this.selector, b, c), this }, die: function (a, b) { return p(this.context).off(a, this.selector || "**", b), this }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return arguments.length === 1 ? this.off(a, "**") : this.off(b, a || "**", c) }, trigger: function (a, b) { return this.each(function () { p.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { if (this[0]) return p.event.trigger(a, b, this[0], !0) }, toggle: function (a) { var b = arguments, c = a.guid || p.guid++, d = 0, e = function (c) { var e = (p._data(this, "lastToggle" + a.guid) || 0) % d; return p._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(), b[e].apply(this, arguments) || !1 }; e.guid = c; while (d < b.length) b[d++].guid = c; return this.click(e) }, hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) } }), p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { p.fn[b] = function (a, c) { return c == null && (c = a, a = null), arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) }, Y.test(b) && (p.event.fixHooks[b] = p.event.keyHooks), Z.test(b) && (p.event.fixHooks[b] = p.event.mouseHooks) }), function (a, b) { function bc(a, b, c, d) { c = c || [], b = b || r; var e, f, i, j, k = b.nodeType; if (!a || typeof a != "string") return c; if (k !== 1 && k !== 9) return []; i = g(b); if (!i && !d) if (e = P.exec(a)) if (j = e[1]) { if (k === 9) { f = b.getElementById(j); if (!f || !f.parentNode) return c; if (f.id === j) return c.push(f), c } else if (b.ownerDocument && (f = b.ownerDocument.getElementById(j)) && h(b, f) && f.id === j) return c.push(f), c } else { if (e[2]) return w.apply(c, x.call(b.getElementsByTagName(a), 0)), c; if ((j = e[3]) && _ && b.getElementsByClassName) return w.apply(c, x.call(b.getElementsByClassName(j), 0)), c } return bp(a.replace(L, "$1"), b, c, d, i) } function bd(a) { return function (b) { var c = b.nodeName.toLowerCase(); return c === "input" && b.type === a } } function be(a) { return function (b) { var c = b.nodeName.toLowerCase(); return (c === "input" || c === "button") && b.type === a } } function bf(a) { return z(function (b) { return b = +b, z(function (c, d) { var e, f = a([], c.length, b), g = f.length; while (g--) c[e = f[g]] && (c[e] = !(d[e] = c[e])) }) }) } function bg(a, b, c) { if (a === b) return c; var d = a.nextSibling; while (d) { if (d === b) return -1; d = d.nextSibling } return 1 } function bh(a, b) { var c, d, f, g, h, i, j, k = C[o][a]; if (k) return b ? 0 : k.slice(0); h = a, i = [], j = e.preFilter; while (h) { if (!c || (d = M.exec(h))) d && (h = h.slice(d[0].length)), i.push(f = []); c = !1; if (d = N.exec(h)) f.push(c = new q(d.shift())), h = h.slice(c.length), c.type = d[0].replace(L, " "); for (g in e.filter) (d = W[g].exec(h)) && (!j[g] || (d = j[g](d, r, !0))) && (f.push(c = new q(d.shift())), h = h.slice(c.length), c.type = g, c.matches = d); if (!c) break } return b ? h.length : h ? bc.error(a) : C(a, i).slice(0) } function bi(a, b, d) { var e = b.dir, f = d && b.dir === "parentNode", g = u++; return b.first ? function (b, c, d) { while (b = b[e]) if (f || b.nodeType === 1) return a(b, c, d) } : function (b, d, h) { if (!h) { var i, j = t + " " + g + " ", k = j + c; while (b = b[e]) if (f || b.nodeType === 1) { if ((i = b[o]) === k) return b.sizset; if (typeof i == "string" && i.indexOf(j) === 0) { if (b.sizset) return b } else { b[o] = k; if (a(b, d, h)) return b.sizset = !0, b; b.sizset = !1 } } } else while (b = b[e]) if (f || b.nodeType === 1) if (a(b, d, h)) return b } } function bj(a) { return a.length > 1 ? function (b, c, d) { var e = a.length; while (e--) if (!a[e](b, c, d)) return !1; return !0 } : a[0] } function bk(a, b, c, d, e) { var f, g = [], h = 0, i = a.length, j = b != null; for (; h < i; h++) if (f = a[h]) if (!c || c(f, d, e)) g.push(f), j && b.push(h); return g } function bl(a, b, c, d, e, f) { return d && !d[o] && (d = bl(d)), e && !e[o] && (e = bl(e, f)), z(function (f, g, h, i) { if (f && e) return; var j, k, l, m = [], n = [], o = g.length, p = f || bo(b || "*", h.nodeType ? [h] : h, [], f), q = a && (f || !b) ? bk(p, m, a, h, i) : p, r = c ? e || (f ? a : o || d) ? [] : g : q; c && c(q, r, h, i); if (d) { l = bk(r, n), d(l, [], h, i), j = l.length; while (j--) if (k = l[j]) r[n[j]] = !(q[n[j]] = k) } if (f) { j = a && r.length; while (j--) if (k = r[j]) f[m[j]] = !(g[m[j]] = k) } else r = bk(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : w.apply(g, r) }) } function bm(a) { var b, c, d, f = a.length, g = e.relative[a[0].type], h = g || e.relative[" "], i = g ? 1 : 0, j = bi(function (a) { return a === b }, h, !0), k = bi(function (a) { return y.call(b, a) > -1 }, h, !0), m = [function (a, c, d) { return !g && (d || c !== l) || ((b = c).nodeType ? j(a, c, d) : k(a, c, d)) } ]; for (; i < f; i++) if (c = e.relative[a[i].type]) m = [bi(bj(m), c)]; else { c = e.filter[a[i].type].apply(null, a[i].matches); if (c[o]) { d = ++i; for (; d < f; d++) if (e.relative[a[d].type]) break; return bl(i > 1 && bj(m), i > 1 && a.slice(0, i - 1).join("").replace(L, "$1"), c, i < d && bm(a.slice(i, d)), d < f && bm(a = a.slice(d)), d < f && a.join("")) } m.push(c) } return bj(m) } function bn(a, b) { var d = b.length > 0, f = a.length > 0, g = function (h, i, j, k, m) { var n, o, p, q = [], s = 0, u = "0", x = h && [], y = m != null, z = l, A = h || f && e.find.TAG("*", m && i.parentNode || i), B = t += z == null ? 1 : Math.E; y && (l = i !== r && i, c = g.el); for (; (n = A[u]) != null; u++) { if (f && n) { for (o = 0; p = a[o]; o++) if (p(n, i, j)) { k.push(n); break } y && (t = B, c = ++g.el) } d && ((n = !p && n) && s--, h && x.push(n)) } s += u; if (d && u !== s) { for (o = 0; p = b[o]; o++) p(x, q, i, j); if (h) { if (s > 0) while (u--) !x[u] && !q[u] && (q[u] = v.call(k)); q = bk(q) } w.apply(k, q), y && !h && q.length > 0 && s + b.length > 1 && bc.uniqueSort(k) } return y && (t = B, l = z), x }; return g.el = 0, d ? z(g) : g } function bo(a, b, c, d) { var e = 0, f = b.length; for (; e < f; e++) bc(a, b[e], c, d); return c } function bp(a, b, c, d, f) { var g, h, j, k, l, m = bh(a), n = m.length; if (!d && m.length === 1) { h = m[0] = m[0].slice(0); if (h.length > 2 && (j = h[0]).type === "ID" && b.nodeType === 9 && !f && e.relative[h[1].type]) { b = e.find.ID(j.matches[0].replace(V, ""), b, f)[0]; if (!b) return c; a = a.slice(h.shift().length) } for (g = W.POS.test(a) ? -1 : h.length - 1; g >= 0; g--) { j = h[g]; if (e.relative[k = j.type]) break; if (l = e.find[k]) if (d = l(j.matches[0].replace(V, ""), R.test(h[0].type) && b.parentNode || b, f)) { h.splice(g, 1), a = d.length && h.join(""); if (!a) return w.apply(c, x.call(d, 0)), c; break } } } return i(a, m)(d, b, f, c, R.test(a)), c } function bq() { } var c, d, e, f, g, h, i, j, k, l, m = !0, n = "undefined", o = ("sizcache" + Math.random()).replace(".", ""), q = String, r = a.document, s = r.documentElement, t = 0, u = 0, v = [].pop, w = [].push, x = [].slice, y = [].indexOf || function (a) { var b = 0, c = this.length; for (; b < c; b++) if (this[b] === a) return b; return -1 }, z = function (a, b) { return a[o] = b == null || b, a }, A = function () { var a = {}, b = []; return z(function (c, d) { return b.push(c) > e.cacheLength && delete a[b.shift()], a[c] = d }, a) }, B = A(), C = A(), D = A(), E = "[\\x20\\t\\r\\n\\f]", F = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", G = F.replace("w", "w#"), H = "([*^$|!~]?=)", I = "\\[" + E + "*(" + F + ")" + E + "*(?:" + H + E + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + G + ")|)|)" + E + "*\\]", J = ":(" + F + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + I + ")|[^:]|\\\\.)*|.*))\\)|)", K = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + E + "*((?:-\\d)?\\d*)" + E + "*\\)|)(?=[^-]|$)", L = new RegExp("^" + E + "+|((?:^|[^\\\\])(?:\\\\.)*)" + E + "+$", "g"), M = new RegExp("^" + E + "*," + E + "*"), N = new RegExp("^" + E + "*([\\x20\\t\\r\\n\\f>+~])" + E + "*"), O = new RegExp(J), P = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, Q = /^:not/, R = /[\x20\t\r\n\f]*[+~]/, S = /:not\($/, T = /h\d/i, U = /input|select|textarea|button/i, V = /\\(?!\\)/g, W = { ID: new RegExp("^#(" + F + ")"), CLASS: new RegExp("^\\.(" + F + ")"), NAME: new RegExp("^\\[name=['\"]?(" + F + ")['\"]?\\]"), TAG: new RegExp("^(" + F.replace("w", "w*") + ")"), ATTR: new RegExp("^" + I), PSEUDO: new RegExp("^" + J), POS: new RegExp(K, "i"), CHILD: new RegExp("^:(only|nth|first|last)-child(?:\\(" + E + "*(even|odd|(([+-]|)(\\d*)n|)" + E + "*(?:([+-]|)" + E + "*(\\d+)|))" + E + "*\\)|)", "i"), needsContext: new RegExp("^" + E + "*[>+~]|" + K, "i") }, X = function (a) { var b = r.createElement("div"); try { return a(b) } catch (c) { return !1 } finally { b = null } }, Y = X(function (a) { return a.appendChild(r.createComment("")), !a.getElementsByTagName("*").length }), Z = X(function (a) { return a.innerHTML = "", a.firstChild && typeof a.firstChild.getAttribute !== n && a.firstChild.getAttribute("href") === "#" }), $ = X(function (a) { a.innerHTML = ""; var b = typeof a.lastChild.getAttribute("multiple"); return b !== "boolean" && b !== "string" }), _ = X(function (a) { return a.innerHTML = "", !a.getElementsByClassName || !a.getElementsByClassName("e").length ? !1 : (a.lastChild.className = "e", a.getElementsByClassName("e").length === 2) }), ba = X(function (a) { a.id = o + 0, a.innerHTML = "
    ", s.insertBefore(a, s.firstChild); var b = r.getElementsByName && r.getElementsByName(o).length === 2 + r.getElementsByName(o + 0).length; return d = !r.getElementById(o), s.removeChild(a), b }); try { x.call(s.childNodes, 0)[0].nodeType } catch (bb) { x = function (a) { var b, c = []; for (; b = this[a]; a++) c.push(b); return c } } bc.matches = function (a, b) { return bc(a, null, null, b) }, bc.matchesSelector = function (a, b) { return bc(b, null, null, [a]).length > 0 }, f = bc.getText = function (a) { var b, c = "", d = 0, e = a.nodeType; if (e) { if (e === 1 || e === 9 || e === 11) { if (typeof a.textContent == "string") return a.textContent; for (a = a.firstChild; a; a = a.nextSibling) c += f(a) } else if (e === 3 || e === 4) return a.nodeValue } else for (; b = a[d]; d++) c += f(b); return c }, g = bc.isXML = function (a) { var b = a && (a.ownerDocument || a).documentElement; return b ? b.nodeName !== "HTML" : !1 }, h = bc.contains = s.contains ? function (a, b) { var c = a.nodeType === 9 ? a.documentElement : a, d = b && b.parentNode; return a === d || !!(d && d.nodeType === 1 && c.contains && c.contains(d)) } : s.compareDocumentPosition ? function (a, b) { return b && !!(a.compareDocumentPosition(b) & 16) } : function (a, b) { while (b = b.parentNode) if (b === a) return !0; return !1 }, bc.attr = function (a, b) { var c, d = g(a); return d || (b = b.toLowerCase()), (c = e.attrHandle[b]) ? c(a) : d || $ ? a.getAttribute(b) : (c = a.getAttributeNode(b), c ? typeof a[b] == "boolean" ? a[b] ? b : null : c.specified ? c.value : null : null) }, e = bc.selectors = { cacheLength: 50, createPseudo: z, match: W, attrHandle: Z ? {} : { href: function (a) { return a.getAttribute("href", 2) }, type: function (a) { return a.getAttribute("type") } }, find: { ID: d ? function (a, b, c) { if (typeof b.getElementById !== n && !c) { var d = b.getElementById(a); return d && d.parentNode ? [d] : [] } } : function (a, c, d) { if (typeof c.getElementById !== n && !d) { var e = c.getElementById(a); return e ? e.id === a || typeof e.getAttributeNode !== n && e.getAttributeNode("id").value === a ? [e] : b : [] } }, TAG: Y ? function (a, b) { if (typeof b.getElementsByTagName !== n) return b.getElementsByTagName(a) } : function (a, b) { var c = b.getElementsByTagName(a); if (a === "*") { var d, e = [], f = 0; for (; d = c[f]; f++) d.nodeType === 1 && e.push(d); return e } return c }, NAME: ba && function (a, b) { if (typeof b.getElementsByName !== n) return b.getElementsByName(name) }, CLASS: _ && function (a, b, c) { if (typeof b.getElementsByClassName !== n && !c) return b.getElementsByClassName(a) } }, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling"} }, preFilter: { ATTR: function (a) { return a[1] = a[1].replace(V, ""), a[3] = (a[4] || a[5] || "").replace(V, ""), a[2] === "~=" && (a[3] = " " + a[3] + " "), a.slice(0, 4) }, CHILD: function (a) { return a[1] = a[1].toLowerCase(), a[1] === "nth" ? (a[2] || bc.error(a[0]), a[3] = +(a[3] ? a[4] + (a[5] || 1) : 2 * (a[2] === "even" || a[2] === "odd")), a[4] = +(a[6] + a[7] || a[2] === "odd")) : a[2] && bc.error(a[0]), a }, PSEUDO: function (a) { var b, c; if (W.CHILD.test(a[0])) return null; if (a[3]) a[2] = a[3]; else if (b = a[4]) O.test(b) && (c = bh(b, !0)) && (c = b.indexOf(")", b.length - c) - b.length) && (b = b.slice(0, c), a[0] = a[0].slice(0, c)), a[2] = b; return a.slice(0, 3) } }, filter: { ID: d ? function (a) { return a = a.replace(V, ""), function (b) { return b.getAttribute("id") === a } } : function (a) { return a = a.replace(V, ""), function (b) { var c = typeof b.getAttributeNode !== n && b.getAttributeNode("id"); return c && c.value === a } }, TAG: function (a) { return a === "*" ? function () { return !0 } : (a = a.replace(V, "").toLowerCase(), function (b) { return b.nodeName && b.nodeName.toLowerCase() === a }) }, CLASS: function (a) { var b = B[o][a]; return b || (b = B(a, new RegExp("(^|" + E + ")" + a + "(" + E + "|$)"))), function (a) { return b.test(a.className || typeof a.getAttribute !== n && a.getAttribute("class") || "") } }, ATTR: function (a, b, c) { return function (d, e) { var f = bc.attr(d, a); return f == null ? b === "!=" : b ? (f += "", b === "=" ? f === c : b === "!=" ? f !== c : b === "^=" ? c && f.indexOf(c) === 0 : b === "*=" ? c && f.indexOf(c) > -1 : b === "$=" ? c && f.substr(f.length - c.length) === c : b === "~=" ? (" " + f + " ").indexOf(c) > -1 : b === "|=" ? f === c || f.substr(0, c.length + 1) === c + "-" : !1) : !0 } }, CHILD: function (a, b, c, d) { return a === "nth" ? function (a) { var b, e, f = a.parentNode; if (c === 1 && d === 0) return !0; if (f) { e = 0; for (b = f.firstChild; b; b = b.nextSibling) if (b.nodeType === 1) { e++; if (a === b) break } } return e -= d, e === c || e % c === 0 && e / c >= 0 } : function (b) { var c = b; switch (a) { case "only": case "first": while (c = c.previousSibling) if (c.nodeType === 1) return !1; if (a === "first") return !0; c = b; case "last": while (c = c.nextSibling) if (c.nodeType === 1) return !1; return !0 } } }, PSEUDO: function (a, b) { var c, d = e.pseudos[a] || e.setFilters[a.toLowerCase()] || bc.error("unsupported pseudo: " + a); return d[o] ? d(b) : d.length > 1 ? (c = [a, a, "", b], e.setFilters.hasOwnProperty(a.toLowerCase()) ? z(function (a, c) { var e, f = d(a, b), g = f.length; while (g--) e = y.call(a, f[g]), a[e] = !(c[e] = f[g]) }) : function (a) { return d(a, 0, c) }) : d } }, pseudos: { not: z(function (a) { var b = [], c = [], d = i(a.replace(L, "$1")); return d[o] ? z(function (a, b, c, e) { var f, g = d(a, null, e, []), h = a.length; while (h--) if (f = g[h]) a[h] = !(b[h] = f) }) : function (a, e, f) { return b[0] = a, d(b, null, f, c), !c.pop() } }), has: z(function (a) { return function (b) { return bc(a, b).length > 0 } }), contains: z(function (a) { return function (b) { return (b.textContent || b.innerText || f(b)).indexOf(a) > -1 } }), enabled: function (a) { return a.disabled === !1 }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { var b = a.nodeName.toLowerCase(); return b === "input" && !!a.checked || b === "option" && !!a.selected }, selected: function (a) { return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 }, parent: function (a) { return !e.pseudos.empty(a) }, empty: function (a) { var b; a = a.firstChild; while (a) { if (a.nodeName > "@" || (b = a.nodeType) === 3 || b === 4) return !1; a = a.nextSibling } return !0 }, header: function (a) { return T.test(a.nodeName) }, text: function (a) { var b, c; return a.nodeName.toLowerCase() === "input" && (b = a.type) === "text" && ((c = a.getAttribute("type")) == null || c.toLowerCase() === b) }, radio: bd("radio"), checkbox: bd("checkbox"), file: bd("file"), password: bd("password"), image: bd("image"), submit: be("submit"), reset: be("reset"), button: function (a) { var b = a.nodeName.toLowerCase(); return b === "input" && a.type === "button" || b === "button" }, input: function (a) { return U.test(a.nodeName) }, focus: function (a) { var b = a.ownerDocument; return a === b.activeElement && (!b.hasFocus || b.hasFocus()) && (!!a.type || !!a.href) }, active: function (a) { return a === a.ownerDocument.activeElement }, first: bf(function (a, b, c) { return [0] }), last: bf(function (a, b, c) { return [b - 1] }), eq: bf(function (a, b, c) { return [c < 0 ? c + b : c] }), even: bf(function (a, b, c) { for (var d = 0; d < b; d += 2) a.push(d); return a }), odd: bf(function (a, b, c) { for (var d = 1; d < b; d += 2) a.push(d); return a }), lt: bf(function (a, b, c) { for (var d = c < 0 ? c + b : c; --d >= 0; ) a.push(d); return a }), gt: bf(function (a, b, c) { for (var d = c < 0 ? c + b : c; ++d < b; ) a.push(d); return a })} }, j = s.compareDocumentPosition ? function (a, b) { return a === b ? (k = !0, 0) : (!a.compareDocumentPosition || !b.compareDocumentPosition ? a.compareDocumentPosition : a.compareDocumentPosition(b) & 4) ? -1 : 1 } : function (a, b) { if (a === b) return k = !0, 0; if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex; var c, d, e = [], f = [], g = a.parentNode, h = b.parentNode, i = g; if (g === h) return bg(a, b); if (!g) return -1; if (!h) return 1; while (i) e.unshift(i), i = i.parentNode; i = h; while (i) f.unshift(i), i = i.parentNode; c = e.length, d = f.length; for (var j = 0; j < c && j < d; j++) if (e[j] !== f[j]) return bg(e[j], f[j]); return j === c ? bg(a, f[j], -1) : bg(e[j], b, 1) }, [0, 0].sort(j), m = !k, bc.uniqueSort = function (a) { var b, c = 1; k = m, a.sort(j); if (k) for (; b = a[c]; c++) b === a[c - 1] && a.splice(c--, 1); return a }, bc.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a) }, i = bc.compile = function (a, b) { var c, d = [], e = [], f = D[o][a]; if (!f) { b || (b = bh(a)), c = b.length; while (c--) f = bm(b[c]), f[o] ? d.push(f) : e.push(f); f = D(a, bn(e, d)) } return f }, r.querySelectorAll && function () { var a, b = bp, c = /'|\\/g, d = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, e = [":focus"], f = [":active", ":focus"], h = s.matchesSelector || s.mozMatchesSelector || s.webkitMatchesSelector || s.oMatchesSelector || s.msMatchesSelector; X(function (a) { a.innerHTML = "", a.querySelectorAll("[selected]").length || e.push("\\[" + E + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), a.querySelectorAll(":checked").length || e.push(":checked") }), X(function (a) { a.innerHTML = "

    ", a.querySelectorAll("[test^='']").length && e.push("[*^$]=" + E + "*(?:\"\"|'')"), a.innerHTML = "", a.querySelectorAll(":enabled").length || e.push(":enabled", ":disabled") }), e = new RegExp(e.join("|")), bp = function (a, d, f, g, h) { if (!g && !h && (!e || !e.test(a))) { var i, j, k = !0, l = o, m = d, n = d.nodeType === 9 && a; if (d.nodeType === 1 && d.nodeName.toLowerCase() !== "object") { i = bh(a), (k = d.getAttribute("id")) ? l = k.replace(c, "\\$&") : d.setAttribute("id", l), l = "[id='" + l + "'] ", j = i.length; while (j--) i[j] = l + i[j].join(""); m = R.test(a) && d.parentNode || d, n = i.join(",") } if (n) try { return w.apply(f, x.call(m.querySelectorAll(n), 0)), f } catch (p) { } finally { k || d.removeAttribute("id") } } return b(a, d, f, g, h) }, h && (X(function (b) { a = h.call(b, "div"); try { h.call(b, "[test!='']:sizzle"), f.push("!=", J) } catch (c) { } }), f = new RegExp(f.join("|")), bc.matchesSelector = function (b, c) { c = c.replace(d, "='$1']"); if (!g(b) && !f.test(c) && (!e || !e.test(c))) try { var i = h.call(b, c); if (i || a || b.document && b.document.nodeType !== 11) return i } catch (j) { } return bc(c, null, null, [b]).length > 0 }) } (), e.pseudos.nth = e.pseudos.eq, e.filters = bq.prototype = e.pseudos, e.setFilters = new bq, bc.attr = p.attr, p.find = bc, p.expr = bc.selectors, p.expr[":"] = p.expr.pseudos, p.unique = bc.uniqueSort, p.text = bc.getText, p.isXMLDoc = bc.isXML, p.contains = bc.contains } (a); var bc = /Until$/, bd = /^(?:parents|prev(?:Until|All))/, be = /^.[^:#\[\.,]*$/, bf = p.expr.match.needsContext, bg = { children: !0, contents: !0, next: !0, prev: !0 }; p.fn.extend({ find: function (a) { var b, c, d, e, f, g, h = this; if (typeof a != "string") return p(a).filter(function () { for (b = 0, c = h.length; b < c; b++) if (p.contains(h[b], this)) return !0 }); g = this.pushStack("", "find", a); for (b = 0, c = this.length; b < c; b++) { d = g.length, p.find(a, this[b], g); if (b > 0) for (e = d; e < g.length; e++) for (f = 0; f < d; f++) if (g[f] === g[e]) { g.splice(e--, 1); break } } return g }, has: function (a) { var b, c = p(a, this), d = c.length; return this.filter(function () { for (b = 0; b < d; b++) if (p.contains(this, c[b])) return !0 }) }, not: function (a) { return this.pushStack(bj(this, a, !1), "not", a) }, filter: function (a) { return this.pushStack(bj(this, a, !0), "filter", a) }, is: function (a) { return !!a && (typeof a == "string" ? bf.test(a) ? p(a, this.context).index(this[0]) >= 0 : p.filter(a, this).length > 0 : this.filter(a).length > 0) }, closest: function (a, b) { var c, d = 0, e = this.length, f = [], g = bf.test(a) || typeof a != "string" ? p(a, b || this.context) : 0; for (; d < e; d++) { c = this[d]; while (c && c.ownerDocument && c !== b && c.nodeType !== 11) { if (g ? g.index(c) > -1 : p.find.matchesSelector(c, a)) { f.push(c); break } c = c.parentNode } } return f = f.length > 1 ? p.unique(f) : f, this.pushStack(f, "closest", a) }, index: function (a) { return a ? typeof a == "string" ? p.inArray(this[0], p(a)) : p.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1 }, add: function (a, b) { var c = typeof a == "string" ? p(a, b) : p.makeArray(a && a.nodeType ? [a] : a), d = p.merge(this.get(), c); return this.pushStack(bh(c[0]) || bh(d[0]) ? d : p.unique(d)) }, addBack: function (a) { return this.add(a == null ? this.prevObject : this.prevObject.filter(a)) } }), p.fn.andSelf = p.fn.addBack, p.each({ parent: function (a) { var b = a.parentNode; return b && b.nodeType !== 11 ? b : null }, parents: function (a) { return p.dir(a, "parentNode") }, parentsUntil: function (a, b, c) { return p.dir(a, "parentNode", c) }, next: function (a) { return bi(a, "nextSibling") }, prev: function (a) { return bi(a, "previousSibling") }, nextAll: function (a) { return p.dir(a, "nextSibling") }, prevAll: function (a) { return p.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return p.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return p.dir(a, "previousSibling", c) }, siblings: function (a) { return p.sibling((a.parentNode || {}).firstChild, a) }, children: function (a) { return p.sibling(a.firstChild) }, contents: function (a) { return p.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : p.merge([], a.childNodes) } }, function (a, b) { p.fn[a] = function (c, d) { var e = p.map(this, b, c); return bc.test(a) || (d = c), d && typeof d == "string" && (e = p.filter(d, e)), e = this.length > 1 && !bg[a] ? p.unique(e) : e, this.length > 1 && bd.test(a) && (e = e.reverse()), this.pushStack(e, a, k.call(arguments).join(",")) } }), p.extend({ filter: function (a, b, c) { return c && (a = ":not(" + a + ")"), b.length === 1 ? p.find.matchesSelector(b[0], a) ? [b[0]] : [] : p.find.matches(a, b) }, dir: function (a, c, d) { var e = [], f = a[c]; while (f && f.nodeType !== 9 && (d === b || f.nodeType !== 1 || !p(f).is(d))) f.nodeType === 1 && e.push(f), f = f[c]; return e }, sibling: function (a, b) { var c = []; for (; a; a = a.nextSibling) a.nodeType === 1 && a !== b && c.push(a); return c } }); var bl = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", bm = / jQuery\d+="(?:null|\d+)"/g, bn = /^\s+/, bo = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, bp = /<([\w:]+)/, bq = /]", "i"), bv = /^(?:checkbox|radio)$/, bw = /checked\s*(?:[^=]|=\s*.checked.)/i, bx = /\/(java|ecma)script/i, by = /^\s*\s*$/g, bz = { option: [1, ""], legend: [1, "
    ", "
    "], thead: [1, "", "
    "], tr: [2, "", "
    "], td: [3, "", "
    "], col: [2, "", "
    "], area: [1, "", ""], _default: [0, "", ""] }, bA = bk(e), bB = bA.appendChild(e.createElement("div")); bz.optgroup = bz.option, bz.tbody = bz.tfoot = bz.colgroup = bz.caption = bz.thead, bz.th = bz.td, p.support.htmlSerialize || (bz._default = [1, "X
    ", "
    "]), p.fn.extend({ text: function (a) { return p.access(this, function (a) { return a === b ? p.text(this) : this.empty().append((this[0] && this[0].ownerDocument || e).createTextNode(a)) }, null, a, arguments.length) }, wrapAll: function (a) { if (p.isFunction(a)) return this.each(function (b) { p(this).wrapAll(a.call(this, b)) }); if (this[0]) { var b = p(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstChild && a.firstChild.nodeType === 1) a = a.firstChild; return a }).append(this) } return this }, wrapInner: function (a) { return p.isFunction(a) ? this.each(function (b) { p(this).wrapInner(a.call(this, b)) }) : this.each(function () { var b = p(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = p.isFunction(a); return this.each(function (c) { p(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { p.nodeName(this, "body") || p(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (a) { (this.nodeType === 1 || this.nodeType === 11) && this.appendChild(a) }) }, prepend: function () { return this.domManip(arguments, !0, function (a) { (this.nodeType === 1 || this.nodeType === 11) && this.insertBefore(a, this.firstChild) }) }, before: function () { if (!bh(this[0])) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this) }); if (arguments.length) { var a = p.clean(arguments); return this.pushStack(p.merge(a, this), "before", this.selector) } }, after: function () { if (!bh(this[0])) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this.nextSibling) }); if (arguments.length) { var a = p.clean(arguments); return this.pushStack(p.merge(this, a), "after", this.selector) } }, remove: function (a, b) { var c, d = 0; for (; (c = this[d]) != null; d++) if (!a || p.filter(a, [c]).length) !b && c.nodeType === 1 && (p.cleanData(c.getElementsByTagName("*")), p.cleanData([c])), c.parentNode && c.parentNode.removeChild(c); return this }, empty: function () { var a, b = 0; for (; (a = this[b]) != null; b++) { a.nodeType === 1 && p.cleanData(a.getElementsByTagName("*")); while (a.firstChild) a.removeChild(a.firstChild) } return this }, clone: function (a, b) { return a = a == null ? !1 : a, b = b == null ? a : b, this.map(function () { return p.clone(this, a, b) }) }, html: function (a) { return p.access(this, function (a) { var c = this[0] || {}, d = 0, e = this.length; if (a === b) return c.nodeType === 1 ? c.innerHTML.replace(bm, "") : b; if (typeof a == "string" && !bs.test(a) && (p.support.htmlSerialize || !bu.test(a)) && (p.support.leadingWhitespace || !bn.test(a)) && !bz[(bp.exec(a) || ["", ""])[1].toLowerCase()]) { a = a.replace(bo, "<$1>"); try { for (; d < e; d++) c = this[d] || {}, c.nodeType === 1 && (p.cleanData(c.getElementsByTagName("*")), c.innerHTML = a); c = 0 } catch (f) { } } c && this.empty().append(a) }, null, a, arguments.length) }, replaceWith: function (a) { return bh(this[0]) ? this.length ? this.pushStack(p(p.isFunction(a) ? a() : a), "replaceWith", a) : this : p.isFunction(a) ? this.each(function (b) { var c = p(this), d = c.html(); c.replaceWith(a.call(this, b, d)) }) : (typeof a != "string" && (a = p(a).detach()), this.each(function () { var b = this.nextSibling, c = this.parentNode; p(this).remove(), b ? p(b).before(a) : p(c).append(a) })) }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, c, d) { a = [].concat.apply([], a); var e, f, g, h, i = 0, j = a[0], k = [], l = this.length; if (!p.support.checkClone && l > 1 && typeof j == "string" && bw.test(j)) return this.each(function () { p(this).domManip(a, c, d) }); if (p.isFunction(j)) return this.each(function (e) { var f = p(this); a[0] = j.call(this, e, c ? f.html() : b), f.domManip(a, c, d) }); if (this[0]) { e = p.buildFragment(a, this, k), g = e.fragment, f = g.firstChild, g.childNodes.length === 1 && (g = f); if (f) { c = c && p.nodeName(f, "tr"); for (h = e.cacheable || l - 1; i < l; i++) d.call(c && p.nodeName(this[i], "table") ? bC(this[i], "tbody") : this[i], i === h ? g : p.clone(g, !0, !0)) } g = f = null, k.length && p.each(k, function (a, b) { b.src ? p.ajax ? p.ajax({ url: b.src, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) : p.error("no ajax") : p.globalEval((b.text || b.textContent || b.innerHTML || "").replace(by, "")), b.parentNode && b.parentNode.removeChild(b) }) } return this } }), p.buildFragment = function (a, c, d) { var f, g, h, i = a[0]; return c = c || e, c = !c.nodeType && c[0] || c, c = c.ownerDocument || c, a.length === 1 && typeof i == "string" && i.length < 512 && c === e && i.charAt(0) === "<" && !bt.test(i) && (p.support.checkClone || !bw.test(i)) && (p.support.html5Clone || !bu.test(i)) && (g = !0, f = p.fragments[i], h = f !== b), f || (f = c.createDocumentFragment(), p.clean(a, c, f, d), g && (p.fragments[i] = h && f)), { fragment: f, cacheable: g} }, p.fragments = {}, p.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { p.fn[a] = function (c) { var d, e = 0, f = [], g = p(c), h = g.length, i = this.length === 1 && this[0].parentNode; if ((i == null || i && i.nodeType === 11 && i.childNodes.length === 1) && h === 1) return g[b](this[0]), this; for (; e < h; e++) d = (e > 0 ? this.clone(!0) : this).get(), p(g[e])[b](d), f = f.concat(d); return this.pushStack(f, a, g.selector) } }), p.extend({ clone: function (a, b, c) { var d, e, f, g; p.support.html5Clone || p.isXMLDoc(a) || !bu.test("<" + a.nodeName + ">") ? g = a.cloneNode(!0) : (bB.innerHTML = a.outerHTML, bB.removeChild(g = bB.firstChild)); if ((!p.support.noCloneEvent || !p.support.noCloneChecked) && (a.nodeType === 1 || a.nodeType === 11) && !p.isXMLDoc(a)) { bE(a, g), d = bF(a), e = bF(g); for (f = 0; d[f]; ++f) e[f] && bE(d[f], e[f]) } if (b) { bD(a, g); if (c) { d = bF(a), e = bF(g); for (f = 0; d[f]; ++f) bD(d[f], e[f]) } } return d = e = null, g }, clean: function (a, b, c, d) { var f, g, h, i, j, k, l, m, n, o, q, r, s = b === e && bA, t = []; if (!b || typeof b.createDocumentFragment == "undefined") b = e; for (f = 0; (h = a[f]) != null; f++) { typeof h == "number" && (h += ""); if (!h) continue; if (typeof h == "string") if (!br.test(h)) h = b.createTextNode(h); else { s = s || bk(b), l = b.createElement("div"), s.appendChild(l), h = h.replace(bo, "<$1>"), i = (bp.exec(h) || ["", ""])[1].toLowerCase(), j = bz[i] || bz._default, k = j[0], l.innerHTML = j[1] + h + j[2]; while (k--) l = l.lastChild; if (!p.support.tbody) { m = bq.test(h), n = i === "table" && !m ? l.firstChild && l.firstChild.childNodes : j[1] === "" && !m ? l.childNodes : []; for (g = n.length - 1; g >= 0; --g) p.nodeName(n[g], "tbody") && !n[g].childNodes.length && n[g].parentNode.removeChild(n[g]) } !p.support.leadingWhitespace && bn.test(h) && l.insertBefore(b.createTextNode(bn.exec(h)[0]), l.firstChild), h = l.childNodes, l.parentNode.removeChild(l) } h.nodeType ? t.push(h) : p.merge(t, h) } l && (h = l = s = null); if (!p.support.appendChecked) for (f = 0; (h = t[f]) != null; f++) p.nodeName(h, "input") ? bG(h) : typeof h.getElementsByTagName != "undefined" && p.grep(h.getElementsByTagName("input"), bG); if (c) { q = function (a) { if (!a.type || bx.test(a.type)) return d ? d.push(a.parentNode ? a.parentNode.removeChild(a) : a) : c.appendChild(a) }; for (f = 0; (h = t[f]) != null; f++) if (!p.nodeName(h, "script") || !q(h)) c.appendChild(h), typeof h.getElementsByTagName != "undefined" && (r = p.grep(p.merge([], h.getElementsByTagName("script")), q), t.splice.apply(t, [f + 1, 0].concat(r)), f += r.length) } return t }, cleanData: function (a, b) { var c, d, e, f, g = 0, h = p.expando, i = p.cache, j = p.support.deleteExpando, k = p.event.special; for (; (e = a[g]) != null; g++) if (b || p.acceptData(e)) { d = e[h], c = d && i[d]; if (c) { if (c.events) for (f in c.events) k[f] ? p.event.remove(e, f) : p.removeEvent(e, f, c.handle); i[d] && (delete i[d], j ? delete e[h] : e.removeAttribute ? e.removeAttribute(h) : e[h] = null, p.deletedIds.push(d)) } } } }), function () { var a, b; p.uaMatch = function (a) { a = a.toLowerCase(); var b = /(chrome)[ \/]([\w.]+)/.exec(a) || /(webkit)[ \/]([\w.]+)/.exec(a) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a) || /(msie) ([\w.]+)/.exec(a) || a.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a) || []; return { browser: b[1] || "", version: b[2] || "0"} }, a = p.uaMatch(g.userAgent), b = {}, a.browser && (b[a.browser] = !0, b.version = a.version), b.chrome ? b.webkit = !0 : b.webkit && (b.safari = !0), p.browser = b, p.sub = function () { function a(b, c) { return new a.fn.init(b, c) } p.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function c(c, d) { return d && d instanceof p && !(d instanceof a) && (d = a(d)), p.fn.init.call(this, c, d, b) }, a.fn.init.prototype = a.fn; var b = a(e); return a } } (); var bH, bI, bJ, bK = /alpha\([^)]*\)/i, bL = /opacity=([^)]*)/, bM = /^(top|right|bottom|left)$/, bN = /^(none|table(?!-c[ea]).+)/, bO = /^margin/, bP = new RegExp("^(" + q + ")(.*)$", "i"), bQ = new RegExp("^(" + q + ")(?!px)[a-z%]+$", "i"), bR = new RegExp("^([-+])=(" + q + ")", "i"), bS = {}, bT = { position: "absolute", visibility: "hidden", display: "block" }, bU = { letterSpacing: 0, fontWeight: 400 }, bV = ["Top", "Right", "Bottom", "Left"], bW = ["Webkit", "O", "Moz", "ms"], bX = p.fn.toggle; p.fn.extend({ css: function (a, c) { return p.access(this, function (a, c, d) { return d !== b ? p.style(a, c, d) : p.css(a, c) }, a, c, arguments.length > 1) }, show: function () { return b$(this, !0) }, hide: function () { return b$(this) }, toggle: function (a, b) { var c = typeof a == "boolean"; return p.isFunction(a) && p.isFunction(b) ? bX.apply(this, arguments) : this.each(function () { (c ? a : bZ(this)) ? p(this).show() : p(this).hide() }) } }), p.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = bH(a, "opacity"); return c === "" ? "1" : c } } } }, cssNumber: { fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": p.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, d, e) { if (!a || a.nodeType === 3 || a.nodeType === 8 || !a.style) return; var f, g, h, i = p.camelCase(c), j = a.style; c = p.cssProps[i] || (p.cssProps[i] = bY(j, i)), h = p.cssHooks[c] || p.cssHooks[i]; if (d === b) return h && "get" in h && (f = h.get(a, !1, e)) !== b ? f : j[c]; g = typeof d, g === "string" && (f = bR.exec(d)) && (d = (f[1] + 1) * f[2] + parseFloat(p.css(a, c)), g = "number"); if (d == null || g === "number" && isNaN(d)) return; g === "number" && !p.cssNumber[i] && (d += "px"); if (!h || !("set" in h) || (d = h.set(a, d, e)) !== b) try { j[c] = d } catch (k) { } }, css: function (a, c, d, e) { var f, g, h, i = p.camelCase(c); return c = p.cssProps[i] || (p.cssProps[i] = bY(a.style, i)), h = p.cssHooks[c] || p.cssHooks[i], h && "get" in h && (f = h.get(a, !0, e)), f === b && (f = bH(a, c)), f === "normal" && c in bU && (f = bU[c]), d || e !== b ? (g = parseFloat(f), d || p.isNumeric(g) ? g || 0 : f) : f }, swap: function (a, b, c) { var d, e, f = {}; for (e in b) f[e] = a.style[e], a.style[e] = b[e]; d = c.call(a); for (e in b) a.style[e] = f[e]; return d } }), a.getComputedStyle ? bH = function (b, c) { var d, e, f, g, h = a.getComputedStyle(b, null), i = b.style; return h && (d = h[c], d === "" && !p.contains(b.ownerDocument, b) && (d = p.style(b, c)), bQ.test(d) && bO.test(c) && (e = i.width, f = i.minWidth, g = i.maxWidth, i.minWidth = i.maxWidth = i.width = d, d = h.width, i.width = e, i.minWidth = f, i.maxWidth = g)), d } : e.documentElement.currentStyle && (bH = function (a, b) { var c, d, e = a.currentStyle && a.currentStyle[b], f = a.style; return e == null && f && f[b] && (e = f[b]), bQ.test(e) && !bM.test(b) && (c = f.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), f.left = b === "fontSize" ? "1em" : e, e = f.pixelLeft + "px", f.left = c, d && (a.runtimeStyle.left = d)), e === "" ? "auto" : e }), p.each(["height", "width"], function (a, b) { p.cssHooks[b] = { get: function (a, c, d) { if (c) return a.offsetWidth === 0 && bN.test(bH(a, "display")) ? p.swap(a, bT, function () { return cb(a, b, d) }) : cb(a, b, d) }, set: function (a, c, d) { return b_(a, c, d ? ca(a, b, d, p.support.boxSizing && p.css(a, "boxSizing") === "border-box") : 0) } } }), p.support.opacity || (p.cssHooks.opacity = { get: function (a, b) { return bL.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : "" }, set: function (a, b) { var c = a.style, d = a.currentStyle, e = p.isNumeric(b) ? "alpha(opacity=" + b * 100 + ")" : "", f = d && d.filter || c.filter || ""; c.zoom = 1; if (b >= 1 && p.trim(f.replace(bK, "")) === "" && c.removeAttribute) { c.removeAttribute("filter"); if (d && !d.filter) return } c.filter = bK.test(f) ? f.replace(bK, e) : f + " " + e } }), p(function () { p.support.reliableMarginRight || (p.cssHooks.marginRight = { get: function (a, b) { return p.swap(a, { display: "inline-block" }, function () { if (b) return bH(a, "marginRight") }) } }), !p.support.pixelPosition && p.fn.position && p.each(["top", "left"], function (a, b) { p.cssHooks[b] = { get: function (a, c) { if (c) { var d = bH(a, b); return bQ.test(d) ? p(a).position()[b] + "px" : d } } } }) }), p.expr && p.expr.filters && (p.expr.filters.hidden = function (a) { return a.offsetWidth === 0 && a.offsetHeight === 0 || !p.support.reliableHiddenOffsets && (a.style && a.style.display || bH(a, "display")) === "none" }, p.expr.filters.visible = function (a) { return !p.expr.filters.hidden(a) }), p.each({ margin: "", padding: "", border: "Width" }, function (a, b) { p.cssHooks[a + b] = { expand: function (c) { var d, e = typeof c == "string" ? c.split(" ") : [c], f = {}; for (d = 0; d < 4; d++) f[a + bV[d] + b] = e[d] || e[d - 2] || e[0]; return f } }, bO.test(a) || (p.cssHooks[a + b].set = b_) }); var cd = /%20/g, ce = /\[\]$/, cf = /\r?\n/g, cg = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, ch = /^(?:select|textarea)/i; p.fn.extend({ serialize: function () { return p.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { return this.elements ? p.makeArray(this.elements) : this }).filter(function () { return this.name && !this.disabled && (this.checked || ch.test(this.nodeName) || cg.test(this.type)) }).map(function (a, b) { var c = p(this).val(); return c == null ? null : p.isArray(c) ? p.map(c, function (a, c) { return { name: b.name, value: a.replace(cf, "\r\n")} }) : { name: b.name, value: c.replace(cf, "\r\n")} }).get() } }), p.param = function (a, c) { var d, e = [], f = function (a, b) { b = p.isFunction(b) ? b() : b == null ? "" : b, e[e.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; c === b && (c = p.ajaxSettings && p.ajaxSettings.traditional); if (p.isArray(a) || a.jquery && !p.isPlainObject(a)) p.each(a, function () { f(this.name, this.value) }); else for (d in a) ci(d, a[d], c, f); return e.join("&").replace(cd, "+") }; var cj, ck, cl = /#.*$/, cm = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, cn = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, co = /^(?:GET|HEAD)$/, cp = /^\/\//, cq = /\?/, cr = /)<[^<]*)*<\/script>/gi, cs = /([?&])_=[^&]*/, ct = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, cu = p.fn.load, cv = {}, cw = {}, cx = ["*/"] + ["*"]; try { ck = f.href } catch (cy) { ck = e.createElement("a"), ck.href = "", ck = ck.href } cj = ct.exec(ck.toLowerCase()) || [], p.fn.load = function (a, c, d) { if (typeof a != "string" && cu) return cu.apply(this, arguments); if (!this.length) return this; var e, f, g, h = this, i = a.indexOf(" "); return i >= 0 && (e = a.slice(i, a.length), a = a.slice(0, i)), p.isFunction(c) ? (d = c, c = b) : c && typeof c == "object" && (f = "POST"), p.ajax({ url: a, type: f, dataType: "html", data: c, complete: function (a, b) { d && h.each(d, g || [a.responseText, b, a]) } }).done(function (a) { g = arguments, h.html(e ? p("
    ").append(a.replace(cr, "")).find(e) : a) }), this }, p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (a, b) { p.fn[b] = function (a) { return this.on(b, a) } }), p.each(["get", "post"], function (a, c) { p[c] = function (a, d, e, f) { return p.isFunction(d) && (f = f || e, e = d, d = b), p.ajax({ type: c, url: a, data: d, success: e, dataType: f }) } }), p.extend({ getScript: function (a, c) { return p.get(a, b, c, "script") }, getJSON: function (a, b, c) { return p.get(a, b, c, "json") }, ajaxSetup: function (a, b) { return b ? cB(a, p.ajaxSettings) : (b = a, a = p.ajaxSettings), cB(a, b), a }, ajaxSettings: { url: ck, isLocal: cn.test(cj[1]), global: !0, type: "GET", contentType: "application/x-www-form-urlencoded; charset=UTF-8", processData: !0, async: !0, accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": cx }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": a.String, "text html": !0, "text json": p.parseJSON, "text xml": p.parseXML }, flatOptions: { context: !0, url: !0} }, ajaxPrefilter: cz(cv), ajaxTransport: cz(cw), ajax: function (a, c) { function y(a, c, f, i) { var k, s, t, u, w, y = c; if (v === 2) return; v = 2, h && clearTimeout(h), g = b, e = i || "", x.readyState = a > 0 ? 4 : 0, f && (u = cC(l, x, f)); if (a >= 200 && a < 300 || a === 304) l.ifModified && (w = x.getResponseHeader("Last-Modified"), w && (p.lastModified[d] = w), w = x.getResponseHeader("Etag"), w && (p.etag[d] = w)), a === 304 ? (y = "notmodified", k = !0) : (k = cD(l, u), y = k.state, s = k.data, t = k.error, k = !t); else { t = y; if (!y || a) y = "error", a < 0 && (a = 0) } x.status = a, x.statusText = (c || y) + "", k ? o.resolveWith(m, [s, y, x]) : o.rejectWith(m, [x, y, t]), x.statusCode(r), r = b, j && n.trigger("ajax" + (k ? "Success" : "Error"), [x, l, k ? s : t]), q.fireWith(m, [x, y]), j && (n.trigger("ajaxComplete", [x, l]), --p.active || p.event.trigger("ajaxStop")) } typeof a == "object" && (c = a, a = b), c = c || {}; var d, e, f, g, h, i, j, k, l = p.ajaxSetup({}, c), m = l.context || l, n = m !== l && (m.nodeType || m instanceof p) ? p(m) : p.event, o = p.Deferred(), q = p.Callbacks("once memory"), r = l.statusCode || {}, t = {}, u = {}, v = 0, w = "canceled", x = { readyState: 0, setRequestHeader: function (a, b) { if (!v) { var c = a.toLowerCase(); a = u[c] = u[c] || a, t[a] = b } return this }, getAllResponseHeaders: function () { return v === 2 ? e : null }, getResponseHeader: function (a) { var c; if (v === 2) { if (!f) { f = {}; while (c = cm.exec(e)) f[c[1].toLowerCase()] = c[2] } c = f[a.toLowerCase()] } return c === b ? null : c }, overrideMimeType: function (a) { return v || (l.mimeType = a), this }, abort: function (a) { return a = a || w, g && g.abort(a), y(0, a), this } }; o.promise(x), x.success = x.done, x.error = x.fail, x.complete = q.add, x.statusCode = function (a) { if (a) { var b; if (v < 2) for (b in a) r[b] = [r[b], a[b]]; else b = a[x.status], x.always(b) } return this }, l.url = ((a || l.url) + "").replace(cl, "").replace(cp, cj[1] + "//"), l.dataTypes = p.trim(l.dataType || "*").toLowerCase().split(s), l.crossDomain == null && (i = ct.exec(l.url.toLowerCase()) || !1, l.crossDomain = i && i.join(":") + (i[3] ? "" : i[1] === "http:" ? 80 : 443) !== cj.join(":") + (cj[3] ? "" : cj[1] === "http:" ? 80 : 443)), l.data && l.processData && typeof l.data != "string" && (l.data = p.param(l.data, l.traditional)), cA(cv, l, c, x); if (v === 2) return x; j = l.global, l.type = l.type.toUpperCase(), l.hasContent = !co.test(l.type), j && p.active++ === 0 && p.event.trigger("ajaxStart"); if (!l.hasContent) { l.data && (l.url += (cq.test(l.url) ? "&" : "?") + l.data, delete l.data), d = l.url; if (l.cache === !1) { var z = p.now(), A = l.url.replace(cs, "$1_=" + z); l.url = A + (A === l.url ? (cq.test(l.url) ? "&" : "?") + "_=" + z : "") } } (l.data && l.hasContent && l.contentType !== !1 || c.contentType) && x.setRequestHeader("Content-Type", l.contentType), l.ifModified && (d = d || l.url, p.lastModified[d] && x.setRequestHeader("If-Modified-Since", p.lastModified[d]), p.etag[d] && x.setRequestHeader("If-None-Match", p.etag[d])), x.setRequestHeader("Accept", l.dataTypes[0] && l.accepts[l.dataTypes[0]] ? l.accepts[l.dataTypes[0]] + (l.dataTypes[0] !== "*" ? ", " + cx + "; q=0.01" : "") : l.accepts["*"]); for (k in l.headers) x.setRequestHeader(k, l.headers[k]); if (!l.beforeSend || l.beforeSend.call(m, x, l) !== !1 && v !== 2) { w = "abort"; for (k in { success: 1, error: 1, complete: 1 }) x[k](l[k]); g = cA(cw, l, c, x); if (!g) y(-1, "No Transport"); else { x.readyState = 1, j && n.trigger("ajaxSend", [x, l]), l.async && l.timeout > 0 && (h = setTimeout(function () { x.abort("timeout") }, l.timeout)); try { v = 1, g.send(t, y) } catch (B) { if (v < 2) y(-1, B); else throw B } } return x } return x.abort() }, active: 0, lastModified: {}, etag: {} }); var cE = [], cF = /\?/, cG = /(=)\?(?=&|$)|\?\?/, cH = p.now(); p.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var a = cE.pop() || p.expando + "_" + cH++; return this[a] = !0, a } }), p.ajaxPrefilter("json jsonp", function (c, d, e) { var f, g, h, i = c.data, j = c.url, k = c.jsonp !== !1, l = k && cG.test(j), m = k && !l && typeof i == "string" && !(c.contentType || "").indexOf("application/x-www-form-urlencoded") && cG.test(i); if (c.dataTypes[0] === "jsonp" || l || m) return f = c.jsonpCallback = p.isFunction(c.jsonpCallback) ? c.jsonpCallback() : c.jsonpCallback, g = a[f], l ? c.url = j.replace(cG, "$1" + f) : m ? c.data = i.replace(cG, "$1" + f) : k && (c.url += (cF.test(j) ? "&" : "?") + c.jsonp + "=" + f), c.converters["script json"] = function () { return h || p.error(f + " was not called"), h[0] }, c.dataTypes[0] = "json", a[f] = function () { h = arguments }, e.always(function () { a[f] = g, c[f] && (c.jsonpCallback = d.jsonpCallback, cE.push(f)), h && p.isFunction(g) && g(h[0]), h = g = b }), "script" }), p.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function (a) { return p.globalEval(a), a } } }), p.ajaxPrefilter("script", function (a) { a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1) }), p.ajaxTransport("script", function (a) { if (a.crossDomain) { var c, d = e.head || e.getElementsByTagName("head")[0] || e.documentElement; return { send: function (f, g) { c = e.createElement("script"), c.async = "async", a.scriptCharset && (c.charset = a.scriptCharset), c.src = a.url, c.onload = c.onreadystatechange = function (a, e) { if (e || !c.readyState || /loaded|complete/.test(c.readyState)) c.onload = c.onreadystatechange = null, d && c.parentNode && d.removeChild(c), c = b, e || g(200, "success") }, d.insertBefore(c, d.firstChild) }, abort: function () { c && c.onload(0, 1) } } } }); var cI, cJ = a.ActiveXObject ? function () { for (var a in cI) cI[a](0, 1) } : !1, cK = 0; p.ajaxSettings.xhr = a.ActiveXObject ? function () { return !this.isLocal && cL() || cM() } : cL, function (a) { p.extend(p.support, { ajax: !!a, cors: !!a && "withCredentials" in a }) } (p.ajaxSettings.xhr()), p.support.ajax && p.ajaxTransport(function (c) { if (!c.crossDomain || p.support.cors) { var d; return { send: function (e, f) { var g, h, i = c.xhr(); c.username ? i.open(c.type, c.url, c.async, c.username, c.password) : i.open(c.type, c.url, c.async); if (c.xhrFields) for (h in c.xhrFields) i[h] = c.xhrFields[h]; c.mimeType && i.overrideMimeType && i.overrideMimeType(c.mimeType), !c.crossDomain && !e["X-Requested-With"] && (e["X-Requested-With"] = "XMLHttpRequest"); try { for (h in e) i.setRequestHeader(h, e[h]) } catch (j) { } i.send(c.hasContent && c.data || null), d = function (a, e) { var h, j, k, l, m; try { if (d && (e || i.readyState === 4)) { d = b, g && (i.onreadystatechange = p.noop, cJ && delete cI[g]); if (e) i.readyState !== 4 && i.abort(); else { h = i.status, k = i.getAllResponseHeaders(), l = {}, m = i.responseXML, m && m.documentElement && (l.xml = m); try { l.text = i.responseText } catch (a) { } try { j = i.statusText } catch (n) { j = "" } !h && c.isLocal && !c.crossDomain ? h = l.text ? 200 : 404 : h === 1223 && (h = 204) } } } catch (o) { e || f(-1, o) } l && f(h, j, l, k) }, c.async ? i.readyState === 4 ? setTimeout(d, 0) : (g = ++cK, cJ && (cI || (cI = {}, p(a).unload(cJ)), cI[g] = d), i.onreadystatechange = d) : d() }, abort: function () { d && d(0, 1) } } } }); var cN, cO, cP = /^(?:toggle|show|hide)$/, cQ = new RegExp("^(?:([-+])=|)(" + q + ")([a-z%]*)$", "i"), cR = /queueHooks$/, cS = [cY], cT = { "*": [function (a, b) { var c, d, e = this.createTween(a, b), f = cQ.exec(b), g = e.cur(), h = +g || 0, i = 1, j = 20; if (f) { c = +f[2], d = f[3] || (p.cssNumber[a] ? "" : "px"); if (d !== "px" && h) { h = p.css(e.elem, a, !0) || c || 1; do i = i || ".5", h = h / i, p.style(e.elem, a, h + d); while (i !== (i = e.cur() / g) && i !== 1 && --j) } e.unit = d, e.start = h, e.end = f[1] ? h + (f[1] + 1) * c : c } return e } ] }; p.Animation = p.extend(cW, { tweener: function (a, b) { p.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" "); var c, d = 0, e = a.length; for (; d < e; d++) c = a[d], cT[c] = cT[c] || [], cT[c].unshift(b) }, prefilter: function (a, b) { b ? cS.unshift(a) : cS.push(a) } }), p.Tween = cZ, cZ.prototype = { constructor: cZ, init: function (a, b, c, d, e, f) { this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (p.cssNumber[c] ? "" : "px") }, cur: function () { var a = cZ.propHooks[this.prop]; return a && a.get ? a.get(this) : cZ.propHooks._default.get(this) }, run: function (a) { var b, c = cZ.propHooks[this.prop]; return this.options.duration ? this.pos = b = p.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : cZ.propHooks._default.set(this), this } }, cZ.prototype.init.prototype = cZ.prototype, cZ.propHooks = { _default: { get: function (a) { var b; return a.elem[a.prop] == null || !!a.elem.style && a.elem.style[a.prop] != null ? (b = p.css(a.elem, a.prop, !1, ""), !b || b === "auto" ? 0 : b) : a.elem[a.prop] }, set: function (a) { p.fx.step[a.prop] ? p.fx.step[a.prop](a) : a.elem.style && (a.elem.style[p.cssProps[a.prop]] != null || p.cssHooks[a.prop]) ? p.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now } } }, cZ.propHooks.scrollTop = cZ.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }, p.each(["toggle", "show", "hide"], function (a, b) { var c = p.fn[b]; p.fn[b] = function (d, e, f) { return d == null || typeof d == "boolean" || !a && p.isFunction(d) && p.isFunction(e) ? c.apply(this, arguments) : this.animate(c$(b, !0), d, e, f) } }), p.fn.extend({ fadeTo: function (a, b, c, d) { return this.filter(bZ).css("opacity", 0).show().end().animate({ opacity: b }, a, c, d) }, animate: function (a, b, c, d) { var e = p.isEmptyObject(a), f = p.speed(b, c, d), g = function () { var b = cW(this, p.extend({}, a), f); e && b.stop(!0) }; return e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) }, stop: function (a, c, d) { var e = function (a) { var b = a.stop; delete a.stop, b(d) }; return typeof a != "string" && (d = c, c = a, a = b), c && a !== !1 && this.queue(a || "fx", []), this.each(function () { var b = !0, c = a != null && a + "queueHooks", f = p.timers, g = p._data(this); if (c) g[c] && g[c].stop && e(g[c]); else for (c in g) g[c] && g[c].stop && cR.test(c) && e(g[c]); for (c = f.length; c--; ) f[c].elem === this && (a == null || f[c].queue === a) && (f[c].anim.stop(d), b = !1, f.splice(c, 1)); (b || !d) && p.dequeue(this, a) }) } }), p.each({ slideDown: c$("show"), slideUp: c$("hide"), slideToggle: c$("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle"} }, function (a, b) { p.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), p.speed = function (a, b, c) { var d = a && typeof a == "object" ? p.extend({}, a) : { complete: c || !c && b || p.isFunction(a) && a, duration: a, easing: c && b || b && !p.isFunction(b) && b }; d.duration = p.fx.off ? 0 : typeof d.duration == "number" ? d.duration : d.duration in p.fx.speeds ? p.fx.speeds[d.duration] : p.fx.speeds._default; if (d.queue == null || d.queue === !0) d.queue = "fx"; return d.old = d.complete, d.complete = function () { p.isFunction(d.old) && d.old.call(this), d.queue && p.dequeue(this, d.queue) }, d }, p.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }, p.timers = [], p.fx = cZ.prototype.init, p.fx.tick = function () { var a, b = p.timers, c = 0; for (; c < b.length; c++) a = b[c], !a() && b[c] === a && b.splice(c--, 1); b.length || p.fx.stop() }, p.fx.timer = function (a) { a() && p.timers.push(a) && !cO && (cO = setInterval(p.fx.tick, p.fx.interval)) }, p.fx.interval = 13, p.fx.stop = function () { clearInterval(cO), cO = null }, p.fx.speeds = { slow: 600, fast: 200, _default: 400 }, p.fx.step = {}, p.expr && p.expr.filters && (p.expr.filters.animated = function (a) { return p.grep(p.timers, function (b) { return a === b.elem }).length }); var c_ = /^(?:body|html)$/i; p.fn.offset = function (a) { if (arguments.length) return a === b ? this : this.each(function (b) { p.offset.setOffset(this, a, b) }); var c, d, e, f, g, h, i, j = { top: 0, left: 0 }, k = this[0], l = k && k.ownerDocument; if (!l) return; return (d = l.body) === k ? p.offset.bodyOffset(k) : (c = l.documentElement, p.contains(c, k) ? (typeof k.getBoundingClientRect != "undefined" && (j = k.getBoundingClientRect()), e = da(l), f = c.clientTop || d.clientTop || 0, g = c.clientLeft || d.clientLeft || 0, h = e.pageYOffset || c.scrollTop, i = e.pageXOffset || c.scrollLeft, { top: j.top + h - f, left: j.left + i - g }) : j) }, p.offset = { bodyOffset: function (a) { var b = a.offsetTop, c = a.offsetLeft; return p.support.doesNotIncludeMarginInBodyOffset && (b += parseFloat(p.css(a, "marginTop")) || 0, c += parseFloat(p.css(a, "marginLeft")) || 0), { top: b, left: c} }, setOffset: function (a, b, c) { var d = p.css(a, "position"); d === "static" && (a.style.position = "relative"); var e = p(a), f = e.offset(), g = p.css(a, "top"), h = p.css(a, "left"), i = (d === "absolute" || d === "fixed") && p.inArray("auto", [g, h]) > -1, j = {}, k = {}, l, m; i ? (k = e.position(), l = k.top, m = k.left) : (l = parseFloat(g) || 0, m = parseFloat(h) || 0), p.isFunction(b) && (b = b.call(a, c, f)), b.top != null && (j.top = b.top - f.top + l), b.left != null && (j.left = b.left - f.left + m), "using" in b ? b.using.call(a, j) : e.css(j) } }, p.fn.extend({ position: function () { if (!this[0]) return; var a = this[0], b = this.offsetParent(), c = this.offset(), d = c_.test(b[0].nodeName) ? { top: 0, left: 0} : b.offset(); return c.top -= parseFloat(p.css(a, "marginTop")) || 0, c.left -= parseFloat(p.css(a, "marginLeft")) || 0, d.top += parseFloat(p.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat(p.css(b[0], "borderLeftWidth")) || 0, { top: c.top - d.top, left: c.left - d.left} }, offsetParent: function () { return this.map(function () { var a = this.offsetParent || e.body; while (a && !c_.test(a.nodeName) && p.css(a, "position") === "static") a = a.offsetParent; return a || e.body }) } }), p.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (a, c) { var d = /Y/.test(c); p.fn[a] = function (e) { return p.access(this, function (a, e, f) { var g = da(a); if (f === b) return g ? c in g ? g[c] : g.document.documentElement[e] : a[e]; g ? g.scrollTo(d ? p(g).scrollLeft() : f, d ? f : p(g).scrollTop()) : a[e] = f }, a, e, arguments.length, null) } }), p.each({ Height: "height", Width: "width" }, function (a, c) { p.each({ padding: "inner" + a, content: c, "": "outer" + a }, function (d, e) { p.fn[e] = function (e, f) { var g = arguments.length && (d || typeof e != "boolean"), h = d || (e === !0 || f === !0 ? "margin" : "border"); return p.access(this, function (c, d, e) { var f; return p.isWindow(c) ? c.document.documentElement["client" + a] : c.nodeType === 9 ? (f = c.documentElement, Math.max(c.body["scroll" + a], f["scroll" + a], c.body["offset" + a], f["offset" + a], f["client" + a])) : e === b ? p.css(c, d, e, h) : p.style(c, d, e, h) }, c, g ? e : b, g, null) } }) }), a.jQuery = a.$ = p, typeof define == "function" && define.amd && define.amd.jQuery && define("jquery", [], function () { return p }) })(window); \ No newline at end of file diff --git a/jquery.rdfquery.core.min-1.0.js b/jquery.rdfquery.core.min-1.0.js new file mode 100644 index 0000000..3e252a3 --- /dev/null +++ b/jquery.rdfquery.core.min-1.0.js @@ -0,0 +1 @@ +(function(c){var d={},a=/^(([a-z][\-a-z0-9+\.]*):)?(\/\/([^\/?#]+))?([^?#]*)?(\?([^#]*))?(#(.*))?$/i,g,b=function(i){var h=i.match(a);if(h===null){throw"Malformed URI: "+i}return{scheme:h[1]?h[2].toLowerCase():undefined,authority:h[3]?h[4]:undefined,path:h[5]||"",query:h[6]?h[7]:undefined,fragment:h[8]?h[9]:undefined}},f=function(i){var j="",h=[];if(/\./.test(i)){while(i!==undefined&&i!==""){if(i==="."||i===".."){i=""}else{if(/^\.\.\//.test(i)){i=i.substring(3)}else{if(/^\.\//.test(i)){i=i.substring(2)}else{if(/^\/\.(\/|$)/.test(i)){i="/"+i.substring(3)}else{if(/^\/\.\.(\/|$)/.test(i)){i="/"+i.substring(4);j=j.replace(/\/?[^\/]+$/,"")}else{h=i.match(/^(\/?[^\/]*)(\/.*)?$/);i=h[2];j=j+h[1]}}}}}}return j}else{return i}},e=function(h,i){if(h.authority!==""&&(h.path===undefined||h.path==="")){return"/"+i}else{return h.path.replace(/[^\/]+$/,"")+i}};c.uri=function(j,i){var h;j=j||"";if(d[j]){return d[j]}i=i||c.uri.base();if(typeof i==="string"){i=c.uri.absolute(i)}h=new c.uri.fn.init(j,i);if(d[h]){return d[h]}else{d[h]=h;return h}};c.uri.fn=c.uri.prototype={scheme:undefined,authority:undefined,path:undefined,query:undefined,fragment:undefined,init:function(j,i){var h={};i=i||{};c.extend(this,b(j));if(this.scheme===undefined){this.scheme=i.scheme;if(this.authority!==undefined){this.path=f(this.path)}else{this.authority=i.authority;if(this.path===""){this.path=i.path;if(this.query===undefined){this.query=i.query}}else{if(!/^\//.test(this.path)){this.path=e(i,this.path)}this.path=f(this.path)}}}if(this.scheme===undefined){throw"Malformed URI: URI is not an absolute URI and no base supplied: "+j}return this},resolve:function(h){return c.uri(h,this)},relative:function(p){var n,o,m=0,k,l=[],h="";if(typeof p==="string"){p=c.uri(p,{})}if(p.scheme!==this.scheme||p.authority!==this.authority){return p.toString()}if(p.path!==this.path){n=p.path.split("/");o=this.path.split("/");if(n[1]!==o[1]){h=p.path}else{while(n[m]===o[m]){m+=1}k=m;for(;m]+>/.exec(k.outerHTML);n=a.exec(r);while(n!==null){h=n[1]||"";o=n[2]||n[3];if(h===""||o!==""){m[h]=b.uri(n[2]||n[3]);q=true}n=a.exec(r)}a.lastIndex=0}j=j||(k.parentNode.nodeType===1?f.parent().xmlns():{});m=q?b.extend({},j,m):j;f.data("xmlns",m)}return m}else{if(typeof h==="object"){for(c in h){if(typeof h[c]==="string"){this.xmlns(c,h[c])}}this.find("*").andSelf().removeData("xmlns");return this}else{if(m===undefined){m=f.xmlns()}return m[h]}}}else{this.find("*").andSelf().removeData("xmlns");return this.attr(l,d)}};b.fn.removeXmlns=function(e){var c,f,d;if(typeof e==="object"){if(e.length===undefined){for(f in e){if(typeof e[f]==="string"){this.removeXmlns(f)}}}else{for(d=0;d]+)/.exec(this[0].outerHTML)[1].toLowerCase()}}if(d==="?xml:namespace"){throw"XMLinHTML: Unable to get the prefix to resolve the name of this element"}c=/^(([^:]+):)?([^:]+)$/.exec(d);f=c[2]||"";e=this.xmlns(f);if(e===undefined&&f!==""){throw"MalformedQName: The prefix "+f+" is not declared"}return{namespace:e,localPart:c[3],prefix:f,name:d}}})(jQuery);(function(b){var a=function(c){return c.replace(/[ \t\n\r]+/," ").replace(/^ +/,"").replace(/ +$/,"")};b.typedValue=function(d,c){return b.typedValue.fn.init(d,c)};b.typedValue.fn=b.typedValue.prototype={representation:undefined,value:undefined,datatype:undefined,init:function(e,c){var f;if(b.typedValue.valid(e,c)){f=b.typedValue.types[c];this.representation=e;this.datatype=c;this.value=f.value(f.strip?a(e):e);return this}else{throw {name:"InvalidValue",message:e+" is not a valid "+c+" value"}}}};b.typedValue.fn.init.prototype=b.typedValue.fn;b.typedValue.types={};b.typedValue.types["http://www.w3.org/2001/XMLSchema#string"]={regex:/^.*$/,strip:false,value:function(c){return c}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#boolean"]={regex:/^(?:true|false|1|0)$/,strip:true,value:function(c){return c==="true"||c==="1"}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#decimal"]={regex:/^[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)$/,strip:true,value:function(c){return c}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#integer"]={regex:/^[\-\+]?[0-9]+$/,strip:true,value:function(c){return parseInt(c,10)}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#int"]={regex:/^[\-\+]?[0-9]+$/,strip:true,value:function(c){return parseInt(c,10)}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#float"]={regex:/^(?:[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)(?:[eE][\-\+]?[0-9]+)?|[\-\+]?INF|NaN)$/,strip:true,value:function(c){if(c==="-INF"){return -1/0}else{if(c==="INF"||c==="+INF"){return 1/0}else{return parseFloat(c)}}}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#double"]={regex:b.typedValue.types["http://www.w3.org/2001/XMLSchema#float"].regex,strip:true,value:b.typedValue.types["http://www.w3.org/2001/XMLSchema#float"].value};b.typedValue.types["http://www.w3.org/2001/XMLSchema#duration"]={regex:/^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:([0-9]+(?:\.[0-9]+))?S)?)$/,validate:function(d){var c=this.regex.exec(d);return c[2]||c[3]||c[4]||c[5]||c[6]||c[7]},strip:true,value:function(c){return c}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#dateTime"]={regex:/^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):(([0-9]{2})(\.([0-9]+))?)((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,validate:function(d){var c=this.regex.exec(d),g=parseInt(c[1],10),i=c[10]===undefined||c[10]==="Z"?"+0000":c[10].replace(/:/,""),f;if(g===0||parseInt(i,10)<-1400||parseInt(i,10)>1400){return false}try{g=g<100?Math.abs(g)+1000:g;month=parseInt(c[2],10);day=parseInt(c[3],10);if(day>31){return false}else{if(day>30&&!(month===1||month===3||month===5||month===7||month===8||month===10||month===12)){return false}else{if(month===2){if(day>29){return false}else{if(day===29&&(g%4!==0||(g%100===0&&g%400!==0))){return false}}}}}f=""+g+"/"+c[2]+"/"+c[3]+" "+c[4]+":"+c[5]+":"+c[7]+" "+i;f=new Date(f);return true}catch(h){return false}},strip:true,value:function(c){return c}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#date"]={regex:/^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,validate:function(e){var c=this.regex.exec(e),f=parseInt(c[1],10),g=parseInt(c[2],10),d=parseInt(c[3],10),h=c[10]===undefined||c[10]==="Z"?"+0000":c[10].replace(/:/,"");if(f===0||g>12||d>31||parseInt(h,10)<-1400||parseInt(h,10)>1400){return false}else{return true}},strip:true,value:function(c){return c}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#gMonthDay"]={regex:/^--([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,validate:function(e){var c=this.regex.exec(e),f=parseInt(c[1],10),d=parseInt(c[2],10),g=c[3]===undefined||c[3]==="Z"?"+0000":c[3].replace(/:/,"");if(f>12||d>31||parseInt(g,10)<-1400||parseInt(g,10)>1400){return false}else{if(f===2&&d>29){return false}else{if((f===4||f===6||f===9||f===11)&&d>30){return false}else{return true}}}},strip:true,value:function(c){return c}};b.typedValue.types["http://www.w3.org/2001/XMLSchema#anyURI"]={regex:/^.*$/,strip:true,value:function(c,d){var e=b.extend({},b.typedValue.defaults,d);return b.uri.resolve(c,e.base)}};b.typedValue.defaults={base:b.uri.base(),namespaces:{}};b.typedValue.valid=function(e,c){var f=b.typedValue.types[c];if(f===undefined){throw"InvalidDatatype: The datatype "+c+" can't be recognised"}else{e=f.strip?a(e):e;if(f.regex.test(e)){return f.validate===undefined?true:f.validate(e)}else{return false}}}})(jQuery);(function(a){a.curie=function(f,c){var g=a.extend({},a.curie.defaults,c||{}),b=/^(([^:]*):)?(.+)$/.exec(f),h=b[2],d=b[3],e=g.namespaces[h];if(/^:.+/.test(f)){if(g.reservedNamespace===undefined||g.reservedNamespace===null){throw"Malformed CURIE: No prefix and no default namespace for unprefixed CURIE "+f}else{e=g.reservedNamespace}}else{if(h){if(e===undefined){throw"Malformed CURIE: No namespace binding for "+h+" in CURIE "+f}}else{if(g.charcase==="lower"){f=f.toLowerCase()}else{if(g.charcase==="upper"){f=f.toUpperCase()}}if(g.reserved.length&&a.inArray(f,g.reserved)>=0){e=g.reservedNamespace;d=f}else{if(g.defaultNamespace===undefined||g.defaultNamespace===null){throw"Malformed CURIE: No prefix and no default namespace for unprefixed CURIE "+f}else{e=g.defaultNamespace}}}}return a.uri(e+d)};a.curie.defaults={namespaces:{},reserved:[],reservedNamespace:undefined,defaultNamespace:undefined,charcase:"preserve"};a.safeCurie=function(d,c){var b=/^\[([^\]]+)\]$/.exec(d);return b?a.curie(b[1],c):a.uri(d)};a.createCurie=function(f,b){var e=a.extend({},a.curie.defaults,b||{}),d=e.namespaces,c;f=a.uri(f).toString();if(e.reservedNamespace!==undefined&&f.substring(0,e.reservedNamespace.toString().length)===e.reservedNamespace.toString()){c=f.substring(e.reservedNamespace.toString().length);if(a.inArray(c,e.reserved)===-1){c=":"+c}}else{a.each(d,function(h,g){if(f.substring(0,g.toString().length)===g.toString()){c=h+":"+f.substring(g.toString().length);return null}})}if(c===undefined){throw"No Namespace Binding: There's no appropriate namespace binding for generating a CURIE from "+f}else{return c}};a.fn.curie=function(c,b){var d=a.extend({},a.fn.curie.defaults,{namespaces:this.xmlns()},b||{});return a.curie(c,d)};a.fn.safeCurie=function(d,b){var c=a.extend({},a.fn.curie.defaults,{namespaces:this.xmlns()},b||{});return a.safeCurie(d,c)};a.fn.createCurie=function(d,b){var c=a.extend({},a.fn.curie.defaults,{namespaces:this.xmlns()},b||{});return a.createCurie(d,c)};a.fn.curie.defaults={reserved:["alternate","appendix","bookmark","cite","chapter","contents","copyright","first","glossary","help","icon","index","last","license","meta","next","p3pv1","prev","role","section","stylesheet","subsection","start","top","up"],reservedNamespace:"http://www.w3.org/1999/xhtml/vocab#",defaultNamespace:undefined,charcase:"lower"}})(jQuery);(function(E){var f={},c={},s={},B={},q={},i="http://www.w3.org/2001/XMLSchema#",v="http://www.w3.org/1999/02/22-rdf-syntax-ns#",u="http://www.w3.org/2000/01/rdf-schema#",y=/^<(([^>]|\\>)*)>$/,S=/^("""((\\"|[^"])*)"""|"((\\"|[^"])*)")(@([a-z]+(-[a-z0-9]+)*)|\^\^(.+))?$/,g=/(("""((\\"|[^"])*)""")|("(\\"|[^"]|)*")|(<(\\>|[^>])*>)|\S)+/g,w=databankSeed=new Date().getTime()%1000,j=function(){w+=1;return"b"+w.toString(16)},J=function(){databankSeed+=1;return"data"+databankSeed.toString(16)},k=function(W,X){if(typeof W==="string"){try{return E.rdf.resource(W,X)}catch(Z){try{return E.rdf.blank(W,X)}catch(Y){throw"Bad Triple: Subject "+W+" is not a resource: "+Y}}}else{return W}},Q=function(X,W){if(X==="a"){return E.rdf.type}else{if(typeof X==="string"){try{return E.rdf.resource(X,W)}catch(Y){throw"Bad Triple: Property "+X+" is not a resource: "+Y}}else{return X}}},M=function(W,Y){if(typeof W==="string"){try{return E.rdf.resource(W,Y)}catch(aa){try{return E.rdf.blank(W,Y)}catch(Z){try{return E.rdf.literal(W,Y)}catch(X){throw"Bad Triple: Object "+W+" is not a resource or a literal "+X}}}}else{return W}},a=function(Z,X,Y){var W;if(typeof X==="string"){W=X.substring(1);if(Y[W]&&Y[W]!==Z){return null}else{Y[W]=Z;return Y}}else{if(X===Z){return Y}else{return null}}},T=function(X,W){return E.map(X,function(Y){var Z=W.exec(Y);return Z===null?null:{bindings:Z,triples:[Y]}})},p=function(W,Y,X){return E.map(W,function(ab,Z){var aa=E.map(Y,function(ac){var ad=true;E.each(ac.bindings,function(af,ae){if(!(ab.bindings[af]===undefined||ab.bindings[af]===ae)){ad=false;return false}});return ad?ac:null});if(aa.length>0){return E.map(aa,function(ac){return{bindings:E.extend({},ab.bindings,ac.bindings),triples:E.unique(ab.triples.concat(ac.triples))}})}else{return X?ab:null}})},U=function(W,Y){var X,Z,aa;if(Y.filterExp!==undefined&&!E.isFunction(Y.filterExp)){if(W.union===undefined){X=typeof Y.filterExp.subject==="string"?"":Y.filterExp.subject;Z=typeof Y.filterExp.property==="string"?"":Y.filterExp.property;aa=typeof Y.filterExp.object==="string"?"":Y.filterExp.object;if(W.queries[X]===undefined){W.queries[X]={}}if(W.queries[X][Z]===undefined){W.queries[X][Z]={}}if(W.queries[X][Z][aa]===undefined){W.queries[X][Z][aa]=[]}W.queries[X][Z][aa].push(Y)}else{E.each(W.union,function(ac,ab){U(ab,Y)})}}},z=function(W){W.length=0;W.matches=[];E.each(W.children,function(X,Y){z(Y)});E.each(W.partOf,function(X,Y){z(Y)})},G=function(X,W){if(W.length>0){E.each(X.children,function(Y,Z){I(Z,W)});E.each(X.partOf,function(Y,Z){G(Z,W)});E.each(W,function(Z,Y){X.matches.push(Y);Array.prototype.push.call(X,Y.bindings)})}},I=function(Y,X){var W;if(Y.union===undefined){if(Y.top||Y.parent.top){W=Y.alphaMemory}else{X=X||Y.parent.matches;if(E.isFunction(Y.filterExp)){W=E.map(X,function(Z,aa){return Y.filterExp.call(Z.bindings,aa,Z.bindings,Z.triples)?Z:null})}else{W=p(X,Y.alphaMemory,Y.filterExp.optional)}}}else{W=E.map(Y.union,function(Z){return Z.matches})}G(Y,W)},o=function(Y,X){var W;if(Y.filterExp.optional){z(Y);I(Y)}else{if(Y.top||Y.parent.top){W=[X]}else{W=p(Y.parent.matches,[X],false)}G(Y,W)}},O=function(X,Y){var W,Z=X.filterExp.exec(Y);if(Z!==null){W={triples:[Y],bindings:Z};X.alphaMemory.push(W);o(X,W)}},d=function(W,X){W.alphaMemory.splice(E.inArray(X,W.alphaMemory),1);z(W);I(W)},A=function(W,X){E.each(W,function(Y,Z){O(Z,X)})},l=function(W,X){E.each(W,function(Y,Z){d(Z,X)})},e=function(W,aa){var X=aa.subject,Y=aa.property,Z=aa.object;if(W.union===undefined){if(W.queries[X]!==undefined){if(W.queries[X][Y]!==undefined){if(W.queries[X][Y][Z]!==undefined){A(W.queries[X][Y][Z],aa)}if(W.queries[X][Y][""]!==undefined){A(W.queries[X][Y][""],aa)}}if(W.queries[X][""]!==undefined){if(W.queries[X][""][Z]!==undefined){A(W.queries[X][""][Z],aa)}if(W.queries[X][""][""]!==undefined){A(W.queries[X][""][""],aa)}}}if(W.queries[""]!==undefined){if(W.queries[""][Y]!==undefined){if(W.queries[""][Y][Z]!==undefined){A(W.queries[""][Y][Z],aa)}if(W.queries[""][Y][""]!==undefined){A(W.queries[""][Y][""],aa)}}if(W.queries[""][""]!==undefined){if(W.queries[""][""][Z]!==undefined){A(W.queries[""][""][Z],aa)}if(W.queries[""][""][""]!==undefined){A(W.queries[""][""][""],aa)}}}}else{E.each(W.union,function(ac,ab){e(ab,aa)})}},r=function(W,aa){var X=aa.subject,Y=aa.property,Z=aa.object;if(W.union===undefined){if(W.queries[X]!==undefined){if(W.queries[X][Y]!==undefined){if(W.queries[X][Y][Z]!==undefined){l(W.queries[X][Y][Z],aa)}if(W.queries[X][Y][""]!==undefined){l(W.queries[X][Y][""],aa)}}if(W.queries[X][""]!==undefined){if(W.queries[X][""][Z]!==undefined){l(W.queries[X][""][Z],aa)}if(W.queries[X][""][""]!==undefined){l(W.queries[X][""][""],aa)}}}if(W.queries[""]!==undefined){if(W.queries[""][Y]!==undefined){if(W.queries[""][Y][Z]!==undefined){l(W.queries[""][Y][Z],aa)}if(W.queries[""][Y][""]!==undefined){l(W.queries[""][Y][""],aa)}}if(W.queries[""][""]!==undefined){if(W.queries[""][""][Z]!==undefined){l(W.queries[""][""][Z],aa)}if(W.queries[""][""][""]!==undefined){l(W.queries[""][""][""],aa)}}}}else{E.each(W.union,function(ac,ab){r(ab,aa)})}},m=function(ab){var aa={},X,W,Y,Z;for(X=0;X");for(X in aa[af]){ad=E.rdf.resource("<"+X+">");for(ab=0;ab")}else{if(Y.type==="bnode"){Z=E.rdf.blank(Y.value)}else{if(Y.datatype!==undefined){Z=E.rdf.literal(Y.value,{datatype:Y.datatype})}else{W={};if(Y.lang!==undefined){W.lang=Y.lang}Z=E.rdf.literal('"'+Y.value+'"',W)}}}ae.push(E.rdf.triple(ac,ad,Z))}}}return ae},D=function(Z,Y,X,aa){var ab=Z.ownerDocument,W;if(Y!==undefined&&Y!==null){if(ab.createAttributeNS){W=ab.createAttributeNS(Y,X);W.nodeValue=aa;Z.attributes.setNamedItemNS(W)}else{W=ab.createNode(2,X,Y);W.nodeValue=aa;Z.attributes.setNamedItem(W)}}else{W=ab.createAttribute(X);W.nodeValue=aa;Z.attributes.setNamedItem(W)}return Z},x=function(X,W,Y){if(Y){D(X,"http://www.w3.org/2000/xmlns/","xmlns:"+Y,W)}else{D(X,undefined,"xmlns",W)}return X},C=function(Y,W){var aa,ab="",Z,X=false;if(Y!==undefined&&Y!==null){if(/:/.test(W)){Z=/([^:]+):/.exec(W)[1]}X=true}if(document.implementation&&document.implementation.createDocument){aa=document.implementation.createDocument(Y,W,null);if(X){x(aa.documentElement,Y,Z)}return aa}else{aa=new ActiveXObject("Microsoft.XMLDOM");aa.async="false";if(Z===undefined){ab=' xmlns="'+Y+'"'}else{ab=" xmlns:"+Z+'="'+Y+'"'}aa.loadXML("<"+W+ab+"/>");return aa}},h=function(Y,X,W){var aa=Y.ownerDocument,Z;if(X!==undefined&&X!==null){Z=aa.createElementNS?aa.createElementNS(X,W):aa.createNode(1,W,X)}else{Z=aa.createElement(W)}Y.appendChild(Z);return Z},L=function(X,Z){var Y=X.ownerDocument,W;W=Y.createTextNode(Z);X.appendChild(W);return X},t=function(Y,W){var ac,aa,X,ab;try{aa=new ActiveXObject("Microsoft.XMLDOM");aa.async="false";aa.loadXML(""+W+"")}catch(Z){ac=new DOMParser();aa=ac.parseFromString(""+W+"","text/xml")}for(X=0;X1){Z=/(.+[#\/])([^#\/]+)/.exec(W);af=Z[1];ag=Z[2];for(Y in X){if(X[Y]===af){ab=Y;break}}for(aa=(W===E.rdf.type.value.toString()?1:0);aa",{base:Z})}else{if(b(Y,v,"ID")){X=F(Y,v,"ID");W=E.rdf.resource("<#"+X+">",{base:Z})}else{if(b(Y,v,"nodeID")){X=F(Y,v,"nodeID");W=E.rdf.blank("_:"+X)}else{W=E.rdf.blank("[]")}}}return W},N=function(ao,Y,Z,at){var ab,ae,ac,af,ap,aj,at,ai,ah,ad=1,ar,aq,al,W=[],aa,an,ak={},X,ag=[];at=F(ao,"http://www.w3.org/XML/1998/namespace","lang")||at;Z=F(ao,"http://www.w3.org/XML/1998/namespace","base")||Z;if(at!==null&&at!==undefined&&at!==""){ak={lang:at}}ab=n(ao,Z);if(Y&&(ao.namespaceURI!==v||H(ao)!=="Description")){ac=E.rdf.type;ap=E.rdf.resource("<"+ao.namespaceURI+H(ao)+">");ag.push(E.rdf.triple(ab,ac,ap))}for(ai=0;ai");ap=E.rdf.literal('"'+ae.nodeValue+'"',ak);ag.push(E.rdf.triple(ab,ac,ap))}else{if(H(ae)==="type"){ac=E.rdf.type;ap=E.rdf.resource("<"+ae.nodeValue+">",{base:Z});ag.push(E.rdf.triple(ab,ac,ap))}}}}for(ai=0;ai");ad+=1}else{ac=E.rdf.resource("<"+ae.namespaceURI+H(ae)+">")}at=F(ae,"http://www.w3.org/XML/1998/namespace","lang")||at;if(at!==null&&at!==undefined&&at!==""){ak={lang:at}}if(b(ae,v,"resource")){af=F(ae,v,"resource");ap=E.rdf.resource("<"+af+">",{base:Z})}else{if(b(ae,v,"nodeID")){af=F(ae,v,"nodeID");ap=E.rdf.blank("_:"+af)}else{if(b(ae,v,"parseType")){aa=F(ae,v,"parseType");if(aa==="Literal"){try{an=new XMLSerializer();af=an.serializeToString(ae.getElementsByTagName("*")[0])}catch(am){af="";for(ah=0;ah0){ap=X[X.length-1].subject;ag=ag.concat(X)}else{ap=E.rdf.blank("[]")}}else{if(aa==="Collection"){if(ae.getElementsByTagName("*").length>0){for(ah=0;ah0){al=X[X.length-1].subject;ag=ag.concat(X)}else{al=n(af)}ag.push(E.rdf.triple(ar,E.rdf.first,al));if(ah===W.length-1){ag.push(E.rdf.triple(ar,E.rdf.rest,E.rdf.nil))}else{aq=E.rdf.blank("[]");ag.push(E.rdf.triple(ar,E.rdf.rest,aq));ar=aq}}}else{ap=E.rdf.nil}}}}}else{if(b(ae,v,"datatype")){af=ae.childNodes[0].nodeValue;ap=E.rdf.literal(af,{datatype:F(ae,v,"datatype")})}else{if(ae.getElementsByTagName("*").length>0){for(ah=0;ah0){ap=X[X.length-1].subject;ag=ag.concat(X)}else{ap=n(af)}}}}else{if(ae.childNodes.length>0){af=ae.childNodes[0].nodeValue;ap=E.rdf.literal('"'+af+'"',ak)}else{X=N(ae,false,Z,at);if(X.length>0){ap=X[X.length-1].subject;ag=ag.concat(X)}else{ap=E.rdf.blank("[]")}}}}}}}ag.push(E.rdf.triple(ab,ac,ap));if(b(ae,v,"ID")){aj=E.rdf.resource("<#"+F(ae,v,"ID")+">",{base:Z});ag.push(E.rdf.triple(aj,E.rdf.subject,ab));ag.push(E.rdf.triple(aj,E.rdf.property,ac));ag.push(E.rdf.triple(aj,E.rdf.object,ap))}}}return ag},P=function(X){var W,Z,Y,aa=[];if(X.documentElement.namespaceURI===v&&H(X.documentElement)==="RDF"){Z=F(X.documentElement,"http://www.w3.org/XML/1998/namespace","lang");base=F(X.documentElement,"http://www.w3.org/XML/1998/namespace","base")||E.uri.base();for(W=0;W0){W=E(this).map(function(X,Y){return E.map(E.rdf.gleaners,function(Z){return Z.call(E(Y))})});return E.rdf({triples:W,namespaces:E(this).xmlns()})}else{return E.rdf()}}};E.extend(E.expr[":"],{about:function(X,Z,W){var Y=E(X),ab=W[3]?Y.safeCurie(W[3]):null,aa=false;E.each(E.rdf.gleaners,function(ac,ad){aa=ad.call(Y,{about:ab});if(aa){return null}});return aa},type:function(X,Z,W){var Y=E(X),aa=W[3]?Y.curie(W[3]):null,ab=false;E.each(E.rdf.gleaners,function(ac,ad){if(ad.call(Y,{type:aa})){ab=true;return null}});return ab}});E.rdf.databank=function(X,W){return new E.rdf.databank.fn.init(X,W)};E.rdf.databank.fn=E.rdf.databank.prototype={init:function(Y,W){var X;Y=Y||[];W=W||{};this.id=J();if(W.union===undefined){this.queries={};this.tripleStore={};this.objectStore={};this.baseURI=W.base||E.uri.base();this.namespaces=E.extend({},W.namespaces||{});for(X=0;X0){Y=Z.pop();if(ab[Y]===undefined){if(Y.value===undefined){Y=E.rdf.resource(Y)}if(this.tripleStore[Y]!==undefined){for(X=0;X/g,">"),Y.base)}else{if(ab.substring(0,1)===":"){Z=Y.namespaces[""];if(Z===undefined){throw"Malformed Resource: No namespace binding for default namespace in "+ab}else{this.value=E.uri.resolve(Z+ab.substring(1))}}else{if(ab.substring(ab.length-1)===":"){aa=ab.substring(0,ab.length-1);Z=Y.namespaces[aa];if(Z===undefined){throw"Malformed Resource: No namespace binding for prefix "+aa+" in "+ab}else{this.value=E.uri.resolve(Z)}}else{try{this.value=E.curie(ab,{namespaces:Y.namespaces})}catch(ac){throw"Malformed Resource: Bad format for resource "+ac}}}}}else{this.value=ab}return this},dump:function(){return{type:"uri",value:this.value.toString()}},toString:function(){return"<"+this.value+">"}};E.rdf.resource.fn.init.prototype=E.rdf.resource.fn;E.rdf.resource.defaults={base:E.uri.base(),namespaces:{}};E.rdf.type=E.rdf.resource("<"+v+"type>");E.rdf.label=E.rdf.resource("<"+u+"label>");E.rdf.first=E.rdf.resource("<"+v+"first>");E.rdf.rest=E.rdf.resource("<"+v+"rest>");E.rdf.nil=E.rdf.resource("<"+v+"nil>");E.rdf.subject=E.rdf.resource("<"+v+"subject>");E.rdf.property=E.rdf.resource("<"+v+"property>");E.rdf.object=E.rdf.resource("<"+v+"object>");E.rdf.blank=function(W){var X;if(c[W]){return c[W]}X=new E.rdf.blank.fn.init(W);if(c[X]){return c[X]}else{c[X]=X;return X}};E.rdf.blank.fn=E.rdf.blank.prototype={type:"bnode",value:undefined,id:undefined,init:function(W){if(W==="[]"){this.id=j();this.value="_:"+this.id}else{if(W.substring(0,2)==="_:"){this.id=W.substring(2);this.value=W}else{throw"Malformed Blank Node: "+W+" is not a legal format for a blank node"}}return this},dump:function(){return{type:"bnode",value:this.value}},toString:function(){return this.value}};E.rdf.blank.fn.init.prototype=E.rdf.blank.fn;E.rdf.literal=function(Y,W){var X;if(s[Y]){return s[Y]}X=new E.rdf.literal.fn.init(Y,W);if(s[X]){return s[X]}else{s[X]=X;return X}};E.rdf.literal.fn=E.rdf.literal.prototype={type:"literal",value:undefined,lang:undefined,datatype:undefined,init:function(aa,X){var W,Y,Z=E.extend({},E.rdf.literal.defaults,X);if(Z.lang!==undefined&&Z.datatype!==undefined){throw"Malformed Literal: Cannot define both a language and a datatype for a literal ("+aa+")"}if(Z.datatype!==undefined){Y=E.safeCurie(Z.datatype,{namespaces:Z.namespaces});E.extend(this,E.typedValue(aa.toString(),Y))}else{if(Z.lang!==undefined){this.value=aa.toString();this.lang=Z.lang}else{if(typeof aa==="boolean"){E.extend(this,E.typedValue(aa.toString(),i+"boolean"))}else{if(typeof aa==="number"){E.extend(this,E.typedValue(aa.toString(),i+"double"))}else{if(aa==="true"||aa==="false"){E.extend(this,E.typedValue(aa,i+"boolean"))}else{if(E.typedValue.valid(aa,i+"integer")){E.extend(this,E.typedValue(aa,i+"integer"))}else{if(E.typedValue.valid(aa,i+"decimal")){E.extend(this,E.typedValue(aa,i+"decimal"))}else{if(E.typedValue.valid(aa,i+"double")&&!/^\s*([\-\+]?INF|NaN)\s*$/.test(aa)){E.extend(this,E.typedValue(aa,i+"double"))}else{W=S.exec(aa);if(W!==null){this.value=(W[2]||W[4]).replace(/\\"/g,'"');if(W[9]){Y=E.rdf.resource(W[9],Z);E.extend(this,E.typedValue(this.value,Y.value))}else{if(W[7]){this.lang=W[7]}}}else{throw"Malformed Literal: Couldn't recognise the value "+aa}}}}}}}}}return this},dump:function(){var W={type:"literal",value:this.value.toString()};if(this.lang!==undefined){W.lang=this.lang}else{if(this.datatype!==undefined){W.datatype=this.datatype.toString()}}return W},toString:function(){var W='"'+this.value+'"';if(this.lang!==undefined){W+="@"+this.lang}else{if(this.datatype!==undefined){W+="^^<"+this.datatype+">"}}return W}};E.rdf.literal.fn.init.prototype=E.rdf.literal.fn;E.rdf.literal.defaults={base:E.uri.base(),namespaces:{},datatype:undefined,lang:undefined}})(jQuery); \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..68766ff --- /dev/null +++ b/manifest.json @@ -0,0 +1,31 @@ +{ + "manifest_version": 2, + + "name": "RES-check", + "description": "Highlight RESable pages.", + "version": "1.0", + + "page_action": { + "default_icon": { + "19": "r-icon.png" + } + }, + "background": { + "persistent": false, + "scripts": ["background.js"] + }, + "content_scripts": [ + { + "matches": [ + "http://*/*", + "https://*/*" + ], + "js": [ "jquery.min.js", "jquery-ui.min.js", "turn.js", "codemirror-compressed.js", "jquery.rdfquery.core.min-1.0.js", "contentscript.js" ], + "css": [ "turn.css", "codemirror.css", "custom.css" ], + "run_at" : "document_idle", + "all_frames" : false + } + ], + "web_accessible_resources": [ + "fold.png"] +} diff --git a/r-icon.png b/r-icon.png new file mode 100644 index 0000000..3c4cdc6 --- /dev/null +++ b/r-icon.png Binary files differ diff --git a/turn.css b/turn.css new file mode 100644 index 0000000..e3c1c23 --- /dev/null +++ b/turn.css @@ -0,0 +1,80 @@ +#turn_wrapper { + width: 80px; + height: 80px; + display: block; + position: absolute; + top: 0; + left: 0; +} + +#turn_hideme { + width: 85%; + height: 85%; + overflow: hidden; + display: block; + position: absolute; + float: left; + top: 0; + left: 0; + z-index: 1; +} + +#turn_object{ + position: relative; +} + +#turn_wrapper.right #turn_hideme *, +#turn_wrapper.right #turn_object { + float: right !important; +} + +#turn_wrapper.right #turn_hideme { + float: right !important; + right: 0 !important; + left: auto; +} +#turn_wrapper.right #turn_object { + right: 0 !important; + left: auto !important; +} + +#turn_wrapper.right { + position: absolute; + top: 0; + width: 100%; + height: 0; + right: 0 !important; +} + +#turn_wrapper.right #turn_object * { + position: absolute; + right: 0 !important; +} + +#turn_wrapper #turn_object img#turn_fold { + display: block; + width: 100%; + height: 100%; + z-index: 1000; + right: 0; + position: absolute; +} + +/* the jQuery CSS Framework */ +#turn_wrapper .ui-resizable { position: relative;} +#turn_wrapper .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 0; bottom: 0; } +#turn_wrapper .ui-resizable-sw { cursor: sw-resize; width: 12px; height: 12px; left: 0; bottom: 0; } + + +#turn_wrapper .ui-resizable-handle { + position: absolute; + font-size: 0.1px; + z-index: 99999; + display: block; + border: none !important; + border-width: 0 !important; + /* I have NO idea why this works for IE7, but it does. Background none doesn't work. Go figure. */ + background: url(#none) !important; + width: 100% !important; + height: 100% !important; +} \ No newline at end of file diff --git a/turn.js b/turn.js new file mode 100644 index 0000000..e2fdbca --- /dev/null +++ b/turn.js @@ -0,0 +1,100 @@ +/** + * The Sexy Curls JQuery Plugin + * By Elliott Kember - http://twitter.com/elliottkember + * Released under the MIT license (MIT-LICENSE.txt) + * + * My only request is: please don't over-use this plugin. + * If this ends up being used all over the internets, and becomes "that annoying effect", I'll be upset. + * + * I dragged a curl, and I liked it - I hope @jeresig don't mind it. + */ + +(function($){ + $.fn.fold = function(options) { + /* this doesn't work with IE8 + var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1); + var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1); + + // We just won't show it for IE5.5 and IE6. Go away. I'm really tempted to write "document.location= 'http://www.getfirefox.com';" here. + if (ie55 || ie6) {this.remove(); return true;} + */ + + // MSIE must be 8 or greater + if (navigator.appName == "Microsoft Internet Explorer"){ + var ary = navigator.appVersion.match(/MSIE..../g); + var msieVersion = 8; // in case our test fails try it anyway + for(var i=0; i 7) break; + } + } + + // New - you don't have to specify options! + options = options || {}; + + // Default awesomeness + var defaults = { + directory: '.', // The directory we're in + side: 'left', // change me to "right" if you want rightness + turnImage: 'fold.png', // The triangle-shaped fold image + maxHeight: 400, // The maximum height. Duh. + startingWidth: 80, // The height and width + startingHeight: 80, // with which to start (these should probably be camelCase, d'oh.) + autoCurl: false // If this is set to true, the fold will curl/uncurl on mouseover/mouseout. + }; + + // Change turnImage if we're running the default image, and they've specified 'right' + if (options.side == 'right' && !options.turnImage) defaults.turnImage = 'fold-sw.png'; + + // Merge options with the defaults + var options = $.extend(defaults, options); + + // Set up the wrapper objects + var turn_hideme = $('
    '); + var turn_wrapper = $('
    '); + var turn_object = $('
    '); + var img = $(''); + + // Set starting width and height of our turn-o-ma-bob + turn_object.css({ + width: options.startingWidth, + height: options.startingHeight + }); + + // There are different CSS considerations for a top-right fold. + if (options.side == 'right') turn_wrapper.addClass('right'); + + // Rappin', I'm rappin' - I'm rap-rap-rappin'. + this.wrap(turn_wrapper).wrap(turn_object).after(img).wrap(turn_hideme); + + // If you want autoCurl, you don't get scrolling. Why? Because it looks silly. + + turn_wrapper = $('#turn_wrapper'); + turn_object = $('#turn_object'); + + if (!options.autoCurl) { + // Hit 'em with the drag-stick because it ain't gonna curl itself! + turn_object.resizable({ + maxHeight: options.maxHeight, + aspectRatio: true, + handles: options.side == 'left' ? 'se' : 'sw' + }); + } else { + // Thanks to @zzzrByte for this bit! + turn_wrapper.hover( + function(){ + turn_object.stop().animate({ + width: options.maxHeight, + height: options.maxHeight + }); + }, + function(){ + turn_object.stop().animate({ + width: options.startingHeight, + height: options.startingHeight + }); + } + ); + } + }; +})(jQuery);