/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("',inline_markup:'
{content}
',custom_markup:"",social_tools:''},f);var r,s,t,u,v,w,x,y=this,z=!1,A=a(window).height(),B=a(window).width();return doresize=!0,scroll_pos=n(),a(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){m(),o()}),f.keyboard_shortcuts&&a(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(b){if("undefined"!=typeof $pp_pic_holder&&$pp_pic_holder.is(":visible"))switch(b.keyCode){case 37:a.prettyPhoto.changePage("previous"),b.preventDefault();break;case 39:a.prettyPhoto.changePage("next"),b.preventDefault();break;case 27:settings.modal||a.prettyPhoto.close(),b.preventDefault()}}),a.prettyPhoto.initialize=function(){return settings=f,"pp_default"==settings.theme&&(settings.horizontal_padding=16),theRel=a(this).attr(settings.hook),galleryRegExp=/\[(?:.*)\]/,isSet=galleryRegExp.exec(theRel)?!0:!1,pp_images=isSet?jQuery.map(y,function(b){return-1!=a(b).attr(settings.hook).indexOf(theRel)?a(b).attr("href"):void 0}):a.makeArray(a(this).attr("href")),pp_titles=isSet?jQuery.map(y,function(b){return-1!=a(b).attr(settings.hook).indexOf(theRel)?a(b).find("img").attr("alt")?a(b).find("img").attr("alt"):"":void 0}):a.makeArray(a(this).find("img").attr("alt")),pp_descriptions=isSet?jQuery.map(y,function(b){return-1!=a(b).attr(settings.hook).indexOf(theRel)?a(b).attr("title")?a(b).attr("title"):"":void 0}):a.makeArray(a(this).attr("title")),pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1),set_position=jQuery.inArray(a(this).attr("href"),pp_images),rel_index=isSet?set_position:a("a["+settings.hook+"^='"+theRel+"']").index(a(this)),q(this),settings.allow_resize&&a(window).bind("scroll.prettyphoto",function(){m()}),a.prettyPhoto.open(),!1},a.prettyPhoto.open=function(b){return"undefined"==typeof settings&&(settings=f,pp_images=a.makeArray(arguments[0]),pp_titles=a.makeArray(arguments[1]?arguments[1]:""),pp_descriptions=a.makeArray(arguments[2]?arguments[2]:""),isSet=pp_images.length>1?!0:!1,set_position=arguments[3]?arguments[3]:0,q(b.target)),settings.hideflash&&a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),i(a(pp_images).size()),a(".pp_loaderIcon").show(),settings.deeplinking&&c(),settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href)),$pp_pic_holder.find(".pp_social").html(facebook_like_link)),$ppt.is(":hidden")&&$ppt.css("opacity",0).show(),$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity),$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+a(pp_images).size()),"undefined"!=typeof pp_descriptions[set_position]&&""!=pp_descriptions[set_position]?$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])):$pp_pic_holder.find(".pp_description").hide(),movie_width=parseFloat(e("width",pp_images[set_position]))?e("width",pp_images[set_position]):settings.default_width.toString(),movie_height=parseFloat(e("height",pp_images[set_position]))?e("height",pp_images[set_position]):settings.default_height.toString(),z=!1,-1!=movie_height.indexOf("%")&&(movie_height=parseFloat(a(window).height()*parseFloat(movie_height)/100-150),z=!0),-1!=movie_width.indexOf("%")&&(movie_width=parseFloat(a(window).width()*parseFloat(movie_width)/100-150),z=!0),$pp_pic_holder.fadeIn(function(){switch($ppt.html(settings.show_title&&""!=pp_titles[set_position]&&"undefined"!=typeof pp_titles[set_position]?unescape(pp_titles[set_position]):" "),imgPreloader="",skipInjection=!1,l(pp_images[set_position])){case"image":imgPreloader=new Image,nextImage=new Image,isSet&&set_position0&&(movie_id=movie_id.substr(0,movie_id.indexOf("?"))),movie_id.indexOf("&")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("&")))),movie="http://www.youtube.com/embed/"+movie_id,movie+=e("rel",pp_images[set_position])?"?rel="+e("rel",pp_images[set_position]):"?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toInject=settings.iframe_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":r=j(movie_width,movie_height),movie_id=pp_images[set_position];var b=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/,c=movie_id.match(b);movie="http://player.vimeo.com/video/"+c[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=r.width+"/embed/?moog_width="+r.width,toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,r.height).replace(/{path}/g,movie);break;case"quicktime":r=j(movie_width,movie_height),r.height+=15,r.contentHeight+=15,r.containerHeight+=15,toInject=settings.quicktime_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":r=j(movie_width,movie_height),flash_vars=pp_images[set_position],flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length),filename=pp_images[set_position],filename=filename.substring(0,filename.indexOf("?")),toInject=settings.flash_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":r=j(movie_width,movie_height),frame_url=pp_images[set_position],frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1),toInject=settings.iframe_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,r=j(movie_width,movie_height),doresize=!0,skipInjection=!0,a.get(pp_images[set_position],function(a){toInject=settings.inline_markup.replace(/{content}/g,a),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,g()});break;case"custom":r=j(movie_width,movie_height),toInject=settings.custom_markup;break;case"inline":myClone=a(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapInner('
').appendTo(a("body")).show(),doresize=!1,r=j(a(myClone).width(),a(myClone).height()),doresize=!0,a(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,a(pp_images[set_position]).html())}imgPreloader||skipInjection||($pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,g())}),!1},a.prettyPhoto.changePage=function(b){currentGalleryPage=0,"previous"==b?(set_position--,0>set_position&&(set_position=a(pp_images).size()-1)):"next"==b?(set_position++,set_position>a(pp_images).size()-1&&(set_position=0)):set_position=b,rel_index=set_position,doresize||(doresize=!0),settings.allow_expand&&a(".pp_contract").removeClass("pp_contract").addClass("pp_expand"),h(function(){a.prettyPhoto.open()})},a.prettyPhoto.changeGalleryPage=function(a){"next"==a?(currentGalleryPage++,currentGalleryPage>totalPage&&(currentGalleryPage=0)):"previous"==a?(currentGalleryPage--,0>currentGalleryPage&&(currentGalleryPage=totalPage)):currentGalleryPage=a,slide_speed="next"==a||"previous"==a?settings.animation_speed:0,slide_to=currentGalleryPage*itemsPerPage*itemWidth,$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)},a.prettyPhoto.startSlideshow=function(){"undefined"==typeof x?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){return a.prettyPhoto.stopSlideshow(),!1}),x=setInterval(a.prettyPhoto.startSlideshow,settings.slideshow)):a.prettyPhoto.changePage("next")},a.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){return a.prettyPhoto.startSlideshow(),!1}),clearInterval(x),x=void 0},a.prettyPhoto.close=function(){$pp_overlay.is(":animated")||(a.prettyPhoto.stopSlideshow(),$pp_pic_holder.stop().find("object,embed").css("visibility","hidden"),a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){a(this).remove()}),$pp_overlay.fadeOut(settings.animation_speed,function(){settings.hideflash&&a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible"),a(this).remove(),a(window).unbind("scroll.prettyphoto"),d(),settings.callback(),doresize=!0,s=!1,delete settings}))},!pp_alreadyInitialized&&b()&&(pp_alreadyInitialized=!0,hashIndex=b(),hashRel=hashIndex,hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){a("a["+f.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)),this.unbind("click.prettyphoto").bind("click.prettyphoto",a.prettyPhoto.initialize)}}(jQuery);var pp_alreadyInitialized=!1; var CommonSetting = { imageBaseUrl: '/Widgets/_Resources/Images/', graphicsUrl: '//assets.wvholdings.com/2/IMAGES/' }; Array.prototype.IndexOf = function (searchStr) { for (var i = 0; i < this.length; i++) { if (this[i] === searchStr) { return i; } } return -1; }; Array.prototype.Contains = function (searchStr) { for (var i = 0; i < this.length; i++) { if (this[i] == searchStr) { return true; } } return false; }; Array.prototype.Clear = function () { if (typeof this == Array) { while (this.length > 0) { this.pop(); } } }; // ToDo: confirm following two methods Array.prototype.Dedupe = function () { var result = []; $.each(this, function (i, e) { if (e && e.length && $.inArray(e, result) == -1) result.push(e); }); // ToDo: change method signature return result; } // pass multiple arrays as arguments, eg. arr1.Intersection(arr2, arr3, arr4...) will return intersection of {arr1, arr2, arr3, arr4...} Array.prototype.Intersection = function () { var result = []; if (typeof this == Array) { var arrays = [this]; for (var i = 0; i < arguments.length; i++) { var thisArg = arguments[i]; if (typeof thisArg == Array) { arrays.push(thisArg); } } result = arrays.shift().filter(function (v) { return arrays.every(function (a) { return a.indexOf(v) !== -1; }); }); } return result; } var _travelStorage = function (type) { var _storeDb, _enable = false, _STORAGE_VERSION_STR = "_version_"; if (type == "cache") { try { localStorage.setItem("test", "test"); localStorage.removeItem("test"); _enable = true; _storeDb = localStorage; } catch (e) { _enable = false; } } else if (type == "session") { try { sessionStorage.setItem("test", "test"); sessionStorage.removeItem("test"); _enable = true; _storeDb = sessionStorage; } catch (e) { _enable = false; } } if (_enable) { var ver = _storeDb.getItem(_STORAGE_VERSION_STR); if (typeof SiteContext == "object" && SiteContext.ScriptVersion) { if (ver != SiteContext.ScriptVersion) { //_storeDb.clear(); _storeDb.setItem("_version_", SiteContext.ScriptVersion); } } } var _trySet = function (key, value) { try { _storeDb.setItem(key, value); return true; } catch (e) { return false; } }; //if global disable if (typeof SiteContext == "object" && !SiteContext.clientCacheEnable) _enable = false; return { enable: function () { return _enable; }, _getVer: function () { return _storeDb.getItem(_STORAGE_VERSION_STR); }, get: function (key) { if (_enable) return _storeDb.getItem(key); return null; }, set: function (key, value) { if (_enable) { var flag = _trySet(key, value); if (flag == false) _storeDb.clear(); return flag; } return false; } }; }; var TravelHelper = { deserialize: function (str) { if (str == null || str == "") return null; return Sys.Serialization.JavaScriptSerializer.deserialize(str); }, htmlDecode : function(input){ var e = document.createElement('div'); e.innerHTML = input; return e.childNodes[0].nodeValue; }, serialize: function (obj) { if (obj == null) return null; return Sys.Serialization.JavaScriptSerializer.serialize(obj); }, dateInJson: function (value) { if (typeof value === 'string') { var isDate = /Date\(([-+]?\d+[-+]?\d+)\)/.exec(value); if (isDate) { value = new Date(eval(isDate[1])); } } return value; }, dateDiffInDays: function (d1, d2) { // The number of milliseconds in one day var ONE_DAY = 1000 * 60 * 60 * 24; var date1 = new Date(d1); var date2 = new Date(d2); // Convert both dates to milliseconds var date1_ms = date1.getTime(); var date2_ms = date2.getTime(); // Calculate the difference in milliseconds var difference_ms = Math.abs(date1_ms - date2_ms); // Convert back to days and return return Math.round(difference_ms / ONE_DAY); }, formatDate: function (date) { var year = date.getFullYear(); var month = (1 + date.getMonth()).toString(); month = month.length > 1 ? month : '0' + month; var day = date.getDate().toString(); day = day.length > 1 ? day : '0' + day; return month + '/' + day + '/' + year; }, addQueryParam: function (url, key, value) { if (url && typeof url === 'string' && key && value) { url = url.indexOf('?') === -1 ? url.concat('?') : url.concat('&'); url = url.concat(key, '=', value); } return url; }, addQueryParamByObj: function (url, queryObj) { var _this = this; for (var prop in queryObj) { url = _this.addQueryParam(url, prop, queryObj[prop]); }; return url; }, getQueryParamAsObj: function (url) { var queryString = typeof (url) === "string" && url.indexOf('?') > 0 ? url.split('?')[1] : url; var arrayKeyValue = queryString.split("&"); var obj = {}; for (var i = 0; i < arrayKeyValue.length; i++) { var temp = arrayKeyValue[i].split('='); if (temp.length === 2) obj[temp[0]] = temp[1]; } return obj; }, getQueryStringParam: function (name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }, template: (function () { var svcUrl = '/Handlers/TemplateResourceHandler.ashx'; return { setSvcUrl: function (url) { svcUrl = url; }, _getCacheKeyName: function (param) { var ckname = ""; if (typeof param == "object") { for (var c = 0; c < param.length; c++) ckname += param[c]; } else ckname = param; return ckname; }, getList: function () { var callback, qs = []; if (typeof arguments[1] == "boolean") { if (arguments[1] == true) qs.push("local=true"); callback = arguments[2]; } else callback = arguments[1]; $.each(arguments[0], function (index, itm) { //if (itm) // itm = itm.replace(/\./g, '_'); qs.push("t" + index + "=" + itm); }); url = svcUrl + "?" + qs.join('&'); if (typeof SiteContext != "undefined" && SiteContext.CultureCode) url = url + "&c=" + SiteContext.CultureCode; TravelHelper.ajax.get(url, function (data) { if (typeof callback == "function") callback(data); }); } }; }()), pageTemplate: { enable: true, init: function () { if (typeof ($pageTemplate) != "undefined" && $.isArray($pageTemplate)) this._onSuccess($pageTemplate); }, _tmpl: {}, _compileTmpl: {}, _onSuccess: function (res) { var _this = this; this.isTemplateLoaded = true; $.each(res, function (index, val) { _this._tmpl[val.Name] = val.Template; }); $.each(this._subscriber, function (index, fn) { setTimeout(fn, 10); }); }, _subscriber: [], register: function (afterLoadCallback) { if ($.isFunction(afterLoadCallback)) this._subscriber.push(afterLoadCallback); }, get: function (tname) { return this._tmpl[tname]; }, getCompile: function (tname) { if (typeof this._compileTmpl[tname] === "undefined") { try { this._compileTmpl[tname] = Handlebars.compile(this._tmpl[tname]); } catch (e) { var expString = "Can't find Template " + tname + " " + e; throw expString; } } return this._compileTmpl[tname]; }, isTemplateLoaded: false }, Template: function (templateList, afterLoadCallback, cachtemplate) { var _tmpl = {}, _isInit = false, _compileTmpl = {}; var _this = this; var initilize = function () { if (SiteContext && SiteContext.templateKey && cachtemplate) { if (TravelHelper.pageTemplate.isTemplateLoaded) { _isInit = true; setTimeout(function () { if ($.isFunction(afterLoadCallback)) { afterLoadCallback(); } }, 50); } else { TravelHelper.pageTemplate.register($.proxy(pageTemplateLoaded, _this)); } } else { TravelHelper.template.getList(templateList, false, $.proxy(onTemplLoad, _this)); cachtemplate = false; } }; var onTemplLoad = function (lst) { $.each(lst, function (index, val) { _tmpl[val.Name] = val.Template; }); _isInit = true; if ($.isFunction(afterLoadCallback)) { afterLoadCallback(); } }; var pageTemplateLoaded = function () { cachtemplate = true; _isInit = true; if ($.isFunction(afterLoadCallback)) afterLoadCallback(); } initilize(); return { get: function (tname) { if (cachtemplate) return TravelHelper.pageTemplate.get(tname); return _tmpl[tname]; }, isInit: function () { return _isInit; }, getCompile: function (tname) { if (cachtemplate) return TravelHelper.pageTemplate.getCompile(tname); if (typeof _compileTmpl[tname] === "undefined") { try { _compileTmpl[tname] = Handlebars.compile(_tmpl[tname]); } catch (e) { var expString = "Can't find Template " + tname + " " + e; throw expString; } } return _compileTmpl[tname]; } }; }, ajax: { lstAjaxCall: [], getVersionUrl: function (url) { if (SiteContext != undefined && SiteContext.ScriptVersion != undefined) { if (url.indexOf('?') >= 0) url = url + "&sver=" + SiteContext.ScriptVersion; else url = url + "?sver=" + SiteContext.ScriptVersion; if (window.location && window.location.href.indexOf('profiler=true') > 0) { url = url + "&profiler=true"; } } return url; }, get: function (url, onSuccess, onFailed) { var ac = $.ajax({ type: "GET", contentType: "application/json", url: this.getVersionUrl(url), data: null, dataType: 'json', processData: false, success: function (res) { if (typeof onSuccess == "function") onSuccess(res); }, error: function (XMLHttpRequest, textStatus, errorThrown) { if (typeof onFailed == "function") onFailed(XMLHttpRequest, textStatus, errorThrown); } }); this.lstAjaxCall.push(ac); }, getSync: function (url, onSuccess, onFailed) { //synchronous call, added async=false parameter var ac = $.ajax({ type: "GET", contentType: "application/json", url: this.getVersionUrl(url), data: null, async: false, dataType: 'json', processData: false, success: function (res) { if (typeof onSuccess == "function") onSuccess(res); }, error: function (XMLHttpRequest, textStatus, errorThrown) { if (typeof onFailed == "function") onFailed(XMLHttpRequest, textStatus, errorThrown); } }); this.lstAjaxCall.push(ac); }, getJsonp: function (url, onSuccess, onFailed) { var ac = $.ajax({ type: "GET", contentType: "application/json", url: this.getVersionUrl(url), data: null, dataType: 'jsonp', processData: false, success: function (res) { if (typeof onSuccess == "function") onSuccess(res); }, error: function (XMLHttpRequest, textStatus, errorThrown) { if (typeof onFailed == "function") onFailed(XMLHttpRequest, textStatus, errorThrown); } }); this.lstAjaxCall.push(ac); }, post: function (url, data, onSuccess, onFailed) { var pData = null; if (data != null) pData = TravelHelper.serialize(data); var ac = $.ajax({ type: "POST", contentType: "application/json", url: this.getVersionUrl(url), data: pData, dataType: 'json', processData: false, success: function (res) { if (typeof onSuccess == "function") onSuccess(res); }, error: function (XMLHttpRequest, textStatus, errorThrown) { if (typeof onFailed == "function") onFailed(XMLHttpRequest, textStatus, errorThrown); } }); this.lstAjaxCall.push(ac); }, postCall: function (url, data, onSuccess, onFailed) { var pData = null; if (data != null) pData = JSON.stringify(data); var ac = $.ajax({ type: "POST", contentType: "application/json", url: this.getVersionUrl(url), data: pData, dataType: 'json', processData: false, success: function (res) { if (typeof onSuccess == "function") onSuccess(res); }, error: function (XMLHttpRequest, textStatus, errorThrown) { if (typeof onFailed == "function") onFailed(XMLHttpRequest, textStatus, errorThrown); } }); this.lstAjaxCall.push(ac); }, stop: function () { if (this.lstAjaxCall.length > 0) { try { for (var cnt = 0; cnt < this.lstAjaxCall.length; cnt++) { this.lstAjaxCall[cnt].abort(); } } catch (e) { } } }, getXML: function (url, onSuccess, onFailed) { var ac = $.ajax({ type: "GET", contentType: "application/xml", url: url, data: null, cache: false, processData: false, success: function (res) { if (typeof onSuccess == "function") onSuccess(res); }, error: function (XMLHttpRequest, textStatus, errorThrown) { if (typeof onFailed == "function") onFailed(XMLHttpRequest, textStatus, errorThrown); } }); this.lstAjaxCall.push(ac); } }, removeSpecialCharacters: function (description) { if (description !== "") { return description.replace(/[#*><=^~{}¤¦§¨ª«¬®¯±µ¶º¸º»¼½¾¿×÷+„¡¨ª«¯´·¸º»ΓΔΘΛΞΠΣΨΩδεζηλμξπρςσφψωϑϒϖ†‡•…‰℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⌈⌉⌊⌋⟨⟩◊♠♣♥♦€â¢]/gi, ''); } return null; }, //this data exist till browser close session: new _travelStorage("session"), //this data exist till user remove it cache: new _travelStorage("cache") }; function SetKOTemplateEngine() { ko.templateSources.stringTemplate = function (template, templates) { this.templateName = template; this.templates = templates; } ko.utils.extend(ko.templateSources.stringTemplate.prototype, { data: function (key, value) { this.templates._data = this.templates._data || {}; this.templates._data[this.templateName] = this.templates._data[this.templateName] || {}; if (arguments.length === 1) { return this.templates._data[this.templateName][key]; } this.templates._data[this.templateName][key] = value; }, text: function (value) { if (arguments.length === 0) { return this.templates.get(this.templateName); } this.templates.set(this.templateName, value); } }); var templateEngine = new ko.nativeTemplateEngine(); templateEngine.makeTemplateSource = function (template) { return new ko.templateSources.stringTemplate(template, TravelHelper.pageTemplate); }; ko.setTemplateEngine(templateEngine); }; function OpenPopupWindow(url) { popWindow = window.open(url, 'mywindow', 'height=850,width=1050,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes'); // return false; } /****Tab script start**************************************************************************************************/ function createCookie(name, value, days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toGMTString(); } var cookieContent = name + "=" + value + expires + "; path=/"; document.cookie = cookieContent; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function eraseCookie(name) { createCookie(name, "", -1); } var messagingService = new function () { var servicePath; return { init: function (svcPath) { servicePath = svcPath; }, removeMessage: function () { $.ajax({ type: "GET", contentType: "application/json", url: servicePath + "/removeMessage", processData: false, cache: false, success: function (result) { if (result == '') { return false; } return result; }, error: function (XMLHttpRequest, textStatus, errorThrown) { return false; } }); }, addMessage: function (message) { $.ajax( { type: "POST", contentType: "application/json", url: servicePath + "/addMessage", data: Sys.Serialization.JavaScriptSerializer.serialize(message), processData: false, cache: false, success: function (result) { if (result == '') { return false; } return true; }, error: function (XMLHttpRequest, textStatus, errorThrown) { return false; } }); } }; }(); function OpenWindow(url, windowname, w, h) { var setvalues = 'height=' + h + ',width=' + w + ',top=50,left=100,scrollbars=yes,resizable=yes,,menubar=no,toolbar=no,status=no'; var win = window.open(url, windowname, setvalues); } //Dream trip popup function OpenNewPopupWindowWithHeightWidth(url) { OpenWindow(url, "", 1100, 600); } String.prototype.trim = function () { return this.replace(/^\s*/, "").replace(/\s*$/, ""); }; var UIEvent = function (sender) { var _sender = sender; var _listeners = []; var callAsyn = function (index, args) { setTimeout(function () { _listeners[index](_sender, args); }, 0); }; return { attach: function (listener) { _listeners.push(listener); }, notify: function (args, async) { var isAsync = false; if (typeof async == "boolean") isAsync = async; for (var i = 0; i < _listeners.length; i++) { if (isAsync) callAsyn(i, args); else _listeners[i](_sender, args); } } }; }; $(function () { if (typeof (ko) != "undefined") { SetKOTemplateEngine(); } TravelHelper.pageTemplate.init(); }); $.fn.smoothScroll = function () { }; /* ******XML******** *********JSON************ { name : { validations : [ { type : 'required', error: ''} ] } } */ ; (function ($) { var ControlValidate = function (element, options) { this.holder = $(element); this.button = null; this.rules = {}; this._errorList = []; this.totalControls = 0; this.validatedControls = 0; this.options = $.extend({}, $.fn.controlValidate.defaults, options); if (typeof this.options.summaryHolder == "object") this.summaryHolder = this.options.summaryHolder; else this.summaryHolder = $(this.options.summaryHolder, this.holder); this.init(); }; ControlValidate.prototype = { init: function () { if (this.options.rules == null) this.parseRuleXml(this.options.ruleXml); else this.rules = this.options.rules; var _this = this; _this.button = $("[val-submit]", this.holder); $("[val-submit]", this.holder).on('click', function () { var group = $(this).attr("val-submit"); _this.button = $(this); _this.validate(group); }); _this.initControls(); }, initControls: function () { var _controls = $("[val-group='" + this.options.group + "']", this.holder), _this = this; if (_controls.length > 0) { _controls.each(function () { _this.initControlEvent($(this)); }); } }, validate: function (groupName) { var _controls = $("[val-group='" + groupName + "']", this.holder); this._errorList = []; this.totalControls = _controls.length; this.validatedControls = 0; if (_controls.length > 0) { _controls.each($.proxy(this.fireControlValidation, this)); } else { this.holder.trigger("val-success", [this.button]); } }, fireControlValidation: function (index, controlToValidate) { setTimeout($.proxy(this.validateControl, this, index, controlToValidate), 0); }, validateControl: function (index, controlToValidate) { var $cntrl = $(controlToValidate); this.initControlEvent($cntrl); var valRS = null; valRS = this.isValidControl($cntrl); this.changeControlStyle($cntrl, valRS.isValid); if (valRS.isValid == false) this._errorList.push(valRS.error); ++this.validatedControls; this.check(); }, isValidControl: function ($cntrl) { var isEnbale = $cntrl.attr("val-enable"), ruleName = $cntrl.attr("val-rule"), ruleToExecute = this.rules[ruleName], rs = null, isVisible = $cntrl.is(':visible'), fireOnInvisible = $cntrl.attr("val-checkvisible"); $cntrl.data("isValid", true); if ((isVisible || fireOnInvisible == "false") && (isEnbale == undefined || isEnbale == "true") && ruleToExecute != undefined && ruleToExecute.validations.length > 0) { rs = this.executeRule($cntrl, ruleName, ruleToExecute); $cntrl.data("isValid", rs.isValid); if (rs.error != null) $cntrl.data("val-error", rs.error.error); return rs; } return { isValid: true, error: null }; }, executeRule: function ($cntrl, ruleName, ruleToExecute) { var value = this.getControlValue($cntrl), _isValid = true, _error = null; for (var cnt = 0; cnt < ruleToExecute.validations.length; cnt++) { var validation = ruleToExecute.validations[cnt]; var method = this.valMethod[validation.type]; if ($.isFunction(method)) { _isValid = method(value, $cntrl, validation, this.holder); if (!_isValid) { var err = $cntrl.attr("val-error"); _error = { name: ruleName, control: $cntrl, type: validation.type, error: (err != undefined && err != "") ? err : validation.error }; break; } } } return { isValid: _isValid, error: _error }; }, initControlEvent: function (cntrl) { if (cntrl.data("val-init") == undefined) { cntrl.on("focus", $.proxy(this.onControlFocus, this)); cntrl.on("blur", $.proxy(this.onControlBlur, this)); cntrl.on("change", $.proxy(this.onControlChange, this)); if (this.options.enableKeypressSubmit) { cntrl.on("keypress", $.proxy(this.onControlPress, this)); } cntrl.data("val-init", true); } }, check: function () { if (this.validatedControls != this.totalControls) return; if (this._errorList.length > 0) { if (this.options.displaySummary == true) this.showError(this._errorList); else if (this.options.displaySummaryHeader == true) this.showError(null); this.holder.trigger("val-failed", [this._errorList]); } else { this.summaryHolder.hide(); this.holder.trigger("val-success", [this.button]); } }, showError: function (errorList) { if (this.summaryTemplate == undefined) this.summaryTemplate = Handlebars.compile(this.options.summaryTemplate); errorList = this.dedupeErrorList(errorList); var h = this.options.summaryHeader, t = { header: h == '' ? this.summaryHolder.attr("val-summary") : h, errors: errorList }; if (this.summaryHolder.length > 0) { this.summaryHolder.html(this.summaryTemplate(t)); this.summaryHolder.show(); this.summaryHolder.focus(); } }, dedupeErrorList: function (errorList) { if (errorList) { var u = {}, a = []; for (var i = 0, l = errorList.length; i < l; ++i) { if (u.hasOwnProperty(errorList[i].error)) { continue; } a.push(errorList[i]); u[errorList[i].error] = 1; } return a; } return errorList; }, getControlValue: function (cntrl) { var type = cntrl.attr("type"), val = cntrl.val(); if (type === "radio" || type === "checkbox") { return $("input[name='" + $(cntrl).attr("name") + "']:checked").val(); } if (typeof val === "string") { return val.replace(/\r/g, ""); } return val; }, changeControlStyle: function (cntrl, isValid) { if (this.options.changeControlStyle == false) return; var c = cntrl; if (this.options.applyStyleToParent === true) c = cntrl.parents(this.options.parentIdentifier); if (isValid) c.removeClass(this.options.errorClass); else c.addClass(this.options.errorClass); }, onControlFocus: function (e) { var $cntrl = $(e.currentTarget); if ($cntrl.data("isValid") == false) this.popover($cntrl, $cntrl.data("val-error")); }, onControlBlur: function (e) { this.hidePopover(); }, onControlChange: function (e) { var $cntrl = $(e.currentTarget), valFireOnChange = $cntrl.attr("val-fireonchange"); if (valFireOnChange != undefined && valFireOnChange == "false") return; var rs = this.isValidControl($cntrl); this.changeControlStyle($cntrl, rs.isValid); if ($cntrl.data("isValid") == false) this.popover($cntrl, $cntrl.data("val-error")); else this.hidePopover(); }, onControlPress: function (e) { if (e.keyCode == 13) { this.validate($(e.currentTarget).attr("val-group")); e.preventDefault(); } }, parseRuleXml: function (strXml) { var xmldoc = $.parseXML(strXml); var $xml = $(xmldoc); $("rule", $xml).each($.proxy(this.addRuleFromXml, this)); }, addRuleFromXml: function (index, xml) { var $xml = $(xml); var lst = []; $("validation", $xml).each(function (index, tag) { if (tag.attributes.length > 0) { var obj = {}; for (var i = 0; i < tag.attributes.length; i++) { obj[tag.attributes[i].name] = tag.attributes[i].value; } lst.push(obj); } // var elmt = $(this); // lst.push({ // type:elmt.attr("type"), // error:elmt.attr("error") // }); }); if (lst.length > 0) this.rules[$xml.attr("name")] = { validations: lst }; }, execute: function (param) { switch (param[0]) { case "add-method": if (param[1] != undefined && param[2] != undefined && $.isFunction(param[2])) this.valMethod[param[1]] = param[2]; break; case "validate": this.validate(param[1]); break; case "set-error": this.showError(param[1]); break; case "reinit-controls": this.initControls(); break; }; }, addValMethod: function (name, callback) { if ($.isFunction(callback)) this.valMethod[name] = callback; }, valMethod: { required: function (value, cntrl, rule) { return (rule.initial == undefined || rule.initial != value) && $.trim(value).length > 0; }, match: function (value, cntrl, rule) { var flag = true; switch (rule.value) { case "email": flag = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test($.trim(value)); break; case "url": flag = /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); break; case "number": flag = /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value); break; case "digit": flag = /^\d+$/.test(value); break; case "min": flag = value >= rule.param; break; case "max": flag = value <= rule.param; break; case "regex": flag = (new RegExp(rule.param)).test(value); break; case "creditCardNum": flag = _validationHelper.checkForCreditCard(value); // Master Card - Amex - Visa break; case "cvv": flag = /^[0-9]{3,4}$/.test(value); break; } return flag; }, range: function (value, cntrl, rule) { return (value >= rule.min && value <= rule.max); }, equalTo: function (value, cntrl, rule, holder) { var target = $(rule.control, holder); return value == target.val(); }, length: function (value, cntrl, rule) { if (rule.min == undefined && rule.max == undefined) return true; else if (rule.min == undefined) { return value.length <= rule.max; } else if (rule.max == undefined) { return value.length >= rule.min; } else { return value.length <= rule.max && value.length >= rule.min; } }, custom: function (value, cntrl, rule, holder) { var flag = holder.triggerHandler("val-custom", [{ val: value, control: cntrl, rule: rule }]); if (typeof flag != "boolean") flag = true; return flag; } }, popover: function (cntrl, error) { if (this.options.displayPopover == false) return; var $po, pos, actualHeight, actualWidth, tp, placement, valCntrl = cntrl, poClass = this.options.popoverClass; $po = this.getPopoverHolder(); $po.find("p").html(error); //if (cntrl.attr("id") && $po.data("poFor") == cntrl.attr("id")) { // $po.show(); // return; //} var fireOnVisible = cntrl.attr("val-checkvisible"); if (fireOnVisible && fireOnVisible == "false") { pos = this.getPosition(cntrl.next()); } else pos = this.getPosition(cntrl); placement = cntrl.attr("val-placement"); placement = (placement == undefined) ? this.options.defaultPlacement : placement; actualHeight = $po.height(); actualWidth = $po.width(); switch (placement) { case "right": tp = { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }; break; case "top": tp = { top: pos.top - actualHeight - 12, left: pos.left + pos.width / 2 - actualWidth / 2 }; break; case "bottom": tp = { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 }; break; case "left": tp = { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth }; break; } $po.css(tp) .attr("class", poClass + " " + placement) .show() .data("poFor", cntrl.attr('id')); $("body form").click(function (ev) { if (valCntrl[0] != ev.target) { $po.hide(); } }); if (fireOnVisible && fireOnVisible == "false") { setTimeout(function () { $po.hide(); $po.data("poFor", ""); }, 2000); } }, getPosition: function (cntrl) { return $.extend({}, cntrl.offset(), { width: cntrl[0].offsetWidth , height: cntrl[0].offsetHeight }); }, getPopoverHolder: function () { if (this._po == undefined) { var po = $("
"); po.html(this.options.popoverTemplate); $('body').append(po); this._po = po.children(); } return this._po; }, hidePopover: function () { if (this._po) this._po.hide(); } }; $.fn.controlValidate = function (option) { var arg = arguments; return this.each(function () { var $this = $(this), data = $this.data('validate'), options = typeof option == 'object' && option; if (!data) $this.data('validate', (data = new ControlValidate(this, options))); else if (typeof option == "string") data.execute(arg); }); }; $.fn.controlValidate.defaults = { group: '', ruleXml: null, rules: null, enableKeypressSubmit: false, errorClass: 'error', changeControlStyle: true, applyStyleToParent: true, parentIdentifier: '.control-group', displaySummary: true, displaySummaryHeader: true, //this property consider when display summary property is false. summaryHolder: 'div[val-summary]', summaryHeader: '', summaryTemplate: '
{{header}}
{{#if errors}}
    {{#each errors}}
  1. {{/each}}
{{/if}}
', defaultPlacement: 'right', displayPopover: true, popoverClass: 'popover', popoverTemplate: '

' }; $.fn.controlValidate.Constructor = ControlValidate; var _validationHelper = { checkForCreditCard: function (cardNumber) { if (/[^0-9]+/.test(cardNumber) || cardNumber.length < 13 || cardNumber.length > 16) return false; cardNumber = cardNumber.replace(/\D/g, ""); if (this.isCheckSumValid(cardNumber) == false) return false; if (/^(5[12345])/.test(cardNumber) && cardNumber.length == 16) // mastercard (16 digits - starts with 51,52,53,54,55) return true; if (/^(4)/.test(cardNumber) && (cardNumber.length == 16 || cardNumber.length == 13)) // visa (13 / 16 digits - starts with 4) return true; if (/^(3[47])/.test(cardNumber) && cardNumber.length == 15) // american express (15 digits - starts with 34,37) return true; return false; }, isCheckSumValid: function (cardNumber) { try { var checkSum = 0; // running checksum total var j = 1; // takes value of 1 or 2 // Process each digit one by one starting at the right var calc = 0; for (var i = cardNumber.length - 1; i >= 0; i--) { // Extract the next digit and multiply by 1 or 2 on alternative digits. calc = parseInt(cardNumber[i]) * j; // If the result is in two digits add 1 to the checksum total if (calc > 9) { checkSum++; calc -= 10; } // Add the units element to the checksum total checkSum += calc; // Switch the value of j j = (j == 1) ? 2 : 1; } // All done - if checksum is divisible by 10, it is a valid modulus 10. // If not, report an error. return checkSum % 10 == 0; } catch (err) { return false; } } }; })(window.jQuery); /*! * Globalize * * http://github.com/jquery/globalize * * Copyright Software Freedom Conservancy, Inc. * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license */ (function (window, undefined) { var Globalize, // private variables regexHex, regexInfinity, regexParseFloat, regexTrim, // private JavaScript utility functions arrayIndexOf, endsWith, extend, isArray, isFunction, isObject, startsWith, trim, truncate, zeroPad, // private Globalization utility functions appendPreOrPostMatch, expandFormat, formatDate, formatNumber, getTokenRegExp, getEra, getEraYear, parseExact, parseNegativePattern; // Global variable (Globalize) or CommonJS module (globalize) Globalize = function (cultureSelector) { return new Globalize.prototype.init(cultureSelector); }; if (typeof require !== "undefined" && typeof exports !== "undefined" && typeof module !== "undefined") { // Assume CommonJS module.exports = Globalize; } else { // Export as global variable window.Globalize = Globalize; } Globalize.cultures = {}; Globalize.prototype = { constructor: Globalize, init: function (cultureSelector) { this.cultures = Globalize.cultures; this.cultureSelector = cultureSelector; return this; } }; Globalize.prototype.init.prototype = Globalize.prototype; // 1. When defining a culture, all fields are required except the ones stated as optional. // 2. Each culture should have a ".calendars" object with at least one calendar named "standard" // which serves as the default calendar in use by that culture. // 3. Each culture should have a ".calendar" object which is the current calendar being used, // it may be dynamically changed at any time to one of the calendars in ".calendars". Globalize.cultures["default"] = { // A unique name for the culture in the form - name: "en-US", // the name of the culture in the english language englishName: "English", // the name of the culture in its own language nativeName: "English", // whether the culture uses right-to-left text isRTL: false, // "language" is used for so-called "specific" cultures. // For example, the culture "es-CL" means "Spanish, in Chili". // It represents the Spanish-speaking culture as it is in Chili, // which might have different formatting rules or even translations // than Spanish in Spain. A "neutral" culture is one that is not // specific to a region. For example, the culture "es" is the generic // Spanish culture, which may be a more generalized version of the language // that may or may not be what a specific culture expects. // For a specific culture like "es-CL", the "language" field refers to the // neutral, generic culture information for the language it is using. // This is not always a simple matter of the string before the dash. // For example, the "zh-Hans" culture is netural (Simplified Chinese). // And the "zh-SG" culture is Simplified Chinese in Singapore, whose lanugage // field is "zh-CHS", not "zh". // This field should be used to navigate from a specific culture to it's // more general, neutral culture. If a culture is already as general as it // can get, the language may refer to itself. language: "en", // numberFormat defines general number formatting rules, like the digits in // each grouping, the group separator, and how negative numbers are displayed. numberFormat: { // [negativePattern] // Note, numberFormat.pattern has no "positivePattern" unlike percent and currency, // but is still defined as an array for consistency with them. // negativePattern: one of "(n)|-n|- n|n-|n -" pattern: ["-n"], // number of decimal places normally shown decimals: 2, // string that separates number groups, as in 1,000,000 ",": ",", // string that separates a number from the fractional portion, as in 1.99 ".": ".", // array of numbers indicating the size of each number group. // TODO: more detailed description and example groupSizes: [3], // symbol used for positive numbers "+": "+", // symbol used for negative numbers "-": "-", // symbol used for NaN (Not-A-Number) "NaN": "NaN", // symbol used for Negative Infinity negativeInfinity: "-Infinity", // symbol used for Positive Infinity positiveInfinity: "Infinity", percent: { // [negativePattern, positivePattern] // negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %" // positivePattern: one of "n %|n%|%n|% n" pattern: ["-n %", "n %"], // number of decimal places normally shown decimals: 2, // array of numbers indicating the size of each number group. // TODO: more detailed description and example groupSizes: [3], // string that separates number groups, as in 1,000,000 ",": ",", // string that separates a number from the fractional portion, as in 1.99 ".": ".", // symbol used to represent a percentage symbol: "%" }, currency: { // [negativePattern, positivePattern] // negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)" // positivePattern: one of "$n|n$|$ n|n $" pattern: ["($n)", "$n"], // number of decimal places normally shown decimals: 2, // array of numbers indicating the size of each number group. // TODO: more detailed description and example groupSizes: [3], // string that separates number groups, as in 1,000,000 ",": ",", // string that separates a number from the fractional portion, as in 1.99 ".": ".", // symbol used to represent currency symbol: "$", // code used to represent currency code: "USD" } }, // calendars defines all the possible calendars used by this culture. // There should be at least one defined with name "standard", and is the default // calendar used by the culture. // A calendar contains information about how dates are formatted, information about // the calendar's eras, a standard set of the date formats, // translations for day and month names, and if the calendar is not based on the Gregorian // calendar, conversion functions to and from the Gregorian calendar. calendars: { standard: { // name that identifies the type of calendar this is name: "Gregorian_USEnglish", // separator of parts of a date (e.g. "/" in 11/05/1955) "/": "/", // separator of parts of a time (e.g. ":" in 05:44 PM) ":": ":", // the first day of the week (0 = Sunday, 1 = Monday, etc) firstDay: 0, days: { // full day names names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // abbreviated day names namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // shortest day names namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }, months: { // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar) names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], // abbreviated month names namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""] }, // AM and PM designators in one of these forms: // The usual view, and the upper and lower case versions // [ standard, lowercase, uppercase ] // The culture does not use AM or PM (likely all standard date formats use 24 hour time) // null AM: ["AM", "am", "AM"], PM: ["PM", "pm", "PM"], eras: [ // eras in reverse chronological order. // name: the name of the era in this culture (e.g. A.D., C.E.) // start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era. // offset: offset in years from gregorian calendar { "name": "A.D.", "start": null, "offset": 0 } ], // when a two digit year is given, it will never be parsed as a four digit // year greater than this year (in the appropriate era for the culture) // Set it as a full year (e.g. 2029) or use an offset format starting from // the current year: "+19" would correspond to 2029 if the current year 2010. twoDigitYearMax: 2029, // set of predefined date and time patterns used by the culture // these represent the format someone in this culture would expect // to see given the portions of the date that are shown. patterns: { // short date pattern d: "M/d/yyyy", // long date pattern D: "dddd, MMMM dd, yyyy", // short time pattern t: "h:mm tt", // long time pattern T: "h:mm:ss tt", // long date, short time pattern f: "dddd, MMMM dd, yyyy h:mm tt", // long date, long time pattern F: "dddd, MMMM dd, yyyy h:mm:ss tt", // month/day pattern M: "MMMM dd", // month/year pattern Y: "yyyy MMMM", // S is a sortable format that does not vary by culture S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss" } // optional fields for each calendar: /* monthsGenitive: Same as months but used when the day preceeds the month. Omit if the culture has no genitive distinction in month names. For an explaination of genitive months, see http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx convert: Allows for the support of non-gregorian based calendars. This convert object is used to to convert a date to and from a gregorian calendar date to handle parsing and formatting. The two functions: fromGregorian( date ) Given the date as a parameter, return an array with parts [ year, month, day ] corresponding to the non-gregorian based year, month, and day for the calendar. toGregorian( year, month, day ) Given the non-gregorian year, month, and day, return a new Date() object set to the corresponding date in the gregorian calendar. */ } }, // For localized strings messages: {} }; Globalize.cultures["default"].calendar = Globalize.cultures["default"].calendars.standard; Globalize.cultures.en = Globalize.cultures["default"]; Globalize.cultureSelector = "en"; // // private variables // regexHex = /^0x[a-f0-9]+$/i; regexInfinity = /^[+\-]?infinity$/i; regexParseFloat = /^[+\-]?\d*\.?\d*(e[+\-]?\d+)?$/; regexTrim = /^\s+|\s+$/g; // // private JavaScript utility functions // arrayIndexOf = function (array, item) { if (array.indexOf) { return array.indexOf(item); } for (var i = 0, length = array.length; i < length; i++) { if (array[i] === item) { return i; } } return -1; }; endsWith = function (value, pattern) { return value.substr(value.length - pattern.length) === pattern; }; extend = function () { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if (typeof target === "boolean") { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if (typeof target !== "object" && !isFunction(target)) { target = {}; } for (; i < length; i++) { // Only deal with non-null/undefined values if ((options = arguments[i]) != null) { // Extend the base object for (name in options) { src = target[name]; copy = options[name]; // Prevent never-ending loop if (target === copy) { continue; } // Recurse if we're merging plain objects or arrays if (deep && copy && (isObject(copy) || (copyIsArray = isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && isArray(src) ? src : []; } else { clone = src && isObject(src) ? src : {}; } // Never move original objects, clone them target[name] = extend(deep, clone, copy); // Don't bring in undefined values } else if (copy !== undefined) { target[name] = copy; } } } } // Return the modified object return target; }; isArray = Array.isArray || function (obj) { return Object.prototype.toString.call(obj) === "[object Array]"; }; isFunction = function (obj) { return Object.prototype.toString.call(obj) === "[object Function]"; }; isObject = function (obj) { return Object.prototype.toString.call(obj) === "[object Object]"; }; startsWith = function (value, pattern) { return value.indexOf(pattern) === 0; }; trim = function (value) { return (value + "").replace(regexTrim, ""); }; truncate = function (value) { if (isNaN(value)) { return NaN; } return Math[value < 0 ? "ceil" : "floor"](value); }; zeroPad = function (str, count, left) { var l; for (l = str.length; l < count; l += 1) { str = (left ? ("0" + str) : (str + "0")); } return str; }; // // private Globalization utility functions // appendPreOrPostMatch = function (preMatch, strings) { // appends pre- and post- token match strings while removing escaped characters. // Returns a single quote count which is used to determine if the token occurs // in a string literal. var quoteCount = 0, escaped = false; for (var i = 0, il = preMatch.length; i < il; i++) { var c = preMatch.charAt(i); switch (c) { case "\'": if (escaped) { strings.push("\'"); } else { quoteCount++; } escaped = false; break; case "\\": if (escaped) { strings.push("\\"); } escaped = !escaped; break; default: strings.push(c); escaped = false; break; } } return quoteCount; }; expandFormat = function (cal, format) { // expands unspecified or single character date formats into the full pattern. format = format || "F"; var pattern, patterns = cal.patterns, len = format.length; if (len === 1) { pattern = patterns[format]; if (!pattern) { throw "Invalid date format string \'" + format + "\'."; } format = pattern; } else if (len === 2 && format.charAt(0) === "%") { // %X escape format -- intended as a custom format string that is only one character, not a built-in format. format = format.charAt(1); } return format; }; formatDate = function (value, format, culture) { var cal = culture.calendar, convert = cal.convert, ret; if (!format || !format.length || format === "i") { if (culture && culture.name.length) { if (convert) { // non-gregorian calendar, so we cannot use built-in toLocaleString() ret = formatDate(value, cal.patterns.F, culture); } else { var eraDate = new Date(value.getTime()), era = getEra(value, cal.eras); eraDate.setFullYear(getEraYear(value, cal, era)); ret = eraDate.toLocaleString(); } } else { ret = value.toString(); } return ret; } var eras = cal.eras, sortable = format === "s"; format = expandFormat(cal, format); // Start with an empty string ret = []; var hour, zeros = ["0", "00", "000"], foundDay, checkedDay, dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g, quoteCount = 0, tokenRegExp = getTokenRegExp(), converted; function padZeros(num, c) { var r, s = num + ""; if (c > 1 && s.length < c) { r = (zeros[c - 2] + s); return r.substr(r.length - c, c); } else { r = s; } return r; } function hasDay() { if (foundDay || checkedDay) { return foundDay; } foundDay = dayPartRegExp.test(format); checkedDay = true; return foundDay; } function getPart(date, part) { if (converted) { return converted[part]; } switch (part) { case 0: return date.getFullYear(); case 1: return date.getMonth(); case 2: return date.getDate(); default: throw "Invalid part value " + part; } } if (!sortable && convert) { converted = convert.fromGregorian(value); } for (; ;) { // Save the current index var index = tokenRegExp.lastIndex, // Look for the next pattern ar = tokenRegExp.exec(format); // Append the text before the pattern (or the end of the string if not found) var preMatch = format.slice(index, ar ? ar.index : format.length); quoteCount += appendPreOrPostMatch(preMatch, ret); if (!ar) { break; } // do not replace any matches that occur inside a string literal. if (quoteCount % 2) { ret.push(ar[0]); continue; } var current = ar[0], clength = current.length; switch (current) { case "ddd": //Day of the week, as a three-letter abbreviation case "dddd": // Day of the week, using the full name var names = (clength === 3) ? cal.days.namesAbbr : cal.days.names; ret.push(names[value.getDay()]); break; case "d": // Day of month, without leading zero for single-digit days case "dd": // Day of month, with leading zero for single-digit days foundDay = true; ret.push( padZeros(getPart(value, 2), clength) ); break; case "MMM": // Month, as a three-letter abbreviation case "MMMM": // Month, using the full name var part = getPart(value, 1); ret.push( (cal.monthsGenitive && hasDay()) ? (cal.monthsGenitive[clength === 3 ? "namesAbbr" : "names"][part]) : (cal.months[clength === 3 ? "namesAbbr" : "names"][part]) ); break; case "M": // Month, as digits, with no leading zero for single-digit months case "MM": // Month, as digits, with leading zero for single-digit months ret.push( padZeros(getPart(value, 1) + 1, clength) ); break; case "y": // Year, as two digits, but with no leading zero for years less than 10 case "yy": // Year, as two digits, with leading zero for years less than 10 case "yyyy": // Year represented by four full digits part = converted ? converted[0] : getEraYear(value, cal, getEra(value, eras), sortable); if (clength < 4) { part = part % 100; } ret.push( padZeros(part, clength) ); break; case "h": // Hours with no leading zero for single-digit hours, using 12-hour clock case "hh": // Hours with leading zero for single-digit hours, using 12-hour clock hour = value.getHours() % 12; if (hour === 0) hour = 12; ret.push( padZeros(hour, clength) ); break; case "H": // Hours with no leading zero for single-digit hours, using 24-hour clock case "HH": // Hours with leading zero for single-digit hours, using 24-hour clock ret.push( padZeros(value.getHours(), clength) ); break; case "m": // Minutes with no leading zero for single-digit minutes case "mm": // Minutes with leading zero for single-digit minutes ret.push( padZeros(value.getMinutes(), clength) ); break; case "s": // Seconds with no leading zero for single-digit seconds case "ss": // Seconds with leading zero for single-digit seconds ret.push( padZeros(value.getSeconds(), clength) ); break; case "t": // One character am/pm indicator ("a" or "p") case "tt": // Multicharacter am/pm indicator part = value.getHours() < 12 ? (cal.AM ? cal.AM[0] : " ") : (cal.PM ? cal.PM[0] : " "); ret.push(clength === 1 ? part.charAt(0) : part); break; case "f": // Deciseconds case "ff": // Centiseconds case "fff": // Milliseconds ret.push( padZeros(value.getMilliseconds(), 3).substr(0, clength) ); break; case "z": // Time zone offset, no leading zero case "zz": // Time zone offset with leading zero hour = value.getTimezoneOffset() / 60; ret.push( (hour <= 0 ? "+" : "-") + padZeros(Math.floor(Math.abs(hour)), clength) ); break; case "zzz": // Time zone offset with leading zero hour = value.getTimezoneOffset() / 60; ret.push( (hour <= 0 ? "+" : "-") + padZeros(Math.floor(Math.abs(hour)), 2) + // Hard coded ":" separator, rather than using cal.TimeSeparator // Repeated here for consistency, plus ":" was already assumed in date parsing. ":" + padZeros(Math.abs(value.getTimezoneOffset() % 60), 2) ); break; case "g": case "gg": if (cal.eras) { ret.push( cal.eras[getEra(value, eras)].name ); } break; case "/": ret.push(cal["/"]); break; default: throw "Invalid date format pattern \'" + current + "\'."; } } return ret.join(""); }; // formatNumber (function () { var expandNumber; expandNumber = function (number, precision, formatInfo) { var groupSizes = formatInfo.groupSizes, curSize = groupSizes[0], curGroupIndex = 1, factor = Math.pow(10, precision), rounded = Math.round(number * factor) / factor; if (!isFinite(rounded)) { rounded = number; } number = rounded; var numberString = number + "", right = "", split = numberString.split(/e/i), exponent = split.length > 1 ? parseInt(split[1], 10) : 0; numberString = split[0]; split = numberString.split("."); numberString = split[0]; right = split.length > 1 ? split[1] : ""; var l; if (exponent > 0) { right = zeroPad(right, exponent, false); numberString += right.slice(0, exponent); right = right.substr(exponent); } else if (exponent < 0) { exponent = -exponent; numberString = zeroPad(numberString, exponent + 1, true); right = numberString.slice(-exponent, numberString.length) + right; numberString = numberString.slice(0, -exponent); } if (precision > 0) { right = formatInfo["."] + ((right.length > precision) ? right.slice(0, precision) : zeroPad(right, precision)); } else { right = ""; } var stringIndex = numberString.length - 1, sep = formatInfo[","], ret = ""; while (stringIndex >= 0) { if (curSize === 0 || curSize > stringIndex) { return numberString.slice(0, stringIndex + 1) + (ret.length ? (sep + ret + right) : right); } ret = numberString.slice(stringIndex - curSize + 1, stringIndex + 1) + (ret.length ? (sep + ret) : ""); stringIndex -= curSize; if (curGroupIndex < groupSizes.length) { curSize = groupSizes[curGroupIndex]; curGroupIndex++; } } return numberString.slice(0, stringIndex + 1) + sep + ret + right; }; formatNumber = function (value, format, culture) { if (!isFinite(value)) { if (value === Infinity) { return culture.numberFormat.positiveInfinity; } if (value === -Infinity) { return culture.numberFormat.negativeInfinity; } return culture.numberFormat["NaN"]; } if (!format || format === "i") { return culture.name.length ? value.toLocaleString() : value.toString(); } format = format || "D"; var nf = culture.numberFormat, number = Math.abs(value), precision = -1, pattern; if (format.length > 1) precision = parseInt(format.slice(1), 10); var current = format.charAt(0).toUpperCase(), formatInfo; switch (current) { case "D": pattern = "n"; number = truncate(number); if (precision !== -1) { number = zeroPad("" + number, precision, true); } if (value < 0) number = "-" + number; break; case "N": formatInfo = nf; /* falls through */ case "C": formatInfo = formatInfo || nf.currency; /* falls through */ case "P": formatInfo = formatInfo || nf.percent; pattern = value < 0 ? formatInfo.pattern[0] : (formatInfo.pattern[1] || "n"); if (precision === -1) precision = formatInfo.decimals; number = expandNumber(number * (current === "P" ? 100 : 1), precision, formatInfo); break; default: throw "Bad number format specifier: " + current; } var patternParts = /n|\$|-|%/g, ret = ""; for (; ;) { var index = patternParts.lastIndex, ar = patternParts.exec(pattern); ret += pattern.slice(index, ar ? ar.index : pattern.length); if (!ar) { break; } switch (ar[0]) { case "n": ret += number; break; case "$": ret += nf.currency.symbol; break; case "-": // don't make 0 negative if (/[1-9]/.test(number)) { ret += nf["-"]; } break; case "%": ret += nf.percent.symbol; break; } } return ret; }; }()); getTokenRegExp = function () { // regular expression for matching date and time tokens in format strings. return (/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g); }; getEra = function (date, eras) { if (!eras) return 0; var start, ticks = date.getTime(); for (var i = 0, l = eras.length; i < l; i++) { start = eras[i].start; if (start === null || ticks >= start) { return i; } } return 0; }; getEraYear = function (date, cal, era, sortable) { var year = date.getFullYear(); if (!sortable && cal.eras) { // convert normal gregorian year to era-shifted gregorian // year by subtracting the era offset year -= cal.eras[era].offset; } return year; }; // parseExact (function () { var expandYear, getDayIndex, getMonthIndex, getParseRegExp, outOfRange, toUpper, toUpperArray; expandYear = function (cal, year) { // expands 2-digit year into 4 digits. if (year < 100) { var now = new Date(), era = getEra(now), curr = getEraYear(now, cal, era), twoDigitYearMax = cal.twoDigitYearMax; twoDigitYearMax = typeof twoDigitYearMax === "string" ? new Date().getFullYear() % 100 + parseInt(twoDigitYearMax, 10) : twoDigitYearMax; year += curr - (curr % 100); if (year > twoDigitYearMax) { year -= 100; } } return year; }; getDayIndex = function (cal, value, abbr) { var ret, days = cal.days, upperDays = cal._upperDays; if (!upperDays) { cal._upperDays = upperDays = [ toUpperArray(days.names), toUpperArray(days.namesAbbr), toUpperArray(days.namesShort) ]; } value = toUpper(value); if (abbr) { ret = arrayIndexOf(upperDays[1], value); if (ret === -1) { ret = arrayIndexOf(upperDays[2], value); } } else { ret = arrayIndexOf(upperDays[0], value); } return ret; }; getMonthIndex = function (cal, value, abbr) { var months = cal.months, monthsGen = cal.monthsGenitive || cal.months, upperMonths = cal._upperMonths, upperMonthsGen = cal._upperMonthsGen; if (!upperMonths) { cal._upperMonths = upperMonths = [ toUpperArray(months.names), toUpperArray(months.namesAbbr) ]; cal._upperMonthsGen = upperMonthsGen = [ toUpperArray(monthsGen.names), toUpperArray(monthsGen.namesAbbr) ]; } value = toUpper(value); var i = arrayIndexOf(abbr ? upperMonths[1] : upperMonths[0], value); if (i < 0) { i = arrayIndexOf(abbr ? upperMonthsGen[1] : upperMonthsGen[0], value); } return i; }; getParseRegExp = function (cal, format) { // converts a format string into a regular expression with groups that // can be used to extract date fields from a date string. // check for a cached parse regex. var re = cal._parseRegExp; if (!re) { cal._parseRegExp = re = {}; } else { var reFormat = re[format]; if (reFormat) { return reFormat; } } // expand single digit formats, then escape regular expression characters. var expFormat = expandFormat(cal, format).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1"), regexp = ["^"], groups = [], index = 0, quoteCount = 0, tokenRegExp = getTokenRegExp(), match; // iterate through each date token found. while ((match = tokenRegExp.exec(expFormat)) !== null) { var preMatch = expFormat.slice(index, match.index); index = tokenRegExp.lastIndex; // don't replace any matches that occur inside a string literal. quoteCount += appendPreOrPostMatch(preMatch, regexp); if (quoteCount % 2) { regexp.push(match[0]); continue; } // add a regex group for the token. var m = match[0], len = m.length, add; switch (m) { case "dddd": case "ddd": case "MMMM": case "MMM": case "gg": case "g": add = "(\\D+)"; break; case "tt": case "t": add = "(\\D*)"; break; case "yyyy": case "fff": case "ff": case "f": add = "(\\d{" + len + "})"; break; case "dd": case "d": case "MM": case "M": case "yy": case "y": case "HH": case "H": case "hh": case "h": case "mm": case "m": case "ss": case "s": add = "(\\d\\d?)"; break; case "zzz": add = "([+-]?\\d\\d?:\\d{2})"; break; case "zz": case "z": add = "([+-]?\\d\\d?)"; break; case "/": add = "(\\/)"; break; default: throw "Invalid date format pattern \'" + m + "\'."; } if (add) { regexp.push(add); } groups.push(match[0]); } appendPreOrPostMatch(expFormat.slice(index), regexp); regexp.push("$"); // allow whitespace to differ when matching formats. var regexpStr = regexp.join("").replace(/\s+/g, "\\s+"), parseRegExp = { "regExp": regexpStr, "groups": groups }; // cache the regex for this format. return re[format] = parseRegExp; }; outOfRange = function (value, low, high) { return value < low || value > high; }; toUpper = function (value) { // "he-IL" has non-breaking space in weekday names. return value.split("\u00A0").join(" ").toUpperCase(); }; toUpperArray = function (arr) { var results = []; for (var i = 0, l = arr.length; i < l; i++) { results[i] = toUpper(arr[i]); } return results; }; parseExact = function (value, format, culture) { // try to parse the date string by matching against the format string // while using the specified culture for date field names. value = trim(value); var cal = culture.calendar, // convert date formats into regular expressions with groupings. // use the regexp to determine the input format and extract the date fields. parseInfo = getParseRegExp(cal, format), match = new RegExp(parseInfo.regExp).exec(value); if (match === null) { return null; } // found a date format that matches the input. var groups = parseInfo.groups, era = null, year = null, month = null, date = null, weekDay = null, hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null, pmHour = false; // iterate the format groups to extract and set the date fields. for (var j = 0, jl = groups.length; j < jl; j++) { var matchGroup = match[j + 1]; if (matchGroup) { var current = groups[j], clength = current.length, matchInt = parseInt(matchGroup, 10); switch (current) { case "dd": case "d": // Day of month. date = matchInt; // check that date is generally in valid range, also checking overflow below. if (outOfRange(date, 1, 31)) return null; break; case "MMM": case "MMMM": month = getMonthIndex(cal, matchGroup, clength === 3); if (outOfRange(month, 0, 11)) return null; break; case "M": case "MM": // Month. month = matchInt - 1; if (outOfRange(month, 0, 11)) return null; break; case "y": case "yy": case "yyyy": year = clength < 4 ? expandYear(cal, matchInt) : matchInt; if (outOfRange(year, 0, 9999)) return null; break; case "h": case "hh": // Hours (12-hour clock). hour = matchInt; if (hour === 12) hour = 0; if (outOfRange(hour, 0, 11)) return null; break; case "H": case "HH": // Hours (24-hour clock). hour = matchInt; if (outOfRange(hour, 0, 23)) return null; break; case "m": case "mm": // Minutes. min = matchInt; if (outOfRange(min, 0, 59)) return null; break; case "s": case "ss": // Seconds. sec = matchInt; if (outOfRange(sec, 0, 59)) return null; break; case "tt": case "t": // AM/PM designator. // see if it is standard, upper, or lower case PM. If not, ensure it is at least one of // the AM tokens. If not, fail the parse for this format. pmHour = cal.PM && (matchGroup === cal.PM[0] || matchGroup === cal.PM[1] || matchGroup === cal.PM[2]); if ( !pmHour && ( !cal.AM || (matchGroup !== cal.AM[0] && matchGroup !== cal.AM[1] && matchGroup !== cal.AM[2]) ) ) return null; break; case "f": // Deciseconds. case "ff": // Centiseconds. case "fff": // Milliseconds. msec = matchInt * Math.pow(10, 3 - clength); if (outOfRange(msec, 0, 999)) return null; break; case "ddd": // Day of week. case "dddd": // Day of week. weekDay = getDayIndex(cal, matchGroup, clength === 3); if (outOfRange(weekDay, 0, 6)) return null; break; case "zzz": // Time zone offset in +/- hours:min. var offsets = matchGroup.split(/:/); if (offsets.length !== 2) return null; hourOffset = parseInt(offsets[0], 10); if (outOfRange(hourOffset, -12, 13)) return null; var minOffset = parseInt(offsets[1], 10); if (outOfRange(minOffset, 0, 59)) return null; tzMinOffset = (hourOffset * 60) + (startsWith(matchGroup, "-") ? -minOffset : minOffset); break; case "z": case "zz": // Time zone offset in +/- hours. hourOffset = matchInt; if (outOfRange(hourOffset, -12, 13)) return null; tzMinOffset = hourOffset * 60; break; case "g": case "gg": var eraName = matchGroup; if (!eraName || !cal.eras) return null; eraName = trim(eraName.toLowerCase()); for (var i = 0, l = cal.eras.length; i < l; i++) { if (eraName === cal.eras[i].name.toLowerCase()) { era = i; break; } } // could not find an era with that name if (era === null) return null; break; } } } var result = new Date(), defaultYear, convert = cal.convert; defaultYear = convert ? convert.fromGregorian(result)[0] : result.getFullYear(); if (year === null) { year = defaultYear; } else if (cal.eras) { // year must be shifted to normal gregorian year // but not if year was not specified, its already normal gregorian // per the main if clause above. year += cal.eras[(era || 0)].offset; } // set default day and month to 1 and January, so if unspecified, these are the defaults // instead of the current day/month. if (month === null) { month = 0; } if (date === null) { date = 1; } // now have year, month, and date, but in the culture's calendar. // convert to gregorian if necessary if (convert) { result = convert.toGregorian(year, month, date); // conversion failed, must be an invalid match if (result === null) return null; } else { // have to set year, month and date together to avoid overflow based on current date. result.setFullYear(year, month, date); // check to see if date overflowed for specified month (only checked 1-31 above). if (result.getDate() !== date) return null; // invalid day of week. if (weekDay !== null && result.getDay() !== weekDay) { return null; } } // if pm designator token was found make sure the hours fit the 24-hour clock. if (pmHour && hour < 12) { hour += 12; } result.setHours(hour, min, sec, msec); if (tzMinOffset !== null) { // adjust timezone to utc before applying local offset. var adjustedMin = result.getMinutes() - (tzMinOffset + result.getTimezoneOffset()); // Safari limits hours and minutes to the range of -127 to 127. We need to use setHours // to ensure both these fields will not exceed this range. adjustedMin will range // somewhere between -1440 and 1500, so we only need to split this into hours. result.setHours(result.getHours() + parseInt(adjustedMin / 60, 10), adjustedMin % 60); } return result; }; }()); parseNegativePattern = function (value, nf, negativePattern) { var neg = nf["-"], pos = nf["+"], ret; switch (negativePattern) { case "n -": neg = " " + neg; pos = " " + pos; /* falls through */ case "n-": if (endsWith(value, neg)) { ret = ["-", value.substr(0, value.length - neg.length)]; } else if (endsWith(value, pos)) { ret = ["+", value.substr(0, value.length - pos.length)]; } break; case "- n": neg += " "; pos += " "; /* falls through */ case "-n": if (startsWith(value, neg)) { ret = ["-", value.substr(neg.length)]; } else if (startsWith(value, pos)) { ret = ["+", value.substr(pos.length)]; } break; case "(n)": if (startsWith(value, "(") && endsWith(value, ")")) { ret = ["-", value.substr(1, value.length - 2)]; } break; } return ret || ["", value]; }; // // public instance functions // Globalize.prototype.findClosestCulture = function (cultureSelector) { return Globalize.findClosestCulture.call(this, cultureSelector); }; Globalize.prototype.format = function (value, format, cultureSelector) { return Globalize.format.call(this, value, format, cultureSelector); }; Globalize.prototype.localize = function (key, cultureSelector) { return Globalize.localize.call(this, key, cultureSelector); }; Globalize.prototype.parseInt = function (value, radix, cultureSelector) { return Globalize.parseInt.call(this, value, radix, cultureSelector); }; Globalize.prototype.parseFloat = function (value, radix, cultureSelector) { return Globalize.parseFloat.call(this, value, radix, cultureSelector); }; Globalize.prototype.culture = function (cultureSelector) { return Globalize.culture.call(this, cultureSelector); }; // // public singleton functions // Globalize.addCultureInfo = function (cultureName, baseCultureName, info) { var base = {}, isNew = false; if (typeof cultureName !== "string") { // cultureName argument is optional string. If not specified, assume info is first // and only argument. Specified info deep-extends current culture. info = cultureName; cultureName = this.culture().name; base = this.cultures[cultureName]; } else if (typeof baseCultureName !== "string") { // baseCultureName argument is optional string. If not specified, assume info is second // argument. Specified info deep-extends specified culture. // If specified culture does not exist, create by deep-extending default info = baseCultureName; isNew = (this.cultures[cultureName] == null); base = this.cultures[cultureName] || this.cultures["default"]; } else { // cultureName and baseCultureName specified. Assume a new culture is being created // by deep-extending an specified base culture isNew = true; base = this.cultures[baseCultureName]; } this.cultures[cultureName] = extend(true, {}, base, info ); // Make the standard calendar the current culture if it's a new culture if (isNew) { this.cultures[cultureName].calendar = this.cultures[cultureName].calendars.standard; } }; Globalize.findClosestCulture = function (name) { var match; if (!name) { return this.findClosestCulture(this.cultureSelector) || this.cultures["default"]; } if (typeof name === "string") { name = name.split(","); } if (isArray(name)) { var lang, cultures = this.cultures, list = name, i, l = list.length, prioritized = []; for (i = 0; i < l; i++) { name = trim(list[i]); var pri, parts = name.split(";"); lang = trim(parts[0]); if (parts.length === 1) { pri = 1; } else { name = trim(parts[1]); if (name.indexOf("q=") === 0) { name = name.substr(2); pri = parseFloat(name); pri = isNaN(pri) ? 0 : pri; } else { pri = 1; } } prioritized.push({ lang: lang, pri: pri }); } prioritized.sort(function (a, b) { if (a.pri < b.pri) { return 1; } else if (a.pri > b.pri) { return -1; } return 0; }); // exact match for (i = 0; i < l; i++) { lang = prioritized[i].lang; match = cultures[lang]; if (match) { return match; } } // neutral language match for (i = 0; i < l; i++) { lang = prioritized[i].lang; do { var index = lang.lastIndexOf("-"); if (index === -1) { break; } // strip off the last part. e.g. en-US => en lang = lang.substr(0, index); match = cultures[lang]; if (match) { return match; } } while (1); } // last resort: match first culture using that language for (i = 0; i < l; i++) { lang = prioritized[i].lang; for (var cultureKey in cultures) { var culture = cultures[cultureKey]; if (culture.language == lang) { return culture; } } } } else if (typeof name === "object") { return name; } return match || null; }; Globalize.format = function (value, format, cultureSelector) { var culture = this.findClosestCulture(cultureSelector); if (value instanceof Date) { value = formatDate(value, format, culture); } else if (typeof value === "number") { value = formatNumber(value, format, culture); } return value; }; //custom Functions Written As Wrapper. By default The culture Passes in These function is the Customized Culture Globalize.toShortDate = function (value) { return this.format(value, "d", "en-CUS"); }; Globalize.toLongDate = function (value) { return this.format(value, "D", "en-CUS"); }; Globalize.InitGlobalCulture = function (value) { var obj = value; var jsonObj = { name: obj.Name,//"en-CUS" englishName: "English (Custom)", nativeName: "English (Custom)", isRTL: ((obj.TextDirection == "LTR") ? false : true), language: "en", numberFormat: { pattern: ["-n"], decimals: obj.DecimalDigits, ",": obj.GroupSeparator, ".": obj.DecimalSymbol, groupSizes: obj.DigitGrouping, "+": obj.PositiveSymbol, "-": obj.NegativeSymbol, "NaN": "NaN", negativeInfinity: "-Infinity", positiveInfinity: "Infinity", percent: { pattern: ["-n %", "n %"], decimals: obj.DecimalDigits, groupSizes: obj.DigitGrouping, ",": obj.GroupSeparator, ".": obj.DecimalSymbol, symbol: "%" }, currency: { pattern: ["($n)", "$n"], decimals: obj.DecimalDigits, groupSizes: obj.DigitGrouping, ",": obj.GroupSeparator, ".": obj.DecimalSymbol, symbol: obj.CurrencySymbol, code: obj.CurrencyCode } }, calendars: { standard: { name: "Custom_USEnglish", "/": obj.DateSeparator, ":": obj.TimeSeparator, firstDay: 0, days: { names: obj.FullDayName, namesAbbr: obj.AbbreviatedDayName, namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }, months: { names: obj.FullMonthName, namesAbbr: obj.AbbreviatedMonthName }, AM: [obj.AmDesignator], PM: [obj.PmDesignator], eras: [ { "name": "A.D.", "start": null, "offset": 0 } ], twoDigitYearMax: 2029, patterns: { // short date pattern d: obj.ShortDateFormat, // long date pattern D: obj.LongDateFormat, // short time pattern t: obj.TimeFormat, // long time pattern T: "h:mm:ss tt", // long date, short time pattern f: "dddd, MMMM dd, yyyy h:mm tt", // long date, long time pattern F: "dddd, MMMM dd, yyyy h:mm:ss tt", // month/day pattern M: "MMMM dd", // month/year pattern Y: "yyyy MMMM", // S is a sortable format that does not vary by culture S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss" } } } }; this.addCultureInfo(obj.Name, "default", jsonObj); }; Globalize.toJqueryUiFormat = function (dateStr) { if (dateStr.indexOf("yyyy") != -1) { dateStr = dateStr.replace("yyyy", "yy"); } else if (dateStr.indexOf("yy") != -1) { dateStr = dateStr.replace("yy", "y"); } if (dateStr.indexOf("MMMM") != -1) { dateStr = dateStr.replace("MMMM", "MM"); } else if (dateStr.indexOf("MMM") != -1) { dateStr = dateStr.replace("MMM", "M"); } else if (dateStr.indexOf("MM") != -1) { dateStr = dateStr.replace("MM", "mm"); } else if (dateStr.indexOf("M") != -1) { dateStr = dateStr.replace("M", "m"); } return dateStr; }; // custom function definition ends Globalize.localize = function (key, cultureSelector) { return this.findClosestCulture(cultureSelector).messages[key] || this.cultures["default"].messages[key]; }; Globalize.parseDate = function (value, formats, culture) { culture = this.findClosestCulture(culture); var date, prop, patterns; if (formats) { if (typeof formats === "string") { formats = [formats]; } if (formats.length) { for (var i = 0, l = formats.length; i < l; i++) { var format = formats[i]; if (format) { date = parseExact(value, format, culture); if (date) { break; } } } } } else { patterns = culture.calendar.patterns; for (prop in patterns) { date = parseExact(value, patterns[prop], culture); if (date) { break; } } } return date || null; }; Globalize.parseInt = function (value, radix, cultureSelector) { return truncate(Globalize.parseFloat(value, radix, cultureSelector)); }; Globalize.parseFloat = function (value, radix, cultureSelector) { // radix argument is optional if (typeof radix !== "number") { cultureSelector = radix; radix = 10; } var culture = this.findClosestCulture(cultureSelector); var ret = NaN, nf = culture.numberFormat; if (value.indexOf(culture.numberFormat.currency.symbol) > -1) { // remove currency symbol value = value.replace(culture.numberFormat.currency.symbol, ""); // replace decimal seperator value = value.replace(culture.numberFormat.currency["."], culture.numberFormat["."]); } //Remove percentage character from number string before parsing if (value.indexOf(culture.numberFormat.percent.symbol) > -1) { value = value.replace(culture.numberFormat.percent.symbol, ""); } // remove spaces: leading, trailing and between - and number. Used for negative currency pt-BR value = value.replace(/ /g, ""); // allow infinity or hexidecimal if (regexInfinity.test(value)) { ret = parseFloat(value); } else if (!radix && regexHex.test(value)) { ret = parseInt(value, 16); } else { // determine sign and number var signInfo = parseNegativePattern(value, nf, nf.pattern[0]), sign = signInfo[0], num = signInfo[1]; // #44 - try parsing as "(n)" if (sign === "" && nf.pattern[0] !== "(n)") { signInfo = parseNegativePattern(value, nf, "(n)"); sign = signInfo[0]; num = signInfo[1]; } // try parsing as "-n" if (sign === "" && nf.pattern[0] !== "-n") { signInfo = parseNegativePattern(value, nf, "-n"); sign = signInfo[0]; num = signInfo[1]; } sign = sign || "+"; // determine exponent and number var exponent, intAndFraction, exponentPos = num.indexOf("e"); if (exponentPos < 0) exponentPos = num.indexOf("E"); if (exponentPos < 0) { intAndFraction = num; exponent = null; } else { intAndFraction = num.substr(0, exponentPos); exponent = num.substr(exponentPos + 1); } // determine decimal position var integer, fraction, decSep = nf["."], decimalPos = intAndFraction.indexOf(decSep); if (decimalPos < 0) { integer = intAndFraction; fraction = null; } else { integer = intAndFraction.substr(0, decimalPos); fraction = intAndFraction.substr(decimalPos + decSep.length); } // handle groups (e.g. 1,000,000) var groupSep = nf[","]; integer = integer.split(groupSep).join(""); var altGroupSep = groupSep.replace(/\u00A0/g, " "); if (groupSep !== altGroupSep) { integer = integer.split(altGroupSep).join(""); } // build a natively parsable number string var p = sign + integer; if (fraction !== null) { p += "." + fraction; } if (exponent !== null) { // exponent itself may have a number patternd var expSignInfo = parseNegativePattern(exponent, nf, "-n"); p += "e" + (expSignInfo[0] || "+") + expSignInfo[1]; } if (regexParseFloat.test(p)) { ret = parseFloat(p); } } return ret; }; Globalize.culture = function (cultureSelector) { // setter if (typeof cultureSelector !== "undefined") { this.cultureSelector = cultureSelector; } // getter return this.findClosestCulture(cultureSelector) || this.cultures["default"]; }; }(this)); $(function () { i18N = window.i18N || {}; var contentModule = { //settings and defaults culture: { initCulture: function (cultureSettings, cultureCode) { if (cultureSettings) { } else { if (this.name == cultureCode) { return; } else { cultureSettings = getCulture(cultureCode); } } cultureSettings = Sys.Serialization.JavaScriptSerializer.deserialize(cultureSettings); contentModule.currency.setCurrency(cultureSettings.CurrencyCode); TemplarContext.CultureInfo.Culture = cultureSettings.Name; Globalize.InitGlobalCulture(cultureSettings); contentModule.initSettings(cultureSettings); contentModule.resources.setResources(cultureSettings); //initilizes bootstrap calender with culture set in the i18N object. this.InitilizeBootstrapCalender(); }, /* The method registers a new culture for bootstrap calender plugin form either the passed culture or the culture set in the i18N object. */ InitilizeBootstrapCalender: function (callenderObjectValues, name) { if (callenderObjectValues != null && name != null) { // create callender object from the passsed values if (typeof $.fn.datetimepicker != "undefined") { $.fn.datetimepicker.dates[name] = { days: callenderObjectValues.days, daysShort: callenderObjectValues.daysShort, daysMin: callenderObjectValues.daysMin, months: callenderObjectValues.months, monthsShort: callenderObjectValues.monthsShort, today: callenderObjectValues.today, clear: callenderObjectValues.clear }; } // create callender object from the passsed values if (typeof $.fn.datepicker != "undefined") { $.fn.datepicker.dates[name] = { days: callenderObjectValues.days, daysShort: callenderObjectValues.daysShort, daysMin: callenderObjectValues.daysMin, months: callenderObjectValues.months, monthsShort: callenderObjectValues.monthsShort, today: callenderObjectValues.today, clear: callenderObjectValues.clear }; } } else { // create callender object from the current culture in i18N if (typeof $.fn.datetimepicker != "undefined") { $.fn.datetimepicker.dates[i18N.content.culture.name] = { days: i18N.content.date.fullDayName, daysShort: i18N.content.date.shortDayName, daysMin: i18N.content.date.shortDayName, months: i18N.content.date.fullMonthsName, monthsShort: i18N.content.date.shortMonthsName, today: i18N.content.resources.TodayDispText, clear: i18N.content.resources.ClearDispText, yearText: i18N.content.resources.YearDispText, monthText: i18N.content.resources.MonthDispText }; } // create callender object from the current culture in i18N if (typeof $.fn.datepicker != "undefined") { $.fn.datepicker.dates[i18N.content.culture.name] = { days: i18N.content.date.fullDayName, daysShort: i18N.content.date.shortDayName, daysMin: i18N.content.date.shortDayName, months: i18N.content.date.fullMonthsName, monthsShort: i18N.content.date.shortMonthsName, today: i18N.content.resources.TodayDispText, clear: i18N.content.resources.ClearDispText }; } } }, name: 'en-US', language: 'en', isRTL: false }, currency: { symbol: '$', code: 'USD', setCurrency: function (currencyCode) { this.code = currencyCode; } }, date: { shortDate: "MM/dd/yyyy", longDate: "dd MMMM yyyy", shortTime: "hh:mm", longTime: "hh:mm:ss", amDesignator: "AM", pmDesignator: "PM", fullMonthsName: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], shortMonthsName: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], fullDayName: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDayName: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] }, number: { decimals: 2, groupSize: 3 }, distance: { }, resources: { TodayDispText:"Today", ClearDispText: "Clear", MonthDispText: "Month", YearDispText : "Year", setResources: function (cultureSettings) { this.TodayDispText = cultureSettings.TodayDispText; this.ClearDispText = cultureSettings.ClearDispText; this.MonthDispText = cultureSettings.MonthDispText; this.YearDispText = cultureSettings.YearDispText; } }, initSettings: function (cultureSettings) { var culture = Globalize.culture(cultureSettings.Name); // culture this.culture.name = culture.name; this.culture.isRTL = culture.isRTL; this.culture.language = culture.language; //date this.date.shortDate = culture.calendar.patterns.d || this.date.shortDate; this.date.longDate = culture.calendar.patterns.D || this.date.longDate; this.date.shortTime = culture.calendar.patterns.t || this.date.shortTime; this.date.longTime = culture.calendar.patterns.T || this.date.longTime; this.date.fullDayName = culture.calendar.days.names || this.date.fullDayName; this.date.shortDayName = culture.calendar.days.namesAbbr || this.date.shortDayName; this.date.fullMonthsName = culture.calendar.months.names.slice(0, 12) || this.date.fullMonthsName; this.date.shortMonthsName = culture.calendar.months.namesAbbr.slice(0, 12) || this.date.shortMonthsName; this.date.amDesignator = culture.calendar.AM[0] || "AM"; this.date.pmDesignator = culture.calendar.PM[0] || "PM"; //currency this.currency.symbol = culture.numberFormat.currency.symbol; //this.currency.code = culture.numberFormat.currency.code; //number this.number.decimals = culture.numberFormat.decimals; this.number.groupSize = culture.numberFormat.groupSizes[0]; //distance }, getCulture: function (cultureCode) { // make ajax call to get culture here } }; var dataFormatModule = { currency: { currencyFormat: function (amt) { if (amt == undefined || amt == null) { return NaN; } amt = typeof (amt) === "number" ? amt : Globalize.parseFloat(amt); var formatedAmount = Globalize.format(amt, "c"); var lenOfCode = contentModule.currency.symbol.length; if (lenOfCode > 1) { return formatedAmount.slice(0, lenOfCode) + " " + formatedAmount.slice(lenOfCode); } return formatedAmount; }, intCurrencyFormat: function (amt) { if (amt == undefined || amt == null) { return NaN; } amt = typeof (amt) === "number" ? amt : Globalize.parseFloat(amt); amt = Math.ceil(amt); var formatedAmount = Globalize.format(amt, "c0"); var lenOfCode = contentModule.currency.symbol.length; if (lenOfCode > 1) { return formatedAmount.slice(0, lenOfCode) + " " + formatedAmount.slice(lenOfCode); } return formatedAmount; } }, date: { _todate: function (date, inputFormat) { var returnDate = date; if (typeof (date) === "object") returnDate = date; else { if (!inputFormat) inputFormat = "MM/dd/yyyy"; returnDate = Globalize.parseDate(date, inputFormat); if (returnDate == null) returnDate = Globalize.parseDate(date, inputFormat, "en-us"); } return returnDate; }, longDate: function (date, inputFormat) {//this will return value in dddd, dd MMMM yyyy if (date) { date = this._todate(date, inputFormat); return Globalize.format(date, "D"); } return ''; }, shortDate: function (date, inputFormat) { // this will return value in MM/dd/yyyy if (date) { date = this._todate(date, inputFormat); return Globalize.format(date, "d"); } return ''; }, longShortDate: function (date, inputFormat) { //this will return value in ddd, dd MMM yyyy if (date) { date = this._todate(date, inputFormat); return Globalize.format(date, "ddd, dd MMM yyyy"); } return ''; }, //longDateLongTime: function (date, inputFormat) { // if (date) { // //date = typeof (date) === "object" ? date : Globalize.parseDate(date, "MM/dd/yyyy"); // date = this._todate(date, inputFormat); // return Globalize.format(date, "F"); // } // return ''; //}, //longDateShortTime: function (date, inputFormat) { // if (date) { // // date = typeof (date) === "object" ? date : Globalize.parseDate(date, "MM/dd/yyyy"); // date = this._todate(date, inputFormat); // return Globalize.format(date, "f"); // } // return ''; //}, //shortDateLongTime: function (date, inputFormat) { // if (date) { // // date = typeof (date) === "object" ? date : Globalize.parseDate(date, "MM/dd/yyyy"); // date = this._todate(date, inputFormat); // //return Globalize.format(date, "d") + " " + Globalize.format(date, 'T'); // return Globalize.format(date, "ddd, dd MMM yyyy") + " " + Globalize.format(date, 'T'); // } // return ''; //}, //shortDateShortTime: function (date, inputFormat) { // if (date) { // //date = typeof (date) === "object" ? date : Globalize.parseDate(date, "MM/dd/yyyy"); // date = this._todate(date, inputFormat); // // return Globalize.format(date, "d") + " " + Globalize.format(date, 't'); // return Globalize.format(date, "ddd, dd MMM yyyy") + " " + Globalize.format(date, 't'); // } // return ''; //}, longShortDateShortTime: function (date, inputFormat) { if (date) { date = this._todate(date, inputFormat); return Globalize.format(date, "ddd, dd MMM yyyy") + " " + Globalize.format(date, 't'); } return ''; }, shortTime: function (date) { if (date) { date = typeof (date) === "object" ? date : Globalize.parseDate(date, "MM/dd/yyyy"); return Globalize.format(date, "t"); } return ''; }, longTime: function (date) { if (date) { date = typeof (date) === "object" ? date : Globalize.parseDate(date, "MM/dd/yyyy"); return Globalize.format(date, "T"); } return ''; }, shortDateMonth: function (date, inputFormat) { if (date) { date = this._todate(date, inputFormat); return Globalize.format(date, "M"); } return ''; }, toJqueryUiFormat: function (dateStr) { if (dateStr.indexOf("MMMM") != -1) { dateStr = dateStr.replace("MMMM", "MM"); } else if (dateStr.indexOf("MMM") != -1) { dateStr = dateStr.replace("MMM", "M"); } else if (dateStr.indexOf("MM") != -1) { dateStr = dateStr.replace("MM", "mm"); } else if (dateStr.indexOf("M") != -1) { dateStr = dateStr.replace("M", "m"); } return dateStr; }, toMystiqueI18nFormat: function (dateStr) { if (dateStr.indexOf("MM") != -1) { dateStr = dateStr.replace("MM", "MMMM"); } else if (dateStr.indexOf("M") != -1) { dateStr = dateStr.replace("M", "MMM"); } else if (dateStr.indexOf("mm") != -1) { dateStr = dateStr.replace("mm", "MM"); } else if (dateStr.indexOf("m") != -1) { dateStr = dateStr.replace("m", "M"); } return dateStr; }, format: function (date, format, inputFormat) { if (date) { date = this._todate(date, inputFormat); } return Globalize.format(date, format); } }, distance: { distanceFormat: function (value, unit) { if (unit) { var displayUnit = unit; } else { var displayUnit = value == 1 ? 'Mi' : 'Mi'; } return value + ' ' + displayUnit; }, distanceParser: function (value) { var km = value.split(' '); return km[0]; } }, number: { numberFormat: function (number, mantissa) { if (dataParserModule.isNumeric(number)) { number = typeof (number) === "number" ? number : Globalize.parseFloat(number); return mantissa ? Globalize.format(number, "n" + mantissa) : Globalize.format(number, "n"); } return NaN; }, intNumberFormat: function (number) { if (dataParserModule.isNumeric(number)) { number = typeof (number) === "number" ? number : Globalize.parseFloat(number); return Globalize.format(number, "n0"); } return NaN; }, intCeilNumberFormat: function (number) { if (number == undefined || number == null) { return NaN; } number = typeof (number) === "number" ? number : Globalize.parseFloat(number); number = Math.ceil(number); var formatedValue = Globalize.format(number, "n0"); return formatedValue; }, intCeilNumber: function (number) { if (number == undefined || number == null) { return NaN; } number = typeof (number) === "number" ? number : Globalize.parseFloat(number); number = Math.ceil(number); return number; } }, percentage: { percentangeFormat: function (number) { if (number) { number = typeof (number) === "number" ? number : Globalize.parseFloat(number); return Globalize.format(number, "p"); } return ''; } } }; var dataParserModule = { int: { parse: function (number) { return Globalize.parseInt(number); } }, float: { parse: function (number) { return Globalize.parseFloat(number); } }, percentage: { parse: function (number) { if (number) return Globalize.parseFloat(number); return ''; } }, currency: { parse: function (amt) { if (amt) return Globalize.parseFloat(amt); return ''; } }, date: { parse: function (date, format) { if (format) { return Globalize.parseDate(date, format); } return Globalize.parseDate(date); } }, isNumeric: function (num) { if (num == undefined) return false; var regEx = RegExp("^-*[0-9,\.]+$"); return regEx.test(num.toString()); } }; var localizeModule = { initLocalization: function (settings) { var keyValue = {}; $.each(settings, function (index, val) { keyValue[val.key] = val.value; }); Globalize.addCultureInfo(contentModule.culture.language, { messages: keyValue }); }, getLocalize: function (key, defaultVal) { if (key) { var localString = Globalize.localize(key, contentModule.culture.language); if (localString) { return localString; } } return defaultVal; } }; i18N = { content: { culture: contentModule.culture, currency: contentModule.currency, date: contentModule.date, number: contentModule.number, resources: contentModule.resources }, formatters: dataFormatModule, parsers: dataParserModule, localize: localizeModule }; return i18N; }); /*! handlebars v1.3.0 Copyright (C) 2011 by Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @license */ var Handlebars = function () { var a = function () { "use strict"; function a(a) { this.string = a } var b; return a.prototype.toString = function () { return "" + this.string }, b = a }(), b = function (a) { "use strict"; function b(a) { return h[a] || "&" } function c(a, b) { for (var c in b) Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]) } function d(a) { return a instanceof g ? a.toString() : a || 0 === a ? (a = "" + a, j.test(a) ? a.replace(i, b) : a) : "" } function e(a) { return a || 0 === a ? m(a) && 0 === a.length ? !0 : !1 : !0 } var f = {}, g = a, h = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }, i = /[&<>"'`]/g, j = /[&<>"'`]/; f.extend = c; var k = Object.prototype.toString; f.toString = k; var l = function (a) { return "function" == typeof a }; l(/x/) && (l = function (a) { return "function" == typeof a && "[object Function]" === k.call(a) }); var l; f.isFunction = l; var m = Array.isArray || function (a) { return a && "object" == typeof a ? "[object Array]" === k.call(a) : !1 }; return f.isArray = m, f.escapeExpression = d, f.isEmpty = e, f }(a), c = function () { "use strict"; function a(a, b) { var d; b && b.firstLine && (d = b.firstLine, a += " - " + d + ":" + b.firstColumn); for (var e = Error.prototype.constructor.call(this, a), f = 0; f < c.length; f++) this[c[f]] = e[c[f]]; d && (this.lineNumber = d, this.column = b.firstColumn) } var b, c = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"]; return a.prototype = new Error, b = a }(), d = function (a, b) { "use strict"; function c(a, b) { this.helpers = a || {}, this.partials = b || {}, d(this) } function d(a) { a.registerHelper("helperMissing", function (a) { if (2 === arguments.length) return void 0; throw new h("Missing helper: '" + a + "'") }), a.registerHelper("blockHelperMissing", function (b, c) { var d = c.inverse || function () { }, e = c.fn; return m(b) && (b = b.call(this)), b === !0 ? e(this) : b === !1 || null == b ? d(this) : l(b) ? b.length > 0 ? a.helpers.each(b, c) : d(this) : e(b) }), a.registerHelper("each", function (a, b) { var c, d = b.fn, e = b.inverse, f = 0, g = ""; if (m(a) && (a = a.call(this)), b.data && (c = q(b.data)), a && "object" == typeof a) if (l(a)) for (var h = a.length; h > f; f++) c && (c.index = f, c.first = 0 === f, c.last = f === a.length - 1), g += d(a[f], { data: c }); else for (var i in a) a.hasOwnProperty(i) && (c && (c.key = i, c.index = f, c.first = 0 === f), g += d(a[i], { data: c }), f++); return 0 === f && (g = e(this)), g }), a.registerHelper("if", function (a, b) { return m(a) && (a = a.call(this)), !b.hash.includeZero && !a || g.isEmpty(a) ? b.inverse(this) : b.fn(this) }), a.registerHelper("unless", function (b, c) { return a.helpers["if"].call(this, b, { fn: c.inverse, inverse: c.fn, hash: c.hash }) }), a.registerHelper("with", function (a, b) { return m(a) && (a = a.call(this)), g.isEmpty(a) ? void 0 : b.fn(a) }), a.registerHelper("log", function (b, c) { var d = c.data && null != c.data.level ? parseInt(c.data.level, 10) : 1; a.log(d, b) }) } function e(a, b) { p.log(a, b) } var f = {}, g = a, h = b, i = "1.3.0"; f.VERSION = i; var j = 4; f.COMPILER_REVISION = j; var k = { 1: "<= 1.0.rc.2", 2: "== 1.0.0-rc.3", 3: "== 1.0.0-rc.4", 4: ">= 1.0.0" }; f.REVISION_CHANGES = k; var l = g.isArray, m = g.isFunction, n = g.toString, o = "[object Object]"; f.HandlebarsEnvironment = c, c.prototype = { constructor: c, logger: p, log: e, registerHelper: function (a, b, c) { if (n.call(a) === o) { if (c || b) throw new h("Arg not supported with multiple helpers"); g.extend(this.helpers, a) } else c && (b.not = c), this.helpers[a] = b }, registerPartial: function (a, b) { n.call(a) === o ? g.extend(this.partials, a) : this.partials[a] = b } }; var p = { methodMap: { 0: "debug", 1: "info", 2: "warn", 3: "error" }, DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3, log: function (a, b) { if (p.level <= a) { var c = p.methodMap[a]; "undefined" != typeof console && console[c] && console[c].call(console, b) } } }; f.logger = p, f.log = e; var q = function (a) { var b = {}; return g.extend(b, a), b }; return f.createFrame = q, f }(b, c), e = function (a, b, c) { "use strict"; function d(a) { var b = a && a[0] || 1, c = m; if (b !== c) { if (c > b) { var d = n[c], e = n[b]; throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + d + ") or downgrade your runtime to an older version (" + e + ").") } throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + a[1] + ").") } } function e(a, b) { if (!b) throw new l("No environment passed to template"); var c = function (a, c, d, e, f, g) { var h = b.VM.invokePartial.apply(this, arguments); if (null != h) return h; if (b.compile) { var i = { helpers: e, partials: f, data: g }; return f[c] = b.compile(a, { data: void 0 !== g }, b), f[c](d, i) } throw new l("The partial " + c + " could not be compiled when running in runtime-only mode") }, d = { escapeExpression: k.escapeExpression, invokePartial: c, programs: [], program: function (a, b, c) { var d = this.programs[a]; return c ? d = g(a, b, c) : d || (d = this.programs[a] = g(a, b)), d }, merge: function (a, b) { var c = a || b; return a && b && a !== b && (c = {}, k.extend(c, b), k.extend(c, a)), c }, programWithDepth: b.VM.programWithDepth, noop: b.VM.noop, compilerInfo: null }; return function (c, e) { e = e || {}; var f, g, h = e.partial ? e : b; e.partial || (f = e.helpers, g = e.partials); var i = a.call(d, h, c, f, g, e.data); return e.partial || b.VM.checkRevision(d.compilerInfo), i } } function f(a, b, c) { var d = Array.prototype.slice.call(arguments, 3), e = function (a, e) { return e = e || {}, b.apply(this, [a, e.data || c].concat(d)) }; return e.program = a, e.depth = d.length, e } function g(a, b, c) { var d = function (a, d) { return d = d || {}, b(a, d.data || c) }; return d.program = a, d.depth = 0, d } function h(a, b, c, d, e, f) { var g = { partial: !0, helpers: d, partials: e, data: f }; if (void 0 === a) throw new l("The partial " + b + " could not be found"); return a instanceof Function ? a(c, g) : void 0 } function i() { return "" } var j = {}, k = a, l = b, m = c.COMPILER_REVISION, n = c.REVISION_CHANGES; return j.checkRevision = d, j.template = e, j.programWithDepth = f, j.program = g, j.invokePartial = h, j.noop = i, j }(b, c, d), f = function (a, b, c, d, e) { "use strict"; var f, g = a, h = b, i = c, j = d, k = e, l = function () { var a = new g.HandlebarsEnvironment; return j.extend(a, g), a.SafeString = h, a.Exception = i, a.Utils = j, a.VM = k, a.template = function (b) { return k.template(b, a) }, a }, m = l(); return m.create = l, f = m }(d, a, c, b, e), g = function (a) { "use strict"; function b(a) { a = a || {}, this.firstLine = a.first_line, this.firstColumn = a.first_column, this.lastColumn = a.last_column, this.lastLine = a.last_line } var c, d = a, e = { ProgramNode: function (a, c, d, f) { var g, h; 3 === arguments.length ? (f = d, d = null) : 2 === arguments.length && (f = c, c = null), b.call(this, f), this.type = "program", this.statements = a, this.strip = {}, d ? (h = d[0], h ? (g = { first_line: h.firstLine, last_line: h.lastLine, last_column: h.lastColumn, first_column: h.firstColumn }, this.inverse = new e.ProgramNode(d, c, g)) : this.inverse = new e.ProgramNode(d, c), this.strip.right = c.left) : c && (this.strip.left = c.right) }, MustacheNode: function (a, c, d, f, g) { if (b.call(this, g), this.type = "mustache", this.strip = f, null != d && d.charAt) { var h = d.charAt(3) || d.charAt(2); this.escaped = "{" !== h && "&" !== h } else this.escaped = !!d; this.sexpr = a instanceof e.SexprNode ? a : new e.SexprNode(a, c), this.sexpr.isRoot = !0, this.id = this.sexpr.id, this.params = this.sexpr.params, this.hash = this.sexpr.hash, this.eligibleHelper = this.sexpr.eligibleHelper, this.isHelper = this.sexpr.isHelper }, SexprNode: function (a, c, d) { b.call(this, d), this.type = "sexpr", this.hash = c; var e = this.id = a[0], f = this.params = a.slice(1), g = this.eligibleHelper = e.isSimple; this.isHelper = g && (f.length || c) }, PartialNode: function (a, c, d, e) { b.call(this, e), this.type = "partial", this.partialName = a, this.context = c, this.strip = d }, BlockNode: function (a, c, e, f, g) { if (b.call(this, g), a.sexpr.id.original !== f.path.original) throw new d(a.sexpr.id.original + " doesn't match " + f.path.original, this); this.type = "block", this.mustache = a, this.program = c, this.inverse = e, this.strip = { left: a.strip.left, right: f.strip.right }, (c || e).strip.left = a.strip.right, (e || c).strip.right = f.strip.left, e && !c && (this.isInverse = !0) }, ContentNode: function (a, c) { b.call(this, c), this.type = "content", this.string = a }, HashNode: function (a, c) { b.call(this, c), this.type = "hash", this.pairs = a }, IdNode: function (a, c) { b.call(this, c), this.type = "ID"; for (var e = "", f = [], g = 0, h = 0, i = a.length; i > h; h++) { var j = a[h].part; if (e += (a[h].separator || "") + j, ".." === j || "." === j || "this" === j) { if (f.length > 0) throw new d("Invalid path: " + e, this); ".." === j ? g++ : this.isScoped = !0 } else f.push(j) } this.original = e, this.parts = f, this.string = f.join("."), this.depth = g, this.isSimple = 1 === a.length && !this.isScoped && 0 === g, this.stringModeValue = this.string }, PartialNameNode: function (a, c) { b.call(this, c), this.type = "PARTIAL_NAME", this.name = a.original }, DataNode: function (a, c) { b.call(this, c), this.type = "DATA", this.id = a }, StringNode: function (a, c) { b.call(this, c), this.type = "STRING", this.original = this.string = this.stringModeValue = a }, IntegerNode: function (a, c) { b.call(this, c), this.type = "INTEGER", this.original = this.integer = a, this.stringModeValue = Number(a) }, BooleanNode: function (a, c) { b.call(this, c), this.type = "BOOLEAN", this.bool = a, this.stringModeValue = "true" === a }, CommentNode: function (a, c) { b.call(this, c), this.type = "comment", this.comment = a } }; return c = e }(c), h = function () { "use strict"; var a, b = function () { function a(a, b) { return { left: "~" === a.charAt(2), right: "~" === b.charAt(0) || "~" === b.charAt(1) } } function b() { this.yy = {} } var c = { trace: function () { }, yy: {}, symbols_: { error: 2, root: 3, statements: 4, EOF: 5, program: 6, simpleInverse: 7, statement: 8, openInverse: 9, closeBlock: 10, openBlock: 11, mustache: 12, partial: 13, CONTENT: 14, COMMENT: 15, OPEN_BLOCK: 16, sexpr: 17, CLOSE: 18, OPEN_INVERSE: 19, OPEN_ENDBLOCK: 20, path: 21, OPEN: 22, OPEN_UNESCAPED: 23, CLOSE_UNESCAPED: 24, OPEN_PARTIAL: 25, partialName: 26, partial_option0: 27, sexpr_repetition0: 28, sexpr_option0: 29, dataName: 30, param: 31, STRING: 32, INTEGER: 33, BOOLEAN: 34, OPEN_SEXPR: 35, CLOSE_SEXPR: 36, hash: 37, hash_repetition_plus0: 38, hashSegment: 39, ID: 40, EQUALS: 41, DATA: 42, pathSegments: 43, SEP: 44, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "EOF", 14: "CONTENT", 15: "COMMENT", 16: "OPEN_BLOCK", 18: "CLOSE", 19: "OPEN_INVERSE", 20: "OPEN_ENDBLOCK", 22: "OPEN", 23: "OPEN_UNESCAPED", 24: "CLOSE_UNESCAPED", 25: "OPEN_PARTIAL", 32: "STRING", 33: "INTEGER", 34: "BOOLEAN", 35: "OPEN_SEXPR", 36: "CLOSE_SEXPR", 40: "ID", 41: "EQUALS", 42: "DATA", 44: "SEP" }, productions_: [0, [3, 2], [3, 1], [6, 2], [6, 3], [6, 2], [6, 1], [6, 1], [6, 0], [4, 1], [4, 2], [8, 3], [8, 3], [8, 1], [8, 1], [8, 1], [8, 1], [11, 3], [9, 3], [10, 3], [12, 3], [12, 3], [13, 4], [7, 2], [17, 3], [17, 1], [31, 1], [31, 1], [31, 1], [31, 1], [31, 1], [31, 3], [37, 1], [39, 3], [26, 1], [26, 1], [26, 1], [30, 2], [21, 1], [43, 3], [43, 1], [27, 0], [27, 1], [28, 0], [28, 2], [29, 0], [29, 1], [38, 1], [38, 2]], performAction: function (b, c, d, e, f, g) { var h = g.length - 1; switch (f) { case 1: return new e.ProgramNode(g[h - 1], this._$); case 2: return new e.ProgramNode([], this._$); case 3: this.$ = new e.ProgramNode([], g[h - 1], g[h], this._$); break; case 4: this.$ = new e.ProgramNode(g[h - 2], g[h - 1], g[h], this._$); break; case 5: this.$ = new e.ProgramNode(g[h - 1], g[h], [], this._$); break; case 6: this.$ = new e.ProgramNode(g[h], this._$); break; case 7: this.$ = new e.ProgramNode([], this._$); break; case 8: this.$ = new e.ProgramNode([], this._$); break; case 9: this.$ = [g[h]]; break; case 10: g[h - 1].push(g[h]), this.$ = g[h - 1]; break; case 11: this.$ = new e.BlockNode(g[h - 2], g[h - 1].inverse, g[h - 1], g[h], this._$); break; case 12: this.$ = new e.BlockNode(g[h - 2], g[h - 1], g[h - 1].inverse, g[h], this._$); break; case 13: this.$ = g[h]; break; case 14: this.$ = g[h]; break; case 15: this.$ = new e.ContentNode(g[h], this._$); break; case 16: this.$ = new e.CommentNode(g[h], this._$); break; case 17: this.$ = new e.MustacheNode(g[h - 1], null, g[h - 2], a(g[h - 2], g[h]), this._$); break; case 18: this.$ = new e.MustacheNode(g[h - 1], null, g[h - 2], a(g[h - 2], g[h]), this._$); break; case 19: this.$ = { path: g[h - 1], strip: a(g[h - 2], g[h]) }; break; case 20: this.$ = new e.MustacheNode(g[h - 1], null, g[h - 2], a(g[h - 2], g[h]), this._$); break; case 21: this.$ = new e.MustacheNode(g[h - 1], null, g[h - 2], a(g[h - 2], g[h]), this._$); break; case 22: this.$ = new e.PartialNode(g[h - 2], g[h - 1], a(g[h - 3], g[h]), this._$); break; case 23: this.$ = a(g[h - 1], g[h]); break; case 24: this.$ = new e.SexprNode([g[h - 2]].concat(g[h - 1]), g[h], this._$); break; case 25: this.$ = new e.SexprNode([g[h]], null, this._$); break; case 26: this.$ = g[h]; break; case 27: this.$ = new e.StringNode(g[h], this._$); break; case 28: this.$ = new e.IntegerNode(g[h], this._$); break; case 29: this.$ = new e.BooleanNode(g[h], this._$); break; case 30: this.$ = g[h]; break; case 31: g[h - 1].isHelper = !0, this.$ = g[h - 1]; break; case 32: this.$ = new e.HashNode(g[h], this._$); break; case 33: this.$ = [g[h - 2], g[h]]; break; case 34: this.$ = new e.PartialNameNode(g[h], this._$); break; case 35: this.$ = new e.PartialNameNode(new e.StringNode(g[h], this._$), this._$); break; case 36: this.$ = new e.PartialNameNode(new e.IntegerNode(g[h], this._$)); break; case 37: this.$ = new e.DataNode(g[h], this._$); break; case 38: this.$ = new e.IdNode(g[h], this._$); break; case 39: g[h - 2].push({ part: g[h], separator: g[h - 1] }), this.$ = g[h - 2]; break; case 40: this.$ = [{ part: g[h] }]; break; case 43: this.$ = []; break; case 44: g[h - 1].push(g[h]); break; case 47: this.$ = [g[h]]; break; case 48: g[h - 1].push(g[h]) } }, table: [{ 3: 1, 4: 2, 5: [1, 3], 8: 4, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 11], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 1: [3] }, { 5: [1, 16], 8: 17, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 11], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 1: [2, 2] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 16: [2, 9], 19: [2, 9], 20: [2, 9], 22: [2, 9], 23: [2, 9], 25: [2, 9] }, { 4: 20, 6: 18, 7: 19, 8: 4, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 21], 20: [2, 8], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 4: 20, 6: 22, 7: 19, 8: 4, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 21], 20: [2, 8], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 16: [2, 13], 19: [2, 13], 20: [2, 13], 22: [2, 13], 23: [2, 13], 25: [2, 13] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 16: [2, 14], 19: [2, 14], 20: [2, 14], 22: [2, 14], 23: [2, 14], 25: [2, 14] }, { 5: [2, 15], 14: [2, 15], 15: [2, 15], 16: [2, 15], 19: [2, 15], 20: [2, 15], 22: [2, 15], 23: [2, 15], 25: [2, 15] }, { 5: [2, 16], 14: [2, 16], 15: [2, 16], 16: [2, 16], 19: [2, 16], 20: [2, 16], 22: [2, 16], 23: [2, 16], 25: [2, 16] }, { 17: 23, 21: 24, 30: 25, 40: [1, 28], 42: [1, 27], 43: 26 }, { 17: 29, 21: 24, 30: 25, 40: [1, 28], 42: [1, 27], 43: 26 }, { 17: 30, 21: 24, 30: 25, 40: [1, 28], 42: [1, 27], 43: 26 }, { 17: 31, 21: 24, 30: 25, 40: [1, 28], 42: [1, 27], 43: 26 }, { 21: 33, 26: 32, 32: [1, 34], 33: [1, 35], 40: [1, 28], 43: 26 }, { 1: [2, 1] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 16: [2, 10], 19: [2, 10], 20: [2, 10], 22: [2, 10], 23: [2, 10], 25: [2, 10] }, { 10: 36, 20: [1, 37] }, { 4: 38, 8: 4, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 11], 20: [2, 7], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 7: 39, 8: 17, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 21], 20: [2, 6], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 17: 23, 18: [1, 40], 21: 24, 30: 25, 40: [1, 28], 42: [1, 27], 43: 26 }, { 10: 41, 20: [1, 37] }, { 18: [1, 42] }, { 18: [2, 43], 24: [2, 43], 28: 43, 32: [2, 43], 33: [2, 43], 34: [2, 43], 35: [2, 43], 36: [2, 43], 40: [2, 43], 42: [2, 43] }, { 18: [2, 25], 24: [2, 25], 36: [2, 25] }, { 18: [2, 38], 24: [2, 38], 32: [2, 38], 33: [2, 38], 34: [2, 38], 35: [2, 38], 36: [2, 38], 40: [2, 38], 42: [2, 38], 44: [1, 44] }, { 21: 45, 40: [1, 28], 43: 26 }, { 18: [2, 40], 24: [2, 40], 32: [2, 40], 33: [2, 40], 34: [2, 40], 35: [2, 40], 36: [2, 40], 40: [2, 40], 42: [2, 40], 44: [2, 40] }, { 18: [1, 46] }, { 18: [1, 47] }, { 24: [1, 48] }, { 18: [2, 41], 21: 50, 27: 49, 40: [1, 28], 43: 26 }, { 18: [2, 34], 40: [2, 34] }, { 18: [2, 35], 40: [2, 35] }, { 18: [2, 36], 40: [2, 36] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 16: [2, 11], 19: [2, 11], 20: [2, 11], 22: [2, 11], 23: [2, 11], 25: [2, 11] }, { 21: 51, 40: [1, 28], 43: 26 }, { 8: 17, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 11], 20: [2, 3], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 4: 52, 8: 4, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 11], 20: [2, 5], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 14: [2, 23], 15: [2, 23], 16: [2, 23], 19: [2, 23], 20: [2, 23], 22: [2, 23], 23: [2, 23], 25: [2, 23] }, { 5: [2, 12], 14: [2, 12], 15: [2, 12], 16: [2, 12], 19: [2, 12], 20: [2, 12], 22: [2, 12], 23: [2, 12], 25: [2, 12] }, { 14: [2, 18], 15: [2, 18], 16: [2, 18], 19: [2, 18], 20: [2, 18], 22: [2, 18], 23: [2, 18], 25: [2, 18] }, { 18: [2, 45], 21: 56, 24: [2, 45], 29: 53, 30: 60, 31: 54, 32: [1, 57], 33: [1, 58], 34: [1, 59], 35: [1, 61], 36: [2, 45], 37: 55, 38: 62, 39: 63, 40: [1, 64], 42: [1, 27], 43: 26 }, { 40: [1, 65] }, { 18: [2, 37], 24: [2, 37], 32: [2, 37], 33: [2, 37], 34: [2, 37], 35: [2, 37], 36: [2, 37], 40: [2, 37], 42: [2, 37] }, { 14: [2, 17], 15: [2, 17], 16: [2, 17], 19: [2, 17], 20: [2, 17], 22: [2, 17], 23: [2, 17], 25: [2, 17] }, { 5: [2, 20], 14: [2, 20], 15: [2, 20], 16: [2, 20], 19: [2, 20], 20: [2, 20], 22: [2, 20], 23: [2, 20], 25: [2, 20] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 16: [2, 21], 19: [2, 21], 20: [2, 21], 22: [2, 21], 23: [2, 21], 25: [2, 21] }, { 18: [1, 66] }, { 18: [2, 42] }, { 18: [1, 67] }, { 8: 17, 9: 5, 11: 6, 12: 7, 13: 8, 14: [1, 9], 15: [1, 10], 16: [1, 12], 19: [1, 11], 20: [2, 4], 22: [1, 13], 23: [1, 14], 25: [1, 15] }, { 18: [2, 24], 24: [2, 24], 36: [2, 24] }, { 18: [2, 44], 24: [2, 44], 32: [2, 44], 33: [2, 44], 34: [2, 44], 35: [2, 44], 36: [2, 44], 40: [2, 44], 42: [2, 44] }, { 18: [2, 46], 24: [2, 46], 36: [2, 46] }, { 18: [2, 26], 24: [2, 26], 32: [2, 26], 33: [2, 26], 34: [2, 26], 35: [2, 26], 36: [2, 26], 40: [2, 26], 42: [2, 26] }, { 18: [2, 27], 24: [2, 27], 32: [2, 27], 33: [2, 27], 34: [2, 27], 35: [2, 27], 36: [2, 27], 40: [2, 27], 42: [2, 27] }, { 18: [2, 28], 24: [2, 28], 32: [2, 28], 33: [2, 28], 34: [2, 28], 35: [2, 28], 36: [2, 28], 40: [2, 28], 42: [2, 28] }, { 18: [2, 29], 24: [2, 29], 32: [2, 29], 33: [2, 29], 34: [2, 29], 35: [2, 29], 36: [2, 29], 40: [2, 29], 42: [2, 29] }, { 18: [2, 30], 24: [2, 30], 32: [2, 30], 33: [2, 30], 34: [2, 30], 35: [2, 30], 36: [2, 30], 40: [2, 30], 42: [2, 30] }, { 17: 68, 21: 24, 30: 25, 40: [1, 28], 42: [1, 27], 43: 26 }, { 18: [2, 32], 24: [2, 32], 36: [2, 32], 39: 69, 40: [1, 70] }, { 18: [2, 47], 24: [2, 47], 36: [2, 47], 40: [2, 47] }, { 18: [2, 40], 24: [2, 40], 32: [2, 40], 33: [2, 40], 34: [2, 40], 35: [2, 40], 36: [2, 40], 40: [2, 40], 41: [1, 71], 42: [2, 40], 44: [2, 40] }, { 18: [2, 39], 24: [2, 39], 32: [2, 39], 33: [2, 39], 34: [2, 39], 35: [2, 39], 36: [2, 39], 40: [2, 39], 42: [2, 39], 44: [2, 39] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 16: [2, 22], 19: [2, 22], 20: [2, 22], 22: [2, 22], 23: [2, 22], 25: [2, 22] }, { 5: [2, 19], 14: [2, 19], 15: [2, 19], 16: [2, 19], 19: [2, 19], 20: [2, 19], 22: [2, 19], 23: [2, 19], 25: [2, 19] }, { 36: [1, 72] }, { 18: [2, 48], 24: [2, 48], 36: [2, 48], 40: [2, 48] }, { 41: [1, 71] }, { 21: 56, 30: 60, 31: 73, 32: [1, 57], 33: [1, 58], 34: [1, 59], 35: [1, 61], 40: [1, 28], 42: [1, 27], 43: 26 }, { 18: [2, 31], 24: [2, 31], 32: [2, 31], 33: [2, 31], 34: [2, 31], 35: [2, 31], 36: [2, 31], 40: [2, 31], 42: [2, 31] }, { 18: [2, 33], 24: [2, 33], 36: [2, 33], 40: [2, 33] }], defaultActions: { 3: [2, 2], 16: [2, 1], 50: [2, 42] }, parseError: function (a) { throw new Error(a) }, parse: function (a) { function b() { var a; return a = c.lexer.lex() || 1, "number" != typeof a && (a = c.symbols_[a] || a), a } var c = this, d = [0], e = [null], f = [], g = this.table, h = "", i = 0, j = 0, k = 0; this.lexer.setInput(a), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.yy.parser = this, "undefined" == typeof this.lexer.yylloc && (this.lexer.yylloc = {}); var l = this.lexer.yylloc; f.push(l); var m = this.lexer.options && this.lexer.options.ranges; "function" == typeof this.yy.parseError && (this.parseError = this.yy.parseError); for (var n, o, p, q, r, s, t, u, v, w = {}; ;) { if (p = d[d.length - 1], this.defaultActions[p] ? q = this.defaultActions[p] : ((null === n || "undefined" == typeof n) && (n = b()), q = g[p] && g[p][n]), "undefined" == typeof q || !q.length || !q[0]) { var x = ""; if (!k) { v = []; for (s in g[p]) this.terminals_[s] && s > 2 && v.push("'" + this.terminals_[s] + "'"); x = this.lexer.showPosition ? "Parse error on line " + (i + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + v.join(", ") + ", got '" + (this.terminals_[n] || n) + "'" : "Parse error on line " + (i + 1) + ": Unexpected " + (1 == n ? "end of input" : "'" + (this.terminals_[n] || n) + "'"), this.parseError(x, { text: this.lexer.match, token: this.terminals_[n] || n, line: this.lexer.yylineno, loc: l, expected: v }) } } if (q[0] instanceof Array && q.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + p + ", token: " + n); switch (q[0]) { case 1: d.push(n), e.push(this.lexer.yytext), f.push(this.lexer.yylloc), d.push(q[1]), n = null, o ? (n = o, o = null) : (j = this.lexer.yyleng, h = this.lexer.yytext, i = this.lexer.yylineno, l = this.lexer.yylloc, k > 0 && k--); break; case 2: if (t = this.productions_[q[1]][1], w.$ = e[e.length - t], w._$ = { first_line: f[f.length - (t || 1)].first_line, last_line: f[f.length - 1].last_line, first_column: f[f.length - (t || 1)].first_column, last_column: f[f.length - 1].last_column }, m && (w._$.range = [f[f.length - (t || 1)].range[0], f[f.length - 1].range[1]]), r = this.performAction.call(w, h, j, i, this.yy, q[1], e, f), "undefined" != typeof r) return r; t && (d = d.slice(0, -1 * t * 2), e = e.slice(0, -1 * t), f = f.slice(0, -1 * t)), d.push(this.productions_[q[1]][0]), e.push(w.$), f.push(w._$), u = g[d[d.length - 2]][d[d.length - 1]], d.push(u); break; case 3: return !0 } } return !0 } }, d = function () { var a = { EOF: 1, parseError: function (a, b) { if (!this.yy.parser) throw new Error(a); this.yy.parser.parseError(a, b) }, setInput: function (a) { return this._input = a, this._more = this._less = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this }, input: function () { var a = this._input[0]; this.yytext += a, this.yyleng++, this.offset++, this.match += a, this.matched += a; var b = a.match(/(?:\r\n?|\n).*/g); return b ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), a }, unput: function (a) { var b = a.length, c = a.split(/(?:\r\n?|\n)/g); this._input = a + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - b - 1), this.offset -= b; var d = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1); var e = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: c ? (c.length === d.length ? this.yylloc.first_column : 0) + d[d.length - c.length].length - c[0].length : this.yylloc.first_column - b }, this.options.ranges && (this.yylloc.range = [e[0], e[0] + this.yyleng - b]), this }, more: function () { return this._more = !0, this }, less: function (a) { this.unput(this.match.slice(a)) }, pastInput: function () { var a = this.matched.substr(0, this.matched.length - this.match.length); return (a.length > 20 ? "..." : "") + a.substr(-20).replace(/\n/g, "") }, upcomingInput: function () { var a = this.match; return a.length < 20 && (a += this._input.substr(0, 20 - a.length)), (a.substr(0, 20) + (a.length > 20 ? "..." : "")).replace(/\n/g, "") }, showPosition: function () { var a = this.pastInput(), b = new Array(a.length + 1).join("-"); return a + this.upcomingInput() + "\n" + b + "^" }, next: function () { if (this.done) return this.EOF; this._input || (this.done = !0); var a, b, c, d, e; this._more || (this.yytext = "", this.match = ""); for (var f = this._currentRules(), g = 0; g < f.length && (c = this._input.match(this.rules[f[g]]), !c || b && !(c[0].length > b[0].length) || (b = c, d = g, this.options.flex)) ; g++); return b ? (e = b[0].match(/(?:\r\n?|\n).*/g), e && (this.yylineno += e.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: e ? e[e.length - 1].length - e[e.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + b[0].length }, this.yytext += b[0], this.match += b[0], this.matches = b, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._input = this._input.slice(b[0].length), this.matched += b[0], a = this.performAction.call(this, this.yy, this, f[d], this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), a ? a : void 0) : "" === this._input ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }) }, lex: function () { var a = this.next(); return "undefined" != typeof a ? a : this.lex() }, begin: function (a) { this.conditionStack.push(a) }, popState: function () { return this.conditionStack.pop() }, _currentRules: function () { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules }, topState: function () { return this.conditionStack[this.conditionStack.length - 2] }, pushState: function (a) { this.begin(a) } }; return a.options = {}, a.performAction = function (a, b, c, d) { function e(a, c) { return b.yytext = b.yytext.substr(a, b.yyleng - c) } switch (c) { case 0: if ("\\\\" === b.yytext.slice(-2) ? (e(0, 1), this.begin("mu")) : "\\" === b.yytext.slice(-1) ? (e(0, 1), this.begin("emu")) : this.begin("mu"), b.yytext) return 14; break; case 1: return 14; case 2: return this.popState(), 14; case 3: return e(0, 4), this.popState(), 15; case 4: return 35; case 5: return 36; case 6: return 25; case 7: return 16; case 8: return 20; case 9: return 19; case 10: return 19; case 11: return 23; case 12: return 22; case 13: this.popState(), this.begin("com"); break; case 14: return e(3, 5), this.popState(), 15; case 15: return 22; case 16: return 41; case 17: return 40; case 18: return 40; case 19: return 44; case 20: break; case 21: return this.popState(), 24; case 22: return this.popState(), 18; case 23: return b.yytext = e(1, 2).replace(/\\"/g, '"'), 32; case 24: return b.yytext = e(1, 2).replace(/\\'/g, "'"), 32; case 25: return 42; case 26: return 34; case 27: return 34; case 28: return 33; case 29: return 40; case 30: return b.yytext = e(1, 2), 40; case 31: return "INVALID"; case 32: return 5 } }, a.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:[\s\S]*?--\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{!--)/, /^(?:\{\{![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:-?[0-9]+(?=([~}\s)])))/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/], a.conditions = { mu: { rules: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], inclusive: !1 }, emu: { rules: [2], inclusive: !1 }, com: { rules: [3], inclusive: !1 }, INITIAL: { rules: [0, 1, 32], inclusive: !0 } }, a }(); return c.lexer = d, b.prototype = c, c.Parser = b, new b }(); return a = b }(), i = function (a, b) { "use strict"; function c(a) { return a.constructor === f.ProgramNode ? a : (e.yy = f, e.parse(a)) } var d = {}, e = a, f = b; return d.parser = e, d.parse = c, d }(h, g), j = function (a) { "use strict"; function b() { } function c(a, b, c) { if (null == a || "string" != typeof a && a.constructor !== c.AST.ProgramNode) throw new f("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + a); b = b || {}, "data" in b || (b.data = !0); var d = c.parse(a), e = (new c.Compiler).compile(d, b); return (new c.JavaScriptCompiler).compile(e, b) } function d(a, b, c) { function d() { var d = c.parse(a), e = (new c.Compiler).compile(d, b), f = (new c.JavaScriptCompiler).compile(e, b, void 0, !0); return c.template(f) } if (null == a || "string" != typeof a && a.constructor !== c.AST.ProgramNode) throw new f("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + a); b = b || {}, "data" in b || (b.data = !0); var e; return function (a, b) { return e || (e = d()), e.call(this, a, b) } } var e = {}, f = a; return e.Compiler = b, b.prototype = { compiler: b, disassemble: function () { for (var a, b, c, d = this.opcodes, e = [], f = 0, g = d.length; g > f; f++) if (a = d[f], "DECLARE" === a.opcode) e.push("DECLARE " + a.name + "=" + a.value); else { b = []; for (var h = 0; h < a.args.length; h++) c = a.args[h], "string" == typeof c && (c = '"' + c.replace("\n", "\\n") + '"'), b.push(c); e.push(a.opcode + " " + b.join(" ")) } return e.join("\n") }, equals: function (a) { var b = this.opcodes.length; if (a.opcodes.length !== b) return !1; for (var c = 0; b > c; c++) { var d = this.opcodes[c], e = a.opcodes[c]; if (d.opcode !== e.opcode || d.args.length !== e.args.length) return !1; for (var f = 0; f < d.args.length; f++) if (d.args[f] !== e.args[f]) return !1 } if (b = this.children.length, a.children.length !== b) return !1; for (c = 0; b > c; c++) if (!this.children[c].equals(a.children[c])) return !1; return !0 }, guid: 0, compile: function (a, b) { this.opcodes = [], this.children = [], this.depths = { list: [] }, this.options = b; var c = this.options.knownHelpers; if (this.options.knownHelpers = { helperMissing: !0, blockHelperMissing: !0, each: !0, "if": !0, unless: !0, "with": !0, log: !0 }, c) for (var d in c) this.options.knownHelpers[d] = c[d]; return this.accept(a) }, accept: function (a) { var b, c = a.strip || {}; return c.left && this.opcode("strip"), b = this[a.type](a), c.right && this.opcode("strip"), b }, program: function (a) { for (var b = a.statements, c = 0, d = b.length; d > c; c++) this.accept(b[c]); return this.isSimple = 1 === d, this.depths.list = this.depths.list.sort(function (a, b) { return a - b }), this }, compileProgram: function (a) { var b, c = (new this.compiler).compile(a, this.options), d = this.guid++; this.usePartial = this.usePartial || c.usePartial, this.children[d] = c; for (var e = 0, f = c.depths.list.length; f > e; e++) b = c.depths.list[e], 2 > b || this.addDepth(b - 1); return d }, block: function (a) { var b = a.mustache, c = a.program, d = a.inverse; c && (c = this.compileProgram(c)), d && (d = this.compileProgram(d)); var e = b.sexpr, f = this.classifySexpr(e); "helper" === f ? this.helperSexpr(e, c, d) : "simple" === f ? (this.simpleSexpr(e), this.opcode("pushProgram", c), this.opcode("pushProgram", d), this.opcode("emptyHash"), this.opcode("blockValue")) : (this.ambiguousSexpr(e, c, d), this.opcode("pushProgram", c), this.opcode("pushProgram", d), this.opcode("emptyHash"), this.opcode("ambiguousBlockValue")), this.opcode("append") }, hash: function (a) { var b, c, d = a.pairs; this.opcode("pushHash"); for (var e = 0, f = d.length; f > e; e++) b = d[e], c = b[1], this.options.stringParams ? (c.depth && this.addDepth(c.depth), this.opcode("getContext", c.depth || 0), this.opcode("pushStringParam", c.stringModeValue, c.type), "sexpr" === c.type && this.sexpr(c)) : this.accept(c), this.opcode("assignToHash", b[0]); this.opcode("popHash") }, partial: function (a) { var b = a.partialName; this.usePartial = !0, a.context ? this.ID(a.context) : this.opcode("push", "depth0"), this.opcode("invokePartial", b.name), this.opcode("append") }, content: function (a) { this.opcode("appendContent", a.string) }, mustache: function (a) { this.sexpr(a.sexpr), a.escaped && !this.options.noEscape ? this.opcode("appendEscaped") : this.opcode("append") }, ambiguousSexpr: function (a, b, c) { var d = a.id, e = d.parts[0], f = null != b || null != c; this.opcode("getContext", d.depth), this.opcode("pushProgram", b), this.opcode("pushProgram", c), this.opcode("invokeAmbiguous", e, f) }, simpleSexpr: function (a) { var b = a.id; "DATA" === b.type ? this.DATA(b) : b.parts.length ? this.ID(b) : (this.addDepth(b.depth), this.opcode("getContext", b.depth), this.opcode("pushContext")), this.opcode("resolvePossibleLambda") }, helperSexpr: function (a, b, c) { var d = this.setupFullMustacheParams(a, b, c), e = a.id.parts[0]; if (this.options.knownHelpers[e]) this.opcode("invokeKnownHelper", d.length, e); else { if (this.options.knownHelpersOnly) throw new f("You specified knownHelpersOnly, but used the unknown helper " + e, a); this.opcode("invokeHelper", d.length, e, a.isRoot) } }, sexpr: function (a) { var b = this.classifySexpr(a); "simple" === b ? this.simpleSexpr(a) : "helper" === b ? this.helperSexpr(a) : this.ambiguousSexpr(a) }, ID: function (a) { this.addDepth(a.depth), this.opcode("getContext", a.depth); var b = a.parts[0]; b ? this.opcode("lookupOnContext", a.parts[0]) : this.opcode("pushContext"); for (var c = 1, d = a.parts.length; d > c; c++) this.opcode("lookup", a.parts[c]) }, DATA: function (a) { if (this.options.data = !0, a.id.isScoped || a.id.depth) throw new f("Scoped data references are not supported: " + a.original, a); this.opcode("lookupData"); for (var b = a.id.parts, c = 0, d = b.length; d > c; c++) this.opcode("lookup", b[c]) }, STRING: function (a) { this.opcode("pushString", a.string) }, INTEGER: function (a) { this.opcode("pushLiteral", a.integer) }, BOOLEAN: function (a) { this.opcode("pushLiteral", a.bool) }, comment: function () { }, opcode: function (a) { this.opcodes.push({ opcode: a, args: [].slice.call(arguments, 1) }) }, declare: function (a, b) { this.opcodes.push({ opcode: "DECLARE", name: a, value: b }) }, addDepth: function (a) { 0 !== a && (this.depths[a] || (this.depths[a] = !0, this.depths.list.push(a))) }, classifySexpr: function (a) { var b = a.isHelper, c = a.eligibleHelper, d = this.options; if (c && !b) { var e = a.id.parts[0]; d.knownHelpers[e] ? b = !0 : d.knownHelpersOnly && (c = !1) } return b ? "helper" : c ? "ambiguous" : "simple" }, pushParams: function (a) { for (var b, c = a.length; c--;) b = a[c], this.options.stringParams ? (b.depth && this.addDepth(b.depth), this.opcode("getContext", b.depth || 0), this.opcode("pushStringParam", b.stringModeValue, b.type), "sexpr" === b.type && this.sexpr(b)) : this[b.type](b) }, setupFullMustacheParams: function (a, b, c) { var d = a.params; return this.pushParams(d), this.opcode("pushProgram", b), this.opcode("pushProgram", c), a.hash ? this.hash(a.hash) : this.opcode("emptyHash"), d } }, e.precompile = c, e.compile = d, e }(c), k = function (a, b) { "use strict"; function c(a) { this.value = a } function d() { } var e, f = a.COMPILER_REVISION, g = a.REVISION_CHANGES, h = a.log, i = b; d.prototype = { nameLookup: function (a, b) { var c, e; return 0 === a.indexOf("depth") && (c = !0), e = /^[0-9]+$/.test(b) ? a + "[" + b + "]" : d.isValidJavaScriptVariableName(b) ? a + "." + b : a + "['" + b + "']", c ? "(" + a + " && " + e + ")" : e }, compilerInfo: function () { var a = f, b = g[a]; return "this.compilerInfo = [" + a + ",'" + b + "'];\n" }, appendToBuffer: function (a) { return this.environment.isSimple ? "return " + a + ";" : { appendToBuffer: !0, content: a, toString: function () { return "buffer += " + a + ";" } } }, initializeBuffer: function () { return this.quotedString("") }, namespace: "Handlebars", compile: function (a, b, c, d) { this.environment = a, this.options = b || {}, h("debug", this.environment.disassemble() + "\n\n"), this.name = this.environment.name, this.isChild = !!c, this.context = c || { programs: [], environments: [], aliases: {} }, this.preamble(), this.stackSlot = 0, this.stackVars = [], this.registers = { list: [] }, this.hashes = [], this.compileStack = [], this.inlineStack = [], this.compileChildren(a, b); var e, f = a.opcodes; this.i = 0; for (var g = f.length; this.i < g; this.i++) e = f[this.i], "DECLARE" === e.opcode ? this[e.name] = e.value : this[e.opcode].apply(this, e.args), e.opcode !== this.stripNext && (this.stripNext = !1); if (this.pushSource(""), this.stackSlot || this.inlineStack.length || this.compileStack.length) throw new i("Compile completed with content left on stack"); return this.createFunctionContext(d) }, preamble: function () { var a = []; if (this.isChild) a.push(""); else { var b = this.namespace, c = "helpers = this.merge(helpers, " + b + ".helpers);"; this.environment.usePartial && (c = c + " partials = this.merge(partials, " + b + ".partials);"), this.options.data && (c += " data = data || {};"), a.push(c) } this.environment.isSimple ? a.push("") : a.push(", buffer = " + this.initializeBuffer()), this.lastContext = 0, this.source = a }, createFunctionContext: function (a) { var b = this.stackVars.concat(this.registers.list); if (b.length > 0 && (this.source[1] = this.source[1] + ", " + b.join(", ")), !this.isChild) for (var c in this.context.aliases) this.context.aliases.hasOwnProperty(c) && (this.source[1] = this.source[1] + ", " + c + "=" + this.context.aliases[c]); this.source[1] && (this.source[1] = "var " + this.source[1].substring(2) + ";"), this.isChild || (this.source[1] += "\n" + this.context.programs.join("\n") + "\n"), this.environment.isSimple || this.pushSource("return buffer;"); for (var d = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"], e = 0, f = this.environment.depths.list.length; f > e; e++) d.push("depth" + this.environment.depths.list[e]); var g = this.mergeSource(); if (this.isChild || (g = this.compilerInfo() + g), a) return d.push(g), Function.apply(this, d); var i = "function " + (this.name || "") + "(" + d.join(",") + ") {\n " + g + "}"; return h("debug", i + "\n\n"), i }, mergeSource: function () { for (var a, b = "", c = 0, d = this.source.length; d > c; c++) { var e = this.source[c]; e.appendToBuffer ? a = a ? a + "\n + " + e.content : e.content : (a && (b += "buffer += " + a + ";\n ", a = void 0), b += e + "\n ") } return b }, blockValue: function () { this.context.aliases.blockHelperMissing = "helpers.blockHelperMissing"; var a = ["depth0"]; this.setupParams(0, a), this.replaceStack(function (b) { return a.splice(1, 0, b), "blockHelperMissing.call(" + a.join(", ") + ")" }) }, ambiguousBlockValue: function () { this.context.aliases.blockHelperMissing = "helpers.blockHelperMissing"; var a = ["depth0"]; this.setupParams(0, a); var b = this.topStack(); a.splice(1, 0, b), this.pushSource("if (!" + this.lastHelper + ") { " + b + " = blockHelperMissing.call(" + a.join(", ") + "); }") }, appendContent: function (a) { this.pendingContent && (a = this.pendingContent + a), this.stripNext && (a = a.replace(/^\s+/, "")), this.pendingContent = a }, strip: function () { this.pendingContent && (this.pendingContent = this.pendingContent.replace(/\s+$/, "")), this.stripNext = "strip" }, append: function () { this.flushInline(); var a = this.popStack(); this.pushSource("if(" + a + " || " + a + " === 0) { " + this.appendToBuffer(a) + " }"), this.environment.isSimple && this.pushSource("else { " + this.appendToBuffer("''") + " }") }, appendEscaped: function () { this.context.aliases.escapeExpression = "this.escapeExpression", this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")")) }, getContext: function (a) { this.lastContext !== a && (this.lastContext = a) }, lookupOnContext: function (a) { this.push(this.nameLookup("depth" + this.lastContext, a, "context")) }, pushContext: function () { this.pushStackLiteral("depth" + this.lastContext) }, resolvePossibleLambda: function () { this.context.aliases.functionType = '"function"', this.replaceStack(function (a) { return "typeof " + a + " === functionType ? " + a + ".apply(depth0) : " + a }) }, lookup: function (a) { this.replaceStack(function (b) { return b + " == null || " + b + " === false ? " + b + " : " + this.nameLookup(b, a, "context") }) }, lookupData: function () { this.pushStackLiteral("data") }, pushStringParam: function (a, b) { this.pushStackLiteral("depth" + this.lastContext), this.pushString(b), "sexpr" !== b && ("string" == typeof a ? this.pushString(a) : this.pushStackLiteral(a)) }, emptyHash: function () { this.pushStackLiteral("{}"), this.options.stringParams && (this.push("{}"), this.push("{}")) }, pushHash: function () { this.hash && this.hashes.push(this.hash), this.hash = { values: [], types: [], contexts: [] } }, popHash: function () { var a = this.hash; this.hash = this.hashes.pop(), this.options.stringParams && (this.push("{" + a.contexts.join(",") + "}"), this.push("{" + a.types.join(",") + "}")), this.push("{\n " + a.values.join(",\n ") + "\n }") }, pushString: function (a) { this.pushStackLiteral(this.quotedString(a)) }, push: function (a) { return this.inlineStack.push(a), a }, pushLiteral: function (a) { this.pushStackLiteral(a) }, pushProgram: function (a) { null != a ? this.pushStackLiteral(this.programExpression(a)) : this.pushStackLiteral(null) }, invokeHelper: function (a, b, c) { this.context.aliases.helperMissing = "helpers.helperMissing", this.useRegister("helper"); var d = this.lastHelper = this.setupHelper(a, b, !0), e = this.nameLookup("depth" + this.lastContext, b, "context"), f = "helper = " + d.name + " || " + e; d.paramsInit && (f += "," + d.paramsInit), this.push("(" + f + ",helper ? helper.call(" + d.callParams + ") : helperMissing.call(" + d.helperMissingParams + "))"), c || this.flushInline() }, invokeKnownHelper: function (a, b) { var c = this.setupHelper(a, b); this.push(c.name + ".call(" + c.callParams + ")") }, invokeAmbiguous: function (a, b) { this.context.aliases.functionType = '"function"', this.useRegister("helper"), this.emptyHash(); var c = this.setupHelper(0, a, b), d = this.lastHelper = this.nameLookup("helpers", a, "helper"), e = this.nameLookup("depth" + this.lastContext, a, "context"), f = this.nextStack(); c.paramsInit && this.pushSource(c.paramsInit), this.pushSource("if (helper = " + d + ") { " + f + " = helper.call(" + c.callParams + "); }"), this.pushSource("else { helper = " + e + "; " + f + " = typeof helper === functionType ? helper.call(" + c.callParams + ") : helper; }") }, invokePartial: function (a) { var b = [this.nameLookup("partials", a, "partial"), "'" + a + "'", this.popStack(), "helpers", "partials"]; this.options.data && b.push("data"), this.context.aliases.self = "this", this.push("self.invokePartial(" + b.join(", ") + ")") }, assignToHash: function (a) { var b, c, d = this.popStack(); this.options.stringParams && (c = this.popStack(), b = this.popStack()); var e = this.hash; b && e.contexts.push("'" + a + "': " + b), c && e.types.push("'" + a + "': " + c), e.values.push("'" + a + "': (" + d + ")") }, compiler: d, compileChildren: function (a, b) { for (var c, d, e = a.children, f = 0, g = e.length; g > f; f++) { c = e[f], d = new this.compiler; var h = this.matchExistingProgram(c); null == h ? (this.context.programs.push(""), h = this.context.programs.length, c.index = h, c.name = "program" + h, this.context.programs[h] = d.compile(c, b, this.context), this.context.environments[h] = c) : (c.index = h, c.name = "program" + h) } }, matchExistingProgram: function (a) { for (var b = 0, c = this.context.environments.length; c > b; b++) { var d = this.context.environments[b]; if (d && d.equals(a)) return b } }, programExpression: function (a) { if (this.context.aliases.self = "this", null == a) return "self.noop"; for (var b, c = this.environment.children[a], d = c.depths.list, e = [c.index, c.name, "data"], f = 0, g = d.length; g > f; f++) b = d[f], 1 === b ? e.push("depth0") : e.push("depth" + (b - 1)); return (0 === d.length ? "self.program(" : "self.programWithDepth(") + e.join(", ") + ")" }, register: function (a, b) { this.useRegister(a), this.pushSource(a + " = " + b + ";") }, useRegister: function (a) { this.registers[a] || (this.registers[a] = !0, this.registers.list.push(a)) }, pushStackLiteral: function (a) { return this.push(new c(a)) }, pushSource: function (a) { this.pendingContent && (this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))), this.pendingContent = void 0), a && this.source.push(a) }, pushStack: function (a) { this.flushInline(); var b = this.incrStack(); return a && this.pushSource(b + " = " + a + ";"), this.compileStack.push(b), b }, replaceStack: function (a) { var b, d, e, f = "", g = this.isInline(); if (g) { var h = this.popStack(!0); if (h instanceof c) b = h.value, e = !0; else { d = !this.stackSlot; var i = d ? this.incrStack() : this.topStackName(); f = "(" + this.push(i) + " = " + h + "),", b = this.topStack() } } else b = this.topStack(); var j = a.call(this, b); return g ? (e || this.popStack(), d && this.stackSlot--, this.push("(" + f + j + ")")) : (/^stack/.test(b) || (b = this.nextStack()), this.pushSource(b + " = (" + f + j + ");")), b }, nextStack: function () { return this.pushStack() }, incrStack: function () { return this.stackSlot++, this.stackSlot > this.stackVars.length && this.stackVars.push("stack" + this.stackSlot), this.topStackName() }, topStackName: function () { return "stack" + this.stackSlot }, flushInline: function () { var a = this.inlineStack; if (a.length) { this.inlineStack = []; for (var b = 0, d = a.length; d > b; b++) { var e = a[b]; e instanceof c ? this.compileStack.push(e) : this.pushStack(e) } } }, isInline: function () { return this.inlineStack.length }, popStack: function (a) { var b = this.isInline(), d = (b ? this.inlineStack : this.compileStack).pop(); if (!a && d instanceof c) return d.value; if (!b) { if (!this.stackSlot) throw new i("Invalid stack pop"); this.stackSlot-- } return d }, topStack: function (a) { var b = this.isInline() ? this.inlineStack : this.compileStack, d = b[b.length - 1]; return !a && d instanceof c ? d.value : d }, quotedString: function (a) { return '"' + a.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + '"' }, setupHelper: function (a, b, c) { var d = [], e = this.setupParams(a, d, c), f = this.nameLookup("helpers", b, "helper"); return { params: d, paramsInit: e, name: f, callParams: ["depth0"].concat(d).join(", "), helperMissingParams: c && ["depth0", this.quotedString(b)].concat(d).join(", ") } }, setupOptions: function (a, b) { var c, d, e, f = [], g = [], h = []; f.push("hash:" + this.popStack()), this.options.stringParams && (f.push("hashTypes:" + this.popStack()), f.push("hashContexts:" + this.popStack())), d = this.popStack(), e = this.popStack(), (e || d) && (e || (this.context.aliases.self = "this", e = "self.noop"), d || (this.context.aliases.self = "this", d = "self.noop"), f.push("inverse:" + d), f.push("fn:" + e)); for (var i = 0; a > i; i++) c = this.popStack(), b.push(c), this.options.stringParams && (h.push(this.popStack()), g.push(this.popStack())); return this.options.stringParams && (f.push("contexts:[" + g.join(",") + "]"), f.push("types:[" + h.join(",") + "]")), this.options.data && f.push("data:data"), f }, setupParams: function (a, b, c) { var d = "{" + this.setupOptions(a, b).join(",") + "}"; return c ? (this.useRegister("options"), b.push("options"), "options=" + d) : (b.push(d), "") } }; for (var j = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "), k = d.RESERVED_WORDS = {}, l = 0, m = j.length; m > l; l++) k[j[l]] = !0; return d.isValidJavaScriptVariableName = function (a) { return !d.RESERVED_WORDS[a] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a) ? !0 : !1 }, e = d }(d, c), l = function (a, b, c, d, e) { "use strict"; var f, g = a, h = b, i = c.parser, j = c.parse, k = d.Compiler, l = d.compile, m = d.precompile, n = e, o = g.create, p = function () { var a = o(); return a.compile = function (b, c) { return l(b, c, a) }, a.precompile = function (b, c) { return m(b, c, a) }, a.AST = h, a.Compiler = k, a.JavaScriptCompiler = n, a.Parser = i, a.parse = j, a }; return g = p(), g.create = p, f = g }(f, g, i, j, k); return l }(); Handlebars.registerHelper("foreach",function(n,t){var o=t.fn,s=t.inverse,r=0,u="",i,e,f;if(t.data&&(i=Handlebars.createFrame(t.data)),n&&typeof n=="object")if(n instanceof Array)for(e=n.length;r