1 2function onloadCSS(e,t){function n(){!a&&t&&(a=!0,t.call(e))}var a;e.addEventListener&&e.addEventListener("load",n),e.attachEvent&&e.attachEvent("onload",n),"isApplicationInstalled"in navigator&&"onloadcssdefined"in e&&e.onloadcssdefined(n)}!function(e){"use strict";var t=function(t,n,a){function o(e){return d.body?e():void setTimeout(function(){o(e)})}function r(){i.addEventListener&&i.removeEventListener("load",r),i.media=a||"all"}var l,d=e.document,i=d.createElement("link");if(n)l=n;else{var s=(d.body||d.getElementsByTagName("head")[0]).childNodes;l=s[s.length-1]}var c=d.styleSheets;i.rel="stylesheet",i.href=t,i.media="only x",o(function(){l.parentNode.insertBefore(i,n?l:l.nextSibling)});var f=function(e){for(var t=i.href,n=c.length;n--;)if(c[n].href===t)return e();setTimeout(function(){f(e)})};return i.addEventListener&&i.addEventListener("load",r),i.onloadcssdefined=f,f(r),i};"undefined"!=typeof exports?exports.loadCSS=t:e.loadCSS=t}("undefined"!=typeof global?global:this),function(e){if(e.loadCSS){var t=loadCSS.relpreload={};if(t.support=function(){try{return e.document.createElement("link").relList.supports("preload")}catch(t){return!1}},t.poly=function(){for(var t=e.document.getElementsByTagName("link"),n=0;n<t.length;n++){var a=t[n];"preload"===a.rel&&"style"===a.getAttribute("as")&&(e.loadCSS(a.href,a),a.rel=null)}},!t.support()){t.poly();var n=e.setInterval(t.poly,300);e.addEventListener&&e.addEventListener("load",function(){e.clearInterval(n)}),e.attachEvent&&e.attachEvent("onload",function(){e.clearInterval(n)})}}}(this); 3!function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,a,i,s;for(var l in x){if(e=[],t=x[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(o=r(t.fn,"function")?t.fn():t.fn,a=0;a<e.length;a++)i=e[a],s=i.split("."),1===s.length?Modernizr[s[0]]=o:(!Modernizr[s[0]]||Modernizr[s[0]]instanceof Boolean||(Modernizr[s[0]]=new Boolean(Modernizr[s[0]])),Modernizr[s[0]][s[1]]=o),b.push((o?"":"no-")+s.join("-"))}}function a(e){var t=w.className,n=Modernizr._config.classPrefix||"";if(S&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),S?w.className.baseVal=t:w.className=t)}function i(e,t){if("object"==typeof e)for(var n in e)E(e,n)&&i(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),o=Modernizr[r[0]];if(2==r.length&&(o=o[r[1]]),"undefined"!=typeof o)return Modernizr;t="function"==typeof t?t():t,1==r.length?Modernizr[r[0]]=t:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),a([(t&&0!=t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function s(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):S?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function l(e,t){return!!~(""+e).indexOf(t)}function c(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function u(){var e=t.body;return e||(e=s(S?"svg":"body"),e.fake=!0),e}function d(e,n,r,o){var a,i,l,c,d="modernizr",f=s("div"),p=u();if(parseInt(r,10))for(;r--;)l=s("div"),l.id=o?o[r]:d+(r+1),f.appendChild(l);return a=s("style"),a.type="text/css",a.id="s"+d,(p.fake?p:f).appendChild(a),p.appendChild(f),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(t.createTextNode(e)),f.id=d,p.fake&&(p.style.background="",p.style.overflow="hidden",c=w.style.overflow,w.style.overflow="hidden",w.appendChild(p)),i=n(f,e),p.fake?(p.parentNode.removeChild(p),w.style.overflow=c,w.offsetHeight):f.parentNode.removeChild(f),!!i}function f(e,t){return function(){return e.apply(t,arguments)}}function p(e,t,n){var o;for(var a in e)if(e[a]in t)return n===!1?e[a]:(o=t[e[a]],r(o,"function")?f(o,n||t):o);return!1}function m(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function h(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(m(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var a=[];o--;)a.push("("+m(t[o])+":"+r+")");return a=a.join(" or "),d("@supports ("+a+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return n}function g(e,t,o,a){function i(){d&&(delete D.style,delete D.modElem)}if(a=r(a,"undefined")?!1:a,!r(o,"undefined")){var u=h(e,o);if(!r(u,"undefined"))return u}for(var d,f,p,m,g,v=["modernizr","tspan"];!D.style;)d=!0,D.modElem=s(v.shift()),D.style=D.modElem.style;for(p=e.length,f=0;p>f;f++)if(m=e[f],g=D.style[m],l(m,"-")&&(m=c(m)),D.style[m]!==n){if(a||r(o,"undefined"))return i(),"pfx"==t?m:!0;try{D.style[m]=o}catch(y){}if(D.style[m]!=g)return i(),"pfx"==t?m:!0}return i(),!1}function v(e,t,n,o,a){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+R.join(i+" ")+i).split(" ");return r(t,"string")||r(t,"undefined")?g(s,t,o,a):(s=(e+" "+_.join(i+" ")+i).split(" "),p(s,t,n))}function y(e,t,r){return v(e,n,n,t,r)}var b=[],x=[],T={_version:"3.0.0-alpha.4",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){x.push({name:e,fn:t,options:n})},addAsyncTest:function(e){x.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=T,Modernizr=new Modernizr;var C=T._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];T._prefixes=C;var w=t.documentElement,S="svg"===w.nodeName.toLowerCase();S||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=b.elements;return"string"==typeof e?e.split(" "):e}function o(e,t){var n=b.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),b.elements=n+" "+e,c(t)}function a(e){var t=y[e[g]];return t||(t={},v++,e[g]=v,y[v]=t),t}function i(e,n,r){if(n||(n=t),d)return n.createElement(e);r||(r=a(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():h.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!o.canHaveChildren||m.test(e)||o.tagUrn?o:r.frag.appendChild(o)}function s(e,n){if(e||(e=t),d)return e.createDocumentFragment();n=n||a(e);for(var o=n.frag.cloneNode(),i=0,s=r(),l=s.length;l>i;i++)o.createElement(s[i]);return o}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return b.shivMethods?i(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(b,t.frag)}function c(e){e||(e=t);var r=a(e);return!b.shivCSS||u||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{dis
3play:block}mark{background:#FF0;color:#000}template{display:none}")),d||l(e,r),e}var u,d,f="3.7.2",p=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,h=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g="_html5shiv",v=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",u="hidden"in e,d=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){u=!0,d=!0}}();var b={elements:p.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:f,shivCSS:p.shivCSS!==!1,supportsUnknownElements:d,shivMethods:p.shivMethods!==!1,type:"default",shivDocument:c,createElement:i,createDocumentFragment:s,addElements:o};e.html5=b,c(t)}(this,t);var k="Moz O ms Webkit",_=T._config.usePrefixes?k.toLowerCase().split(" "):[];T._domPrefixes=_;var E;!function(){var e={}.hasOwnProperty;E=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),T._l={},T.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},T._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e<n.length;e++)(r=n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){T.addTest=i}),Modernizr.addTest("cssgradients",function(){var e="background-image:",t="gradient(linear,left top,right bottom,from(#9f9),to(white));",n="linear-gradient(left top,#9f9, white);",r=e+C.join(n+e).slice(0,-e.length);Modernizr._config.usePrefixes&&(r+=e+"-webkit-"+t);var o=s("a"),a=o.style;return a.cssText=r,(""+a.backgroundImage).indexOf("gradient")>-1}),Modernizr.addTest("opacity",function(){var e=s("a").style;return e.cssText=C.join("opacity:.55;"),/^0.55$/.test(e.opacity)}),Modernizr.addTest("multiplebgs",function(){var e=s("a").style;return e.cssText="background:url(https://),url(https://),red url(https://)",/(url\s*\(.*?){3}/.test(e.background)}),Modernizr.addTest("rgba",function(){var e=s("a").style;return e.cssText="background-color:rgba(150,255,150,.5)",(""+e.backgroundColor).indexOf("rgba")>-1});var z=s("input"),j="search tel url email datetime date month week time datetime-local number range color".split(" "),N={};Modernizr.inputtypes=function(e){for(var r,o,a,i=e.length,s=":)",l=0;i>l;l++)z.setAttribute("type",r=e[l]),a="text"!==z.type&&"style"in z,a&&(z.value=s,z.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(r)&&z.style.WebkitAppearance!==n?(w.appendChild(z),o=t.defaultView,a=o.getComputedStyle&&"textfield"!==o.getComputedStyle(z,null).WebkitAppearance&&0!==z.offsetHeight,w.removeChild(z)):/^(search|tel)$/.test(r)||(a=/^(url|email|number)$/.test(r)?z.checkValidity&&z.checkValidity()===!1:z.value!=s)),N[e[l]]=!!a;return N}(j),Modernizr.addTest("hsla",function(){var e=s("a").style;return e.cssText="background-color:hsla(120,40%,100%,.5)",l(e.backgroundColor,"rgba")||l(e.backgroundColor,"hsla")});var P="CSS"in e&&"supports"in e.CSS,F="supportsCSS"in e;Modernizr.addTest("supports",P||F);var R=T._config.usePrefixes?k.split(" "):[];T._cssomPrefixes=R;var A=T.testStyles=d;Modernizr.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var r=["@media (",C.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");A(r,function(e){n=9===e.offsetTop})}return n});var B=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,o=533>t&&e.match(/android/gi);return n||o||r}();B?Modernizr.addTest("fontface",!1):A('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),o=r.sheet||r.styleSheet,a=o?o.cssRules&&o.cssRules[0]?o.cssRules[0].cssText:o.cssText||"":"",i=/src/i.test(a)&&0===a.indexOf(n.split(" ")[0]);Modernizr.addTest("fontface",i)}),A('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}',function(e){Modernizr.addTest("generatedcontent",e.offsetHeight>=7)});var $={elem:s("modernizr")};Modernizr._q.push(function(){delete $.elem});var D={style:$.elem.style};Modernizr._q.unshift(function(){delete D.style});var L=T.testProp=function(e,t,r){return g([e],n,t,r)};Modernizr.addTest("textshadow",L("textShadow","1px 1px")),T.testAllProps=v,T.testAllProps=y,Modernizr.addTest("cssanimations",y("animationName","a",!0)),Modernizr.addTest("backgroundsize",y("backgroundSize","100%",!0)),Modernizr.addTest("borderradiu
3s",y("borderRadius","0px",!0)),Modernizr.addTest("borderimage",y("borderImage","url() 1",!0)),Modernizr.addTest("boxshadow",y("boxShadow","1px 1px",!0)),Modernizr.addTest("flexbox",y("flexBasis","1px",!0)),function(){Modernizr.addTest("csscolumns",function(){var e=!1,t=y("columnCount");try{(e=!!t)&&(e=new Boolean(e))}catch(n){}return e});for(var e,t,n=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],r=0;r<n.length;r++)e=n[r].toLowerCase(),t=y("column"+n[r]),("breakbefore"===e||"breakafter"===e||"breakinside"==e)&&(t=t||y(n[r])),Modernizr.addTest("csscolumns."+e,t)}(),Modernizr.addTest("flexboxlegacy",y("boxDirection","reverse",!0)),Modernizr.addTest("cssreflections",y("boxReflect","above",!0)),Modernizr.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&y("transform","scale(1)",!0)}),Modernizr.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in w.style)){var n;Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{left:9px;position:absolute;height:5px;margin:0;padding:0;border:0}}",A(n,function(t){e=9===t.offsetLeft&&5===t.offsetHeight})}return e}),Modernizr.addTest("csstransitions",y("transition","all",!0)),o(),a(b),delete T.addTest,delete T.addAsyncTest;for(var O=0;O<Modernizr._q.length;O++)Modernizr._q[O]();e.Modernizr=Modernizr}(window,document); 4Modernizr.addTest('dateinput', function() { 5return Modernizr.inputtypes.date; 6}); 7Modernizr.addTest('os-ios', function() { 8return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; 9});
vendor: 87,445 bytes, lines 9-10
9 10!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=ce.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<ce(i,this).index(l):ce.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Yt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&ie.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce});
vendor: 778 bytes, line 11
11"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]}
11,n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return!(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var Q,A,R=!1,C=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return R=!0,e=r.apply(this,arguments),R=!1,e})}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in R||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(A={animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(A,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=A):A=s.cssNumber,Q=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=x(e),n=r,C.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||A[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))},"css-number");var S,P,k,H,E=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&E.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return E.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&E.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):E.apply(this,arguments)},"data-camelCase"),s.fx&&(k=s.Tween.prototype.run,H=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=H),k.apply(this,arguments)},"easing-one-arg"),S=s.fx.interval,P="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",P),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){u("fx-interval",P),S=e}}));var M=s.fn.load,q=s.event.add,O=s.event.fix;s.event.props=[],s.event.fixHooks={}
11,r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=O.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),q.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?M.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated")}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var F=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(F,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s}); 12(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;
12d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.
12coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)}); 13!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2";var n,i=0,a=Array.prototype.hasOwnProperty,r=Array.prototype.slice;V.cleanData=(n=V.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=V._data(i,"events"))&&e.remove&&V(i).triggerHandler("remove");n(t)}),V.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=V.Widget),Array.isArray(e)&&(e=V.extend.apply(null,[{}].concat(e))),V.expr.pseudos[l.toLowerCase()]=function(t){return!!V.data(t,l)},V[r]=V[r]||{},s=V[r][t],n=V[r][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},V.extend(n,s,{version:e.version,_proto:V.extend({},e),_childConstructors:[]}),(o=new i).options=V.widget.extend({},o.options),V.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=V.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(V.each(s._childConstructors,function(t,e){var i=e.prototype;V.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),V.widget.bridge(t,n),n},V.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],a.call(s[n],e)&&void 0!==i&&(V.isPlainObject(i)?t[e]=V.isPlainObject(t[e])?V.widget.extend({},t[e],i):V.widget.extend({},i):t[e]=i);return t},V.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;V.fn[o]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=V.data(this,a);return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for "+o+" widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V.data(this,a);t?(t.option(i||{}),t._init&&t._init()):V.data(this,a,new e(i,this))})),n}},V.Widget=function(){},V.Widget._childConstructors=[],V.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}}
vendor: 54,863 bytes, line 13
13,_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=V(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||V(),i=n.add?(function(){var i=[];n.element.each(function(t,e){V.map(a.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),a._on(V(i),{remove:"_untrackClassesElement"})}(),V(V.uniqueSort(i.get().concat(n.element.get())))):V(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return(n=V.extend({element:this.element,classes:this.options.classes||{}},n)).keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;V.each(s.classesElementLookup,function(t,e){-1!==V.inArray(i.target,e)&&(s.classesElementLookup[t]=V(e.not(i.target).get()))}),this._off(V(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,i={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return i.element.toggleClass(this._classes(i),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=V(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),V.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!V(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||V.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?a.on(t,s,i):o.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=V(this.bindings.not(t).get()),this.focusable=V(this.focusable.not(t).get()),this.hoverable=V(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(V(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(V(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=V.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!("function"==typeof o&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},V.each({show:"fadeIn",hide:"fadeOut"},function(o,a){V.Widget.prototype["_"+o]=function(e,t,i){var s,n=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!V.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&V.effects&&V.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){V(this)[o](),i&&i.call(e[0]),t()})}});var s,x,k,o,l,h,c,u,C;V.widget;function D(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function I(t,e){return parseInt(V.css(t,e),10)||0}function T(t){return null!=t&&t===t.window}x=Math.max,k=Math.abs,o=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,C=V.fn.position,V.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=V("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),i=e.children()[0];return V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?V.position.scrollbarWidth():0,height:e?V.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=V(t||window),i=T(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?V(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},V.fn.position=function(u){if(!u||!u.of)return C.apply(this,arguments);var d,p,f,g,m,t,_="string"==typeof(u=V.extend({},u)).of?V(document).find(u.of):V(u.of),v=V.position.getWithinInfo(u.within),b=V.position.getScrollInfo(v),y=(u.collision||"flip").split(" "),w={},e=9===(t=(e=_)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:T(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return _[0].preventDefault&&(u.at="left top"),p=e.width,f=e.height,m=V.extend({},g=e.offset),V.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],u[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?m.left+=p:"center"===u.at[0]&&(m.left+=p/2),"bottom"===u.at[1]?m.top+=f:"center"===u.at[1]&&(m.top+=f/2),d=D(w.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,a=V(this),r=a.outerWidth(),l=a.outerHeight(),e=I(this,"marginLeft"),s=I(this,"marginTop"),n=r+e+I(this,"marginRight")+b.width,o=l+s+I(this,"marginBottom")+b.height,h=V.extend({},m),c=D(w.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?h.left-=r:"center"===u.my[0]&&(h.left-=r/2),"bottom"===u.my[1]?h.top-=l:"center"===u.my[1]&&(h.top-=l/2),h.left+=c[0],h.top+=c[1],i={marginLeft:e,marginTop:s},V.each(["left","top"],function(t,e){V.ui.position[y[t]]&&V.ui.position[y[t]][e](h,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:v,elem:a})}),u.using&&(t=function(t){var e=g.left-h.left,i=e+p-r,s=g.top-h.top,n=s+f-l,o={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:a,left:h.left,top:h.top,width:r,height:l},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&k(e+i)<p&&(o.horizontal="center"),f<l&&k(s+n)<f&&(o.vertical="middle"),x(k(e),k(i))>x(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})},V.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0<a&&r<=0?(i=t.left+a+e.collisionWidth-n-s,t.left+=a-i):t.left=!(0<r&&a<=0)&&r<a?s+n-e.collisionWidth:s:0<a?t.left+=a:0<r?t.left-=r:t.left=x(t.left-o,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,a=s-o,r=o+e.collisionHeight-n-s;e.collisionHeight>n?0<a&&r<=0?(i=t.top+a+e.collisionHeight-n-s,t.top+=a-i):t.top=!(0<r&&a<=0)&&r<a?s+n-e.collisionHeight:s:0<a?t.top+=a:0<r?t.top-=r:t.top=x(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,a=t.left-e.collisionPosition.marginLeft,r=a-o,l=a+e.collisionWidth-n-o,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,a=-2*e.offset[0];r<0?((s=t.left+h+i+a+e.collisionWidth-n-s)<0||s<k(r))&&(t.left+=h+i+a):0<l&&(0<(o=t.left-e.collisionPosition.marginLeft+h+i+a-o)||k(o)<l)&&(t.left+=h+i+a)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,a=t.top-e.collisionPosition.marginTop,r=a-o,l=a+e.collisionHeight-n-o,h="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,a=-2*e.offset[1];r<0?((s=t.top+h+i+a+e.collisionHeight-n-s)<0||s<k(r))&&(t.top+=h+i+a):0<l&&(0<(o=t.top-e.collisionPosition.marginTop+h+i+a-o)||k(o)<l)&&(t.top+=h+i+a)}},flipfit:{left:function(){V.ui.position.flip.left.apply(this,arguments),V.ui.position.fit.left.apply(this,arguments)},top:function(){V.ui.position.flip.top.apply(this,arguments),V.ui.position.fit.top.apply(this,arguments)}}};V.ui.position,V.extend(V.expr.pseudos,{data:V.expr.createPseudo?V.expr.createPseudo(function(e){return function(t){return!!V.data(t,e)}}):function(t,e,i){return!!V.data(t,i[3])}}),V.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var t,d=V,p={},e=p.toString,f=/^([\-+])=\s*(\d+\.?\d*)/,g=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],m=d.Color=function(t,e,i,s){return new d.Color.fn.parse(t,e,i,s)},_={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},v={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},b=m.support={},y=d("<p>")[0],w=d.each;function P(t){return null==t?t+"":"object"==typeof t?p[e.call(t)]||"object":typeof t}function M(t,e,i){var s=v[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function S(s){var n=m(),o=n._rgba=[];return s=s.toLowerCase(),w(g,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[_[e].cache]=i[_[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&d.extend(o,B.transparent),n):B[s]}function H(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}y.style.cssText="background-color:rgba(1,1,1,.5)",b.rgba=-1<y.style.backgroundColor.indexOf("rgba"),w(_,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),d.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){p["[object "+e+"]"]=e.toLowerCase()}),(m.fn=d.extend(m.prototype,{parse:function(n,t,e,i){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=d(n).css(t),t=void 0);var o=this,s=P(n),a=this._rgba=[];return void 0!==t&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(S(n)||B._default):"array"===s?(w(_.rgba.props,function(t,e){a[e.idx]=M(n[e.idx],e)}),this):"object"===s?(w(_,n instanceof m?function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}:function(t,i){var s=i.cache;w(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=M(n[t],e,!0)}),o[s]&&d.inArray(null,o[s].slice(0,3))<0&&(null==o[s][3]&&(o[s][3]=1),i.from&&(o._rgba=i.from(o[s])))}),this):void 0},is:function(t){var n=m(t),o=!0,a=this;return w(_,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],w(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return w(_,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var e=(h=m(t))._space(),i=_[e],t=0===this.alpha()?m("transparent"):this,r=t[i.cache]||i.to(t._rgba),l=r.slice(),h=h[i.cache];return w(i.props,function(t,e){var i=e.idx,s=r[i],n=h[i],o=v[e.type]||{};null!==n&&(null===s?l[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=M((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=m(t)._rgba;return m(d.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=d.map(this._rgba,function(t,e){return null!=t?t:2<e?1:0});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=d.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+d.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=m.fn,_.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,s=t[2]/255,n=t[3],o=Math.max(e,i,s),a=Math.min(e,i,s),r=o-a,l=o+a,t=.5*l,i=a===o?0:e===o?60*(i-s)/r+360:i===o?60*(s-e)/r+120:60*(e-i)/r+240,l=0==r?0:t<=.5?r/l:r/(2-l);return[Math.round(i)%360,l,t,null==n?1:n]},_.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],t=t[3],i=s<=.5?s*(1+i):s+i-s*i,s=2*s-i;return[Math.round(255*H(s,i,e+1/3)),Math.round(255*H(s,i,e)),Math.round(255*H(s,i,e-1/3)),t]},w(_,function(l,t){var e=t.props,o=t.cache,a=t.to,r=t.from;m.fn[l]=function(t){if(a&&!this[o]&&(this[o]=a(this._rgba)),void 0===t)return this[o].slice();var i=P(t),s="array"===i||"object"===i?t:arguments,n=this[o].slice();return w(e,function(t,e){t=s["object"===i?t:e.idx];null==t&&(t=n[e.idx]),n[e.idx]=M(t,e)}),r?((t=m(r(n)))[o]=n,t):m(n)},w(e,function(a,r){m.fn[a]||(m.fn[a]=function(t){var e,i=P(t),s="alpha"===a?this._hsla?"hsla":"rgba":l,n=this[s](),o=n[r.idx];return"undefined"===i?o:("function"===i&&(i=P(t=t.call(this,o))),null==t&&r.empty?this:("string"===i&&(e=f.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),n[r.idx]=t,this[s](n)))})})}),(m.hook=function(t){t=t.split(" ");w(t,function(t,o){d.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==P(e)||(i=S(e)))){if(e=m(i||e),!b.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=d.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},d.fx.step[o]=function(t){t.colorInit||(t.start=m(t.elem,o),t.end=m(t.end),t.colorInit=!0),d.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),d.cssHooks.borderColor={expand:function(i){var s={};return w(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}};var z,A,O,N,E,W,F,L,R,Y,B=d.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},j="ui-effects-",q="ui-effects-style",K="ui-effects-animated";function U(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function X(t,e,i,s){return t={effect:t=V.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(s=e,i=null,e={}),"number"!=typeof e&&!V.fx.speeds[e]||(s=i,i=e,e={}),"function"==typeof i&&(s=i,i=null),e&&V.extend(t,e),i=i||e.duration,t.duration=V.fx.off?0:"number"==typeof i?i:i in V.fx.speeds?V.fx.speeds[i]:V.fx.speeds._default,t.complete=s||e.complete,t}function $(t){return!t||"number"==typeof t||V.fx.speeds[t]||("string"==typeof t&&!V.effects.effect[t]||("function"==typeof t||"object"==typeof t&&!t.effect))}function G(t,e){var i=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?i:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}V.effects={effect:{}},N=["add","remove","toggle"],E={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},V.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){V.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(d.style(t.elem,e,t.end),t.setAttr=!0)}}),V.fn.addBack||(V.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),V.effects.animateClass=function(n,t,e,i){var o=V.speed(t,e,i);return this.queue(function(){var i=V(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:V(this),start:U(this)}}),s=function(){V.each(N,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=U(this.el[0]),this.diff=function(t,e){var i,s,n={};for(i in e)s=e[i],t[i]!==s&&(E[i]||!V.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s));return n}(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=V.Deferred(),i=V.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),V.when.apply(V,e.get()).done(function(){s(),V.each(arguments,function(){var e=this.el;V.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},V.fn.extend({addClass:(O=V.fn.addClass,function(t,e,i,s){return e?V.effects.animateClass.call(this,{add:t},e,i,s):O.apply(this,arguments)}),removeClass:(A=V.fn.removeClass,function(t,e,i,s){return 1<arguments.length?V.effects.animateClass.call(this,{remove:t},e,i,s):A.apply(this,arguments)}),toggleClass:(z=V.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?V.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):z.apply(this,arguments):V.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return V.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),V.expr&&V.expr.pseudos&&V.expr.pseudos.animated&&(V.expr.pseudos.animated=(W=V.expr.pseudos.animated,function(t){return!!V(t).data(K)||W(t)})),!1!==V.uiBackCompat&&V.extend(V.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(j+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(j+e[s]),t.css(e[s],i))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=V("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(q,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(q)||"",t.removeData(q)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=V("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(j+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=j+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),V.fn.extend({effect:function(){function t(t){var e=V(this),i=V.effects.mode(e,r)||o;e.data(K,!0),l.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||V.effects.saveStyle(e),"function"==typeof t&&t()}var s=X.apply(this,arguments),n=V.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,l=[];return V.fx.off||!n?r?this[r](s.duration,a):this.each(function(){a&&a.call(this)}):!1===e?this.each(t).each(h):this.queue(i,t).queue(i,h);function h(t){var e=V(this);function i(){"function"==typeof a&&a.call(e[0]),"function"==typeof t&&t()}s.mode=l.shift(),!1===V.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(K),V.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}},show:(R=V.fn.show,function(t){if($(t))return R.apply(this,arguments);t=X.apply(this,arguments);return t.mode="show",this.effect.call(this,t)}),hide:(L=V.fn.hide,function(t){if($(t))return L.apply(this,arguments);t=X.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)}),toggle:(F=V.fn.toggle,function(t){if($(t)||"boolean"==typeof t)return F.apply(this,arguments);t=X.apply(this,arguments);return t.mode="toggle",this.effect.call(this,t)}),cssUnit:function(t){var i=this.css(t),s=[];return V.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):G(this.css("clip"),this)},transfer:function(t,e){var i=V(this),s=V(t.to),n="fixed"===s.css("position"),o=V("body"),a=n?o.scrollTop():0,r=n?o.scrollLeft():0,o=s.offset(),o={top:o.top-a,left:o.left-r,height:s.innerHeight(),width:s.innerWidth()},s=i.offset(),l=V("<div class='ui-effects-transfer'></div>");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=G(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},Y={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){Y[t]=function(t){return Math.pow(t,e+2)}}),V.extend(Y,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(Y,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});y=V.effects,V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,p="up"===l||"down"===l?"top":"left",f="up"===l||"left"===l,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),l=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[p]=l,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[p]=l;g<c;g++)(i={})[p]=(f?"-=":"+=")+h,n.animate(i,u,d).animate(s,u,d),h=a?2*h:h/2;a&&((i={opacity:0})[p]=(f?"-=":"+=")+h,n.animate(i,u,d)),n.queue(e),V.effects.unshift(n,t,1+o)}),V.effects.define("clip","hide",function(t,e){var i={},s=V(this),n=t.direction||"vertical",o="both"===n,a=o||"horizontal"===n,o=o||"vertical"===n,n=s.cssClip();i.clip={top:o?(n.bottom-n.top)/2:n.top,right:a?(n.right-n.left)/2:n.right,bottom:o?(n.bottom-n.top)/2:n.bottom,left:a?(n.right-n.left)/2:n.left},V.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=n),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("drop","hide",function(t,e){var i=V(this),s="show"===t.mode,n=t.direction||"left",o="up"===n||"down"===n?"top":"left",a="up"===n||"left"===n?"-=":"+=",r="+="==a?"-=":"+=",l={opacity:0};V.effects.createPlaceholder(i),n=t.distance||i["top"==o?"outerHeight":"outerWidth"](!0)/2,l[o]=a+n,s&&(i.css(l),l[o]=r+n,l.opacity=1),i.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,l=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=l,c=V(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),p=Math.ceil(c.outerWidth()/h),f=Math.ceil(c.outerHeight()/l),g=[];function m(){g.push(this),g.length===l*h&&(c.css({visibility:"visible"}),V(g).remove(),e())}for(i=0;i<l;i++)for(o=d.top+i*f,r=i-(l-1)/2,s=0;s<h;s++)n=d.left+s*p,a=s-(h-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,c=V.effects.createPlaceholder(i),u=i.cssClip(),d={clip:V.extend({},u)},p={clip:V.extend({},u)},f=[u[l[0]],u[l[1]]],s=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[l[0]]=a,p.clip[l[0]]=a,p.clip[l[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(V.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(V.effects.clipToBox(d),h,e.easing).animate(V.effects.clipToBox(p),h,e.easing),t()}).animate(d,h,e.easing).animate(p,h,e.easing).queue(t),V.effects.unshift(i,s,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(c=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*c.y+d.top,f.left=(p.outerWidth-f.outerWidth)*c.x+d.left,g.top=(p.outerHeight-g.outerHeight)*c.y+d.top,g.left=(p.outerWidth-g.outerWidth)*c.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),V.effects.effect.size.call(this,s,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l<o;l++)i.animate({opacity:r},a,t.easing),r=1-r;i.animate({opacity:r},a,t.easing),i.queue(e),V.effects.unshift(i,s,1+o)}),V.effects.define("shake",function(t,e){var i=1,s=V(this),n=t.direction||"left",o=t.distance||20,a=t.times||3,r=2*a+1,l=Math.round(t.duration/r),h="up"===n||"down"===n?"top":"left",c="up"===n||"left"===n,u={},d={},p={},n=s.queue().length;for(V.effects.createPlaceholder(s),u[h]=(c?"-=":"+=")+o,d[h]=(c?"+=":"-=")+2*o,p[h]=(c?"-=":"+=")+2*o,s.animate(u,l,t.easing);i<a;i++)s.animate(d,l,t.easing).animate(p,l,t.easing);s.animate(d,l,t.easing).animate(u,l/2,t.easing).queue(e),V.effects.unshift(s,n,1+r)}),V.effects.define("slide","show",function(t,e){var i,s,n=V(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r,c=t.distance||n["top"==l?"outerHeight":"outerWidth"](!0),u={};V.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[l],u[l]=(h?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(l,u[l]),u.clip=i,u[l]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),y=!1!==V.uiBackCompat?V.effects.define("transfer",function(t,e){V(this).transfer(t,e)}):y;V.ui.focusable=function(t,e){var i,s,n,o,a=t.nodeName.toLowerCase();return"area"===a?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(s=V("img[usemap='#"+s+"']")).length&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(a)?(n=!t.disabled)&&(o=V(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===a&&t.href||e,n&&V(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(V(t)))},V.extend(V.expr.pseudos,{focusable:function(t){return V.ui.focusable(t,null!=V.attr(t,"tabindex"))}});var Q,J;V.ui.focusable,V.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):V(this[0].form)},V.ui.formResetMixin={_formResetHandler:function(){var e=V(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");V.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(V.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}};V.expr.pseudos||(V.expr.pseudos=V.expr[":"]),V.uniqueSort||(V.uniqueSort=V.unique),V.escapeSelector||(Q=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,J=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},V.escapeSelector=function(t){return(t+"").replace(Q,J)}),V.fn.even&&V.fn.odd||V.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}});var Z;V.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},V.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+V.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},V.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=V(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:V(this[0].ownerDocument||document)},V.extend(V.expr.pseudos,{tabbable:function(t){var e=V.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&V.ui.focusable(t,i)}}),V.fn.extend({uniqueId:(Z=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++Z)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&V(this).removeAttr("id")})}}),V.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(t){return t.find("> li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()<i.index()),c=this.options.animate||{},u=h&&c.down||c,h=function(){a._toggleComplete(e)};return n=(n="string"==typeof u?u:n)||u.easing||c.easing,o=(o="number"==typeof u?u:o)||u.duration||c.duration,i.length?t.length?(s=t.show().outerHeight(),i.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:n,complete:h,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===l&&(r+=e.now):"content"!==a.options.heightStyle&&(e.now=Math.round(s-i.outerHeight()-r),r=0)}})):i.animate(this.hideProps,o,n,h):t.animate(this.showProps,o,n,h)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),V.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=!(i=i||e.body).nodeName?e.body:i},V.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(V.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],V.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=V.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:V(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},i?0:this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","fal
13se")},_closeOnDocumentClick:function(t){return!V(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this._menuItems(this.active.children(".ui-menu")).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(t){return(t||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(t,e,i){var s;(s=this.active?"first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").last():this.active[t+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(e=V(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=V(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||V(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(String.prototype.trim.call(V(this).children(".ui-menu-item-wrapper").text()))})}});V.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value(
vendor: 12,087 bytes, line 13
13)},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==V.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=V("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:V.map(t,function(t){return"string"==typeof t?{label:t,value:t}:V.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(V.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;V.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return V("<li>").append(V("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(e))},100))}});V.ui.autocomplete;var tt=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(a=a.concat(e.get()))):void(V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(tt,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("<div></div>").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();
vendor: 1,426 bytes, line 13
13this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+V.escapeSelector(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(this)._form().length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V("<span>"),this.iconSpace=V("<span> </span>
13"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var et;V.ui.checkboxradio;V.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===V.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var i="iconPosition"!==t,s=i?this.options.iconPosition:e,t="top"===s||"bottom"===s;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=V("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,e),this._attachIcon(s),t?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconS
vendor: 13,579 bytes, line 13
13pace||(this.iconSpace=V("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=(void 0===t.showLabel?this.options:t).showLabel,i=(void 0===t.icon?this.options:t).icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),(this.element[0].disabled=e)&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==V.uiBackCompat&&(V.widget("ui.button",V.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),V.fn.button=(et=V.fn.button,function(i){var t="string"==typeof i,s=Array.prototype.slice.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t=V(this).attr("type"),e=V.data(this,"ui-"+("checkbox"!==t&&"radio"!==t?"button":"checkboxradio"));return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for button widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on button prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V(this).attr("type"),e="checkbox"!==t&&"radio"!==t?"button":"checkboxradio",t=V.data(this,"ui-"+e);t?(t.option(i||{}),t._init&&t._init()):"button"!=e?V(this).checkboxradio(V.extend({icon:!1},i)):et.call(V(this),i)})),n}),V.fn.buttonset=function(){return V.ui.controlgroup||V.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var it;V.ui.button;function st(){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:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},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,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=nt(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function nt(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,ot)}function ot(){V.datepicker._isDisabledDatepicker((it.inline?it.dpDiv.parent():it.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function at(t,e){for(var i in V.extend(t,e),e)null==e[i]&&(t[i]=e[i]);return t}V.extend(V.ui,{datepicker:{version:"1.13.2"}}),V.extend(st.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return at(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(V(t),n)).settings=V.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?nt(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=V(t);e.append=V([]),e.trigger=V([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),V.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s=this._get(e,"appendText"),n=this._get(e,"isRTL");e.append&&e.append.remove(),s&&(e.append=V("<span>").addClass(this._appendClass).text(s),t[n?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(i=this._get(e,"showOn"))&&"both"!==i||t.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(s=this._get(e,"buttonText"),i=this._get(e,"buttonImage"),this._get(e,"buttonImageOnly")?e.trigger=V("<img>").addClass(this._triggerClass).attr({src:i,alt:s,title:s}):(e.trigger=V("<button type='button'>").addClass(this._triggerClass),i?e.trigger.html(V("<img>").attr({src:i,alt:s,title:s})):e.trigger.text(s)),t[n?"before":"after"](e.trigger),e.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===t[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==t[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,o,a;this._get(t,"autoSize")&&!t.inline&&(o=new Date(2009,11,20),(a=this._get(t,"dateFormat")).match(/[DM]/)&&(e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length))},_inlineDatepicker:function(t,e){var i=V(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),V.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a=this._dialogInst;return a||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",a)),at(a.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,e=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[o/2-100+e,s/2-150+n]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",a),this},_destroyDatepicker:function(t){var e,i=V(t),s=V.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),V.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),it===s&&(it=null,this._curInst=null))},_enableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return V.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,o=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?V.extend({},V.datepicker._defaults):o?"all"===e?V.extend({},o.settings):this._get(o,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),o&&(this._curInst===o&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),e=this._getMinMaxDate(o,"min"),i=this._getMinMaxDate(o,"max"),at(o.settings,s),null!==e&&void 0!==s.dateFormat&&void 0===s.minDate&&(o.settings.minDate=this._formatDate(o,e)),null!==i&&void 0!==s.dateFormat&&void 0===s.maxDate&&(o.settings.maxDate=this._formatDate(o,i)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(V(t),o),this._autoSize(o),this._setDate(o,n),this._updateAlternate(o),this._updateDatepicker(o))}
vendor: 3,508 bytes, line 13
13,_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){t=this._getInst(t);t&&this._updateDatepicker(t)},_setDateDatepicker:function(t,e){t=this._getInst(t);t&&(this._setDate(t,e),this._updateDatepicker(t),this._updateAlternate(t))},_getDateDatepicker:function(t,e){t=this._getInst(t);return t&&!t.inline&&this._setDateFromField(t,e),t?this._getDate(t):null},_doKeyDown:function(t){var e,i,s=V.datepicker._getInst(t.target),n=!0,o=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,V.datepicker._datepickerShowing)switch(t.keyCode){case 9:V.datepicker._hideDatepicker(),n=!1;break;case 13:return(i=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",s.dpDiv))[0]&&V.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),(e=V.datepicker._get(s,"onSelect"))?(i=V.datepicker._formatDate(s),e.apply(s.input?s.input[0]:null,[i,s])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&V.datepicker._clearDate(t.target),n=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&V.datepicker._gotoToday(t.target),n=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?1:-1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,-7,"D"),n=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?-1:1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,7,"D"),n=t.ctrlKey||t.metaKey;break;default:n=!1}else 36===t.keyCode&&t.ctrlKey?V.datepicker._showDatepicker(this):n=!1;n&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i=V.datepicker._getInst(t.target);if(V.datepicker._get(i,"constrainInput"))return e=V.datepicker._possibleChars(V.datepicker._get(i,"dateFormat")),i=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||i<" "||!e||-1<e.indexOf(i)},_doKeyUp:function(t){t=V.datepicker._getInst(t.target);if(t.input.val()!==t.lastVal)try{V.datepicker.parseDate(V.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,V.datepicker._getFormatConfig(t))&&(V.datepicker._setDateFromField(t),V.datepicker._updateAlternate(t),V.datepicker._updateDatepicker(t))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=V("input",t.parentNode)[0]),V.datepicker._isDisabledDatepicker(t)||V.datepicker._lastInput===t||(n=V.datepicker._getInst(t),V.datepicker._curInst&&V.datepicker._curInst!==n&&(V.datepicker._curInst.dpDiv.stop(!0,!0),n&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0])),!1!==(i=(s=V.datepicker._get(n,"beforeShow"))?s.apply(t,[t,n]):{})&&(at(n.settings,i),n.lastVal=null,V.datepicker._lastInput=t,V.datepicker._setDateFromField(n),V.datepicker._inDialog&&(t.value=""),
vendor: 32,153 bytes, line 13
13V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(t),V.datepicker._pos[1]+=t.offsetHeight),e=!1,V(t).parents().each(function(){return!(e|="fixed"===V(this).css("position"))}),s={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(n),s=V.datepicker._checkOffset(n,s,e),n.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":e?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),n.inline||(i=V.datepicker._get(n,"showAnim"),s=V.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(V(t))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[i]?n.dpDiv.show(i,V.datepicker._get(n,"showOptions"),s):n.dpDiv[i||"show"](i?s:null),V.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),V.datepicker._curInst=n)))},_updateDatepicker:function(t){this.maxRows=4,(it=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a"),o=V.datepicker._get(t,"onUpdateDatepicker");0<n.length&&ot.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year").first().replaceWith(t.yearshtml),e=t.yearshtml=null},0)),o&&o.apply(t.input?t.input[0]:null,[t])},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:V(document).scrollLeft()),l=document.documentElement.clientHeight+(i?0:V(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-o:0,e.left-=i&&e.left===t.input.offset().left?V(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+a?V(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>l&&n<l?Math.abs(n+a):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||V.expr.pseudos.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return[(e=V(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s=this._curInst;!s||t&&s!==V.data(t,"datepicker")||this._datepickerShowing&&(e=this._get(s,"showAnim"),i=this._get(s,"duration"),t=function(){V.datepicker._tidyDialog(s)},V.effects&&(V.effects.effect[e]||V.effects[e])?s.dpDiv.hide(e,V.datepicker._get(s,"showOptions"),i,t):s.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?i:null,t),e||t(),this._datepickerShowing=!1,(t=this._get(s,"onClose"))&&t.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI&&(V.unblockUI(),V("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e;V.datepicker._curInst&&(e=V(t.target),t=V.datepicker._getInst(e[0]),(e[0].id===V.datepicker._mainDivId||0!==e.parents("#"+V.datepicker._mainDivId).length||e.hasClass(V.datepicker.markerClassName)||e.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)&&(!e.hasClass(V.datepicker.markerClassName)||V.datepicker._curInst===t)||V.datepicker._hideDatepicker())},_adjustDate:function(t,e,i){var s=V(t),t=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(t,e,i),this._updateDatepicker(t))},_gotoToday:function(t){var e=V(t),i=this._getInst(e[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(t=new Date,i.selectedDay=t.getDate(),i.drawMonth=i.selectedMonth=t.getMonth(),i.drawYear=i.selectedYear=t.getFullYear()),this._notifyChange(i),this._adjustDate(e)},_selectMonthYear:function(t,e,i){var s=V(t),t=this._getInst(s[0]);t["selected"+("M"===i?"Month":"Year")]=t["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(t),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=V(t);V(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(n[0])||((n=this._getInst(n[0])).selectedDay=n.currentDay=parseInt(V("a",s).attr("data-date")),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){t=V(t);this._selectDate(t,"")},_selectDate:function(t,e){var i=V(t),t=this._getInst(i[0]);e=null!=e?e:this._formatDate(t),t.input&&t.input.val(e),this._updateAlternate(t),(i=this._get(t,"onSelect"))?i.apply(t.input?t.input[0]:null,[e,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s=this._get(t,"altField");s&&(e=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),t=this.formatDate(e,i,this._getFormatConfig(t)),V(document).find(s).val(t))},noWeekends:function(t){t=t.getDay();return[0<t&&t<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(e,n,t){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;for(var i,s,o,a=0,r=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,r="string"!=typeof r?r:(new Date).getFullYear()%100+parseInt(r,10),l=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,h=(t?t.dayNames:null)||this._defaults.dayNames,c=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,u=(t?t.monthNames:null)||this._defaults.monthNames,d=-1,p=-1,f=-1,g=-1,m=!1,_=function(t){t=w+1<e.length&&e.charAt(w+1)===t;return t&&w++,t},v=function(t){var e=_(t),e="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,e=new RegExp("^\\d{"+("y"===t?e:1)+","+e+"}"),e=n.substring(a).match(e);if(!e)throw"Missing number at position "+a;return a+=e[0].length,parseInt(e[0],10)},b=function(t,e,i){var s=-1,e=V.map(_(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(V.each(e,function(t,e){var i=e[1];if(n.substr(a,i.length).toLowerCase()===i.toLowerCase())return s=e[0],a+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+a},y=function(){if(n.charAt(a)!==e.charAt(w))throw"Unexpected literal at position "+a;a++},w=0;w<e.length;w++)if(m)"'"!==e.charAt(w)||_("'")?y():m=!1;else switch(e.charAt(w)){case"d":f=v("d");break;case"D":b("D",l,h);break;case"o":g=v("o");break;case"m":p=v("m");break;case"M":p=b("M",c,u);break;case"y":d=v("y");break;case"@":d=(o=new Date(v("@"))).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"!":d=(o=new Date((v("!")-this._ticksTo1970)/1e4)).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"'":_("'")?y():m=!0;break;default:y()}if(a<n.length&&(s=n.substr(a),!/^\s+/.test(s)))throw"Extra/unparsed characters found in date: "+s;if(-1===d?d=(new Date).getFullYear():d<100&&(d+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d<=r?0:-100)),-1<g)for(p=1,f=g;;){if(f<=(i=this._getDaysInMonth(d,p-1)))break;p++,f-=i}if((o=this._daylightSavingAdjust(new Date(d,p-1,f))).getFullYear()!==d||o.getMonth()+1!==p||o.getDate()!==f)throw"Invalid date";return o},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:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function s(t,e,i){var s=""+e;if(c(t))for(;s.length<i;)s="0"+s;return s}function n(t,e,i,s){return(c(t)?s:i)[e]}var o,a=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,h=(i?i.monthNames:null)||this._defaults.monthNames,c=function(t){t=o+1<e.length&&e.charAt(o+1)===t;return t&&o++,t},u="",d=!1;if(t)for(o=0;o<e.length;o++)if(d)"'"!==e.charAt(o)||c("'")?u+=e.charAt(o):d=!1;else switch(e.charAt(o)){case"d":u+=s("d",t.getDate(),2);break;case"D":u+=n("D",t.getDay(),a,r);break;case"o":u+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=s("m",t.getMonth()+1,2);break;case"M":u+=n("M",t.getMonth(),l,h);break;case"y":u+=c("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":c("'")?u+="'":d=!0;break;default:u+=e.charAt(o)}return u},_possibleChars:function(e){for(var t="",i=!1,s=function(t){t=n+1<e.length&&e.charAt(n+1)===t;return t&&n++,t},n=0;n<e.length;n++)if(i)"'"!==e.charAt(n)||s("'")?t+=e.charAt(n):i=!1;else switch(e.charAt(n)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":s("'")?t+="'":i=!0;break;default:t+=e.charAt(n)}return t},_get:function(t,e){return(void 0!==t.settings[e]?t.settings:this._defaults)[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s,t=null==t||""===t?e:"string"==typeof t?function(t){try{return V.datepicker.parseDate(V.datepicker._get(r,"dateFormat"),t,V.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?V.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(t);a;){switch(a[2]||"d"){case"d":case"D":n+=parseInt(a[1],10);break;case"w":case"W":n+=7*parseInt(a[1],10);break;case"m":case"M":s+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s))}a=o.exec(t)}return new Date(i,s,n)}(t):"number"==typeof t?isNaN(t)?e:(i=t,(s=new Date).setDate(s.getDate()+i),s):new Date(t.getTime());return(t=t&&"Invalid Date"===t.toString()?e:t)&&(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)),this._daylightSavingAdjust(t)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,e=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=e.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=e.getMonth(),t.drawYear=t.selectedYear=t.currentYear=e.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){V.datepicker._adjustDate(i,-e,"M")},next:function(){V.datepicker._adjustDate(i,+e,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(i)},selectDay:function(){return V.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(i,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,x,k,C,D,I,T,P,M,S,H,z,A=new Date,O=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth(),A.getDate())),N=this._get(t,"isRTL"),E=this._get(t,"showButtonPanel"),W=this._get(t,"hideIfNoPrevNext"),F=this._get(t,"navigationAsDateFormat"),L=this._getNumberOfMonths(t),R=this._get(t,"showCurrentAtPos"),A=this._get(t,"stepMonths"),Y=1!==L[0]||1!==L[1],B=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),j=this._getMinMaxDate(t,"min"),q=this._getMinMaxDate(t,"max"),K=t.drawMonth-R,U=t.drawYear;if(K<0&&(K+=12,U--),q)for(e=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth()-L[0]*L[1]+1,q.getDate())),e=j&&e<j?j:e;this._daylightSavingAdjust(new Date(U,K,1))>e;)--K<0&&(K=11,U--);for(t.drawMonth=K,t.drawYear=U,R=this._get(t,"prevText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K-A,1)),this._getFormatConfig(t)):R,i=this._canAdjustMonth(t,-1,U,K)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML,R=this._get(t,"nextText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K+A,1)),this._getFormatConfig(t)):R,s=this._canAdjustMonth(t,1,U,K)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:R}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML,A=this._get(t,"currentText"),W=this._get(t,"gotoCurrent")&&t.currentDay?B:O,A=F?this.formatDate(A,W,this._getFormatConfig(t)):A,R="",t.inline||(R=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(t,"closeText"))[0].outerHTML),F="",E&&(F=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(N?R:"").append(this._isInRange(t,W)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(A):"").append(N?"":R)[0].outerHTML),n=parseInt(this._get(t,"firstDay"),10),n=isNaN(n)?0:n,o=this._get(t,"showWeek"),a=this._get(t,"dayNames"),r=this._get(t,"dayNamesMin"),l=this._get(t,"monthNames"),h=this._get(t,"monthNamesShort"),c=this._get(t,"beforeShowDay"),u=this._get(t,"showOtherMonths"),d=this._get(t,"selectOtherMonths"),p=this._getDefaultDate(t),f="",m=0;m<L[0];m++){for(_="",this.maxRows=4,v=0;v<L[1];v++){if(b=this._daylightSavingAdjust(new Date(U,K,t.selectedDay)),y=" ui-corner-all",w="",Y){if(w+="<div class='ui-datepicker-group",1<L[1])switch(v){case 0:w+=" ui-datepicker-group-first",y=" ui-corner-"+(N?"right":"left");break;case L[1]-1:w+=" ui-datepicker-group-last",y=" ui-corner-"+(N?"left":"right");break;default:w+=" ui-datepicker-group-middle",y=""}w+="'>"}for(w+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+y+"'>"+(/all|left/.test(y)&&0===m?N?s:i:"")+(/all|right/.test(y)&&0===m?N?i:s:"")+this._generateMonthYearHeader(t,K,U,j,q,0<m||0<v,l,h)+"</div><table class='ui-datepicker-calendar'><thead><tr>",x=o?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",g=0;g<7;g++)x+="<th scope='col'"+(5<=(g+n+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+a[k=(g+n)%7]+"'>"+r[k]+"</span></th>";for(w+=x+"</tr></thead><tbody>",D=this._getDaysInMonth(U,K),U===t.selectedYear&&K===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,D)),C=(this._getFirstDayOfMonth(U,K)-n+7)%7,D=Math.ceil((C+D)/7),I=Y&&this.maxRows>D?this.maxRows:D,this.maxRows=I,T=this._daylightSavingAdjust(new Date(U,K,1-C)),P=0;P<I;P++){for(w+="<tr>",M=o?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(T)+"</td>":"",g=0;g<7;g++)S=c?c.apply(t.input?t.input[0]:null,[T]):[!0,""],z=(H=T.getMonth()!==K)&&!d||!S[0]||j&&T<j||q&&q<T,M+="<td class='"+(5<=(g+n+6)%7?" ui-datepicker-week-end":"")+(H?" ui-datepicker-other-month":"")+(T.getTime()===b.getTime()&&K===t.selectedMonth&&t._keyEvent||p.getTime()===T.getTime()&&p.getTime()===b.getTime()?" "+this._dayOverClass:"")+(z?" "+this._unselectableClass+" ui-state-disabled":"")+(H&&!u?"":" "+S[1]+(T.getTime()===B.getTime()?" "+this._currentClass:"")+(T.getTime()===O.getTime()?" ui-datepicker-today":""))+"'"+(H&&!u||!S[2]?"":" title='"+S[2].replace(/'/g,"'")+"'")+(z?"":" data-handler='selectDay' data-event='click' data-month='"+T.getMonth()+"' data-year='"+T.getFullYear()+"'")+">"+(H&&!u?" ":z?"<span class='ui-state-default'>"+T.getDate()+"</span>":"<a class='ui-state-default"+(T.getTime()===O.getTime()?" ui-state-highlight":"")+(T.getTime()===B.getTime()?" ui-state-active":"")+(H?" ui-priority-secondary":"")+"' href='#' aria-current='"+(T.getTime()===B.getTime()?"true":"false")+"' data-date='"+T.getDate()+"'>"+T.getDate()+"</a>")+"</td>",T.setDate(T.getDate()+1),T=this._daylightSavingAdjust(T);w+=M+"</tr>"}11<++K&&(K=0,U++),_+=w+="</tbody></table>"+(Y?"</div>"+(0<L[0]&&v===L[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}f+=_}return f+=F,t._keyEvent=!1,f},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="<div class='ui-datepicker-title'>",y="";if(o||!f)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' aria-label='"+_+"' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!l||c>=s.getMonth())&&(!h||c<=n.getMonth())&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(m||(b+=y+(!o&&f&&g?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!g)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="<select class='ui-datepicker-year' aria-label='"+v+"' data-handler='selectYear' data-event='change'>";d<=p;d++)t.yearshtml+="<option value='"+d+"'"+(d===i?" selected='selected'":"")+">"+d+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":" ")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e<i?i:e;return t&&t<e?t:e},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){t=this._get(t,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),n=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(t,n)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=null,o=null,a=this._get(t,"yearRange");return a&&(t=a.split(":"),a=(new Date).getFullYear(),n=parseInt(t[0],10),o=parseInt(t[1],10),t[0].match(/[+\-].*/)&&(n+=a),t[1].match(/[+\-].*/)&&(o+=a)),(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!o||e.getFullYear()<=o)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new st,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker,V.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var rt=!1;V(document).on("mouseup",function(){rt=!1});V.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===V.data(t.target,e.widgetName+".preventClickEvent"))return V.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!rt){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&V(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===V.data(t.target,this.widgetName+".preventClickEvent")&&V.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),rt=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(V.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&V.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,rt=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},V.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&V(t).trigger("blur")};V.widget("ui.draggable",V.ui.mouse,{version:"1.13.2",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,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<V(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=V(this);return V("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=V.ui.safeActiveElement(this.document[0]);V(t.target).closest(e).length||V.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===V(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),V.ui.ddmanager&&!e.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),V.ui.ddmanager&&V.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new V.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return V.ui.ddmanager&&!this.options.dropBehaviour&&(i=V.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,i)?V(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),V.ui.ddmanager&&V.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),V.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new V.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!V(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i="function"==typeof e.helper,t=i?V(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}
vendor: 4,254 bytes, line 13
13:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_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 t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=V(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,V(n).width()-this.helperProportions.width-this.margins.left,(V(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[V(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,V(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,V(window).scrollLeft()+V(window).width()-this.helperProportions.width-this.margins.left,V(window).scrollTop()+(V(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,t=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:t?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:t?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s=this.options,n=this._isRootNode(this.scrollParent[0]),o=t.pageX,a=t.pageY;return n&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(o=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(a=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>
vendor: 586 bytes, line 13
13i[3]&&(a=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis&&(a=this.originalPageY)),{top:a
vendor: 6,471 bytes, line 13
13-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity?o.scrollTop=n=o.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(o.scrollTop=n=o.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity?o.scrollLeft=n=o.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(o.scrollLeft=n=o.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-V(a).scrollTop()<s.scrollSensitivity?n=V(a).scrollTop(V(a).scrollTop()-s.scrollSpeed):V(window).height()-(t.pageY-V(a).scrollTop())<s.scrollSensitivity&&(n=V(a).scrollTop(V(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-V(a).scrollLeft()<s.scrollSensitivity?n=V(a).scrollLeft(V(a).scrollLeft()-s.scrollSpeed):V(window).width()-(t.pageX-V(a).scrollLeft())<s.scrollSensitivity&&(n=V(a).scrollLeft(V(a).scrollLeft()+s.scrollSpeed)))),!1!==n&&V.ui.ddmanager&&!s.dropBehaviour&&V.ui.ddmanager.prepareOffsets(i,t)}}),V.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],V(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=V(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,o,a,r,l,h,c,u,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)l=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,c=(h=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||l+p<f||_<h-p||c+p<m||!V.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(h-_)<=p,n=Math.abs(c-m)<=p,o=Math.abs(r-g)<=p,a=Math.abs(l-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),a
vendor: 9,875 bytes, line 13
13&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left)),u=s||n||o||a,"outer"!==d.snapMode&&(s=Math.abs(h-m)<=p,n=Math.abs(c-_)<=p,o=Math.abs(r-f)<=p,a=Math.abs(l-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||n||o||a||u)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||o||a||u)}}),V.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=V.makeArray(V(i.stack)).sort(function(t,e){return(parseInt(V(t).css("zIndex"),10)||0)-(parseInt(V(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(V(i[0]).css("zIndex"),10)||0,V(i).each(function(t){V(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),V.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&V(e.helper).css("zIndex",i._zIndex)}});V.ui.draggable;V.widget("ui.resizable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===V(t).css("overflow"))return!1;var i=e&&"left"===e?"scrollLeft":"scrollTop",e=!1;if(0<t[i])return!0;try{t[i]=1,e=0<t[i],t[i]=0}catch(t){}return e},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),V.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(V("<div class='ui-wrapper'></div>").css({overflow:"hidden",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("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",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(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".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"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=String.prototype.trim.call(i[e])),n=V("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=V(s.containment).scrollLeft()||0,i+=V(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),s<n.maxWidth&&(n.maxWidth=s),t<n.maxHeight&&(n.maxHeight=t)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left
vendor: 5,511 bytes, line 13
13=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||V("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,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}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,n={width:i.size.width-a,height:i.size.height-o},a=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,o&&a?{top:o,left:a}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=V(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,a=o instanceof V?o.get(0):/parent/.test(o)?e.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(a,"left")?a.scrollWidth:o,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,a={top:0,left:0}
vendor: 2,289 bytes, line 13
13,r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(a=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-a.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-a.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-a.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var t=V(this).resizable("instance").options;V(t.alsoResize).each(function(){var t=V(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left
vendor: 32,344 bytes, line 13
13:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,u=Math.round((s.height-n.height)/h)*h,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>d,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<p-h?(e.size.height=p,e.position.top=o.top-u):(p=h-t.height,e.size.height=p,e.position.top=o.top+n.height-p),0<d-l?(e.size.width=d,e.position.left=o.left-c):(d=l-t.width,e.size.width=d,e.position.left=o.left+n.width-d))}});V.ui.resizable;V.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=V(this).css(t).offset().top;e<0&&V(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&V.fn.draggable&&this._makeDraggable(),this.options.resizable&&V.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?V(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:V.noop,enable:V.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||V.ui.safeBlur(V.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+V(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(V.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=!(t=!(t=!(t=!(t=t||this.element.find("[autofocus]")).length?this.element.find(":tabbable"):t).length?this.uiDialogButtonPane.find(":tabbable"):t).length?this.uiDialogTitlebarClose.filter(":tabbable"):t).length?this.uiDialog:t).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=V.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=V("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=V("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("<button type='button'></button>").button({label:V("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=V("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=V("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("<button></button>",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i,s;this.options.modal&&(i=V.fn.jquery.substring(0,4),s=!0,this._delay(function(){s=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;s||((e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable(),"3.4."!==i&&"3.5."!==i||e._delay(e._restoreTabbableFocus)))}.bind(this)),this.overlay=V("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});V.ui.dialog;function lt(t,e,i){return e<=t&&t<e+i}V.widget("ui.droppable",{version:"1.13.2",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof i?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t=t||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){V.ui.ddmanager.droppables[t]=V.ui.ddmanager.droppables[t]||[],V.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=V.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept="function"==typeof e?e:function(t){return t.is(e)}:"scope"===t&&(i=V.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=V.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=V.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||V.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=V(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&V.ui.intersect(i,V.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),V.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,a=n+t.helperProportions.width,r=o+t.helperProportions.height,l=e.offset.left,h=e.offset.top,c=l+e.proportions().width,u=h+e.proportions().height;switch(i){case"fit":return l<=n&&a<=c&&h<=o&&r<=u;case"intersect":return l<n+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&h<o+t.helperProportions.height/2&&r-t.helperProportions.height/2<u;case"pointer":return lt(s.pageY,h,e.proportions().height)&<(s.pageX,l,e.proportions().width);case"touch":return(h<=o&&o<=u||h<=r&&r<=u||o<h&&u<r)&&(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a);default:return!1}},!(V.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=V.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===o&&n[i]._activate.call(n[i],e),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return V.each((V.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&V.ui.intersect(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,o){n.options.refreshPositions&&V.ui.ddmanager.prepareOffsets(n,o),V.each(V.ui.ddmanager.droppables[n.options.scope]||[],function(){var t,e,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(i=V.ui.intersect(n,this,this.options.tolerance,o))&&this.isover?"isout":i&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return V(this).droppable("instance").options.scope===e})).length&&((t=V(i[0]).droppable("instance")).greedyChild="isover"===s)),t&&"isover"===s&&(t.isover=!1,t.isout=!0,t._out.call(t,o)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,o),t&&"isout"===s&&(t.isout=!1,t.isover=!0,t._over.call(t,o)))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)}})!==V.uiBackCompat&&V.widget("ui.droppable",V.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});V.ui.droppable,V.widget("ui.progressbar",{version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=V("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectable",V.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var i=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){i.elementPos=V(i.element[0]).offset(),i.selectees=V(i.options.filter,i.element[0]),i._addClass(i.selectees,"ui-selectee"),i.selectees.each(function(){var t=V(this),e=t.offset(),e={left:e.left-i.elementPos.left,top:e.top-i.elementPos.top};V.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=V("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],l=s.pageX,h=s.pageY;return l<a&&(t=l,l=a,a=t),h<r&&(t=h,h=r,r=t),this.helper.css({left:a,top:r,width:l-a,height:h-r}),this.selectees.each(function(){var t=V.data(this,"selectable-item"),e=!1,i={};t&&t.element!==n.element[0]&&(i.left=t.left+n.elementPos.left,i.right=t.right+n.elementPos.left,i.top=t.top+n.elementPos.top,i.bottom=t.bottom+n.elementPos.top,"touch"===o.tolerance?e=!(i.left>l||i.right<a||i.top>h||i.bottom<r):"fit"===o.tolerance&&(e=i.left>a&&i.right<l&&i.top>r&&i.bottom<h),e?(t.selected&&(n._removeClass(t.$element,"ui-selected"),t.selected=!1),t.unselecting&&(n._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1),t.selecting||(n._addClass(t.$element,"ui-selecting"),t.selecting=!0,n._trigger("selecting",s,{selecting:t.element}))):(t.selecting&&((s.metaKey||s.ctrlKey)&&t.startselected?(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,n._addClass(t.$element,"ui-selected"),t.selected=!0):(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,t.startselected&&(n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",s,{unselecting:t.element}))),t.selected&&(s.metaKey||s.ctrlKey||t.startselected||(n._removeClass(t.$element,"ui-selected"),t.selected=!1,n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",s,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,V(".ui-unselecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1,t.startselected=!1,i._trigger("unselected",e,{unselected:t.element})}),V(".ui-selecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-selecting")._addClass(t.$element,"ui-selected"),t.selecting=!1,t.selected=!0,t.startselected=!0,i._trigger("selected",e,{selected:t.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),V.widget("ui.selectmenu",[V.ui.formResetMixin,{version:"1.13.2",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=V()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.trigger("focus"),t.preventDefault()}}),this.element.hide(),this.button=V("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=V("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=V("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=V("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),i._setSelection(),i._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){e=e.item.data("ui-selectmenu-item");null!=i.focusIndex&&e.index!==i.focusIndex&&(i._trigger("focus",t,{item:e}),i.isOpen||i._select(e,t)),i.focusIndex=e.index,i.button.attr("aria-activedescendant",i.menuItems.eq(e.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(V.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=V("<span>");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";V.each(t,function(t,e){var i;e.optgroup!==o&&(i=V("<li>",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=V("<li>"),s=V("<div>",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var i,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](s).eq(-1):i[t+"All"](s).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")}
vendor: 4,336 bytes, line 13
13,_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.trigger("focus"))},_documentClick:{mousedown:function(t){this.isOpen&&(V(t.target).closest(".ui-selectmenu-menu, #"+V.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case V.ui.keyCode.TAB:case V.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case V.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case V.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case V.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case V.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case V.ui.keyCode.LEFT:this._move("prev",t);break;case V.ui.keyCode.RIGHT:this._move("next",t);break;case V.ui.keyCode.HOME:case V.ui.keyCode.PAGE_UP:this._move("first",t);break;case V.ui.keyCode.END:case V.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){t=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(t,e){var i;"icons"===t&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)),this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){e.hidden||s.push(i._parseOption(V(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),V.widget("ui.slider",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null}
vendor: 4,689 bytes, line 13
13,numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(V(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){V(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:Array.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=V("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,o,e,a,r=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),a={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(a),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-r.values(t));(e<s||s===e&&(t===r._lastChangedValue||r.values(t)===l.min))&&(s=e,n=V(this),o=t)}),!1!==this._start(t,o)&&(this._mouseSliding=!0,this._handleIndex=o,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),e=n.offset(),a=!V(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=a?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return(t=1<t?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),e=this._valueMin()+t*e,this._trimAlignValue(e)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value(
vendor: 4,839 bytes, line 13
13)},values:function(t,e){var i,s,n;if(1<arguments.length)return this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!Array.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i;if(arguments.length)return t=this.options.values[t],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(e=this.options.values.slice(),i=0;i<e.length;i+=1)e[i]=this._trimAlignValue(e[i]);return e}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,i=(t-this._valueMin())%e,t=t-i;return 2*Math.abs(i)>=e&&(t+=0<i?e:-e),parseFloat(t.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,l=!this._animateOff&&a.animate,h={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,h["horizontal"===r.orientation?"left":"bottom"]=i+"%",V(this).stop(1,1)[l?"animate":"css"](h,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,h["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](h,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=V(t.target).data("ui-slider-handle-index");switch(t.keyCode){case V.ui.keyCode.HOME:case V.ui.keyCode.END:case V.ui.keyCode.PAGE_UP:case V.ui.keyCode.PAGE_DOWN:case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(V(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case V.ui.keyCode.HOME:i=this._valueMin();break;case V.ui.keyCode.END:i=this._valueMax();break;case V.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;
vendor: 10,695 bytes, line 13
13case V.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=V(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(V(t.target),null,"ui-state-active"))}}}),V.widget("ui.sortable",V.ui.mouse,{version:"1.13.2",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,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),V.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,n=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),V(t.target).parents().each(function(){if(V.data(this,n.widgetName+"-item")===n)return i=V(this),!1}),!!(i=V.data(t.target,n.widgetName+"-item")===n?V(t.target):i)&&(!(this.options.handle&&!e&&(V(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,n,o=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=V("parent"!==o.appendTo?o.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},V.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),V.extend(this.offset,{parent:this._getParentOffset()}),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=V("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return V.ui.ddmanager&&(V.ui.ddmanager.current=this),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,n,o=this.options;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),o.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(n=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===n?"next":"prev"]()[0]===s||V.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&V.contains(this.element[0],s))){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,n,o;if(t)return V.ui.ddmanager&&!this.options.dropBehaviour&&V.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),o={},(n=this.options.axis)&&"x"!==n||(o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,V(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new V.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),V.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?V(this.domPosition.prev).after(this.currentItem):V(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},V(t).each(function(){var t=(V(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(V(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,h="x"===this.options.axis||r<s+h&&s+h<l,c="y"===this.options.axis||o<e+c&&e+c<a;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?h&&c:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this.dragDirection.vertical,t=this.dragDirection.horizontal;return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s
vendor: 4,080 bytes, line 13
13&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],a=[],r=this._connectWith();if(r&&t)for(e=r.length-1;0<=e;e--)for(i=(s=V(r[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&a.push(["function"==typeof n.options.items?n.options.items.call(n.element):V(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function l(){o.push(this)}for(a.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):V(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=a.length-1;0<=e;e--)a[e][0].each(l);return V(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=V.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,n,o,a,r,l,h=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):V(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(e=u.length-1;0<=e;e--)for(i=(s=V(u[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&(c.push(["function"==typeof n.options.items?n.options.items.call(n.element[0],t,{item:this.currentItem}):V(n.options.items,n.element),n]),this.containers.push(n));for(e=c.length-1;0<=e;e--)for(o=c[e][1],l=(a=c[e][i=0]).length;i<l;i++)(r=V(a[i])).data(this.widgetName+"-item",o),h.push({item:r,instance:o,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?V(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,n,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,n=i.currentItem[0].nodeName.toLowerCase(),o.placeholder={element:function(){var t=V("<"+n+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===n?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),V("<tr>",i.document[0]).appendTo(t)):"tr"===n?i._createTrPlaceholder(i.currentItem,t):"img"===n&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()
vendor: 36,944 bytes, lines 13-14
13||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=V(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){V("<td> </td>",i.document[0]).attr("colspan",V(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,l,h,c=null,u=null,d=this.containers.length-1;0<=d;d--)V.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&V.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(l=c.floating||this._isFloating(this.currentItem))?"left":"top",o=l?"width":"height",h=l?"pageX":"pageY",e=this.items.length-1;0<=e;e--)V.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[h]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[h]-a)<i&&(i=Math.abs(t[h]-a),s=this.items[e],this.direction=r?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[u]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[u].element,!0),this._trigger("change",t,this._uiHash()),this.containers[u]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[u],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?V(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[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")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&V.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_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 t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=V(i.containment)[0],e=V(i.containment).offset(),i="hidden"!==V(t).css("overflow"),this.containment=[e.left+(parseInt(V(t).css("borderLeftWidth"),10)||0)+(parseInt(V(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(V(t).css("borderTopWidth"),10)||0)+(parseInt(V(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(V(t).css("borderLeftWidth"),10)||0)-(parseInt(V(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(V(t).css("borderTopWidth"),10)||0)-(parseInt(V(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===V.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||V([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}});function ht(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}V.widget("ui.spinner",{version:"1.13.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return V.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){var i=V.ui.safeActiveElement(this.document[0]);if(this.element[0]===i&&e){if(!this.spinning&&!this._start(t))return!1;this._spin((0<e?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var e;function i(){this.element[0]===V.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e}))}e=this.element[0]===V.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(V(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var e=this.options,i=V.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,e.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-e.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var e=this.options.incremental;return e?"function"==typeof e?e(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_adjustValue:function(t){var e=this.options,i=null!==e.min?e.min:0,s=t-i;return t=i+Math.round(s/e.step)*e.step,t=parseFloat(t.toFixed(this._precision())),null!==e.max&&t>e.max?e.max:null!==e.min&&t<e.min?e.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,e.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:ht(function(t){this._super(t)}),_parse:function(t){return""===(t="string"==typeof t&&""!==t?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t:t)||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:ht(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:ht(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:ht(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:ht(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());ht(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==V.uiBackCompat&&V.widget("ui.spinner",V.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});var ct;V.ui.spinner;V.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(ct=/#.*$/,function(t){var e=t.href.replace(ct,""),i=location.href.replace(ct,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=V.uniqueSort(t.disabled.concat(V.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=V(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(V(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):V()}},_tabKeydown:function(t){var e=V(V.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:i++;break;case V.ui.keyCode.UP:case V.ui.keyCode.LEFT:s=!1,i--;break;case V.ui.keyCode.END:i=this.anchors.length-1;break;case V.ui.keyCode.HOME:i=0;break;case V.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case V.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===V.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===V.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===V.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==V.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=V.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!V.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=V()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=V()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){V(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){V(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return V("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=V(),this.anchors.each(function(t,e){var i,s,n,o=V(e).uniqueId().attr("id"),a=V(e).closest("li"),r=a.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(n=a.attr("aria-controls")||V({}).uniqueId()[0].id,(s=l.element.find(i="#"+n)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return V("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=V(e),!0===t||-1!==V.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=V(this).outerHeight(!0)}),this.panels.each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,V(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):V(),i={oldTab:i,oldPanel:r,newTab:o?V():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?V():s,this.xhr&&this.xhr.abort(),r.length||a.length||V.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===V(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return!1===t?V():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+V.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){V.data(this,"ui-tabs-destroy")?V(this).remove():V(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=V(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?V.map(t,function(t){return t!==i?t:null}):V.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==V.inArray(t,e))return;e=Array.isArray(e)?V.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=V.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,V.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=V(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==V.uiBackCompat&&V.widget("ui.tabs",V.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});V.ui.tabs;V.widget("ui.tooltip",{version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=V(this).attr("title");return V("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=V.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=String.prototype.trim.call(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=V("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=V([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&V.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=V(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=V(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=V([])},open:function(t){var i=this,e=V(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=V(this);e.data("ui-tooltip-open")&&((t=V.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){s._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=n),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a=V.extend({},this.options.position);function r(t){a.of=t,n.is(":hidden")||n.position(a)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(i=V("<div>").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),i.removeAttr("id").find("[id]").removeAttr("id"),i.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):n.position(V.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(r(a.of),clearInterval(o))},13)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===V.ui.keyCode.ESCAPE&&((t=V.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){var t=this._find(e);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=V(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(V(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&V.each(this.parents,function(t,e){V(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=V("<div>").attr("role","tooltip"),i=V("<div>").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=!t.length?this.document[0].body:t},_destroy:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),V("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==V.uiBackCompat&&V.widget("ui.tooltip",V.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});V.ui.tooltip}); 14!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];
vendor: 4,587 bytes, lines 14-15
14if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e}function o(t,e,r){return this instanceof o?("string"==typeof t&&(t=document.querySelectorAll(t)),this.elements=n(t),this.options=i({},this.options),"function"==typeof e?r=e:i(this.options,e),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(function(){this.check()}.bind(this))):new o(t,e,r)}function r(t){this.img=t}function s(t,e){this.url=t,this.element=e,this.img=new Image}var h=t.jQuery,a=t.console;o.prototype=Object.create(e.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&d[e]){for(var i=t.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var d={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(e.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,t),n=i.exec(e.backgroundImage)}},o.prototype.addImage=function(t){var e=new r(t);this.images.push(e)},o.prototype.addBackground=function(t,e){var i=new s(t,e);this.images.push(i)},o.prototype.check=function(){function t(t,i,n){setTimeout(function(){e.progress(t,i,n)})}var e=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},o.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,t,e)},o.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},r.prototype=Object.create(e.prototype),r.prototype.check=function(){var t=this.getIsImageComplete();return t?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},r.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},r.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var t=this.getIsImageComplete();t&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},o.makeJQueryPlugin=function(e){e=e||t.jQuery,e&&(h=e,h.fn.imagesLoaded=function(t,e){var i=new o(this,t,e);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o}); 15!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];
vendor: 4,097 bytes, line 15
15if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);r.isBoxSizeOuter=s=200==t(o.width),i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["de
15sandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e},i.makeArray=function(t){var e=[];if(Array.isArray(t))e=t;else if(t&&"object"==typeof t&&"number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];t&&clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i||100)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var n=t.console;return i.htmlInit=function(e,o){i.docReady(function(){var r=i.toDashed(o),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(n&&n.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,o,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=this.layout.size,s=-1!=n.indexOf("%")?parseFloat(n)/100*r.width:parseInt(n,10),a=-1!=o.indexOf("%")?parseFloat(o)/100*r.height:parseInt(o,10);s=isNaN(s)?0:s,a=isNaN(a)?0:a,s-=e?r.paddingLeft:r.paddingRight,a-=i?r.paddingTop:r.paddingBottom,this.position.x=s,this.position.y=a},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return void this.layoutPosition();var a=t-i,h=e-n,u={};u.transform=this.getTranslate(a,h),this.transition({to:u,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10
vendor: 14,210 bytes, line 15
15)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
15 16;(function($){ 17if( typeof $.datepicker === 'undefined' ){ 18console.log( 'tig.datepicker cannot be initialized. UI Datepicker is missed or included after tig.datepicker...' ); 19return; 20} 21$.extend($.ui, { tigDatepicker: { version: "0.8.7" } }); 22var PROP_NAME = "tigDatepicker", 23dpuuid = new Date().getTime(), 24instActive, 25oneDaySeconds = 86400000, 26defaultOptions = { 27maxBookedNights: 30, 28checkAvailabilityOnLoad: true, 29showDaysTitle: false, 30showPossibleBookingDays: true, 31dateFormat: 'd/m/y' 32}; 33function TigDatepicker(){ 34this.markerClassName = 'hasDatepicker tig-calendar'; 35this.checkProcessing = 0; 36this.availability = {}; 37this._attachHandlers = function( inst ){ 38var stepMonths = this._get(inst, "stepMonths"), 39id = "#" + inst.id.replace( /\\\\/g, "\\" ), 40handlers, events; 41inst.dpDiv.find("[data-handler]").map(function () { 42handlers = (this.getAttribute("data-handler")).split( ' ' ); 43events = (this.getAttribute("data-event")).split( ' ' ); 44var handler = { 45prev: function () { 46window["DP_jQuery_" + dpuuid].tigDatepicker._adjustDate(id, -stepMonths, "M"); 47}, 48next: function () { 49window["DP_jQuery_" + dpuuid].tigDatepicker._adjustDate(id, +stepMonths, "M"); 50}, 51hide: function () { 52window["DP_jQuery_" + dpuuid].tigDatepicker._hideDatepicker(); 53}, 54today: function () { 55window["DP_jQuery_" + dpuuid].tigDatepicker._gotoToday(id); 56}, 57selectDay: function () { 58var $td = $( this ).parent("td"); 59window["DP_jQuery_" + dpuuid].tigDatepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), $td); 60return false; 61}, 62selectUnavailableDay: function () { 63var $td = $( this ).parent("td"); 64window["DP_jQuery_" + dpuuid].tigDatepicker._selectUnavailableDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), $td); 65return false; 66}, 67mouseEnterDay: function () { 68var $td = $( this ).parent("td"); 69window["DP_jQuery_" + dpuuid].tigDatepicker._mouseEnterDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), $td); 70}, 71selectMonth: function () { 72window["DP_jQuery_" + dpuuid].tigDatepicker._selectMonthYear(id, this, "M"); 73return false; 74}, 75selectYear: function () { 76window["DP_jQuery_" + dpuuid].tigDatepicker._selectMonthYear(id, this, "Y"); 77return false; 78}, 79mouseLeaveCalendar: function () { 80window["DP_jQuery_" + dpuuid].tigDatepicker._mouseLeaveCalendar(id); 81} 82}; 83for( var i = 0; i <= events.length; i++ ){ 84$( this ).bind( events[i], handler[handlers[i]] ); 85} 86}); 87}; 88this._updateAlternate = function( inst ){ 89var altFormat, date, dateStr, arrivalDate, departureDate, 90altField = this._get( inst, "altField" ), 91altFieldArrival = this._get( inst, "altFieldArrival" ), 92altFieldDeparture = this._get( inst, "altFieldDeparture" ); 93if( altField ){ // update alternate field too 94altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" ); 95date = this._getDate( inst ); 96dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) ); 97$( altField ).each( function(){ $( this ).val( dateStr ); } ); 98} 99if(altFieldArrival ) { // update alternate field too 100altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" ); 101if( inst.arrivalDate ){ 102date = this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ); 103dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) ); 104$( altFieldArrival ).each( function(){ $( this ).val( dateStr ); } ); 105}else{ 106$( altFieldArrival ).each( function(){ $( this ).val( '' ); } ); 107} 108} 109if( altFieldDeparture ){ // update alternate field too 110altFormat = this._get( inst, "altFormat") || this._get( inst, "dateFormat" ); 111if( inst.departureDate ){ 112date = this.parseDate( this._get( inst, "dateFormat" ), inst.departureDate, this._getFormatConfig( inst ) ); 113dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) ); 114$( altFieldDeparture ).each( function(){ $( this ).val( dateStr ); } ); 115}else{ 116$( altFieldDeparture ).each( function(){ $( this ).val( '' ); } ); 117} 118} 119}; 120this._updateDatepicker = function(inst) { 121this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) 122instActive = inst; // for delegate hover events
123var monthSelect = inst.dpDiv && inst.dpDiv.find('select.ui-datepicker-month')[0]; 124var wasMonthSelectFocused = monthSelect && document.activeElement === monthSelect; 125inst.dpDiv.empty().append(this._generateHTML(inst)); 126this._attachHandlers(inst); 127if (wasMonthSelectFocused) { 128inst.dpDiv.find('select.ui-datepicker-month').focus(); 129} 130var origyearshtml, 131numMonths = this._getNumberOfMonths(inst), 132cols = numMonths[1], 133width = 17; 134inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); 135if (cols > 1) { 136inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em"); 137} 138inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + 139"Class"]("ui-datepicker-multi"); 140inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + 141"Class"]("ui-datepicker-rtl"); 142var focusInsideDatepicker = inst.dpDiv && $.contains(inst.dpDiv[0], document.activeElement); 143if (!inst._monthYearSelection && !focusInsideDatepicker && inst === $.tigDatepicker._curInst && $.tigDatepicker._datepickerShowing && inst.input && 144inst.input.is(":visible") && !inst.input.is(":disabled") && inst.input[0] !== document.activeElement) { 145inst.input.focus(); 146} 147if( inst.yearshtml ){ 148origyearshtml = inst.yearshtml; 149setTimeout(function(){ 150if( origyearshtml === inst.yearshtml && inst.yearshtml ){ 151inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml); 152} 153origyearshtml = inst.yearshtml = null; 154}, 0); 155} 156}; 157this._checkAvailability = function( inst ){ 158var ths = this, i, dateId, params, 159numberOfMonths = this._get( inst, 'numberOfMonths' ), 160onStartCheckingAvailability = this._get( inst, 'onStartCheckingAvailability' ), 161startDate, endDate; 162if( inst.hotelId && inst.doAvailabilityCall && Cookie.getCookie('skip_aval_call') != 1 ){ 163for( i = 0; i < numberOfMonths; i++ ){ 164if( inst.drawMonth + i <= 12 ){ 165dateId = inst.drawYear + '-' + ( inst.drawMonth + i ); 166}else{ 167dateId = ( inst.drawYear + 1 ) + '-' + ( inst.drawMonth + i - 12 ); 168} 169if( typeof this.availability[inst.hotelId] === 'undefined' || typeof this.availability[inst.hotelId][dateId] === 'undefined' ){ 170if( typeof this.availability[inst.hotelId] === 'undefined' ){ 171this.availability[inst.hotelId] = {}; 172this.availability[inst.hotelId][dateId] = []; 173} 174if( typeof this.availability[inst.hotelId][dateId] === 'undefined' ){ 175this.availability[inst.hotelId][dateId] = []; 176} 177startDate = new Date( inst.drawYear, inst.drawMonth + i, 1 ); 178endDate = new Date( inst.drawYear, inst.drawMonth + i + 1, 0 ); 179if( startDate.getTime() < ( new Date() ).getTime() ){ 180startDate = new Date(); 181} 182if( this.checkProcessing == 0 ){ 183if( onStartCheckingAvailability ){ 184onStartCheckingAvailability.apply((inst.input ? inst.input[0] : null)); 185} 186this.showLoader( inst ); 187} 188this.checkProcessing++; 189params = { 190'hotel_id': inst.hotelId, 191'start_date': this._formatDate( inst, startDate ), 192'end_date': this._formatDate( inst, endDate ) 193}; 194var additional_params = inst.additional_availability_params; 195if ( typeof additional_params === 'object' ) { 196jQuery.extend( params, additional_params ); 197} 198(function(){ 199var hotelID = params.hotel_id, 200dateID = dateId, 201instance = inst; 202jQuery.ez( "Calendar::fetch::" + JSON.stringify( params ), {}, function( data ){ 203if( typeof data.content.unavailable_days !== 'undefined' ){ 204ths._implementNewUnavailableDays( instance, hotelID, dateID, data.content.unavailable_days ); 205}else{ 206ths._checkingError( instance, data ); 207} 208} ); 209})(); 210} 211else { 212this._adjustDate( inst.input ); 213} 214} 215} 216}; 217this._checkingError = function( inst, data ){ 218var onFinishCheckingAvailability = this._get( inst, 'onFinishCheckingAvailability' ); 219if( typeof console !== 'undefined' ){ 220console.log( data ); 221} 222this.checkProcessing--; 223if( this.checkProcessing == 0 ){ 224if( onFinishCheckingAvailability ){ 225onFinishCheckingAvailability.apply((inst.input ? inst.input[0] : null)); 226} 227this.hideLoader( inst ); 228} 229}; 230this._implementNewUnavailableDays = function( inst, hotelId, dateId, unavailableDays ){ 231var onFinishCheckingAvailability = this._get( inst, 'onFinishCheckingAvailability' ); 232if( typeof this.availability[hotelId] !== 'undefined' ){ 233if( typeof this.availability[hotelId][dateId] !== 'undefined' ){ 234this.availability[hotelId][dateId].length = 0; 235$.merge( this.availability[hotelId][dateId], unavailableDays ); 236}else{ 237this.availability[hotelId][dateId] = unavailableDays; 238} 239}else{ 240this.availability[hotelId] = {}; 241this.availability[hotelId][dateId] = unavailableDays; 242} 243this.updateDatepickers(); 244this.checkProcessing--; 245if( this.checkProcessing == 0 ){ 246if( onFinishCheckingAvailability ){ 247onFinishCheckingAvailability.apply((inst.input ? inst.input[0] : null)); 248} 249this.hideLoader( inst ); 250} 251}; 252this.showLoader = function( inst ){ 253inst.input.addClass( 'processing' ); 254}; 255this.hideLoader = function( inst ){ 256inst.input.removeClass( 'processing' ); 257}; 258this._attachDatepicker = function(target, settings) { 259var nodeName, inline, inst, 260checkAvailabilityOnLoad; 261nodeName = target.nodeName.toLowerCase(); 262inline = (nodeName === "div" || nodeName === "span"); 263if (!target.id) { 264this.uuid += 1; 265target.id = "dp" + this.uuid; 266} 267inst = this._newInst($(target), inline); 268inst.settings = $.extend({}, settings || {}); 269this._implementAdditionalInstanceSettings( inst ); 270if (nodeName === "input") { 271this._connectDatepicker(target, inst); 272} else if (inline) { 273this._inlineDatepicker(target, inst); 274} 275checkAvailabilityOnLoad = this._get( inst, 'checkAvailabilityOnLoad' ); 276if( checkAvailabilityOnLoad ){ 277this._checkAvailability( inst ); 278} 279}; 280this._implementAdditionalInstanceSettings = function( inst ){ 281var hotelId = inst.input.data( 'hotel-id' ),
282arrivalDate = inst.input.data( 'start-date' ), 283departureDate = inst.input.data( 'end-date' ), 284doAvailabilityCall = inst.input.data( 'do-availability' ); 285inst.hotelId = ( hotelId ) ? 286hotelId : ( this._get( inst, 'hotelId' ) ) ? this._get( inst, 'hotelId' ) : false; 287inst.arrivalDate = ( arrivalDate ) ? 288arrivalDate : ( this._get( inst, 'arrivalDate' ) ) ? this._get( inst, 'arrivalDate' ) : false; 289inst.departureDate = ( departureDate ) ? 290departureDate : ( this._get( inst, 'departureDate' ) ) ? this._get( inst, 'departureDate' ) : false; 291inst.doAvailabilityCall = ( doAvailabilityCall ) ? 292doAvailabilityCall : ( this._get( inst, 'checkAvailabilityOnChange' ) ) ? this._get( inst, 'checkAvailabilityOnChange' ) : true; 293if( inst.arrivalDate ){ 294inst.settings.defaultDate = inst.arrivalDate; 295} 296this.checkDates( inst ); 297}; 298this.checkDates = function( inst ){ 299}; 300this._newInst = function(target, inline) { 301var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars 302return {id: id, input: target, // associated target 303hotelId: false, arrivalDate: false, departureDate: false, 304selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection 305drawMonth: 0, drawYear: 0, // month being drawn 306inline: inline, // is datepicker inline or not 307dpDiv: (!inline ? this.dpDiv : // presentation div 308bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))}; 309}; 310this._notifyChange = function(inst) { 311var onChange = this._get(inst, "onChangeMonthYear"); 312this._tigChangeMonthYear( inst ); 313if (onChange) { 314onChange.apply((inst.input ? inst.input[0] : null), 315[inst.selectedYear, inst.selectedMonth + 1, inst]); 316} 317}; 318this._generateHTML = function(inst) { 319var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, 320controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, 321monthNames, monthNamesShort, beforeShowDay, showOtherMonths, 322showDaysTitle, showPossibleBookingDays, 323selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, 324cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, 325printDate, dRow, tbody, daySettings, otherMonth, unselectable, availableOnlyForDeparture, 326tempDate = new Date(), 327today = this._daylightSavingAdjust( 328new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time 329isRTL = this._get(inst, "isRTL"), 330showButtonPanel = this._get(inst, "showButtonPanel"), 331hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"), 332navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"), 333numMonths = this._getNumberOfMonths(inst), 334showCurrentAtPos = this._get(inst, "showCurrentAtPos"), 335stepMonths = this._get(inst, "stepMonths"), 336isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1), 337currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : 338new Date(inst.currentYear, inst.currentMonth, inst.currentDay))), 339minDate = this._getMinMaxDate(inst, "min"), 340maxDate = this._getMinMaxDate(inst, "max"), 341drawMonth = inst.drawMonth - showCurrentAtPos, 342drawYear = inst.drawYear, 343arrival = ( inst.arrivalDate ? this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ) : false ), 344departure = ( inst.departureDate ? this.parseDate( this._get( inst, "dateFormat" ), inst.departureDate, this._getFormatConfig( inst ) ) : false ); 345if (drawMonth < 0) { 346drawMonth += 12; 347drawYear--; 348} 349if (maxDate) { 350maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), 351maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); 352maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); 353while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { 354drawMonth--; 355if (drawMonth < 0) { 356drawMonth = 11; 357drawYear--; 358} 359} 360} 361inst.drawMonth = drawMonth; 362inst.drawYear = drawYear; 363prevText = this._get(inst, "prevText"); 364prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, 365this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), 366this._getFormatConfig(inst))); 367prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? 368"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" + 369" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" : 370(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>")); 371nextText = this._get(inst, "nextText"); 372nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, 373this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), 374this._getFormatConfig(inst))); 375next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? 376"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" + 377" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" : 378(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>")); 379currentText = this._get(inst, "currentText"); 380gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today); 381currentText = (!navigationAsDateFormat ? currentText : 382this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
383controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + 384this._get(inst, "closeText") + "</button>" : ""); 385buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") + 386(this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" + 387">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : ""; 388firstDay = parseInt(this._get(inst, "firstDay"),10); 389firstDay = (isNaN(firstDay) ? 0 : firstDay); 390showWeek = this._get(inst, "showWeek"); 391dayNames = this._get(inst, "dayNames"); 392dayNamesMin = this._get(inst, "dayNamesMin"); 393monthNames = this._get(inst, "monthNames"); 394monthNamesShort = this._get(inst, "monthNamesShort"); 395beforeShowDay = this._get(inst, "beforeShowDay"); 396showOtherMonths = this._get(inst, "showOtherMonths"); 397showDaysTitle = this._get( inst, "showDaysTitle" ); 398showPossibleBookingDays = this._get( inst, "showPossibleBookingDays" ); 399selectOtherMonths = this._get(inst, "selectOtherMonths"); 400defaultDate = this._getDefaultDate(inst); 401html = ""; 402dow; 403for (row = 0; row < numMonths[0]; row++) { 404group = ""; 405this.maxRows = 4; 406for (col = 0; col < numMonths[1]; col++) { 407selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); 408cornerClass = " ui-corner-all"; 409calender = ""; 410if (isMultiMonth) { 411calender += "<div class='ui-datepicker-group"; 412if (numMonths[1] > 1) { 413switch (col) { 414case 0: calender += " ui-datepicker-group-first"; 415cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break; 416case numMonths[1]-1: calender += " ui-datepicker-group-last"; 417cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break; 418default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break; 419} 420} 421calender += "'>"; 422} 423calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + 424(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : prev) + 425(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : next) + 426this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, 427row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers 428"</div><table class='ui-datepicker-calendar'" + ( showPossibleBookingDays ? " data-event='mouseleave' data-handler='mouseLeaveCalendar'" : "") + "><thead>" + 429"<tr>"; 430thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : ""); 431for (dow = 0; dow < 7; dow++) { // days of the week 432day = (dow + firstDay) % 7; 433thead += "<th" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + 434"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>"; 435} 436calender += thead + "</tr></thead><tbody>"; 437daysInMonth = this._getDaysInMonth(drawYear, drawMonth); 438if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) { 439inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); 440} 441leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; 442curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate 443numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) 444this.maxRows = numRows; 445printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); 446for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows 447calender += "<tr>"; 448tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" + 449this._get(inst, "calculateWeek")(printDate) + "</td>"); 450for (dow = 0; dow < 7; dow++) { // create date picker days 451daySettings = this._tigBeforeShowDay( inst, printDate ); 452daySettings = (beforeShowDay ? 453beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate, daySettings]) : daySettings); 454otherMonth = (printDate.getMonth() !== drawMonth); 455unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || 456(minDate && printDate < minDate) || (maxDate && printDate > maxDate); 457availableOnlyForDeparture = !otherMonth && this._tigCheckDateAvailabeOnlyForDeparture(inst, printDate); 458unselectable = unselectable && !availableOnlyForDeparture; 459tbody += "<td class='" + 460((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends 461(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months 462((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key 463(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ? 464" " + this._dayOverClass : "") + // highlight selected day 465(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days 466(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates 467(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day 468(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different) 469((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "'") + "'" : "") + // cell title 470">" + 471(otherMonth && !showOtherMonths ? " " : // display for other months 472(showDaysTitle ? ( arrival && arrival.getTime() === printDate.getTime() ? "<span class='tig-datepicker-title'>arrival</span>" : 473( departure && departure.getTime() === printDate.getTime() ? "<span class='tig-datepicker-title'>departure</span>" : 474( printDate.getTime() === today.getTime() ? "<span class='tig-datepicker-title'>today</span>" : "" ) ) ) : "" ) + // display additional titles 475(unselectable 476? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" 477: "<a tabindex=\"0\" class='ui-state-default" + 478(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") + 479(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day 480(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months 481"'" + 482(unselectable ? ( daySettings[1].indexOf( 'tig-unavailable-date' ) != -1 ? " data-handler='selectUnavailableDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" : "" ) : " data-handler='selectDay" + ( showPossibleBookingDays ? " mouseEnterDay" : "" ) + "' data-event='click" + ( showPossibleBookingDays ? " mouseenter" : "" ) + "' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + // actions 483" aria-label=\"Available " + (!arrival || departure ? "Check-in" : "Check-out") + " date, " + (new Intl.DateTimeFormat('default', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }).format(printDate)) + "\"" + 484"href='#' role='button'>" + printDate.getDate() + "</a>")) + 485"</td>"; 486printDate.setDate(printDate.getDate() + 1); 487printDate = this._daylightSavingAdjust(printDate); 488} 489calender += tbody + "</tr>"; 490} 491drawMonth++; 492if (drawMonth > 11) { 493drawMonth = 0; 494drawYear++; 495} 496calender += "</tbody></table>" + (isMultiMonth ? "</div>" + 497((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div><div class='tig-datepicker-loader'>" + 498( ( this._get( inst, 'loaderHtml' ) ) ? this._get( inst, 'loaderHtml' ) : '' ) + "</div>" : "") : ""); 499group += calender; 500} 501html += group; 502} 503html += buttonPanel; 504inst._keyEvent = false;
505return html; 506}; 507this._generateMonthYearHeader = function(inst, drawMonth, drawYear, minDate, maxDate, 508secondary, monthNames, monthNamesShort) { 509var months; 510months = (maxDate.getFullYear() - minDate.getFullYear()) * 12; 511months -= minDate.getMonth(); 512months += maxDate.getMonth() + 1; 513var monthCount = months <= 0 ? 0 : months; 514var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, 515changeMonth = this._get(inst, "changeMonth"), 516changeYear = this._get(inst, "changeYear"), 517showMonthAfterYear = this._get(inst, "showMonthAfterYear"), 518html = "<div class='ui-datepicker-title'>", 519monthHtml = "", 520startMonth = ( minDate ) ? minDate.getMonth() : ( new Date() ).getMonth(), 521startYear = ( minDate ) ? minDate.getFullYear() : ( new Date() ).getFullYear(), 522currentMonth = ( minDate ) ? minDate.getMonth() : ( new Date() ).getMonth(), 523currentYear = ( minDate ) ? minDate.getFullYear() : ( new Date() ).getFullYear(); 524if (secondary || !changeMonth) { 525monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + ' ' + drawYear + "</span>"; 526} else { 527inMinYear = (minDate && minDate.getFullYear() === drawYear); 528inMaxYear = (maxDate && maxDate.getFullYear() === drawYear); 529monthHtml += "<div class='select form-control-sm'><select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>"; 530for ( month = startMonth; month < monthCount + startMonth; month++) { 531currentYear = startYear + parseInt( month / 12, 10 ); 532currentMonth = month % 12; 533monthHtml += "<option data-year='" + currentYear + "' value='" + currentMonth + "'" + 534( ( currentMonth === drawMonth && currentYear == drawYear ) ? " selected='selected'" : "") + 535">" + monthNamesShort[currentMonth] + ' ' + currentYear + "</option>"; 536} 537monthHtml += "</select></div>"; 538} 539if (!showMonthAfterYear) { 540html += monthHtml + (secondary || !(changeMonth && changeYear) ? " " : ""); 541} 542html += "</div>"; // Close datepicker_header 543return html; 544}; 545this._selectMonthYear = function(id, select, period) { 546var target = $(id), 547inst = this._getInst(target[0]); 548inst.selectedMonth = inst.drawMonth = parseInt( select.options[select.selectedIndex].value, 10 ); 549inst.selectedYear = inst.drawYear = parseInt( $( select.options[select.selectedIndex] ).data( 'year' ), 10 ); 550inst._monthYearSelection = true; 551this._notifyChange(inst); 552this._adjustDate(target); 553setTimeout(function() { 554var monthSelect = inst.dpDiv.find('select.ui-datepicker-month'); 555if (monthSelect.length) { 556monthSelect.focus(); 557} 558inst._monthYearSelection = false; 559}, 100); 560}; 561this._mouseLeaveCalendar = function( id ){ 562var inst, target, allTDs; 563target = $(id); 564inst = this._getInst(target[0]); 565if( inst.arrivalDate && !inst.departureDate ){ 566allTDs = target.find( 'td:not(.ui-datepicker-other-month)' ); 567$( allTDs ).removeClass( 'tig-middle-date' ); 568} 569}; 570this._mouseEnterDay = function( id, month, year, td ){ 571var inst, target, allTDs, arrivalTDIndex, currentTDIndex, i; 572target = $(id); 573inst = this._getInst(target[0]); 574if( inst.arrivalDate && !inst.departureDate ){ 575allTDs = target.find( 'td:not(.ui-datepicker-other-month)' ); 576arrivalTDIndex = allTDs.index( target.find( 'td.tig-arrival-date' ) ); 577currentTDIndex = allTDs.index( td ); 578$( allTDs ).removeClass( 'tig-middle-date' ); 579if( arrivalTDIndex >= currentTDIndex ){ 580return; 581} 582for( i = arrivalTDIndex; i <= currentTDIndex; i++ ){ 583if( this._get( inst, 'maxBookedNights' ) && ( i - arrivalTDIndex ) > this._get( inst, 'maxBookedNights' ) ){ 584break; 585} 586if( $( allTDs[i] ).hasClass( 'tig-unavailable-date' ) ){ 587break; 588} 589$( allTDs[i] ).addClass( 'tig-middle-date' ); 590} 591} 592}; 593this._selectDay = function(id, month, year, td) { 594var inst, 595target = $(id); 596if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { 597return; 598} 599inst = this._getInst(target[0]); 600inst.selectedDay = inst.currentDay = $("a", td).text(); 601inst.selectedMonth = inst.currentMonth = month; 602inst.selectedYear = inst.currentYear = year; 603this._selectDate(id, this._formatDate(inst, 604inst.currentDay, inst.currentMonth, inst.currentYear)); 605}; 606this._selectDate = function(id, dateStr) { 607var onSelect, 608target = $(id), 609inst = this._getInst(target[0]); 610dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); 611if (inst.input) { 612inst.input.val(dateStr); 613} 614this._tigSelectDate( dateStr, inst ); 615this._updateAlternate(inst); 616onSelect = this._get(inst, "onSelect"); 617if (onSelect) { 618onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback 619} else if (inst.input) { 620inst.input.trigger("change"); // fire the change event 621} 622if (inst.inline){ 623this._updateDatepicker(inst); 624} else { 625this._hideDatepicker(); 626this._lastInput = inst.input[0]; 627if (typeof(inst.input[0]) !== "object") { 628inst.input.focus(); // restore focus 629} 630this._lastInput = null; 631} 632}; 633this._selectUnavailableDay = function( id, month, year, td ){ 634var inst, 635target = $(id); 636inst = this._getInst(target[0]); 637inst.selectedDay = inst.currentDay = parseInt( $( td ).text() ); 638inst.selectedMonth = inst.currentMonth = month; 639inst.selectedYear = inst.currentYear = year; 640this._tigSelectDate( this._formatDate( inst, 641inst.currentDay, inst.currentMonth, inst.currentYear ), inst, true ); 642this._updateAlternate(inst); 643if (inst.inline){ 644this._updateDatepicker(inst); 645} else { 646this._hideDatepicker(); 647this._lastInput = inst.input[0]; 648if (typeof(inst.input[0]) !== "object") { 649inst.input.focus(); // restore focus 650} 651this._lastInput = null; 652} 653}; 654this._tigChangeMonthYear = function( inst ){ 655this._checkAvailability( inst ); 656}; 657this._tigCheckAvailability = function( inst, date ){ 658var isAvailble = true, dateId; 659if( inst.hotelId && typeof this.availability[inst.hotelId] !== 'undefined' ){ 660dateId = date.getFullYear() + '-' + ( date.getMonth() ); 661if( typeof this.availability[inst.hotelId][dateId] !== 'undefined' ){ 662if( $.inArray( this._formatDate( inst, date ), this.availability[inst.hotelId][dateId] ) != -1 ){ 663isAvailble = false;
664} 665} 666} 667return isAvailble; 668}; 669this._tigCheckDateAvailabeOnlyForDeparture = function( inst, date ){ 670var dateBefore = new Date(); 671var isAvailableForDeparture = false; 672var currentDate = new Date(); 673dateBefore.setTime(date.getTime() - 24 * 60 *60); 674if (currentDate < dateBefore && 675this._tigCheckAvailability(inst, dateBefore) 676&& !this._tigCheckAvailability(inst, date) 677) { 678isAvailableForDeparture = true 679} 680return isAvailableForDeparture; 681}; 682this._tigBeforeShowDay = function( inst, date ){ 683var arrivalDate = ( inst.arrivalDate ) ? 684this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ) : false, 685departureDate = ( inst.departureDate ) ? 686this.parseDate( this._get( inst, "dateFormat" ), inst.departureDate, this._getFormatConfig( inst ) ) : false; 687if( arrivalDate && arrivalDate.getTime() == date.getTime() ){ 688return [true, 'tig-arrival-date', 'Arrival Date']; 689}else if( departureDate && departureDate.getTime() == date.getTime() && !this._tigCheckAvailability( inst, date ) ){ 690return [false, 'tig-departure-date tig-unavailable-date', 'Departure Date']; 691}else if( departureDate && departureDate.getTime() == date.getTime() ){ 692return [true, 'tig-departure-date', 'Departure Date']; 693}else if( !this._tigCheckAvailability( inst, date ) && this._tigCheckDateAvailabeOnlyForDeparture(inst, date)){ 694return [false, '', 'Unavailable for arrival']; 695}else if( !this._tigCheckAvailability( inst, date ) ){ 696return [false, 'tig-unavailable-date', 'Unavailable Date']; 697}else if( ( arrivalDate && departureDate ) && ( arrivalDate.getTime() < date.getTime() && departureDate.getTime() > date.getTime() ) ){ 698return [true, 'tig-selected-date', 'Selected Date']; 699}else{ 700return [true, '']; 701} 702}; 703this._tigSelectDate = function( dateText, inst, unavailable ){ 704var selectedDate = this.parseDate( this._get( inst, "dateFormat" ), dateText, this._getFormatConfig( inst ) ), 705onSelectDates = this._get( inst, 'onSelectDates' ), 706onSelectArrivalDate = this._get( inst, 'onSelectArrivalDate' ), 707possibleBook = true, arrivalDay, selectedArrivalDay, departureDay, 708maxBookedNights = this._get( inst, "maxBookedNights" ); 709if( ( !inst.arrivalDate || ( inst.arrivalDate && inst.departureDate ) ) && unavailable ){ 710return; 711} 712if( !inst.arrivalDate || ( inst.arrivalDate && inst.departureDate ) ){ 713inst.arrivalDate = dateText; 714this._checkEndOfMonth( inst ); 715inst.departureDate = false; 716selectedArrivalDay = this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ).getTime(); 717if( this._tigCheckDateAvailabeOnlyForDeparture( inst, new Date( selectedArrivalDay ))){ 718inst.arrivalDate = false 719} 720if( onSelectArrivalDate ){ 721onSelectArrivalDate.apply((inst.input ? inst.input[0] : null), [inst.arrivalDate]); 722} 723}else{ 724arrivalDay = this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ).getTime(); 725if( selectedDate.getTime() <= arrivalDay && unavailable ){ 726return; 727}else if( selectedDate.getTime() <= arrivalDay ){ 728inst.arrivalDate = dateText; 729this._checkEndOfMonth( inst ); 730inst.departureDate = false; 731if( onSelectArrivalDate ){ 732onSelectArrivalDate.apply((inst.input ? inst.input[0] : null), [inst.arrivalDate]); 733} 734return; 735} 736departureDay = this.parseDate( this._get( inst, "dateFormat" ), dateText, this._getFormatConfig( inst ) ).getTime(); 737while( arrivalDay < ( departureDay - oneDaySeconds ) ){ 738arrivalDay += oneDaySeconds; 739if( !this._tigCheckAvailability( inst, new Date( arrivalDay ) ) ){ 740possibleBook = false; 741arrivalDay = departureDay; 742} 743} 744if( possibleBook && maxBookedNights ){ 745if( selectedDate.getTime() - this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ).getTime() > ( oneDaySeconds * this._get( inst, "maxBookedNights" ) ) ){ 746possibleBook = false; 747} 748} 749if( possibleBook ){ 750inst.departureDate = dateText; 751if( onSelectDates ){ 752onSelectDates.apply((inst.input ? inst.input[0] : null), 753[this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ), this.parseDate( this._get( inst, "dateFormat" ), inst.departureDate, this._getFormatConfig( inst ) )]); 754} 755}
755else if( !unavailable ){ 756inst.arrivalDate = dateText; 757this._checkEndOfMonth( inst ); 758inst.departureDate = false; 759if( onSelectArrivalDate ){ 760onSelectArrivalDate.apply((inst.input ? inst.input[0] : null), [inst.arrivalDate]); 761} 762} 763} 764if( this._get( inst, 'synchronize' ) ){ 765this._tigSynchronize( inst, selectedDate ); 766} 767}; 768this._checkEndOfMonth = function( inst ){ 769var currentArrival = this.parseDate( this._get( inst, "dateFormat" ), inst.arrivalDate, this._getFormatConfig( inst ) ), 770month = currentArrival.getMonth(), 771nextArrival = new Date( currentArrival.getFullYear(), currentArrival.getMonth(), currentArrival.getDate() + 1 ); 772if( month != nextArrival.getMonth() ){ 773inst.drawMonth = currentArrival.getMonth(); 774this.updateDatepickers(); 775} 776}; 777this._tigSynchronize = function( inst, selectedDate ){ 778var allTigDatepickers, ths = this, instance; 779allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 780$.each( allTigDatepickers, 781function( index, item ){ 782instance = ths._getInst( item ); 783if( ths._get( instance, 'synchronize' ) && inst.id != instance.id ){ 784ths._setDate( instance, selectedDate, true ); 785ths._notifyChange( instance ); 786ths._adjustDate( item ); 787} 788} 789); 790}; 791this.updateDatepickers = function(){ 792var allTigDatepickers, ths = this; 793allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 794$.each( allTigDatepickers, 795function( index, item ){ 796inst = ths._getInst( item ); 797ths._notifyChange( inst ); 798ths._adjustDate( item ); 799} 800); 801}; 802this.setHotelId = function( hotelId, inst ){ 803var allTigDatepickers, ths = this, inst; 804if( typeof hotelId === 'undefined' ){ 805return false; 806} 807if( typeof inst !== 'undefined' ){ 808if( typeof inst !== 'object' ){ 809inst.hotelId = hotelId; 810}else{ 811inst = this._getInst( inst ); 812inst.hotelId = hotelId; 813} 814}else{ 815allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 816$.each( allTigDatepickers, 817function( index, item ){ 818inst = ths._getInst( item ); 819inst.hotelId = hotelId; 820} 821); 822} 823}; 824this.setDoAvailabilityCall = function( doAvailabilityCall, inst ){ 825var allTigDatepickers, ths = this, inst; 826if( typeof doAvailabilityCall === 'undefined' ){ 827return false; 828} 829if( typeof inst !== 'undefined' ){ 830if( typeof inst !== 'object' ){ 831inst.doAvailabilityCall = doAvailabilityCall; 832}else{ 833inst = this._getInst( inst ); 834inst.doAvailabilityCall = doAvailabilityCall; 835} 836}else{ 837allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 838$.each( allTigDatepickers, 839function( index, item ){ 840inst = ths._getInst( item ); 841inst.doAvailabilityCall = doAvailabilityCall; 842} 843); 844} 845}; 846this.setAdditionalAvailabilityParams = function( params, inst ){ 847var allNXCDatepickers, ths = this; 848if( typeof inst !== 'undefined' ){ 849if( typeof inst !== 'object' ){ 850inst.additional_availability_params = params; 851}else{ 852inst = this._getInst( inst ); 853inst.additional_availability_params = params; 854} 855}else{ 856allNXCDatepickers = $( '.hasDatepicker.tig-calendar' ); 857$.each( allNXCDatepickers, 858function( index, item ){ 859inst = ths._getInst( item ); 860inst.additional_availability_params = params; 861} 862); 863} 864}; 865this.clearAvailabilityCache = function(){ 866this.availability = {}; 867}; 868this.setDates = function( arrival, departure, update, inst ){ 869var allTigDatepickers, ths = this, inst; 870if( !arrival && !departure ){ 871return false; 872} 873if( typeof inst !== 'undefined' ){ 874if( typeof inst !== 'object' ){ 875inst = this._getInst( inst ); 876inst.arrivalDate = arrival; 877inst.departureDate = departure; 878}else{ 879inst.arrivalDate = arrival; 880inst.departureDate = departure; 881} 882}else{ 883allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 884$.each( allTigDatepickers, 885function( index, item ){ 886inst = ths._getInst( item ); 887inst.arrivalDate = arrival; 888inst.departureDate = departure; 889} 890); 891} 892}; 893this.clearDates = function( update ){ 894var allTigDatepickers, ths = this, inst; 895allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 896$.each( allTigDatepickers, 897function( index, item ){ 898inst = ths._getInst( item ); 899inst.arrivalDate = false; 900inst.departureDate = false; 901if( update ){ 902ths._setDate( inst, new Date(), true ); 903ths._notifyChange( inst ); 904ths._adjustDate( item ); 905} 906} 907); 908}; 909this.clearDepartureDate = function( update ){ 910var allTigDatepickers, ths = this, inst; 911allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 912$.each( allTigDatepickers, 913function( index, item ){ 914inst = ths._getInst( item ); 915inst.departureDate = false;
916if( update ){ 917ths._setDate( inst, new Date(), true ); 918ths._notifyChange( inst ); 919ths._adjustDate( item ); 920} 921} 922); 923}; 924this.checkAvailability = function( inst ){ 925var allTigDatepickers, ths = this, inst; 926if( typeof inst !== 'undefined' ){ 927if( typeof inst === 'object' ){ 928this._checkAvailability( inst ); 929}else{ 930this._checkAvailability( this._getInst( inst ) ); 931} 932}else{ 933allTigDatepickers = $( '.hasDatepicker.tig-calendar' ); 934$.each( allTigDatepickers, 935function( index, item ){ 936inst = ths._getInst( item ); 937ths._checkAvailability( inst ); 938} 939); 940} 941}; 942this.convertDate = function( date, format, settings ){ 943var convertedDate = false, 944settings = ( typeof settings === 'undefined' ) ? {} : settings; 945if( format ){ 946convertedDate = this.formatDate( format, date, settings ); 947}else{ 948convertedDate = this.formatDate( this._defaults.formatDate, date, settings ); 949} 950return convertedDate; 951}; 952} 953TigDatepicker.prototype = $.datepicker; 954function bindHover(dpDiv) { 955var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; 956return dpDiv.delegate(selector, "mouseout", function() { 957$(this).removeClass("ui-state-hover"); 958if (this.className.indexOf("ui-datepicker-prev") !== -1) { 959$(this).removeClass("ui-datepicker-prev-hover"); 960} 961if (this.className.indexOf("ui-datepicker-next") !== -1) { 962$(this).removeClass("ui-datepicker-next-hover"); 963} 964}) 965.delegate(selector, "mouseover", function(){ 966if (!$.tigDatepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { 967$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); 968$(this).addClass("ui-state-hover"); 969if (this.className.indexOf("ui-datepicker-prev") !== -1) { 970$(this).addClass("ui-datepicker-prev-hover"); 971} 972if (this.className.indexOf("ui-datepicker-next") !== -1) { 973$(this).addClass("ui-datepicker-next-hover"); 974} 975} 976}); 977} 978function extendRemove(target, props) { 979$.extend(target, props); 980for (var name in props) { 981if (props[name] == null) { 982target[name] = props[name]; 983} 984} 985return target; 986} 987$.fn.tigDatepicker = function(options){ 988if ( !this.length ) { 989return this; 990} 991if (!$.tigDatepicker.initialized) { 992$(document).mousedown($.tigDatepicker._checkExternalClick); 993$.tigDatepicker.initialized = true; 994} 995if ($("#"+$.tigDatepicker._mainDivId).length === 0) { 996$("body").append($.tigDatepicker.dpDiv); 997} 998var otherArgs = Array.prototype.slice.call(arguments, 1); 999if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) { 1000return $.tigDatepicker["_" + options + "Datepicker"]. 1001apply($.tigDatepicker, [this[0]].concat(otherArgs)); 1002} 1003if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") { 1004return $.tigDatepicker["_" + options + "Datepicker"]. 1005apply($.tigDatepicker, [this[0]].concat(otherArgs)); 1006} 1007return this.each(function() { 1008typeof options === "string" ? 1009$.tigDatepicker["_" + options + "Datepicker"]. 1010apply($.tigDatepicker, [this].concat(otherArgs)) : 1011$.tigDatepicker._attachDatepicker(this, $.extend( defaultOptions, options )); 1012}); 1013}; 1014$.tigDatepicker = new TigDatepicker(); // singleton instance 1015$.tigDatepicker.initialized = false; 1016$.tigDatepicker.uuid = new Date().getTime(); 1017$.tigDatepicker.version = "1.10.1"; 1018window["DP_jQuery_" + dpuuid] = $; 1019})(jQuery); 1020(function() { 1021var method; 1022var noop = function () {}; 1023var methods = [ 1024'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 1025'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 1026'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 1027'timeStamp', 'trace', 'warn' 1028]; 1029var length = methods.length; 1030var console = (window.console = window.console || {}); 1031while (length--) { 1032method = methods[length]; 1033if (!console[method]) { 1034console[method] = noop; 1035} 1036} 1037}()); 1038Number.prototype.formatMoney = function(c, d, t){ 1039var n = this, 1040c = isNaN(c = Math.abs(c)) ? 2 : c, 1041d = d == undefined ? "." : d, 1042t = t == undefined ? "," : t, 1043s = n < 0 ? "-" : "", 1044i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", 1045j = (j = i.length) > 3 ? j % 3 : 0; 1046return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); 1047}; 1048;( function( window, document, undefined ){ 1049var packages = {}, 1050modules = {}, 1051statistics = {}, 1052cases = {}, 1053ready = false, 1054loaded = false, 1055defaults = { 1056type: 'ui', // could be ui, library 1057compile: 'onReady', // could be onReady, onLoad, manually 1058global: false // if true, attach module interface to window[module_name] 1059}, 1060PackageManager, StatisticManager, CaseManager, 1061moduleSelectorPattern = '[luana-module="{name}"], .luana-module-{name}', 1062_isUndefined = function( value ){ 1063return typeof value === 'undefined'; 1064}, 1065_isBoolean = function( value ){ 1066return ( typeof value === 'boolean' ); 1067}, 1068_isArray = function( value ){ 1069return ( Object.prototype.toString.call( value ) === '[object Array]' ); 1070}, 1071_log = function( log, type ){ 1072if( !_isUndefined( window.console ) && !_isUndefined( console.log ) && luana.developerMode ){ 1073if( !_isUndefined( type ) ){ 1074if( type == 'error' ){ 1075console.log( '%c ' + log, 'color: #FF302C;' ); 1076}else if( type == 'warning' ){ 1077console.log( '%c ' + log, 'color: #FB9D17;' ); 1078}else{ 1079console.log( '%c ' + log, 'color: #35BD37;' ); 1080} 1081}else{ 1082console.log( log ); 1083} 1084} 1085}, 1086_getAttributes = function( name ){ 1087var attr = { 1088name: '', 1089caseName: false 1090}, i, tempArray = [], 1091attrArray = name.split( '.' ); 1092if( attrArray.length <= 1 ){
1093attr.name = name; 1094}else{ 1095attr.name = attrArray[0]; 1096for( i = 1; i < attrArray.length; i++ ){ 1097tempArray.push( attrArray[i] ); 1098} 1099attr.caseName = tempArray.join( '.' ); 1100} 1101return attr; 1102}, 1103_moduleSelector = function( name ){ 1104return moduleSelectorPattern.replace( /{name}/gi, name ); 1105}; 1106if( _isUndefined( Function.prototype.bind ) ){ 1107Function.prototype.bind = function( context ){ 1108return ( function( func ){ 1109return function(){ 1110func.call( context ); 1111}; 1112} )( this ); 1113}; 1114} 1115function Controller( pack, module ){ 1116var _updateElements = function( scope ){ 1117$.each( CaseManager.getPackData( pack ).localSelectors, 1118function( index, selector ){ 1119scope.elements[ index ] = 1120$( scope.root ).find( selector ); 1121} 1122); 1123$.each( CaseManager.getPackData( pack ).globalSelectors, 1124function( index, selector ){ 1125scope.elements[ index ] = $( selector ); 1126} 1127); 1128$.each( CaseManager.getCasePackData( pack ), 1129function( index, casePack ){ 1130$.each( casePack.localSelectors, 1131function( _index, selector ){ 1132scope.elements[ _index ] = 1133$( scope.root ).find( selector ); 1134} 1135); 1136$.each( casePack.globalSelectors, 1137function( _index, selector ){ 1138scope.elements[ _index ] = $( selector ); 1139} 1140); 1141} 1142); 1143}; 1144this.__updateModule = function(){ 1145PackageManager.update( module.name ); 1146}; 1147this.__updateElements = function( scope ){ 1148if( !_isUndefined( scope ) ){ 1149_updateElements( scope ); 1150}else{ 1151$.each( module.scopes, 1152function(){ 1153_updateElements( this ); 1154} 1155); 1156} 1157}; 1158this.__throughScopes = function( iterrator ){ 1159$.each( module.scopes, iterrator ); 1160}; 1161this.__getScopes = function(){ 1162return module.scopes; 1163}; 1164this.__getRoots = function(){ 1165return module.roots; 1166}; 1167this.__getRootByScope = function( scope ){ 1168var root = false; 1169$.each( this.__getRoots(), 1170function( index, item ){ 1171if( $( item ).data( module.name ) == scope ){ 1172root = item; 1173} 1174} 1175); 1176return root; 1177}; 1178this.__getRootByElement = function( element ){ 1179var root = false, scope, obj; 1180scope = $( element ).data( module.name ); 1181if( !_isUndefined( scope ) ){ 1182root = element; 1183}else{ 1184obj = $( element ).parents( _moduleSelector( module.name ) ); 1185if( obj ){ 1186if( !_isUndefined( $( obj ).data( module.name ) ) ){ 1187root = obj; 1188} 1189} 1190} 1191return root; 1192}; 1193this.__getScopeByElement = function( element ){ 1194var scope = false, 1195root = this.__getRootByElement( element ); 1196if( root ){ 1197scope = $( root ).data( module.name ); 1198} 1199return scope; 1200}; 1201this.__getScopesByElement = function( element ){ 1202var scopes = [], 1203scope, 1204elements = $( element ); 1205if( elements.length == 1 ){ 1206scopes = [this.__getScopeByElement( element )]; 1207}else if( elements.length > 1 ){ 1208$.each( elements, 1209function( index, item ){ 1210scope = this.__getScopeByElement( item ); 1211if( scope ){ 1212scopes.push( scope ); 1213} 1214}.bind( this ) 1215); 1216} 1217return scopes; 1218}; 1219this.__setState = function( scope ){ 1220module.state = scope; 1221}; 1222this.__getState = function(){ 1223return module.state; 1224}; 1225this.__clearState = function(){ 1226module.state = false; 1227}; 1228this.__setTimeout = function( callback, timeout ){ 1229this.__clearTimeout(); 1230module.timeout = window.setTimeout( callback, timeout ); 1231}; 1232this.__clearTimeout = function(){ 1233window.clearTimeout( module.timeout ); 1234}; 1235this.__setInterval = function( callback, interval ){ 1236this.__clearInterval(); 1237module.interval = window.setInterval( callback, interval ); 1238}; 1239this.__clearInterval = function(){ 1240window.clearInterval( module.interval ); 1241}; 1242} 1243function View( module ){ 1244this.__getScopes = function(){ 1245return module.scopes; 1246}; 1247this.__getRoots = function(){ 1248return module.roots; 1249}; 1250this.__setState = function( scope ){ 1251module.state = scope; 1252}; 1253this.__getState = function(){ 1254return module.state; 1255}; 1256this.__clearState = function(){ 1257module.state = false; 1258}; 1259} 1260function Event( module, scope, eventType, handler, element, secondElement, preventDefault ){ 1261var _callback = function( event ){ 1262var additionalParameters = Array.prototype.slice.call( arguments, 1, arguments.length ); 1263if( preventDefault ){ 1264event.preventDefault(); 1265} 1266if( scope ){ 1267module.controller[handler].call( module.controller, scope, this, event, additionalParameters ); 1268}else{ 1269module.controller[handler].call( module.controller, this, event, additionalParameters ); 1270} 1271}; 1272if( !_isUndefined( module.controller[handler] ) ){ 1273if( luana.developerMode ){ 1274$( element ).addClass( 'l-' + module.name + '-e-' + eventType + 1275'-handled' + ( ( secondElement ) ? '-live' : '' ) ); 1276} 1277if( secondElement ){ 1278$( element ).on( eventType, secondElement, _callback ); 1279}else{ 1280$( element ).on( eventType, _callback ); 1281} 1282}else{ 1283_log( module.name + ': Event ' + eventType + ' cannot be ' + 1284'attached as there is no handler ' + handler, 'warning' ); 1285} 1286} 1287StatisticManager = (function(){ 1288return { 1289show: function(){ 1290if( luana.developerMode ){ 1291$.each( statistics, 1292function( index, statisticCtrl ){ 1293statisticCtrl.call( packages ); 1294} 1295); 1296} 1297} 1298} 1299})(); 1300CaseManager = (function(){ 1301var _check = function( caseName ){ 1302var casesArray = caseName.split( '.' ), 1303inverse = false, key, 1304i, isTrue = true; 1305for( i = 0; i < casesArray.length; i++ ){ 1306inverse = ( casesArray[i].indexOf( '!' ) === 0 ); 1307key = ( inverse ) ? casesArray[i].substr( 1 ) : casesArray[i]; 1308if( inverse ){ 1309if( !( typeof cases[key] !== 'undefined' && !cases[key] ) ){ 1310isTrue = false;
1311} 1312}else{ 1313if( !( typeof cases[key] !== 'undefined' && cases[key] ) ){ 1314isTrue = false; 1315} 1316} 1317} 1318return isTrue; 1319}; 1320return { 1321getPackData: function( pack ){ 1322return pack.data; 1323}, 1324getCasePackData: function( pack ){ 1325var casePackData = []; 1326$.each( pack.casesOrder, 1327function( index, key ){ 1328if( _check( key ) ){ 1329casePackData.push( pack.casesData[key] ); 1330} 1331} 1332); 1333return casePackData; 1334}, 1335getOptions: function( pack ){ 1336var options; 1337if( pack.data.factory ){ 1338options = pack.data.factory.options; 1339}else{ 1340options = $.extend( true, {}, defaults ); 1341} 1342return options; 1343} 1344}; 1345})(); 1346PackageManager = (function(){ 1347var _compilePackage = function( pack, type ){ 1348if( !pack.compiled && ( type == CaseManager.getOptions( pack ).compile || type == 'manually' ) ){ 1349modules[pack.name] = new Module( pack.name ); 1350if( CaseManager.getOptions( pack ).type === 'library' ){ 1351if( CaseManager.getPackData( pack ).factory || 1352CaseManager.getCasePackData( pack ).length ){ 1353_initializeLibrary( pack, modules[pack.name] ); 1354pack.compiled = true; 1355} 1356}else if( CaseManager.getOptions( pack ).type === 'ui' ){ 1357if( modules[pack.name].roots.length && 1358( CaseManager.getPackData( pack ).factory || 1359CaseManager.getCasePackData( pack ).length ) ){ 1360_initializeModule( pack, modules[pack.name] ); 1361pack.compiled = true; 1362}else{ 1363_log( pack.name + ': compilation is skipped. There are no any roots.', 'error' ); 1364pack.errors.push( 'Cannot be compiled. Module doesn`t have any routs. You can set force = true to compile module without routs...' ); 1365} 1366} 1367} 1368}, 1369_updatePackage = function( pack, module ){ 1370module.roots = $( _moduleSelector( pack.name ) ); 1371$.each( module.roots, 1372function(){ 1373if( _isUndefined( $( this ).data( module.name ) ) ){ 1374_updateModule( pack, module, this ); 1375} 1376} 1377); 1378}, 1379_initializeLibrary = function( pack, module ){ 1380var scope = {}; 1381$.each( CaseManager.getPackData( pack ).scope, 1382function( index, packScope ){ 1383scope = $.extend( true, scope, packScope ); 1384} 1385); 1386$.each( CaseManager.getCasePackData( pack ), 1387function( index, caseItem ){ 1388$.each( caseItem.scope, 1389function( _index, packScope ){ 1390scope = $.extend( true, scope, packScope ); 1391} 1392); 1393} 1394); 1395_prepareView( pack, module ); 1396_prepareController( pack, module, scope ); 1397_prepareFace( pack, module ); 1398}, 1399_initializeModule = function( pack, module ){ 1400var scope = {}, localScope; 1401$.each( CaseManager.getPackData( pack ).scope, 1402function( index, packScope ){ 1403scope = $.extend( true, scope, packScope ); 1404} 1405); 1406$.each( CaseManager.getCasePackData( pack ), 1407function( index, caseItem ){ 1408$.each( caseItem.scope, 1409function( _index, packScope ){ 1410scope = $.extend( true, scope, packScope ); 1411} 1412); 1413} 1414); 1415_prepareView( pack, module ); 1416_prepareController( pack, module ); 1417_prepareFace( pack, module ); 1418scope.elements = {}; 1419pack.logs.push( 'Module has ' + module.roots.length + ( module.roots.length === 1 ? ' root' : ' roots' ) ); 1420$.each( module.roots, 1421function( index, item ){ 1422localScope = $.extend( true, {}, scope ); 1423localScope.root = item; 1424module.controller.__updateElements( localScope ); 1425module.scopes.push( localScope ); 1426$( item ).data( module.name, localScope ); 1427_attachEvents( pack, module, localScope ); 1428_eachScope( pack, module, localScope ); 1429} 1430); 1431_initialize( pack, module ); 1432_attachGlobalEvents( pack, module ); 1433}, 1434_updateModule = function( pack, module, root ){ 1435var scope = {}, localScope; 1436$.each( CaseManager.getPackData( pack ).scope, 1437function( index, packScope ){ 1438scope = $.extend( true, scope, packScope ); 1439} 1440); 1441$.each( CaseManager.getCasePackData( pack ), 1442function( index, caseItem ){ 1443$.each( caseItem.scope, 1444function( _index, packScope ){ 1445scope = $.extend( true, scope, packScope ); 1446} 1447); 1448} 1449); 1450scope.elements = {}; 1451localScope = $.extend( true, {}, scope ); 1452localScope.root = root; 1453module.controller.__updateElements( localScope ); 1454module.scopes.push( localScope ); 1455$( root ).data( module.name, localScope ); 1456_attachEvents( pack, module, localScope ); 1457_eachScope( pack, module, localScope ); 1458}, 1459_prepareView = function( pack, module ){ 1460function ProxyView(){} 1461ProxyView.prototype = new View( module ); 1462var vw = new ProxyView(); 1463$.each( CaseManager.getPackData( pack ).view, 1464function( index, item ){ 1465$.extend( vw, item.call() ); 1466} 1467); 1468$.each( CaseManager.getCasePackData( pack ), 1469function( index, caseItem ){ 1470$.each( caseItem.view, 1471function( _index, packScope ){ 1472$.extend( vw, packScope.call() ); 1473} 1474); 1475} 1476); 1477module.view = vw; 1478}, 1479_prepareController = function( pack, module, scope ){ 1480function ProxyController(){} 1481ProxyController.prototype = new Controller( pack, module ); 1482var ctrl = new ProxyController(); 1483$.each( CaseManager.getPackData( pack ).controller, 1484function( index, item ){ 1485if( !_isUndefined( scope ) ){ 1486$.extend( ctrl, item( module.view, scope ) ); 1487}else{ 1488$.extend( ctrl, item( module.view ) ); 1489} 1490} 1491); 1492$.each( CaseManager.getCasePackData( pack ), 1493function( index, caseItem ){ 1494$.each( caseItem.controller, 1495function( _index, item ){ 1496if( !_isUndefined( scope ) ){ 1497$.extend( ctrl, item( module.view, scope ) ); 1498}else{ 1499$.extend( ctrl, item( module.view ) ); 1500} 1501} 1502); 1503} 1504); 1505module.controller = ctrl; 1506}, 1507_prepareFace = function( pack, module ){ 1508var faces = []; 1509$.each( CaseManager.getPackData( pack ).faces, 1510function( index, item ){ 1511faces = faces.concat( item ); 1512} 1513); 1514$.each( CaseManager.getCasePackData( pack ), 1515function( index, caseItem ){ 1516$.each( caseItem.faces, 1517function( _index, item ){ 1518faces = faces.concat( item ); 1519} 1520); 1521} 1522); 1523$.each( faces, 1524function( index, face ){ 1525if( _isUndefined( module.face[face] ) ){ 1526module.face[face] = function(){ 1527return module.controller[face].apply( module.controller, arguments ); 1528} 1529} 1530} 1531); 1532pack.logs.push( 'Module has ' + faces.length + ( faces.length === 1 ? ' face' : ' faces' ) ); 1533if( CaseManager.getOptions( pack ).global ){ 1534if( _isUndefined( window[pack.name] ) ){ 1535window[pack.name] = module.face; 1536} 1537pack.logs.push( 'Module has a face on the global scope with name: ' + pack.name ); 1538} 1539}, 1540_checkEventsExisting = function( pack ){ 1541var events = [], i, 1542casePacks = CaseManager.getCasePackData( pack ); 1543if( casePacks.length ){ 1544for( i = casePacks.length - 1; i >= 0; i-- ){ 1545if( casePacks[i].events.length ){ 1546events = casePacks[i].events; 1547break; 1548} 1549} 1550} 1551if( !events.length ){ 1552events = CaseManager.getPackData( pack ).events; 1553} 1554return events; 1555}, 1556_attachEvents = function( pack, module, scope ){ 1557var preventDefault = false, 1558element = false, 1559secondElement = false, 1560eventType = false, 1561eventsCount = 0, 1562elementsCount = 0, 1563events; 1564events = _checkEventsExisting( pack ); 1565$.each( events, 1566function( index, item ){ 1567module.events = $.extend( true, module.events, item( scope ) ); 1568} 1569); 1570$.each( module.events, 1571function( handler, item ){ 1572preventDefault = false;
1573secondElement = false; 1574element = item[1]; 1575eventType = item[0]; 1576if( !_isUndefined( item[2] ) ){ 1577if( _isBoolean( item[2] ) ){ 1578preventDefault = item[2]; 1579}else{ 1580secondElement = item[2]; 1581if( !_isUndefined( item[3] ) ){ 1582preventDefault = item[3]; 1583} 1584} 1585} 1586Event( module, scope, eventType, handler, element, secondElement, preventDefault ); 1587elementsCount += $( item[1] ).length; 1588eventsCount++; 1589} 1590); 1591pack.logs.push( 'Module has ' + eventsCount + ( eventsCount === 1 ? ' event' : ' events' ) + 1592' attached to ' + elementsCount + ( elementsCount === 1 ? ' element' : ' elements' ) ); 1593}, 1594_checkGlobalEventsExisting = function( pack ){ 1595var events = [], i, 1596casePacks = CaseManager.getCasePackData( pack ); 1597if( casePacks.length ){ 1598for( i = casePacks.length - 1; i >= 0; i-- ){ 1599if( casePacks[i].globalEvents.length ){ 1600events = casePacks[i].globalEvents; 1601break; 1602} 1603} 1604} 1605if( !events.length ){ 1606events = CaseManager.getPackData( pack ).globalEvents; 1607} 1608return events; 1609}, 1610_attachGlobalEvents = function( pack, module ){ 1611var preventDefault = false, 1612element = false, 1613secondElement = false, 1614eventType = false, 1615elementsCount = 0, 1616events; 1617events = _checkGlobalEventsExisting( pack ); 1618$.each( events, 1619function( index, item ){ 1620module.globalEvents = $.extend( true, module.globalEvents, item() ); 1621} 1622); 1623$.each( module.globalEvents, 1624function( handler, item ){ 1625preventDefault = false;
1626secondElement = false; 1627element = item[1]; 1628eventType = item[0]; 1629if( !_isUndefined( item[2] ) ){ 1630if( _isBoolean( item[2] ) ){ 1631preventDefault = item[2]; 1632}else{ 1633secondElement = item[2]; 1634if( !_isUndefined( item[3] ) ){ 1635preventDefault = item[3]; 1636} 1637} 1638} 1639Event( module, false, eventType, handler, element, secondElement, preventDefault ); 1640elementsCount += $( item[1] ).length; 1641} 1642); 1643}, 1644_eachScope = function( pack, module, scope ){ 1645if( !_isUndefined( module.controller.eachScope ) ){ 1646module.controller.eachScope.call( module.controller, scope ); 1647} 1648}, 1649_initialize = function( pack, module ){ 1650if( !_isUndefined( module.controller.initialize ) ){ 1651module.controller.initialize.call( module.controller ); 1652} 1653}; 1654return { 1655compile: function( type, packageName ){ 1656if( _isUndefined( packageName ) ){ 1657$.each( packages, 1658function( index, pack ){ 1659_compilePackage( pack, type ); 1660} 1661); 1662}else{ 1663if( !_isUndefined( packages[packageName] ) ){ 1664_compilePackage( packages[packageName], type ); 1665} 1666} 1667}, 1668update: function( packageName ){ 1669if( !_isUndefined( packageName ) && !_isUndefined( packages[packageName] ) ){ 1670if( !_isUndefined( modules[packageName] ) ){ 1671_updatePackage( packages[packageName], modules[packageName] ); 1672} 1673} 1674} 1675}; 1676})(); 1677function Module( name ){ 1678this.name = name; 1679this.roots = $( _moduleSelector( name ) ); 1680this.scopes = []; 1681this.view = {}; 1682this.controller = {}; 1683this.events = {}; 1684this.globalEvents = {}; 1685this.face = {}; 1686this.state = false; 1687this.interval = false; 1688this.timeout = false; 1689} 1690function Package( name, factory ){ 1691this.name = name; 1692this.compiled = false; 1693this.dataPattern = { 1694factory: false, 1695scope: [], 1696localSelectors: {}, 1697globalSelectors: {}, 1698events: [], 1699globalEvents: [], 1700controller: [], 1701view: [], 1702faces: [] 1703}; 1704this.data = $.extend( true, {}, this.dataPattern ); 1705this.data.factory = factory; 1706this.casesData = {}; 1707this.casesOrder = []; 1708this.errors = []; 1709this.logs = []; 1710this.getData = function( caseName ){ 1711return ( !caseName ) ? this.data : this.casesData[caseName]; 1712}; 1713} 1714Package.prototype = { 1715addScope: function( caseName, scope ){ 1716this.getData( caseName ).scope.push( scope ); 1717}, 1718addLocalSelectors: function( caseName, selectors ){ 1719$.extend( this.getData( caseName ).localSelectors, selectors ); 1720}, 1721addGlobalSelectors: function( caseName, selectors ){ 1722$.extend( this.getData( caseName ).globalSelectors, selectors ); 1723}, 1724addEvents: function( caseName, events ){ 1725this.getData( caseName ).events.push( events ); 1726}, 1727addGlobalEvents: function( caseName, events ){ 1728this.getData( caseName ).globalEvents.push( events ); 1729}, 1730addController: function( caseName, controller ){ 1731this.getData( caseName ).controller.push( controller ); 1732}, 1733addView: function( caseName, view ){ 1734this.getData( caseName ).view.push( view ); 1735}, 1736addFaces: function( caseName, face ){ 1737this.getData( caseName ).faces.push( face ); 1738}, 1739prepareDataForCase: function( caseName, factory ){ 1740if( typeof this.getData( caseName ) === 'undefined' ){ 1741$.extend( true, this.casesData[caseName] = {}, this.dataPattern ); 1742this.casesData[caseName].factory = factory; 1743} 1744}, 1745setMainCase: function( factory ){ 1746this.data.factory = factory; 1747}, 1748hasCase: function( caseName ){ 1749return typeof this.casesData[caseName] !== 'undefined'; 1750}, 1751getFactory: function( caseName ){ 1752return ( !caseName ) ? this.data.factory : this.casesData[caseName].factory; 1753} 1754}; 1755function Factory( name, caseName, options ){ 1756this.name = name; 1757this.caseName = caseName; 1758this.options = $.extend( true, $.extend( true, {}, defaults ), options ); 1759} 1760Factory.prototype = { 1761faces: function(){ 1762var face = []; 1763$.each( arguments, function( index, item ){ 1764if( _isArray( item ) ){ 1765face = face.concat( item ); 1766}else{ 1767face.push( item ); 1768} 1769} ); 1770packages[this.name].addFaces( this.caseName, face ); 1771return this; 1772}, 1773describeScope: function( scope ){ 1774packages[this.name].addScope( this.caseName, scope ); 1775return this; 1776}, 1777defineElements: function( localSelectors, globalSelectors ){ 1778packages[this.name].addLocalSelectors( this.caseName, localSelectors ); 1779if( !_isUndefined( globalSelectors ) ){ 1780packages[this.name].addGlobalSelectors( this.caseName, globalSelectors ); 1781} 1782return this; 1783}, 1784attachEvents: function( events ){ 1785packages[this.name].addEvents( this.caseName, events ); 1786return this; 1787}, 1788attachGlobalEvents: function( events ){ 1789packages[this.name].addGlobalEvents( this.caseName, events ); 1790return this; 1791}, 1792controller: function( controller ){ 1793packages[this.name].addController( this.caseName, controller ); 1794return this; 1795}, 1796view: function( view ){ 1797packages[this.name].addView( this.caseName, view ); 1798return this; 1799}, 1800compile: function(){ 1801if( !_isUndefined( packages[this.name] ) && packages[this.name].compiled ){ 1802PackageManager.update( this.name ); 1803}else{ 1804_compilePackages( 'manually', this.name ); 1805} 1806}, 1807update: function(){ 1808if( !_isUndefined( packages[this.name] ) && packages[this.name].compiled ){ 1809PackageManager.update( this.name ); 1810} 1811} 1812}; 1813function Luana(){ 1814this.developerMode = false;
1815this.factory = function( name, options ){ 1816var attributes = _getAttributes( name ), 1817factory; 1818if( _isUndefined( packages[attributes.name] ) ){ 1819packages[attributes.name] = new Package( attributes.name, false ); 1820} 1821if( attributes.caseName === false ){ 1822packages[attributes.name].setMainCase( new Factory( attributes.name, false, 1823_isUndefined( options ) ? {} : options ) ); 1824factory = packages[attributes.name].getFactory(); 1825}else if( !packages[attributes.name].hasCase( attributes.caseName ) ){ 1826packages[attributes.name].prepareDataForCase( attributes.caseName, new Factory( attributes.name, attributes.caseName, 1827_isUndefined( options ) ? {} : options ) ); 1828packages[attributes.name].casesOrder.push( attributes.caseName ); 1829factory = packages[attributes.name].getFactory( attributes.caseName ); 1830}else{ 1831factory = packages[attributes.name].getFactory( attributes.caseName ); 1832} 1833return factory; 1834}; 1835this.module = function( name ){ 1836if( !_isUndefined( modules[name] ) ){ 1837return modules[name].face; 1838}else{ 1839return false; 1840} 1841}; 1842this.hasModule = function( name ){ 1843return ( !_isUndefined( modules[name] ) && packages[name].compiled ); 1844}; 1845this.statistics = function( name, statisticCtrl ){ 1846if( _isUndefined( statistics[name] ) ){ 1847statistics[name] = statisticCtrl; 1848return true; 1849} 1850return false; 1851}; 1852this.update = function(){ 1853$.each( packages, function( index, item ){ 1854this.factory( item['name'] ).compile(); 1855}.bind( this ) ); 1856}; 1857this.addCase = function( name, hanlder ){ 1858if( !_isUndefined( hanlder ) ){ 1859cases[name] = hanlder.call(); 1860} 1861}; 1862this.getCases = function(){ 1863return cases; 1864}; 1865} 1866function _compilePackages( type, packName ){ 1867if( !_isUndefined( packName ) ){ 1868PackageManager.compile( type, packName ); 1869}else{ 1870PackageManager.compile( type ); 1871} 1872} 1873function _ready(){ 1874_compilePackages( 'onReady' ); 1875ready = true; 1876} 1877function _load(){ 1878_compilePackages( 'onLoad' ); 1879loaded = true; 1880StatisticManager.show(); 1881} 1882window.luana = new Luana(); 1883$( document ).ready( _ready ); 1884$( window ).load( _load ); 1885} )( window, document ); 1886luana.factory( 'lajax', { type: 'library', global: true } ) 1887.controller( function( view ){ 1888return { 1889fetchReservationList : function( params, callback ){ 1890jQuery.ez( "ajaxReservation::fetch::" + JSON.stringify( params ), {}, function( data ){ 1891if ( callback ){ 1892callback( data ); 1893} 1894} ); 1895}, 1896fetchReservation : function( params, callback ){ 1897jQuery.ez( "ajaxReservation::find::" + JSON.stringify( params ), {}, function( data ){ 1898if ( callback ){ 1899callback( data ); 1900} 1901} ); 1902}, 1903modifyReservation : function( params, callback ){ 1904jQuery.ez( "ajaxReservation::modify::" + JSON.stringify( params ), {}, function( data ){ 1905if ( callback ){ 1906callback( data ); 1907} 1908} ); 1909}, 1910cancelReservation : function( params, callback ){ 1911jQuery.ez( "ajaxReservation::cancel::" + params , {}, function( data ){ 1912if ( callback ){ 1913callback( data ); 1914} 1915} ); 1916}, 1917roomCapacityFilter : function( params, callback ){ 1918jQuery.ez( "ezjsctemplate::nxc_doyle_room_capacity_filter::" + params.join('::'), {}, function( data ){ 1919if ( callback ){ 1920callback( data ); 1921} 1922} ); 1923}, 1924hotelCityFilter : function( params, callback ){ 1925jQuery.ez( "ezjsctemplate::nxc_doyle_city_hotel_filter::" + params.join('::'), {}, function( data ){ 1926if ( callback ){ 1927callback( data ); 1928} 1929} ); 1930}, 1931collectedForm : function( params, callback ){ 1932jQuery.post( formEl.attr( 'action' ), jQuery.param( params ) ).done( function( data ) { 1933if ( callback ){ 1934callback( data ); 1935} 1936}); 1937}, 1938searchLeFilter : function( action, params, callback ){ 1939jQuery.post( action, jQuery.param( params ) ).done( function( data ) { 1940if ( callback ){ 1941callback( data ); 1942} 1943}); 1944} 1945}; 1946} ) 1947.faces( [ 1948'fetchReservationList', 1949'fetchReservation', 1950'modifyReservation', 1951'cancelReservation', 1952'roomCapacityFilter', 1953'collectedForm', 1954'hotelCityFilter', 1955'searchLeFilter' 1956] ); 1957luana.factory( 'gallery' ) 1958.defineElements( { 1959holder: '[gallery-holder]', 1960items: '[gallery-item]', 1961next: '[gallery-next]', 1962prev: '[gallery-prev]', 1963currentLabel: '[gallery-current]', 1964countLabel: '[gallery-count]', 1965navItem: '[gallery-nav-item]' 1966} ) 1967.describeScope( { 1968current: 1, 1969count: 0, 1970lastUpdate: ( new Date() ).getTime(), 1971scrollTime: 6000, 1972isAnimating: false,
1973navArrows: false, 1974autoplay: true, 1975activeClass: 'is-active', 1976additionalItems: 2 1977} ) 1978.controller( function( view ){ 1979return { 1980initialize: function(){ 1981this.__setInterval( this.update.bind( this ), 1000 ); 1982}, 1983eachScope: function( scope ){ 1984scope.count = scope.elements.items.length; 1985$( scope.elements.countLabel ).text( scope.count ); 1986scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 1987this.prepare( scope ); 1988if( $( scope.root ).hasClass( 'random-start' ) ){ 1989this.gotoItem( scope, parseInt( scope.count * Math.random() ) + 1 ); 1990} 1991scope.navArrows = typeof $(scope.root).attr('naw-arrows') !== 'undefined'; 1992}, 1993prepare: function( scope ){ 1994if (scope.elements.items.length > 1) { 1995view.addAdditionalItems( scope ); 1996view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%', true ); 1997$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 1998$( $( scope.elements.items ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 1999scope.navArrows = typeof $(scope.root).attr('naw-arrows') !== 'undefined'; 2000if (scope.navArrows) { 2001this.__setState(scope); 2002} 2003} else { 2004$( scope.elements.next ).hide(); 2005$( scope.elements.prev ).hide(); 2006$( scope.elements.navItem ).hide(); 2007$( scope.elements.holder ).css("transition", "none"); 2008$( scope.elements.holder ).css("left", "0"); 2009} 2010}, 2011update: function(){ 2012var currentTime = ( new Date() ).getTime(); 2013this.__throughScopes( function( index, scope ){ 2014if (scope.elements.items.length <= 1) { 2015$( scope.elements.next ).hide(); 2016$( scope.elements.prev ).hide(); 2017$( scope.elements.navItem ).hide(); 2018$( scope.elements.holder ).css({left: 0}); 2019return; 2020} 2021scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 2022if( 2023scope.count > 1 2024&& currentTime - scope.lastUpdate >= scope.scrollTime 2025&& scope.autoplay 2026){ 2027this.move( scope, 1 ); 2028} 2029}.bind( this ) ); 2030}, 2031move: function( scope, direction ){ 2032if (scope.elements.items.length > 1) { 2033if (!scope.isAnimating) { 2034$($(scope.elements.navItem).get(scope.current - 1)).removeClass(scope.activeClass); 2035$($(scope.elements.items).get(scope.current - 1)).removeClass(scope.activeClass); 2036scope.current += direction; 2037if (scope.current >= scope.count + 1) { 2038view.update(scope, (-(scope.additionalItems - 1) * 100) + '%', true); 2039scope.current = 1; 2040} else if (scope.current <= 0) { 2041view.update(scope, (-(scope.count + scope.additionalItems) * 100) + '%', true); 2042scope.current = scope.count; 2043} 2044view.update(scope, (-(scope.current + scope.additionalItems - 1) * 100) + '%'); 2045scope.lastUpdate = (new Date()).getTime(); 2046$(scope.elements.currentLabel).text(scope.current); 2047$($(scope.elements.navItem).get(scope.current - 1)).addClass(scope.activeClass); 2048$($(scope.elements.items).get(scope.current - 1)).addClass(scope.activeClass); 2049} 2050} 2051}, 2052keyDown: function( element, event ) { 2053var scope = this.__getState(); 2054if( scope && scope.navArrows ) { 2055if ( event.keyCode === 37 ) { 2056this.clickPrev( scope ); 2057event.preventDefault(); 2058} else if ( event.keyCode === 39 ) { 2059this.clickNext( scope ); 2060event.preventDefault(); 2061} 2062} 2063}, 2064clickNext: function( scope ){ 2065this.move( scope, 1 ); 2066}, 2067clickPrev: function( scope ){ 2068this.move( scope, -1 ); 2069}, 2070swipeRight: function( scope ){ 2071this.move( scope, -1 ); 2072}, 2073swipeLeft: function( scope ){ 2074this.move( scope, 1 ); 2075}, 2076clickNavItem: function( scope, item ){ 2077var index = $( scope.elements.navItem ).index( item ) + 1; 2078this.gotoItem( scope, index ); 2079}, 2080gotoItem: function( scope, index ){ 2081if ( scope.current - index !== 0 ) { 2082this.move( scope, -1 * ( scope.current - index ) ); 2083} 2084} 2085} 2086} ) 2087.attachEvents( function( scope ){ 2088return { 2089clickNext: ['click', scope.elements.next, true], 2090clickPrev: ['click', scope.elements.prev, true], 2091clickNavItem: ['click', scope.elements.navItem, true], 2092swipeRight: ['swiperight', scope.elements.holder, true], 2093swipeLeft: ['swipeleft', scope.elements.holder, true] 2094} 2095} ).attachGlobalEvents( function( scope ){ 2096return { 2097keyDown: ['keydown', window] 2098} 2099}).view( function(){ 2100return { 2101addAdditionalItems: function( scope ){ 2102$( scope.elements.holder ).append( $( scope.elements.items[0] ).clone().addClass('is-additional') ); 2103$( scope.elements.holder ).append( $( scope.elements.items[1] ).clone().addClass('is-additional') ); 2104$( scope.elements.holder ).prepend( $( scope.elements.items[scope.elements.items.length - 1] ).clone().addClass('is-additional') ); 2105$( scope.elements.holder ).prepend( $( scope.elements.items[scope.elements.items.length - 2] ).clone().addClass('is-additional') ); 2106}, 2107update: function( scope, left, withoutAnimation ){ 2108if( !withoutAnimation ){ 2109scope.elements.holder.removeClass('no-transition'); 2110scope.elements.holder[0].offsetHeight; 2111if ( !Modernizr.csstransitions ) { 2112scope.isAnimating = true; 2113scope.elements.holder.animate( { left: left }, 800, function(){ 2114scope.isAnimating = false;
2115} ); 2116} else { 2117scope.elements.holder.css( { left: left } ); 2118} 2119}else{ 2120scope.elements.holder.addClass('no-transition'); 2121$(scope.root).css('height', $(scope.elements.items[0]).height() + "px"); 2122scope.elements.holder.css('display','none'); 2123scope.elements.holder[0].offsetHeight; 2124scope.elements.holder.css('display','block'); 2125$(scope.root).css('height','auto'); 2126scope.elements.holder.css( { left: left } ); 2127} 2128} 2129} 2130} ); 2131luana.factory( 'gallery-frontpage' ) 2132.defineElements( { 2133holder: '[gallery-holder]', 2134items: '[gallery-item]', 2135next: '[gallery-next]', 2136prev: '[gallery-prev]', 2137currentLabel: '[gallery-current]', 2138countLabel: '[gallery-count]', 2139navItem: '[gallery-nav-item]' 2140} ) 2141.describeScope( { 2142current: 1, 2143currentNavItem: -1, 2144count: 0, 2145lastUpdate: ( new Date() ).getTime(), 2146scrollTime: 6000, 2147isAnimating: false, 2148autoplay: true, 2149type: 'carousel', 2150activeClass: 'is-active', 2151notExcludedItems: {} 2152} ) 2153.controller( function( view ){ 2154return { 2155initialize: function(){ 2156this.__setInterval( this.update.bind( this ), 1000 ); 2157}, 2158eachScope: function( scope ){ 2159scope.count = scope.elements.items.length; 2160scope.notExcludedItems = $( scope.elements.items ).filter(':not(.excluded)'); 2161$( scope.elements.countLabel ).text( scope.count ); 2162scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 2163this.prepare( scope ); 2164if( $( scope.root ).hasClass( 'random-start' ) ){ 2165this.gotoItem( scope, parseInt( scope.count * Math.random() ) + 1 ); 2166} else { 2167if ( !$( scope.elements.items[scope.current - 1] ).hasClass('excluded') ) { 2168scope.currentNavItem = scope.current - 1; 2169$( $( scope.elements.navItem ).get( scope.currentNavItem ) ).addClass( scope.activeClass ); 2170} 2171} 2172}, 2173prepare: function( scope ){ 2174$(scope.elements.holder[0]).css({ 2175height: $(scope.elements.items[0]).height() + "px" 2176}); 2177for(var i = 0; i < scope.elements.items.length; ++i) { 2178$(scope.elements.items[i]).css({ 2179"position": "absolute", 2180"left": 0, 2181"top": 0 2182}); 2183} 2184view.update( scope, ( -( scope.current ) * 100 ) + '%', true ); 2185}, 2186update: function(){ 2187var currentTime = ( new Date() ).getTime(); 2188this.__throughScopes( function( index, scope ){ 2189if (scope.elements.items.length <= 1) { 2190$( scope.elements.next ).hide(); 2191$( scope.elements.prev ).hide(); 2192$( scope.elements.navItem ).hide(); 2193$( scope.elements.holder ).css({left: 0}); 2194return; 2195} 2196if( 2197scope.count > 1 2198&& currentTime - scope.lastUpdate >= scope.scrollTime 2199&& scope.autoplay 2200){ 2201this.move( scope, 1 ); 2202} 2203}.bind( this ) ); 2204}, 2205move: function( scope, direction ){ 2206if( !scope.isAnimating ){ 2207if ( scope.currentNavItem !== -1 ) $( $( scope.elements.navItem ).get( scope.currentNavItem ) ).removeClass( scope.activeClass ); 2208scope.current += direction; 2209if( scope.current >= scope.count + 1 ){ 2210scope.current = 1; 2211}else if( scope.current <= 0 ){ 2212scope.current = scope.count; 2213} 2214view.update( scope ); 2215this.setNavItemIndex(scope, scope.current); 2216scope.lastUpdate = ( new Date() ).getTime(); 2217$( scope.elements.currentLabel ).text( scope.current ); 2218if ( !$( $( scope.elements.items ).get( scope.current - 1 ) ).hasClass('excluded') ) $($(scope.elements.navItem).get( scope.currentNavItem )).addClass(scope.activeClass); 2219} 2220}, 2221clickNext: function( scope ){ 2222this.move( scope, 1 ); 2223}, 2224clickPrev: function( scope ){ 2225this.move( scope, -1 ); 2226}, 2227setNavItemIndex: function ( scope, index ) { 2228if ( index !== 0 ) { 2229scope.currentNavItem = $( scope.notExcludedItems ).index( $( scope.elements.items ).get( index - 1 ) ); 2230if ( scope.currentNavItem === -1 ) { 2231for ( var i = index; i > 0; i-- ) { 2232if ( !$( $( scope.elements.items ).get( i - 1 ) ).hasClass('excluded') ) { 2233this.setNavItemIndex(scope, i); 2234return; 2235} 2236} 2237} 2238} 2239}, 2240gotoItem: function( scope, index ) { 2241var targetIndex = -1 * ( scope.current - index ); 2242this.move(scope, targetIndex); 2243} 2244} 2245} ) 2246.attachEvents( function( scope ){ 2247return { 2248clickNext: ['click', scope.elements.next, true], 2249clickPrev: ['click', scope.elements.prev, true] 2250} 2251} ) 2252.view( function(){ 2253return { 2254update: function( scope ){ 2255$(scope.elements.holder[0]).height($(scope.elements.items[scope.current]).height()); 2256for(var i = 0; i < scope.elements.items.length; ++i) { 2257$(scope.elements.items[i]).removeClass(scope.activeClass); 2258} 2259setTimeout(function() { 2260$(scope.elements.items[scope.current - 1]).addClass(scope.activeClass); 2261}, 200); 2262} 2263} 2264} ); 2265luana.factory( 'gallery-hover' ) 2266.defineElements( { 2267holder: '[gallery-holder]', 2268items: '[gallery-item]', 2269next: '[gallery-next]', 2270prev: '[gallery-prev]', 2271currentLabel: '[gallery-current]', 2272countLabel: '[gallery-count]', 2273navItem: '[gallery-nav-item]' 2274} ) 2275.describeScope( { 2276current: 1, 2277count: 0, 2278lastUpdate: ( new Date() ).getTime(), 2279scrollTime: 6000, 2280isAnimating: false, 2281autoplay: true, 2282isSingle: false, 2283activeClass: 'is-active',
2284additionalItems: 2, 2285htmlVideoPlayers: [] 2286} ) 2287.controller( function( view ){ 2288return { 2289initialize: function(){ 2290this.__setInterval( this.update.bind( this ), 1000 ); 2291}, 2292eachScope: function( scope ){ 2293scope.count = scope.elements.items.length; 2294if ( typeof $(scope.root).data('scroll-time') !== 'undefined' && $(scope.root).data('scroll-time') !== "" ) { 2295scope.scrollTime = parseInt($(scope.root).data('scroll-time')); 2296} 2297$( scope.elements.countLabel ).text( scope.count ); 2298this.prepare( scope ); 2299}, 2300prepare: function( scope ){ 2301view.addAdditionalItems( scope ); 2302view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%', true ); 2303$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2304$( $( scope.elements.items ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2305var videoHTML; 2306$( scope.elements.items ).each(function(i) { 2307videoHTML = $(this).find('video'); 2308if (videoHTML.length) { 2309if (!videoHTML.is(":visible")) { 2310videoHTML[0].src = ''; 2311} else { 2312if (videoHTML.attr('portrait-src') && $( window ).width() < '768') { 2313videoHTML.attr('src', videoHTML.attr('portrait-src')); 2314} 2315scope.htmlVideoPlayers[i] = videoHTML[0]; 2316if (videoHTML.attr('autoplay')) { 2317videoHTML[0].pause(); 2318} 2319var playButton = $(this).find('[video-play-big]'); 2320var controls = $(this).find('[video-controls]'); 2321if (playButton.length) { 2322playButton.on('click', function() { 2323playButton.hide(); 2324scope.htmlVideoPlayers[i].play(); 2325if (controls.length) { 2326controls.attr('data-state', 'visible'); 2327} 2328}) 2329}
2330if (controls.length) { 2331var playpauseButton = controls.find('[playpause]'); 2332var muteButton = controls.find('[mute]'); 2333playpauseButton.on('click', function() { 2334if (playpauseButton.attr('data-state') == 'play') { 2335scope.htmlVideoPlayers[i].play(); 2336} else { 2337scope.htmlVideoPlayers[i].pause(); 2338} 2339}) 2340muteButton.on('click', function() { 2341if (muteButton.attr('data-state') == 'mute') { 2342muteButton.attr('data-state', 'unmute'); 2343scope.htmlVideoPlayers[i].muted = false; 2344} else { 2345muteButton.attr('data-state', 'mute'); 2346scope.htmlVideoPlayers[i].muted = true; 2347} 2348}) 2349} 2350scope.htmlVideoPlayers[i].onended = function() { 2351if (controls.length) { 2352playpauseButton.attr('data-state', 'play'); 2353} 2354scope.autoplay = true; 2355}; 2356scope.htmlVideoPlayers[i].onpause = function() { 2357if (controls.length) { 2358playpauseButton.attr('data-state', 'play'); 2359} 2360scope.autoplay = true; 2361}; 2362scope.htmlVideoPlayers[i].onplay = function() { 2363if (controls.length) { 2364playpauseButton.attr('data-state', 'pause'); 2365} 2366if (playButton.length) { 2367playButton.addClass('u-isHidden'); 2368} 2369scope.autoplay = false; 2370}; 2371} 2372} 2373}); 2374if (typeof scope.htmlVideoPlayers[scope.current - 1] != 'undefined') { 2375if (scope.htmlVideoPlayers[scope.current - 1].autoplay) { 2376var promise = scope.htmlVideoPlayers[scope.current - 1].play(); 2377var playButt = $( $( scope.elements.items ).get( scope.current - 1 ) ).find('[video-play-big]'); 2378if (promise !== undefined) { 2379promise.catch(function() { 2380if (playButt.length) { 2381playButt.removeClass('u-isHidden'); 2382} 2383}).then(function() { 2384}); 2385} 2386scope.autoplay = false; 2387} 2388} else { 2389scope.autoplay = true; 2390} 2391}, 2392update: function( scope ){ 2393var currentTime = ( new Date() ).getTime(); 2394this.__throughScopes( function( index, scope ){ 2395if ( $(window).width() > 1024 ) { 2396scope.autoplay = false; 2397} else { 2398var htmlVideo = $( $( scope.elements.items ).get( scope.current - 1 ) ).find('video'); 2399if (!htmlVideo.length) { 2400scope.autoplay = true; 2401} 2402} 2403if( 2404scope.count > 1 2405&& currentTime - scope.lastUpdate >= scope.scrollTime 2406&& scope.autoplay 2407){ 2408this.move( scope, 1 ); 2409} 2410}.bind( this ) ); 2411}, 2412move: function( scope, direction ){ 2413if( !scope.isAnimating ){ 2414if (typeof scope.htmlVideoPlayers[scope.current - 1] != 'undefined') { 2415scope.htmlVideoPlayers[scope.current - 1].pause(); 2416} 2417$( $( scope.elements.navItem ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 2418$( $( scope.elements.items ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 2419scope.current += direction; 2420if( scope.current >= scope.count + 1 ){ 2421view.update( scope, ( -( scope.additionalItems - 1 ) * 100 ) + '%', true ); 2422scope.current = 1; 2423}else if( scope.current <= 0 ){ 2424view.update( scope, ( -( scope.count + scope.additionalItems ) * 100 ) + '%', true ); 2425scope.current = scope.count; 2426} 2427view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%' ); 2428scope.lastUpdate = ( new Date() ).getTime(); 2429$( scope.elements.currentLabel ).text( scope.current ); 2430$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2431$( $( scope.elements.items ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2432if (typeof scope.htmlVideoPlayers[scope.current - 1] != 'undefined') { 2433if (scope.htmlVideoPlayers[scope.current - 1].autoplay) { 2434var promise = scope.htmlVideoPlayers[scope.current - 1].play(); 2435var playButt = $( $( scope.elements.items ).get( scope.current - 1 ) ).find('[video-play-big]'); 2436if (promise !== undefined) { 2437promise.catch(function() { 2438if (playButt.length) { 2439playButt.removeClass('u-isHidden'); 2440} 2441}).then(function() { 2442}); 2443} 2444} 2445} 2446} 2447}, 2448clickNext: function( scope ){ 2449this.move( scope, 1 ); 2450}, 2451clickPrev: function( scope ){ 2452this.move( scope, -1 ); 2453}, 2454swipeRight: function ( scope ) { 2455if (!scope.isSingle) { 2456this.move( scope, -1 ); 2457} 2458}, 2459swipeLeft: function ( scope ) { 2460if (!scope.isSingle) { 2461this.move( scope, 1 ); 2462} 2463}, 2464clickNavItem: function( scope, item ){ 2465var index = $( scope.elements.navItem ).index( item ) + 1; 2466this.gotoItem( scope, index ); 2467}, 2468gotoItem: function( scope, index ){ 2469if ( scope.current - index !== 0 ) { 2470this.move( scope, -1 * ( scope.current - index ) ); 2471} 2472} 2473} 2474} ) 2475.attachEvents( function( scope ){ 2476return { 2477clickNext: ['click', scope.elements.next, true], 2478clickPrev: ['click', scope.elements.prev, true], 2479clickNavItem: ['mouseover', scope.elements.navItem, true],
2480swipeRight: ['swiperight', scope.elements.holder, true], 2481swipeLeft: ['swipeleft', scope.elements.holder, true] 2482} 2483} ) 2484.view( function(){ 2485return { 2486addAdditionalItems: function( scope ){ 2487function updateVideoItem(appendItem) { 2488var appendVideoItem = appendItem.find('video'); 2489if (appendVideoItem.length) { 2490appendVideoItem[0].autoplay = false; 2491appendVideoItem[0].muted = true; 2492appendVideoItem[0].preload = 'none'; 2493appendVideoItem[0].pause(); 2494} 2495} 2496var appendItem = $( scope.elements.items[0] ).clone(); 2497updateVideoItem(appendItem); 2498$( scope.elements.holder ).append( appendItem ); 2499appendItem = $( scope.elements.items[1] ).clone(); 2500updateVideoItem(appendItem); 2501$( scope.elements.holder ).append( appendItem ); 2502appendItem = $( scope.elements.items[scope.elements.items.length - 1] ).clone(); 2503updateVideoItem(appendItem); 2504$( scope.elements.holder ).prepend( appendItem ); 2505appendItem = $( scope.elements.items[scope.elements.items.length - 2] ).clone(); 2506updateVideoItem(appendItem); 2507$( scope.elements.holder ).prepend( appendItem ); 2508}, 2509update: function( scope, left, withoutAnimation ){ 2510if( !withoutAnimation ){ 2511scope.elements.holder.removeClass('no-transition'); 2512scope.elements.holder[0].offsetHeight; 2513if ( !Modernizr.csstransitions ) { 2514scope.isAnimating = true; 2515scope.elements.holder.animate( { left: left }, 800, function(){ 2516scope.isAnimating = false; 2517} ); 2518} else { 2519scope.elements.holder.css( { left: left } ); 2520} 2521}else{ 2522scope.elements.holder.addClass('no-transition'); 2523$(scope.root).css('height', $(scope.elements.items[0]).height() + "px"); 2524scope.elements.holder.css('display','none'); 2525scope.elements.holder[0].offsetHeight; 2526scope.elements.holder.css('display','block'); 2527$(scope.root).css('height','auto'); 2528scope.elements.holder.css( { left: left } ); 2529} 2530} 2531} 2532} ); 2533luana.factory( 'gallery-double' ) 2534.defineElements( { 2535holder1: '[gallery-holder-1]', 2536holder2: '[gallery-holder-2]', 2537items1: '[gallery-item-1]', 2538items2: '[gallery-item-2]', 2539next: '[gallery-next]', 2540prev: '[gallery-prev]', 2541currentLabel: '[gallery-current]', 2542countLabel: '[gallery-count]', 2543navItem: '[gallery-nav-item]' 2544} ) 2545.describeScope( { 2546current: 1, 2547count: 0, 2548lastUpdate: ( new Date() ).getTime(), 2549scrollTime: 6000, 2550isAnimating: false, 2551autoplay: true, 2552activeClass: 'is-active', 2553additionalItems: 2, 2554autoplayNow: true 2555} ) 2556.controller( function( view ){ 2557return { 2558initialize: function(){ 2559this.__setInterval( this.update.bind( this ), 1000 ); 2560}, 2561eachScope: function( scope ){ 2562scope.count = scope.elements.items1.length; 2563$( scope.elements.countLabel ).text( scope.count ); 2564scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 2565this.prepare( scope ); 2566}, 2567prepare: function( scope ){ 2568if (scope.elements.items1.length > 1) { 2569view.addAdditionalItems( scope ); 2570view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%', true ); 2571$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2572$( $( scope.elements.items1 ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2573$( $( scope.elements.items2 ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2574scope.navArrows = typeof $(scope.root).attr('naw-arrows') !== 'undefined'; 2575if (scope.navArrows) { 2576this.__setState(scope); 2577} 2578} else { 2579$( scope.elements.next ).hide(); 2580$( scope.elements.prev ).hide(); 2581$( scope.elements.navItem ).hide(); 2582} 2583}, 2584update: function( scope ){ 2585var currentTime = ( new Date() ).getTime(); 2586if (scope.elements.items1.length <= 1) { 2587$( scope.elements.next ).hide(); 2588$( scope.elements.prev ).hide(); 2589$( scope.elements.navItem ).hide(); 2590$( scope.elements.holder ).css({left: 0}); 2591return; 2592} 2593this.__throughScopes( function( index, scope ){ 2594scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 2595if( 2596scope.count > 1 2597&& currentTime - scope.lastUpdate >= scope.scrollTime 2598&& scope.autoplay 2599&& scope.autoplayNow 2600){ 2601this.move( scope, 1 ); 2602} 2603}.bind( this ) ); 2604}, 2605move: function( scope, direction ){ 2606if (scope.elements.items1.length > 1) { 2607if( !scope.isAnimating ){ 2608$( $( scope.elements.navItem ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 2609$( $( scope.elements.items1 ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 2610$( $( scope.elements.items2 ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 2611scope.current += direction; 2612if( scope.current >= scope.count + 1 ){ 2613view.update( scope, ( -( scope.additionalItems - 1 ) * 100 ) + '%', true ); 2614scope.current = 1; 2615}else if( scope.current <= 0 ){ 2616view.update( scope, ( -( scope.count + scope.additionalItems ) * 100 ) + '%', true ); 2617scope.current = scope.count; 2618} 2619view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%' ); 2620scope.lastUpdate = ( new Date() ).getTime(); 2621$( scope.elements.currentLabel ).text( scope.current ); 2622$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2623$( $( scope.elements.items1 ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2624$( $( scope.elements.items2 ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2625} 2626} 2627}, 2628hoverOn1: function( scope ) { 2629scope.autoplayNow = false;
2630}, 2631hoverOff1: function( scope ) { 2632scope.autoplayNow = true; 2633}, 2634hoverOn2: function( scope ) { 2635scope.autoplayNow = false; 2636}, 2637hoverOff2: function( scope ) { 2638scope.autoplayNow = true; 2639}, 2640clickNext: function( scope ){ 2641this.move( scope, 1 ); 2642}, 2643clickPrev: function( scope ){ 2644this.move( scope, -1 ); 2645}, 2646swipeRight: function( scope ){ 2647this.move( scope, -1 ); 2648}, 2649swipeLeft: function( scope ){ 2650this.move( scope, 1 ); 2651}, 2652clickNavItem: function( scope, item ){ 2653var index = $( scope.elements.navItem ).index( item ) + 1; 2654this.gotoItem( scope, index ); 2655}, 2656gotoItem: function( scope, index ){ 2657if ( scope.current - index !== 0 ) { 2658this.move( scope, -1 * ( scope.current - index ) ); 2659} 2660} 2661} 2662} ) 2663.attachEvents( function( scope ){ 2664return { 2665clickNext: ['click', scope.elements.next, true], 2666clickPrev: ['click', scope.elements.prev, true], 2667clickNavItem: ['click', scope.elements.navItem, true], 2668hoverOn1: ['mouseover', scope.elements.holder1, true], 2669hoverOff1: ['mouseleave', scope.elements.holder1, true], 2670hoverOn2: ['mouseover', scope.elements.holder2, true], 2671hoverOff2: ['mouseleave', scope.elements.holder2, true], 2672swipeRight: ['swiperight', scope.elements.holder1, true], 2673swipeLeft: ['swipeleft', scope.elements.holder1, true] 2674} 2675} ) 2676.view( function(){ 2677return { 2678addAdditionalItems: function( scope ){ 2679$( scope.elements.holder1 ).append( $( scope.elements.items1[0] ).clone() ); 2680$( scope.elements.holder1 ).append( $( scope.elements.items1[1] ).clone() ); 2681$( scope.elements.holder1 ).prepend( $( scope.elements.items1[scope.elements.items1.length - 1] ).clone() ); 2682$( scope.elements.holder1 ).prepend( $( scope.elements.items1[scope.elements.items1.length - 2] ).clone() ); 2683$( scope.elements.holder2 ).append( $( scope.elements.items2[0] ).clone() ); 2684$( scope.elements.holder2 ).append( $( scope.elements.items2[1] ).clone() ); 2685$( scope.elements.holder2 ).prepend( $( scope.elements.items2[scope.elements.items2.length - 1] ).clone() ); 2686$( scope.elements.holder2 ).prepend( $( scope.elements.items2[scope.elements.items2.length - 2] ).clone() ); 2687}, 2688update: function( scope, left, withoutAnimation ){ 2689if( !withoutAnimation ){ 2690scope.elements.holder1.removeClass('no-transition'); 2691scope.elements.holder2.removeClass('no-transition'); 2692scope.elements.holder1[0].offsetHeight; 2693scope.elements.holder2[0].offsetHeight; 2694if ( !Modernizr.csstransitions ) { 2695scope.isAnimating = true; 2696scope.elements.holder1.animate( { left: left }, 800, function(){ 2697scope.isAnimating = false; 2698} ); 2699scope.elements.holder2.animate( { left: left }, 800, function(){ 2700scope.isAnimating = false; 2701} ); 2702} else { 2703scope.elements.holder1.css( { left: left } ); 2704scope.elements.holder2.css( { left: left } ); 2705} 2706}else{ 2707scope.elements.holder1.addClass('no-transition'); 2708scope.elements.holder2.addClass('no-transition'); 2709$(scope.root).css('height', $(scope.elements.items1[0]).height() + "px"); 2710$(scope.root).css('height', $(scope.elements.items2[0]).height() + "px"); 2711scope.elements.holder1.css('display','none'); 2712scope.elements.holder2.css('display','none'); 2713scope.elements.holder1[0].offsetHeight; 2714scope.elements.holder2[0].offsetHeight; 2715scope.elements.holder1.css('display','block'); 2716scope.elements.holder2.css('display','block'); 2717$(scope.root).css('height','auto'); 2718scope.elements.holder1.css( { left: left } ); 2719scope.elements.holder2.css( { left: left } ); 2720} 2721} 2722} 2723} ); 2724luana.factory( 'gallery-slice' ) 2725.defineElements( { 2726holder: '[gallery-holder]', 2727items: '[gallery-item]', 2728next: '[gallery-next]', 2729prev: '[gallery-prev]', 2730currentLabel: '[gallery-current]', 2731countLabel: '[gallery-count]', 2732navItem: '[gallery-nav-item]' 2733} ) 2734.describeScope( { 2735current: 1, 2736count: 0, 2737lastUpdate: ( new Date() ).getTime(), 2738scrollTime: 6000, 2739isAnimating: false, 2740autoplay: true, 2741activeClass: 'is-active', 2742additionalItems: 2, 2743autoplayNow: true 2744} ) 2745.controller( function( view ){ 2746return { 2747initialize: function(){ 2748this.__setInterval( this.update.bind( this ), 1000 ); 2749}, 2750eachScope: function( scope ){ 2751scope.count = scope.elements.items.length; 2752$( scope.elements.countLabel ).text( scope.count ); 2753this.prepare( scope ); 2754if( $( scope.root ).hasClass( 'random-start' ) ){ 2755this.gotoItem( scope, parseInt( scope.count * Math.random() ) + 1 ); 2756} 2757}, 2758prepare: function( scope ){ 2759view.addAdditionalItems( scope ); 2760if ($(window).width() < 769 ) { 2761view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%', true ); 2762} else { 2763view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 50 ) + '%', true ); 2764} 2765$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2766$( $( scope.elements.items ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2767var thx = this; 2768var allItems= $(scope.root).find(".rotate-item"); 2769$(".rotate-item").mouseover(function () { 2770scope.autoplayNow = false;
2771thx.hover(scope, this, allItems ); 2772}); 2773if (!($( scope.root ).hasClass("no-autoplay"))) { 2774$(".rotate-item").mouseleave(function () { 2775scope.autoplayNow = true; 2776}); 2777} 2778}, 2779update: function( scope ){ 2780var currentTime = ( new Date() ).getTime(); 2781this.__throughScopes( function( index, scope ){ 2782if (scope.elements.items.length <= 1) { 2783$( scope.elements.next ).hide(); 2784$( scope.elements.prev ).hide(); 2785$( scope.elements.navItem ).hide(); 2786$( scope.elements.holder ).css({left: 0}); 2787return; 2788} 2789scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 2790if( 2791scope.count > 1 2792&& currentTime - scope.lastUpdate >= scope.scrollTime 2793&& scope.autoplay && scope.autoplayNow 2794){ 2795this.move( scope, 1 ); 2796} 2797}.bind( this ) ); 2798}, 2799move: function( scope, direction ){ 2800if( !scope.isAnimating ){ 2801$( $( scope.elements.navItem ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 2802$( $( scope.elements.items ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 2803scope.current += direction; 2804if( scope.current >= scope.count + 1 ){ 2805if ($(window).width() < 769 ) { 2806view.update( scope, ( -( scope.additionalItems - 1 ) * 100 ) + '%', true ); 2807} else { 2808view.update( scope, ( -( scope.additionalItems - 1 ) * 50 ) + '%', true ); 2809} 2810scope.current = 1; 2811}else if( scope.current <= 0 ){ 2812if ($(window).width() < 769 ) { 2813view.update( scope, ( -( scope.count + scope.additionalItems ) * 100 ) + '%', true ); 2814} else { 2815view.update( scope, ( -( scope.count + scope.additionalItems ) * 50 ) + '%', true ); 2816} 2817scope.current = scope.count; 2818} 2819if ($(window).width() < 769 ) { 2820view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%' ); 2821} else { 2822view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 50 ) + '%' ); 2823} 2824scope.lastUpdate = ( new Date() ).getTime(); 2825$( scope.elements.currentLabel ).text( scope.current ); 2826$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2827$( $( scope.elements.items ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2828} 2829}, 2830clickNext: function( scope ){ 2831this.move( scope, 1 ); 2832}, 2833clickPrev: function( scope ){ 2834this.move( scope, -1 ); 2835}, 2836swipeRight: function( scope ){ 2837this.move( scope, -1 ); 2838}, 2839swipeLeft: function( scope ){ 2840this.move( scope, 1 ); 2841}, 2842hover: function( scope, item, allItems ) { 2843var elementWidth = $(".slice-slider-container").width() / 2; 2844var parentWidth = $( scope.root ).width(); 2845if (parentWidth > elementWidth*2) { 2846var itemoffset = (elementWidth - ( (parentWidth - elementWidth*2) / 2) ) / (elementWidth*0.02); 2847var currentLeft = ( -( scope.current + scope.additionalItems - 1 ) * 50 ); 2848if ( item == $( allItems ).get( scope.current )) { 2849var go = ( -( scope.current + scope.additionalItems - 1 ) * 50 ) + itemoffset; 2850if (parentWidth < elementWidth*3) { 2851scope.current = scope.current - 1; 2852} 2853view.update( scope, go + '%' ); 2854} else if ( item == $( allItems ).get( scope.current + 3 ) ) { 2855var go = ( -( scope.current + scope.additionalItems - 1 ) * 50 ) - itemoffset; 2856if (parentWidth < elementWidth*3) { 2857scope.current = scope.current + 1; 2858} 2859view.update( scope, go + '%' ); 2860} 2861} 2862}, 2863clickNavItem: function( scope, item ){ 2864var index = $( scope.elements.navItem ).index( item ) + 1; 2865this.gotoItem( scope, index ); 2866}, 2867gotoItem: function( scope, index ){ 2868if ( scope.current - index !== 0 ) { 2869this.move( scope, -1 * ( scope.current - index ) ); 2870} 2871} 2872} 2873} ) 2874.attachEvents( function( scope ){ 2875return { 2876clickNext: ['click', scope.elements.next, true], 2877clickPrev: ['click', scope.elements.prev, true], 2878clickNavItem: ['click', scope.elements.navItem, true], 2879swipeRight: ['swiperight', scope.elements.holder, true], 2880swipeLeft: ['swipeleft', scope.elements.holder, true] 2881} 2882} ) 2883.view( function(){ 2884return { 2885addAdditionalItems: function( scope ){ 2886$( scope.elements.holder ).append( $( scope.elements.items[0] ).clone() ); 2887$( scope.elements.holder ).append( $( scope.elements.items[1] ).clone() ); 2888$( scope.elements.holder ).prepend( $( scope.elements.items[scope.elements.items.length - 1] ).clone() ); 2889$( scope.elements.holder ).prepend( $( scope.elements.items[scope.elements.items.length - 2] ).clone() ); 2890}, 2891update: function( scope, left, withoutAnimation ){ 2892if( !withoutAnimation ){ 2893scope.elements.holder.removeClass('no-transition'); 2894scope.elements.holder[0].offsetHeight; 2895if ( !Modernizr.csstransitions ) { 2896scope.isAnimating = true; 2897scope.elements.holder.animate( { left: left }, 800, function(){ 2898scope.isAnimating = false;
2899} ); 2900} else { 2901scope.elements.holder.css( { left: left } ); 2902} 2903} else { 2904scope.elements.holder.addClass('no-transition'); 2905$(scope.root).css('height', $(scope.elements.items[0]).height() + "px"); 2906scope.elements.holder.css('display','none'); 2907scope.elements.holder[0].offsetHeight; 2908scope.elements.holder.css('display','block'); 2909$(scope.root).css('height','auto'); 2910scope.elements.holder.css( { left: left } ); 2911} 2912} 2913} 2914} ); 2915luana.factory( 'gallery-half' ) 2916.defineElements( { 2917holder: '[gallery-holder]', 2918items: '[gallery-item]', 2919next: '[gallery-next]', 2920prev: '[gallery-prev]', 2921currentLabel: '[gallery-current]', 2922countLabel: '[gallery-count]', 2923navItem: '[gallery-nav-item]' 2924} ) 2925.describeScope( { 2926current: 1, 2927count: 0, 2928lastUpdate: ( new Date() ).getTime(), 2929scrollTime: 6000, 2930isAnimating: false, 2931autoplay: true, 2932activeClass: 'is-active', 2933additionalItems: 2 2934} ) 2935.controller( function( view ){ 2936return { 2937initialize: function(){ 2938this.__setInterval( this.update.bind( this ), 1000 ); 2939}, 2940eachScope: function( scope ){ 2941scope.count = scope.elements.items.length; 2942$( scope.elements.countLabel ).text( scope.count ); 2943scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 2944this.prepare( scope ); 2945if( $( scope.root ).hasClass( 'random-start' ) ){ 2946this.gotoItem( scope, parseInt( scope.count * Math.random() ) + 1 ); 2947} 2948}, 2949prepare: function( scope ){ 2950if (scope.elements.items.length > 1) { 2951view.addAdditionalItems( scope ); 2952if ($(window).width() < 769 ) { 2953view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%', true ); 2954} else { 2955if (scope.count == 2) { 2956$( scope.elements.next ).addClass("hidden"); 2957$( scope.elements.prev ).addClass("hidden"); 2958} else { 2959view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 50 ) + '%', true ); 2960} 2961} 2962$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2963$( $( scope.elements.items ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 2964} else { 2965$( scope.elements.next ).hide(); 2966$( scope.elements.prev ).hide(); 2967$( scope.elements.navItem ).hide(); 2968} 2969}, 2970update: function( scope ){ 2971var currentTime = ( new Date() ).getTime(); 2972this.__throughScopes( function( index, scope ){ 2973if (scope.elements.items.length <= 1) { 2974$( scope.elements.next ).hide(); 2975$( scope.elements.prev ).hide(); 2976$( scope.elements.navItem ).hide(); 2977$( scope.elements.holder ).css({left: 0}); 2978return; 2979} 2980scope.autoplay = !$( scope.root ).hasClass( 'no-autoplay' ); 2981if( 2982scope.count > 1 2983&& currentTime - scope.lastUpdate >= scope.scrollTime 2984&& scope.autoplay 2985){ 2986if (scope.count == 2 && $(window).width() > 769 ){ 2987$( scope.elements.next ).addClass("hidden"); 2988$( scope.elements.prev ).addClass("hidden"); 2989} else { 2990$( scope.elements.next ).removeClass("hidden"); 2991$( scope.elements.prev ).removeClass("hidden"); 2992this.move( scope, 1 ); 2993} 2994} 2995}.bind( this ) ); 2996}, 2997move: function( scope, direction ){ 2998if (scope.elements.items.length > 1) { 2999if( !scope.isAnimating ){ 3000$( $( scope.elements.navItem ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 3001$( $( scope.elements.items ).get( scope.current - 1 ) ).removeClass( scope.activeClass ); 3002scope.current += direction; 3003if( scope.current >= scope.count + 1 ){ 3004if ($(window).width() < 769 ) { 3005view.update( scope, ( -( scope.additionalItems - 1 ) * 100 ) + '%', true ); 3006} else { 3007view.update( scope, ( -( scope.additionalItems - 1 ) * 50 ) + '%', true ); 3008} 3009scope.current = 1; 3010}else if( scope.current <= 0 ){ 3011if ($(window).width() < 769 ) { 3012view.update( scope, ( -( scope.count + scope.additionalItems ) * 100 ) + '%', true ); 3013} else { 3014view.update( scope, ( -( scope.count + scope.additionalItems ) * 50 ) + '%', true ); 3015} 3016scope.current = scope.count; 3017} 3018if ($(window).width() < 769 ) { 3019view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 100 ) + '%' ); 3020} else { 3021view.update( scope, ( -( scope.current + scope.additionalItems - 1 ) * 50 ) + '%' ); 3022} 3023scope.lastUpdate = ( new Date() ).getTime(); 3024$( scope.elements.currentLabel ).text( scope.current ); 3025$( $( scope.elements.navItem ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 3026$( $( scope.elements.items ).get( scope.current - 1 ) ).addClass( scope.activeClass ); 3027} 3028} 3029}, 3030clickNext: function( scope ){ 3031this.move( scope, 1 ); 3032}, 3033clickPrev: function( scope ){ 3034this.move( scope, -1 ); 3035}, 3036swipeRight: function( scope ){ 3037this.move( scope, -1 ); 3038}, 3039swipeLeft: function( scope ){ 3040this.move( scope, 1 ); 3041}, 3042clickNavItem: function( scope, item ){ 3043var index = $( scope.elements.navItem ).index( item ) + 1; 3044this.gotoItem( scope, index ); 3045}, 3046gotoItem: function( scope, index ){ 3047if ( scope.current - index !== 0 ) { 3048this.move( scope, -1 * ( scope.current - index ) ); 3049} 3050} 3051} 3052} ) 3053.attachEvents( function( scope ){ 3054return { 3055clickNext: ['click', scope.elements.next, true], 3056clickPrev: ['click', scope.elements.prev, true], 3057clickNavItem: ['click', scope.elements.navItem, true],
3058swipeRight: ['swiperight', scope.elements.holder, true], 3059swipeLeft: ['swipeleft', scope.elements.holder, true] 3060} 3061} ) 3062.view( function(){ 3063return { 3064addAdditionalItems: function( scope ){ 3065$( scope.elements.holder ).append( $( scope.elements.items[0] ).clone() ); 3066$( scope.elements.holder ).append( $( scope.elements.items[1] ).clone() ); 3067$( scope.elements.holder ).prepend( $( scope.elements.items[scope.elements.items.length - 1] ).clone() ); 3068$( scope.elements.holder ).prepend( $( scope.elements.items[scope.elements.items.length - 2] ).clone() ); 3069}, 3070update: function( scope, left, withoutAnimation ){ 3071if( !withoutAnimation ){ 3072scope.elements.holder.removeClass('no-transition'); 3073scope.elements.holder[0].offsetHeight; 3074if ( !Modernizr.csstransitions ) { 3075scope.isAnimating = true; 3076scope.elements.holder.animate( { left: left }, 800, function(){ 3077scope.isAnimating = false; 3078} ); 3079} else { 3080scope.elements.holder.css( { left: left } ); 3081} 3082}else{ 3083scope.elements.holder.addClass('no-transition'); 3084$(scope.root).css('height', $(scope.elements.items[0]).height() + "px"); 3085scope.elements.holder.css('display','none'); 3086scope.elements.holder[0].offsetHeight; 3087scope.elements.holder.css('display','block'); 3088$(scope.root).css('height','auto'); 3089scope.elements.holder.css( { left: left } ); 3090} 3091} 3092} 3093} ); 3094luana.factory( 'show-hide-class' ) 3095.describeScope( { 3096className: 'is-visible', 3097target: '', 3098parent: '' 3099} ).controller( function( view ){ 3100return { 3101eachScope: function( scope ){ 3102scope.target = typeof $( scope.root ).attr( 'data-target' ) === 'undefined' ? scope.target : $( scope.root ).attr( 'data-target' ); 3103scope.parent = typeof $( scope.root ).attr( 'data-parent' ) === 'undefined' ? scope.parent : $( scope.root ).attr( 'data-parent' ); 3104scope.changeTriggerText = !( typeof $( scope.root ).attr( 'data-hide-text' ) === 'undefined' || typeof $( scope.root ).attr( 'data-show-text' ) === 'undefined' ); 3105if ( scope.changeTriggerText ) { 3106scope.triggerTextShow = $( scope.root ).attr( 'data-show-text' ); 3107scope.triggerTextHide = $( scope.root ).attr( 'data-hide-text' ); 3108} 3109}, 3110show: function( scope ) { 3111view.show( scope ); 3112if ( scope.changeTriggerText ) { 3113$( scope.root ).text( scope.triggerTextShow ); 3114} 3115}, 3116hide: function( scope ) { 3117view.hide( scope ); 3118if ( scope.changeTriggerText ) { 3119$( scope.root ).text( scope.triggerTextHide ); 3120} 3121}, 3122update: function( scope ){ 3123if( $( scope.target ).hasClass( scope.className ) ){ 3124this.hide( scope ); 3125}else{ 3126this.show( scope ); 3127} 3128} 3129}; 3130} ).attachEvents( function( scope ){ 3131return { 3132update: ['click', scope.root, true] 3133}; 3134} ).view( function(){ 3135return { 3136show: function( scope ){ 3137this.addClass( scope ); 3138}, 3139hide: function( scope ){ 3140this.removeClass( scope ); 3141}, 3142addClass: function( scope ) { 3143$( scope.root ).addClass( scope.className ); 3144$( scope.target ).addClass( scope.className ); 3145$( scope.parent ).addClass( scope.className ); 3146}, 3147removeClass: function( scope ) { 3148$( scope.root ).removeClass( scope.className ); 3149$( scope.target ).removeClass( scope.className ); 3150$( scope.parent ).removeClass( scope.className ); 3151} 3152} 3153} ); 3154luana.factory( 'gallery-controler' ) 3155.describeScope( { 3156target: '', 3157items: '.slider', 3158next: '[gallery-next]', 3159prev: '[gallery-prev]', 3160navItem: '[gallery-nav-item]', 3161holder: '[gallery-holder]', 3162intervalId: null, 3163openMenuBtn: '.globalheader-menu-btn' 3164} ).controller( function( view ){ 3165return { 3166initialize: function(){ 3167this.__throughScopes(function (index, scope) { 3168this.scroll(scope); 3169this.orientationChange(scope); 3170}.bind(this)); 3171}, 3172scrollHandler: function( scope) { 3173scope.intervalId && window.clearTimeout(scope.intervalId); 3174scope.intervalId = window.setTimeout(function() { 3175this.scroll(scope); 3176window.clearTimeout(scope.intervalId) 3177}.bind(this),400) 3178}, 3179orientationChange: function(scope) { 3180window.setTimeout(function() { 3181this.__throughScopes( 3182function (index, scope) { 3183if (window.innerWidth <= 736) { 3184$(scope.items).removeClass("no-autoplay"); 3185} else { 3186this.scroll(scope); 3187} 3188}.bind(this) 3189); 3190}.bind(this),100) 3191}, 3192scroll: function( scope ){ 3193if (window.innerWidth <= 736) { 3194return; 3195} 3196$(scope.items).addClass( "no-autoplay" ); 3197if ($(scope.openMenuBtn).hasClass('is-open')) { 3198return; 3199} 3200var thx = this; 3201$(scope.items).each(function (index, item) { 3202if (thx.checkVisible(item)) { 3203$(item).removeClass( "no-autoplay" ); 3204return false;
3205} 3206}); 3207}, 3208checkVisible: function ( elm ) { 3209var vpH = $(window).height(), // Viewport Height 3210st = $(window).scrollTop(), // Scroll Top 3211y = $(elm).offset().top, 3212elementHeight = $(elm).height(); 3213return (st-y)<=0; 3214}, 3215openMenu: function ( scope, element) { 3216if (window.innerWidth <= 736) { 3217return; 3218} 3219if ($(element).hasClass('is-open')) { 3220$(scope.items).addClass( "no-autoplay" ); 3221} else { 3222this.scroll(scope); 3223} 3224}, 3225clickNavItem: function ( scope, element) { 3226if (window.innerWidth <= 736) { 3227return; 3228} 3229$(scope.items).addClass( "no-autoplay" ); 3230var currentItem = $( element ).parents(".slider"); 3231$(currentItem).removeClass( "no-autoplay"); 3232}, 3233clickNext: function ( scope, element) { 3234if (window.innerWidth <= 736) { 3235return; 3236} 3237$(scope.items).addClass( "no-autoplay" ); 3238var currentItem = $( element ).parents(".slider"); 3239$(currentItem).removeClass( "no-autoplay"); 3240}, 3241clickPrev: function ( scope, element) { 3242if (window.innerWidth <= 736) { 3243return; 3244} 3245$(scope.items).addClass( "no-autoplay" ); 3246var currentItem = $( element ).parents(".slider"); 3247$(currentItem).removeClass( "no-autoplay"); 3248}, 3249swipeRight: function ( scope, element) { 3250if (window.innerWidth <= 736) { 3251return; 3252} 3253$(scope.items).addClass( "no-autoplay" ); 3254var currentItem = $( element ).parents(".slider"); 3255$(currentItem).removeClass( "no-autoplay"); 3256}, 3257swipeLeft: function ( scope, element) { 3258if (window.innerWidth <= 736) { 3259return; 3260} 3261$(scope.items).addClass( "no-autoplay" ); 3262var currentItem = $( element ).parents(".slider"); 3263$(currentItem).removeClass( "no-autoplay"); 3264} 3265}; 3266} ).attachEvents( function( scope ){ 3267return { 3268scrollHandler: ['scroll', document, true], 3269clickNavItem: ['click', scope.navItem, true], 3270clickNext: ['click', scope.next, true], 3271clickPrev: ['click', scope.prev, true], 3272swipeRight: ['swiperight', scope.holder, true], 3273swipeLeft: ['swipeleft', scope.holder, true], 3274openMenu: ['click', document, scope.openMenuBtn, false] 3275}; 3276} ).attachGlobalEvents( function(){ 3277return { 3278orientationChange: ['orientationchange', window, true] 3279}; 3280}); 3281luana.factory( 'scroll-menu' ) 3282.defineElements( { 3283target: '', 3284menu: '.rotate-menu', 3285menuId: 'rotate-menu', 3286holder: '.sotc-nav-holder', 3287items: '.rotate-menu-item', 3288leftBtn: '[menu-left]', 3289rightBtn: '[menu-right]' 3290} ) 3291.describeScope( { 3292diff: 0, 3293count: 0, 3294isAnimating: false, 3295current: 0, 3296timeout: null 3297} ) 3298.controller( function( view ){ 3299return { 3300initialize: function() { 3301this.__throughScopes(function(index, scope){ 3302this.prepare(scope); 3303}.bind(this) ); 3304}, 3305prepare: function( scope ){ 3306var menuWidth = document.getElementById('rotate-menu').scrollWidth; 3307var holderWidth = $(scope.elements.holder).width(); 3308scope.diff = menuWidth - holderWidth; 3309var curLeft = parseInt($(scope.elements.menu).css("left")); 3310if (scope.diff < 0) { 3311$(scope.elements.rightBtn).addClass("hidden"); 3312$(scope.elements.leftBtn).addClass("hidden"); 3313} 3314if (scope.diff > 0) { 3315$(scope.elements.leftBtn).addClass("hidden"); 3316$(scope.elements.rightBtn).removeClass("hidden"); 3317} 3318}, 3319windowResize: function() { 3320this.__throughScopes( function( index, scope ){ 3321$(scope.elements.leftBtn).addClass("hidden"); 3322$('.rotate-menu').css( { left: 0 }); 3323scope.current = 0; 3324var menuWidth = document.getElementById('rotate-menu').scrollWidth; 3325var holderWidth = $(scope.elements.holder).width(); 3326scope.diff = menuWidth - holderWidth; 3327var curLeft = parseInt($(scope.elements.menu).css("left")); 3328if (scope.diff < 0) { 3329$(scope.elements.rightBtn).addClass("hidden"); 3330$(scope.elements.leftBtn).addClass("hidden"); 3331left = 0; 3332$('.rotate-menu').css( { left: left }); 3333} 3334if (scope.diff > 0) { 3335if (!(curLeft < 0)) { 3336$(scope.elements.rightBtn).removeClass("hidden"); 3337} else if (curLeft > holderWidth - menuWidth){ 3338$(scope.elements.leftBtn).removeClass("hidden"); 3339} else { 3340$(scope.elements.rightBtn).removeClass("hidden"); 3341$(scope.elements.leftBtn).removeClass("hidden"); 3342} 3343} 3344}.bind( this ) ); 3345}, 3346clickLeft: function( scope ){ 3347if( scope.isAnimating || scope.current == 0 ){ 3348return 3349} 3350var menuWidth = document.getElementById('rotate-menu').scrollWidth; 3351var holderWidth = $(scope.elements.holder).width(); 3352scope.diff = menuWidth - holderWidth; 3353var items = $( scope.elements.items ); 3354if (window.innerWidth <= 769 && scope.current == 1) { 3355$(scope.elements.rightBtn).addClass("hidden"); 3356} 3357var currentWidth = $(items[scope.current]).outerWidth(); 3358var curLeft = parseInt($(scope.elements.menu).css("left")); 3359var left = 0; 3360if (scope.diff > 0 && curLeft < 0) { 3361if (curLeft + currentWidth >= 0) { 3362left = 0; 3363$(scope.elements.leftBtn).addClass("hidden"); 3364$(scope.elements.rightBtn).removeClass("hidden"); 3365scope.current = 0; 3366} else { 3367left = curLeft + currentWidth; 3368$(scope.elements.rightBtn).removeClass("hidden"); 3369scope.current = scope.current - 1; 3370} 3371scope.isAnimating = true; 3372$('.rotate-menu').css( { left: left }); 3373setInterval(function() {scope.isAnimating = false;}, 600); 3374} 3375}, 3376swipeRight: function ( scope, element) { 3377this.clickLeft(scope); 3378}, 3379swipeLeft: function ( scope, element) { 3380this.clickRight(scope); 3381}, 3382clickRight: function ( scope, element) { 3383var items = $( scope.elements.items); 3384if( scope.isAnimating || items.length - 1 == scope.current ){ 3385return; 3386} 3387var menuWidth = document.getElementById('rotate-menu').scrollWidth; 3388var holderWidth = $(scope.elements.holder).width(); 3389scope.diff = menuWidth - holderWidth; 3390var items = $( scope.elements.items); 3391if (window.innerWidth <= 769 && scope.current == items.length - 2) { 3392$(scope.elements.rightBtn).addClass("hidden"); 3393} 3394var currentWidth = $(items[scope.current]).outerWidth(); 3395var curLeft = parseInt($(scope.elements.menu).css("left")); 3396var left = 0; 3397if (scope.diff > 0 && curLeft > holderWidth - menuWidth) { 3398if (curLeft - currentWidth <= -1 * scope.diff) { 3399left = -(scope.diff); 3400$(scope.elements.rightBtn).addClass("hidden"); 3401scope.current = items.length - 1; 3402$(scope.elements.leftBtn).removeClass("hidden"); 3403} else { 3404left = curLeft - currentWidth; 3405$(scope.elements.leftBtn).removeClass("hidden"); 3406scope.current = scope.current + 1; 3407} 3408scope.isAnimating = true; 3409$('.rotate-menu').css( { left: left }); 3410setInterval(function() {scope.isAnimating = false;}, 600); 3411} 3412} 3413}; 3414} ).attachEvents( function( scope ){ 3415return { 3416clickLeft: ['click', scope.elements.leftBtn, true], 3417clickRight: ['click', scope.elements.rightBtn, true], 3418windowResize: ['resize', window], 3419swipeRight: ['swiperight', scope.elements.holder, true],
3420swipeLeft: ['swipeleft', scope.elements.holder, true] 3421}; 3422}); 3423luana.factory( 'hint' ).faces( [ "update" ] ) 3424.defineElements( { 3425label: '.hint-label', 3426input: 'input, .hint-control' 3427} ).controller( function( view ){ 3428return { 3429eachScope: function( scope ){ 3430this.check( scope ); 3431setTimeout( function() { 3432this.check( scope ); 3433}.bind( this ), 100 ); 3434}, 3435update: function(){ 3436this.__throughScopes( 3437function( index, scope ){ 3438this.check( scope ); 3439}.bind( this ) 3440); 3441setTimeout( function() { 3442this.__throughScopes( 3443function( index, scope ){ 3444this.check( scope ); 3445}.bind( this ) 3446); 3447}.bind( this ), 200 ); 3448}, 3449check: function( scope ){ 3450var $input = $( scope.elements.input ); 3451var hasValue = $input.val() !== ''; 3452try { 3453var isAutofilled = $input.is( ':-webkit-autofill' ); 3454hasValue = hasValue || isAutofilled; 3455} catch( e ) { 3456} 3457hasValue ? view.hide( scope ) : view.show( scope ); 3458}, 3459input: function( scope, element ){ 3460if( $( element ).val() !== '' ){ 3461view.hide( scope ); 3462} 3463else { 3464view.show( scope ); 3465} 3466}, 3467keyup: function( scope, element ){ 3468if( $( element ).val() !== '' ){ 3469view.hide( scope ); 3470} 3471else { 3472view.show( scope ); 3473} 3474}, 3475blur: function( scope, element ){ 3476if( $( element ).val() === '' ){ 3477view.show( scope ); 3478} 3479}, 3480change: function( scope ) { 3481view.hide( scope ); 3482} 3483}; 3484} ).attachEvents( function( scope ){ 3485return { 3486input: ['input', scope.elements.input], 3487keyup: ['keyup', scope.elements.input], 3488blur: ['blur', scope.elements.input], 3489change: ['change', scope.elements.input] 3490}; 3491} ).attachGlobalEvents( function(){ 3492return { 3493update: ['load', window] 3494}; 3495} ).view( function(){ 3496return { 3497show: function( scope ){ 3498$( scope.elements.label ).show(); 3499}, 3500hide: function( scope ){ 3501$( scope.elements.label ).hide(); 3502} 3503}; 3504} ); 3505luana.factory( 'tabs' ).describeScope( { 3506current: 0, 3507activeClass:'is-active' 3508} ).defineElements( { 3509link: '[tab-link]', 3510content: '[tab-content]' 3511} ).controller( function( view ){ 3512return { 3513eachScope: function( scope ){ 3514$.each( scope.elements.link, 3515function( index, link ){ 3516if ( $( link ).hasClass( scope.activeClass ) ) { 3517scope.current = index; 3518} 3519} 3520); 3521this.show( scope, scope.current ); 3522}, 3523show: function( scope, index ){ 3524view.hide( scope, scope.current ); 3525view.show( scope, index ); 3526scope.current = index; 3527}, 3528click: function( scope, element ){ 3529var index = $( scope.elements.link ).index( element ); 3530this.show( scope, index ); 3531} 3532}; 3533} ).attachEvents( function( scope ){ 3534return { 3535click: ['click', scope.elements.link, true] 3536}; 3537} ).view( function(){ 3538return { 3539show: function( scope, index ){ 3540$( scope.elements.link[index] ).addClass( scope.activeClass ); 3541$( scope.elements.content[index] ).show(); 3542}, 3543hide: function( scope, index ){ 3544$( scope.elements.link[index] ).removeClass( scope.activeClass ); 3545$( scope.elements.content[index] ).hide(); 3546} 3547} 3548} ); 3549luana.factory( 'tabs-target' ).describeScope( { 3550current: 0, 3551activeClass:'is-active' 3552} ).defineElements( { 3553link: '[data-link]' 3554} ).controller( function( view ){ 3555return { 3556eachScope: function( scope ){ 3557$.each( scope.elements.link, 3558function( index, link ){ 3559if ( $( link ).hasClass( scope.activeClass ) ) { 3560scope.current = index; 3561} else { 3562view.hide( scope, index ); 3563} 3564} 3565); 3566this.show( scope, scope.current ); 3567}, 3568show: function( scope, index ){ 3569view.hide( scope, scope.current ); 3570view.show( scope, index ); 3571scope.current = index; 3572}, 3573click: function( scope, element ){ 3574var index = $( scope.elements.link ).index( element ); 3575this.show( scope, index ); 3576} 3577}; 3578} ).attachEvents( function( scope ){ 3579return { 3580click: ['click', scope.elements.link, true] 3581}; 3582} ).view( function(){ 3583return { 3584show: function( scope, index ){ 3585$( scope.elements.link[index] ).addClass( scope.activeClass ); 3586$( $(scope.elements.link[index]).data('target') ).show(); 3587}, 3588hide: function( scope, index ){ 3589$( scope.elements.link[index] ).removeClass( scope.activeClass ); 3590$( $(scope.elements.link[index]).data('target') ).hide(); 3591} 3592} 3593} ); 3594luana.factory( 'share-confirmation' ) 3595.describeScope( { 3596addThisEmailLink: '.addthis_button_email', 3597addThisFacebookLink: '.addthis_button_facebook' 3598} ) 3599.defineElements( { 3600printLink: '[print-link]', 3601facebookLink: '[facebook-share-link]', 3602shareEmailLink: '[share-email-link]', 3603printForm: 'form#printForm' 3604} ) 3605.controller( function( view ){ 3606return { 3607clickPrintLink: function( scope ){ 3608view.openNewWindow( scope, '', $( scope.elements.printForm ).attr( 'target' ), 'scrollbars=yes' ); 3609view.clickOnElement( $( scope.elements.printForm ).children( 'input[type=submit]' ) ); 3610}, 3611clickFacebookLink: function( scope ){ 3612view.clickOnElement( $( scope.addThisFacebookLink ) ); 3613}, 3614clickEmailLink: function( scope ){ 3615view.clickOnElement( $( scope.addThisEmailLink ) ); 3616} 3617}; 3618} ) 3619.attachEvents( function( scope ){ 3620return { 3621clickPrintLink: ['click', scope.elements.printLink, true], 3622clickFacebookLink: ['click', scope.elements.facebookLink, true], 3623clickEmailLink: ['click', scope.elements.shareEmailLink, true] 3624}; 3625} ) 3626.view( function(){ 3627return { 3628openNewWindow: function( scope, url, target, params ){ 3629window.open( url, target, params ); 3630}, 3631clickOnElement: function( element ){ 3632element.trigger( 'click' ); 3633} 3634}; 3635} ); 3636luana.factory('show-hide').faces(['toggleByHash']) 3637.describeScope({ 3638visibleOnStart: false, 3639changeTriggerText: false, 3640triggerTextShow: '', 3641triggerTextHide: '', 3642openClass: 'is-open', 3643target: '', 3644fadeInOut: false, 3645hasAnimation: true, 3646hash: '', 3647notAddDisplayNone: false, 3648outsideClickHide: false, 3649escapeHide: false, 3650storeToCookieName: '', 3651storeToCookieNameDays: 365, 3652showIfCookieExpire: false, 3653showDelay: 0, 3654trapFocus: false 3655}).controller(function (view) { 3656return { 3657eachScope: function (scope) { 3658this.getOptions(scope); 3659if (scope.visibleOnStart == "true" || scope.showIfCookieExpire) { 3660if (scope.showDelay > 0) { 3661setTimeout(function () { 3662this.show(scope, scope.hasAnimation); 3663}.bind(this), scope.showDelay); 3664} else { 3665this.show(scope, false); 3666} 3667} else { 3668this.hide(scope, false); 3669} 3670this.checkHash(scope, scope.hash); 3671}, 3672getOptions: function (scope) { 3673scope.visibleOnStart = typeof $(scope.root).attr('data-visible') === 'undefined' ? false : $(scope.root).attr('data-visible');
3674scope.outsideClickHide = $(scope.root).is('[outside-click-hide]'); 3675scope.escapeHide = $(scope.root).is('[escape-hide]'); 3676scope.fadeInOut = $(scope.root).is('[fade]'); 3677scope.target = typeof $(scope.root).attr('data-target') === 'undefined' ? false : $(scope.root).attr('data-target'); 3678scope.notAddDisplayNone = typeof $(scope.root).attr('data-noadddisplaynone') === 'undefined' ? false : $(scope.root).attr('data-noadddisplaynone'); 3679scope.parent = typeof $(scope.root).attr('data-parent') === 'undefined' ? false : $(scope.root).attr('data-parent'); 3680scope.hasAnimation = typeof $(scope.root).attr('data-animation') === 'undefined' ? true : $(scope.root).attr('data-animation'); 3681scope.changeTriggerText = !(typeof $(scope.root).attr('data-hide-text') === 'undefined' || typeof $(scope.root).attr('data-show-text') === 'undefined'); 3682if (scope.changeTriggerText) { 3683scope.triggerTextShow = $(scope.root).attr('data-show-text'); 3684scope.triggerTextHide = $(scope.root).attr('data-hide-text'); 3685} 3686scope.hash = (window.location.hash).replace(/\#/gi, ''); 3687scope.storeToCookieName = typeof $(scope.root).attr('data-store-hide-to-cookie') === 'undefined' ? false : $(scope.root).attr('data-store-hide-to-cookie'); 3688scope.storeToCookieNameDays = typeof $(scope.root).attr('data-store-hide-to-cookie-days') === 'undefined' ? 356 : $(scope.root).attr('data-store-hide-to-cookie-days'); 3689scope.showIfCookieExpire = $(scope.root).is('[show-if-cookie-expire]') && typeof Cookie.getCookie(scope.storeToCookieName) === 'undefined'; 3690scope.showDelay = typeof $(scope.root).attr('data-show-delay') === 'undefined' ? 0 : $(scope.root).attr('data-show-delay'); 3691scope.trapFocus = $(scope.root).is('[data-trap-focus]'); 3692}, 3693show: function (scope, animation) { 3694view.show(scope, animation); 3695if (scope.changeTriggerText) { 3696$(scope.root).text(scope.triggerTextShow); 3697} 3698if (scope.trapFocus) { 3699this.enableFocusTrap(scope); 3700} 3701}, 3702hide: function (scope, animation) { 3703view.hide(scope, animation); 3704if (scope.changeTriggerText) { 3705$(scope.root).text(scope.triggerTextHide); 3706} 3707if (scope.storeToCookieName != '') { 3708Cookie.setCookie(scope.storeToCookieName, '1', scope.storeToCookieNameDays); 3709} 3710if (scope.trapFocus) { 3711this.disableFocusTrap(scope); 3712} 3713}, 3714enableFocusTrap: function (scope) { 3715var target = $(scope.target); 3716var focusableElements = target.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').filter(':visible'); 3717if (focusableElements.length === 0) return; 3718scope.firstFocusable = focusableElements.first()[0]; 3719scope.lastFocusable = focusableElements.last()[0]; 3720scope.triggerElement = document.activeElement; 3721scope.focusTrapHandler = function(e) { 3722if (e.key !== 'Tab') return; 3723if (e.shiftKey) { 3724if (document.activeElement === scope.firstFocusable) { 3725e.preventDefault(); 3726scope.lastFocusable.focus(); 3727} 3728} else { 3729if (document.activeElement === scope.lastFocusable) { 3730e.preventDefault(); 3731scope.firstFocusable.focus(); 3732} 3733} 3734}; 3735$(document).on('keydown', scope.focusTrapHandler); 3736setTimeout(function() { scope.firstFocusable.focus(); }, 100); 3737}, 3738disableFocusTrap: function (scope) { 3739if (scope.focusTrapHandler) { 3740$(document).off('keydown', scope.focusTrapHandler); 3741} 3742if (scope.triggerElement) { 3743setTimeout(function() { scope.triggerElement.focus(); }, 100); 3744} 3745}, 3746clickDocument: function (unused, event) { 3747this.__throughScopes( 3748function (index, scope) { 3749if (scope.outsideClickHide && $(scope.target).is(":visible")) { 3750if ($(scope.target).is(event.target) 3751&& $(scope.target).has(event.target).length === 0) { 3752this.hide(scope, scope.hasAnimation); 3753if (scope.storeToCookieName != '') { 3754Cookie.setCookie(scope.storeToCookieName, '1', scope.storeToCookieNameDays); 3755} 3756} 3757} 3758}.bind(this) 3759); 3760}, 3761keyPress: function (unused, event) { 3762this.__throughScopes( 3763function (index, scope) { 3764if (scope.escapeHide 3765&& event.keyCode === 27 3766&& $(scope.target).is(":visible")) { 3767this.hide(scope, scope.hasAnimation); 3768if (scope.storeToCookieName != '') { 3769Cookie.setCookie(scope.storeToCookieName, '1', scope.storeToCookieNameDays); 3770} 3771} 3772}.bind(this) 3773); 3774}, 3775toggle: function (scope) { 3776if (scope.notAddDisplayNone != "true") { 3777if ($(scope.target).is(":visible")) { 3778this.hide(scope, scope.hasAnimation); 3779} else { 3780this.show(scope, scope.hasAnimation); 3781} 3782} else { 3783if ($(scope.target).hasClass("is-open")) { 3784this.hide(scope, scope.hasAnimation); 3785} else { 3786this.show(scope, scope.hasAnimation); 3787} 3788} 3789}, 3790toggleByKeyboard: function ( scope, _, event ) { 3791if (event.keyCode === 13) { 3792} 3793}, 3794checkHash: function (scope, hash) { 3795var target = (scope.target).replace(/\#/gi, ''); 3796if (target == hash) { 3797this.toggle(scope); 3798} 3799},
3800toggleByHash: function (hash) { 3801this.__throughScopes( 3802function (index, scope) { 3803this.checkHash(scope, hash) 3804}.bind(this) 3805); 3806} 3807}; 3808}).attachEvents(function (scope) { 3809return { 3810toggle: ['click', scope.root, true], 3811toggleByKeyboard: ['keyup', scope.root, true] 3812}; 3813}).attachGlobalEvents(function () { 3814return { 3815keyPress: ['keyup', document], 3816clickDocument: ['click', document] 3817}; 3818}).view(function () { 3819return { 3820show: function (scope, animation) { 3821if (animation == true) { 3822if ( scope.fadeInOut ) { 3823$(scope.target).fadeIn(400, function () { 3824this.addOpenClass(scope); 3825}.bind(this)); 3826} else { 3827$(scope.target).slideDown(400, function () { 3828this.addOpenClass(scope); 3829}.bind(this)); 3830} 3831} else { 3832$(scope.target).css({'display': 'block'}); 3833this.addOpenClass(scope); 3834} 3835}, 3836hide: function (scope, animation) { 3837if (animation == true) { 3838if ( scope.fadeInOut ) { 3839$( scope.target ).fadeOut( 400, function(){ 3840this.removeOpenClass( scope ); 3841}.bind( this ) ); 3842} else { 3843$(scope.target).slideUp(400, function () { 3844this.removeOpenClass(scope); 3845}.bind(this)); 3846} 3847} else { 3848if (scope.notAddDisplayNone != "true") { 3849$(scope.target).css({'display': 'none'}); 3850} 3851this.removeOpenClass(scope); 3852} 3853}, 3854addOpenClass: function (scope) { 3855$(scope.root).addClass(scope.openClass); 3856$(scope.target).addClass(scope.openClass); 3857$(scope.parent).addClass(scope.openClass); 3858}, 3859removeOpenClass: function (scope) { 3860$(scope.root).removeClass(scope.openClass); 3861$(scope.target).removeClass(scope.openClass); 3862$(scope.parent).removeClass(scope.openClass); 3863} 3864} 3865}); 3866luana.factory( 'focus-on-click' ).describeScope({ 3867target: '' 3868}).controller( function(){ 3869return { 3870eachScope: function( scope ){ 3871scope.target = typeof $( scope.root ).attr( 'data-target' ) === 'undefined' ? scope.target : $( scope.root ).attr( 'data-target' ); 3872}, 3873click: function( scope ) { 3874$(scope.target).click(); 3875}, 3876}; 3877} ).attachEvents( function( scope ){ 3878return { 3879click: ['click', scope.root, true] 3880}; 3881} ); 3882luana.addCase('iOs', function(){ 3883return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; 3884}); 3885luana.factory('booking-widget') 3886.defineElements({ 3887calendar: '[calendar]', 3888calendarTitle: '.calendar-widget-title', 3889dateFields: '[checkin-date], [checkout-date]', 3890closeLink: '[bwidget-calendar-close]', 3891hotelSelection: '[bwidget-hotel-select]', 3892submitButton: '[bwidget-submit]', 3893ipreferBookButton: '[iprefer-book-button]', 3894westburyBookButtonWrapper: '[westbury-book-button-wrapper]', 3895bookButton: '[bwidget-book-button]', 3896applyButton: '[bwidget-apply-button]', 3897adultsSelect: '[bw-adults-select]', 3898childrenSelect: '[bw-children-select]', 3899errorMessage: '[lightbox-content]', 3900arriveDateMobile: '[bwidget-m-checkin-date]', 3901departureDateMobile: '[bwidget-m-checkout-date]', 3902hiddenStartDate: '[bwidget-hidden-checkin-date]', 3903hiddenEndDate: '[bwidget-hidden-checkout-date]', 3904radioButtons: '[bwidget-code-option]', 3905hotelPromoOptions: '[bwidget-hotel-promo-option]', 3906blockClass: '[bwidget-code]', 3907codeInputs: '[bwidget-code-input]', 3908codeInputsForClear: '[bwidget-code-input]:not([promo-option])', 3909roomsSelect: '[bwidget-rooms-input]', 3910roomItems: '[bwidget-room]', 3911promoTypeInput: '[bwidget-promo-type]', 3912promoCodeInput: '[bwidget-promo-code]', 3913resetCodes: '[bwidget-reset-codes]', 3914departureDate: '[departure-date]', 3915isDCSearch: 'input[name=is_dc_result]', 3916hotelIdInput: 'input[name=hotel_id]', 3917doAvailabilityInput: 'input[name=do_availability]', 3918hotelDateFormatInput: 'input[name=date_format]', 3919searchInput: 'input.search_keyword', 3920showCodes: '#show-codes', 3921form: '#your-reservation-form [bwidget-m-checkin-date], [promo-option], [bwidget-m-checkout-date], [bwidget-rooms-input], #adults1, #children1, #adults2, #children2, #adults3, #children3, #adults4, #children4, [bw-adults-select], [bw-children-select]' 3922},{ 3923optionLink: '[bwidget-option-link]' 3924}) 3925.describeScope({ 3926hidden: true, 3927offsetTop: 0, 3928scrollTop: 0, 3929roomsCount: 1, 3930index: 0, 3931isArrivalSelected: false, 3932isDepartureSelected: false 3933}) 3934.controller(function (view) { 3935var optionClass = "is-active"; 3936return { 3937eachScope: function (scope) { 3938this.initializeCalendar(scope); 3939this.selectHotel(scope); 3940$('body').addClass('with-booking-widget'); 3941this.updateRadioButtons( scope ); 3942this.changeRoomsCount( scope ); 3943}, 3944initializeCalendar: function (scope) { 3945view.drawCalendar(scope); 3946this.updateAvailabilityParams(scope); 3947}, 3948updateAvailabilityParams: function (scope){ 3949var lastParams = {}; 3950var params = {}, doClearCache = false;
3951var fields = $('#your-reservation-form input[name=PromoCode], #your-reservation-form input[name=PromoType], #your-reservation-form input[name=rateCode]'); 3952$.each(fields, function(i, field) { 3953var fName = $(field).attr('name'); 3954var fVal = $(field).val(); 3955params[fName] = fVal; 3956if (lastParams[fName] !== fVal) { 3957doClearCache = true; 3958} 3959}); 3960$.tigDatepicker.setAdditionalAvailabilityParams(params); 3961if (doClearCache) { 3962$.tigDatepicker.clearAvailabilityCache(); 3963$.tigDatepicker.updateDatepickers(); 3964} 3965lastParams = params; 3966}, 3967clickOptionLink: function (scope, element) { 3968if ( !$( element ).hasClass( optionClass ) ) { 3969$( scope.elements.optionLink).removeClass( optionClass ); 3970$( element).addClass( optionClass ); 3971if (scope.hidden) { 3972view.show(scope); 3973} else { 3974view.hide(scope); 3975} 3976} 3977}, 3978clickDateFields: function (scope) { 3979view.showCalendar(scope); 3980this.updateScroll( scope ); 3981}, 3982touchMoveBody: function( scope, event ) { 3983$( scope.elements.dateFields).blur(); 3984}, 3985clickCheckInDateMobile: function (scope) { 3986var arrDate = $( scope.elements.arriveDateMobile ).val(), 3987depDate = $( scope.elements.departureDateMobile ).val(); 3988arrDate = $.datepicker.parseDate("yy-mm-dd", arrDate); 3989depDate = !depDate ? arrDate : $.datepicker.parseDate("yy-mm-dd", depDate); 3990if ( arrDate.getTime() >= depDate.getTime() ) { 3991depDate = arrDate; 3992depDate.setDate( depDate.getDate() + 1 ); 3993depDate = $.datepicker.formatDate( "yy-mm-dd", depDate ); 3994$(scope.elements.departureDateMobile).val( depDate ); 3995$(scope.elements.hiddenEndDate).val( depDate ); 3996if( luana.hasModule( 'hint' ) ){ 3997luana.module( 'hint' ).update(); 3998} 3999} 4000$( scope.elements.hiddenStartDate ).val( $(scope.elements.arriveDateMobile ).val()); 4001if($( scope.elements.calendar ).closest( "form" ).data("autosubmit-form") != undefined && $(scope.elements.departureDateMobile).val().length > 0 && this.checkMobileDates($(scope.elements.arriveDateMobile).val(), $(scope.elements.departureDateMobile).val())){ 4002$( scope.elements.calendar ).closest( "form" ).submit(); 4003} 4004}, 4005clickCheckOutDateMobile: function (scope) { 4006$(scope.elements.hiddenEndDate).val($(scope.elements.departureDateMobile).val()); 4007if($( scope.elements.calendar ).closest( "form" ).data("autosubmit-form") != undefined && $(scope.elements.arriveDateMobile).val().length > 0 && $(scope.elements.departureDateMobile).val().length > 0 ){ 4008if(this.checkMobileDates($(scope.elements.arriveDateMobile).val(), $(scope.elements.departureDateMobile).val())) 4009$( scope.elements.calendar ).closest( "form" ).submit(); 4010else 4011alert('wrong dates selected'); 4012} 4013}, 4014checkMobileDates: function (arriveDate, departDate){ 4015arriveDate = arriveDate.split("-"); 4016var newArriveDate = new Date(arriveDate[1]+"/"+arriveDate[2]+"/"+arriveDate[0]).getTime(); 4017departDate = departDate.split("-"); 4018var newDepartDate = new Date(departDate[1]+"/"+departDate[2]+"/"+departDate[0]).getTime(); 4019return newArriveDate < newDepartDate; 4020}, 4021clickCloseLink: function (scope) { 4022view.hideCalendar(scope); 4023}, 4024selectHotel: function (scope) { 4025var selectedOption = $(scope.elements.hotelSelection).children('option:selected'), 4026selectedHotelId = $(selectedOption).val(), 4027doAvailability = $(selectedOption).data('do-availability') == 'y', 4028dateFormat = $(selectedOption).data('date-format'); 4029if(scope.elements.westburyBookButtonWrapper && selectedHotelId === 'WESTBURY') { 4030scope.elements.westburyBookButtonWrapper.removeClass('u-isHidden'); 4031} else { 4032scope.elements.westburyBookButtonWrapper.addClass('u-isHidden'); 4033} 4034if (selectedHotelId != '1') { 4035view.setHotelId(scope, selectedHotelId, doAvailability, dateFormat); 4036} else { 4037view.hideHotelPromoOptions( scope ); 4038} 4039this.__throughScopes( 4040function( index, scope ){ 4041if(scope.elements.hotelSelection.val() !== selectedHotelId) { 4042scope.elements.hotelSelection.val(selectedHotelId); 4043} 4044}.bind( this ) 4045); 4046}, 4047changeHotel: function (scope) { 4048this.updateAdultsCountOptions(scope, false); 4049var form = $( scope.elements.calendar ).closest( "form" ); 4050if(form.data("autosubmit-form") != undefined || form.attr("autosubmit-hotel") !== undefined){ 4051form.attr('action', form.data('changeHotelAction')); 4052form.submit(); 4053} else { 4054this.showSubmitButton( scope ); 4055if(scope.elements.ipreferBookButton && scope.elements.hotelSelection.val() === 'DUPONT') { 4056if ($( scope.elements.promoTypeInput ).val() !== 'group-code' && $( scope.elements.promoTypeInput ).val() !== 'corporate-id' && $( scope.elements.promoTypeInput ).val() !=='promo-code') { 4057scope.elements.ipreferBookButton.removeClass('u-isHidden'); 4058} 4059if(scope.elements.bookButton) { 4060scope.elements.bookButton.html(scope.elements.bookButton.attr('dupont-button-title')); 4061} 4062if(scope.elements.applyButton) { 4063scope.elements.applyButton.html('FIND A ROOM'); 4064} 4065} else { 4066scope.elements.ipreferBookButton.addClass('u-isHidden'); 4067if(scope.elements.bookButton) { 4068scope.elements.bookButton.html('FIND A ROOM'); 4069} 4070if(scope.elements.applyButton) { 4071scope.elements.applyButton.html('Apply Changes'); 4072} 4073} 4074} 4075}, 4076submitForm: function (scope, element) { 4077if ((!scope.isArrivalSelected || !scope.isDepartureSelected) && !element.hasAttribute('bwidget-apply-button') && element.hasAttribute('find-button')) { 4078var text = !scope.isArrivalSelected ? 'Please select an arrival date' : 'Please select a departure date'; 4079$('[dates-required-tooltip-text]').text(text).attr("style", "visibility: visible"); 4080return false;
4081} 4082var selected_hotel = $(scope.elements.hotelIdInput).val(); 4083if( $(scope.elements.isDCSearch ).val() != 'true' ) { 4084$(element).parents('form').attr('action', $(element).data('gha-search-action')).submit(); 4085$('[global-loader]').addClass('is-open'); 4086return; 4087} else if ($(element).parents('form') != $(element).data('original-action')) { 4088$(element).parents('form').attr('action', $(element).data('original-action')); 4089} 4090if (selected_hotel != '') { 4091$(element).parents('form').attr('action', $(element).parents('form').data('changeHotelAction')); 4092$(element).parents('form').submit(); 4093$('[global-loader]').addClass('is-open'); 4094} else { 4095var content = $(scope.elements.errorMessage).html(); 4096view.showLightbox(scope, content); 4097} 4098}, 4099updateRadioButtons: function( scope, element ){ 4100$.each( scope.elements.radioButtons, 4101function( key, value ){ 4102if( $( value ).is( ':checked' ) ){ 4103if (scope.elements.hotelIdInput.val() === 'DUPONT' || scope.elements.hotelSelection.val() === 'DUPONT') { 4104if ($(value).val() === 'group-code' || $(value).val() ==='corporate-id' || $(value).val() ==='promo-code') { 4105scope.elements.bookButton.html('FIND A ROOM'); 4106scope.elements.ipreferBookButton.addClass('u-isHidden'); 4107} else { 4108scope.elements.bookButton.html('DISCOVERY MEMBERS, BOOK HERE'); 4109scope.elements.ipreferBookButton.removeClass('u-isHidden'); 4110} 4111} 4112view.showInput( scope, value ); 4113} 4114} 4115); 4116}, 4117clickRadioButton: function( scope, element ){ 4118this.updateRadioButtons( scope, element ); 4119view.setCodeRadioValue( scope, element ); 4120}, 4121enterPromoCode: function( scope, element ){ 4122view.setCodeValue( scope, element ); 4123}, 4124changeRoomsCount: function( scope ){ 4125var additionalClass = 'multiple-rooms'; 4126scope.roomsCount = $( scope.elements.roomsSelect ).val(); 4127if( scope.roomsCount > 1 ){ 4128view.addRootClass( scope, additionalClass ); 4129}else{ 4130view.removeRootClass( scope, additionalClass ); 4131} 4132$.each( $( scope.elements.roomItems ), 4133function( key, value ){ 4134scope.index = key; 4135if( key < scope.roomsCount ){ 4136view.showSelect( scope ); 4137}else{ 4138view.hideSelect( scope ); 4139} 4140} 4141); 4142}, 4143clickResetCodes: function( scope ){ 4144view.resetCodes( scope ); 4145}, 4146updateScroll: function( scope ){ 4147scope.scrollTop = $('body').scrollTop(); 4148if (scope.scrollTop === 0) { 4149scope.scrollTop = $('html,body').scrollTop(); 4150} 4151var stickyNavHeight = $( ".nav-hotel-wrapper.is-sticky" ).outerHeight(), 4152topViewLimit = scope.scrollTop + stickyNavHeight, 4153scrollCompensate = scope.elements.calendar.offset().top - stickyNavHeight - 20; 4154if( scope.elements.calendar.length > 0 ) { 4155if ( topViewLimit > scope.elements.calendar.offset().top ) { 4156setTimeout(function(scope) { 4157$( 'html, body' ).animate({scrollTop: scrollCompensate }, '300'); 4158},100); 4159} 4160} 4161}, 4162clickDepartureDateField: function( scope ){ 4163$.tigDatepicker.clearDepartureDate( false ); 4164$( scope.elements.calendarTitle ).text( $( scope.elements.calendarTitle ).data( 'departure' ) ); 4165}, 4166showSubmitButton: function ( scope ){ 4167scope.elements.submitButton.removeClass('hidden'); 4168}, 4169hotelChanged: function ( scope ){ 4170this.updateAdultsCountOptions(scope, true); 4171var doAvailability = $(scope.elements.doAvailabilityInput).val() == 'y'; 4172var dateFormat = $(scope.elements.hotelDateFormatInput).val(); 4173if ($(scope.elements.hotelIdInput).val() != '') { 4174view.setHotelId(scope, $(scope.elements.hotelIdInput).val(), doAvailability, dateFormat); 4175} 4176if(scope.elements.ipreferBookButton && scope.elements.hotelIdInput.val() === 'DUPONT') { 4177scope.elements.ipreferBookButton.removeClass('u-isHidden'); 4178if(scope.elements.bookButton) { 4179scope.elements.bookButton.html(scope.elements.bookButton.attr('dupont-button-title')); 4180} 4181if(scope.elements.applyButton) { 4182scope.elements.applyButton.html('FIND A ROOM'); 4183} 4184} else { 4185scope.elements.ipreferBookButton.addClass('u-isHidden'); 4186if(scope.elements.bookButton) { 4187scope.elements.bookButton.html('FIND A ROOM'); 4188} 4189if(scope.elements.applyButton) { 4190scope.elements.applyButton.html('Apply Changes'); 4191} 4192} 4193if(scope.elements.westburyBookButtonWrapper && scope.elements.hotelIdInput.val() === 'WESTBURY') { 4194scope.elements.westburyBookButtonWrapper.removeClass('u-isHidden'); 4195} else { 4196scope.elements.westburyBookButtonWrapper.addClass('u-isHidden'); 4197} 4198}, 4199clickIpreferBookButton: function ( scope ){ 4200var baseUrl = scope.elements.ipreferBookButton.attr('base-synxis-url'); 4201if ($( scope.elements.hiddenStartDate ).val()) { 4202baseUrl += '&arrive=' + $( scope.elements.hiddenStartDate ).val(); 4203} 4204if ($( scope.elements.hiddenEndDate ).val()) { 4205baseUrl += '&depart=' + $( scope.elements.hiddenEndDate ).val(); 4206} 4207if ($( scope.elements.roomsSelect ).val()) { 4208baseUrl += '&rooms=' + $( scope.elements.roomsSelect ).val(); 4209} 4210if ($( scope.elements.adultsSelect)) { 4211var adults = []; 4212$( scope.elements.adultsSelect).each(function() { 4213if ($(this).is(":visible")) { 4214adults.push($(this).val()); 4215} 4216}); 4217if (adults.length) { 4218baseUrl += '&adult=' + adults.join(','); 4219} 4220} 4221if ($( scope.elements.childrenSelect)) { 4222var children = []; 4223$( scope.elements.childrenSelect).each(function() { 4224if ($(this).is(":visible")) { 4225children.push($(this).val()); 4226} 4227}); 4228if (children.length) { 4229baseUrl += '&child=' + children.join(','); 4230} 4231} 4232scope.elements.ipreferBookButton.attr('href', baseUrl); 4233}, 4234updateAdultsCountOptions: function (scope, fromHomepage) { 4235var adultsOptionsCount = 4; 4236var currentHotelCode = fromHomepage ? scope.elements.hotelIdInput.val() : scope.elements.hotelSelection.val(); 4237if ( 4238(currentHotelCode && typeof window[currentHotelCode + '_max_adults'] !== 'undefined' 4239) 4240) { 4241adultsOptionsCount = window[currentHotelCode + '_max_adults']; 4242} 4243$( scope.elements.adultsSelect).each(function() { 4244if ($(this).find('option').length == adultsOptionsCount) { 4245return; 4246} 4247if ($(this).find('option').length > adultsOptionsCount) { 4248do { 4249$(this).find('option').last().remove(); 4250} while ($(this).find('option').length > adultsOptionsCount); 4251} else { 4252do { 4253$(this).append( "<option value=\"" + ($(this).find('option').length + 1) + "\">" + ($(this).find('option').length + 1) + "</option>" ); 4254} while ($(this).find('option').length < adultsOptionsCount); 4255} 4256}); 4257}, 4258hotelInputChanged: function ( scope ){ 4259var hotelId = scope.elements.hotelIdInput.val(); 4260scope.elements.hotelPromoOptions 4261.addClass( 'hidden' )
4262.filter( '.js-promo-option--' + hotelId ).removeClass( 'hidden' ); 4263if (hotelId === 'DUPONT') { 4264$('.js-hide-DUPONT').hide(); 4265} else { 4266$('.js-hide-DUPONT').show(); 4267} 4268if(scope.elements.westburyBookButtonWrapper && hotelId === 'WESTBURY') { 4269scope.elements.westburyBookButtonWrapper.removeClass('u-isHidden'); 4270} else { 4271scope.elements.westburyBookButtonWrapper.addClass('u-isHidden'); 4272} 4273} 4274} 4275}) 4276.attachEvents(function (scope) { 4277return { 4278clickCheckInDateMobile: ['change', scope.elements.arriveDateMobile, true], 4279clickCheckOutDateMobile: ['change', scope.elements.departureDateMobile, true], 4280clickOptionLink: ['click', scope.elements.optionLink, true], 4281clickDateFields: ['click', scope.elements.dateFields], 4282clickDepartureDateField: ['click', scope.elements.departureDate], 4283touchMoveBody: [ 'touchmove', 'body'], 4284clickCloseLink: ['click', scope.elements.closeLink, true], 4285selectHotel: ['change', scope.elements.hotelSelection, true], 4286changeHotel: ['change', scope.elements.hotelSelection, true], 4287submitForm: ['click', scope.elements.submitButton, true], 4288clickRadioButton: ['click', scope.elements.radioButtons], 4289enterPromoCode: ['change', scope.elements.codeInputs], 4290changeRoomsCount: ['change', scope.elements.roomsSelect, false], 4291clickResetCodes: ['click', scope.elements.resetCodes, true ], 4292showSubmitButton: ['change', scope.elements.form, false], 4293hotelChanged: ['change', scope.elements.searchInput, false], 4294clickIpreferBookButton: ['click', scope.elements.ipreferBookButton, false] 4295} 4296}) 4297.view(function () { 4298var openClass = 'bwidget-open', 4299displayClass = 'open'; 4300return { 4301drawCalendar: function( scope ){ 4302$( scope.elements.calendar ).tigDatepicker({ 4303numberOfMonths: $(window).width() < 769 ? 1 : 2, 4304changeMonth: true, 4305monthNames:monthNames, 4306monthNamesShort:monthNamesShort, 4307dayNamesMin:dayNamesMin, 4308firstDay: ( typeof dateFormat !== 'undefined' && typeof dateFormatsList[dateFormat] !== 'undefined' ) ? 4309dateFormatsList[dateFormat]['firstDay'] : dateFormatsList['DMY']['firstDay'], 4310altFieldArrival: '[checkin-date]', 4311altFieldDeparture: '[checkout-date]', 4312dateFormat: 'yy-mm-dd', 4313altFormat: ( typeof dateFormat !== 'undefined' && typeof dateFormatsList[dateFormat] !== 'undefined' ) ? 4314dateFormatsList[dateFormat]['format'] : dateFormatsList['DMY']['format'], 4315minDate: new Date(), 4316maxDate: $('body').attr('calendar-max-date') 4317? new Date($('body').attr('calendar-max-date')) 4318: new Date( ( new Date() ).setFullYear( ( new Date() ).getFullYear() + 1 ) ), 4319loaderHtml: '<div class="tig-datepicker-loader-container"><div class="tig-datepicker-loader-image"></div></div>', 4320onSelectArrivalDate: function(){ 4321scope.isArrivalSelected = true; 4322scope.isDepartureSelected = false; 4323$( scope.elements.calendarTitle ).text( $( scope.elements.calendarTitle ).data( 'departure' ) ); 4324$( scope.elements.calendar ).addClass( 'departure-calendar' ); 4325$( scope.elements.calendar ).hide(); 4326window.setTimeout( function(){ 4327$( scope.elements.calendar ) 4328.show(); 4329if( luana.hasModule( 'hint' ) ){ 4330luana.module( 'hint' ).update(); 4331} 4332}, 100 ); 4333}, 4334onSelectDates: function( startDate, endDate ) { 4335scope.isArrivalSelected = true; 4336scope.isDepartureSelected = true; 4337$( scope.elements.calendarTitle ).text( $( scope.elements.calendarTitle ).data( 'arrival' ) ); 4338$( scope.elements.hiddenStartDate ).val( $.tigDatepicker.formatDate( 'yy-mm-dd', startDate) ); 4339$( scope.elements.hiddenEndDate ).val( $.tigDatepicker.formatDate( 'yy-mm-dd', endDate) ); 4340$( scope.elements.calendar ).hide(); 4341$( scope.elements.calendar ).removeClass( 'departure-calendar' ); 4342window.setTimeout( function(){ 4343if( luana.hasModule( 'hint' ) ){ 4344luana.module( 'hint' ).update(); 4345} 4346}, 100 ); 4347if($( scope.elements.calendar ).closest( "form" ).data("autosubmit-form") != undefined){ 4348$( scope.elements.calendar ).closest( "form" ).submit(); 4349} 4350scope.elements.submitButton.removeClass('hidden'); 4351} 4352}); 4353}, 4354showCalendar: function( scope ){ 4355$( scope.elements.calendar ) 4356.show() 4357.find('select.ui-datepicker-month').focus(); 4358}, 4359hideCalendar: function( scope ){ 4360$( scope.elements.calendar ).hide(); 4361}, 4362show: function( scope ){ 4363scope.hidden = false; 4364$( scope.root ).addClass( openClass ); 4365$( scope.elements.optionLink ).text( $( scope.elements.optionLink ).data( 'text-alt' ) ); 4366}, 4367hide: function( scope ){ 4368scope.hidden = true; 4369$( scope.root ).removeClass( openClass ); 4370$( scope.elements.optionLink ).text( $( scope.elements.optionLink ).data( 'text-def' ) ); 4371}, 4372addRootClass: function( scope, additionalClass ){ 4373$( scope.root ).addClass( additionalClass ); 4374}, 4375removeRootClass: function( scope, additionalClass ){ 4376$( scope.root ).removeClass( additionalClass ); 4377}, 4378setHotelId: function( scope, hotelId, doAvailability, dateFormatLocal ) { 4379if( dateFormat != dateFormatLocal ){ 4380dateFormat = dateFormatLocal; 4381$( scope.elements.calendar ).tigDatepicker( 'option', 'firstDay', ( typeof dateFormat !== 'undefined' && typeof dateFormatsList[dateFormat] !== 'undefined' ) ? 4382dateFormatsList[dateFormat]['firstDay'] : dateFormatsList['DMY']['firstDay'] ); 4383$( scope.elements.calendar ).tigDatepicker( 'option', 'altFormat', ( typeof dateFormat !== 'undefined' && typeof dateFormatsList[dateFormat] !== 'undefined' ) ? 4384dateFormatsList[dateFormat]['format'] : dateFormatsList['DMY']['format'] ); 4385} 4386$.tigDatepicker.setHotelId( hotelId ); 4387$.tigDatepicker.setDoAvailabilityCall( doAvailability ); 4388if ( doAvailability ) $.tigDatepicker.checkAvailability(); 4389this.showHotelPromoOptions( scope, hotelId ); 4390}, 4391showLightbox: function( scope, content ){ 4392lightbox.setContent( content ); 4393lightbox.show(); 4394}, 4395showInput: function( scope, element ){ 4396$( scope.elements.blockClass ).hide(); 4397$( element ).siblings( scope.elements.blockClass ).show(); 4398}, 4399setCodeValue: function( scope, element ){ 4400if($( element ).data('optPromoType') !== undefined){ 4401$( scope.elements.promoTypeInput ).val( $( element ).data('optPromoType') ); 4402$( scope.elements.promoCodeInput ).val( $( element ).val() ); 4403}else{ 4404$( scope.elements.promoTypeInput ).val( $( element ).parent().siblings( "[bwidget-code-option]" ).val() ); 4405$( scope.elements.promoCodeInput ).val( $( element ).val() ); 4406} 4407}, 4408setCodeRadioValue: function( scope, element ){ 4409$( scope.elements.promoTypeInput ).val( $( element ).val() ); 4410$( scope.elements.promoCodeInput ).val( $( element ).siblings( scope.elements.blockClass ).find( scope.elements.codeInputs ).val() ); 4411}, 4412showSelect: function( scope ){ 4413$( scope.elements.roomItems[scope.index] ).addClass( displayClass ); 4414}, 4415hideSelect: function( scope ){ 4416$( scope.elements.roomItems[scope.index] ).removeClass( displayClass ); 4417}, 4418hideHotelPromoOptions: function( scope ){ 4419scope.elements.hotelPromoOptions.addClass( 'hidden' );
4420$( scope.elements.showCodes ).hide(); 4421this.clearPromo( scope ); 4422}, 4423showHotelPromoOptions: function( scope, hotelId ){ 4424scope.elements.hotelPromoOptions 4425.addClass( 'hidden' ) 4426.filter( '.js-promo-option--' + hotelId ).removeClass( 'hidden' ) 4427; 4428}, 4429clearPromo: function( scope ){ 4430$( scope.elements.promoTypeInput ).val( '' ); 4431$( scope.elements.promoCodeInput ).val( '' ); 4432scope.elements.hotelPromoOptions.find( 'input' ).prop( 'checked', false ); 4433if (scope.elements.hotelIdInput.val() === 'DUPONT' || scope.elements.hotelSelection.val() === 'DUPONT') { 4434scope.elements.bookButton.html(scope.elements.bookButton.attr('dupont-button-title')); 4435scope.elements.ipreferBookButton.removeClass('u-isHidden'); 4436} 4437}, 4438resetCodes: function( scope ){ 4439this.clearPromo( scope ); 4440$( scope.elements.radioButtons ).prop( 'checked', false ); 4441$( scope.elements.codeInputsForClear ).val( '' ); 4442if( luana.hasModule( 'hint' ) ){ 4443luana.module( 'hint' ).update(); 4444} 4445$('.bwidget-codes').find('.bwidget-code-block').hide(); 4446this.showSubmitButton( scope ); 4447}, 4448clickDepartureDateField: function( scope ){ 4449$.tigDatepicker.clearDepartureDate( false ); 4450$( scope.elements.calendarTitle ).text( $( scope.elements.calendarTitle ).data( 'departure' ) ); 4451}, 4452showSubmitButton: function ( scope ){ 4453scope.elements.submitButton.removeClass('hidden'); 4454}, 4455hotelChanged: function ( scope ){ 4456var doAvailability = $(scope.elements.doAvailabilityInput).val() == 'y'; 4457var dateFormat = $(scope.elements.hotelDateFormatInput).val(); 4458if ($(scope.elements.hotelIdInput).val() != '') { 4459view.setHotelId(scope, $(scope.elements.hotelIdInput).val(), doAvailability, dateFormat); 4460} 4461} 4462} 4463}); 4464luana.factory('booking-widget.iOs') 4465.attachEvents(function (scope) { 4466return { 4467clickCheckInDateMobile: ['blur', scope.elements.arriveDateMobile, true], 4468clickCheckOutDateMobile: ['blur', scope.elements.departureDateMobile, true], 4469clickOptionLink: ['click', scope.elements.optionLink, true], 4470clickDepartureDateField: ['click', scope.elements.departureDate], 4471clickDateFields: ['click', scope.elements.dateFields], 4472touchMoveBody: [ 'touchmove', 'body'], 4473clickCloseLink: ['click', scope.elements.closeLink, true], 4474selectHotel: ['change', scope.elements.hotelSelection, true], 4475changeHotel: ['change', scope.elements.hotelSelection, true], 4476submitForm: ['click', scope.elements.submitButton, true], 4477clickRadioButton: ['click', scope.elements.radioButtons], 4478enterPromoCode: ['change', scope.elements.codeInputs], 4479changeRoomsCount: ['change', scope.elements.roomsSelect, false], 4480clickResetCodes: ['click', scope.elements.resetCodes, true ], 4481showSubmitButton: ['change', scope.elements.form, false], 4482hotelChanged: ['change', scope.elements.hotelIdInput, false], 4483hotelInputChanged: ['change', scope.elements.searchInput, false], 4484clickIpreferBookButton: ['click', scope.elements.ipreferBookButton, false] 4485} 4486}); 4487luana.factory( 'tooltip' ).describeScope( { 4488tooltipRoot: '#luana-tooltip', 4489tooltipInner: '#luana-tooltip-inner', 4490tooltipText: '', 4491direction: 'top', 4492directionClass: 'is-top', 4493styleClass: 'default' 4494} ).controller( function( view ){ 4495return { 4496initialize: function(){ 4497var $tooltip; 4498$tooltip = $('<div id="luana-tooltip" class="tooltip"><span id="luana-tooltip-inner" class="tooltip-inner"></span><span class="tooltip-triangle"></span></div>').css({'position' : 'absolute'}); 4499$( 'body' ).append( $tooltip ); 4500}, 4501eachScope: function( scope ) { 4502scope.tooltipText = typeof $( scope.root ).attr( 'data-text' ) === 'undefined' ? scope.text : $( scope.root ).attr( 'data-text' ); 4503scope.direction = typeof $( scope.root ).attr( 'data-direction' ) === 'undefined' ? scope.direction : $( scope.root ).attr( 'data-direction' ); 4504scope.styleClass = typeof $( scope.root ).attr( 'data-style' ) === 'undefined' ? scope.styleClass : $( scope.root ).attr( 'data-style' ); 4505scope.directionClass = 'is-' + scope.direction; 4506scope.styleClass = 'tooltip-' + scope.styleClass; 4507}, 4508calculatePosition: function( scope ){ 4509var pos = $( scope.root ).offset(), 4510y = 0, x = 0; 4511if ( scope.direction == 'right' ) { 4512y = pos.top - Math.abs( $( scope.root ).outerHeight()/2 - $( scope.tooltipRoot ).outerHeight()/2 ); 4513x = pos.left + $( scope.root ).outerWidth(); 4514}else{ 4515y = pos.top - $( scope.tooltipRoot ).outerHeight(); 4516x = pos.left + ( $( scope.root ).outerWidth()/2 - $( scope.tooltipRoot ).outerWidth()/2 ); 4517} 4518return { 4519x: x, 4520y: y 4521} 4522}, 4523setPosition: function( scope ){ 4524var pos = this.calculatePosition( scope );
4525$( scope.tooltipRoot ).css( 'top', pos.y ).css( 'left', pos.x ); 4526}, 4527update: function( scope ){ 4528view.setText( scope.tooltipInner, scope.tooltipText ); 4529$( scope.tooltipRoot ).addClass( scope.directionClass ).addClass( scope.styleClass ); 4530}, 4531show: function( scope ){ 4532this.update( scope ); 4533this.setPosition( scope ); 4534view.show( scope.tooltipRoot, scope.directionClass ); 4535}, 4536hide: function( scope ){ 4537view.hide( scope.tooltipRoot, scope.directionClass ); 4538$( scope.tooltipRoot ).removeClass( scope.directionClass ).removeClass( scope.styleClass ); 4539} 4540}; 4541} ).attachEvents( function( scope ){ 4542return { 4543show: ['mouseenter', scope.root], 4544hide: ['mouseleave', scope.root] 4545}; 4546} ).view( function(){ 4547return { 4548show: function( element, directionClass ){ 4549$( element ).css( { 'visibility' : 'visible', 'opacity' : 1 } ); 4550}, 4551hide: function( element, directionClass ){ 4552$( element ).css( { 'visibility' : 'hidden', 'opacity' : 0 } ); 4553}, 4554setText: function( element, text ){ 4555$( element ) 4556.empty() 4557.append( text ); 4558} 4559}; 4560} ); 4561luana.factory('booking-widget-sticky') 4562.defineElements({ 4563dateFields: '[checkin-date], [checkout-date]' 4564},{ 4565topWidget: '[bwidget-top-widget]', 4566bottomWidget: '[bwidget-bottom-widget]' 4567}) 4568.describeScope({ 4569index: 0, 4570scrollTop: 0, 4571topLimit: -100, 4572bottomLimit: 0 4573}) 4574.controller(function (view) { 4575return { 4576eachScope: function (scope) { 4577this.scrollWindow(scope); 4578}, 4579update: function (scope) { 4580scope.scrollTop = $('body').scrollTop(); 4581if (scope.scrollTop === 0) { 4582scope.scrollTop = $('html,body').scrollTop(); 4583} 4584if( scope.elements.topWidget.length > 0 ) { 4585scope.topLimit = $( scope.elements.topWidget ).offset().top + $( scope.elements.topWidget).height(); 4586} 4587if( scope.elements.bottomWidget.length > 0 ) { 4588scope.bottomLimit = $( scope.elements.bottomWidget ).offset().top + $( scope.elements.bottomWidget ).height() - $( window ).height(); 4589} 4590}, 4591scrollWindow: function (scope) { 4592this.update( scope ); 4593if ( scope.scrollTop > scope.topLimit && scope.scrollTop < scope.bottomLimit ) { 4594view.stickBottomWidget( scope ); 4595} else { 4596view.unstickBottomWidget( scope ); 4597} 4598}, 4599focusDateFields: function( scope ){ 4600var yPos = window.pageYOffset || document.documentElement.scrollTop; 4601window.scrollTo(0, yPos); 4602$( scope.elements.dateFields).blur(); 4603} 4604} 4605}) 4606.attachEvents(function (scope) { 4607return { 4608scrollWindow: ['scroll', window], 4609focusDateFields: [ 'focus', scope.elements.dateFields, true] 4610} 4611}) 4612.view(function () { 4613var bwidgetFixedClass = 'bwidget-fixed'; 4614return { 4615stickBottomWidget: function( scope ){ 4616$( scope.root ).addClass( bwidgetFixedClass ); 4617}, 4618unstickBottomWidget: function( scope ){ 4619$( scope.root ).removeClass( bwidgetFixedClass ); 4620} 4621} 4622}); 4623luana.factory( 'sticky-menu' ) 4624.faces( ['updateSize'] ) 4625.defineElements( { 4626header: '#header' 4627} ) 4628.describeScope( { 4629scrollTop: 0, 4630offsetTop: 0, 4631headerHeight: 0, 4632headerFullHeight: 0, 4633isAdded: false 4634} ) 4635.controller( function( view ){ 4636return { 4637eachScope: function( scope ){ 4638this.updateSize( scope ); 4639scope.offsetTop = $( scope.root ).offset().top; 4640}, 4641updateSize: function( scope ){ 4642scope.headerHeight = $( scope.elements.header).innerHeight(); 4643scope.headerFullHeight = $( scope.elements.header).outerHeight( true ) + $( scope.root ).outerHeight( true ); 4644}, 4645handleScroll: function(){ 4646var top = $( document ).scrollTop(), element; 4647this.__throughScopes( 4648function( index, scope ){ 4649this.updateSize( scope ); 4650scope.scrollTop = top; 4651if( scope.scrollTop > scope.offsetTop - scope.headerHeight ){ 4652if( !scope.isAdded ){ 4653view.addRootClass( scope ); 4654} 4655}else{ 4656if( scope.isAdded ){ 4657view.removeRootClass( scope ); 4658} 4659} 4660}.bind( this ) 4661); 4662} 4663}; 4664} ) 4665.attachGlobalEvents( function(){ 4666return { 4667handleScroll: ['scroll', window] 4668}; 4669} ) 4670.view( function(){ 4671var fixedClass = 'is-sticky'; 4672return { 4673addRootClass: function( scope ){ 4674scope.isAdded = true; 4675$( scope.root ).addClass( fixedClass ); 4676}, 4677removeRootClass: function( scope ){ 4678scope.isAdded = false; 4679$( scope.root ).removeClass( fixedClass ); 4680} 4681}; 4682} ); 4683luana.factory( 'dropdown' ) 4684.defineElements( { 4685button: '[dropdown-toggle]', 4686list: '[dropdown-menu]', 4687close: '[dropdown-close]' 4688} ).describeScope( { 4689visible: false 4690} ).controller( function( view ){ 4691return { 4692clickButton: function( scope ){ 4693if( scope.visible ){ 4694view.hide( scope ); 4695}else{ 4696if( this.__getState() !== false && this.__getState().visible ){ 4697view.hide( this.__getState() ); 4698} 4699this.align( scope ); 4700view.show( scope ); 4701} 4702}, 4703align: function( scope ){ 4704var top = $( scope.elements.button ).offset().top - $( document ).scrollTop(); 4705if( $( window ).height() - top < $( scope.elements.list ).outerHeight( true ) ){ 4706view.up( scope, true ); 4707}else{ 4708view.up( scope, false ); 4709} 4710}, 4711clickDocument: function( element, event ){ 4712var scope = this.__getState(); 4713if( scope ){ 4714if( !this.__getScopeByElement( event.target ) ){ 4715view.hide( this.__getState() ); 4716} 4717} 4718}, 4719clickClose: function( scope ) { 4720view.hide( scope ); 4721} 4722}; 4723} ).attachEvents( function( scope ){ 4724return { 4725clickButton: ['click', scope.elements.button, true], 4726clickClose: ['click', scope.elements.close, true] 4727}; 4728} ).attachGlobalEvents( function( scope ){ 4729return { 4730clickDocument: ['click', document] 4731}; 4732} ).view( function(){ 4733return { 4734up: function( scope, isUp ){ 4735if( isUp ){ 4736$( scope.root ).addClass( 'is-up' ); 4737}else{ 4738$( scope.root ).removeClass( 'is-up' ); 4739} 4740}, 4741show: function( scope ){ 4742$( scope.root ).addClass( 'is-open' ); 4743scope.visible = true; 4744this.__setState( scope ); 4745}, 4746hide: function( scope ){ 4747$( scope.root ).removeClass( 'is-open' ); 4748scope.visible = false;
4749this.__clearState(); 4750} 4751}; 4752} ); 4753luana.factory( 'dates-form' ) 4754.describeScope( { 4755minDate : false, 4756dateFormat : false, 4757defaultStep : true 4758} ) 4759.defineElements( { 4760arrivalDate: '[dates-form-start]', 4761departureDate: '[dates-form-end]', 4762arrivalDateAlt: '[dates-form-start-alt]', 4763departureDateAlt: '[dates-form-end-alt]' 4764} ).controller( function( view ){ 4765var _addAriaLabels = function _addAriaLabels(dpDiv) { 4766var $days; 4767if (dpDiv) { 4768$days = dpDiv.find('a.ui-state-default'); 4769$days.each(function(index, day) { 4770var $day = $(day); 4771var $td = $day.parent('td'); 4772var dateYear = $td.data('year'); 4773var dateMonth = $td.data('month'); 4774var dateDay = $day.text(); 4775var date = new Date(dateYear, dateMonth, dateDay); 4776var formattedDate = (new Intl.DateTimeFormat('default', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }).format(date)); 4777$day.attr('aria-label', formattedDate); 4778}); 4779} 4780}; 4781var _beforeShow = function _beforeShow(input, inst) { 4782var isIE11 = !!window.MSInputMethodContext && !!document.documentMode; 4783var shouldShow = isIE11 ? !this.fixFocusIE : true; 4784this.fixFocusIE = false; 4785if (shouldShow) { 4786window.setTimeout( function() { 4787_addAriaLabels(inst.dpDiv); 4788inst.dpDiv.find('a.ui-state-default').first().focus(); 4789}, 10 ); 4790} 4791return shouldShow; 4792}; 4793var _onChangeMonthYear = function _onChangeMonthYear(year, month, inst) { 4794window.setTimeout( function() { 4795_addAriaLabels(inst.dpDiv); 4796}, 10 ); 4797}; 4798var _onClose = function _onClose(dateText, inst) { 4799this.fixFocusIE = true; 4800this.focus(); 4801}; 4802return { 4803eachScope: function( scope ){ 4804scope.minDate = typeof $( scope.root ).attr( 'data-form-min-date' ) === 'undefined' ? false : $( scope.root ).attr( 'data-form-min-date' ); 4805scope.dateFormat = typeof $( scope.root ).attr( 'data-form-date-format' ) === 'undefined' ? false : $( scope.root ).attr( 'data-form-date-format' ); 4806scope.defaultStep = typeof $( scope.root ).attr( 'data-form-no-default-step' ) === 'undefined' ? true : false; 4807this.main( scope ); 4808}, 4809update: function(){ 4810this.__throughScopes( 4811function( index, scope ){ 4812this.main( scope ); 4813}.bind( this ) 4814); 4815}, 4816main: function( scope ){ 4817var minDateDeparture; 4818if ( scope.defaultStep ) { 4819minDateDeparture = scope.minDate ? scope.minDate : '+1d'; 4820}else{ 4821minDateDeparture = scope.minDate ? scope.minDate : '+0'; 4822} 4823$( scope.elements.arrivalDate ).datepicker({ 4824showButtonPanel: true, 4825closeText: '', 4826minDate: scope.minDate ? scope.minDate : '+0', 4827altField: scope.elements.arrivalDateAlt, 4828altFormat: "yy-mm-dd", 4829dateFormat: ( scope.dateFormat !== false && typeof dateFormatsList[dateFormat] !== 'undefined' ) ? 4830dateFormatsList[scope.dateFormat]['format'] : dateFormatsList['DMY']['format'], 4831fixFocusIE: false, 4832beforeShow: _beforeShow, 4833onChangeMonthYear: _onChangeMonthYear, 4834onClose: _onClose, 4835onSelect: function(dateStr) { 4836window.setTimeout( function(){ 4837if( luana.hasModule( 'hint' ) ){ 4838luana.module( 'hint' ).update(); 4839} 4840}, 10 ); 4841var min = $(this).datepicker('getDate') || new Date(); // Selected date or today if none 4842if ( scope.defaultStep ) { 4843min.setDate(min.getDate() + 1); // Add one day 4844} 4845$( scope.elements.departureDate ).datepicker('option', {minDate: min, defaultDate: min}); 4846if ($( scope.elements.departureDate ).length > 0) { 4847window.setTimeout($.proxy(function() { 4848$( scope.elements.departureDate ).focus(); 4849}, this), 10); 4850} else { 4851this.fixFocusIE = true; 4852$(this).blur().change().focus(); 4853} 4854} 4855}); 4856$( scope.elements.departureDate ).datepicker({ 4857showButtonPanel: true, 4858closeText: '', 4859minDate: minDateDeparture, 4860altField: scope.elements.departureDateAlt, 4861altFormat: "yy-mm-dd", 4862dateFormat: ( scope.dateFormat !== false && typeof dateFormatsList[dateFormat] !== 'undefined' ) ? 4863dateFormatsList[scope.dateFormat]['format'] : dateFormatsList['DMY']['format'], 4864fixFocusIE: false, 4865beforeShow: _beforeShow, 4866onChangeMonthYear: _onChangeMonthYear, 4867onClose: _onClose, 4868onSelect: function( dateStr ) { 4869window.setTimeout( function(){ 4870if( luana.hasModule( 'hint' ) ){ 4871luana.module( 'hint' ).update(); 4872} 4873}, 10 ); 4874this.fixFocusIE = true; 4875$(this).blur().change().focus(); 4876} 4877}); 4878} 4879}; 4880} ).attachGlobalEvents( function(){ 4881return { 4882update: ['load', window] 4883}; 4884} ); 4885luana.factory( 'acco' ) 4886.describeScope( { 4887current: 0, 4888class_name: 'is-open', 4889notVisibleOnStart: false 4890} ) 4891.defineElements( { 4892items: '[acco-item]', 4893links: '[acco-link]', 4894content: '[acco-content]' 4895} ) 4896.controller( function( view ) { 4897return { 4898eachScope: function( scope ){ 4899scope.notVisibleOnStart = !!$( scope.root ).data( 'visible' ); 4900}, 4901initialize: function(){ 4902this.__throughScopes( 4903function( index, scope ){ 4904$.each( scope.elements.items, function ( index, item ) { 4905if ( $(item).hasClass( scope.class_name ) ) { scope.current = index; } 4906} ); 4907if( scope.notVisibleOnStart ) { 4908scope.current = -1; 4909} 4910this.showImmediately( scope, scope.current ); 4911}.bind( this ) 4912); 4913}, 4914update: function( scope, index ) { 4915if ( index == scope.current ) { 4916this.hide( scope, index ); 4917scope.current = -1; 4918} else { 4919this.hide( scope, scope.current ); 4920this.show( scope, index ); 4921scope.current = index; 4922} 4923},
4924getHeight: function( scope, index ) { 4925var height; 4926$( scope.elements.content[index] ).addClass( 'check-height' ); 4927height = $( scope.elements.content[index] ).height(); 4928$( scope.elements.content[index] ).removeClass( 'check-height' ); 4929return height; 4930}, 4931hide: function( scope, index ) { 4932if ( index !== -1 ) { 4933view.hide( scope, index ); 4934} 4935}, 4936showImmediately: function( scope, index ) { 4937if ( index !== -1 ) { 4938view.showImmediately( scope, index ); 4939} 4940}, 4941show: function( scope, index ) { 4942if ( index !== -1 ) { 4943view.show( scope, index, this.getHeight( scope, index ) ); 4944} 4945}, 4946clickLink: function( scope, element ) { 4947var index = scope.elements.links.index( element ); 4948this.update( scope, index ); 4949} 4950}; 4951} ) 4952.attachEvents( function( scope ) { 4953return { 4954clickLink: ['click', scope.elements.links, true] 4955}; 4956} ) 4957.view( function() { 4958return { 4959showImmediately: function( scope, index ) { 4960$( scope.elements.items[index] ).addClass( scope.class_name ); 4961$( scope.elements.links[index] ).addClass( scope.class_name ); 4962$( scope.elements.content[index] ).show(); 4963}, 4964show: function( scope, index, height ) { 4965$( scope.elements.items[index] ).addClass( scope.class_name );
4966$( scope.elements.links[index] ).addClass( scope.class_name ); 4967$( scope.elements.content[index] ).height( 0 ); 4968$( scope.elements.content[index] ).show(); 4969$( scope.elements.content[index] ).animate( { height: height }, 400, function() { 4970$( scope.elements.content[index] ).css( 'height', 'auto'); 4971} ); 4972}, 4973hide: function( scope, index ) { 4974$( scope.elements.items[index] ).removeClass( scope.class_name ); 4975$( scope.elements.links[index] ).removeClass( scope.class_name ); 4976$( scope.elements.content[index] ).animate( { height: 0 }, 400, function() { 4977$( scope.elements.content[index] ).hide(); 4978} ); 4979} 4980}; 4981} ); 4982luana.factory( 'hash-opener' ) 4983.controller( function( view ) { 4984return { 4985click: function ( scope ){ 4986var hash = $( scope.root ).attr( 'href' ).substr(1); 4987luana.module( 'show-hide' ).toggleByHash( hash ); 4988} 4989}; 4990} ) 4991.attachEvents( function( scope ) { 4992return { 4993click: [ 'click', scope.root ] 4994}; 4995} ); 4996luana.factory( 'collected-form', { global: false } ) 4997.describeScope( { 4998errorClass: 'message-warning' 4999} ) 5000.defineElements( { 5001lightboxContent: '[lightbox-content]' 5002} ) 5003.controller( function( view ){ 5004return { 5005formSubmit: function( scope ){ 5006formEl = jQuery( scope.root ).find( 'form' ); 5007var postDataArray = formEl.serializeArray(); 5008var submitBtnEl = formEl.find('[type=submit]'); 5009postDataArray.push({ 5010name: submitBtnEl.attr( 'name' ), 5011value: submitBtnEl.attr( 'value' ) 5012}); 5013view.loaderForResultContainer( scope, true ); 5014lajax.collectedForm( postDataArray, function( data ){ 5015if( data.indexOf( scope.errorClass ) != -1 ) { 5016view.setResultContent( scope, data ); 5017} else { 5018view.showThankYouPopup( scope ); 5019} 5020view.loaderForResultContainer( scope, false ); 5021luana.factory( 'form' ).update(); 5022luana.factory( 'validate-corporate-form' ).update(); 5023}); 5024} 5025}; 5026} ) 5027.attachEvents( function( scope ){ 5028return { 5029formSubmit: ['submit', scope.root, 'form', true] 5030}; 5031}) 5032.view( function(){ 5033return { 5034loaderForResultContainer: function( scope, loading ){ 5035resultContEl = jQuery( scope.root ); 5036if( loading ) { 5037resultContEl.addClass( 'loading' ); 5038} else { 5039resultContEl.removeClass( 'loading' ); 5040} 5041}, 5042setResultContent: function( scope, html ){ 5043jQuery( scope.root ).children( '.content-result' ).html( html ); 5044}, 5045showThankYouPopup: function( scope ){ 5046var form = jQuery( scope.root ).find( 'form' ); 5047form.find('.message-warning').hide(); 5048form.find('label').removeClass('error-input'); 5049var content = $( scope.elements.lightboxContent ).html(); 5050lightbox.setContent( content ); 5051lightbox.show(); 5052if ( 5053jQuery(scope.root).hasClass('wedding-enquiry') || 5054jQuery(scope.root).hasClass('meeting-enquiry') || 5055form.hasClass('corporate-form') 5056) { 5057form.find('input[type=text]').val(''); 5058form.find('input[type=password]').val(''); 5059form.find('select').each(function(index, item){ 5060$(item).val($(item).find("option:first").val()); 5061}); 5062form.find('.js-clear-after-submit input[type=radio]').prop('checked', false); 5063form.find('.radios-item').find('input[type=radio]:first').prop('checked', true); 5064form.find('input[type=checkbox]').prop('checked', false); 5065} 5066} 5067}; 5068} ); 5069var lightboxApp = luana.factory( 'lightbox', { global: true } ); 5070lightboxApp.describeScope( { 5071closeButton: '[close-button]', 5072closeAndReload: '[close-reload-button]' 5073} ); 5074lightboxApp.faces( ['show', 'hide', 'setContent'] ); 5075lightboxApp.controller( function( view ){ 5076return { 5077show: function( isFixed ){ 5078view.showPopup( this.__getRoots(), isFixed ); 5079}, 5080hide: function(){ 5081view.hidePopup( this.__getRoots() ); 5082}, 5083hideAndReload: function(){ 5084view.hidePopupAndReloadPage( this.__getRoots() ); 5085}, 5086setContent: function( content ){ 5087view.setContent( this.__getRoots(), content ); 5088} 5089}; 5090} ); 5091lightboxApp.attachEvents( function( scope ){ 5092return { 5093hide: ['click', scope.root, scope.closeButton, true], 5094hideAndReload: ['click', scope.root, scope.closeAndReload, true] 5095}; 5096} ); 5097lightboxApp.view( function(){ 5098return { 5099showPopup: function( root, isFixed ){ 5100if ( isFixed == true ) { 5101$( root ).addClass( 'fixed' ); 5102$('html').addClass( 'has-lightbox' ); 5103} 5104$( root ).addClass( 'is-open' ); 5105}, 5106hidePopup: function( root, isFixed ){ 5107$( root ).removeClass( 'is-open' ).removeClass('fixed'); 5108$('html').removeClass( 'has-lightbox' ); 5109}, 5110hidePopupAndReloadPage: function( root, isFixed ){ 5111$( root ).removeClass( 'is-open' ).removeClass('fixed'); 5112$('html').removeClass( 'has-lightbox' ); 5113window.location.href = window.location.href.toString(); 5114}, 5115setContent: function( root, content ){ 5116$( root ).html( content ); 5117} 5118}; 5119} ); 5120var formApp = luana.factory( 'form' ); 5121formApp.describeScope( { 5122countryWithStates: { 5123'CA': '.ca-states', 5124'US': '.us-states' 5125} 5126} ); 5127formApp.defineElements( { 5128countriesSelect: '[countries-select] select', 5129countryInput: 'input.country-input', 5130hotelsSelect: '[hotels-select] select', 5131hotelInput: 'input.hotel-input', 5132statesSelect: '[states-select] select', 5133stateInput: 'input.state-input', 5134clubsSelect: '[club-select] select', 5135clubInput: 'input.club-input', 5136countiesSelect: '[county-select] select', 5137countyInput: 'input.county-input', 5138stateInputBlock: '[state-input-block]'
5139}); 5140formApp.controller( function( view ){ 5141return { 5142hotelSelect: function( scope, element ){ 5143view.setInputValue( scope, element, scope.elements.hotelInput ); 5144}, 5145stateSelect: function( scope, element ){ 5146view.setInputValue( scope, element, scope.elements.stateInput ); 5147}, 5148clubSelect: function( scope, element ){ 5149view.setInputValue( scope, element, scope.elements.clubInput ); 5150}, 5151countySelect: function( scope, element ){ 5152view.setInputValue( scope, element, scope.elements.countyInput ); 5153}, 5154countrySelect: function( scope, element ){ 5155view.setInputValue( scope, element, scope.elements.countryInput ); 5156if( $( element ).val() === 'CA' ){ 5157view.toggleStateSelect( scope, element, scope.countryWithStates['CA'] ); 5158scope.elements.stateInputBlock.hide(); 5159scope.elements.stateInput.val( $( scope.countryWithStates['CA'] ).val() ); 5160}else if( $( element ).val() === 'US' ){ 5161view.toggleStateSelect( scope, element, scope.countryWithStates['US'] ); 5162scope.elements.stateInputBlock.hide(); 5163scope.elements.stateInput.val( $( scope.countryWithStates['US'] ).val() ); 5164}else{ 5165scope.elements.stateInput.val(''); 5166scope.elements.stateInputBlock.show(); 5167view.toggleStateSelect( scope, element, false ); 5168} 5169} 5170}; 5171} ); 5172formApp.attachEvents( function( scope ){ 5173return { 5174hotelSelect: ['click', scope.elements.hotelsSelect], 5175stateSelect: ['change', scope.elements.statesSelect], 5176countrySelect: ['change', scope.elements.countriesSelect], 5177clubSelect: ['change', scope.elements.clubsSelect], 5178countySelect: ['change', scope.elements.countiesSelect] 5179}; 5180} ); 5181formApp.view( function(){ 5182return { 5183setInputValue: function( scope, element, input ){ 5184input.val( $( element ).children( 'option:selected ').text() ); 5185}, 5186toggleStateSelect: function( scope, element, selectClass ){ 5187$( scope.elements.statesSelect ).parent().parent().hide(); 5188if( selectClass ){ 5189$( selectClass ).parents( scope.itemClass ).show(); 5190} 5191} 5192}; 5193} ); 5194luana.factory( 'digits' ) 5195.controller( function( view ){ 5196var pattern = /[^0-9]/gi; 5197return { 5198keyup: function( scope, element, event ){ 5199$( element ).val( ( $( element ).val() ).replace( pattern, '' ) ); 5200} 5201}; 5202} ) 5203.attachEvents( function( scope ){ 5204return { 5205keyup: ['keyup', scope.root] 5206}; 5207} ); 5208luana.factory( 'general-form-ajax' ).describeScope( { 5209url: false 5210} ) 5211.defineElements( { 5212submit: '[data-form-submit]', 5213form: '[data-form]', 5214fields: '[data-form-required]', 5215errorMessage: '[data-form-error]', 5216thankYouMessage: '[data-form-thankyou-message]', 5217errorPopupMessage: '[data-form-error-message]', 5218loader: '[data-form-loader]', 5219cleaningFields: '[data-form-clean]', 5220hideBlockAfterSubmit: '[data-hide-block]', 5221enabledAjax: true, 5222countriesSelect: '[countries-select] select', 5223countryInput: 'input.country-input' 5224} ) 5225.controller( function( view ){ 5226return { 5227initialize: function(){ 5228this.__throughScopes( function( index, scope ){ 5229if( $( scope.elements.form ).attr( 'action' ) != '' ) { 5230scope.url = $( scope.elements.form ).attr( 'action' ); 5231} 5232scope.enabledAjax = typeof $( scope.root ).attr( 'data-form-no-ajax' ) === 'undefined'; 5233} ); 5234}, 5235submitForm: function( scope ){ 5236$( scope.elements.fields ).trigger('form-validate'); 5237if( this.validateForm( scope ) ){ 5238view.toggleLoader( scope ); 5239if( scope.enabledAjax ){ 5240$.post( 5241scope.url, 5242$( scope.elements.form ).serialize(), 5243function( data ){ 5244view.toggleLoader( scope ); 5245if ( data == '{error: 1}' ) { 5246view.showErrorPopup( scope ); 5247} else { 5248view.hideElement( scope ); 5249view.showThankYouPopup( scope ); 5250} 5251$('html,body').scrollTop(0); 5252view.clearElements( scope ); 5253if( luana.hasModule( 'hint' ) ){ 5254luana.module( 'hint' ).update(); 5255} 5256} 5257); 5258}else{ 5259$( scope.elements.form ).submit(); 5260} 5261} 5262}, 5263validateForm: function( scope ){ 5264var isValidate = true; 5265$.each( scope.elements.fields, 5266function( key, control ){ 5267var patternText = typeof $( control ).attr( 'data-pattern' ) === 'undefined' ? false : $( control ).attr( 'data-pattern' ), 5268skipHidden = typeof $( control ).attr( 'data-skip-hidden' ) === 'undefined' ? false : true, 5269isControlValid = true; 5270if( !(skipHidden && $( control ).is(":hidden")) ) { 5271if ( typeof $( control ).attr( 'data-form-addon-validation' ) !== 'undefined' ) { 5272isControlValid = $( control ).attr( 'data-form-addon-validation' ) === 'true' ? true : false;
5273} else { 5274if( typeof $( control ).attr( 'data-form-checkbox-req' ) !== 'undefined') { 5275isControlValid = this.validateBox( control, patternText ); 5276} else{ 5277isControlValid = this.validateControl( control, patternText ); 5278} 5279} 5280} 5281if ( isControlValid ) { 5282view.setControlSuccess( control ); 5283} else { 5284view.setControlInvalid( control ); 5285isValidate = false; 5286} 5287}.bind(this) 5288); 5289return isValidate; 5290}, 5291validateControl: function( control, pattern ){ 5292return pattern ? this.testPattern( control, pattern ) : !( $( control ).val() === '' ); 5293}, 5294validateBox: function ( element ) { 5295var isValid = true; 5296if ( $(element).is(':checked') ) { 5297view.setControlSuccess(element); 5298} else { 5299view.setControlInvalid(element); 5300isValid = false; 5301} 5302return isValid; 5303}, 5304testPattern: function( control, patternString ){ 5305var pattern = new RegExp(patternString); 5306return pattern.test( $( control ).val() ); 5307}, 5308countrySelect: function( scope, element ){ 5309scope.elements.countryInput.val($( element ).val()); 5310} 5311}; 5312} ) 5313.attachEvents( function( scope ){ 5314return { 5315submitForm: ['click', scope.elements.submit, true], 5316countrySelect: ['change', scope.elements.countriesSelect] 5317}; 5318} ) 5319.view( function(){ 5320var loaderClass = 'is-open'; 5321var hiddenClass = 'hidden'; 5322return { 5323showThankYouPopup: function( scope ){ 5324var content = $( scope.elements.thankYouMessage ).html(); 5325lightbox.setContent( content ); 5326lightbox.show(); 5327}, 5328showErrorPopup: function( scope ){ 5329var content = $( scope.elements.errorPopupMessage ).html(); 5330lightbox.setContent( content ); 5331lightbox.show(); 5332}, 5333setControlInvalid: function( control ){ 5334$( control ).addClass( 'is-invalid' ); 5335$( control ).parent('.select').addClass( 'is-invalid' ); 5336$( control ).parent('.hint').addClass( 'is-invalid' ); 5337}, 5338setControlSuccess: function( control ){ 5339$( control ).removeClass( 'is-invalid' ); 5340$( control ).parent('.select').removeClass( 'is-invalid' ); 5341$( control ).parent('.hint').removeClass( 'is-invalid' ); 5342}, 5343hideErrorMessages: function( scope ){ 5344$( scope.elements.errorMessage ).hide(); 5345}, 5346showErrorMessages: function( scope ){ 5347$( scope.elements.errorMessage ).show(); 5348}, 5349toggleLoader: function( scope ){ 5350$( scope.elements.loader ).toggleClass( loaderClass ); 5351}, 5352hideElement: function( scope ){ 5353if(scope.elements.hideBlockAfterSubmit.length > 0){ 5354$(scope.elements.hideBlockAfterSubmit).hide(); 5355} 5356if ($(scope.root).is(scope.elements.hideBlockAfterSubmit.selector)) { 5357$(scope.root).hide(); 5358} 5359}, 5360clearElements: function( scope ){ 5361var text = ''; 5362$.each( scope.elements.cleaningFields, 5363function( key, value ){ 5364$( value ).val('').trigger('change'); 5365if($( value ).prop("tagName") == 'SELECT'){ 5366if($( value ).find("[selected]").length > 0){ 5367$( value ).find("[selected]").attr('selected','selected'); 5368} 5369else{ 5370$( value ).find(">:first-child").attr('selected','selected'); 5371} 5372} 5373if($( value ).attr('type') == 'radio' || $( value ).attr('type') == 'checkbox'){ 5374$( value ).attr('checked', false); 5375} 5376} 5377); 5378} 5379} 5380} ); 5381luana.factory( 'general-form-ajax-confirm-email' ) 5382.defineElements( { 5383email: '[data-form-email]', 5384confirmEmail: '[data-form-confirm-email]', 5385fields: '[data-form-email], [data-form-confirm-email]' 5386} ) 5387.controller( function( view ){ 5388return { 5389eachScope: function( scope ) { 5390this.validate( scope ); 5391}, 5392validate: function( scope ){ 5393var step = true; 5394step = $( scope.elements.email ).val() === $( scope.elements.confirmEmail ).val(); 5395step = this.checkControls( scope ) && step; 5396step ? view.setSuccess( scope ) : view.setError( scope ); 5397}, 5398checkControls: function( scope ) { 5399var isValidate = true; 5400$.each( scope.elements.fields, 5401function( key, control ){ 5402var patternText = typeof $( control ).attr( 'data-pattern' ) === 'undefined' ? false : $( control ).attr( 'data-pattern' ); 5403if( !this.validateControl( control, patternText ) ) { 5404isValidate = false; 5405} 5406}.bind(this) 5407); 5408return isValidate; 5409}, 5410validateControl: function( control, pattern ){ 5411return pattern ? this.testPattern( control, pattern ) : !( $( control ).val() === '' ); 5412}, 5413testPattern: function( control, patternString ){ 5414var pattern = new RegExp(patternString); 5415return pattern.test( $( control ).val() ); 5416} 5417}; 5418} ) 5419.attachEvents( function( scope ){ 5420return { 5421validate: ['keyup', scope.elements.fields], 5422validate: ['change', scope.elements.fields] 5423}; 5424} ) 5425.view( function(){ 5426return { 5427setError: function( scope ){ 5428$( scope.elements.fields ).attr( 'data-form-addon-validation', false ); 5429}, 5430setSuccess: function( scope ){ 5431$( scope.elements.fields ).attr( 'data-form-addon-validation', true ); 5432} 5433} 5434} ); 5435luana.factory( 'general-form-ajax-radio' ) 5436.defineElements( {
5437controls: 'input[type="radio"]' 5438} ) 5439.controller( function( view ){ 5440return { 5441eachScope: function( scope ) { 5442this.validate( scope ); 5443}, 5444validate: function( scope ){ 5445var step = false; 5446$.each( scope.elements.controls, 5447function( key, control ){ 5448if ( $( control ).prop( "checked" ) ) { 5449step = true; 5450} 5451}); 5452step ? view.setSuccess( scope ) : view.setError( scope ); 5453} 5454}; 5455} ) 5456.attachEvents( function( scope ){ 5457return { 5458validate: ['change', scope.elements.controls], 5459validate: ['click', scope.elements.controls] 5460}; 5461} ) 5462.view( function(){ 5463return { 5464setError: function( scope ){ 5465$( scope.root ).attr( 'data-form-addon-validation', false ); 5466}, 5467setSuccess: function( scope ){ 5468$( scope.root ).attr( 'data-form-addon-validation', true ); 5469} 5470} 5471} ); 5472luana.factory( 'general-form-ajax-trigger-select' ) 5473.defineElements( { 5474controls: 'select' 5475} ) 5476.describeScope( { 5477triggerValue: false, 5478target: false 5479} ) 5480.controller( function( view ){ 5481return { 5482eachScope: function( scope ) { 5483scope.triggerValue = typeof $( scope.root ).attr( 'data-form-trigger-val' ) === 'undefined' ? false : $( scope.root ).attr( 'data-form-trigger-val' ); 5484scope.target = typeof $( scope.root ).attr( 'data-form-target' ) === 'undefined' ? false : $( scope.root ).attr( 'data-form-target' ); 5485this.validate( scope ); 5486}, 5487validate: function( scope ){ 5488$.each( scope.elements.controls, 5489function( key, control ){ 5490$( control ).val() === scope.triggerValue ? $( scope.target ).show() : $( scope.target ).hide(); 5491}); 5492} 5493}; 5494} ) 5495.attachEvents( function( scope ){ 5496return { 5497validate: ['change', scope.elements.controls] 5498}; 5499} ); 5500luana.factory( 'general-form-ajax-related-fields' ) 5501.defineElements( { 5502controls: '[data-form-related-fields]' 5503} ) 5504.controller( function( view ){ 5505return { 5506eachScope: function( scope ) { 5507this.validate( scope ); 5508}, 5509validate: function( scope ){ 5510var step = false; 5511$.each( scope.elements.controls, 5512function( key, control ){ 5513if ( $( control ).val() !== '' ) { 5514step = true; 5515} 5516}); 5517step ? view.setSuccess( scope ) : view.setError( scope ); 5518} 5519}; 5520} ) 5521.attachEvents( function( scope ){ 5522return { 5523validate: ['form-validate', scope.root] 5524}; 5525} ) 5526.view( function(){ 5527return { 5528setError: function( scope ){ 5529$( scope.root ).attr( 'data-form-addon-validation', false ); 5530}, 5531setSuccess: function( scope ){ 5532$( scope.root ).attr( 'data-form-addon-validation', true ); 5533} 5534} 5535} ); 5536luana.factory( 'show-find-reservation-lightbox' ).defineElements( { 5537link: 'a[href="/reservation/find"]' 5538} ) 5539.describeScope( { 5540target: '', 5541} ).controller( function( view ){ 5542return { 5543eachScope: function( scope ){ 5544scope.target = typeof $( scope.root ).attr( 'data-target' ) === 'undefined' ? scope.target : $( scope.root ).attr( 'data-target' ); 5545}, 5546show: function( scope ) { 5547$( scope.target ).show(); 5548}, 5549hide: function( scope ) { 5550$( scope.target ).hide(); 5551}, 5552update: function( scope ){ 5553if( $( scope.target ).is( ':visible' ) ){ 5554this.hide( scope ); 5555}else{ 5556this.show( scope ); 5557} 5558} 5559}; 5560} ).attachEvents( function( scope ){ 5561return { 5562update: ['click', scope.elements.link, true] 5563}; 5564} ); 5565luana.factory('booking-widget-collapsed') 5566.defineElements({ 5567bwidgetOpenBtn: '[bwidget-type-collapsed-btn]' 5568}) 5569.describeScope({ 5570openingCount: 0, 5571isClicked: false 5572}) 5573.controller(function ( view ) { 5574return { 5575eachScope: function ( scope ) { 5576this.collapseWidgetOnStart( scope ); 5577}, 5578collapseWidgetOnStart: function ( scope ) { 5579this.__setTimeout( function(){ 5580view.collapseWidget( scope ) 5581}, 3000); 5582}, 5583openWidget: function ( scope ) { 5584view.openWidget( scope ); 5585scope.openingCount = scope.openingCount + 1; 5586scope.isClicked = false; 5587this.setWidgetLongTimeout(scope); 5588}, 5589clearWidgetTimeout: function ( scope ) { 5590this.__clearTimeout(); 5591}, 5592setWidgetLongTimeout: function(scope) { 5593if ( scope.openingCount < 2 && !scope.isClicked ) { 5594this.__setTimeout( function(){ 5595view.collapseWidget( scope ) 5596}, 5000); 5597} 5598}, 5599clickOnWidget: function ( scope ) { 5600scope.isClicked = true; 5601this.clearWidgetTimeout( scope ); 5602}, 5603enterWidget: function ( scope ) { 5604this.clearWidgetTimeout( scope ); 5605}, 5606leaveWidget: function ( scope ) { 5607this.setWidgetLongTimeout(scope); 5608}, 5609inWidget: function(scope) { 5610this.clearWidgetTimeout( scope ); 5611} 5612} 5613}) 5614.attachEvents(function ( scope ) { 5615return { 5616scrollWindow: ['scroll', window], 5617openWidget: ['click', scope.elements.bwidgetOpenBtn, true], 5618clickOnWidget: [ 'mousedown', scope.root ], 5619enterWidget: [ 'mouseenter', scope.root ], 5620leaveWidget: [ 'mouseleave', scope.root ], 5621inWidget: ['mousemove', scope.root ] 5622} 5623}) 5624.view(function () { 5625var collapseClass= 'bwidget-type-collapsed'; 5626return { 5627collapseWidget: function( scope ){ 5628$( scope.root ).addClass( collapseClass ); 5629}, 5630openWidget: function( scope ) { 5631$( scope.root ).removeClass( collapseClass ); 5632} 5633} 5634}); 5635luana.factory( 'goto' ) 5636.describeScope( { 5637target: '', 5638hasAnimation: true 5639} ).controller( function( view ){ 5640return { 5641eachScope: function ( scope ){ 5642this.getOptions( scope ); 5643}, 5644getOptions: function( scope ) { 5645scope.target = typeof $( scope.root ).attr( 'href' ) === 'undefined' ? false : $( scope.root ).attr( 'href' ); 5646scope.hasAnimation = typeof $( scope.root ).attr( 'data-animation' ) === 'undefined' ? false : true; 5647}, 5648move: function( scope, animation ) { 5649var pos = $( scope.target ).length > 0 ? $( scope.target ).offset() : 0; 5650if ( pos != 0 ) { 5651scope.hasAnimation ? 5652$('html, body').animate({ scrollTop: pos.top }) : 5653$( window ).scrollTop( pos.top ); 5654} 5655} 5656}; 5657} ).attachEvents( function( scope ){ 5658return { 5659move: ['click', scope.root, true] 5660}; 5661}); 5662(function($) { 5663$(function() { 5664var $searchInput, 5665$searchButton, 5666$searchBlock, 5667stateClass; 5668$searchBlock = $('#search-block'); 5669$searchInput = $('#search-input'); 5670$searchButton = $('#search-button'); 5671stateClass = 'is-open'; 5672if ( $searchInput.length !== 0 && $searchButton.length !== 0 ) { 5673$searchButton.on('click', function(e){ 5674if( $searchInput.val() === "" && $searchBlock.hasClass(stateClass)) { 5675e.preventDefault(); 5676$searchBlock.removeClass(stateClass); 5677} else if ( !$searchBlock.hasClass(stateClass) ) { 5678e.preventDefault(); 5679$searchBlock.addClass(stateClass); 5680} 5681}); 5682} 5683}); 5684})(window.jQuery); 5685$( document ).ready(function(){ 5686var focusTrap = { 5687activeElement: null, 5688container: null, 5689getFocusableElements: function(container) { 5690var focusableSelectors = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not
5690([tabindex="-1"])'; 5691return $(container).find(focusableSelectors).filter(':visible'); 5692}, 5693activate: function(container, triggerElement) { 5694this.container = container; 5695this.activeElement = triggerElement || document.activeElement; 5696var focusableElements = this.getFocusableElements(container); 5697if (focusableElements.length > 0) { 5698focusableElements.first().focus(); 5699} 5700$(document).on('keydown.focusTrap', this.handleKeydown.bind(this)); 5701}, 5702deactivate: function() { 5703$(document).off('keydown.focusTrap'); 5704if (this.activeElement && $(this.activeElement).length) { 5705$(this.activeElement).focus(); 5706} 5707this.container = null; 5708this.activeElement = null; 5709}, 5710handleKeydown: function(e) { 5711if (!this.container) return; 5712if (e.keyCode === 27) { 5713e.preventDefault(); 5714closeAllMenus(); 5715return; 5716} 5717if (e.keyCode === 9) { 5718var focusableElements = this.getFocusableElements(this.container); 5719if (focusableElements.length === 0) return; 5720var firstElement = focusableElements.first()[0]; 5721var lastElement = focusableElements.last()[0]; 5722if (e.shiftKey) { 5723if (document.activeElement === firstElement) { 5724e.preventDefault(); 5725lastElement.focus(); 5726} 5727} else { 5728if (document.activeElement === lastElement) { 5729e.preventDefault(); 5730firstElement.focus(); 5731} 5732} 5733} 5734} 5735}; 5736function closeAllMenus() { 5737$('body').removeClass('iosBugFixCaret'); 5738$('.globalheader-book button, #header-booking-widget, .globalheader-book, .globalheader-menu-btn, #header-menu').removeClass('is-open'); 5739$('.globalheader-menu-closer').hide(); 5740focusTrap.deactivate(); 5741} 5742$('.globalheader-menu-btn, .globalheader-menu-caption').on('click', function(e) { 5743e.preventDefault(); 5744var isOpening = !$('#header-menu').hasClass('is-open'); 5745var triggerButton = $('.globalheader-menu-btn')[0]; 5746$('body').toggleClass('iosBugFixCaret'); 5747$('.globalheader-book button, #header-booking-widget, .globalheader-book').removeClass('is-open'); 5748$('.globalheader-menu-closer').toggle(); 5749$('.globalheader-menu-btn').toggleClass('is-open'); 5750$('#header-menu').toggleClass('is-open'); 5751if (isOpening) { 5752focusTrap.activate('#header-menu', triggerButton); 5753} else { 5754focusTrap.deactivate(); 5755} 5756}); 5757var bookingWidgetTrigger = null; 5758var bookingWidgetFocusTrapHandler = null; 5759function enableBookingWidgetFocusTrap() { 5760var widget = $('#header-booking-widget'); 5761var toggleButton = $('.globalheader-book button')[0]; 5762var widgetFocusable = widget.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').filter(':visible').toArray(); 5763var focusableElements = [toggleButton].concat(widgetFocusable); 5764if (focusableElements.length === 0) return; 5765var firstFocusable = focusableElements[0]; 5766var lastFocusable = focusableElements[focusableElements.length - 1]; 5767bookingWidgetFocusTrapHandler = function(e) { 5768if (e.key !== 'Tab') return; 5769if (e.shiftKey) { 5770if (document.activeElement === firstFocusable) { 5771e.preventDefault(); 5772lastFocusable.focus(); 5773} 5774} else { 5775if (document.activeElement === lastFocusable) { 5776e.preventDefault(); 5777firstFocusable.focus(); 5778} 5779} 5780}; 5781$(document).on('keydown', bookingWidgetFocusTrapHandler); 5782setTimeout(function() { firstFocusable.focus(); }, 100); 5783} 5784function disableBookingWidgetFocusTrap() { 5785if (bookingWidgetFocusTrapHandler) { 5786$(document).off('keydown', bookingWidgetFocusTrapHandler); 5787bookingWidgetFocusTrapHandler = null; 5788} 5789if (bookingWidgetTrigger) { 5790setTimeout(function() { $(bookingWidgetTrigger).focus(); }, 100); 5791bookingWidgetTrigger = null; 5792} 5793} 5794$('.globalheader-book button').on('click', function(e) { 5795if ($(this).attr('is-login') === "1") { 5796return; 5797} 5798e.preventDefault(); 5799if ($('#header-menu').hasClass('is-open')) { 5800focusTrap.deactivate(); 5801} 5802$('body').toggleClass('iosBugFixCaret'); 5803$('.globalheader-menu-btn, #header-menu').removeClass('is-open'); 5804$('.globalheader-menu-closer').toggle(); 5805$(this).toggleClass('is-open'); 5806$('.globalheader-book').toggleClass('is-open'); 5807$('#header-booking-widget').toggleClass('is-open'); 5808if ($('#header-booking-widget').hasClass('is-open')) { 5809bookingWidgetTrigger = this; 5810enableBookingWidgetFocusTrap(); 5811} else { 5812disableBookingWidgetFocusTrap(); 5813} 5814}); 5815$('.globalheader-menu-closer').on('click', function(e) { 5816closeAllMenus(); 5817$('body').removeClass('iosBugFixCaret'); 5818$('.globalheader-book button, #header-booking-widget, .globalheader-book, .globalheader-menu-btn, #header-menu').removeClass('is-open'); 5819$('.globalheader-menu-closer').hide(); 5820disableBookingWidgetFocusTrap(); 5821}); 5822$(document).on("scroll", function(e) { 5823var header = $('.globalheader'); 5824var scrollTop = +$(this).scrollTop(); 5825if(scrollTop > 90) { 5826header.addClass("solid"); 5827} else { 5828header.removeClass("solid"); 5829} 5830}); 5831var heightOnLoad = $(window).height(); 5832var userAgent = navigator.userAgent || navigator.vendor || window.opera; 5833if (userAgent.match(/android/i)) { 5834$('.heroHeight').css({ 'height':heightOnLoad }); 5835} 5836if (userAgent.match(/ipad/i)) { 5837$('.heroHeight').css({ 'height':heightOnLoad }); 5838} 5839if (userAgent.match(/iphone/i)) { 5840$('.heroHeight').css({ 'height':heightOnLoad }); 5841}
5842$('.js-payment input:radio').change(function(){ 5843$('#payment-card-block').fadeToggle(50); 5844}); 5845var refid = getUrlVars()['refid']; 5846if(refid != undefined && refid.length){ 5847Cookie.setCookie('refid', refid, 1); 5848} 5849$('.inner-hotel-nav__expand-btn').on('click keydown', function(e) { 5850if (e.type === 'keydown' && e.keyCode !== 13 && e.keyCode !== 32) { 5851return; 5852} 5853e.preventDefault(); 5854var $button = $(this); 5855var $parent = $button.closest('.inner-hotel-nav__has-submenu, .inner-hotel-nav-hotels__has-submenu'); 5856var $submenu = $parent.next('.inner-hotel-nav__submenu'); 5857var isOpen = $parent.hasClass('is-open'); 5858if (isOpen) { 5859$parent.removeClass('is-open'); 5860$button.removeClass('is-open').attr('aria-expanded', 'false'); 5861$submenu.slideUp(); 5862} else { 5863$('.inner-hotel-nav__has-submenu.is-open, .inner-hotel-nav-hotels__has-submenu.is-open').removeClass('is-open'); 5864$('.inner-hotel-nav__expand-btn.is-open').removeClass('is-open').attr('aria-expanded', 'false'); 5865$('.inner-hotel-nav__submenu').slideUp(); 5866$parent.addClass('is-open'); 5867$button.addClass('is-open').attr('aria-expanded', 'true'); 5868$submenu.slideDown(); 5869} 5870}); 5871var $gs_main = $('.gs-main').imagesLoaded( function() { 5872$gs_main.masonry({ 5873itemSelector: '.grid-cell', 5874horizontalOrder: true, 5875percentPosition: true 5876}); 5877}); 5878}); 5879function doOnOrientationChange() { 5880var heightOnLoad = $(window).height(); 5881$('.heroHeight').css({ 'min-height':heightOnLoad }); 5882$('.heroHeight').css({ 'height':heightOnLoad }); 5883} 5884window.addEventListener('orientationchange', doOnOrientationChange); 5885function stopVideo(iframe){ 5886$(iframe)[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*'); 5887} 5888function getUrlVars() 5889{ 5890var vars = [], hash; 5891var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 5892for(var i = 0; i < hashes.length; i++) 5893{ 5894hash = hashes[i].split('='); 5895vars.push(hash[0]); 5896vars[hash[0]] = hash[1]; 5897} 5898return vars; 5899} 5900function getFromSession(key) { 5901if (!key || !sessionStorage || typeof sessionStorage.getItem !== 'function') { 5902return; 5903} 5904try { 5905var values = sessionStorage.getItem(key); 5906if (values) { 5907return values; 5908} 5909} catch (e) { 5910} 5911} 5912jQuery( document ).ready(function( $ ) { 5913}); 5914luana.factory( 'close' ).controller( function(){ 5915return { 5916click: function( scope ){ 5917$( $( scope.root ).data( "close-target" ) ).hide(); 5918$( scope.root ).removeClass("is-open"); 5919$( $( scope.root ).data( "close-target" ) ).removeClass("is-open"); 5920} 5921}; 5922} ).attachEvents( function( scope ){ 5923return { 5924click: ['click', scope.root, true] 5925}; 5926} ); 5927luana.factory( 'open' ).controller( function(){ 5928return { 5929click: function( scope ){ 5930$( $( scope.root ).data( "open-target" ) ).show(); 5931} 5932}; 5933} ).attachEvents( function( scope ){ 5934return { 5935click: ['click', scope.root, false] 5936}; 5937} ); 5938window.Cookie = (function(){ 5939var _getCookie = function( name ){ 5940var matches = document.cookie.match( new RegExp( '(?:^|; )' + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + '=([^;]*)' )); 5941return ( matches ) ? decodeURIComponent( matches[1] ) : undefined; 5942}, 5943_setCookie = function( name, value, days ){ 5944if ( 5945name !== 'skip_aval_call' 5946&& (typeof Cookiebot === undefined || !Cookiebot.consent.marketing) 5947) { 5948console.log('Cookie "' + name + ': ' + value + '" rejected as cookie consent not provided'); 5949return; 5950} 5951var date = new Date(), 5952expires = ''; 5953if( typeof days !== 'undefined' ){ 5954date.setTime( date.getTime() + ( days * 24 * 60 * 60 * 1000 ) ); 5955expires = '; expires=' + date.toGMTString(); 5956} 5957document.cookie = name + '=' + value + expires + '; path=/'; 5958}, 5959_deleteCookie = function( name, path, domain ){ 5960if ( _getCookie( name ) ) document.cookie = name + "=" + 5961( ( path ) ? ";path=" + path : "") + 5962( ( domain ) ? ";domain=" + domain : "" ) + 5963";expires=Thu, 01-Jan-1970 00:00:01 GMT"; 5964}; 5965return { 5966getCookie: _getCookie, 5967setCookie: _setCookie, 5968deleteCookie: _deleteCookie 5969}; 5970})(); 5971luana.factory('cookie-policy' ).defineElements({ 5972acceptButton: '[accept-cookie-policy]' 5973}).controller(function(view) { 5974return { 5975eachScope: function( scope ){ 5976this.setCookiePolicyVariable(scope); 5977}, 5978closeCookiePolicyPopup: function(scope){ 5979Cookie.setCookie('ca_v3', '1', 360); 5980$(scope.root).hide(); 5981$(scope.root).removeClass("is-open"); 5982}, 5983setCookiePolicyVariable: function(scope) { 5984if (typeof Cookiebot !== 'undefined' && Cookiebot.isOutOfRegion && Cookie.getCookie('ca_v3') != '1') { 5985$(scope.root).show(); 5986$(scope.root).addClass("is-open"); 5987} 5988} 5989}; 5990}).attachEvents(function(scope){ 5991return { 5992closeCookiePolicyPopup: ['click', scope.elements.acceptButton, true] 5993}; 5994} ); 5995luana.factory( 'widget-count-select' ) 5996.faces( ['select'] ) 5997.defineElements( { 5998button: '[select-value-button]', 5999holder: '[select-value-holder]', 6000presenter: '[select-value-presenter]', 6001list: '[select-value-list]' 6002}, 6003{ 6004roomGallery:'[room-view-list]' 6005} 6006).describeScope( { 6007visible: false, 6008count: 0, 6009enteredString: '', 6010lastAdded: ( new Date() ).getTime(), 6011selectedPosition: -1, 6012currentPosition: -1, 6013needTriggerChange: true, 6014cookieName: 'room_index_gallery' 6015} ).controller( function( view ){ 6016return { 6017eachScope: function( scope ){ 6018var defaultSelectedElement; 6019defaultSelectedElement = $( scope.elements.list ).find( 'a[data-selected]' ); 6020if( defaultSelectedElement.length ){ 6021scope.needTriggerChange = false;
6022this.selectValue( scope, defaultSelectedElement[0] ); 6023} else { 6024$( scope.root ).addClass('is-pristine is-empty').removeClass('is-selected'); 6025} 6026scope.count = $( scope.elements.list ).find( 'a' ).length; 6027$( scope.elements.holder ).css({'display':'none'}); 6028}, 6029clickButton: function( scope ){ 6030if( scope.visible ){ 6031view.hide( scope ); 6032}else{ 6033if( this.__getState() !== false && this.__getState().visible ){ 6034view.hide( this.__getState() ); 6035} 6036this.align( scope ); 6037view.show( scope ); 6038} 6039$(scope.root).removeClass('is-invalid'); 6040}, 6041align: function( scope ){ 6042$(scope.elements.list).removeAttr('style'); 6043var globTop = $(scope.elements.button).offset().top; 6044var top = globTop - $(document).scrollTop(); 6045var height = $(scope.elements.list).outerHeight(true); 6046if ($(window).height() - top < height) { 6047if (height >= globTop) { 6048$(scope.elements.list).css('max-height', globTop); 6049} 6050view.up(scope, true); 6051} else { 6052view.up(scope, false); 6053} 6054}, 6055selectValue: function( scope, element ){ 6056if( !( $( element ).attr( 'disabled' ) || $( scope.elements.list ).is( '[data-readonly]' ) ) ){ 6057scope.currentPosition = $( scope.elements.list ).find( 'a' ).index( element ); 6058scope.selectedPosition = scope.currentPosition; 6059view.updateCurrentValueClass( scope, scope.selectedPosition ); 6060view.setValue( scope, element ); 6061view.hide( scope ); 6062if ($(element).is('[is-empty-option]')) { 6063$(element).removeClass('is-active'); 6064$(scope.root).addClass('is-pristine is-empty').removeClass('is-selected'); 6065var text = $(scope.elements.presenter).data('empty-text'); 6066if (text) { 6067$(scope.elements.presenter).text(text); 6068} 6069} 6070} 6071}, 6072mouseEnter: function( scope, element ){ 6073$( scope.elements.list ).find( 'a' ).removeClass('search'); 6074scope.currentPosition = $( scope.elements.list ).find( 'a' ).index( element ); 6075view.updateCurrentValueClass( scope, scope.currentPosition ); 6076}, 6077move: function( scope, direction ){ 6078scope.currentPosition += direction; 6079scope.currentPosition = ( scope.currentPosition < 0 ) ? 60800 : ( scope.currentPosition >= scope.count ) ? 6081scope.count - 1 : scope.currentPosition; 6082view.updateCurrentValueClass( scope, scope.currentPosition ); 6083}, 6084selectByKey: function( scope, char ){ 6085if( ( new Date() ).getTime() - scope.lastAdded >= 1000 ){ 6086scope.enteredString = ''; 6087} 6088scope.enteredString += char; 6089scope.lastAdded = ( new Date() ).getTime(); 6090var items = []; // arr with all values in list 6091$( scope.elements.list ).find('a span').each( function( i, item ) { 6092items.push( $(item).html() ); 6093$(item).parent('a').removeClass('search'); 6094}); 6095var foundIndex = this.findFirstItemByStr(items, scope.enteredString); 6096if ( foundIndex != -1 ) { 6097scope.currentPosition = foundIndex; 6098$(scope.elements.list).scrollTop( 6099$($(scope.elements.list).find('li').eq(foundIndex)).position().top - $($(scope.elements.list).find('li').first()).position().top 6100); 6101$($(scope.elements.list).find('a').eq(foundIndex)).addClass('search'); 6102} else { 6103scope.enteredString = ''; 6104} 6105}, 6106findFirstItemByStr: function( arr, substring, separator ) { 6107var separator = '&&'; // do not use '|' because of it's regExp 'or' operator 6108var strFromArr = arr.join(separator); 6109var searchRegExp = new RegExp( separator + substring, "i" ); 6110var index = strFromArr.search(searchRegExp); 6111if (index == -1) { 6112return -1; 6113} 6114strFromArr = strFromArr.slice( 0, index ); 6115return strFromArr.split(separator).length ; 6116}, 6117clickDocument: function( element, event ){ 6118var scope = this.__getState(); 6119if( scope ){ 6120if( !this.__getScopeByElement( event.target ) ){ 6121view.hide( this.__getState() ); 6122} 6123} 6124}, 6125tapDocument: function( element, event ){ 6126this.clickDocument( element, event ); 6127}, 6128keyDown: function( element, event ){ 6129var scope = this.__getState(); 6130if( scope ){ 6131if( event.keyCode === 27 ){ 6132view.hide( scope ); 6133}else if( event.keyCode === 13 ){ 6134scope.needTriggerChange = true; 6135this.selectValue( scope, ( $( scope.elements.list ).find( 'a' ) )[scope.currentPosition] ); 6136event.preventDefault(); 6137}else if( event.keyCode === 38 ){ 6138this.move( scope, -1 ); 6139event.preventDefault(); 6140}else if( event.keyCode === 40 ){ 6141this.move( scope, 1 ); 6142event.preventDefault(); 6143}else{ 6144this.selectByKey( scope, String.fromCharCode( event.keyCode ) ); 6145event.preventDefault(); 6146} 6147} 6148}, 6149select: function( element, value ){ 6150var scopes = this.__getScopesByElement( element ), a; 6151$.each( scopes, 6152function( index, scope ){ 6153a = $( scope.elements.list ).find( 'a[data-value="' + value + '"]' ); 6154if( a.length ){ 6155this.selectValue( scope, a ); 6156} 6157}.bind( this ) 6158); 6159}, 6160getText: function( scope ) { 6161return $( scope.elements.holder ).find( ':selected').text(); 6162}, 6163onSelectChange: function( scope ) { 6164var activeRoomIndex = $(scope.elements.roomGallery).find('.active[gallery-item] [room-view-img]').data('item-idex'); 6165try { 6166localStorage.setItem(scope.cookieName, activeRoomIndex); 6167} catch (error) { 6168} 6169view.updatePresenterText( scope, this.getText( scope ) ); 6170}, 6171handleSelectValue: function( scope, element ) { 6172scope.needTriggerChange = true; 6173this.selectValue( scope, element ); 6174} 6175}; 6176} ).attachEvents( function( scope ){ 6177return { 6178clickButton: ['click', scope.elements.button, true], 6179handleSelectValue: ['click', scope.elements.list, 'li > a', true], 6180mouseEnter: ['mouseenter', scope.elements.list, 'li > a'], 6181onSelectChange: ['change', scope.elements.holder] 6182}; 6183} ).attachGlobalEvents( function( scope ){ 6184return { 6185clickDocument: ['click', document], 6186tapDocument: ['tap', document], 6187keyDown: ['keydown', window] 6188}; 6189} ).view( function(){ 6190return { 6191updateCurrentValueClass: function( scope, index ){ 6192var list = $( scope.elements.list ).find( 'a' ); 6193$( list ).removeClass( 'is-active' ); 6194$( list[index] ).addClass( 'is-active' ); 6195}, 6196up: function( scope, isUp ){ 6197if( isUp ){ 6198$( scope.root ).addClass( 'is-up' ); 6199}else{ 6200$( scope.root ).removeClass( 'is-up' ); 6201} 6202}, 6203show: function( scope ){ 6204this.updateCurrentValueClass( scope, scope.selectedPosition ); 6205$( scope.root ).addClass( 'is-open' );
6206$( scope.elements.button ).addClass( 'is-active' ); 6207scope.visible = true; 6208this.__setState( scope ); 6209}, 6210hide: function( scope ){ 6211$( scope.root ).removeClass( 'is-open' ); 6212$( scope.elements.button ).removeClass( 'is-active' ); 6213scope.visible = false; 6214this.__clearState(); 6215}, 6216setValue: function( scope, element ){ 6217var optionToSelect = $(scope.elements.holder).find('option')[scope.selectedPosition]; 6218if (optionToSelect && $(optionToSelect).val() === $(element).data('value')) { 6219$(optionToSelect).prop('selected', true); // handle multiple options with same value 6220} else { 6221$(scope.elements.holder).val($(element).data('value')); 6222} 6223$( scope.elements.presenter ).text( $( element ).text() ); 6224$( scope.root ).removeClass('is-pristine'); 6225$( scope.root ).addClass('is-selected'); 6226if ( scope.needTriggerChange ) { 6227$( scope.elements.holder ).trigger( 'change' ); 6228} 6229$( scope.root ).removeClass('is-pristine is-empty').addClass('is-selected'); 6230}, 6231updatePresenterText: function( scope, text ) { 6232$( scope.elements.presenter ).text( text ); 6233$( scope.root ).removeClass('is-pristine is-empty').addClass('is-selected'); 6234} 6235}; 6236} ); 6237luana.factory( 'map-overlay' ) 6238.defineElements( { 6239overlay: '[data-map-overlay-target]', 6240} ) 6241.controller( function( view ){ 6242return { 6243clickOverlay: function( scope ){ 6244view.hide( scope.elements.overlay ); 6245}, 6246tapOverlay: function( scope, element, event ){ 6247view.hide( scope.elements.overlay ); 6248} 6249}; 6250} ) 6251.attachEvents( function( scope ){ 6252return { 6253clickOverlay: ['click', scope.root, true], 6254tapOverlay: ['tap', scope.root, true] 6255}; 6256} ) 6257.view( function(){ 6258return { 6259hide: function( element ) { 6260$( element ).fadeOut( 400 ); 6261} 6262} 6263} ); 6264$(document).ready(function () { 6265$.widget("custom.catcomplete", $.ui.autocomplete, { 6266_create: function () { 6267this._super(); 6268this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); 6269}, 6270_renderMenu: function (ul, items) { 6271var currentCategory = ""; 6272$.each(items, function (index, item) { 6273if (item['category'] !== 'no_results' && item['category'] !== 'suggestions') { 6274$(ul).removeClass('ui-empty'); 6275if (item.category != currentCategory && item.category) { 6276ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>"); 6277currentCategory = item.category; 6278} 6279this._renderItemData(ul, item); 6280} else { 6281$(ul).addClass('ui-empty'); 6282this._renderItemData(ul, item); 6283} 6284}.bind(this)); 6285var li = $("<li class='ui-autocomplete-close'/>"); 6286var button = $("<button type='button'>" + $(searchInput).data('close-button-text') + "</button>"); 6287$(ul).append(li.append(button)); 6288button.click(function () { 6289this.close(); 6290if ($(searchInput).val() != "") { 6291$(searchInput).parent().addClass("search"); 6292} else { 6293$(searchInput).parent().removeClass("search"); 6294} 6295$(searchInput).blur(); 6296}.bind(this)); 6297}, 6298_renderItemData: function (ul, item) { 6299item.label = item.label.replace( 6300new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(this.term.trim()) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>" 6301); 6302return $("<li>").data("ui-autocomplete-item", item).append('<a' + (item['dc_city'] ? ' class="city"' : '') + '>' + item.label + "</a>").appendTo(ul); 6303} 6304}); 6305var autocompleteJustSelected = false, 6306searchInput = 'input.search_keyword', 6307scriptURL = $(searchInput).data('url'), 6308acClassIdent = 'input[name=ac_class_identifier]', 6309acSearchKeyword = 'input[name=search_keyword]', 6310acHotelCode = 'input[name=hotel_code]', 6311acHotelURL = 'input[name=hotel_url]', 6312acBrandCode = 'input[name=brand_code]', 6313acObjectID = 'input[name=ac_object_id]', 6314acLabel = 'label.label-text', 6315autocompleteForm = $('.js-autocomplete-parent-form'), 6316acHotelLink = '[data-submit-button-row] [data-btn-hotel]', 6317noKeywordResult, 6318clearButton = '[btn-input-clear]', 6319input_loader = '[autocomplete-loader]', 6320isDCResult = 'input[name=is_dc_result]', 6321dcHotelCode = 'input[name=hotel_id]', 6322startDate = '[bwidget-hidden-checkin-date]', 6323endDate = '[bwidget-hidden-checkout-date]', 6324adults = '#adults', 6325children = '#children', 6326doAvailabilityInput = 'input[name=do_availability]', 6327hotelDateFormat = 'input[name=date_format]', 6328ipreferBookButton = '[iprefer-book-button]', 6329bookButton = '[bwidget-book-button]', 6330rooms = '#roomsInput'; 6331var ghaHotelSelected = function (code) { 6332var params = {}; 6333var ghaBookUrl = $(searchInput).data('basic-url'); 6334params['startDate'] = $(startDate).val(); 6335params['endDate'] = $(endDate).val(); 6336var roomsCount = $(rooms).val(); 6337params['hotelCode'] = code; 6338ghaBookUrl = ghaBookUrl + '&' + $.param(params); 6339for (i = 1; i <= roomsCount; i++) {
6340ghaBookUrl = ghaBookUrl + '&room' + i + 'Adults='+$(adults + i).val(); 6341ghaBookUrl = ghaBookUrl + '&room' + i + 'Children='+$(children + i).val(); 6342} 6343window.open(ghaBookUrl, '_blank'); 6344}; 6345var clearAutocompleteFields = function (el) { 6346var form = $(el).closest('form'); 6347$(acClassIdent, form).val(''); 6348$(acObjectID, form).val(''); 6349$(acHotelCode, form).val(''); 6350$(acBrandCode, form).val(''); 6351$(searchInput, form).trigger('change'); 6352}, 6353resortAutocompleteGroups = function (data) { 6354var keyword = $(searchInput).val().toLowerCase(); 6355var sortPriority = ['countries', 'states', 'cities', 'neighbourhoods', 'brands']; 6356var results = {}; 6357$.each(sortPriority, function (index, groupName) { 6358if (typeof data[groupName] === 'undefined') { 6359return; 6360} 6361$.each(data[groupName], function (key, item) { 6362if (item.category !== 'no_results' && item.category !== 'suggestions') { 6363if (item.name.toLowerCase() === keyword) { 6364results[groupName] = data[groupName]; 6365delete data[groupName]; 6366return false; 6367} 6368} 6369}); 6370}); 6371$.each(sortPriority, function (index, groupName) { 6372if (typeof data[groupName] === 'undefined') { 6373return; 6374} 6375$.each(data[groupName], function (key, item) { 6376if (item.category !== 'no_results' && item.category !== 'suggestions') { 6377if (item.name.toLowerCase().indexOf(keyword) !== -1) { 6378results[groupName] = data[groupName]; 6379delete data[groupName]; 6380return false; 6381} 6382} 6383}); 6384}); 6385return $.extend(results, data); 6386}, 6387getResultsRows = function (data, doNotGroup) { 6388data = doNotGroup ? data : resortAutocompleteGroups(data); 6389var results = []; 6390$.each(data, function (index, items) { 6391$.each(items, function (key, item) { 6392if (item.category !== 'no_results' && item.category !== 'suggestions') { 6393results.push({ 6394label: item['name'], 6395value: index === 'keyword' ? item['sort_string'] : item['name'], 6396category: item['category'], 6397classIdentifier: item['class_identifier'], 6398objectID: item['object_id'], 6399url: item['url'], 6400code: item['hotel_code'], 6401brand_code: item['brand_code'], 6402dc_city: typeof item['cityBookNode'] !== 'undefined', 6403dc_result: typeof item['cityBookNode'] !== 'undefined' || typeof item['dcHotelCode'] !== 'undefined', 6404dc_hotel_code: typeof item['dcHotelCode'] !== 'undefined' ? item['dcHotelCode'] : item['cityBookNode'], 6405do_availability: typeof item['doAvailability'] !== 'undefined' ? item['doAvailability'] : item['doAvailability'], 6406date_format: typeof item['dateFormat'] !== 'undefined' ? item['dateFormat'] : item['dateFormat'], 6407}); 6408} 6409}); 6410}); 6411return results; 6412}, 6413getNoResultsRows = function (data) { 6414var results = [{ 6415label: data['no_results'][0]['text'], 6416value: -1, 6417category: data['no_results'][0]['category'] 6418}]; 6419if (data['suggestions'][0]['values'].length > 0) { 6420results.push({ 6421label: data['suggestions'][0]['text'] + '<b>' + data['suggestions'][0]['values'][0] + '</b>?', 6422value: data['suggestions'][0]['values'][0], 6423category: data['suggestions'][0]['category'] 6424}); 6425} 6426return results; 6427}; 6428_attachAutocomplete = function (container) { 6429$.each($(searchInput, container), function (index, el) { 6430$(el).catcomplete({ 6431source: function (request, response) { 6432$(input_loader).show(); 6433clearAutocompleteFields(el); 6434var curKeyword = $(el).val(); 6435if (!curKeyword && noKeywordResult) { 6436response(noKeywordResult); 6437$(input_loader).hide(); 6438return; 6439} 6440$.ajax({ 6441type: 'GET', 6442url: scriptURL+'/'+curKeyword, 6443dataType: 'json', 6444error: function (xhr) { 6445console.log(xhr); 6446$(input_loader).hide(); 6447}, 6448success: function (data) { 6449$(input_loader).hide(); 6450if (!data['no_results'][0]['status']) { 6451var suggestOnly = $(el).data('suggest-only'); 6452if (suggestOnly) { 6453var filteredData = data[suggestOnly]; 6454data = {}; 6455data[suggestOnly] = filteredData; 6456filteredData = null; 6457} 6458var result = getResultsRows(data, !curKeyword); 6459if (!curKeyword) { 6460noKeywordResult = result; 6461} 6462response(result); 6463} else { 6464response(getNoResultsRows(data)); 6465} 6466} 6467}); 6468}, 6469change: function () { 6470if ($(el).val() == '') { 6471clearAutocompleteFields(el); 6472} 6473}, 6474select: function (event, ui) { 6475var form = $(el).parents('form'); 6476form.removeClass('js-submit-triggered'); 6477if (ui.item['category'] === 'suggestions') { 6478if ($(acSearchKeyword, form).length > 0) { 6479$(acSearchKeyword, form).val(ui.item['value']); 6480$(el).focus(); 6481$(searchInput, form).parent().addClass("search"); 6482setTimeout(function() { 6483$(searchInput, form).catcomplete( "search", $(acSearchKeyword, form).val() ); 6484}, 100); 6485} 6486} else { 6487if (ui.item['value'] == -1) { 6488$(acLabel, form).show(); 6489$(el, form).val(''); 6490return false;
6491} else if (ui.item['category'] == 'keyword') { 6492if ($(acSearchKeyword, form).length > 0) { 6493$(acSearchKeyword, form).val( ui.item['objectID']); 6494} 6495form.trigger('submit').addClass('js-submit-triggered'); 6496} else { 6497$.tigDatepicker.checkAvailability(); 6498if ($(searchInput, form).length > 0) { 6499$(searchInput, form).val( ui.item['value']); 6500} 6501if ($(acClassIdent, form).length > 0) { 6502$(acClassIdent, form).val(ui.item['classIdentifier']); 6503} 6504if ($(acObjectID, form).length > 0) { 6505$(acObjectID, form).val(ui.item['objectID']); 6506} 6507if ($(acHotelCode, form).length > 0) { 6508$(acHotelCode, form).val(ui.item['code']); 6509} 6510if ($(acHotelURL, form).length > 0) { 6511$(acHotelURL, form).val(ui.item['url']); 6512} 6513if ($(acHotelLink, form).length > 0) { 6514$(acHotelLink, form).attr('href', ui.item['url']); 6515} 6516if ($(acBrandCode, form).length > 0) { 6517$(acBrandCode, form).val(ui.item['brand_code']); 6518} 6519if ($(acSearchKeyword, form).length > 0) { 6520$(acSearchKeyword, form).val( ui.item['value']); 6521} 6522if (ui.item['dc_result']) { 6523if ($(isDCResult, form).length > 0) { 6524$(isDCResult, form).val(ui.item['dc_result']); 6525} 6526if ($(dcHotelCode, form).length > 0) { 6527$(dcHotelCode, form).val(ui.item['dc_hotel_code']); 6528} 6529if ($(doAvailabilityInput, form).length > 0) { 6530$(doAvailabilityInput, form).val(ui.item['do_availability']); 6531} 6532if ($(hotelDateFormat, form).length > 0) { 6533$(hotelDateFormat, form).val(ui.item['date_format']); 6534} 6535} else { 6536if ($(isDCResult, form).length > 0) { 6537$(isDCResult, form).val(false); 6538} 6539if ($(dcHotelCode, form).length > 0) { 6540$(dcHotelCode, form).val(''); 6541} 6542} 6543if ($(ipreferBookButton, form).length > 0 && $(dcHotelCode, form).length > 0 && $(dcHotelCode, form).val() === 'DUPONT') { 6544$(ipreferBookButton, form).removeClass('u-isHidden'); 6545if ($(bookButton, form).length > 0) { 6546$(bookButton, form).html('DISCOVERY MEMBERS, BOOK HERE'); 6547} 6548} else { 6549$(ipreferBookButton, form).addClass('u-isHidden'); 6550if ($(bookButton, form).length > 0) { 6551$(bookButton, form).html('FIND A ROOM'); 6552} 6553} 6554$(el).trigger('change'); 6555$(el).trigger('blur'); 6556} 6557} 6558autocompleteJustSelected = true; 6559setTimeout(function() { autocompleteJustSelected = false; }, 100); 6560}, 6561open: function () { 6562$(this).removeClass("ui-corner-all").addClass("ui-corner-top"); 6563}, 6564close: function () { 6565$(this).removeClass("ui-corner-top").addClass("ui-corner-all"); 6566}, 6567delay: 200, 6568minLength: 0, 6569appendTo: $(el).data('append-to') ? $($(el).data('append-to')) : null, 6570classes: { 6571"ui-autocomplete": $(el).data('ac-class') 6572} 6573}); 6574}); 6575}; 6576_attachAutocomplete($('body')); 6577$(searchInput).on('keydown', function (e) { 6578if (e.keyCode === 13 || e.keyCode === 108) { 6579autocompleteForm.hasClass('js-submit-triggered') && e.preventDefault(); 6580} 6581}); 6582$(searchInput).on('focus', function () { 6583}); 6584$(searchInput).on('click', function () { 6585$(this).attr("placeholder", $(this).data("placeholder-mod")); 6586$(searchInput).val(""); 6587if ($(this).val() != "") { 6588$(this).parent().addClass("edit"); 6589} else { 6590$(this).parent().addClass("is-open"); 6591} 6592$(this).catcomplete( "search", $(this).val() ); 6593}); 6594$(searchInput).on('keydown', function (e) { 6595if (e.keyCode === 13) { 6596var isOpen = $(this).catcomplete("widget").is(":visible"); 6597if (!isOpen && !autocompleteJustSelected) { 6598e.preventDefault(); 6599$(this).val(""); 6600$(this).catcomplete( "search", $(this).val() ); 6601} 6602} 6603}); 6604$(searchInput).on('blur', function () { 6605$(this).attr("placeholder", $(this).data("placeholder-orig")); 6606if ($(this).val() != "") { 6607$(this).parent().addClass("search"); 6608} else { 6609$(this).parent().removeClass("search"); 6610} 6611$(this).parent().removeClass("edit").removeClass("is-open"); 6612}); 6613$(searchInput).on('keypress paste', function (e) { 6614if ($(this).val() != "") { 6615$(this).parent().removeClass("edit").removeClass("search"); 6616} 6617$(this).parent().addClass("edit").addClass("search"); 6618}); 6619$(searchInput).on('keydown', function (e) { 6620if ($(this).val() == "") { 6621$(this).parent().removeClass("edit").removeClass("search"); 6622} 6623}); 6624$(searchInput).on('change', function (e) { 6625if ($(this).val() == "") { 6626$(this).parent().removeClass("edit").removeClass("search"); 6627} else { 6628$(this).parent().addClass("search"); 6629} 6630}); 6631$(clearButton).on('click', function () { 6632$(searchInput).val(""); 6633$(searchInput).parent().removeClass("edit").removeClass("search"); 6634return false;
6635}); 6636}); 6637luana.factory('datepicker').defineElements({ 6638dateFormat: '[data-date-format]', 6639altFormat: '[data-date-alt-format]', 6640unavailableDates: '[name="closeout_dates"]' 6641}).controller(function (view) { 6642return { 6643eachScope: function (scope) { 6644var el = $(scope.root).children('.datepicker'); 6645el.datepicker({ 6646altField: $(scope.root).children('.datepicker-alt'), 6647dateFormat: $(scope.root).attr('data-date-format'), 6648altFormat: $(scope.root).attr('data-date-alt-format'), 6649beforeShowDay: function (date) { 6650var unavailableDates = scope.elements.unavailableDates.length ? scope.elements.unavailableDates.val().split(',') : []; 6651var dateStr = $.datepicker.formatDate( 6652$(scope.root).attr('data-date-alt-format'), new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0) 6653); 6654var isAvailable = $.inArray(dateStr, unavailableDates) == -1; 6655return [isAvailable, '']; 6656} 6657}); 6658if ($(scope.root).attr('data-max-date')) { 6659el.datepicker('option', 'maxDate', $(scope.root).data('max-date')); 6660} 6661if ($(scope.root).attr('data-min-date')) { 6662el.datepicker('option', 'minDate', $(scope.root).data('min-date')); 6663} 6664} 6665} 6666}); 6667luana.factory('datepicker-inline').defineElements({ 6668altDate: '[datepicker-inline-alt-date]', 6669date: '[datepicker-inline-date]', 6670calendar: '[datepicker-inline-calendar]', 6671unavailableDates: '[datepicker-inline-clouseout-dates]' 6672}).describeScope({ 6673visible: false 6674}).controller(function (view) { 6675return { 6676eachScope: function (scope) { 6677var altFormat = $(scope.root).data('date-alt-format'); 6678$(scope.elements.calendar).datepicker({ 6679altField: scope.elements.altDate, 6680dateFormat: $(scope.root).data('date-format'), 6681altFormat: altFormat, 6682beforeShowDay: function (date) { 6683var unavailableDates = scope.elements.unavailableDates.length ? scope.elements.unavailableDates.val().split(',') : []; 6684var dateStr = $.datepicker.formatDate( 6685altFormat, new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0) 6686); 6687var isAvailable = $.inArray(dateStr, unavailableDates) == -1; 6688return [isAvailable, '']; 6689}, 6690onSelect: function (date, inst) { 6691var dateStr = inst.currentYear + '-' 6692+ ('0' + (inst.currentMonth + 1)).slice(-2) + '-' 6693+ ('0' + inst.currentDay).slice(-2); 6694var dateObj = new Date(dateStr); 6695dateObj = new Date(dateObj.getUTCFullYear(), dateObj.getUTCMonth(), dateObj.getUTCDate(), 0, 0, 0); 6696$(scope.elements.altDate).val(altFormat ? $.datepicker.formatDate(altFormat, dateObj) : dateStr); 6697$(scope.elements.date).val(date); 6698view.hide(scope); 6699$(scope.elements.date).trigger('change'); 6700} 6701}); 6702if ($(scope.elements.date).attr('data-date')) { 6703var date = $(scope.elements.date).data('date'); 6704if (date !== '') { 6705var dateObj = new Date(date); 6706date = $.datepicker.formatDate( 6707$(scope.root).data('date-format'), 6708new Date(dateObj.getUTCFullYear(), dateObj.getUTCMonth(), dateObj.getUTCDate(), 0, 0, 0) 6709); 6710$(scope.elements.calendar).datepicker("setDate", date); 6711$(scope.elements.date).val(date); 6712} 6713} else { 6714$(scope.elements.calendar).datepicker('setDate', null); // reset default date presel 6715} 6716if ($(scope.root).attr('data-max-date')) { 6717$(scope.elements.calendar).datepicker('option', 'maxDate', $(scope.root).data('max-date')); 6718} 6719if ($(scope.root).attr('data-min-date')) { 6720$(scope.elements.calendar).datepicker('option', 'minDate', $(scope.root).data('min-date')); 6721} 6722$(scope.elements.calendar).datepicker('option', 'firstDay', 1); 6723}, 6724align: function (scope) { 6725var top = $(scope.root).offset().top - $(document).scrollTop(); 6726if ($(window).height() - top < $(scope.elements.calendar).outerHeight(true)) { 6727view.up(scope, true); 6728} else { 6729view.up(scope, false); 6730} 6731}, 6732clickDocument: function (element, event) { 6733var scope = this.__getState(); 6734if (scope) { 6735if (!this.__getScopeByElement(event.target) && !$(event.target).hasClass('ui-datepicker-next') && !$(event.target).hasClass('ui-datepicker-prev')) { 6736if (!this.__getScopeByElement(event.target) && !$(event.target).hasClass('ui-icon-circle-triangle-w') && !$(event.target).hasClass('ui-icon-circle-triangle-e')) { 6737view.hide(this.__getState()); 6738$( scope.elements.date ).blur(); 6739} 6740} 6741} 6742}, 6743show: function (scope) { 6744if (this.__getState() !== false && this.__getState().visible) { 6745view.hide(this.__getState()); 6746} 6747this.align(scope); 6748view.show(scope); 6749}, 6750tapDocument: function (element, event) { 6751this.clickDocument(element, event); 6752} 6753} 6754}).attachEvents(function (scope) { 6755return { 6756show: ['click', scope.elements.date] 6757} 6758}).attachGlobalEvents(function (scope) { 6759return { 6760clickDocument: ['click', document], 6761tapDocument: ['tap', document] 6762} 6763}).view(function () { 6764return { 6765show: function (scope) { 6766$(scope.elements.date).addClass('is-active'); 6767$(scope.root).addClass('is-open'); 6768$(scope.elements.calendar).show(0); 6769scope.visible = true; 6770this.__setState(scope); 6771}, 6772hide: function (scope) { 6773$(scope.elements.date).removeClass('is-active'); 6774$(scope.root).removeClass('is-open'); 6775$(scope.elements.calendar).hide(0); 6776scope.visible = false;
6777this.__clearState(); 6778}, 6779up: function (scope, isUp) { 6780if (isUp) { 6781$(scope.root).addClass('is-up'); 6782} else { 6783$(scope.root).removeClass('is-up'); 6784} 6785}, 6786} 6787}); 6788luana.factory( 'select').faces( ['update'] ) 6789.defineElements( { 6790presenter: '[select-value]', 6791select: '[select-hidden]' 6792} ).describeScope( { 6793visible: false 6794} ).controller( function( view ){ 6795return { 6796eachScope: function( scope ){ 6797view.update( scope, this.getText( scope ) ); 6798}, 6799getText: function( scope ) { 6800return $( scope.elements.select ).find( ':selected').text(); 6801}, 6802change: function( scope ) { 6803view.update( scope, this.getText( scope ) ); 6804}, 6805update: function(){ 6806this.__throughScopes( function( index, scope ){ 6807this.change( scope ); 6808}.bind( this ) ); 6809} 6810}; 6811} ).attachEvents( function( scope ){ 6812return { 6813change: ['change', scope.elements.select] 6814}; 6815}).view( function(){ 6816return { 6817update: function( scope, text ){ 6818$( scope.elements.presenter ).text( text ); 6819} 6820}; 6821} ); 6822luana.factory( 'string-gallery' ).defineElements( { 6823line: '.l-gallery-line', 6824items: '.l-gallery-item', 6825next: '.l-gallery-next', 6826prev: '.l-gallery-prev' 6827} ).describeScope( { 6828current: 0, 6829count: 0, 6830isAnimating: false, 6831left: 0, 6832step: 20, 6833width: 0 6834} ).controller( function( view ){ 6835return { 6836eachScope: function( scope ){ 6837scope.step = typeof $( scope.root ).attr( 'data-step' ) === 'undefined' ? 6838scope.step : parseInt( $( scope.root ).attr( 'data-step' ) ); 6839scope.count = scope.elements.items.length; 6840scope.width = scope.count * scope.step; 6841if( scope.left + scope.step > 0 ){ 6842$( scope.elements.prev ).hide(); 6843} 6844if( Math.abs( scope.left - scope.step - 100 ) > scope.width ){ 6845$( scope.elements.next ).hide(); 6846} 6847}, 6848move: function( scope, direction ){ 6849if( !scope.isAnimating ) { 6850if ( direction < 0 ) { 6851if ( scope.left + scope.step <= 0 ) { 6852$( scope.elements.next ).show(); 6853if ( scope.left + scope.step == 0 ) { $( scope.elements.prev ).hide(); } 6854scope.left += scope.step; 6855} else { 6856scope.left = 0; 6857} 6858}else{ 6859if ( Math.abs( scope.left - scope.step - 100 ) <= scope.width ) { 6860$( scope.elements.prev ).show(); 6861if ( Math.abs( scope.left - scope.step - 100 ) == scope.width ) { $( scope.elements.next ).hide(); } 6862scope.left -= scope.step; 6863}else{ 6864scope.left = -( scope.width - 100 ); 6865} 6866} 6867view.update( scope, scope.left + '%', false ); 6868} 6869}, 6870clickNext: function( scope ){ 6871this.move( scope, 1 ); 6872}, 6873clickPrev: function( scope ){ 6874this.move( scope, -1 ); 6875} 6876} 6877} ).attachEvents( function( scope ){ 6878return { 6879clickNext: ['click', scope.elements.next, true], 6880clickPrev: ['click', scope.elements.prev, true] 6881} 6882} ).view( function(){ 6883return { 6884update: function( scope, left, withoutAnimation ){ 6885if( !withoutAnimation ){ 6886scope.isAnimating = true; 6887scope.elements.line.animate( { left: left }, 400, function(){ 6888scope.isAnimating = false; 6889} ); 6890}else{ 6891scope.elements.line.css( { left: left } ); 6892} 6893} 6894} 6895} ); 6896luana.factory( 'status-progress' ).describeScope( { 6897perc: 0, 6898percCurrent: 0, 6899percLastChange: 0, 6900value: 0, 6901maxValue: 40, 6902valueProgress: 0, 6903step: 0 6904} ).defineElements( { 6905line: '.l-status-progress-line', 6906label: '.l-status-progress-label', 6907value: '.l-status-progress-value' 6908} ).controller( function( view ){ 6909return { 6910initialize: function(){ 6911this.__setInterval( this.update.bind( this ), 40 ); 6912}, 6913eachScope: function( scope ){ 6914scope.perc = typeof $( scope.root ).attr( 'data-percentage' ) === 'undefined' ? 69150 : $( scope.root ).attr( 'data-percentage' ); 6916scope.value = typeof $( scope.root ).attr( 'data-value' ) === 'undefined' ? 69170 : $( scope.root ).attr( 'data-value' ); 6918scope.maxValue = typeof $( scope.root ).attr( 'data-max-value' ) === 'undefined' ? 6919scope.maxValue : $( scope.root ).attr( 'data-max-value' ); 6920scope.step = 100/scope.maxValue; 6921this.prepare( scope ); 6922}, 6923prepare: function( scope ){ 6924this.prepareLabel( scope ); 6925view.updateBar( scope, scope.percCurrent ); 6926view.show( scope.elements.line ); 6927}, 6928finish: function( scope ){ 6929view.updateBar( scope, scope.perc ); 6930if ( scope.percCurrent == 100 ) { $( scope.root ).addClass( 'is-full' ); } 6931if ( scope.valueProgress < scope.value ) { 6932this.__setInterval( this.updateValue.bind( this ), 40 ); 6933}else{ 6934view.updateValue( scope, scope.value ); 6935} 6936}, 6937prepareLabel: function( scope ){ 6938var labelWidth = 0;
6939view.updateValue( scope, scope.value ); 6940$( scope.root ).removeClass('is-full'); 6941labelWidth = $( scope.elements.label ).outerWidth(); 6942$( scope.elements.label).css({ 6943'width' : labelWidth + 'px', 6944'margin-left' : -( labelWidth/2 ) + 'px' 6945}); 6946view.updateValue( scope, scope.valueProgress ); 6947view.updateLabel( scope, scope.percCurrent ); 6948view.show( scope.elements.label ); 6949}, 6950update: function(){ 6951this.__throughScopes( function( index, scope ){ 6952if ( scope.percCurrent < scope.perc && scope.perc != 0) { 6953this.doProgress( scope ) 6954}else{ 6955this.__clearInterval(); 6956this.finish( scope ); 6957} 6958}.bind( this ) ); 6959}, 6960updateValue: function(){ 6961this.__throughScopes( function( index, scope ){ 6962if ( scope.valueProgress < scope.value ) { 6963scope.valueProgress += 1; 6964view.updateValue( scope, scope.valueProgress ); 6965}else{ 6966this.__clearInterval(); 6967} 6968}.bind( this ) ); 6969}, 6970doProgress: function( scope ) { 6971scope.percCurrent = scope.percCurrent + 0.5 > scope.perc ? scope.perc : scope.percCurrent + 0.5; 6972if ( scope.percCurrent - scope.percLastChange >= scope.step && scope.valueProgress < scope.maxValue ) { 6973scope.valueProgress += 1; 6974scope.percLastChange += scope.step; 6975view.updateValue( scope, scope.valueProgress ); 6976} 6977view.updateBar( scope, scope.percCurrent ); 6978view.updateLabel( scope, scope.percCurrent ); 6979} 6980}; 6981} ).view( function(){ 6982return { 6983updateBar: function( scope, value ){ 6984$( scope.elements.line ).width( value + '%' ); 6985}, 6986updateLabel : function( scope, value ){ 6987$( scope.elements.label ).css( { 'left' : value + '%' }); 6988}, 6989updateValue: function( scope, value ){ 6990$( scope.elements.value ).text( value ); 6991}, 6992show: function( element ){ 6993$( element ).css({'visibility' : 'visible'}); 6994}, 6995hide: function( element ){ 6996$( element ).css({'visibility' : 'hidden'}); 6997} 6998} 6999} ); 7000luana.factory( 'gha-tabs' ).describeScope( { 7001current: 0, 7002activeClass:'is-active', 7003hideOnStart: false, 7004activeLink: 'active-tab-link', 7005useExternalTabsSwitcher: false, // in case when active tab changed by another script 7006useHeightForToggle: false 7007} ).defineElements( { 7008link: '[tab-link]', 7009content: '[tab-content]', 7010close: '[tab-close]', 7011holder: '[tab-holder]' 7012} ).controller( function( view ){ 7013return { 7014eachScope: function( scope ){ 7015scope.useExternalTabsSwitcher = typeof $( scope.root ).attr('data-external-tab-switcher') !== 'undefined'; 7016scope.useHeightForToggle = typeof $( scope.root ).attr('data-use-height-for-toggle') !== 'undefined'; 7017scope.hideOnStart = $( scope.root ).attr( 'data-hidden' ) == 'true'; 7018this.setCurrent( scope ); 7019this.prepare( scope ); 7020}, 7021prepare: function( scope ){ 7022view.hideContent( scope ); 7023view.hideHolder( scope ); 7024if ( scope.hideOnStart == false ) { 7025this.show( scope, scope.current ); 7026} 7027}, 7028show: function( scope, index ){ 7029view.showHolder( scope ); 7030view.hide( scope, scope.current ); 7031view.show( scope, index ); 7032scope.current = index; 7033}, 7034click: function( scope, element ){ 7035var index = scope.elements.link.index( element ); 7036if ( scope.useExternalTabsSwitcher ) { 7037this.setCurrent( scope ); 7038} 7039this.show( scope, index ); 7040}, 7041close: function( scope ) { 7042view.hideHolder( scope ); 7043}, 7044setCurrent: function( scope ) { 7045$.each( scope.elements.link, 7046function( key, link ){ 7047if ( $( link ).attr( 'tab-link' ) === scope.activeLink || $( link ).hasClass( scope.activeClass ) ) { 7048scope.current = key; 7049} 7050} 7051); 7052} 7053}; 7054} ).attachEvents( function( scope ){ 7055return { 7056click: ['click', scope.elements.link, $(scope.elements.link).length !== $(scope.elements.link).filter('input').length], 7057close: ['click', scope.elements.close, true] 7058}; 7059} ).view( function(){ 7060return { 7061show: function( scope, index ){ 7062$( scope.elements.link[index] ).addClass( scope.activeClass ); 7063scope.useHeightForToggle ? $( scope.elements.content[index] ).css({ 'height' : 'auto', 'overflow' : 'visible' }) : $( scope.elements.content[index] ).show(); 7064}, 7065hide: function( scope, index ){ 7066$( scope.elements.link[index] ).removeClass( scope.activeClass ); 7067scope.useHeightForToggle ? $( scope.elements.content[index] ).css({ 'height' : 0, 'overflow' : 'hidden' }) : $( scope.elements.content[index] ).hide(); 7068}, 7069hideContent: function( scope ){ 7070scope.useHeightForToggle ? $( scope.elements.content ).css({ 'height' : 0, 'overflow' : 'hidden' }) : $( scope.elements.content ).hide(); 7071}, 7072hideHolder: function( scope ){ 7073$( scope.elements.link ).removeClass( scope.activeClass ); 7074$( scope.elements.holder ).hide(); 7075}, 7076showHolder: function( scope ){ 7077$( scope.elements.holder ).show(); 7078} 7079} 7080} ); 7081luana.factory( 'select-all' ).defineElements( { 7082trigger: '[select-all-trigger]', 7083checkboxes: 'input[type="checkbox"]' 7084} ).controller( function(){ 7085return { 7086update: function( scope ){ 7087if ( scope.elements.trigger.prop("checked") ) { 7088$( scope.elements.checkboxes ).prop( "checked", true ); 7089}else{ 7090$( scope.elements.checkboxes ).prop( "checked", false ); 7091} 7092} 7093}; 7094} ).attachEvents( function( scope ){ 7095return { 7096update: ['change', scope.elements.trigger, true] 7097}; 7098} ); 7099luana.factory('video-popup') 7100.defineElements({ 7101overlay: '[video-overlay]', 7102popup: '[video-popup]', 7103closeButton: '[video-close]',
7104iframeWrapper: '[iframe-wrapper]', 7105parrentWrapper: '[parrent-wrapper]', 7106popupIframeContainer: '[iframe-container]', 7107player: '' 7108}) 7109.describeScope({ 7110openClass: 'is-open', 7111autoplay: false 7112}) 7113.controller(function (view) { 7114return { 7115initialize: function(){ 7116this.__throughScopes( function( index, scope ){ 7117scope.elements.player = new Vimeo.Player($(scope.elements.iframeWrapper).find('iframe:visible')); 7118$(scope.elements.iframeWrapper).find('iframe:not(:visible)').remove(); 7119if (scope.elements.player.element.src.indexOf('autoplay=1') !== -1) { 7120scope.elements.player.element.src = scope.elements.player.element.src.replace('autoplay=1', 'autoplay=0'); 7121scope.autoplay = true; 7122} 7123scope.elements.player.on('play', function() { 7124scope.elements.player.unload(); 7125}); 7126scope.elements.player.unload(); 7127} ); 7128}, 7129clickOverlay: function (scope) { 7130view.show(scope); 7131}, 7132clickCloseButton: function (scope) { 7133view.hide(scope); 7134} 7135}; 7136}) 7137.attachEvents(function (scope) { 7138return { 7139clickOverlay: ['click', scope.elements.overlay, false], 7140clickCloseButton: ['click', scope.elements.closeButton, false] 7141}; 7142}) 7143.view(function () { 7144return { 7145show: function (scope) { 7146$(scope.elements.iframeWrapper).appendTo($(scope.elements.popupIframeContainer)); 7147if (scope.autoplay) { 7148scope.elements.player.element.src = scope.elements.player.element.src.replace('autoplay=0', 'autoplay=1'); 7149} 7150$(scope.elements.popup).show().addClass(scope.openClass); 7151$(scope.root).addClass(scope.openClass); 7152}, 7153hide: function (scope) { 7154$(scope.elements.iframeWrapper).appendTo($(scope.elements.parrentWrapper)); 7155if (scope.autoplay) { 7156scope.elements.player.element.src = scope.elements.player.element.src.replace('autoplay=1', 'autoplay=0'); 7157} 7158setTimeout(function () { 7159scope.elements.player.unload(); 7160}, 1000); 7161$(scope.elements.popup).hide().removeClass(scope.openClass); 7162$(scope.root).removeClass(scope.openClass); 7163} 7164} 7165}); 7166$( document ).ready(function() { 7167var isMobile = typeof window.matchMedia === 'function' && window.matchMedia("only screen and (max-width: 1023px)").matches; 7168if (isMobile) { 7169$('[iframe-wrapper]').each(function() { 7170var attr = $(this).attr('mobile-muted'); 7171var iframe = $( this ).find('iframe'); 7172if (iframe.length && typeof attr !== typeof undefined && attr !== false) { 7173var src = iframe.attr('src'); 7174iframe.attr('src', src.replace('muted=' + (attr == 1 ? '0' : '1'), 'muted=' + attr)); 7175} 7176}); 7177} 7178}); 7179luana.factory('validate-form') 7180.describeScope({ 7181errorList: '', 7182phoneRegExpList: { 7183"001": [ 388, 800, 808, 870, 871, 872, 873, 874, 878, 881, 882, 883, 888, 979, 991 ], 7184"AC": [ 247 ], "AD": [ 376 ], "AE": [ 971 ], "AF": [ 93 ], "AG": [ 1 ], "AI": [ 1 ], "AL": [ 355 ], "AM": [ 374 ], "AN": [ 599 ], "AO": [ 244 ], "AQ": [ 672 ], "AR": [ 54 ], "AS": [ 1 ], "AT": [ 43 ], "AU": [ 61 ], "AW": [ 297 ], "AX": [ 358 ], "AZ": [ 994 ], 7185"BA": [ 387 ], "BB": [ 1 ], "BD": [ 880 ], "BE": [ 32 ], "BF": [ 226 ], "BG": [ 359 ], "BH": [ 973 ], "BI": [ 257 ], "BJ": [ 229 ], "BL": [ 590 ], "BM": [ 1 ], "BN": [ 673 ], "BO": [ 591 ], "BR": [ 55 ], "BS": [ 1 ], "BT": [ 975 ], "BW": [ 267 ], "BY": [ 375 ], "BZ": [ 501 ], 7186"CA": [ 1 ], "CC": [ 61 ], "CD": [ 243 ], "CF": [ 236 ], "CG": [ 242 ], "CH": [ 41 ], "CI": [ 225 ], "CK": [ 682 ], "CL": [ 56 ], "CM": [ 237 ], "CN": [ 86 ], "CO": [ 57 ], "CR": [ 506 ], "CU": [ 53 ], "CV": [ 238 ], "CX": [ 61 ], "CY": [ 357 ], "CZ": [ 420 ], 7187"DE": [ 49 ], "DJ": [ 253 ], "DK": [ 45 ], "DM": [ 1 ], "DO": [ 1 ], "DZ": [ 213 ], 7188"EC": [ 593 ], "EE": [ 372 ], "EG": [ 20 ], "ER": [ 291 ], "ES": [ 34 ], "ET": [ 251 ], 7189"FI": [ 358 ], "FJ": [ 679 ], "FK": [ 500 ], "FM": [ 691 ], "FO": [ 298 ], "FR": [ 33 ], 7190"GA": [ 241 ], "UK": [ 44 ], "GB": [ 44 ], "GD": [ 1 ], "GE": [ 995 ], "GF": [ 594 ], "GG": [ 44 ], "GH": [ 233 ], "GI": [ 350 ], "GL": [ 299 ], "GM": [ 220 ], "GN": [ 224 ], "GP": [ 590 ], "GQ": [ 240 ], "GR": [ 30 ], "GT": [ 502 ], "GU": [ 1 ], "GW": [ 245 ], "GY": [ 592 ], 7191"HK": [ 852 ], "HN": [ 504 ], "HR": [ 385 ], "HT": [ 509 ], "HU": [ 36 ], 7192"ID": [ 62 ], "IE": [ 353 ], "IL": [ 972 ], "IM": [ 44 ], "IN": [ 91 ], "IO": [ 246 ], "IQ": [ 964 ], "IR": [ 98 ], "IS": [ 354 ], "IT": [ 39 ], 7193"JE": [ 44 ], "JM": [ 1 ], "JO": [ 962 ], "JP": [ 81 ], 7194"KE": [ 254 ], "KG": [ 996 ], "KH": [ 855 ], "KI": [ 686 ], "KM": [ 269 ], "KN": [ 1 ], "KP": [ 850 ], "KR": [ 82 ], "KW": [ 965 ], "KY": [ 1 ], "KZ": [ 7 ], 7195"LA": [ 856 ], "LB": [ 961 ], "LC": [ 1 ], "LI": [ 423 ], "LK": [ 94 ], "LR": [ 231 ], "LS": [ 266 ], "LT": [ 370 ], "LU": [ 352 ], "LV": [ 371 ], "LY": [ 218 ], 7196"MA": [ 212 ], "MC": [ 377 ], "MD": [ 373 ], "ME": [ 382 ], "MG": [ 261 ], "MH": [ 692 ], "MK": [ 389 ], "ML": [ 223 ], "MM": [ 95 ], "MN": [ 976 ], "MO": [ 853 ], "MP": [ 1 ], "MQ": [ 596 ], "MR": [ 222 ], "MS": [ 1 ], "MT": [ 356 ], "MU": [ 230 ], "MV": [ 960 ], "MW": [ 265 ], "MX": [ 52 ], "MY": [ 60 ], "MZ": [ 258 ], 7197"NA": [ 264 ], "NC": [ 687 ], "NE": [ 227 ], "NF": [ 672 ], "NG": [ 234 ], "NI": [ 505 ], "NL": [ 31 ], "NO": [ 47 ], "NP": [ 977 ], "NR": [ 674 ], "NU": [ 683 ], "NZ": [ 64 ], 7198"OM": [ 968 ], 7199"PA": [ 507 ], "PE": [ 51 ], "PF": [ 689 ], "PG": [ 675 ], "PH": [ 63 ], "PK": [ 92 ], "PL": [ 48 ], "PM": [ 508 ], "PR": [ 1 ], "PS": [ 972, 970 ], "PT": [ 351 ], "PW": [ 680 ], "PY": [ 595 ], 7200"QA": [ 974 ], 7201"RE": [ 262 ], "RO": [ 40 ], "RS": [ 381 ], "RU": [ 7 ], "RW": [ 250 ], 7202"SA": [ 966 ], "SB": [ 677 ], "SC": [ 248 ], "SD": [ 249 ], "SE": [ 46 ], "SG": [ 65 ], "SH": [ 290 ], "SI": [ 386 ], "SJ": [ 47 ], "SK": [ 421 ], "SL": [ 232 ], "SM": [ 378 ], "SN": [ 221 ], "SO": [ 252 ], "SR": [ 597 ], "SS": [ 211 ], "ST": [ 239 ], "SV": [ 503 ], "SY": [ 963 ], "SZ": [ 268 ], 7203"TC": [ 1 ], "TD": [ 235 ], "TF": [ 262 ], "TG": [ 228 ], "TH": [ 66 ], "TJ": [ 992 ], "TK": [ 690 ], "TL": [ 670 ], "TM": [ 993 ], "TN": [ 216 ], "TO": [ 676 ], "TR": [ 90 ], "TT": [ 1 ], "TV": [ 688 ], "TW": [ 886 ], "TZ": [ 255 ], 7204"UA": [ 380 ], "UG": [ 256 ], "US": [ 1 ], "UY": [ 598 ], "UZ": [ 998 ], 7205"VA": [ 39 ], "VC": [ 1 ], "VE": [ 58 ], "VG": [ 1 ], "VI": [ 1 ], "VN": [ 84 ], "VU": [ 678 ], 7206"WF": [ 681 ], "WS": [ 685 ], 7207"YE": [ 967 ], "YT": [ 262 ], 7208"ZA": [ 27 ], "ZM": [ 260 ], "ZW": [ 263 ] 7209} 7210}) 7211.defineElements({ 7212submitButton: '.luana-submit-button', 7213inputField: '.req-input', 7214inputSelect: '.req-select', 7215inputBox: '.req-box', 7216inputEmail: '.req-email', 7217inputEmailConfirm: '.req-email-confirm', 7218inputRadio: '.req-radio', 7219inputPass: '.req-pass', 7220inputPassConfirm: '.req-pass-confirm', 7221inputPhoneCode: '.req-phone-code', 7222inputPhoneNumber: '.req-phone', 7223inputCountry: '.req-country', 7224numbers: '.req-num', 7225inputState: '.req-state', 7226hiddenState: '.hidden-state', 7227zipInput: '.zip-input', 7228corporateTerms: '[corporate-terms]', 7229loader: '[register-form-loader]', 7230inputText: '.req-text' 7231}, { 7232errorListHolder: '.error-list-holder' 7233}) 7234.controller(function (view) { 7235return { 7236initialize: function(){ 7237this.__throughScopes( function( index, scope ){ 7238scope.errorList = $('<div></div>'); 7239} ); 7240}, 7241submitForm: function (scope, element, event) { 7242if ($(scope.elements.loader)) { 7243$(scope.elements.loader).show(); 7244} 7245if ( this.validate(scope) ) { 7246view.hideErrors(scope); 7247view.submit(scope); 7248} else { 7249view.showErrors(scope); 7250if ($(scope.elements.loader)) { 7251$(scope.elements.loader).hide(); 7252} 7253event.preventDefault(); 7254} 7255}, 7256changeCountry: function (scope) {
7257this.setPhoneIntCode(scope); 7258var stateSelectEl = $('.' + $(scope.elements.inputCountry).val().toLowerCase() + '-states'); 7259if ( stateSelectEl.length === 0 ) { 7260$(scope.elements.inputState).val('').removeClass('req-state'); 7261$(scope.elements.inputState).parent('.hint').length !== 0 ? 7262$(scope.elements.inputState).parent('.hint').parent().children('div.ibe-select').hide() : 7263$(scope.elements.inputState).parent().children('div.ibe-select').hide(); 7264$(scope.elements.inputState).attr('type', 'text'); 7265$(scope.elements.inputState ).val( $(scope.elements.inputState ).data('value') ); 7266} else { 7267$(scope.elements.inputState).parent('.hint').length !== 0 ? 7268$(scope.elements.inputState).parent('.hint').parent().children('div.ibe-select').show() : 7269$(scope.elements.inputState).parent().children('div.ibe-select').show(); 7270$(scope.elements.inputState).attr('type', 'hidden'); 7271stateSelectEl.show().siblings('select').hide(); 7272$(scope.elements.inputState).val(stateSelectEl.find(':selected' ).val()).addClass('req-state'); 7273} 7274}, 7275changeState: function (scope, element) { 7276$(scope.elements.inputState).val($(element).val()); 7277}, 7278fillState: function (scope, element) { 7279$(scope.elements.hiddenState).data('value', $(scope.elements.hiddenState ).val()); 7280}, 7281validateInput: function (scope, element) { 7282var isValid = true; 7283if ( $(element).val() == '' ) { 7284view.addErrorClass(element); 7285scope.errorList.append('<p>' + $(element).data('error-title') + '</p>'); 7286isValid = false; 7287} else { 7288view.removeErrorClass(element); 7289} 7290return isValid; 7291}, 7292validateZIP: function (scope, element) { 7293var isValid = true; 7294if ( $(scope.elements.inputCountry).val() == 'US' || $(scope.elements.inputCountry).val() == 'GB' ) { 7295isValid = true; 7296if ( $(element).val() == '' ) { 7297view.addErrorClass(element); 7298scope.errorList.append('<p>' + $(element).data('error-title') + '</p>'); 7299isValid = false; 7300} else { 7301view.removeErrorClass(element); 7302} 7303} else { 7304view.removeErrorClass(element); 7305} 7306return isValid; 7307}, 7308validateSelect: function (scope, element) { 7309var isValid = true; 7310if ( $(element).val() == '' ) { 7311view.addErrorClass(element); 7312scope.errorList.append('<p>' + $(element).data('error-title') + '</p>'); 7313isValid = false; 7314} else { 7315view.removeErrorClass(element); 7316} 7317return isValid; 7318}, 7319validateBox: function (scope, element) { 7320var isValid = true; 7321if ( $(element).is(':checked') ) { 7322view.removeErrorClass(element); 7323} else { 7324view.addErrorClass(element); 7325isValid = false; 7326} 7327return isValid; 7328}, 7329isValidNumber: function (scope, element) { 7330var isValid = true, 7331pattern = /^[0-9]+$/; 7332if ( !pattern.test($(element).val()) ) { 7333isValid = false; 7334view.addErrorClass(element); 7335} else { 7336view.removeErrorClass(element); 7337} 7338return isValid; 7339}, 7340isValidPhoneCode: function (scope, element) { 7341var isValid = true, 7342pattern = /^[0-9\-\+]+$/, 7343countryCode = $(scope.elements.inputCountry).val(), 7344phoneCode = $(element).val(); 7345if ( !pattern.test($(element).val()) ) { 7346isValid = false; 7347view.addErrorClass(element); 7348} else { 7349view.removeErrorClass(element); 7350} 7351return isValid; 7352}, 7353isValidPhoneNumber: function (scope, element) { 7354var isValid = true, 7355pattern = /^[0-9]{0,20}$/; 7356if ( !pattern.test($(element).val()) ) { 7357isValid = false; 7358view.addErrorClass(element); 7359} else { 7360view.removeErrorClass(element); 7361} 7362return isValid; 7363}, 7364validateEmails: function (scope) { 7365var isValid = true; 7366var pattern = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 7367if ( $( scope.elements.inputEmailConfirm ).length > 0 ) { 7368if ( $(scope.elements.inputEmail).val().length && $(scope.elements.inputEmailConfirm).val().length ) { 7369if ( $(scope.elements.inputEmail).val() !== $(scope.elements.inputEmailConfirm).val() ) { 7370isValid = false; 7371view.addErrorClass(scope.elements.inputEmailConfirm); 7372} else if ( !pattern.test($(scope.elements.inputEmail).val()) ) { 7373isValid = false; 7374view.addErrorClass(scope.elements.inputEmail); 7375} else { 7376view.removeErrorClass(scope.elements.inputEmail); 7377view.removeErrorClass(scope.elements.inputEmailConfirm); 7378} 7379} else { 7380isValid = false; 7381view.addErrorClass(scope.elements.inputEmail); 7382view.addErrorClass(scope.elements.inputEmailConfirm); 7383} 7384} else { 7385if( 7386$( scope.elements.inputEmailConfirm ).val() === '' 7387|| !pattern.test( $( scope.elements.inputEmail ).val() ) 7388) { 7389isValid = false;
7390view.addErrorClass( scope.elements.inputEmail ); 7391} 7392} 7393return isValid; 7394}, 7395validatePass: function (scope, element) { 7396var isValid = true, 7397pattern = /^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[!@#$%^&~*])(?=.{8,})/; 7398if ( !pattern.test($(element).val()) ) { 7399isValid = false; 7400view.addErrorClass(element); 7401view.addErrorClass(scope.elements.inputPassConfirm); 7402if (scope.elements.inputText) { 7403view.addErrorClass(scope.elements.inputText); 7404} 7405} 7406else if( $(scope.elements.inputPass).val().length < 8){ 7407isValid = false; 7408view.addErrorClass(element); 7409view.addErrorClass(scope.elements.inputPassConfirm); 7410if (scope.elements.inputText) { 7411view.addErrorClass(scope.elements.inputText); 7412} 7413} 7414else if ( $(scope.elements.inputPass).val().length && $(scope.elements.inputPassConfirm).val().length ) { 7415if ( $(scope.elements.inputPass).val() !== $(scope.elements.inputPassConfirm).val() ) { 7416isValid = false; 7417view.addErrorClass(scope.elements.inputPassConfirm); 7418} else { 7419view.removeErrorClass(scope.elements.inputPass); 7420view.removeErrorClass(scope.elements.inputPassConfirm); 7421if (scope.elements.inputText) { 7422view.removeErrorClass(scope.elements.inputText); 7423} 7424} 7425} else { 7426isValid = false; 7427view.addErrorClass(scope.elements.inputPass); 7428view.addErrorClass(scope.elements.inputPassConfirm); 7429if (scope.elements.inputText) { 7430view.addErrorClass(scope.elements.inputText); 7431} 7432} 7433return isValid; 7434}, 7435setPhoneIntCode: function (scope) { 7436var countryCode = $(scope.elements.inputCountry).val(); 7437if ( typeof scope.phoneRegExpList[ countryCode ] !== "undefined" ) { 7438$(scope.elements.inputPhoneCode).val(scope.phoneRegExpList[ countryCode ][0]); 7439} else { 7440$(scope.elements.inputPhoneCode).val(''); 7441} 7442if( luana.hasModule( 'hint' ) ){ luana.module( 'hint' ).update(); } 7443}, 7444validateCountry: function (scope, element) { 7445var isValid = true; 7446if ( $(element).val() == '-1' ) { 7447view.addErrorClass(element); 7448scope.errorList.append('<p>' + $(element).data('error-title') + '</p>'); 7449isValid = false; 7450} else { 7451view.removeErrorClass(element); 7452} 7453return isValid; 7454}, 7455terms: function( scope, element ) { 7456$( scope.elements.submitButton , scope.root ).prop( "disabled", !$( element ).is( ':checked' ) ); 7457}, 7458validate: function (scope) { 7459var isValid = true; 7460$.each(scope.elements.inputSelect, function (index, item) { 7461if ( !this.validateSelect(scope, item) ) { 7462isValid = false; 7463} 7464}.bind(this)); 7465$.each(scope.elements.inputEmail, function (index, item) { 7466if ( !this.validateEmails(scope, item) ) { 7467isValid = false; 7468} 7469}.bind(this)); 7470$.each(scope.elements.inputPhoneCode, function (index, item) { 7471if ( !this.isValidPhoneCode(scope, item) ) { 7472isValid = false; 7473} 7474}.bind(this)); 7475$.each(scope.elements.inputPhoneNumber, function (index, item) { 7476if ( !this.isValidPhoneNumber(scope, item) ) { 7477isValid = false; 7478} 7479}.bind(this)); 7480$.each(scope.elements.inputCountry, function (index, item) { 7481if ( !this.validateCountry(scope, item) ) { 7482isValid = false; 7483} 7484}.bind(this)); 7485$.each(scope.elements.zipInput, function (index, item) { 7486if ( !this.validateZIP(scope, item) ) { 7487isValid = false; 7488} 7489}.bind(this)); 7490$.each(scope.elements.numbers, function (index, item) { 7491if ( !this.isValidNumber(scope, item) ) { 7492isValid = false; 7493} 7494}.bind(this)); 7495$.each(scope.elements.inputField, function (index, item) { 7496if ( !this.validateInput(scope, item) ) { 7497isValid = false; 7498} 7499}.bind(this)); 7500$.each(scope.elements.inputBox, function (index, item) { 7501if ( !this.validateBox(scope, item) ) { 7502isValid = false; 7503} 7504}.bind(this)); 7505$.each(scope.elements.inputPass, function (index, item) { 7506if ( !this.validatePass(scope, item) ) { 7507isValid = false; 7508} 7509}.bind(this)); 7510return isValid; 7511} 7512}; 7513}) 7514.attachEvents(function (scope) { 7515return { 7516submitForm: [ 'click', scope.elements.submitButton ], 7517changeCountry: [ 'change', scope.elements.inputCountry ], 7518changeState: [ 'change', scope.elements.inputState ], 7519fillState: [ 'mouseleave', scope.elements.hiddenState ], 7520terms: ['change', scope.elements.corporateTerms, true] 7521}; 7522}) 7523.view(function () { 7524return { 7525submit: function (scope) { 7526$(scope.elements.submitButton).submit(); 7527}, 7528addErrorClass: function (element) { 7529$(element).addClass('is-invalid'); 7530$(element).parent('.select').addClass('is-invalid'); 7531$(element).parent('.hint').addClass('is-invalid'); 7532}, 7533removeErrorClass: function (element) { 7534$(element).removeClass('is-invalid'); 7535$(element).parent('.select').removeClass('is-invalid'); 7536$(element).parent('.hint').removeClass('is-invalid'); 7537}, 7538showErrors: function (scope) { 7539if ( scope.elements.errorListHolder.length ) { 7540$(scope.elements.errorListHolder).append(scope.errorList);
7541$(scope.elements.errorListHolder).closest('article').removeClass('hidden'); 7542} 7543}, 7544hideErrors: function (scope) { 7545if ( scope.elements.errorListHolder.length ) { 7546$(scope.elements.errorListHolder).closest('article').addClass('hidden'); 7547} 7548} 7549}; 7550});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.