var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
"use strict";if(typeof Object.getPrototypeOf!=="function"){if(typeof"test".__proto__==="object"){Object.getPrototypeOf=function(a){return a.__proto__}}else{Object.getPrototypeOf=function(a){return a.constructor.prototype}}}if(!Function.prototype.bind){Function.prototype.bind=function(d,c,a,b){if(typeof this!=="function"){throw new Error("Function.prototype.bind - what is trying to be bound is not callable")}var h=Array.prototype.slice.call(arguments,1),g=this,e=function(){},f=function(){return g.apply(this instanceof e&&d?this:d,h.concat(Array.prototype.slice.call(arguments)))};e.prototype=this.prototype;f.prototype=new e();return f}}if(!Array.prototype.forEach){Array.prototype.forEach=function(c){if(this===void 0||this===null){throw new TypeError()}var e=Object(this);var a=e.length>>>0;if(typeof c!=="function"){throw new TypeError()}var b=arguments.length>=2?arguments[1]:void 0;for(var d=0;d<a;d++){if(d in e){c.call(b,e[d],d,e)}}}}var V3;(function(V3,window){if(V3.RegisterFile){return}if(!window.Break){window.Break=function(){eval("debugger")}}if(!V3.Log){var fsafe=function(msg){setTimeout(function(){throw msg},1)};var c=window.console,vs=window.intellisense;V3.Log={Debug:function(msg){try{c.debug(msg);if(vs){vs.logMessage("   DBUG: "+msg)}}catch(e){fsafe("Debug: "+msg)}},Info:function(msg){try{c.info(msg);if(vs){vs.logMessage("   INFO: "+msg)}}catch(e){fsafe("Info : "+msg)}},Warn:function(msg){try{c.warn(msg);if(vs){vs.logMessage("   WARN: "+msg)}}catch(e){fsafe("Warn : "+msg)}},Error:function(msg){try{c.error(msg);if(vs){vs.logMessage("   ERRR: "+msg)}}catch(e){fsafe("Error: "+msg)}}}}V3.isDebuggerAttached=function(){if(typeof window.__BROWSERTOOLS_CONSOLE!=="undefined"){V3.isDebuggerAttached=function(){return true};return true}else{V3.isDebuggerAttached=function(){return false};return false}};var loadedScripts={css:{},js:{}};var loadFile=function(id,url,filetype,lowPriority,numberOfCssIncludesToSkip,callback){if(loadedScripts[filetype][id]){return true}if(filetype=="js"){var eScript=document.createElement("script");eScript.type="text/javascript";eScript.async=false;eScript.setAttribute("addedbyjs","true");eScript.src=url;eScript.onload=function(){setTimeout(function(){if(!_registeredFiles[id]||!_registeredFiles[id].IsLoaded){V3.RegisterFile(id,0,null,function(){})}if(typeof callback==="function"){callback()}},0)};document.getElementsByTagName("head")[0].appendChild(eScript)}else{if(filetype=="css"){if(document.createStyleSheet){var index=numberOfCssIncludesToSkip;if(lowPriority){document.createStyleSheet(url,numberOfCssIncludesToSkip)}else{document.createStyleSheet(url)}}else{var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");link.href=url;link.type="text/css";link.rel="stylesheet";link.setAttribute("addedbyjs","true");var hasBeenAdded=false;if(lowPriority&&head.childNodes.length>0){var skipCount=0;for(var i=0;i<head.childNodes.length;i++){var child=head.childNodes[i];var tagName=(child.tagName+"").toLowerCase();if(tagName=="style"||(tagName=="link"&&child.type=="text/css")){if(skipCount++>=numberOfCssIncludesToSkip){head.insertBefore(link,child);hasBeenAdded=true;break}}}}if(!hasBeenAdded){head.appendChild(link)}}}}loadedScripts[filetype][id]=true;return false};var _registeredFiles={};var _awaitingFiles=[];var _registeredAsyncModules={};var _detectErrorTimerId=null;var fireIfReady=function(e){var isLoadingAsyncModules=false;for(var i=0;i<e.Files.length;i++){var file,ver;if(typeof e.Files[i]==="string"){file=e.Files[i];ver=null}else{file=e.Files[i].Filename||e.Files[i].FileName;ver=e.Files[i].Version}if(_registeredAsyncModules[file]&&!_registeredAsyncModules[file].IsLoading){loadFile(file,_registeredAsyncModules[file].Url,"js");_registeredAsyncModules[file].IsLoading=true;isLoadingAsyncModules=true}else{if(!_registeredFiles[file]||!_registeredFiles[file].IsLoaded){if(V3.debugMode||window.vsDesignTime){V3.Log.Debug("Deferred '"+e.CallbackName+"' because of '"+file+"' Version: "+(ver||"*"))}return false}if(ver&&_registeredFiles[file].Version<ver){return false}}}if(isLoadingAsyncModules){return false}if(window.vsDesignTime){intellisense.logMessage("Trying to load '"+e.CallbackName+"'...")}try{V3._currentlyLoadingModule=e;e.Callback.apply(window,[V3])}catch(error){V3.Log.Error("CRITICAL ERROR thrown while trying to load registered file "+e.CallbackName+". "+error,"error",error)}delete V3._currentlyLoadingModule;return true};V3.WaitForFiles=function(arrFiles,optionalCallbackName,optionalIsOptional,fCallback){if(arguments.length===2){fCallback=arguments[1];optionalCallbackName=null;optionalIsOptional=false}else{if(arguments.length==3){fCallback=arguments[2];if(typeof arguments[1]==="boolean"){optionalIsOptional=arguments[1];optionalCallbackName=null}else{optionalIsOptional=false}}}var awaitingEntry={Files:arrFiles,Callback:fCallback,CallbackName:optionalCallbackName,IsOptional:optionalIsOptional,toString:function(){return this.CallbackName}};if(fireIfReady(awaitingEntry)){return true}else{_awaitingFiles.push(awaitingEntry);return false}};V3.RegisterFile=function(filename,version,optionalDependencyArray,fCallback){var arrDependencies=optionalDependencyArray;if(arguments.length<3){throw new Error("must specify filename, version and fCallback")}if(arguments.length==3){fCallback=arguments[2];arrDependencies=null}if(window.vsDesignTime){intellisense.logMessage("V3.RegisterFile called for '"+filename+"'.")}if(typeof filename!=="string"||filename===""){throw new Error("filename must be specified")}if(typeof version!=="number"||!isFinite(version)){throw new Error("version must be a finite number")}if(typeof fCallback!=="function"){throw new Error("fCallback must be a function")}if(_registeredFiles[filename]){V3.Log.Warn('Registered multiple times into the DOM! Name="'+filename+'"');return}_registeredFiles[filename]={Name:filename,Version:version,IsLoaded:false};if(!V3.WaitForFiles(arrDependencies||[],filename,fCallback.bind(window))){if(V3.debugMode){V3.Log.Debug("Current awaiting count ("+_awaitingFiles.length+"): "+compileString(_awaitingFiles))}}else{V3.Log.Info('Loaded "'+filename+'".');_registeredFiles[filename].IsLoaded=true;if(_awaitingFiles.length>0){for(var i=0;i<_awaitingFiles.length;i++){var awaitingEntry=_awaitingFiles[i];if(fireIfReady(awaitingEntry)){V3.Log.Info("Loaded '"+awaitingEntry.CallbackName+"' (was deferred).");_awaitingFiles.splice(i,1);if(_registeredFiles[awaitingEntry.CallbackName]){_registeredFiles[awaitingEntry.CallbackName].IsLoaded=true}i=-1}}}if(V3.debugMode){V3.Log.Debug("Current awaiting count ("+_awaitingFiles.length+"): "+compileString(_awaitingFiles))}}if(_detectErrorTimerId){clearTimeout(_detectErrorTimerId);_detectErrorTimerId=null}if(_awaitingFiles.length>0){_detectErrorTimerId=setTimeout(function(){Break();var blockingDependencies=[];_awaitingFiles.forEach(function(awaitingEntry){awaitingEntry.Files.forEach(function(dependency){var dependencyKey=dependency.FileName||dependency.Filename||dependency;var r=_registeredFiles[dependencyKey];if(!r&&(!dependency.Version||r.Version<dependency.Version)){var awaitingFileHasCallbackName=false;for(var i=0;i<_awaitingFiles.length;i++){if(_awaitingFiles[i].CallbackName===dependencyKey){awaitingFileHasCallbackName=true;break}}if(!awaitingFileHasCallbackName){blockingDependencies.push(dependencyKey);return false}}});if(blockingDependencies.length>0){return false}});if(_awaitingFiles.every(function(e){return e.IsOptional})){V3.Log.Info("Framework loadup halted by optional "+_awaitingFiles.join(",")+" because of dependencie(s): "+blockingDependencies.join(","),"blockingDependencies",blockingDependencies)}else{V3.Log.Error("Framework loadup halted "+_awaitingFiles.join(",")+" because of dependencie(s): "+blockingDependencies.join(","),"blockingDependencies",blockingDependencies)}},5000)}function compileString(_awaitingFiles){var ret="";for(var i=0;i<_awaitingFiles.length;i++){ret=ret+_awaitingFiles[i].CallbackName+","}return ret}};V3.Dynamic={__class:true,__static:true,LoadScript:function(id,url,callback){if(arguments.length==1){url=id}return loadFile(id,url,"js",null,null,callback)},LoadSheet:function(id,url,isLowPriority,cssFilesToSkip){if(arguments.length<4&&typeof url==="boolean"){cssFilesToSkip=arguments[2];isLowPriority=arguments[1];url=arguments[0]}return loadFile(id,url,"css",isLowPriority,cssFilesToSkip)},RegisterOnDemandModule:function(id,url){if(!_registeredAsyncModules[id]){_registeredAsyncModules[id]={Id:id,Url:url,IsLoading:false}}}};V3.addPlaceholder=function(){document.write('<div id="v3-temp-placeholder"></div>');var e=document.getElementById("v3-temp-placeholder");e.id="";return e}})(V3=V3||{__namespace:true},window); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ var V3 = V3 || {};
V3.Modernizr=(function(A,c,g){var G="2.8.3",v={},y=true,J=c.documentElement,a="modernizr",F=c.createElement(a),C=F.style,I,b={}.toString,j=" -webkit- -moz- -o- -ms- ".split(" "),h="Webkit Moz O ms",D=h.split(" "),H=h.toLowerCase().split(" "),E={svg:"http://www.w3.org/2000/svg"},l={},o={},f={},e=[],k=e.slice,s,m=function(S,U,M,T){var L,R,O,P,K=c.createElement("div"),Q=c.body,N=Q||c.createElement("body");if(parseInt(M,10)){while(M--){O=c.createElement("div");O.id=T?T[M]:a+(M+1);K.appendChild(O)}}L=["&#173;",'<style id="s',a,'">',S,"</style>"].join("");K.id=a;(Q?K:N).innerHTML+=L;N.appendChild(K);if(!Q){N.style.background="";N.style.overflow="hidden";P=J.style.overflow;J.style.overflow="hidden";J.appendChild(N)}R=U(K,S);if(!Q){N.parentNode.removeChild(N);J.style.overflow=P}else{K.parentNode.removeChild(K)}return !!R},i=({}).hasOwnProperty,x;if(!r(i,"undefined")&&!r(i.call,"undefined")){x=function(K,L){return i.call(K,L)}}else{x=function(K,L){return((L in K)&&r(K.constructor.prototype[L],"undefined"))}}if(!Function.prototype.bind){Function.prototype.bind=function d(M){var N=this;if(typeof N!="function"){throw new TypeError()}var K=k.call(arguments,1),L=function(){if(this instanceof L){var Q=function(){};Q.prototype=N.prototype;var P=new Q();var O=N.apply(P,K.concat(k.call(arguments)));if(Object(O)===O){return O}return P}else{return N.apply(M,K.concat(k.call(arguments)))}};return L}}function B(K){C.cssText=K}function u(L,K){return B(j.join(L+";")+(K||""))}function r(L,K){return typeof L===K}function t(L,K){return !!~(""+L).indexOf(K)}function z(M,K){for(var L in M){var N=M[L];if(!t(N,"-")&&C[N]!==g){return K=="pfx"?N:true}}return false}function p(L,O,N){for(var K in L){var M=O[L[K]];if(M!==g){if(N===false){return L[K]}if(r(M,"function")){return M.bind(N||O)}return M}}return false}function n(O,K,N){var L=O.charAt(0).toUpperCase()+O.slice(1),M=(O+" "+D.join(L+" ")+L).split(" ");if(r(K,"string")||r(K,"undefined")){return z(M,K)}else{M=(O+" "+(H).join(L+" ")+L).split(" ");return p(M,K,N)}}l.flexbox=function(){return n("flexWrap")};l.geolocation=function(){return"geolocation" in navigator};l.backgroundsize=function(){return n("backgroundSize")};l.borderimage=function(){return n("borderImage")};l.borderradius=function(){return n("borderRadius")};l.boxshadow=function(){return n("boxShadow")};l.textshadow=function(){return c.createElement("div").style.textShadow===""};l.cssanimations=function(){return n("animationName")};l.cssgradients=function(){var M="background-image:",L="gradient(linear,left top,right bottom,from(#9f9),to(white));",K="linear-gradient(left top,#9f9, white);";B((M+"-webkit- ".split(" ").join(L+M)+j.join(K+M)).slice(0,-M.length));return t(C.backgroundImage,"gradient")};l.cssreflections=function(){return n("boxReflect")};l.csstransforms=function(){return !!n("transform")};l.csstransforms3d=function(){var K=!!n("perspective");if(K&&"webkitPerspective" in J.style){m("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(L,M){K=L.offsetLeft===9&&L.offsetHeight===3})}return K};l.csstransitions=function(){return n("transition")};l.fontface=function(){var K;m('@font-face {font-family:"font";src:url("https://")}',function(O,P){var N=c.getElementById("smodernizr"),L=N.sheet||N.styleSheet,M=L?(L.cssRules&&L.cssRules[0]?L.cssRules[0].cssText:L.cssText||""):"";K=/src/i.test(M)&&M.indexOf(P.split(" ")[0])===0});return K};l.localstorage=function(){try{localStorage.setItem(a,a);localStorage.removeItem(a);return true}catch(K){return false}};l.sessionstorage=function(){try{sessionStorage.setItem(a,a);sessionStorage.removeItem(a);return true}catch(K){return false}};l.svg=function(){return !!c.createElementNS&&!!c.createElementNS(E.svg,"svg").createSVGRect};l.inlinesvg=function(){var K=c.createElement("div");K.innerHTML="<svg/>";return(K.firstChild&&K.firstChild.namespaceURI)==E.svg};l.svgclippaths=function(){return !!c.createElementNS&&/SVGClipPath/.test(b.call(c.createElementNS(E.svg,"clipPath")))};for(var w in l){if(x(l,w)){s=w.toLowerCase();v[s]=l[w]();e.push((v[s]?"":"no-")+s)}}v.addTest=function(L,M){if(typeof L=="object"){for(var K in L){if(x(L,K)){v.addTest(K,L[K])}}}else{L=L.toLowerCase();if(v[L]!==g){return v}M=typeof M=="function"?M():M;if(typeof y!=="undefined"&&y){J.className+=" "+(M?"":"no-")+L}v[L]=M}return v};B("");F=I=null;v._version=G;v._prefixes=j;v._domPrefixes=H;v._cssomPrefixes=D;v.testProp=function(K){return z([K])};v.testAllProps=n;v.testStyles=m;J.className=J.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(y?" js "+e.join(" "):"");var q=v.testStyles=m;v.addTest("hiddenscroll",function(){return q("#modernizr {width:100px;height:100px;overflow:scroll}",function(K){return K.offsetWidth===K.clientWidth})});return v})(this,this.document); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
"use strict";V3.RegisterFile("V3.Utils",1.1,function(V3){var loadedTimeMs=(new Date().valueOf());var loadedRandom=Math.random();var _debugMode=false;var EMPTY_FUNCTION=function(){};var ERROR_FUNCTION=function(errorMessage){throw new Error(errorMessage||"")};V3.Object=(function(){var obj=function(src){if(this instanceof obj){return src?V3.clone(src):{}}else{return new V3.AutoConstruct(obj,src?[src]:null)}};obj.__class=true;try{window.Object.defineProperty({},"test",{enumerable:true,writable:true,configurable:true});obj.define=function(target,name,descriptor){if(typeof descriptor.enumerable!=="boolean"){descriptor.enumerable=true}if(typeof descriptor.writable!=="boolean"){descriptor.writable=true}if(typeof descriptor.configurable!=="boolean"){descriptor.configurable=true}window.Object.defineProperty(target,name,descriptor)}}catch(err){Log.Warn("Browser doesn't support Object.defineProperty() on plain objects. Therefore switching to primitive method 'obj[field]=null;'.","err",err);obj.define=function(target,name,descriptor){target[name]=descriptor.value}}obj.addField=function(target,name,value,hidden,readonly,fixed){var descriptor={value:value,enumerable:hidden===false,writable:readonly,configurable:fixed};return obj.define(target,name,descriptor)};obj.addHidden=function(target,name,initialValue,referenceIsReadOnly){var descriptor={configurable:true,enumerable:false,writable:referenceIsReadOnly!==true,value:null};if(arguments.length>=3){descriptor.value=initialValue}obj.define(target,name,descriptor)};return obj})();V3.Namespace=function(strNamespace,optionalContainer){if((strNamespace+"").indexOf("V3.")===0){strNamespace=strNamespace.substr(3)}if(optionalContainer&&!optionalContainer.__namespace&&optionalContainer!==window){throw"Specified container is not a namespace";return}var names=strNamespace.split(".");var parent=optionalContainer||V3;for(var i=0;i<names.length;i++){var space=parent[names[i]];if(!space){parent[names[i]]=space={}}V3.Object.addHidden(space,"__namespace",true);parent=space}return parent};V3.Namespace("Utils");V3.clone=function(obj,target,bindFunctions){if(Is.ValueType(obj)){throw new Error("not supported error")}if(!target){if(obj instanceof Array){target=[]}else{target={}}}for(var field in obj){var value=obj[field];if(Is.ValueType(value)||!Is.Specified(value)||Is.EnumField(value)){target[field]=value}else{if(Is.Function(value.clone)){target[field]=value.clone()}else{if(Is.PlainObject(value)){target[field]=V3.clone(value,target[field]||{},bindFunctions)}else{if(Is.Function(value)){if(Is.Specified(bindFunctions)){target[field]=value.bind(bindFunctions)}else{target[field]=value}}else{if(Is.Date(value)){target[field]=new Date(value.valueOf())}else{target[field]=value}}}}}}return target};V3.construct=function(ctor,arrArguments){var inst=Object.create(ctor.prototype);var ret=ctor.apply(inst,arrArguments);return Object(ret)===ret?ret:inst};V3.createLookup=function(obj,fGetKey){var f;if(Is.Function(fGetKey)){f=fGetKey}else{var propertyName=fGetKey;f=function(key,value){return value[propertyName]}}var ret={};V3.forEach(obj,function(value,key){ret[f(key,value)]=value});return ret};V3.extend=function(target,overwrite,fields){if(arguments.length===2){fields=arguments[1];overwrite=false}if(V3.Is.ValueType(target)){throw new Error("target must be an object")}if(!target){target={}}for(var fieldName in fields){var field=target[fieldName];if(field!==null&&typeof field==="object"){if(!(field instanceof Array)){V3.extend(field,overwrite,fields[fieldName]);continue}else{if(!overwrite){continue}else{}}}if(typeof field!=="undefined"){if(!overwrite){continue}}target[fieldName]=fields[fieldName]}return target};V3.find=function(obj,fCallback,value,caseSensitive){if(!obj){throw new Error("invalid object")}var ret=null;var predicate;if(Is.Function(fCallback)){predicate=fCallback}else{if(Is.String(value)&&!caseSensitive){value=value.toLowerCase();predicate=function(a){if((a[fCallback]+"").toLowerCase()==value){ret=a;return false}}}else{predicate=function(a){if(a[fCallback]==value){ret=a;return false}}}}V3.forEach(obj,null,function(item,key){if(fCallback(item,key)){ret=item;return false}});return ret};V3.forEach=function(obj,thisArg,fCallback){if(arguments.length<3){fCallback=thisArg;thisArg=this||obj}if(!obj){throw new Error("obj must be set to an instance of array or plain object.")}var iteratedOverAll=true;if(Is.ArrayEnumerable(obj)){for(var i=0;i<obj.length;i++){if(fCallback.call(thisArg,obj[i],i)===false){iteratedOverAll=false;break}}}else{for(var fieldName in obj){if(fCallback.call(thisArg,obj[fieldName],fieldName)===false){iteratedOverAll=false;break}}}return iteratedOverAll};V3.first=function(obj,returnKey){if(!obj){throw new Error("obj not specified")}for(var fieldName in obj){if(returnKey){return fieldName}else{return obj[fieldName]}}return null};V3.isEmpty=function(obj){for(var fieldName in obj){return false}return true};V3.newId=(function(){var _counter=Math.floor(Math.random()*65535);return function(){if(_counter>=65535){_counter=0}else{_counter++}var now=("00000000000"+Math.abs(new Date().valueOf()).toString(16)).slice(-12);var count=("000"+_counter.toString(16)).slice(-4);return now+count}})();V3.sort=function(arr,sortType){if(!sortType){sortType=V3.sortType.AlphabeticallyCaseInsensitive}var ret=[];V3.forEach(function(item){ret.add(item)});ret.sort(function(a,b){return sortType(a,b)});return ret};V3.sortType={AlphabeticallyCaseSensitive:function(a,b){a=(a+"");b=(b+"");return(a==b)?0:(a>b?1:-1)},AlphabeticallyCaseInsensitive:function(a,b){a=(""+a).toUpperCase();b=(""+b).toUpperCase();return(a==b)?0:(a>b?1:-1)}};V3.findFrameworkItem=function(item){var failSafeCounter=2000;var search=function(target,item){var levelsCounter=arguments[2]||0;if(target===item){return""}if(failSafeCounter--<=0){return null}for(var fieldName in target){if(target[fieldName]===item){return fieldName}}if(levelsCounter<10){for(var fieldName in target){var field=target[fieldName];if(typeof field==="object"&&!V3.Is.DomElement(field)){var found=search(field,item,levelsCounter+1);if(typeof found==="string"){return fieldName+"."+found}}}}return null};var found=search(V3,item);if(!found){return null}return"V3."+found};V3.createJsonForDebug=function(obj,spaces,stripOutNulls){var debugJsonReplacer=function(key,value){if(V3.Is.Number(value)){if(V3.Is.EnumField(this[key])){value=V3.findFrameworkItem(this[key])||value}}else{if(value===null){if(stripOutNulls){return undefined}}else{if(this[key] instanceof V3Date){value="/Date('"+this[key].toStringFormat().replace(" 00:00:00.000","")+"')/"}}}return value};return JSON.stringify(obj,debugJsonReplacer,spaces)};V3.parseJson=(function(){var jsonReviverFunction=function(k,v){if(typeof v==="string"){if(v.substr(0,6)==="/Date("){return new Date(parseInt(v.substr(6,v.length-8),10))}else{if(v.length==24&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/g.test(v)){return new Date(v)}}}return v};return function(str){return JSON.parse(str,jsonReviverFunction)}})();V3.addValidation=function(target,fields){function createParameterValidationMethod(checks){return(function(value){for(var i=0;i<checks.length;i++){checks[i](value)}})}function addFieldCheck(fieldName,targetFunction,criteria){if(!(criteria.Params instanceof Array)){throw new Error("Must specify 'Params' array.")}var prefix=fieldName+": ";var parameterIsUnspecified={};for(var i=0;i<criteria.Params.length;i++){var param=criteria.Params[i];var funCheckIsOfType=V3.Is[param.type];if(typeof funCheckIsOfType!=="function"){throw new Error("Unrecognised type '"+criteria.type+"'. For a list of valid types, See: V3.Is.XXXX methods, is case sensitive.")}var checks=[];checks.add(function(value){if(value!==parameterIsUnspecified&&V3.Is.Specified(value)&&!funCheckIsOfType(value)){throw new Error(prefix+"Invalid type supplied for parameter number "+i)}});if(param.isRequired===true){checks.add(function(value){if(typeof value===parameterIsUnspecified&&V3.Is.Property(targetFunction)){return}if(!V3.Is.Specified(value)){throw new Error(prefix+"value must be specified!")}})}if(typeof param.min==="Number"){checks.add(function(value){if(typeof value!=="Number"){value=value.length}if(value<param.min){throw new Error(prefix+"value must be >= "+param.min)}})}if(typeof param.max==="Number"){checks.add(function(value){if(typeof value!=="Number"){value=value.length}if(value>param.max){throw new Error(prefix+"value must be <= "+para.max)}})}param.performParameterValidation=createParameterValidationMethod(checks)}function performValidation(criteria,args,undefined){for(var i=0;i<criteria.Params.length;i++){var value=(i<args.length)?args[i]:parameterIsUnspecified;criteria.Params[i].performParameterValidation(value)}}var fToBind=targetFunction;var fNOP=function(){};var fBound=function(){performValidation(criteria,arguments);return fToBind.apply(this,arguments)};fNOP.prototype=fToBind;fBound.prototype=new fNOP();var wrapper=fBound;if(window.vsDesignTime){intellisense.redirectDefinition(wrapper,targetFunction)}return wrapper}var errors=[];for(var fieldName in fields){if(Is.Function(target[fieldName])){target[fieldName]=addFieldCheck(fieldName,target[fieldName],fields[fieldName])}else{errors.add(new Error("Failed to add validation check"))}}if(errors.length>0){throw (errors.length==1?errors[0]:errors)}};V3.paramDefinition=function(type,isRequired,minValue,maxValue){if(arguments.length===1&&Is.PlainObject(arguments[0])){return arguments[0]}this.type=type;this.isRequired=isRequired;this.min=minValue;this.max=maxValue};var Log=V3.Log=(function(){var con=V3.Log;var insideError=false,doBreak=true;var tracker={};var self;return self={__class:true,__static:true,Debug:function(msg,optionalObjectName,optionalObject,optionalUnwind){if(V3.debugMode||window.vsDesignTime){if(Is.String(optionalObjectName)&&optionalObject&&self.Watch(msg+" "+optionalObjectName,optionalObject,"debug",optionalUnwind)){if(V3.Utils.Console.Enabled){return}}if(V3.Utils.Console&&V3.Utils.Console.Enabled){V3.Utils.Console.WriteDebug(msg)}else{con.Debug(msg)}}},Info:function(msg,optionalObjectName,optionalObject,optionalUnwind){con.Info(msg);if(V3.Utils.Console){V3.Utils.Console.WriteInfo(msg)}if(V3.debugMode){if(Is.String(optionalObjectName)&&optionalObject){self.Watch(optionalObjectName,optionalObject,"info",optionalUnwind)}}},Warn:function(msg,optionalObjectName,optionalObject,optionalUnwind){con.Warn(msg);if(V3.Utils.Console){V3.Utils.Console.WriteWarning(msg)}if(V3.debugMode){if(Is.String(optionalObjectName)&&optionalObject){self.Watch(optionalObjectName,optionalObject,"warn",optionalUnwind)}}},Error:function(msg,optionalObjectName,optionalObject,optionalUnwind){con.Error(msg);if(doBreak&&_debugMode&&V3.isDebuggerAttached()){Break()}if(optionalObject){con.Error(optionalObjectName+": "+optionalObject.toString())}if(insideError){return}insideError=true;if(V3.debugMode){try{if(V3.Utils.Console){V3.Utils.Console.WriteError(msg);if(Is.String(optionalObjectName)&&optionalObject){self.Watch(optionalObjectName,optionalObject,"error",optionalUnwind)}}}catch(err){}}insideError=false},DebugWarning:function(msg){if(!tracker[msg]){tracker[msg]=true;this.Warn(msg)}},Watch:function(objectName,objData,optionalDebugLevel){if(V3.Utils.Console){V3.Utils.Console.AddWatch(objectName,objData,optionalDebugLevel);return true}return false}}})();var Is=V3.Is=(function(){var Is={__class:true};Is.DomElement=function(obj){return(obj&&obj.nodeType)};Is.TextNode=function(obj){return(obj&&obj.nodeType===3)};Is.FormField=function(obj){return(obj&&"INPUT SELECT TEXTAREA".indexOf((""+obj.tagName).toUpperCase())!=-1)};Is.String=function(obj){return(typeof obj==="string")};Is.Number=function(obj){return(typeof obj==="number")};Is.Function=function(obj){return(typeof obj==="function")};Is.Property=function(obj){return(typeof obj==="function"&&obj.__prop)};Is.Date=function(obj){return(obj instanceof Date)};Is.Event=function(obj){return(obj instanceof V3.EventType)};Is.Array=function(obj){return(obj instanceof Array)};Is.ArrayEnumerable=function(obj){if(Is.Array(obj)){return true}else{if(Is.Number(obj.length)&&(obj.length===0||!Is.Undefined(obj[0]))){return true}}return false};Is.Specified=function(obj){return !(obj===null||typeof obj==="undefined")};Is.Boolean=function(obj){return(typeof obj==="boolean")};Is.PlainObject=function(obj){if(typeof obj!=="object"){return false}if(obj instanceof V3.Class){return false}return(Object.prototype.toString.call(obj)==="[object Object]")};Is.Defined=function(obj){return typeof obj!=="undefined"},Is.Undefined=function(obj){return typeof obj==="undefined"};if(Object.prototype.toString.call(arguments)==="[object Arguments]"){Is.Arguments=function(obj){if(Object.prototype.toString.call(obj)==="[object Arguments]"){return true}return false}}else{Is.Arguments=function(obj){if(Object.prototype.toString.call(obj)==="[object Object]"&&Is.Number(obj.length)&&!Is.Function(obj.push)){return true}return false}}Is.EnumField=function(obj){return(obj instanceof V3.Enum.Field)};Is.ValueType=function(value){return Is.String(value)||Is.Number(value)||Is.Boolean(value)};Is.InDOM=function(domElement){do{if(domElement===document){return true}}while(domElement=domElement.parentNode);return false};return Is})();if(!Math.sign){Math.sign=function(x){return((x>0)-(x<0))||+x}}Function.prototype.GetFunctionName=function(){var name=this.name||this.displayName||this.__className;if(!name){var m=/function\s+?(\S+?)\(/i.exec(Function.prototype.toString.call(this));if(m){name=m[1]}}return name||""};Function.prototype.GetFunctionParameters=function(){if(this.__parameterNames instanceof Array){return this.__parameterNames}var str=null;var regex=/function.*?\((.*?)\)/;var match=regex.exec(Function.prototype.toString.call(this));if(match&&match.length==2){str=match[1]}var ret=str.split(",");ret.toString=function(){return str};ret.valueOf=function(){return str};this.__parameterNames=ret;return ret};Function.prototype.InheritsFrom=function(baseClass,extension){if(!baseClass){throw new Error("baseClass is not specified")}else{if(baseClass!==V3.Class&&!(baseClass.prototype instanceof V3.Class)){throw new Error("baseClass must be of type V3.Class")}}var realConstructor=this;var constructorName=this.GetFunctionName();var switchLogic=function(){if(this instanceof baseClass){if(V3.isDebuggerAttached()){return realConstructor.apply(this,arguments)}else{try{return realConstructor.apply(this,arguments)}catch(error){Log.Error("Error while calling a constructor.","error",error)}}}else{return V3.AutoConstruct(fauxConstructor,[].addRange(arguments))}};var fauxConstructor;try{eval("fauxConstructor = function "+constructorName+"() { return switchLogic.apply(this, arguments); };")}catch(err){V3.Log.Error("Failed to create fauxConstructor with constructorName: "+constructorName);eval("fauxConstructor = function default_safe_name() { return switchLogic.apply(this, arguments); };")}V3.Class.SetInheritance(fauxConstructor,baseClass,constructorName);if(extension){V3.extend(fauxConstructor.prototype,true,extension)}realConstructor.prototype=fauxConstructor.prototype;fauxConstructor.__realConstructor=realConstructor;V3.Object.addHidden(fauxConstructor,"__class",true);if(window.vsDesignTime){intellisense.redirectDefinition(fauxConstructor,realConstructor);var example=null;try{example=new fauxConstructor()}catch(error){intellisense.logMessage("Exception while trying to call construction without parameters.");try{example=Object.create(fauxConstructor.prototype);intellisense.logMessage("error="+JSON.stringify(error))}catch(error){example=null}}if(extension){for(var fieldName in example){extension[fieldName]=example[fieldName]}}}return fauxConstructor};RegExp.escape=function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};var RegExpMatch=function(execResult,index){this.groups=execResult;this.value=execResult[0];this.length=this.value.length;this.index=index};RegExpMatch.prototype.toString=function(){return this.value};RegExp.prototype.findAll=function(str){if(!this.global){throw new Error("regexp.global must be set to true")}var ret=[];var result;while((result=this.exec(str))!==null){ret.push(new RegExpMatch(result,this.lastIndex-result[0].length))}if(ret.length==0){return null}return ret};V3.forEach({add:function(value,blockDuplicates){if(blockDuplicates===true&&this.contains(value)){return false}else{this.push(value);return true}},addAt:function(index,item){if(index<0||index>this.length){throw new Error("Index is out of bounds")}this.splice(index,0,item)},addRange:function(arr,blockDuplicates){if(!arr){throw new Error("arr must be specified")}if(arr instanceof Array){arr.forEach(function(item){this.add(item,blockDuplicates)},this)}else{if(Is.Number(arr.length)&&(arr.length===0||!Is.Undefined(arr[0]))){for(var i=0;i<arr.length;i++){this.add(arr[i],blockDuplicates)}}else{throw new Error("'arr' needs to be of type Array, instead received typeof: "+(typeof arr)+".")}}return this},clear:function(){this.length=0},clone:function(){var ret=[];for(var i=0;i<this.length;i++){ret.push(this[i])}return ret},contains:function(item){return this.indexOf(item)!=-1},exists:function(fPredicate,thisArg){for(var i=0;i<this.length;i++){if(fPredicate.call(thisArg,this[i],i,this)){return true}}return false},find:function(fPredicate,thisArg){for(var i=0;i<this.length;i++){if(fPredicate.call(thisArg,this[i],i,this)){return this[i]}}return null},findAll:function(fPredicate,thisArg){var ret=[];for(var i=0;i<this.length;i++){if(fPredicate.call(thisArg,this[i],i,this)){ret.add(this[i])}}return ret},indexOf:function(item){for(var i=0;i<this.length;i++){if(this[i]===item){return i}}return -1},remove:function(item){var i=this.indexOf(item);if(i==-1){return false}else{this.removeAt(i);return true}},removeAll:function(fPredicate,thisArg){for(var i=this.length-1;i>=0;i--){if(fPredicate.call(thisArg,this[i],i,this)){this.removeAt(i)}}},removeAt:function(index){if(!Is.Number(index)){throw new Error("index must be a number")}if(index<0||index>this.length){throw new Error("Index out of bounds")}this.splice(index,1)}},function(field,key){V3.Object.addHidden(Array.prototype,key,field,false)});String.prototype.lpad=function(padString,length){var str=this;while(str.length<length){str=padString+str}return str};String.prototype.rpad=function(padString,length){var str=this;while(str.length<length){str=str+padString}return str};String.prototype.startsWith=function(str,caseSensitive){if(this.length<str.length){return false}var starts=this.substr(0,str.length);if(caseSensitive){return(starts==str)}else{return starts.toLowerCase()==str.toLowerCase()}};String.prototype.endsWith=function(str,caseSensitive){if(this.length<str.length){return false}var ends=this.substr(-str.length);if(caseSensitive){return(ends==str)}else{return ends.toLowerCase()==str.toLowerCase()}};String.prototype.contains=function(str,caseSensitive){if(this.length<str.length){return false}if(caseSensitive){return this.indexOf(str)!=-1}else{return this.toLowerCase().indexOf(str.toLowerCase())!=-1}};Number.prototype.toStringFormat=function(c,d,t){var n=this,c=isNaN(c=Math.abs(c))?2:c,d=d==undefined?".":d,t=t==undefined?",":t,s=n<0?"-":"",i=parseInt(n=Math.abs(+n||0).toFixed(c))+"",j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"")};Number.prototype.toDigits=function(numOfDigits,numOfDecimalPlaces){var str=Math.abs(this).toString();var num,dec=null,decPos=str.indexOf("."),prefix=((this<0)?"-":"");if(decPos==-1){num=str;if(numOfDecimalPlaces>0){dec="0"}}else{num=str.substr(0,decPos);if(numOfDigits<0){numOfDigits=0}dec=str.substr(decPos+1,str.length-decPos-1);if(numOfDecimalPlaces>0||numOfDecimalPlaces<0){if(dec.length>Math.abs(numOfDecimalPlaces)){dec=dec.substr(0,Math.abs(numOfDecimalPlaces))}}}numOfDigits=Math.abs(numOfDigits);if(numOfDecimalPlaces<0){numOfDecimalPlaces=-numOfDecimalPlaces}if(dec==null||numOfDecimalPlaces===0){return prefix+num.lpad("0",numOfDigits)}else{return prefix+num.lpad("0",numOfDigits)+"."+dec.rpad("0",numOfDecimalPlaces)}};Number.prototype.toDecimal=function(maxDecimals,minDecimalLength){var str=Math.abs(this).toString();var num,dec=null,decPos=str.indexOf("."),prefix=((this<0)?"-":"");if(decPos==-1){num=str;if(minDecimalLength>0){dec="0"}}else{num=str.substr(0,decPos);dec=str.substr(decPos+1,str.length-decPos-1);if(maxDecimals>0||maxDecimals<0){if(dec.length>Math.abs(maxDecimals)){dec=dec.substr(0,Math.abs(maxDecimals));dec=dec.replace(/0*$/,"")}}}if(dec==null){return prefix+num}else{return prefix+num+"."+dec.rpad("0",minDecimalLength||0)}};Number.prototype.getNumberOfDecimals=function(){var str=this.toString();var i=str.indexOf(".");if(i==-1){return 0}return str.length-(i+1)};Date.MonthNameStrings=["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.DayOfWeekStrings=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.prototype.toUTCStringFormat=function(format){return this.toStringFormat(format,true)};Date.prototype.equals=function(date){if(this==date){return true}if(!this||!date){return false}return this.getTime()==date.getTime()};Date.prototype.clone=function(){return new Date(this.valueOf())};Date.prototype.toStringFormat=function(format,displayUTC){var dfi;if(displayUTC instanceof CultureInfo){dfi=displayUTC.dateTimeFormat();displayUTC=arguments[3]}else{if(displayUTC instanceof DateTimeFormatInfo){dfi=displayUTC;displayUTC=arguments[3]}else{dfi=CultureInfo.currentCulture().dateTimeFormat()}}if(typeof format!=="string"||format.length===0){format="datetimems"}else{if(format.length==2&&format.substr(0,1)=="%"){format=format.substr(1)}else{if(format.length==1){switch(format){case"t":format=dfi.shortTimePattern();break;case"T":format=dfi.longTimePattern();break;case"d":format=dfi.shortDatePattern();break;case"D":format=dfi.longDatePattern();break;case"g":format=dfi.shortDatePattern()+" "+dfi.shortTimePattern();break;case"G":format=dfi.shortDatePattern()+" "+dfi.longTimePattern();break;case"f":format=dfi.longDatePattern()+" "+dfi.shortTimePattern();break;case"F":format=dfi.fullDateTimePattern();break;case"y":format=dfi.yearMonthPattern();break;case"Y":format=dfi.yearMonthPattern();break;case"m":format=dfi.monthDayPattern();break;case"M":format=dfi.monthDayPattern();break;case"O":format='yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffff';break;case"o":format='yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffff';break}}}}switch(format.toLowerCase()){case"date":return this.getFullYear()+"-"+(this.getMonth()+1).toString().lpad("0",2)+"-"+this.getDate().toString().lpad("0",2);case"time":return this.getHours().toString().lpad("0",2)+":"+this.getMinutes().toString().lpad("0",2)+":"+this.getSeconds().toString().lpad("0",2);case"datetime":return this.getFullYear()+"-"+(this.getMonth()+1).toString().lpad("0",2)+"-"+this.getDate().toString().lpad("0",2)+" "+this.getHours().toString().lpad("0",2)+":"+this.getMinutes().toString().lpad("0",2)+":"+this.getSeconds().toString().lpad("0",2);case"datetimems":return this.getFullYear()+"-"+(this.getMonth()+1).toString().lpad("0",2)+"-"+this.getDate().toString().lpad("0",2)+" "+this.getHours().toString().lpad("0",2)+":"+this.getMinutes().toString().lpad("0",2)+":"+this.getSeconds().toString().lpad("0",2)+"."+this.getMilliseconds().toString().lpad("0",3);case"iso":return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toString().lpad("0",2)+"-"+this.getUTCDate().toString().lpad("0",2)+"T"+this.getUTCHours().toString().lpad("0",2)+":"+this.getUTCMinutes().toString().lpad("0",2)+":"+this.getUTCSeconds().toString().lpad("0",2)+"."+this.getUTCMilliseconds().toString().lpad("0",3)+"Z";case"utcdate":return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toString().lpad("0",2)+"-"+this.getUTCDate().toString().lpad("0",2);case"utctime":return this.getUTCHours().toString().lpad("0",2)+":"+this.getUTCMinutes().toString().lpad("0",2)+":"+this.getUTCSeconds().toString().lpad("0",2)}var src={FullYear:displayUTC?this.getUTCFullYear():this.getFullYear(),Month:displayUTC?this.getUTCMonth():this.getMonth(),Date:displayUTC?this.getUTCDate():this.getDate(),Day:displayUTC?this.getUTCDay():this.getDay(),Hours:displayUTC?this.getUTCHours():this.getHours(),Minutes:displayUTC?this.getUTCMinutes():this.getMinutes(),Seconds:displayUTC?this.getUTCSeconds():this.getSeconds(),Milliseconds:displayUTC?this.getUTCMilliseconds():this.getMilliseconds(),TimezoneOffset:displayUTC?0:this.getTimezoneOffset()};if(format.length<4){switch(format){case"d":return("")+src.Date;case"dd":return(src.Date<10?"0":"")+src.Date;case"ddd":return dfi.abbreviatedDayNames()[src.Day];case"dddd":return dfi.dayNames()[src.Day];case"M":return("")+(src.Month+1);case"MM":return(src.Month<9?"0":"")+(src.Month+1);case"MMM":return dfi.abbreviatedMonthNames()[src.Month];case"MMMM":return dfi.monthNames()[src.Month]}}var ret=format;var constants=/".*?"|'.*?'/gm.findAll(format),constantPlaceholder='"';if(constants){for(var i=0;i<constants.length;i++){ret=ret.replace(constants[i].value,constantPlaceholder)}}if(format.indexOf("h")>=0){var h=(((src.Hours+11)%12)+1).toString();ret=ret.replace("hh",h.lpad("0",2)).replace("h",h)}if(format.indexOf("H")>=0){var h=(src.Hours).toString();ret=ret.replace("HH",h.lpad("0",2)).replace("H",h)}if(format.indexOf("m")>=0){var m=src.Minutes.toString();ret=ret.replace("mm",m.lpad("0",2)).replace("m",m)}if(format.indexOf("s")>=0){var s=src.Seconds.toString();ret=ret.replace("ss",s.lpad("0",2)).replace("s",s)}if(format.indexOf("f")>=0||format.indexOf("F")>=0){var fff=src.Milliseconds.toString().lpad("0",3);var ff=fff.substr(0,2);var f=fff.substr(0,1);ret=ret.replace("fff",fff).replace("ff",ff).replace("f",f);if(format.indexOf("F")>=0){var FFF="FFF";var FF="FF";var F="F";if(fff=="000"){ret=ret.replace(".FFF","").replace("FFF","")}else{ret=ret.replace("FFF",fff)}if(ff=="00"){ret=ret.replace(".FF","").replace("FF","")}else{ret=ret.replace("FF",ff)}if(f=="0"){ret=ret.replace(".F","").replace("F","")}else{ret=ret.replace("F",f)}}}if(format.indexOf("t")>=0){var t=((src.Hours>=12)?dfi.pmDesignator():dfi.amDesignator());ret=ret.replace("tt",t);ret=ret.replace("t",t.substr(0,1))}if(format.indexOf("T")>=0){var t=((src.Hours>=12)?dfi.pmDesignator():dfi.amDesignator());ret=ret.replace("TT",t);ret=ret.replace("T",t.substr(0,1))}if(format.indexOf("y")>=0){var y=src.FullYear.toString().lpad("0",4);ret=ret.replace("yyyy",y).replace("yy",y.substr(2,2))}if(format.indexOf("M")>=0){var m=(src.Month+1).toString();ret=ret.replace(/(^|[^MAP])MM([^M]|$)/gm,"$1"+m.lpad("0",2)+"$2").replace(/(^|[^MAP])M([^M]|$)/gm,"$1"+m+"$2")}if(format.indexOf("d")>=0){var d=src.Date.toString();ret=ret.replace(/(^|[^d])dd([^d]|$)/gm,"$1"+d.lpad("0",2)+"$2").replace(/(^|[^d])d([^d]|$)/gm,"$1"+d+"$2")}if(format.indexOf("ddd")>=0){ret=ret.replace("dddd",dfi.dayNames()[src.Day]).replace("ddd",dfi.abbreviatedDayNames()[src.Day])}if(format.indexOf("MMM")>=0){ret=ret.replace("MMMM",dfi.monthNames()[src.Month]).replace("MMM",dfi.abbreviatedMonthNames()[src.Month])}if(format.indexOf("z")>=0||format.indexOf("Z")>=0){var o=-src.TimezoneOffset;var p=(o>=0)?"+":"-";o=Math.abs(o);var h=Math.floor(o/60).toString();var m=(o%60).toString().lpad("0",2);var z1=p+h,z2=p+h.lpad("0",2),z3=p+h+m,z4=p+h+":"+m,z5=p+h.lpad("0",2)+m,z6=p+h.lpad("0",2)+":"+m;ret=ret.replace("zz:zz",z6).replace("zzzz",z5).replace("z:zz",z4).replace("zzz",z3).replace("zz",z2).replace("z",z1);if(format.indexOf("Z")>=0){if(o==0){ret=ret.replace("ZZ:ZZ","").replace("ZZZZ","").replace("Z:ZZ","").replace("ZZZ","").replace("ZZ","").replace("Z","")}else{ret=ret.replace("ZZ:ZZ",z6).replace("ZZZZ",z5).replace("Z:ZZ",z4).replace("ZZZ",z3).replace("ZZ",z2).replace("Z",z1)}}}if(constants){var index=0;for(var i=0;i<constants.length;i++){var txt=constants[i].value;if(txt=='""'){txt='"'}else{txt=txt.substr(1,txt.length-2)}index=ret.indexOf(constantPlaceholder,index);ret=ret.substr(0,index)+txt+ret.substr(index+constantPlaceholder.length);index=index+txt.length}}return ret};if(window.vsDesignTime){intellisense.annotate(Date,{DayOfWeekStrings:null,MonthNameStrings:null})}V3.Enum=function(values){if(!(this instanceof V3.Enum)){return new V3.Enum(values)}var isArray=Is.Array(values);var fieldPrototypeFunction=function(){V3.Enum.Field.apply(this,arguments)};fieldPrototypeFunction.prototype=new V3.Enum.Field();delete this.prototype;V3.Object.addHidden(this,"prototype",fieldPrototypeFunction.prototype,true);V3.forEach(values,this,function(value,key){var fieldName,fieldValue;if(isArray){fieldName=value;fieldValue=key}else{fieldName=key;fieldValue=value}var accessibleName=fieldName.toString().replace(/\W/g,"");if(!Is.ValueType(fieldValue)){throw Error("The value of an enum field must be a value type.")}fieldName=fieldName+"";var field=new fieldPrototypeFunction(accessibleName,fieldName,fieldValue);this[accessibleName]=field;if(window.vsDesignTime){intellisense.redirectDefinition(field,values)}});if(window.vsDesignTime){intellisense.redirectDefinition(this,values);intellisense.annotate(this,{prototype:null})}return this};V3.Object.addHidden(V3.Enum.prototype,"__enum",true);delete V3.Enum.prototype.constructor;V3.Object.addHidden(V3.Enum.prototype,"exists",function(value){if(!this.__enum){return false}for(var fieldName in this){if(this[fieldName]===value){return true}}return false});V3.Object.addHidden(V3.Enum.prototype,"fromValue",function(val){for(var key in this){if(this[key].valueOf()==val){return this[key]}}throw new Error("Value not found! Value="+val)});V3.Object.addHidden(V3.Enum.prototype,"parse",function(strValue){if(typeof strValue==="undefined"||strValue===null){return null}if(typeof strValue==="string"){if(this[strValue]){return this[strValue]}for(var field in this){if(this[field].toString(true)===strValue){return this[field]}}if(strValue==parseFloat(strValue).toString()){strValue=parseFloat(strValue)}}if(strValue instanceof V3.Enum.Field){for(var field in this){if(this[field]===strValue||(this[field].valueOf()===strValue.valueOf()&&this[field].toString()===strValue.toString())){return this[field]}}}for(var field in this){if(this[field].valueOf()===strValue){return this[field]}}return null});V3.Enum.Field=function(fieldName,displayName,value){V3.Object.addHidden(this,"_fieldName",fieldName);V3.Object.addHidden(this,"_displayName",displayName);V3.Object.addHidden(this,"_value",value)};V3.Object.addHidden(V3.Enum.Field.prototype,"__enumMember",true);V3.Object.addHidden(V3.Enum.Field.prototype,"toString",function(returnDisplayName){return returnDisplayName?this._displayName:this._fieldName});V3.Object.addHidden(V3.Enum.Field.prototype,"valueOf",function(){return this._value});V3.Object.addHidden(V3.Enum.Field.prototype,"equals",function(obj){return obj==this._value||obj===this._fieldName});V3.Object.addHidden(V3.Enum.Field.prototype,"toJSON",function(){return this.valueOf()});V3.Object.addHidden(V3.Enum.Field.prototype,"toStringDebug",function(){return this.toString()+" {"+this.valueOf()+"}"});V3.Class=function(){if(!(this instanceof V3.Class)){var c=new V3.Class();c.__static=true;return c}else{if(_debugMode){var sw=new V3.Utils.StopWatch(true)}if(!this.constructor.__compiledAutoInstantiate){if(_debugMode){var sw=new V3.Utils.StopWatch(true)}var bdy="";var fun={};for(var key in this){if(this[key]&&typeof this[key].__autoInstantiate==="function"){fun[key]=this[key].__autoInstantiate.bind(this[key]);bdy+='fun["'+key+'"](i,"'+key+'");\r\n';if(_debugMode){bdy+='timings["'+key+'"]=sw.getDuration();sw.reset(true);'}}}var compiled=null;if(bdy.length>0){if(_debugMode){bdy="var timings={}; var sw= new V3.Utils.StopWatch(true);"+bdy+"return timings;"}compiled=new Function("fun","i",bdy)}if(compiled){this.constructor.__compiledAutoInstantiate=compiled.bind(this,fun)}else{this.constructor.__compiledAutoInstantiate=EMPTY_FUNCTION}if(_debugMode){Log.Debug("Compiling auto instantiate method for "+this.constructor.name+" ("+sw.getDuration()+"ms)")}}var timings=this.constructor.__compiledAutoInstantiate(this);if(_debugMode){sw.stop();if(sw.getDuration()>25){Log.Warn("Auto Instantiate took: "+sw.getDuration()+"ms. Class: "+this.constructor.name,"timings",timings)}}}};V3.Object.addHidden(V3.Class,"__class",true);V3.Object.addHidden(V3.Class.prototype,"__class",true);V3.Object.addHidden(V3.Class.prototype,"__baseConstructors__",[]);V3.Class.prototype.base=function(arg1,arg2,etc){var args=[].slice.call(arguments,0);var proto=Object.getPrototypeOf(this);if(typeof this.__baseConstructorIndex__!=="number"){V3.Object.addHidden(this,"__baseConstructorIndex__");this.__baseConstructorIndex__=proto.__baseConstructors__.length}var baseCtor=proto.__baseConstructors__[this.__baseConstructorIndex__=this.__baseConstructorIndex__-1];if(arguments.length<baseCtor.length){Log.Warn("Invoking base constructor with not enought arguments based on constructor signature. baseCtor="+baseCtor.name+", Expected number of arguments:"+baseCtor.length+", Specified:"+arguments.length)}baseCtor.apply(this,args);if(this.__baseConstructorIndex__===0){delete this.__baseConstructorIndex__}};V3.Class.prototype.toString=function(){var ret="[instanceof ("+((this.constructor&&this.constructor.name)||"?")+")]";if(this.id){if(Is.String(this.id)){ret=ret+"."+this.id}else{if(Is.Property(this.id)){ret+ret+"."+this.id()}}}return ret};V3.Class.prototype.Set=function(objFields){V3.forEach(objFields,this,function(value,field){if(!(field in this)){throw new Error("'"+field+"' was not found on object.")}var target=this[field];if(Is.Property(target)){target.call(this,value)}else{if(Is.Event(target)){if(Is.Event(value)){target.addEventHandler(value.fire.bind(value))}else{if(Is.Function(value)){target.addEventHandler(value)}else{if(value!==null){throw new Error("Value must be a function. Value="+value)}}}}else{if((target instanceof V3.Collection||Is.Array(value))&&(Is.Function(target.add)||Is.Function(target.addRange))){if(value!==null){if(Is.Function(target.addRange)){target.addRange(value)}else{value.forEach(function(item){target.add(item)},this)}}}else{if(Is.Function(target)){if(Is.Function(value)){this[field]=value}else{if(Is.Array(value)){target.apply(this,value)}else{target.call(this,value)}}}else{if(Is.PlainObject(value)){V3.Class.prototype.Set.call(target,value)}else{if(Is.Undefined(target)){Log.Error("Field not found! Name="+field,"target",this)}else{this[field]=value}}}}}}if(window.vsDesignTime){intellisense.redirectDefinition(field,target)}});return this};V3.Class.SetInheritance=function(ctor,baseClass){var baseInstance=Object.create(baseClass.prototype);ctor.prototype=baseInstance;delete baseInstance.__baseConstructorIndex__;baseInstance.constructor=ctor;V3.Object.addHidden(baseInstance,"__baseConstructors__",baseClass.prototype.__baseConstructors__.clone());baseInstance.__baseConstructors__.add(baseClass);var className=(arguments.length==3?arguments[2]:ctor.GetFunctionName());V3.Object.addHidden(baseInstance,"__className",className,true);V3.Object.addHidden(baseInstance,"__baseClassName",baseClass.GetFunctionName(),true);if(Is.Undefined(ctor.name)){V3.Object.addHidden(ctor,"name",className,true)}if(window.vsDesignTime){ctor.prototype.base=function(){V3.Class.prototype.base.apply(this,arguments)};intellisense.redirectDefinition(ctor.prototype.base,baseClass)}};V3.EventType=function EventType(eventName,optionalArgsString,optionalSingleUse,optionalIsDebugEvent,args){this._delegates=[];var me=this;args=arguments[arguments.length-1];if(args==optionalArgsString){args=null}if(!args||typeof args!=="object"){args={}}this.name=eventName;this.signature=optionalArgsString;if(args.bind&&args.bind instanceof Array&&args.bind.length>0){this.setBindParameters(args.bind);this._owner=args.owner||args.bind[0]}else{this._owner=args.owner||this;this._bindParams=[];this._bindParams.thisArg=this._owner}this._singleUse=(optionalSingleUse===true);this._hasFired=false;if(Is.Undefined(args.log)){if(optionalIsDebugEvent===true){args.log=false}else{args.log=(V3.EventType._doLogging.length===0||V3.EventType._doLogging[V3.EventType._doLogging.length-1])}}this._doLog=args.log===true||args.log==="silent";if(Is.Function(args.lazyLoadCallback)){this._lazyLoadCallback=args.lazyLoadCallback}else{}this.removeEventHandler=this._removeEventHandler;this.fire=this._fire;if(!this._lazyLoadCallback){this.addEventHandler=this._addEventHandler}else{this.addEventHandler=function(targetFunction){this._lazyLoadCallback.call(this._owner,this);this._addEventHandler(targetFunction);this.addEventHandler=this._addEventHandler}}if(this._singleUse){this.reset=function(){this._hasFired=false}}if(window.vsDesignTime){if(Is.String(optionalArgsString)){var arrFireParameters=optionalArgsString.split(",").slice(this._bindParams.length);var fireParams=[];arrFireParameters.forEach(function(paramName){fireParams.add({name:paramName})});this.fire=this.fire.bind(this);this.addEventHandler=this.addEventHandler.bind(this);intellisense.addSignature(this.fire,"Fires/triggers the event for all event handlers to receive.",fireParams);intellisense.addSignature(this.addEventHandler,"The function to invoke when event is fired. Handler function should have the signature: function("+optionalArgsString+")").addParameter("targetFunction("+optionalArgsString+")","Function","")}}};V3.Object.addHidden(V3.EventType,"__class",true,true);V3.Object.addHidden(V3.EventType.prototype,"__event",true,true);V3.extend(V3.EventType.prototype,{setOwner:function(owner){if(this._bindParams.thisArg===this._owner){this._bindParams.thisArg=owner}this._owner=owner},setBindParameters:function(arrBindParameters){this._bindParams=arrBindParameters.slice(1);this._bindParams.thisArg=arrBindParameters[0]},toStringDebug:function(){var ownerName=null;var id;if(this._owner){id=(this._owner.id||this._id);if(this._owner.constructor&&this._owner!=this){ownerName=this._owner.constructor.name;if(!ownerName&&Is.Function(this._owner.constructor.GetFunctionName)){ownerName=this._owner.constructor.GetFunctionName()}}}if(id){if(Is.Property(id)){id=id()}}var pfix="";if(ownerName){pfix="("+ownerName+")"}if(id){pfix="["+pfix+id+"]"}if(pfix){pfix=pfix+"."}return"event "+pfix+this.name},_fireDelegate:function(delegate,argArray){if(V3.debugMode||V3.isDebuggerAttached()){return delegate.apply(this._bindParams.thisArg,this._bindParams.concat(argArray))}else{try{return delegate.apply(this._bindParams.thisArg,this._bindParams.concat(argArray))}catch(err){var me=this;setTimeout(function(){throw err},1);Log.Error("Error while firing event "+this.name,"err",err);if(_debugMode){Log.Watch("",{handler:delegate.toString(),args:argArray},"error",true)}if(V3.Utils.OnEventError!=this){V3.Utils.OnEventError.fire(this.name,err,argArray)}}}},_addEventHandler:function(targetFunction){if(typeof targetFunction!="function"){throw"Invalid target specified"}if(this._singleUse&&this._hasFired){var me=this;me._fireDelegate(targetFunction,me._lastFireParameters)}else{if(this.fire===EMPTY_FUNCTION){this.fire=this._fire}return this._delegates.add(targetFunction,true)}},_removeEventHandler:function(targetFunction){if(typeof(targetFunction)!="function"){throw"Invalid target specified"}return this._delegates.remove(targetFunction)},_fire:function(arg1,arg2,etc){var argArray=Array.prototype.slice.call(arguments,0);if(this._singleUse){if(this._hasFired){return}this._lastFireParameters=argArray}if(this._doLog===true){var obj=[].addRange(argArray);obj.EventObject=this;Log.Debug("Firing "+this.toStringDebug(),"",obj)}var ret=[];if(this._delegates.length>0){var timer=_debugMode?new V3.Utils.StopWatch():null;for(var i=0;i<this._delegates.length&&i<=5000;i++){if(_debugMode){timer.reset(true)}var returnValue=this._fireDelegate(this._delegates[i],argArray);if(Is.Specified(returnValue)){ret.add(returnValue)}if(_debugMode){timer.stop();if(timer.getDuration()>500){Log.Warn("Event handler took a long time to execute. Duration to execute: "+timer.getDuration()+"ms.","Details",{Event:this,Delegate:this._delegates[i]})}}}if(this._delegates.length>5000){Log.Error("Number of event listeners exceeds the maximum of 5000! Event="+this.toStringDebug())}else{if(this._delegates.length>100){Log.Warn("Number of event listeners is very high ("+this._delegates.length+"), possible recursive loop where event handler is adding new event handlers. Event="+this.toStringDebug())}}}this._hasFired=true;return ret}});V3.EventType._doLogging=[];V3.EventType.setDefaultLoggingStatus=function(doLogging){V3.EventType._doLogging.add(doLogging)};V3.EventType.revertDefaultLoggingStatus=function(){if(V3.EventType._doLogging.length===0){Log.Warn("cancelLogging was called too many times!")}else{V3.EventType._doLogging.removeAt(V3.EventType._doLogging.length-1)}};V3.EventPrototype=function(optionalArgsString,optionalSingleUse,optionalIsDebugEvent){var doLogging=V3.EventType._doLogging[V3.EventType._doLogging.length-1];return V3.AutoConstruct(V3.EventType,[].addRange(arguments),function funCustomInstantiateCode(classInstance,fieldName,ctor,args){args.addAt(0,fieldName);V3.EventType.setDefaultLoggingStatus(doLogging);var e=V3.construct(V3.EventType,args);V3.EventType.revertDefaultLoggingStatus();e.setOwner(classInstance);return e})};V3.Property=function(thisArg,fGetter,fSetter){if(!(this instanceof V3.Property)){var ret=V3.AutoConstruct(V3.Property,[].addRange(arguments),true);var Defaults=ret.Defaults.bind(ret);delete ret.Defaults;ret.OnChange=function(handler){Defaults({OnChange:handler});return this};return ret}if(arguments.length<1){throw new Error("No enough parameters specified, required at least 2, instead received "+arguments.length+".")}if(!window.vsDesignTime&&(Is.Undefined(thisArg)||Is.Function(thisArg))){throw new Error("thisArg must be specified, and should be an object, not a function.")}var fCallbackOnSet=null;var fCallbackOnGet=null;var initialValue=null;if(arguments.length==2){if(Is.Function(arguments[1])){fCallbackOnGet=arguments[1]}else{initialValue=arguments[1]}}else{if(arguments.length==3){if(Is.Function(arguments[1])){fCallbackOnGet=arguments[1];fCallbackOnSet=arguments[2]}else{initialValue=arguments[1];fCallbackOnSet=arguments[2]}}}var storage={value:initialValue};var onChange=null;var property;if(fCallbackOnGet&&!fCallbackOnSet){property=fCallbackOnGet.bind(thisArg)}else{onChange=new V3.EventType("Property.OnChange","value, oldValue",{bind:[thisArg],log:false});property=function(value){if(arguments.length==0){if(fCallbackOnGet){return fCallbackOnGet.call(thisArg,storage.value)}else{return storage.value}}else{if(Is.Property(value)){var foreignProperty=value;property.bindProperty(foreignProperty)}else{if(fCallbackOnSet){var refSubstitute={value:value};if(fCallbackOnSet.call(thisArg,value,storage.value,refSubstitute)===false){return}value=refSubstitute.value}if(value!==storage.value){var oldValue=storage.value;storage.value=value;if(onChange){onChange.fire(value,oldValue)}}}}};if(onChange){property.OnChange=onChange;property.bindProperty=function(foreignProperty){if(!foreignProperty){throw new Error("foreignProperty must be specified")}if(!foreignProperty.OnChange){throw new Error("foreignProperty is read only, cannot bind to read-only properties")}foreignProperty.OnChange.addEventHandler(property);property.OnChange.addEventHandler(foreignProperty);property(foreignProperty())};property.unbindProperty=function(foreignProperty){foreignProperty.OnChange.removeEventHandler(property);property.OnChange.removeEventHandler(foreignProperty)}}}V3.Object.addHidden(property,"__prop",true,true);if(window.vsDesignTime){if(fCallbackOnGet||fCallbackOnSet){intellisense.redirectDefinition(property,fCallbackOnGet||fCallbackOnSet)}else{if(onChange){var orig=onChange.addEventHandler;onChange.addEventHandler=function(handler){intellisense.redirectDefinition(property,handler);orig.call(this,arguments);onChange.addEventHandler=orig};intellisense.redirectDefinition(onChange.addEventHandler,orig)}}}return property};V3.PropertyPrototype=function(fGetter,fSetter){return V3.Property.apply(this,arguments)};var Placeholder=function(){};Placeholder.prototype.Defaults=function(obj){var placeholder=this;if(!obj){return}var bdy="";V3.forEach(obj,function(value,key){if(Is.Function(value)){bdy+='o["'+key+'"]=d["'+key+'"].bind(i||o);'}else{bdy+='o["'+key+'"]=d["'+key+'"];'}});placeholder.__defaults=new Function("d","o","i",bdy).bind(null,obj);placeholder.Defaults=ERROR_FUNCTION.bind(null,"Defaults has already been called");return this};Placeholder.prototype.__autoInstantiate=function(classInstance,fieldName){var placeholder=this;var newInstance=placeholder.createInstance(classInstance,fieldName);classInstance[fieldName]=newInstance;return newInstance};Placeholder.prototype.createInstance=function(classInstance,fieldName){var placeholder=this;if(!placeholder.__funCustomInstantiateCode){if(placeholder.__injectOwnerReferences&&!classInstance){throw new Error("owner must be specified")}}var args=placeholder.__arrArguments.clone();if(placeholder.__injectOwnerReferences){args.addAt(0,classInstance)}var newInstance;if(placeholder.__funCustomInstantiateCode){newInstance=placeholder.__funCustomInstantiateCode(classInstance,fieldName,placeholder.__ctor,args)}else{newInstance=V3.construct(placeholder.__ctor,args)}if(placeholder.__defaults){var spec={};placeholder.__defaults(spec,classInstance);V3.Class.prototype.Set.call(newInstance,spec)}return newInstance};Placeholder.prototype.toString=function(){return"auto constructor"};V3.AutoConstruct=function(ctor,arrArguments,injectOwnerReference){if(!arrArguments){arrArguments=[]}var placeholder=new Placeholder();var funCustomInstantiateCode=null;if(injectOwnerReference===true){placeholder.__injectOwnerReferences=true}else{if(Is.Function(injectOwnerReference)){funCustomInstantiateCode=injectOwnerReference}}if(ctor.prototype instanceof V3.Class||ctor===V3.Property){if(injectOwnerReference!==true&&ctor.prototype instanceof V3.Class){placeholder.InjectOwner=function(){placeholder.__injectOwnerReferences=true;return this}}if(window.vsDesignTime){intellisense.annotate(placeholder.Defaults,V3.Class.prototype.Set);intellisense.annotate(placeholder,new ctor(arrArguments))}}else{placeholder.Defaults=null}placeholder.__arrArguments=arrArguments;placeholder.__ctor=ctor;placeholder.__funCustomInstantiateCode=funCustomInstantiateCode;return placeholder};window.__V3_globallyAccessible={};V3.GetGloballyAccessibleFunctionReference=(function(){var counter=0;return function(fHandler,optionalSalt){if(!Is.Function(fHandler)){throw new Error("fHandler must be a function.")}if(Is.Undefined(optionalSalt)){optionalSalt=""}var uid="f"+optionalSalt+(counter++);__V3_globallyAccessible[uid]=fHandler;return"__V3_globallyAccessible['"+uid+"']"}})();window.V3Date=(function(Date){Date.prototype.asDate=function(){return this};Date.prototype.asV3Date=function(){return new V3Date(this)};function V3Date(value_or_year,month,day,hour,minute,second,millisecond){if(arguments.length==0||arguments[0]===null||typeof arguments[0]==="undefined"){var now=new Date();this.setFromDate(now)}else{if(arguments.length==1){if(typeof arguments[0]==="string"){this._set_d(V3Date.parseStrict(arguments[0])._d)}else{if(typeof arguments[0]==="number"){this.setFromDate(new Date(arguments[0]))}else{if(arguments[0] instanceof Date){this.setFromDate(arguments[0])}else{throw new Error("Invalid argument passed into V3Date constructor. Value="+arguments[0])}}}}else{this._set_d(new Date(Date.UTC.apply(this,arguments)))}}}V3Date.prototype=new Date(0);V3Date.equals=function(a,b){if(a&&!b){return false}else{if(!a&&b){return false}else{return a.asDate().valueOf()==b.asDate().valueOf()}}};var proto=V3Date.prototype;proto._set_d=function(_d){if(isNaN(_d.getDate())){throw new Error("d is NAN")}this._d=_d;this.onchange()};proto.onchange=function(){this.value=this.toString()};proto.clone=function(){return new V3Date(this)};var funNames=["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds","Day"];for(var i=0;i<funNames.length;i++){var funName=funNames[i];(function(funName,i){proto["get"+funName]=function(){return this._d["getUTC"+funName].apply(this._d,arguments)};proto["set"+funName]=function(val){var ret=this._d["setUTC"+funName].apply(this._d,arguments);this.onchange();return ret};proto["getUTC"+funName]=function(){var d=this.asDate();return d["getUTC"+funName].apply(d,arguments)};proto["setUTC"+funName]=function(val){var d=this.asDate();var ret=d["setUTC"+funName].apply(d,arguments);this.setFromDate(d);this.onchange();return ret}})(funName,i)}proto.toTimeString=function(){return this.toString("HH:mm:ss")+' "UTC"zzzz'};V3Date.parse=function(strDate){return Date.parse(strDate)};proto.toString=Date.prototype.toStringFormat;proto.asV3Date=function(){return this};proto.valueOf=function(){return this.asDate().valueOf()};proto.toJSON=function(){return this.toISOString()};proto.toISOString=function(){return this.toUTCString("ISO")};proto.toUTCString=function(format){return this.toStringFormat(format,true)};proto.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};proto.getTime=function(){return this.asDate().getTime()};proto.getTimezoneOffset=function(){this.asDate().getTimezoneOffset()};proto.asDate=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());return d};proto.setFromDate=function(d){this._set_d(new Date(Date.UTC(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds())))};proto.addYears=function(years){var n=new V3Date(this);n.setFullYear(n.getFullYear()+years);return n};proto.addMonths=function(months){var n=new V3Date(this);n.setMonth(n.getMonth()+months);return n};proto.addDays=function(days){var n=new V3Date(this);n.setDate(n.getDate()+days);return n};proto.addHours=function(hours){var n=new V3Date(this);n.setHours(n.getHours()+hours);return n};proto.addSeconds=function(seconds){var n=new V3Date(this);n.setSeconds(n.getSeconds()+seconds);return n};proto.addMilliseconds=function(milliseconds){var n=new V3Date(this);n.setMilliseconds(n.getMilliseconds()+milliseconds);return n};proto.date=function(){return new V3Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0)};proto.getDayOfWeek=function(){return V3.CultureInfo.currentCulture().dateTimeFormat().dayNames()[this.getDay()]};proto.getDaysBetween=function(date){var ONE_DAY=86400000;var d1=this.asV3Date().date(),d2=date.asV3Date().date();var diffDayDecimal=(d1.getUTCTime()-d2.getUTCTime())/ONE_DAY;return(diffDayDecimal>=0)?Math.floor(diffDayDecimal):Math.ceil(diffDayDecimal)};proto.getHoursBetween=function(date){var ONE_HOUR=3600000;var d1=this.asV3Date(),d2=date.asV3Date();var diffHourDecimal=(d1.getUTCTime()-d2.getUTCTime())/ONE_HOUR;return(diffHourDecimal>=0)?Math.floor(diffHourDecimal):Math.ceil(diffHourDecimal)};proto.getLastDOW=function(strName,formatter){if(formatter instanceof CultureInfo){formatter=formatter.dateTimeFormat()}else{if(!(formatter instanceof DateTimeFormatInfo)){formatter=V3.CultureInfo.currentCulture().dateTimeFormat()}}var dowOffset=null;var names=[].addRange(formatter.dayNames()).addRange(formatter.abbreviatedDayNames());for(var i=0;i<names.length;i++){if(strName.toLowerCase()==names[i].toLowerCase()){dowOffset=(i%7)-this.getDay();if(dowOffset>0){dowOffset-=7}break}}if(dowOffset===null){throw new Error(strName+" is not recognised as a valid Day of Week")}return this.addDays(dowOffset)};V3Date.min=function(){var m=arguments[0];for(var i=0;i<arguments.length;i++){if(arguments[i].valueOf()<m.valueOf()){m=arguments[i]}}return m};V3Date.max=function(){var m=arguments[0];for(var i=0;i<arguments.length;i++){if(arguments[i].valueOf()>m.valueOf()){m=arguments[i]}}return m};V3Date.parseStrict=function(strDate){if(typeof strDate!=="string"){return null}var Y=parseInt(strDate.substr(0,4),10),M=parseInt(strDate.substr(5,2),10),D=parseInt(strDate.substr(8,2),10),h=0,m=0,s=0,f=0;if(strDate.length>=15){h=parseInt(strDate.substr(11,2),10);m=parseInt(strDate.substr(14,2),10);if(strDate.length>=19){s=parseInt(strDate.substr(17,2),10)}if(strDate.length>=21){f=parseInt(strDate.rpad("0",23).substr(20,3),10)}if(!isFinite(s)){s=0}if(!isFinite(f)){f=0}}M=M-1;if(isNaN(Y)){throw new Error("unable to parse string: "+strDate)}return new V3Date(Y,M,D,h,m,s,f)};return V3Date})(Date);var TimeSpan=(function(){var SECOND=1000,MINUTE=SECOND*60,HOUR=MINUTE*60,DAY=HOUR*24;var TimeSpan=function(milliseconds){this.TotalDays=milliseconds/DAY;this.TotalHours=milliseconds/HOUR;this.TotalMinutes=milliseconds/MINUTE;this.TotalMilliseconds=milliseconds;if(milliseconds<DAY){this.Days=0}else{this.Days=Math.floor(milliseconds/DAY);milliseconds-=(this.Days*DAY)}if(milliseconds<HOUR){this.Hours=0}else{this.Hours=Math.floor(milliseconds/HOUR);milliseconds-=(this.Hours*HOUR)}if(milliseconds<MINUTE){this.Minutes=0}else{this.Minutes=Math.floor(milliseconds/MINUTE);milliseconds-=(this.Minutes*MINUTE)}if(milliseconds<SECOND){this.Seconds=0}else{this.Seconds=Math.floor(milliseconds/SECOND);milliseconds-=(this.Seconds*SECOND)}this.Milliseconds=milliseconds};TimeSpan.__struct=true;TimeSpan.prototype={toString:function(){var ret="";if(this.Days){ret=this.Days+":"}ret+=this.Hours+":"+this.Minutes+":"+this.Seconds;if(this.Milliseconds){ret+="."+this.Milliseconds}return ret},toShortString:function(){var ret="";if(this.Days){ret+=this.Days+"d"}if(this.Hours){ret+=" "+this.Hours+"h"}if(this.Minutes){ret+=" "+this.Minutes+"m"}if(this.Seconds){ret+=" "+this.Seconds+"s"}if(this.Milliseconds){ret+=" "+this.Milliseconds+"ms"}return ret.trim()},toLongString:function(){var fields=[];var t=TimeSpan._Terms;if(this.Days){fields.add(this.Days+" "+(this.Days>1?t.ds:t.d))}if(this.Hours){fields.add(this.Hours+" "+(this.Hours>1?t.hs:t.h))}if(this.Minutes){fields.add(this.Minutes+" "+(this.Minutes>1?t.ms:t.m))}if(this.Seconds){fields.add(this.Seconds+" "+(this.Seconds>1?t.ss:t.s))}var ret="";for(var i=0;i<fields.length;i++){if(i>0){if(i==fields.length-1){ret+=" "+t.and+" "}else{ret+=", "}}ret+=fields[i]}return ret}};TimeSpan.fromDays=function(days){return new TimeSpan(days*DAY)};TimeSpan.fromHours=function(hours){return new TimeSpan(hours*HOUR)};TimeSpan.fromMinutes=function(minutes){return new TimeSpan(minutes*MINUTE)};TimeSpan.fromSeconds=function(seconds){return new TimeSpan(seconds*SECOND)};TimeSpan._Terms={and:"and",d:"Day",ds:"Days",h:"Hour",hs:"Hours",m:"Minute",ms:"Minutes",s:"Second",ss:"Seconds"};return TimeSpan})();var StopWatch=function StopWatch(doStart,namedWatch){if(!StopWatch.NamedWatches){StopWatch.NamedWatches={}}if(namedWatch===undefined&&typeof doStart=="string"){namedWatch=doStart;doStart=undefined}if(!namedWatch){this.name="{Unnamed}"}else{this.name=namedWatch;if(StopWatch.NamedWatches[namedWatch]){var existing=StopWatch.NamedWatches[namedWatch];if(doStart){existing.start()}return existing}else{StopWatch.NamedWatches[namedWatch]=this}}this.reset(doStart)};StopWatch.__class=true;StopWatch.prototype={reset:function(doStart){var wasRunning=this._get_isRunning();this._startTime=new Date();this._lastDuration=0;this._set_isRunning(false);if(doStart){this.start()}return wasRunning},start:function(){if(this._get_isRunning()){return false}else{this._startTime=new Date();this._set_isRunning(true);return true}},stop:function(){var wasRunning;if(!this._get_isRunning()){wasRunning=false}else{this._lastDuration=this._calculateDuration();this._set_isRunning(false);wasRunning=true}return wasRunning},_calculateDuration:function(){return this._lastDuration+(new Date().getTime()-this._startTime.getTime())},getDuration:function(){if(this._get_isRunning()){return this._calculateDuration()}return this._lastDuration},_get_isRunning:function(){return this._isRunning},_set_isRunning:function(value){this._isRunning=value;this.isRunning=value},toString:function(){return this.name+(this._get_isRunning()?" {Is Running":" {Is Stopped")+" Duration="+this.getDuration()+"ms }"}};var Animation=function Animation(duration,offset,doPulsing,fStep){if(arguments.length<2||arguments.length>4){throw new Error("Invalid number of arguments specified")}if(arguments.length===2){fStep=arguments[1];doPulsing=false;offset=0}if(arguments.length===3){fStep=arguments[2];if(Is.Boolean(arguments[1])){doPulsing=arguments[1];offset=0}else{if(Is.Number(arguments[1])){offset=arguments[1];doPulsing=false}}}this._doRun=false;this._startCount=0;this._stopCount=0;this._duration=duration||400;this._effectiveDuration=this._duration/(doPulsing?2:1);this._timerId=0;this._doPulsing=doPulsing;this._repeatCount=0;this._stopCallback=null;this._offset=offset?(offset*this._effectiveDuration):0;this._fCallback=fStep;this.refreshRate=new V3.Property(this,20,function(value,prevValue,refSubstitute){if(value<0.5){refSubstitute.value=1}else{if(value>60){refSubstitute.value=60}}});this.refreshRate.OnChange.addEventHandler(function(value){this._setTimer()});this.OnStart=new V3.EventType("V3.Utils.Animation.OnStart","sender",{owner:this});this.OnCompleted=new V3.EventType("V3.Utils.Animation.OnCompleted","sender",{owner:this})}.InheritsFrom(V3.Class,{_timerId:0,_startCount:0,_repeatCount:0,_position:0,_resumePosition:0,_fun:function(){var stopRunning=false;var now=new Date().getTime();if(!this._startCount){this._startCount=now;this._stopCount=now+this._duration}if(this._repeatCount==-1){if(!this._doRun){stopRunning=true}}else{if(now>=this._stopCount){if(!this._doRun||this._repeatCount==0){now=this._startCount+this._duration;stopRunning=true}else{if(this._repeatCount>0){this._repeatCount-=1;this._startCount=now}}}}var steppingBackwards=false;var ms=(now-this._startCount);this._position=ms;ms=(ms+this._offset)%this._duration;if(ms>this._effectiveDuration){ms=this._duration-ms;steppingBackwards=true}var x=ms/this._effectiveDuration;var easedPercentage;if(!steppingBackwards){easedPercentage=-1*(x)*(x-2)}else{easedPercentage=1*(x)*x}this._fCallback(x,easedPercentage,steppingBackwards);if(stopRunning){clearInterval(this._timerId);this._timerId=0;this._callStopCallback();this.OnCompleted.fire(this);this._startCount=0}},_callStopCallback:function(){if(Is.Function(this._stopCallback)){this._stopCallback();this._stopCallback=null}},_setTimer:function(){if(this._timerId){clearInterval(this._timerId)}if(this._doRun){var animation=this;this._timerId=setInterval(function(){animation._fun()},1000/this.refreshRate())}},start:function(repeatCount,resumeData){this._doRun=true;if(Is.Number(repeatCount)){this._repeatCount=repeatCount}else{if(this._repeatCount<=0){this._repeatCount=-1}}if(Is.Specified(resumeData)){this._resumePosition=resumeData}if(this._resumePosition){this._startCount=(new Date().valueOf())-this._resumePosition;this._resumePosition=0}this._setTimer();this.OnStart.fire(this)},pause:function(){this._doRun=false;this._setTimer();this._resumePosition=this._position;return this._resumePosition},stop:function(callBack){this._position=0;this._resumePosition=0;this._stopCallback=callBack;if(this._timerId){this._doRun=false}else{this._callStopCallback()}}});var OnLoad=new V3.EventType("Document.OnLoad","",true);var OnLoaded=new V3.EventType("OnLoaded","",true);var OnEventError=new V3.EventType("OnEventError","eventName, err, paramArray",false,true);OnLoad.addEventHandler(function(){if(_debugMode){V3.enableDebugMode()}if(V3.debugMode){Log.Info("OnLoad invoked")}});var __debugModeEnabled=false;V3.enableDebugMode=function(silent){if(__debugModeEnabled){return}__debugModeEnabled=true;V3.debugMode=(silent?"silent":true)};var Color=function(){var r=arguments[0],g=arguments[1],b=arguments[2],a=arguments[3];if(arguments.length<=2){if(arguments[0] instanceof Color){r=arguments[0].R;g=arguments[0].G;b=arguments[0].B;a=arguments[0].A;if(arguments.length===2){a=arguments[1]}}else{if(Is.Number(arguments[0])){if(arguments[0]%1!==0){throw new Error("number must be a whole number")}var value=arguments[0];if(arguments.length===2){a=arguments[1]}r=(value&16711680)>>16;g=(value&65280)>>8;b=(value&255)}else{throw new Error("Invalid arguments")}}}if(r%1!==0){throw new Error("r must be a whole number")}if(g%1!==0){throw new Error("g must be a whole number")}if(b%1!==0){throw new Error("b must be a whole number")}this.R=r;this.G=g;this.B=b;if(Is.Number(a)){this.A=a}else{this.A=1}};V3.extend(Color.prototype,true,{R:0,G:0,B:0,A:0,blend:function(color,strength){if(Is.Number(color)){color=new V3.Color(color)}var r=Math.max(0,Math.min(255,Math.round((this.R*(1-strength))+(color.R*strength))));var g=Math.max(0,Math.min(255,Math.round((this.G*(1-strength))+(color.G*strength))));var b=Math.max(0,Math.min(255,Math.round((this.B*(1-strength))+(color.B*strength))));var a=Math.max(0,Math.min(1,Math.round((this.A*(1-strength))+(color.A*strength))));return new V3.Color(r,g,b,a)},grayscale:function(){var greyLevel=Math.round(this.R*0.3+this.G*0.59+this.B*0.11);return new V3.Color(greyLevel,greyLevel,greyLevel,this.A)},toString:function(hex){if(hex===true||(!Is.Specified(hex)&&this.A===1)){return"#"+this.R.toString(16).lpad("0",2)+this.G.toString(16).lpad("0",2)+this.B.toString(16).lpad("0",2)}else{if(hex===false||this.A===1){return"rgb("+this.R+","+this.G+","+this.B+")"}else{return"rgba("+this.R+","+this.G+","+this.B+","+this.A+")"}}},Set:function(obj){if(Is.Number(obj.R)){this.R=obj.R}if(Is.Number(obj.G)){this.G=obj.G}if(Is.Number(obj.B)){this.B=obj.B}if(Is.Number(obj.A)){this.A=obj.A}return this},setHSV:function(h,s,v,a){var rgb=V3.Color.Hsv2rgb(h,s,v);this.R=rgb.r;this.G=rgb.g;this.B=rgb.b;if(arguments.length===4){this.A=a}},getHSV:function(){var hsv=V3.Color.RgbToHsv(this.R,this.G,this.B);return{H:hsv.h,S:hsv.s,V:hsv.v,A:this.A}},offsetHue:function(degreeOffset){var hsv=this.getHSV();hsv.H=((hsv.H*360+degreeOffset)%360)/360;var ret=new V3.Color(0);ret.setHSV(hsv.H,hsv.S,hsv.V,hsv.A);return ret}});V3.extend(Color,{__class:true,parse:function(str){var m=/#?[0-9a-f]{3}||#?[0-9a-f]{6}/i.exec(str);if(m){if(str.startsWith("#")){str=str.substr(1)}var r,g,b;if(str.length==3){r=parseInt(str.substr(0,1),16);r=r+(r<<8);g=parseInt(str.substr(1,1),16);g=g+(g<<8);b=parseInt(str.substr(2,1),16);b=b+(b<<8)}else{r=parseInt(str.substr(0,2),16);g=parseInt(str.substr(2,2),16);b=parseInt(str.substr(4,2),16)}return new V3.Color(r,g,b)}var m=/rgba?\((\d+),(\d+),(\d+)(,\d+)?\)/i.exec(str);if(m){if(m.groups.length===3){return new V3.Color(m.groups[1],m.groups[2],m.groups[3])}else{return new V3.Color(m.groups[1],m.groups[2],m.groups[3],m.groups[4])}return}throw new Error("Unable to parse string '"+str+"' to colour")},Blend:function(firstHex,secondHex,decimalPercentage){var c1=V3.Color.parse(firstHex);var c2=V3.Color.parse(secondHex);return c1.blend(c2,decimalPercentage).toString(true)},RetrieveColors:function(stringWithColor){stringWithColor=stringWithColor.toLowerCase();var i=0;var ret=[];while(true){var i1=stringWithColor.indexOf("rgb",i);var i2=stringWithColor.indexOf("#",i);if(i1==-1){if(i2==-1){break}else{i=i2}}else{if(i2==-1){i=i1}else{i=Math.min(i1,i2)}}var val=null;var isHash=(i==i2);if(isHash){i++;val=stringWithColor.substr(i,6);if(isFinite(parseInt(val.substr(3,3),16))){i+=6}else{i+=3;val=val.substr(0,1)+val.substr(0,1)+val.substr(1,1)+val.substr(1,1)+val.substr(2,1)+val.substr(2,1)}}else{i+=3;var s=stringWithColor.indexOf("(",i);if(s!=-1){var e=stringWithColor.indexOf(")",s);if(e!=-1){i=e;s++;val=stringWithColor.substr(s,e-s);var split=val.split(",");if(split.length>=3){val=parseInt(split[0],10).toString(16).lpad("0",2)+parseInt(split[1],10).toString(16).lpad("0",2)+parseInt(split[2],10).toString(16).lpad("0",2)}}}}if(val!=null&&isFinite(parseInt(val,16))){ret.add(val)}}return ret},RetrieveColor:function(stringWithColor){var arr=V3.Color.RetrieveColors(stringWithColor);if(arr.length>0){return arr[0]}return null},Hsv2rgb:function(h,s,v){var var_r,var_g,var_b;if(s==0){return{r:Math.round(v*255),g:Math.round(v*255),b:Math.round(v*255)}}else{var var_h=h*6;if(var_h==6){var_h=0}var var_i=Math.floor(var_h);var var_1=v*(1-s);var var_2=v*(1-s*(var_h-var_i));var var_3=v*(1-s*(1-(var_h-var_i)));if(var_i==0){var_r=v;var_g=var_3;var_b=var_1}else{if(var_i==1){var_r=var_2;var_g=v;var_b=var_1}else{if(var_i==2){var_r=var_1;var_g=v;var_b=var_3}else{if(var_i==3){var_r=var_1;var_g=var_2;var_b=v}else{if(var_i==4){var_r=var_3;var_g=var_1;var_b=v}else{var_r=v;var_g=var_1;var_b=var_2}}}}}return{r:Math.round(var_r*255),g:Math.round(var_g*255),b:Math.round(var_b*255)}}},RgbToHsv:function(r,g,b){r=r/255;g=g/255;b=b/255;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,v=max;var d=max-min;s=(max==0)?0:d/max;if(max==min){h=0}else{switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h,s:s,v:v}},fromHSV:function(h,s,v,a){if(arguments.length===3){a=1}var rgb=V3.Color.Hsv2rgb(h,s,v);return new V3.Color(rgb.r,rgb.g,rgb.b,a)},getHueFromNumber:function(number,initialHue){if(arguments.length===1){initialHue=0}var hue=initialHue+(number*222.49223594996215);return Math.floor(hue%360)/360}});var Colors=(function(){return{Transparent:new Color(0,0),Black:new Color(0,1),Grey:new Color(8947848,1),White:new Color(16777215,1),Red:new Color(16711680,1),DarkRed:new Color(8912896,1),Green:new Color(65280,1),DarkGreen:new Color(34816,1),Blue:new Color(255,1),DarkBlue:new Color(136,1),Yellow:new Color(16776960,1),Orange:new Color(8947712,1),Cyan:new Color(65535,1),Teal:new Color(34952,1),Magenta:new Color(16711935,1),Purple:new Color(8913032,1)}})();var Cookies=V3.Class();Cookies.__defaultPath="/";Cookies.get=function(name){name=escape(name);var regex=new RegExp("(^| )"+RegExp.escape(name)+"(=(.*?))?(;|$)");var matches=regex.exec(document.cookie);if(matches==null){return null}return unescape(matches[3]||"")};Cookies.set=function(name,value,optionalExpiryDate,optionalPath){if(value===null){value=""}var expiry=((optionalExpiryDate instanceof Date)?optionalExpiryDate:new V3Date().addDays(365)).toUTCString();var path=(typeof optionalPath=="string")?path=optionalPath:path=Cookies.__defaultPath;document.cookie=escape(name)+"="+escape(value)+";expires="+expiry+";path="+escape(path)+";"};Cookies.contains=function(name){return Cookies.get(name)!=null};Cookies.remove=function(name,optionalPath){Cookies.set(name,"",new V3Date().addDays(-1),optionalPath)};Cookies.setGlobal=function(name,value,optionalExpiryDate){Cookies.set(name,value,optionalExpiryDate,"/")};Cookies.removeGlobal=function(name){Cookies.set(name,"",new V3Date().addDays(-1),"/")};V3.Collection=function Collection(owner,doAddAt,doRemoveAt,doClear){if(Is.Function(arguments[0])){doClear=arguments[2];doRemoveAt=arguments[1];doAddAt=arguments[0];owner=this}this.base();this._collection=[];if(doAddAt){if(!Is.Function(doAddAt)){throw new Error("doAddAt must be a function.")}this._doAddAt=doAddAt}if(doRemoveAt){if(!Is.Function(doRemoveAt)){throw new Error("doRemoveAt must be a function.")}this._doRemoveAt=doRemoveAt}if(doClear){if(!Is.Function(doClear)){throw new Error("doClear must be a function.")}this._doClear=doClear}this.owner=owner}.InheritsFrom(V3.Class,{OnChange:V3.EventPrototype("sender, e:{action:'add' or 'remove', item: newChild, index: 0}"),_collection:[],_doAddAt:function(item,index,base){base()},_doRemoveAt:function(item,index,base){base()},_doClear:function(base){base()},count:V3.PropertyPrototype(function(){return this._collection.length}),add:function(child,blockDuplicates){return this.addAt(this._collection.length,child,blockDuplicates)},addAt:function(index,child,blockDuplicates){if(!isFinite(index)){throw new Error("index number be a valid number.")}if(index<0||index>this._collection.length){throw new Error("index out of bounds")}if(blockDuplicates&&this._collection.contains(child)){return false}var me=this;var ret=this._doAddAt.call(this.owner,child,index,function(){me._collection.addAt(index,child);me.OnChange.fire(me,{action:"add",item:child,index:index})});return(ret!==false)},addRange:function(arr,blockDuplicates){if(arr instanceof Array){arr.forEach(function(item){this.add(item,blockDuplicates)},this)}else{if(Is.Arguments(arr)){for(var i=0;i<arr.length;i++){this.add(arr[i],blockDuplicates)}}else{throw new Error("'arr' needs to be of type Array, instead received typeof: "+(typeof arr)+".")}}return this},get:function(index){if(index<0||index>=this._collection.length){throw new Error("index out of bounds")}return this._collection[index]},remove:function(child){var index=this._collection.indexOf(child);if(index==-1){return false}else{return this.removeAt(index)}},removeAt:function(index){if(index<0||index>=this._collection.length){throw new Error("index out of bounds")}var me=this;var ret=this._doRemoveAt.call(this.owner,this._collection[index],index,function(){var item=me._collection[index];me._collection.removeAt(index);me.OnChange.fire(me,{action:"remove",item:item,index:index})});return(ret!==false)},forEach:function(thisArg,fCallback){var args=[this._collection].addRange(arguments);return V3.forEach.apply(this,args)},find:function(fCallback,thisArg){return this._collection.find(fCallback,thisArg)},exists:function(fCallback,thisArg){return this._collection.exists(fCallback,thisArg)},toArray:function(){return[].concat(this._collection)},indexOf:function(child){return this._collection.indexOf(child)},contains:function(child){return this.indexOf(child)!==-1},clear:function(){var me=this;if(me._collection.length==0){return}this._doClear.call(this.owner,function(inBulk){if(inBulk){me._collection.clear()}else{while(me._collection.length>0){me.removeAt(me._collection.length-1)}}})},insertBefore:function(child,existingChild){var index;if(Is.Specified(existingChild)){index=this.indexOf(existingChild);if(index===-1){throw new Error("existingChild does not currently exist in collection.")}}else{index=this._collection.length}this.addAt(index,child)},insertAfter:function(child,existingChild){var index;if(Is.Specified(existingChild)){index=this.indexOf(existingChild);if(index===-1){throw new Error("existingChild does not currently exist in collection.")}}else{index=this._collection.length-1}this.addAt(index+1,child)},toString:function(){return V3.Class.prototype.toString.call(this)+" (count="+this.count()+")"}});var DataTransfer=function DataTransfer(input){this.base();var e;if(Is.String(input)){e=document.getElementById(input)}else{e=input}if(this._instances[e.id]){return this._instances[e.id]}else{this._instances[e.id]=this}var d;if(e.value){d=JSON.parse(e.value)}else{d={}}this.data(d);this.DOMElement=e;OnSubmit.addEventHandler(this._OnSubmit.bind(this))}.InheritsFrom(V3.Class,{_instances:{},DOMElement:null,data:V3.PropertyPrototype(null),OnCommit:V3.EventPrototype("sender, e"),_OnSubmit:function(form,e){var d=this.data();var cancel=false;var args={data:d};this.OnCommit.fire(this,args);if(!cancel){if(args.data){this.DOMElement.value=JSON.stringify(args.data)}else{this.DOMElement.value=""}}}});var LocalStorage=(function(){var LocalStorageInstanceReference={};var directReadAndParse=function(key){var data=window.localStorage.getItem(key);if(!data){return null}try{return V3.parseJson(data)}catch(error){Log.Error("Failure to parse JSON, so removing it from the storage: "+data,"error",error);removeFromStorage(key);return null}};var directWrite=function(key,value){if(value===null){window.localStorage.removeItem(key)}else{window.localStorage.setItem(key,JSON.stringify(value))}};var removeFromStorage=function(key){window.localStorage.removeItem(key)};var updateLastModified=function(){directWrite("V3._LastModified",new Date())};var getLastModified=function(){return directReadAndParse("V3._LastModified")};var getCompositeKey=function(staticKey,dynamicKey,sessionKey){if(!staticKey){throw new Error("staticKey is missing")}if(!dynamicKey){throw new Error("dynamicKey is missing")}if(!sessionKey){return staticKey+"["+dynamicKey+"]"}else{return staticKey+"["+dynamicKey+":"+sessionKey+"]"}};var getStoreMetaKey=function(compositeKey){return"V3.Store."+compositeKey};var getItemDataKey=function(compositeKey,itemKey){return"V3.ItemData."+compositeKey+".["+itemKey+"]"};var getItemMetaKey=function(compositeKey,itemKey){return"V3.ItemMeta."+compositeKey+".["+itemKey+"]"};var isExpired=function(meta){if(meta.absoluteExpiration){if(meta.absoluteExpiration<=new Date()){return true}}if(meta.slidingExpiration){if(meta.lastModified.asV3Date().addSeconds(meta.slidingExpiration)<=new Date()){return true}}return false};var _lastModified=new Date();var _nextCull=new Date();var funSyncStorage=function(){var lastModified=getLastModified();if(lastModified&&_lastModified.valueOf()===lastModified+0&&_nextCull>new Date()){return}_lastModified=lastModified||_lastModified;_nextCull=new V3Date().addSeconds(10);for(var i=window.localStorage.length-1;i>=0;i--){var key=window.localStorage.key(i);if(!key||key.indexOf("V3.")!==0){continue}if(key.indexOf("V3.Store.")===0){var storeMeta=directReadAndParse(key);if(storeMeta&&isExpired(storeMeta)){Log.Warn("Data store expired, about to destroy: "+storeMeta.CompositeKey,"Keys",storeMeta.Keys);var instance=LocalStorageInstanceReference[storeMeta.CompositeKey];if(instance){instance._clearInternal(false)}else{LocalStorage._destory(storeMeta.CompositeKey)}}}else{if(key.indexOf("V3.ItemMeta.")===0){var itemMeta=directReadAndParse(key);if(itemMeta){var instance=LocalStorageInstanceReference[itemMeta.StoreCompositeKey];if(isExpired(itemMeta)){if(instance){instance._removeItemInternal(false,itemMeta.ItemKey)}else{removeFromStorage(key);updateLastModified()}}else{if(instance&&instance.enableCrossInstanceUpdates()){instance._notifyOfItem(itemMeta)}}}}}}for(var lsInstanceId in LocalStorageInstanceReference){var lsInstance=LocalStorageInstanceReference[lsInstanceId];if(lsInstance.enableCrossInstanceUpdates()){if(window.localStorage.getItem(lsInstance._storageKey)===null){if(lsInstance._existsInStorage){Log.Warn("Data store not in storage any more, about to destroy: "+lsInstance._compositeKey,"Keys",lsInstance._meta.Keys);lsInstance._clearInternal(false)}}else{for(var i=lsInstance._meta.Keys.length-1;i>=0;i--){var itemKey=lsInstance._meta.Keys[i];var key=getItemMetaKey(lsInstance._compositeKey,itemKey);if(window.localStorage.getItem(key)===null){lsInstance._removeItemInternal(false,itemKey)}}}}}};var startPollingTimer=function(){if(!startPollingTimer._timerId){funSyncStorage();startPollingTimer._timerId=setInterval(funSyncStorage,750)}};var LocalStorage=function LocalStorage(staticKey,key,sessionId,slidingExpiration,absoluteExpiration){this.base();if(!window.localStorage){Log.Warn("sessionStorage is not available, bookingProcessor cannot persist contents.");return}startPollingTimer();if(!slidingExpiration&&!absoluteExpiration){throw new Error("expiration must be supplied")}if(slidingExpiration instanceof TimeSpan){slidingExpiration=Math.floor(slidingExpiration.TotalMilliseconds/1000)}this._compositeKey=getCompositeKey(staticKey,key,sessionId);if(!LocalStorageInstanceReference[this._compositeKey]){LocalStorageInstanceReference[this._compositeKey]=this}else{return LocalStorageInstanceReference[this._compositeKey]}this._storageKey=getStoreMetaKey(this._compositeKey);this._meta=directReadAndParse(this._storageKey);if(this._meta){this.Keys.addRange(this._meta.Keys)}else{this._meta={lastModified:new Date(),CompositeKey:this._compositeKey,Keys:[]}}this._meta.slidingExpiration=slidingExpiration;this._meta.absoluteExpiration=absoluteExpiration;this._writeMeta();updateLastModified()}.InheritsFrom(V3.Class,{OnChange:V3.EventPrototype("sender, e"),_compositeKey:null,_storageKey:null,_meta:!window.vsDesignTime?null:{Keys:[],lastModified:new Date()},_itemLastModified:V3.Object(),_existsInStorage:false,Keys:V3.Object([]),_pollTimerId:null,enableCrossInstanceUpdates:V3.Property(true),_writeMeta:function(){directWrite(this._storageKey,this._meta);this._existsInStorage=true},_getStorageKeyForItemMeta:function(itemKey){return getItemMetaKey(this._compositeKey,itemKey)},_getStorageKeyForItemData:function(itemKey){return getItemDataKey(this._compositeKey,itemKey)},count:V3.Property(function get(){return this._meta.Keys.length}),clear:function(){this._clearInternal(true)},_clearInternal:function(isLocalTrigger){if(isLocalTrigger){this._meta.Keys.forEach(this.removeItem.bind(this))}else{this._meta.Keys.forEach(this._removeItemInternal.bind(this,false))}LocalStorage._destory(this._compositeKey);this._existsInStorage=false},getItem:function(itemKey){return directReadAndParse(this._getStorageKeyForItemData(itemKey))},setItem:function(itemKey,item,slidingExpiration,absoluteExpiration){if(itemKey===null||V3.Is.Undefined(itemKey)){throw new Error("itemKey must be specified")}if(V3.Is.Undefined(item)){throw new Error("item must be defined")}if(item===null){throw new Error("item cannot be null due to limitations of local storage")}if(slidingExpiration===0){slidingExpiration=null}this.Keys.add(itemKey,true);this._meta.Keys.add(itemKey,true);this._meta.lastModified=new Date();this._writeMeta();var itemMetaKey=this._getStorageKeyForItemMeta(itemKey);var itemMeta=directReadAndParse(itemMetaKey);if(!itemMeta){itemMeta={StoreCompositeKey:this._compositeKey,ItemKey:itemKey}}itemMeta.lastModified=new Date();if(!V3.Is.Undefined(slidingExpiration)){itemMeta.slidingExpiration=slidingExpiration}if(!V3.Is.Undefined(absoluteExpiration)){itemMeta.absoluteExpiration=absoluteExpiration}directWrite(itemMetaKey,itemMeta);directWrite(this._getStorageKeyForItemData(itemMeta.ItemKey),item);this._itemLastModified[itemKey]=itemMeta.lastModified;updateLastModified();this.OnChange.fire(this,{action:"set",itemKey:itemMeta.ItemKey,item:item,trigger:"local"})},removeItem:function(itemKey){this._meta.lastModified=new Date();this._removeItemInternal(true,itemKey);updateLastModified()},_removeItemInternal:function(isLocalTrigger,itemKey){removeFromStorage(this._getStorageKeyForItemData(itemKey));removeFromStorage(this._getStorageKeyForItemMeta(itemKey));delete this._itemLastModified[itemKey];this._meta.Keys.remove(itemKey);if(isLocalTrigger){this._meta.lastModified=new Date();this._writeMeta()}this.Keys.remove(itemKey);this.OnChange.fire(this,{action:"removed",itemKey:itemKey,trigger:isLocalTrigger?"local":"remote"})},_notifyOfItem:function(itemMeta){this._existsInStorage=true;var itemKey=itemMeta.ItemKey;if(!this._itemLastModified[itemKey]||this._itemLastModified[itemKey]<itemMeta.lastModified){this._itemLastModified[itemKey]=itemMeta.lastModified;this.Keys.add(itemMeta.ItemKey,true);this._meta.Keys.add(itemMeta.ItemKey,true);var item=directReadAndParse(this._getStorageKeyForItemData(itemMeta.ItemKey));this.OnChange.fire(this,{action:"set",itemKey:itemMeta.ItemKey,item:item,trigger:"remote"})}}});LocalStorage._destory=function(compositeKey){var meta=directReadAndParse(getStoreMetaKey(compositeKey));if(!meta){return}meta.Keys.forEach(function(itemKey){removeFromStorage(getItemDataKey(compositeKey,itemKey));removeFromStorage(getItemMetaKey(compositeKey,itemKey))});removeFromStorage(getStoreMetaKey(compositeKey));updateLastModified()};return LocalStorage})();var CultureInfo=function CultureInfo(config,prototype){this.base();this._currencyISOAbbreviation=config.CurrencyISOAbbreviation;this._twoLetterISOLanguageName=config.TwoLetterISOLanguageName;this._threeLetterISOLanguageName=config.ThreeLetterISOLanguageName;this._regionId=config.RegionId;this._niCurrency=new NumberFormatInfo(config.CurrencyFormatInfo,prototype?prototype._niCurrency:null);this._dateTimeFormat=new DateTimeFormatInfo(config.DateTimeFormat);this._niNumber=new NumberFormatInfo(config.NumberFormat);this._niPercent=new NumberFormatInfo(config.PercentFormat)}.InheritsFrom(V3.Class,{_niCurrency:null,_niNumber:null,_niPercent:null,twoLetterISOLanguageName:V3.Property(function get(){return this._twoLetterISOLanguageName}),threeLetterISOLanguageName:V3.Property(function get(){return this._threeLetterISOLanguageName}),currencyNumberFormat:V3.Property(function get(){return this._niCurrency}),numberNumberFormat:V3.Property(function get(){return this._niNumber}),percentNumberFormat:V3.Property(function get(){return this._niPercent}),currencyISOAbbreviation:V3.Property(function get(){return this._currencyISOAbbreviation}),dateTimeFormat:V3.Property(function get(){return this._dateTimeFormat}),regionId:V3.Property(function get(){return this._regionId}),name:V3.Property(function get(){return !this._regionId?this._twoLetterISOLanguageName:(this._twoLetterISOLanguageName+"-"+this._regionId)}),toString:function(){return this.name()},formatNumber:function(number,str){var letter=(typeof str==="string"&&str.substr(0,1).toUpperCase());var dd=str.length==1?null:parseInt(str.substr(1),10);var numFormatter;switch(letter){case"C":numFormatter=this.currencyNumberFormat();break;case"N":numFormatter=this.numberNumberFormat();break;case"P":numFormatter=this.percentNumberFormat();break;default:throw new Error("Not implemented or supported format string: "+str)}return numFormatter.formatNumber(number,dd)}});var _PositiveNumberPatterns=[function(c,v){return c+v},function(c,v){return v+c},function(c,v){return c+"\xA0"+v},function(c,v){return v+"\xA0"+c}];var _NegativeNumberPatterns=[function(c,v,n){return"("+c+v+")"},function(c,v,n){return n+c+v},function(c,v,n){return c+n+v},function(c,v,n){return c+v+n},function(c,v,n){return"("+v+c+")"},function(c,v,n){return n+v+c},function(c,v,n){return v+n+c},function(c,v,n){return v+c+n},function(c,v,n){return n+v+"\xA0"+c},function(c,v,n){return n+c+"\xA0"+v},function(c,v,n){return v+"\xA0"+c+n},function(c,v,n){return c+"\xA0"+v+n},function(c,v,n){return c+"\xA0"+n+v},function(c,v,n){return v+n+"\xA0"+c},function(c,v,n){return"("+c+"\xA0"+v+")"},function(c,v,n){return"("+v+"\xA0"+c+")"}];var RoundMidpointAwayFromZero=function(n,dd){var m=Math.pow(10,dd);var s=Math.sign(n);n=n*m*s;return Math.round(n)/m*s};var NumberFormatInfo=function NumberFormatInfo(config,prototype){this.base();var c=this._config={DecimalDigits:2,DecimalSeparator:".",GroupSeparator:",",GroupSizes:[3],PositivePattern:0,NegativePattern:1,Symbol:"$",NegativeSign:"-",Multiplier:1};if(prototype&&prototype._config){V3.extend(c,true,prototype._config)}V3.extend(c,true,config);if(!c.Multiplier){c.Multiplier=1}c.PositivePattern=Math.max(0,Math.min(c.PositivePattern||0,_PositiveNumberPatterns.length-1));c.NegativePattern=Math.max(0,Math.min(c.NegativePattern||0,_NegativeNumberPatterns.length-1));if(!c.GroupSizes||c.GroupSizes.length==0){c.GroupSizes=[0]}this._addSymbolPos=_PositiveNumberPatterns[this._config.PositivePattern];this._addSymbolNeg=_NegativeNumberPatterns[this._config.NegativePattern]}.InheritsFrom(V3.Class,{_config:{},_groupDigits:function(s){var groups=this._config.GroupSizes;var gi=0;var ret=[];for(var i=s.length;i>0;i-=size){var size=groups[gi++];if(gi>=groups.length){gi=groups.length-1}if(i-size<0){size=i}if(size>0){ret.add(s.substr(i-size,size))}else{ret.add(s.substr(0,i));break}}return ret.reverse().join(this._config.GroupSeparator)},decimalDigits:V3.Property(function get(){return this._config.DecimalDigits}),decimalSeparator:V3.Property(function get(){return this._config.DecimalSeparator}),groupSeparator:V3.Property(function get(){return this._config.GroupSeparator}),groupSizes:V3.Property(function get(){return[].addRange(this._config.GroupSizes)}),positivePattern:V3.Property(function get(){return this._config.PositivePattern}),negativePattern:V3.Property(function get(){return this._config.NegativePattern}),symbol:V3.Property(function get(){return this._config.Symbol}),negativeSign:V3.Property(function get(){return this._config.NegativeSign}),setPatternsToIncludeSpaces:function(){var mapPositive=[2,3,2,3];var mapNegative=[14,9,12,11,15,8,13,10,8,9,10,11,12,13,14,15];this._config.PositivePattern=mapPositive[this._config.PositivePattern];this._config.NegativePattern=mapNegative[this._config.NegativePattern];this._addSymbolPos=_PositiveNumberPatterns[this._config.PositivePattern];this._addSymbolNeg=_NegativeNumberPatterns[this._config.NegativePattern]},formatNumber:function(n,dd){if(typeof n!=="number"){throw new Error("Invalid value: "+n)}if(isNaN(n)){return"NaN"}var strSymbol=(this._config.Symbol===null)?"":this._config.Symbol;dd=(dd!==null&&isFinite(dd))?dd:this._config.DecimalDigits;n=RoundMidpointAwayFromZero(n,dd);n=n*this._config.Multiplier;var strs=Math.abs(n).toFixed(dd).split(".");var strNum=this._groupDigits(strs[0]);if(dd>0){strNum=strNum+this._config.DecimalSeparator+strs[1]}return(n<0?this._addSymbolNeg:this._addSymbolPos)(strSymbol,strNum,this._config.NegativeSign)}});var DateTimeFormatInfo=function DateTimeFormatInfo(config){this.base();this._config=config}.InheritsFrom(V3.Class,{dayNames:V3.Property(function get(){return this._config.DayNames}),monthNames:V3.Property(function get(){return this._config.MonthNames}),abbreviatedDayNames:V3.Property(function get(){return this._config.AbbreviatedDayNames}),abbreviatedMonthNames:V3.Property(function get(){return this._config.AbbreviatedMonthNames}),shortestDayNames:V3.Property(function get(){return this._config.ShortestDayNames}),amDesignator:V3.Property(function get(){return this._config.AMDesignator}),pmDesignator:V3.Property(function get(){return this._config.PMDesignator}),longDatePattern:V3.Property(function get(){return this._config.LongDatePattern}),shortDatePattern:V3.Property(function get(){return this._config.ShortDatePattern}),longTimePattern:V3.Property(function get(){return this._config.LongTimePattern}),shortTimePattern:V3.Property(function get(){return this._config.ShortTimePattern}),yearMonthPattern:V3.Property(function get(){return this._config.YearMonthPattern}),monthDayPattern:V3.Property(function get(){return this._config.MonthDayPattern}),fullDateTimePattern:V3.Property(function get(){return this._config.FullDateTimePattern}),firstDayOfWeek:V3.Property(function get(){return this._config.FirstDayOfWeek})});CultureInfo.invariantCulture=new V3.Property(null,function get(){return new CultureInfo({RegionId:null,CurrencyISOAbbreviation:"",TwoLetterISOLanguageName:"iv",ThreeLetterISOLanguageName:"ivl",CurrencyFormatInfo:{DecimalDigits:2,DecimalSeparator:".",GroupSeparator:",",GroupSizes:[3],NegativePattern:0,PositivePattern:0,Symbol:"¤",NegativeSign:"-"},DateTimeFormat:{DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ShortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],AMDesignator:"AM",PMDesignator:"PM",LongDatePattern:"dddd, dd MMMM yyyy",ShortDatePattern:"MM/dd/yyyy",LongTimePattern:"HH:mm:ss",ShortTimePattern:"HH:mm",YearMonthPattern:"yyyy MMMM",MonthDayPattern:"MMMM dd",FullDateTimePattern:"dddd, dd MMMM yyyy HH:mm:ss"}})});CultureInfo.currentCulture=new V3.Property(null,CultureInfo.invariantCulture(),function setter(value,currentValue,ref){if(value===null){throw new Error("value cannot be nul")}});CultureInfo.currentUICulture=new V3.Property(null,CultureInfo.invariantCulture(),function setter(value,currentValue,ref){if(value===null){throw new Error("value cannot be nul")}});(function(){var orig=Number.prototype.toStringFormat;Number.prototype.toStringFormat=function(str,formatProvider){var letter=(typeof str==="string"&&str.substr(0,1).toUpperCase());if(letter==="C"||letter==="N"||letter==="P"){return(formatProvider||CultureInfo.currentCulture()).formatNumber(this.valueOf(),str)}else{return orig.apply(this,[].addRange(arguments))}};Number.prototype.toStringUI=function(str){return V3.CultureInfo.currentUICulture().formatNumber(this.valueOf(),str||"N")};Date.prototype.toStringUI=function(str,formatProvider){if(arguments.length==1){formatProvider=V3.CultureInfo.currentUICulture()}return Date.prototype.toStringFormat.call(this,str,formatProvider)}})();V3.Constants={EMPTY_FUNCTION:EMPTY_FUNCTION};V3.Color=Color;V3.Colors=Colors;V3.Cookies=Cookies;V3.LocalStorage=LocalStorage;V3.TimeSpan=TimeSpan;V3.CultureInfo=CultureInfo;V3.NumberFormatInfo=NumberFormatInfo;V3.DateTimeFormatInfo=DateTimeFormatInfo;V3.Utils.DataTransfer=DataTransfer;V3.Utils.StopWatch=StopWatch;V3.Utils.Animation=Animation;V3.Utils.OnLoad=OnLoad;V3.Utils.OnLoaded=OnLoaded;V3.Utils.OnEventError=OnEventError;var fInitScroll=function(){var lx=null,ly=null;V3.AddEventHandler(window,"scroll",function(event){var x=window.pageXOffset;var y=window.pageYOffset;if(lx!=x||ly!=y){lx=x;ly=y;V3.Utils.OnScroll.fire({event:event,x:x,y:y})}})};V3.Utils._CheckResize=EMPTY_FUNCTION;var fInitResizeTimer=function(){var debug=V3.debuggingEnabledFor("resize");var lw=-1,lh=-1;var lastUpdate=null;var fCheckResize=function(event){var w=document.body.scrollWidth,h=document.body.scrollHeight;if(lw!=w||lh!=h){lastUpdate=(new Date()).valueOf();if(debug){V3.Log.Info("Resized: "+w+"\t"+h+"\t")}lw=w;lh=h;V3.Utils.OnResize.fire({event:event||window.event,width:w,height:h,x:window.pageXOffset,y:window.pageYOffset});return true}};V3.AddEventHandler(window,"resize",function(event){fCheckResize(event);V3.Utils._CheckResize()});var tmrUpdate=null;V3.Utils._CheckResize=function(){lastUpdate=(new Date()).valueOf();if(!tmrUpdate){if(debug){V3.Log.Info("Starting resize timer")}if(debug){V3.Log.Info("ChckRsz: "+document.body.scrollWidth+"\t"+document.body.scrollHeight)}tmrUpdate=setInterval(function(){if(((new Date()).valueOf()-lastUpdate)>750){if(debug){V3.Log.Info("Cancelling resize timer")}clearInterval(tmrUpdate);tmrUpdate=null}fCheckResize(null)},1000/25)}}};V3.Utils.PageIsLoaded=false;var OnSubmit=new V3.EventType("OnSubmit","form, args");var OnScroll=new V3.EventType("OnScroll","e",{log:false,lazyLoadCallback:fInitScroll});var OnResize=new V3.EventType("OnResize","e",{log:false,lazyLoadCallback:fInitResizeTimer});var OnUnload=new V3.EventType("Document.OnUnload","",true);var W3cEventHandler=function(funCallback){return function(e){var event=e||window.event||{};if(window.vsDesignTime){event=window.event}if(!event.stopPropagation){event.stopPropagation=function(){event.cancelBubble=true}}if(!event.target){event.target=event.srcElement}if(!event.preventDefault){event.preventDefault=function(){event.returnValue=false}}if(!event.currentTarget){event.currentTarget=this}var ret=funCallback.call(this,event,this);if(ret===false||event.returnValue===false){if(event.preventDefault){event.preventDefault()}event.returnValue=false;return false}else{return true}}};var AddEventHandler=(function(){var counter=0;return function(domObj,eventName,fEventHandler){var prepend=false;if(arguments.length===4){prepend=arguments[2];fEventHandler=arguments[3]}fEventHandler=W3cEventHandler(fEventHandler);function append(eventName){var existing=domObj["on"+eventName];var fAttach;if(typeof existing!=="function"){fAttach=fEventHandler}else{existing=domObj["v3_on"+eventName]||existing;if(prepend){fAttach=function(event){var retVal=true;if(fEventHandler.apply(this,arguments)===false){retVal=false}if(existing.apply(this,arguments)===false){retVal=false}return retVal}}else{fAttach=function(event){var retVal=true;if(existing.apply(this,arguments)===false){retVal=false}if(fEventHandler.apply(this,arguments)===false){retVal=false}return retVal}}}if(domObj===window||typeof domObj.id==="undefined"){domObj["on"+eventName]=fAttach.bind(domObj)}else{if(!domObj.id){domObj.id="v3_autogenerated_id_"+(counter++)}var jsSafeId=domObj.id.replace("'","\\'");domObj["v3_on"+eventName]=fAttach;domObj["on"+eventName]=new Function("return (this && this.id === '"+jsSafeId+"' ? this : document.getElementById('"+jsSafeId+"')).v3_on"+eventName+".apply(this, arguments);")}}if(Is.Array(eventName)){V3.forEach(eventName,this,append)}else{append(eventName)}}})();(function(){var regexCache={};var getDomElement=function(element){if(!Is.Specified(element)){throw new Error("element must be specified")}if(Is.String(element)){element=document.getElementById(element);if(!element){throw new Error("element with id '"+element+"' not found.")}}if(!Is.DomElement(element)){throw new Error("element not supported")}return element};V3.addCssClass=function(element,className){if(element&&element.V3Ctrl&&element.V3Ctrl.cssClassAdd){element.V3Ctrl.cssClassAdd(className)}else{if(element&&element.classList&&className&&Is.String(className)){var r=false;className.split(" ").forEach(function(className){if(!element.classList.contains(className)){element.classList.add(className);r=true}});return r}else{element=getDomElement(element);if(!Is.String(className)){throw new Error("classname must be a string")}var cn=element.getAttribute("class");var regex=regexCache[className];if(!regex){regex=regexCache[className]=new RegExp("(^|\\s+)"+className+"(\\s+|$)")}if(!regex.test(cn)){element.setAttribute("class",(cn+" "+className).replace(/^\s+|\s+$/gm,""));return true}return false}}};V3.remCssClass=function(element,className){if(element&&element.V3Ctrl&&element.V3Ctrl.cssClassRem){element.V3Ctrl.cssClassRem(className)}else{if(element&&element.classList&&className&&Is.String(className)){var r=false;className.split(" ").forEach(function(className){if(element.classList.contains(className)){element.classList.remove(className);r=true}});return r}else{element=getDomElement(element);if(!Is.String(className)){throw new Error("classname must be a string")}var cn=element.getAttribute("class");if(cn==className){element.removeAttribute("class","");return true}else{var regex=regexCache[className];if(!regex){regex=regexCache[className]=new RegExp("(^|\\s+)"+className+"(\\s+|$)")}if(regex.test(cn)){element.setAttribute("class",cn.replace(regex," "));return true}}return false}}};V3.switchCssClass=function(element,className1,className2,useOne){element=getDomElement(element);if(useOne){V3.remCssClass(element,className2);return V3.addCssClass(element,className1)}else{V3.remCssClass(element,className1);return V3.addCssClass(element,className2)}};V3.toggleCssClass=function(element,initialClass,toggledClass){if(element instanceof Array){for(var i=0;i<element.length;i++){V3.toggleCssClass(element[i],initialClass,toggledClass)}return}element=getDomElement(element);if((element.className||"").indexOf(initialClass)==-1){V3.remCssClass(element,toggledClass);V3.addCssClass(element,initialClass)}else{V3.remCssClass(element,initialClass);V3.addCssClass(element,toggledClass)}}})();window.UserAgentsEnum=V3.Enum({Unknown:"Unknown",iPad:"iPad",IE7:"IE7",IE:"Internet Explorer"});var parseQueryString=function(url){var r=V3.Class();r.Keys=[];r.Values={};r.get=function(key,defaultValue){var v=this.Values[key];if(typeof defaultValue==="undefined"){defaultValue=null}if(typeof v==="undefined"){v=defaultValue}return v};var m,k,v,regex=/[\?&](.*?)=([^&#]*)/gi,t="?";while((m=regex.exec(url))!=null){if(t.length>1){t=t+"&"}k=m[1];v=decodeURIComponent(m[2]);r.Keys.push(k);r.Values[k]=v;t=t+k+"="+v;if(typeof r[k]==="undefined"){r[k]=v;if(typeof r[k.toLowerCase()]==="undefined"){r[k.toLowerCase()]=v}}}r.toString=function(){return t};return r};var QueryString=parseQueryString(window.location.href);var UserAgent=UserAgentsEnum.Unknown;if(QueryString.ipad=="true"||navigator.userAgent.match(/iPad/)){UserAgent=UserAgentsEnum.iPad}else{if(QueryString.ie7=="true"||navigator.userAgent.match(/MSIE 7\./)){UserAgent=UserAgentsEnum.IE7}else{if(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0){UserAgent=UserAgentsEnum.IE}}}V3.W3cEventHandler=W3cEventHandler;V3.AddEventHandler=AddEventHandler;V3.Utils.UserAgent=UserAgent;V3.Utils.parseQueryString=parseQueryString;V3.Utils.QueryString=QueryString;V3.Utils.OnSubmit=OnSubmit;V3.Utils.OnScroll=OnScroll;V3.Utils.OnResize=OnResize;V3.Utils.OnUnload=OnUnload;V3.Utils.OnLoad.addEventHandler(function(){V3.AddEventHandler(window,"unload",V3.Utils.OnUnload.fire.bind(V3.Utils.OnUnload));V3.addCssClass(document.documentElement,"v3_useragent_"+UserAgent.toString());var aspNetPostbackManager=null;if(window.Sys&&window.Sys.WebForms&&window.Sys.WebForms.PageRequestManager&&window.Sys.WebForms.PageRequestManager.getInstance()){aspNetPostbackManager=window.Sys.WebForms.PageRequestManager.getInstance()}for(var i=0;i<document.forms.length;i++){(function(){var form=document.forms[i];var cb=function(event){var args={Index:i,Event:event,CancelSubmit:false};OnSubmit.fire(form,args);return !args.CancelSubmit};if(!aspNetPostbackManager||aspNetPostbackManager._form!==form){V3.AddEventHandler(form,"submit",cb)}else{if(!aspNetPostbackManager._onSubmitStatements){V3.Log.Error("asp.net PageRequestManager doesn't have a private variable called '_onSubmitStatements' which is needed in order to fire the onsubmit event prior to the manager collecting all the form data for submission","aspNetPostbackManager",aspNetPostbackManager)}else{aspNetPostbackManager._onSubmitStatements.add(function(){return !!cb(window.event)})}if(form.onsubmit===null&&(!Is.Specified(aspNetPostbackManager._onsubmit)||Is.Function(aspNetPostbackManager._onsubmit))){form.onsubmit=aspNetPostbackManager._onsubmit;V3.AddEventHandler(form,"submit",true,cb);aspNetPostbackManager._onsubmit=form.onsubmit;form.onsubmit=null}}})()}});(function(){var fReady=function(){V3.Utils.OnLoad.fire();setTimeout(function(){V3.Utils.PageIsLoaded=true;V3.Utils.OnLoaded.fire()},50)};if(document.body&&(!document.readyState||document.readyState!=="loading")){if(V3.debugMode){Log.Info("Firing OnLoad by internal detection")}fReady()}else{V3.AddEventHandler(window,"load",fReady);V3.AddEventHandler(document,"DOMContentLoaded",fReady)}})();V3.debuggingEnabledFor=function(code){return !!V3.debugMode};if(V3.debugMode||(V3.Utils.QueryString.get("db_mod","")||"false").toLowerCase()!=="false"){var knownDebugCodes={};var enabledDebugCodes=V3.Utils.QueryString.get("db_mod","").toLowerCase().split(",");var debugAll=enabledDebugCodes[0]=="all";V3.getDebuggingCodes=function(){return knownDebugCodes};V3.registerDebugCode=function(code,description,declaredIn){code=code.toLowerCase();var r=knownDebugCodes[code];if(!r){r=knownDebugCodes[code]={}}if(description&&!r.Description){r.Description=description}if(!r.DeclaredIn){r.DeclaredIn=declaredIn||""}else{if(declaredIn&&!r.DeclaredIn.contains(declaredIn)){r.DeclaredIn=r.DeclaredIn+","+declaredIn}}};V3.debuggingEnabledFor=function(code1,code2){if(arguments.length==0){return(debugAll||!!V3.debugMode)}var ret=debugAll;for(var i=0;i<arguments.length;i++){var code=arguments[i].toLowerCase();V3.registerDebugCode(code,null,(V3._currentlyLoadingModule||{}).CallbackName);if(enabledDebugCodes.contains(code)){ret=true}}return ret};V3.registerDebugCode("all","Enables all modules for debugging");_debugMode=V3.debuggingEnabledFor("base");V3.registerDebugCode("nc","No-console, hides the console");var silentDebug=V3.debuggingEnabledFor("silent");var noConsole=V3.debuggingEnabledFor("nc");if(!noConsole){OnLoad.addEventHandler(function(){if(V3.Utils.Console){Log.Debug("About to enable the in-page console, all future debug will be outputted there.  Only Info, Warning and Errors will be presented here now.");V3.Utils.Console.EnableConsole()}})}V3.enableDebugMode(silentDebug)}V3.EventType.setDefaultLoggingStatus(_debugMode)});V3.Cookies.__defaultPath='/v4';
V3.CultureInfo.currentCulture(new V3.CultureInfo({CurrencyISOAbbreviation:"GBP",TwoLetterISOLanguageName:"en",ThreeLetterISOLanguageName:"eng",RegionId:"GB",DateTimeFormat:{AMDesignator:"AM",PMDesignator:"PM",DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],ShortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],LongDatePattern:"dddd, d MMMM yyyy",ShortDatePattern:"d/MM/yyyy",LongTimePattern:"h:mm:ss tt",ShortTimePattern:"h:mm tt",YearMonthPattern:"MMMM yyyy",MonthDayPattern:"d MMMM",FullDateTimePattern:"dddd, d MMMM yyyy h:mm:ss tt",FirstDayOfWeek:1},CurrencyFormatInfo:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:"£",NegativeSign:"-",Multiplier:1},PercentFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:5,PositivePattern:1,DecimalSeparator:".",GroupSeparator:",",Symbol:"%",NegativeSign:"-",Multiplier:100},NumberFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:null,NegativeSign:"-",Multiplier:1}}));
V3.CultureInfo.currentUICulture(new V3.CultureInfo({CurrencyISOAbbreviation:"GBP",TwoLetterISOLanguageName:"en",ThreeLetterISOLanguageName:"eng",RegionId:"GB",DateTimeFormat:{AMDesignator:"AM",PMDesignator:"PM",DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],ShortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],LongDatePattern:"dd MMMM yyyy",ShortDatePattern:"dd/MM/yyyy",LongTimePattern:"HH:mm:ss",ShortTimePattern:"HH:mm",YearMonthPattern:"MMMM yyyy",MonthDayPattern:"d MMMM",FullDateTimePattern:"dd MMMM yyyy HH:mm:ss",FirstDayOfWeek:1},CurrencyFormatInfo:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:"£",NegativeSign:"-",Multiplier:1},PercentFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:5,PositivePattern:1,DecimalSeparator:".",GroupSeparator:",",Symbol:"%",NegativeSign:"-",Multiplier:100},NumberFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:null,NegativeSign:"-",Multiplier:1}}));
 })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
"use strict";V3.RegisterFile("V3.UI",1,["V3.Utils"],function(r){r.Namespace("UI");var R=r.Is;var V=false;if(r.debugMode){V=r.Utils.QueryString.get("db_mod","").toLowerCase().split(",").exists(function(e){return e=="ui"||e=="all"});r.Log.Info("V3.UI in debug mode: "+V+". (db_mod=ui)");if(V){r.Log.Warn("V3.UI is in debug mode, this will log many UI events which can significantly slow down the page.")}}r.EventType.setDefaultLoggingStatus(V);var c=function(){if(!r.UI._Body){r.UI._Body=document.createElement("div");r.UI._Body.className="V3";document.body.appendChild(r.UI._Body)}return r.UI._Body};var H=function(W,Z){var Y=W.DOMElement||W;var X=Z.DOMElement||Z;while(X=X.parentNode){if(X===Y){return true}}return false};var h=new r.EventType("OnDOMFocusChanged","e:{oldFocus:DOMElement, newFocus:DOMElement}",false,true);r.Utils.OnLoad.addEventHandler(function(){r.addCssClass(document.body,"loading");r.Utils.OnLoaded.addEventHandler(function(){r.remCssClass(document.body,"loading")});var X=function(ac){var ad=ac.DOMElement||ac;var ab=[];ab.hasV3Controls=false;ab.hasUnfocusEvent=false;while(ad.parentNode){ab.add(ad);if(ad.V3Ctrl){ab.hasV3Controls=true;if(ad.V3Ctrl.OnUnfocus){ab.hasUnfocusEvent=true}}ad=ad.parentNode}ab.isInDom=(ad===document);return ab};var aa=document.body;var e=null;var Y=null;var Z=(function(ae){if(ae.target!==aa){var ad=aa;var ac=ae.target;aa=ae.target;var ab=X(ad);if(!ab.isInDom){ad=Y.find(function(af){return R.InDOM(af)});if(!ad&&R.InDOM(e)){ad=e}if(ad){ab=X(ad)}else{r.Log.Error("The old focused element is no longer in the DOM and no common parent could be found!!")}}h.fire({oldFocus:ad,newFocus:ac});Y=X(ac);e=ab.find(function(af){return Y.contains(af)});if(Y.hasV3Controls){if(ac&&ac.V3Ctrl&&ac.V3Ctrl.OnFocus){ac.V3Ctrl.OnFocus.fire(ac.V3Ctrl,{oldFocus:(ad.V3Ctrl||ad)})}r.forEach(Y,function(af){if(af===e){return false}if(af.V3Ctrl&&af.V3Ctrl.OnFocusContainer){af.V3Ctrl.OnFocusContainer.fire(af.V3Ctrl,{oldFocus:(ad.V3Ctrl||ad),newFocus:(ac.V3Ctrl||ac)})}})}if(ad&&ab.hasV3Controls){if(ad.V3Ctrl&&ad.V3Ctrl.OnUnfocus){ad.V3Ctrl.OnUnfocus.fire(ad.V3Ctrl,{newFocus:ac.V3Ctrl||ac,isWithinContainer:function(){return H(ad,ac)}})}r.forEach(ab,function(af){if(af===e){return false}if(af.V3Ctrl&&af.V3Ctrl.OnUnfocusContainer){af.V3Ctrl.OnUnfocusContainer.fire(af.V3Ctrl,{newFocus:ac.V3Ctrl||ac})}})}}});function W(ac,ab){if(ac){var ad=false;if(ab){r.addCssClass(ac,"focused")}else{r.remCssClass(ac,"focused")}if(ac.v3FocusableParent){ad=true}var ae=ac;while(ae.parentNode){if(ab){r.addCssClass(ae,"child-focused")}else{r.remCssClass(ae,"child-focused")}if(ab&&!ad&&ae.v3FocusableParent){ad=true;r.addCssClass(ae,"focused")}else{r.remCssClass(ae,"focused")}ae=ae.parentNode}}}if(!document.addEventListener){r.Log.Warn("Document doesn't contain document.addEventListener(), so flagging of focuses and unfocsed elements will not work.")}else{document.body.addEventListener("focus",function(ab){Z(ab);W(ab.target,true)},true);document.body.addEventListener("blur",function(ab){W(ab.target,false)},true);document.body.tabIndex=-1}});r.UI.Sticky=function(){throw new Error("Not supported")}.InheritsFrom(r.Class);r.Utils.OnLoaded.addEventHandler(function(){var X=[];var W=function(ab){var Z=document.getElementsByClassName("sticky");X.clear();for(var ac=0;ac<Z.length;ac++){var ad=Z[ac];var ah=parseInt(ad.getAttribute("data-x"),10);var af=parseInt(ad.getAttribute("data-y"),10);var aa,Y;if(!isFinite(ah)||!isFinite(af)){var ag=r.remCssClass(ad,"stick");var ae=ad.getBoundingClientRect();if(ae&&ae.left){aa=ae.left+window.pageXOffset}else{aa=ad.offsetLeft}if(ae&&ae.top){Y=ae.top+window.pageYOffset}else{Y=ad.offsetTop}if(ag){r.addCssClass(ad,"stick")}}if(isFinite(ah)){aa=ah}if(isFinite(af)){Y=af}X.add({DOMElement:ad,x:aa,y:Y,flagged:false})}if(ab){e(ab)}};var e=function(Y){X.forEach(function(Z){if(Y.y>Z.y){if(!Z.flagged){r.addCssClass(Z.DOMElement,"stick");Z.flagged=true}}else{if(Z.flagged){r.remCssClass(Z.DOMElement,"stick");Z.flagged=false}}})};W(null);r.Utils.OnResize.addEventHandler(W);r.Utils.OnScroll.addEventHandler(e)});var I=r.Class();r.extend(I,{selectElementsWithId:function(e,Z,W,Y){if(!R.DomElement(e)){throw new Error("container must be a DOM element!")}var X={};I._selectElementsWithId(e,X,Z,W,Y);return X},_selectElementsWithId:function(e,X,aa,W,Z){for(var Y=0;Y<e.childNodes.length;Y++){var ab=e.childNodes[Y];if(!ab.id||ab.id==""){if(ab.childNodes.length){I._selectElementsWithId(ab,X,aa,W,Z)}}else{if(aa){if(!X[ab.id]){if(Z){X[ab.id]=d.wrap(ab)||ab}else{X[ab.id]=ab}}if(R.Number(W)){I._selectElementsWithId(ab,X,true,W-1,Z)}else{I._selectElementsWithId(ab,X,true,W,Z)}}else{if(Z){throw new Error("wrapDomElements cannot be true if flattenHierarchy is set to false.")}var ac={};if(R.Number(W)){I._selectElementsWithId(ab,ac,false,W-1)}else{I._selectElementsWithId(ab,ac,false,W)}ac.DOMElement=ab;X[ab.id]=ac}}}},isTouchScreen:function(){return("ontouchstart" in document.documentElement)},getScrollPosition:function(){return{x:window.scrollX||window.pageXOffset||0,y:window.scrollY||window.pageYOffset||0}},scrollTo:function(){if(arguments.length==0){return}var X=I.getScrollPosition();var ab,W;if(arguments.length>1&&(R.Boolean(arguments[arguments.length-1])||R.PlainObject(arguments[arguments.length-1]))){if(R.Boolean(arguments[arguments.length-1])){W={OnlyIfHidden:arguments[arguments.length-1],Padding:{X:0,Y:0}}}else{W=arguments[arguments.length-1];if(R.Number(W.Padding)){W.Padding={X:W.Padding,Y:W.Padding}}else{if(!W.Padding){W.Padding={X:0,Y:0}}}}delete arguments[arguments.length-1];arguments.length=arguments.length-1}else{W={OnlyIfHidden:false}}if(R.Number(arguments[0])){ab={};if(arguments.length==1){ab.y=arguments[0];ab.x=X.x}else{ab.y=arguments[0];ab.x=arguments[1]}ab.width=window.innerWidth/2;ab.height=window.innerHeight/2}else{if(R.WebControl(arguments[0])){arguments[0]=arguments[0].DOMElement}if(R.DomElement(arguments[0])){var Y=arguments[0].getClientRects();ab={x:Y[0].left+X.x,y:Y[0].top+X.y,width:Y[0].width,height:Y[0].height}}else{if(R.PlainObject(arguments[0])&&R.Number(arguments[0].x)&&R.Number(arguments[0].y)){ab={x:arguments[0].x,y:arguments[0].y,width:arguments[0].width||0,height:arguments[0].height||0}}else{throw new Error("Invalid arguments")}}}if(W.OnlyIfHidden){var e=function(){var ac=0;if(W.Padding&&W.Padding.X){var ac=W.Padding.X;if(ac<=0.5){ac=(window.innerWidth-ab.width)*ac}}return ac};var aa=function(){var ac=0;if(W.Padding&&W.Padding.Y){var ac=W.Padding.Y;if(ac<=0.5){ac=(window.innerHeight-ab.height)*ac}}return ac};if(X.x<=ab.x&&(ab.x+ab.width)<=(X.x+window.innerWidth)){ab.x=X.x}else{var Z=e();if(ab.width+Z<window.innerWidth){if(X.x<=ab.x){ab.x=ab.x+ab.width+Z-window.innerWidth}else{ab.x-=Z}}}if(X.y<=ab.y&&(ab.y+ab.height)<=(X.y+window.innerHeight)){ab.y=X.y}else{var Z=aa();if(ab.height+Z<window.innerHeight){if(X.y<=ab.y){ab.y=ab.y+ab.height+Z-window.innerHeight}else{ab.y-=Z}}}}window.scrollTo(ab.x,ab.y)},encodeHTML:function(W){var Y=I.__encodeHTML;if(!Y){Y=I.__encodeHTML={d:document.createElement("div"),t:document.createTextNode("")};Y.d.appendChild(Y.t)}Y.t.data=W;var X=Y.d.innerHTML;Y.t.data="";return X}});r.Utils.OnLoad.addEventHandler(function F(){if(I.isTouchScreen()){r.addCssClass(window.document.documentElement,"touch")}else{r.addCssClass(window.document.documentElement,"no-touch")}});var j=function j(e,W){this.base(this._addAt,this._removeAt,this._clear);this._owner=e;if(R.Specified(W)&&!R.Function(W)){throw new Error("typeFilter must be a class constructor function.")}this._typeFilter=W}.InheritsFrom(r.Collection,{_modifyDom:true,_onAdd:function(e){},_onRemove:function(e){},_onClear:function(){return false},_updateDOM:function(X,e){if(this._modifyDom&&this._owner&&this._owner.DOMElement&&X.DOMElement){if(e==this.count()){(this._owner.DOMContainer||this._owner.DOMElement).appendChild(X.DOMElement)}else{var W=this.get(e);if(W){W=W.DOMElement||W}(this._owner.DOMContainer||this._owner.DOMElement).insertBefore(X.DOMElement,W)}r.Utils._CheckResize()}},_addAt:function(Z,W,Y){if(!R.Control(Z)){throw new Error("child must inherit from V3.UI.Control")}if(this._typeFilter&&!(Z instanceof this._typeFilter)){throw new Error("child must be of type "+this._typeFilter.GetFunctionName())}if(Z.Parent===this._owner){var e=this.indexOf(Z);if(e==W||(W==this._collection.length&&e==this._collection.length-1)){throw new Error("child already in collection at that index.")}else{if(e>=0){this._updateDOM(Z,W);this._collection.removeAt(e);this._collection.addAt(W,Z);return}}}if(this._onAdd&&this._onAdd(Z)===false){return false}this._updateDOM(Z,W);if(Z.Parent){Z.Parent.Controls.remove(Z)}Y();if(Z.Parent!==this._owner){var X=Z.Parent;Z.Parent=this._owner;Z.OnParentChange.fire(Z.Parent,X)}Z._fireOnVisibleChangeIfNeeded();return true},_removeAt:function(X,e,Y){if(e<0||e>this._collection.length){throw new Error("index out of bounds")}var Z=this._collection[e];if(this._onRemove&&this._onRemove(Z,e)===false){return false}Y();if(Z.Parent!==null){var W=Z.Parent;Z.Parent=null;Z.OnParentChange.fire(Z.Parent,W)}if(this._modifyDom&&this._owner&&this._owner.DOMElement&&Z.DOMElement&&this._owner.DOMElement==Z.DOMElement.parentNode){(this._owner.DOMContainer||this._owner.DOMElement).removeChild(Z.DOMElement)}Z._fireOnVisibleChangeIfNeeded();return true},_clear:function(e){e(this._onClear())}});var G=function G(e){this.base();if(!(e instanceof x)){throw new Error("owner must be an instance of V3.UI.WebControl")}this._owner=e}.InheritsFrom(r.Class,{count:r.Property(function N(){return this._owner.DOMElement.attributes.length}),add:function(e,W){if(R.PlainObject(arguments[0])){W=arguments[0].value;e=arguments[0].name}if(R.String(e)&&R.String(W)){this._owner.DOMElement.setAttribute(e,W)}else{throw new Error("Invalid parameter values")}},get:function(e){if(!R.String(e)){return null}return this._owner.DOMElement.getAttribute(e)},exists:function(e){if(!R.String(e)){return false}return this._owner.DOMElement.hasAttribute(e)},remove:function(e){if(R.String(e)){this._owner.DOMElement.removeAttribute(e)}}});var u=function u(){this.base();this.OnParentChange.setBindParameters([this,this])}.InheritsFrom(r.Class,{OnParentChange:r.EventPrototype("sender, newParent, oldParent",{log:V}),OnVisibleChange:r.EventPrototype("sender, isEffectivelyVisible",{log:V}),Controls:j().InjectOwner(),Data:r.Object(),Parent:null,_isEffectivelyVisible:null,_fireOnVisibleChangeIfNeeded:function(W){var e=(this.visible()&&this._canBeVisible());if(W&&this.DOMElement){this.DOMElement.style.visibility=(e?"visible":"hidden");if(this.cssClassAdd){if(e){this.cssClassRem("hidden")}else{this.cssClassAdd("hidden")}}}var X=e&&(!this.Parent||this.Parent._isEffectivelyVisible)&&((!this.DOMElement)||(this.DOMElement&&document.body&&document.body.contains(this.DOMElement)));if(X!=this._isEffectivelyVisible){this._isEffectivelyVisible=X;this.Controls.forEach(function(Y){if(Y instanceof u){Y._fireOnVisibleChangeIfNeeded(false)}});this.OnVisibleChange.fire(this,!!this._isEffectivelyVisible);r.Utils._CheckResize()}},_canBeVisible:r.Property(true).OnChange(function E(e){this._fireOnVisibleChangeIfNeeded(true)}),visible:r.Property(true).OnChange(function E(e){this._fireOnVisibleChangeIfNeeded(true)}),isVisible:r.Property(function(){return !!this._isEffectivelyVisible})});r.extend(u.prototype,{Insert:function(Y,X,e){for(var W=0;W<arguments.length;W++){var Z=arguments[W];if(!R.Specified(Z)){continue}if(typeof Z==="string"){Z=document.createTextNode(Z||"")}if(typeof this._OverrideInsert==="function"){this._OverrideInsert.apply(this,arguments)}else{if(R.DomElement(Z)){if(Z.V3Ctrl){throw new Error("This element is controlled by a V3.UI.Control class and therefore cannot be added in this way")}(this.DOMContainer||this.DOMElement).appendChild(Z)}else{this.Controls.add(Z)}}}return this}});r.Is.Control=function(e){return e instanceof u};var x=function x(X,W,Y,e){this.base();if(R.String(X)){if(X.toLowerCase()=="svg"){this.__updateClassName=this.__updateClassNameSvg}this.DOMElement=document.createElement(X);this.DOMElement.id=this.constructor.name+"_"+(d._count=(d._count||0)+1);if(R.String(W)){this._cssClassAdd(true,W)}if(R.String(Y)){if(e){this.DOMElement.innerHTML=Y}else{this.DOMElement.appendChild(document.createTextNode(Y))}}this.DOMElement.V3Ctrl=this}else{if(R.DomElement(X)){this.DOMElement=X;if(this.DOMElement.className){if(typeof this.DOMElement.className.baseVal==="undefined"){this._cssClassListPublic.addRange((this.DOMElement.className+"").split(" "))}else{this._cssClassListPublic.addRange((this.DOMElement.className.baseVal+"").split(" "));this.__updateClassName=this.__updateClassNameSvg}}this.DOMElement.V3Ctrl=this;this._fireOnVisibleChangeIfNeeded()}else{throw new Error("WebControlBasic constructor expected an argument of type string or DomElement. ValueSpecified="+X)}}}.InheritsFrom(u,{OnClick:r.EventPrototype("sender, args",{lazyLoadCallback:function(){var e=this;r.AddEventHandler(this.DOMElement,"click",function(W){if(e.enabled&&!e.enabled()){return}if(e.OnClick.fire(e,{Event:W}).contains(false)){return false}})}}),Attributes:G().InjectOwner(),_cssClassListPublic:r.AutoConstruct(Array),_cssClassListPrivate:r.AutoConstruct(Array),__updateClassName:function(){this.DOMElement.className=this._cssClassListPrivate.join(" ")+" "+this._cssClassListPublic.join(" ");r.Utils._CheckResize()},__updateClassNameSvg:function(){this.DOMElement.className.baseVal=this._cssClassListPrivate.join(" ")+" "+this._cssClassListPublic.join(" ");r.Utils._CheckResize()},cssClass:r.Property(function N(){return this._cssClassListPublic.join(" ")},function y(e){this._cssClassListPublic.clear();this._cssClassListPublic.addRange(e.split(" "),true);this.__updateClassName()}),cssClassAdd:function(e,W){return this._cssClassAdd(false,e,W)},_cssClassAdd:function(Z,ac,ab){var ad=Z?this._cssClassListPrivate:this._cssClassListPublic;var W;if(!Z){W=this.cssClass()}var e=ad.add(ac,true);if(!e&&R.Number(ab)){this._cssClassRem(Z,ac,true);e=ad.add(ac)}if(e){this.__updateClassName();if(ab){if(!R.Number(ab)){this.DOMElement.offsetWidth}else{var Y=this.cssClassAdd__TimerLookup=(this.cssClassAdd__TimerLookup||{});var aa=this;if(Y[ac]){clearTimeout(Y[ac])}Y[ac]=setTimeout(function(){delete Y[ac];aa._cssClassRem(Z,ac)},ab)}}}if(!Z){var X=this.cssClass();if(W!=X){this.cssClass.OnChange.fire(X,W)}}return e},cssClassRem:function(e,W){return this._cssClassRem(false,e,W)},_cssClassRem:function(Y,e,X){var Z;if(!Y){Z=this.cssClass()}var W=Y?this._cssClassListPrivate:this._cssClassListPublic;if(!W.remove(e)){return false}else{this.__updateClassName();if(!Y){var aa=this.cssClass();if(Z!=aa){this.cssClass.OnChange.fire(aa,Z)}}if(X){this.DOMElement.offsetWidth}return true}},cssClassToggle:function(e,Y,X,W){return this._cssClassToggle(false,e,Y,X,W)},_cssClassToggle:function(Y,e,Z,X,W){if(e){if(X){this._cssClassRem(Y,X,W)}if(Z){this._cssClassAdd(Y,Z,W)}}else{if(Z){this._cssClassRem(Y,Z,W)}if(X){this._cssClassAdd(Y,X,W)}}},cssClassTransitionSync:function(e){if(this.cssClassRem(e)){this.DOMElement.offsetWidth;this.cssClassAdd(e)}else{if(this._cssClassRem(true,e)){this.DOMElement.offsetWidth;this._cssClassAdd(true,e)}}},tooltip:r.Property(function N(){return this.DOMElement.title},function y(e){if(e===null){e=""}this.DOMElement.title=e;this.Attributes.add("data-tooltip-text",e)}),activateContainer:function(e){if(this.DOMContainer){throw new Error("DOMContainer already activated")}if(R.TextNode(this.DOMElement)){r.Log.Warn("Unable to create container on text node. id:"+this.DOMElement.id);return}var W;if(!e||r.Is.String(e)){W=document.createElement("div");W.className=e||"container"}else{if(e instanceof x){W=e.DOMContainer||e.DOMElement}else{W=e}}while(this.DOMElement.firstChild){W.appendChild(this.DOMElement.firstChild)}this.DOMElement.appendChild(W);this.DOMContainer=W},_afterAppendDoDom:function(){this._fireOnVisibleChangeIfNeeded()},performClick:function(){this.OnClick.fire(this,{Event:{stopPropagation:r.Constants.EMPTY_FUNCTION}})},focus:function(){var W=this.DOMElement;setTimeout(function(){if(V){r.Log.Debug("calling DOMElement.focus() now.")}W.focus()},0)},scrollIntoView:function(e){I.scrollTo(this,e)},appendTo:function(e,W){if(R.String(e)){e=document.getElementById(e)}if(R.String(W)){W=document.getElementById(W)}if(!W){e.appendChild(this.DOMElement)}else{if(e.contains(W)){e.insertBefore(this.DOMElement,W)}else{if(W.contains(e)){W.insertBefore(this.DOMElement,e.nextSibling)}else{throw new Error("invalid parent/child specified")}}}this._afterAppendDoDom()},Style:function(W){var e=this.DOMElement;r.forEach(W,this,function(Y,X){switch(X.toLowerCase()){case"float":e.style.cssFloat=e.style.styleFloat=Y;return;case"width":case"height":case"left":case"top":case"right":case"bottom":if(R.Number(Y)){Y=Y+"px"}break}if(!R.Specified(e.style[X])){r.Log.Warn("style named '"+X+"' was not found.","domObj.style",e.style)}e.style[X]=Y});return this},AppendTo:function(e){this.appendTo.apply(this,arguments);return this},AppendHere:function(){var e=document.getElementById("v3-temp-div-id");if(!e){document.write('<div id="v3-temp-div-id"></div>');e=document.getElementById("v3-temp-div-id")}this.AppendTo(e.parentNode,e);e.parentNode.removeChild(e);return this},ContainsChild:function(W,e){if(e&&this.DOMElement===(W.DOMElement||W)){return true}return H(this,W)},DOMContainer:null,beginBulkLoad:function(){if(this._isBulkLoading){throw new Error("Already in bulk load state")}if(this._PREV_DOMContainer){throw new Error("Cannot start bulk load as PREV_DOMContainer is already assigned.")}this._isBulkLoading=true;this._PREV_DOMContainer=this.DOMContainer;this.DOMContainer=document.createDocumentFragment()},endBulkLoad:function(){if(!this._isBulkLoading){throw new Error("Not in bulk load state.")}this._isBulkLoading=false;var e=this.DOMContainer;var W=[].addRange(e.childNodes);this.DOMContainer=this._PREV_DOMContainer;delete this._PREV_DOMContainer;(this.DOMContainer||this.DOMElement).appendChild(e);W.forEach(function(X){if(X.V3Ctrl instanceof x){X.V3Ctrl._afterAppendDoDom()}})}});var S=r.Enum({Enter:0,Move:1,Down:2,Up:3,Click:4,DoubleClick:5,Exit:5});var d=function d(e,X){this.base(e,X);var W=this;if(R.String(e)){if(V){if(document.getElementById(this.DOMElement.id)!==null){throw new Error("Id has been duplicated. id="+this.DOMElement.id)}}}if(window.vsDesignTime||V){this._addValidation()}this.DOMElement.V3Ctrl=this;this.enabled(!this.DOMElement.disabled);if(V){this.OnFocus.addEventHandler(function(){this.cssClassAdd("focus-self")});this.OnUnfocus.addEventHandler(function(){this.cssClassRem("focus-self")});this.OnFocusContainer.addEventHandler(function(){this.cssClassAdd("focus-container")});this.OnUnfocusContainer.addEventHandler(function(){this.cssClassRem("focus-container")})}}.InheritsFrom(x,{OnKeyEvent:r.EventPrototype("sender, args",{lazyLoadCallback:function(){r.AddEventHandler(this.DOMElement,"keydown",this._fireOnKey.bind(this,q.Down));r.AddEventHandler(this.DOMElement,"keyup",this._fireOnKey.bind(this,q.Up));r.AddEventHandler(this.DOMElement,"keypress",this._fireOnKey.bind(this,q.Press))}}),OnFocus:r.EventPrototype("sender, e:{oldFocus:Control || DOMElement}",{}),OnFocusContainer:r.EventPrototype("sender, e:{oldFocus:Control || DOMElement}"),OnUnfocus:r.EventPrototype("sender, e:{newFocus:(Control || DOMElement), isWithinContainer:function(){}"),OnUnfocusContainer:r.EventPrototype("sender, e:{newFocus:(Control || DOMElement)"),OnMouseEvent:r.EventPrototype("sender, args",{lazyLoadCallback:function(){var e=this;r.AddEventHandler(e.DOMElement,"mouseover",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Enter,Target:X.target.V3Ctrl,Button:X.button===2?"right":"left"});if(Y.contains(false)){return false}});r.AddEventHandler(e.DOMElement,"mousemove",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Move,Target:X.target.V3Ctrl});if(Y.contains(false)){return false}});var W=null;r.AddEventHandler(e.DOMElement,"mousedown",function(Y){var Z=e.OnMouseEvent.fire(e,{Event:Y,Type:S.Down,Target:Y.target.V3Ctrl});if(Z.contains(false)){return false}var X=new Date().valueOf();if(W){if((X-W)<350){Z=e.OnMouseEvent.fire(e,{Event:Y,Type:S.DoubleClick,Target:Y.target.V3Ctrl,Detected:true});X=null}}W=X;if(Z.contains(false)){return false}});r.AddEventHandler(e.DOMElement,"mouseup",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Up,Target:X.target.V3Ctrl});if(Y.contains(false)){return false}});r.AddEventHandler(e.DOMElement,"mouseout",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Exit,Target:X.target.V3Ctrl});if(Y.contains(false)){return false}})}}),_checkEffectivelyEnabled:function(){this.effectivelyEnabled(this.enabled()&&(!this.Parent||!this.Parent.effectivelyEnabled||this.Parent.effectivelyEnabled()))},enabled:r.Property(true).OnChange(function(e){if(!e){this.effectivelyEnabled(false)}else{this.effectivelyEnabled(!this.Parent||!this.Parent.effectivelyEnabled||this.Parent.effectivelyEnabled())}}),effectivelyEnabled:r.Property(true).OnChange(function(e){if(e){this.DOMElement.disabled=false;this.cssClassRem("disabled");this.Attributes.remove("disabled")}else{this.DOMElement.disabled=true;this.cssClassAdd("disabled");this.Attributes.add("disabled","disabled")}this.Controls.forEach(function(W){if(W instanceof d){W._checkEffectivelyEnabled()}})}),_addValidation:function(){return},_fireOnKey:function(X,Y,W){if(!this.enabled()){return}var aa={Event:Y,Type:X,KeyCode:p.parse(Y.keyCode)||Y.keyCode,Ctrl:Y.ctrlKey};var Z=this.OnKeyEvent.fire(this,aa);if(Z.contains(false)){return false}},color:r.Property(null,function y(e){if(!(e instanceof r.Color)){throw new Error("value must be of type V3.Color")}this.DOMElement.style.color=e.toString(true)})});d._registeredWrappers={};d.registerWrapper=function(W,e){if(!R.String(W)||W===""){throw new Error("tagName must be a string")}if(!R.Function(e)){throw new Error("createInstance must be a function!")}d._registeredWrappers[W.toUpperCase()]=e};d.wrap=function(W){var e=d._registeredWrappers[W.tagName.toUpperCase()];if(e){return e(W)}else{return null}};r.Is.WebControl=function(e){return e&&(e instanceof r.UI.WebControlBasic)};var n=function n(e,W){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0],arguments[2]);e=this.href()}else{this.base("a",arguments[2])}if(this.DOMElement.childNodes.length==1&&R.TextNode(this.DOMElement.childNodes[0])){this._textNode=this.DOMElement.childNodes[0];W=this._textNode.data}else{this._textNode=document.createTextNode(W||"");this.DOMElement.appendChild(this._textNode)}this.href(e);this.text(W)}.InheritsFrom(d,{click:function(){this.DOMElement.click()},href:r.Property("",function(e){if(e){this.DOMElement.href=e}else{this.DOMElement.href="javascript:void(0)"}}),text:r.Property(function N(){return this._textNode.data},function y(e){if(!r.Is.Specified(e)){e=""}this._textNode.data=e.toString()}),target:r.Property(function N(){return this.DOMElement.target},function y(e){this.DOMElement.target=e})});n.wrap=function(e){return new n(e)};var D=function D(Z,Y){var X=["span","label","p","h1","h2","h3","h4","h5","h6"];var W=false;if(arguments.length===1&&R.DomElement(arguments[0])){if(!X.contains((arguments[0].tagName+"").toLowerCase())){throw new Error("Unsupported DOM Element")}this.base(arguments[0]);Z=""}else{if(arguments.length==1&&!r.Is.String(arguments[0])){Y=Z;Z=""}var e=Y;if(R.WebControl(e)){e=e.DOMElement}if(R.FormField(e)){this.base("label");if(e.id){this.DOMElement.htmlFor=e.id}if(!e.parentNode){W=true}}else{if(R.String(Z)&&Z.length<=2&&X.contains(Z.toLowerCase())){this.base(Z);if(arguments.length==2){Z=arguments[1]}else{Z=""}}else{this.base("span")}}}if(this.DOMElement.childNodes.length==1&&R.TextNode(this.DOMElement.childNodes[0])){this._textNode=this.DOMElement.childNodes[0];Z=this._textNode.data}else{this._textNode=document.createTextNode("");this.DOMElement.appendChild(this._textNode)}if(W){this.Controls.add(Y)}this.text(Z)}.InheritsFrom(x,{_updateCanBeVisible:function(){if(!this.autoVisibility()){this._canBeVisible(true)}else{if(this.text()==""){this._canBeVisible(false)}else{this._canBeVisible(true)}}},text:r.Property("",function y(X,W,Y){if(!r.Is.Specified(Y.value)){Y.value=""}this._textNode.data=Y.value.toString()}).OnChange(function E(e){this._updateCanBeVisible()}),autoVisibility:r.Property(false).OnChange(function E(e){this._updateCanBeVisible()})});D.wrap=function(e){return new D(e)};d.registerWrapper("span",D.wrap);d.registerWrapper("label",D.wrap);d.registerWrapper("h1",D.wrap);d.registerWrapper("h2",D.wrap);d.registerWrapper("h3",D.wrap);d.registerWrapper("h4",D.wrap);var b=function b(e){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0],e)}else{this.base("div",e)}}.InheritsFrom(d,{_hookedKeyEvents:false,defaultButton:r.Property(null).OnChange(function(e){if(!this._hookedKeyEvents&&e){this.OnKeyEvent.addEventHandler(function(X,Y){if(Y.Type==q.Press&&Y.KeyCode==p.Enter){var W=this.defaultButton();if(!W){return}var Z=Y.Event.target;if(Z&&((Z.tagName.toLowerCase()=="input")&&(Z.type.toLowerCase()=="submit"||Z.type.toLowerCase()=="button"))||((Z.tagName.toLowerCase()=="a")&&(Z.href!=null)&&(Z.href!=""))||((Z.tagName.toLowerCase()=="textarea"))){return}Y.Event.preventDefault();Y.Event.stopPropagation();W.performClick();return false}})}}),width:r.Property(function N(){return parseInt(this.DOMElement.style.width,10)},function y(e){this.Style({width:e})}),height:r.Property(function N(){return parseInt(this.DOMElement.style.height,10)},function y(e){this.Style({height:e})})});b.wrap=function(e){return new b(e)};d.registerWrapper("div",b.wrap);var M=function M(W){if(V){var e=new r.Utils.StopWatch(true)}this.base("img");if(V){e.stop();if(e.getDuration()>10){r.Log.Warn("init image look a long time: "+e.getDuration()+"ms")}}var X=this;r.AddEventHandler(X.DOMElement,"load",function(){X.loaded=true;X.OnLoad.fire(X,X.DOMElement.src,X.size())});this.Set({imageUrl:W})}.InheritsFrom(d,{OnLoad:r.EventPrototype("sender, url, size",true),clear:function(){this.imageUrl("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAALSURBVAgdY2BgAAAAAwABT0gKrwAAAABJRU5ErkJggg==")},loaded:false,size:r.Property(function N(){return{width:this.DOMElement.naturalWidth,height:this.DOMElement.naturalHeight}}),imageUrl:r.Property(function N(){return this.DOMElement.src},function y(e){if(!e||e===""){throw new Error("Value cannot be an empty string! Use the visible property if trying to hide the image.")}if(this.DOMElement.src!=e){this.DOMElement.src=e}})});function B(e){if(!e){return null}else{return{x:e.x,y:e.y}}}function z(e){if(!e){return null}else{return{width:e.width,height:e.height}}}var C=function C(e,Y,X,W,Z){this.base("div");this._sourceImageSize=Z;this._addInstanceMembersToSpriteImage();this._img=new M(e).Set({OnLoad:this._calculate.bind(this),Style:{position:"absolute"}});this.imageUrl=this._img.imageUrl;this.Controls.add(this._img);this.Style({display:"inline-block",overflow:"hidden",position:"relative"});this.locationOnSprite.OnChange.addEventHandler(this._calculate);this.sizeOnSprite.OnChange.addEventHandler(this._calculate);this.size.OnChange.addEventHandler(this._calculate);this.Set({locationOnSprite:Y,sizeOnSprite:X,size:W||X});this._isReady=true;this._calculate()}.InheritsFrom(d,{_img:null,_sourceBounds:null,_renderedSize:null,_addInstanceMembersToSpriteImage:function(){this._sourceBounds={point:null,size:null};this.locationOnSprite=new r.Property(this,null,function W(X){this._sourceBounds.point=B(X)});this.sizeOnSprite=new r.Property(this,null,function W(X){this._sourceBounds.size=z(X)});this.size=new r.Property(this,null,function W(X){this._renderedSize=z(X);this.Style({width:X.width+"px",height:X.height+"px"})});this.scaledImageSize=new r.Property(this,function e(){return{width:parseInt(this._img.DOMElement.style.width,10),height:parseInt(this._img.DOMElement.style.height,10)}});this.scaledLocationOnSprite=new r.Property(this,function e(){return{x:-parseInt(this._img.DOMElement.style.left,10),y:-parseInt(this._img.DOMElement.style.top,10)}})},_calculate:function(){if(!this._isReady){return}var X=this._sourceImageSize;if(this._img.loaded){X=this._img.size()}var e={x:(this._renderedSize.width/this._sourceBounds.size.width),y:(this._renderedSize.height/this._sourceBounds.size.height)};var W={x:X.width/(this._sourceBounds.size.width),y:X.height/(this._sourceBounds.size.height)};this._img.Style({left:-(this._sourceBounds.point.x*e.x)+"px ",top:-(this._sourceBounds.point.y*e.y)+"px",width:(this._sourceBounds.size.width*e.x*W.x)+"px ",height:(this._sourceBounds.size.height*e.y*W.y)+"px"})}});var T=function T(ab,W,ad,ac,aa,Y,ae){this.base();this.imageUrl=new M(ab).imageUrl;this.scale=new r.Property(this,1);if(R.Number(ac)){ac=[ac]}if(R.Number(aa)){aa=[aa]}if(R.Boolean(ac)){if(R.Boolean(aa)){throw new Error("Cannot specify boolean for both colWidth and rowHeights")}this._isSingleColumnWithVaryingWidths=ac;ac=[Math.max.apply(Math,aa)]}if(R.Boolean(aa)){this._isSingleRowWithVaryingHeights=aa;aa=[Math.max.apply(Math,ac)]}this._rowCount=ad;this._colCount=W;this._colWidths=ac;this._rowHeights=aa;this._colSpacings=(Y instanceof Array)?Y:[Y||0];this._rowSpacings=(ae instanceof Array)?ae:[ae||0];var Z=0;for(var X=0;X<this._rowCount;X++){Z+=this._colWidths[X%this._colWidths.length];Z+=this._colSpacings[X%this._colSpacings.length]}var e=0;for(var X=0;X<this._colCount;X++){e+=this._rowHeights[X%this._rowHeights.length];e+=this._rowSpacings[X%this._rowSpacings.length]}this._size={width:Z,height:e};this.imageIds=new r.Property(this)}.InheritsFrom(r.Class,{_isSingleColumnWithVaryingWidths:false,_isSingleRowWithVaryingHeights:false,getImageFromIndex:function(Z,ad){var e=Z%this._colCount;var Y=Math.floor(Z/this._colCount);var ac={width:this._colWidths[e%this._colWidths.length],height:this._rowHeights[Y%this._rowHeights.length]};var ab=0;var W=0;if(this._isSingleColumnWithVaryingWidths){ac.width=ac.height}else{for(var X=0;X<e;X++){ab+=this._colWidths[X%this._colWidths.length];ab+=this._colSpacings[X%this._colSpacings.length]}}if(this._isSingleRowWithVaryingHeights){ac.height=ac.width}else{for(var X=0;X<Y;X++){W+=this._rowHeights[X%this._rowHeights.length];W+=this._rowSpacings[X%this._rowSpacings.length]}}if(!ad){ad={width:ac.width/this.scale(),height:ac.height/this.scale()}}var aa=new C(this.imageUrl,{x:ab,y:W},ac,ad,this._size);return aa},getImageById:function(X){var e=this.imageIds();if(!e){throw new Error("imageIds is not set")}var W=e[X];if(R.Undefined(W)){return null}else{return this.getImageFromIndex()}},size:r.Property(function N(){return this._size})});var P=function P(W,e,X,Y){this.base(W,Y);if(arguments.length>=3&&W.toLowerCase()==="input"){this.Attributes.add("type",arguments[2])}r.AddEventHandler(this.DOMElement,["change","input","keyup"],this._fireOnChange.bind(this));this.Set({OnFocus:function(Z,aa){this._lastValue=this.value()},OnChange:function(Z,aa){if(this._binding){if(this._customBind){this._customBind(this._binding.obj,this._binding.field,aa)}else{this._binding.obj[this._binding.field]=Z.value()}}}});this._lastValue=this.value();if(!R.String(e)){e=this.DOMElement.name||this.DOMElement.id}this.name(e)}.InheritsFrom(d,{OnChange:r.EventPrototype("sender, e"),value:r.Property(function N(){return this.DOMElement.value},function y(e){if(this.DOMElement.value!=e){this.DOMElement.value=e}this._fireOnChange()}),name:r.Property(function N(){return this.DOMElement.name},function y(e){this.Attributes.add("name",e)}),_lastValue:null,_fireOnChange:function(X){var W=this.value();if(this._lastValue!=W){if(!X){this.OnChange.fire(this,{event:X,lastValue:this._lastValue,value:W,changedByUser:false})}else{this.OnChange.fire(this,{event:X,lastValue:this._lastValue,value:W,changedByUser:true})}this._lastValue=W}},_binding:null,bind:function(e,W){if(arguments.length===0){if(!this._binding){r.Log.Warn("bind() called when control is not currently bound therefore nothing to do.");return}e=this._binding.obj;W=this._binding.field}else{if(e===null){this._binding=null;return}this._binding={obj:e,field:W}}if(this._customBind){this._customBind(e,W)}else{if(R.String(e[W])||R.Number(e[W])){this.value(e[W]+"")}else{e[W]=this.value()}}return this},readOnly:r.Property(false,function y(e){if(e){this.DOMElement.readOnly=true;this.Attributes.add("readonly","readonly")}else{this.DOMElement.readOnly=false;this.Attributes.remove("readonly")}})});var i=P.prototype;if(window.vsDesignTime){intellisense.addSignature(i.name,"Gets or Sets the name of the property",[{name:"value",optional:true}])}var l=function l(e){this.base("input",e,"checkbox");r.AddEventHandler(this.DOMElement,["change","click","onkeyup"],this.__DOMElement_EventHandler.bind(this));this.OnChange.addEventHandler(function(W,X){if(R.Undefined(X.selected)){X.selected=this.DOMElement.checked}})}.InheritsFrom(P,{_customBind:function(X,Y,W){if(!W&&(R.Boolean(X[Y])||R.Number(X[Y]))){this.selected(!!X[Y])}else{X[Y]=this.selected()}},_fireOnChangeEvent:function(e){this.OnChange.fire(this,{checked:e})},__DOMElement_EventHandler:function(e,W){this.selected(W.checked)},selected:r.Property(function N(){return this.DOMElement.checked},function y(W,e){this.DOMElement.checked=W;if(W!=e){this._fireOnChangeEvent(W)}})});var O=function O(e){this.base("input",e,"radio");if(!R.String(e)){throw new Error("Name must be specified!")}this.Group=k.getGroupByName(e);this.Group.registerRadioButton(this);r.AddEventHandler(this.DOMElement,["change","click","onkeyup"],this.__DOMElement_EventHandler.bind(this));this.OnChange.addEventHandler(function(W,X){if(R.Undefined(X.selected)){X.selected=this.DOMElement.checked}})}.InheritsFrom(P,{__DOMElement_EventHandler:function(e,W){this.selected(W.checked)},_customBind:function(X,Y,W){if(!W&&(R.Boolean(X[Y])||R.Number(X[Y]))){this.selected(!!X[Y])}else{X[Y]=this.selected()}},_fireOnChangeEvent:function(X){var W=this.Group._selectedButton;if(X){this.Group._selectedButton=this;if(W){W._deselected()}}var Y={selected:X,selectedButton:this.Group._selectedButton,deselectedButton:W};this.OnChange.fire(this,Y)},_deselected:function(){this.selected(false)},selected:r.Property(false,function(W,e){this.DOMElement.checked=W;if(W!=e){this._fireOnChangeEvent(W)}})});var k=function k(e){this.base();this.groupName(e)}.InheritsFrom(r.Class,{groupName:r.Property(),_Controls:r.AutoConstruct(Array),_selectedButton:null,registerRadioButton:function(e){this._Controls.add(e);if(e.selected()){this._selectedButton=e}}});k._RegisteredGroups={};k.getGroupByName=function(W){var e=k._RegisteredGroups[W];if(!e){e=new k(W);k._RegisteredGroups[W]=e}return e};var o=function o(W,e){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0],arguments[0].name)}else{var X;if(R.String(W)){X=W}else{X=null;if(arguments.length==1){e=arguments[0]}}this.base("select",X)}this.OnChange.addEventHandler(function(Y,Z){if(R.Undefined(Z.selectedIndex)){this._readSelectedItemFromElement();this._enhanceEventArgs(Z)}});if(R.Array(e)||R.PlainObject(e)){this.addRange(e)}}.InheritsFrom(P,{DOMElement:!window.vsDesignTime?null:document.createElement("select"),_selected:r.Object({Index:-1,Value:null,Name:null}),_options:r.AutoConstruct(Array),_enhanceEventArgs:function(W){W.selectedIndex=this._selected.Index;W.selectedValue=this._selected.Value;W.name=this._selected.Name;W.userSelected=true},_customBind:function(X,Y,W){if(!W&&(R.String(X[Y])||R.Number(X[Y]))){this.selectedValue(X[Y])}else{this._readSelectedItemFromElement();if(W){this._enhanceEventArgs(W)}X[Y]=this.selectedValue()}},count:r.Property(function N(){return this._options.length}),selectedIndex:r.Property(function N(){return this._selected.Index},function y(e){if(!R.Number(e)){throw new Error("value must be a number!")}if(e<-1||this.DOMElement.options.length<=e){throw new Error("index out of bounds")}if(e!=this._selected.Index){if(e!==-1){this.DOMElement.options[e].selected=true}else{if(e===-1){this.DOMElement.options[this._selected.Index].selected=false}}this._readSelectedItemFromElement();this.OnChange.fire(this,{event:null,selectedIndex:this._selected.Index,selectedValue:this._selected.Value,name:this._selected.Name,userSelected:false});if(r.jQuery){r.jQuery(this.DOMElement).change()}}}),selectedValue:r.Property(function N(){return this._selected.Value},function y(W){var e=this.find(W);if(e){this.selectedIndex(e.index)}}),_readSelectedItemFromElement:function(e){var Y=this.DOMElement;var X=-1;var Z=null;for(var W=0;W<Y.options.length;W++){if(Y.options[W].selected){X=W;Z=Y.options[W].ctrlValue;if(R.Undefined(Z)){Z=Y.options[W].value}break}}this._selected.Index=X;this._selected.Value=Z;if(X==-1){this._selected.Name=null}else{this._selected.Name=Y.options[X].innerHTML}if(this._lastValue===Z){return false}else{this._lastValue=Z;if(e){this.OnChange.fire(this,{event:null,selectedIndex:this._selected.Index,selectedValue:this._selected.Value,name:this._selected.Name,userSelected:false})}return true}},_indexOfValue:function(X){var W=(R.Specified(X)&&R.Function(X.valueOf))?X.valueOf():X;for(var e=0;e<this._options.length;e++){if(this._options[e].ctrlValue===X||this._options[e].ctrlValueOf===W){return e}}return -1},_findIndexOfOpt:function(W){var X=this.DOMElement;for(var e=0;e<X.options.length;e++){if(X.options[e]===W){return e}}return -1},_getSafe:function(e){var W=this._options[e];if(!W){return null}else{return{index:e,name:W.innerHTML,value:W.ctrlValue,enabled:!W.disabled,selected:this._selected.Index==e}}},add:function(W,X,e){this.addAt(this.count(),W,X,e)},addAt:function(X,W,Z,e){if(X<0||X>this.count()){throw new Error("Index out of valid bounds")}W=W+"";if(R.Undefined(Z)){Z=W}if(!R.Boolean(e)){e=true}var Y=document.createElement("option");Y.innerHTML=W.toString();Y.value=Z;Y.disabled=!e;Y.ctrlValue=Z;if(R.Specified(Z)&&R.Function(Z.valueOf)){Y.ctrlValueOf=Z.valueOf()}else{Y.ctrlValueOf=Z}this._options.addAt(X,Y);this.DOMElement.add(Y,X);if(e&&this._selected.Index==-1){Y.selected=true}this._readSelectedItemFromElement(true)},addRange:function(e){r.forEach(e,this,function(X,W){if(R.String(W)){this.add(W,X)}else{if(R.PlainObject(X)&&R.Defined(X.label)&&R.Defined(X.value)){this.add(X.label,X.value)}else{this.add(X.toString(),X)}}})},clear:function(){this.DOMElement.options.length=0;this._options.clear();this._readSelectedItemFromElement(true)},containsValue:function(e){return(this._indexOfValue(e)!==-1)},indexOfName:function(W){W=W.toLowerCase();var e=-1;this._options.find(function(Y,X){if(Y.innerHTML.toLowerCase()===W){e=X;return true}});return e},get:function(e){if(e<0||e>=this.count()){throw new Error("index out of bounds")}return this._getSafe(e)},find:function(e){return this._getSafe(this._indexOfValue(e))},findByName:function(W){var e=-1;this._options.find(function(Y,X){if(Y.innerHTML==W){e=X;return true}});this._getSafe(e)},remove:function(X){var e=this._indexOfValue(X);if(e>=0){var W=this._options[e];if(e===this.selectedIndex()){this.selectedIndex(-1)}this._options.removeAt(e);this.DOMElement.removeChild(W)}this._readSelectedItemFromElement(true)},rename:function(X,e){var W=this._indexOfValue(X);if(W===-1){throw new Error("value not found")}this.DOMElement.options[W].innerHTML=e+""},setFilter:function y(X){var e=0;var W=-1;if(!X||X===""){X=null}this._options.forEach(function(Z,Y){if(!X||Z.innerHTML.toLowerCase().indexOf(X.toLowerCase())==0){e++;if(W===-1){W=Y}if(!Z.parentNode){this.DOMElement.add(Z,Y)}}else{if(Z.parentNode){this.DOMElement.remove(this._findIndexOfOpt(Z))}}}.bind(this));return{count:e,firstMatch:(W===-1?null:this.get(W))}},toArray:function(W){var e=[];if(W){this._options.forEach(function(X){e.add(X.innerHTML)})}else{e.add({name:item.innerHTML,value:R.Undefined(item.ctrlValue)?item.value:item.ctrlValue})}return e}});o.wrap=function(e){if(!R.DomElement(e)){if(!e&&window.vsDesignTime){e=document.createElement("select")}else{throw new Error("domSelect must be a DOM element")}}return new o(e)};r.extend(o.prototype,{Insert:function(W,e,X){this.addRange.apply(this,arguments);return this}});var L=function L(e){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0])}else{this.base("button")}this.DOMElement.appendChild(this._textNode=document.createTextNode(""));this.DOMElement.type="button";if(!R.String(e)){e=""}this.text(e)}.InheritsFrom(d,{_textNode:null,text:r.Property("",function y(e){this._textNode.data=e}),useSubmitBehaviour:r.Property(false,function y(e){if(e){this.DOMElement.type="submit"}else{this.DOMElement.type="button"}}),performClick:function(){this.DOMElement.click()}});L.wrap=function(e){return new L(e)};d.registerWrapper("button",L.wrap);var q=new r.Enum({Down:0,Up:1,Press:2});var p=new r.Enum({Backspace:8,Enter:13,Escape:27,"Left Arrow":37,"Up Arrow":38,"Right Arrow":39,"Down Arrow":40,Delete:46});var U=function U(){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0])}else{var e=false;var X;if(r.Is.Boolean(arguments[0])){e=(arguments[0]===true);X=arguments[1]}else{X=arguments[0]}if(e){this.base("textarea",null,"",X)}else{this.base("input",null,"text",X)}}this._attachedPanel_OnKeyEvent_Bound=this._attachedPanel_OnKeyEvent_Bound.bind(this);this._attachedPanel_OnUnfocusContainer_Bound=this._attachedPanel_OnUnfocusContainer_Bound.bind(this);this.OnChange.addEventHandler(function(Z,aa){aa.text=this.text();this._makeSuggestion();if(V){r.Log.Debug("SUGGESTION: text="+aa.text+", value="+aa.value+", suggestion="+this._currentSuggestion)}});this.OnKeyEvent.addEventHandler(function(Z,ab){if(ab.KeyCode==p.Delete||ab.KeyCode==p.Backspace){this._stopSuggestions=true;this._currentSuggestion=null}else{this._stopSuggestions=false;if(ab.KeyCode===p.Enter){if(ab.Type==q.Up){this._lockInSuggestion()}}}if(ab.Type==q.Down&&ab.KeyCode==27){var aa=this.attachedPanel();if(aa&&aa.visible()){ab.Event.stopPropagation();this.closeAttachedPanel()}}}.bind(this));this.OnUnfocus.addEventHandler(function(Z,ab){var aa=this.attachedPanel();if(!aa||!aa.visible()){ab.isFocusingAttachedPanel=false}else{ab.isFocusingAttachedPanel=(ab.newFocus&&(ab.newFocus===aa||aa.ContainsChild(ab.newFocus)));if(!ab.isFocusingAttachedPanel){this.closeAttachedPanel()}}this._lockInSuggestion();if(V){r.Log.Debug("LOCK: text="+this.text()+", value="+this.value()+", suggestion="+this._currentSuggestion)}}.bind(this));if(this.DOMElement.tagName.toUpperCase()=="TEXTAREA"){this.rows=new r.Property(this,function W(){return this.DOMElement.rows},function Y(Z){this.DOMElement.rows=Z});this.columns=new r.Property(this,function W(){return this.DOMElement.cols},function Y(Z){this.DOMElement.cols=Z})}}.InheritsFrom(P,{_attachedPanelHookedEvents:false,closeAttachedPanel:function(){var e=this.attachedPanel();if(e&&e.visible()){e.visible(false)}},_attachedPanel_OnKeyEvent_Bound:function(W,X){if(X.KeyCode==p.Escape&&X.Type==q.Down){X.Event.stopPropagation();this._ignoreNextFocus=true;this.DOMElement.focus();W.visible(false)}},_attachedPanel_OnUnfocusContainer_Bound:function(W,X){if(X.newFocus!==this){W.visible(false)}},attachedPanel:r.Property(null,function y(Y,X){if(X){X.cssClassRem("is-attached");X.OnKeyEvent.removeEventHandler(this._attachedPanel_OnKeyEvent_Bound);X.OnUnfocusContainer.removeEventHandler(this._attachedPanel_OnUnfocusContainer_Bound)}if(Y===null){return}if(!(Y instanceof b)){throw new Error("value must be an instance of Panel or null.")}Y.cssClassAdd("is-attached");Y.OnKeyEvent.addEventHandler(this._attachedPanel_OnKeyEvent_Bound);Y.OnUnfocusContainer.addEventHandler(this._attachedPanel_OnUnfocusContainer_Bound);Y.DOMElement.tabIndex=-1;if(!this._attachedPanelHookedEvents){this._attachedPanelHookedEvents=true;var W=this;this.OnFocus.addEventHandler(function(){var Z=this.attachedPanel();if(Z&&!Z.visible()){if(this._ignoreNextFocus){if(V){r.Log.Debug("Is not showing/focusing panel.")}this._ignoreNextFocus=false}else{if(V){r.Log.Debug("Showing/focusing panel.")}Z.visible(true);if(this.readOnly()){Z.focus()}}}});this.OnClick.addEventHandler(function(){var Z=this.attachedPanel();if(Z){Z.visible(true)}})}var e=Y;if(!e.DOMElement.parentNode){if(this.Parent){this.Parent.Controls.insertAfter(e,this)}else{if(this.DOMElement.parentNode){this.DOMElement.parentNode.insertBefore(e.DOMElement,this.DOMElement.nextSibling)}}e.Style({position:"absolute"})}}),_autoSuggestSource:null,_currentSuggestion:null,_stopSuggestions:false,_makeSuggestion:function(){if(!this._autoSuggestSource||this._stopSuggestions){return}var W=this.text();if(W.length==0){return}var e=this._autoSuggestSource.find(function(Y){return(Y.length>W.length&&Y.substr(0,W.length).toLowerCase()===W.toLowerCase())});if(!e){this._currentSuggestion=null}else{this._currentSuggestion=e.substr(W.length);var X=this.DOMElement.selectionStart;this.DOMElement.value=this.DOMElement.value+this._currentSuggestion;this.DOMElement.selectionStart=X;this.DOMElement.selectionEnd=X+this._currentSuggestion.length}},_lockInSuggestion:function(){var e=this._currentSuggestion;if(e&&!this._stopSuggestions){this._currentSuggestion=null;this._stopSuggestions=false;alert("lockin");this.text(this.text()+e)}},selectAll:function(){this.DOMElement.select()},autoSuggestSource:r.Property(null,function y(e){if(e!==null&&!R.Array(e)){throw new Error("value must be an array")}if(e===null||e.length==0){this._autoSuggestSource=null;this._currentSuggestion=null;this._stopSuggestions=false;return}this._autoSuggestSource=e.clone()}),text:r.Property(function N(){var e=this.value();if(this._currentSuggestion){e=e.substr(0,e.length-this._currentSuggestion.length)}var W=this.maxLength();if((e||"").length>W){e=e.substr(0,W)}return e},function y(e){this._currentSuggestion=null;this._stopSuggestions=false;this.value(e)}),placeholder:r.Property("",function y(e){this.DOMElement.placeholder=e}),maxLength:r.Property(2147483647,function y(e){this.DOMElement.maxLength=e})});U.wrap=function(e){return new U(e)};d.registerWrapper("a",n.wrap);d.registerWrapper("select",o.wrap);d.registerWrapper("textarea",U.wrap);d.registerWrapper("input",function(e){switch(e.type.toLowerCase()){case"text":return U.wrap(e);case"submit":return L.wrap(e);default:return null}});var J=function J(){this.base("date-input");if(r.UI.DateInput.HasNativeSupport){this.DOMElement.type="date"}else{this.DOMElement.type="text";this._setupPicker()}this.OnChange.addEventHandler(function(W,Y){if(Y.changedByUser){if(this.allowTextEntry()||this.DOMElement.type==="date"){var Z=new Date(Y.value);var X=/^\d{4}-\d{2}-\d{2}$/;if(X.exec(Y.value)!==null){Z=new Date(Y.value+"T00:00")}if(Z){this.date(Z)}}}});this.OnDateSelected.addEventHandler(function(X,Y){var W=this._bound;if(W){W.obj[W.field]=Y.date}});this.formatString("dd/MM/yyyy");r.CultureInfo.currentUICulture.OnChange.addEventHandler(function(e){this._updateText()}.bind(this))}.InheritsFrom(U,{OnDateSelected:r.EventPrototype("sender, e:{date:dteDate, formatted:strDate}"),_updateText:function(){if(!this.date()){this.value("")}else{if(this.DOMElement.type==="text"){this.value(this.date().toStringFormat(this.formatString(),r.CultureInfo.currentUICulture()))}else{this.value(this.date().toStringFormat("yyyy-MM-dd",r.CultureInfo.currentUICulture()))}}},allowTextEntry:r.Property(false,function y(e){this.readOnly(e)}),isRequired:r.Property(true).OnChange(function(e){if(e&&!this.date()){this.date(this.minDate()||new V3Date())}}),formatString:r.Property("",function y(X,e,W){if(!X){W.value="dd/MM/yyyy"}}).OnChange(function(e){this._updateText();if(!J.HasNativeSupport){this.DOMElement.size=new Date("2000-09-26").toStringFormat(e).length}}),date:r.Property(null,function y(X,e,W){if(X&&R.String(X)){W.value=X=new V3Date(X).date()}else{if(!X){if(!this.isRequired()){this.value("");return}W.value=X=(this.minDate()||new V3Date().date())}else{W.value=X=X.asV3Date().date()}}if(this.maxDate()){if(X>this.maxDate()){W.value=X=this.maxDate()}}if(this.minDate()){if(X<this.minDate()){W.value=X=this.minDate()}}if(X.equals(e)){return false}}).OnChange(function(){this._updateText();this.OnDateSelected.fire(this,{date:this.date(),formatted:this.value()})}),_bound:!window.vsDesignTime?null:{obj:null,field:null},bind:function(X,W){var e=this._bound;if(X){e=this._bound={obj:X,field:W};if(r.Is.Defined(X[W])){this.date(X[W]);return}}if(e.obj[e.field]){this.date(e.obj[e.field]);e.obj[e.field]=this.date()}},_jQueryPickerInUse:null,minDate:r.Property(null,function y(X,e,W){if(R.String(X)){W.value=X=new V3Date(X).date()}else{W.value=X=new V3Date(X).date()}if(X&&this.maxDate()&&X>this.maxDate()){throw new Error("minDate must be less than or equal to maxDate")}}).OnChange(function E(e){if(J.HasNativeSupport){this.DOMElement.min=e.toStringFormat("yyyy-MM-dd")}else{if(this._jQueryPickerInUse){r.jQuery(this.DOMElement).datepicker("option","minDate",e)}}if(e&&this.date()&&this.date()<e){this.date(e)}}),maxDate:r.Property(null,function y(X,e,W){if(R.String(X)){W.value=X=new V3Date(X).date()}else{W.value=X=new V3Date(X).date()}if(X&&this.minDate()&&X<this.minDate()){throw new Error("maxDate must be less than or equal to minDate")}}).OnChange(function E(e){if(J.HasNativeSupport){this.DOMElement.max=e.toStringFormat("yyyy-MM-dd")}else{if(this._jQueryPickerInUse){r.jQuery(this.DOMElement).datepicker("option","maxDate",e)}}if(e&&this.date()&&this.date()>e){this.date(e)}}),_setupPicker:function(){if(!r.jQuery){r.Log.Error("The browser does not support the HTML5 input type 'Date' and jQuery is not present, we cannot present a date picker UI control.");return}var e=new b().Set({cssClass:"date-picker",visible:false,OnKeyEvent:function(W,X){if(X.Type==q.Down&&X.KeyCode==p.Escape){X.Event.stopPropagation();this.visible(false)}}}).Style({position:"relative"}).Insert(new L("X").Set({cssClass:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",OnClick:function(W,X){e.visible(false)}}));this.attachedPanel(e);this.OnParentChange.addEventHandler(function(X,Y,W){if(!this.Parent){if(W){W.Controls.remove(e)}}else{this.Parent.Controls.insertAfter(e,this);if(!this._jQueryPickerInUse){setTimeout(function(){var Z=r.jQuery(e.DOMElement);var aa=r.CultureInfo.currentUICulture().dateTimeFormat();this._jQueryPickerInUse=true;Z.datepicker({onSelect:function(){this.date(Z.datepicker("getDate"));e.visible(false)}.bind(this),onClose:function(ac,ab){this.date(Z.datepicker("getDate"))}.bind(this),showAnim:"",numberOfMonths:1,dateFormat:"yyyy-MM-dd",showButtonPanel:false,buttonImage:"",minDate:this.minDate(),maxDate:this.maxDate(),hideIfNoPrevNext:true,dayNames:aa.dayNames(),dayNamesShort:aa.abbreviatedDayNames(),monthNames:aa.monthNames(),monthNamesShort:aa.abbreviatedMonthNames(),dayNamesMin:aa.shortestDayNames(),firstDay:aa.firstDayOfWeek()||0});r.CultureInfo.currentUICulture.OnChange.addEventHandler(function(ab){var ad=ab.dateTimeFormat();var ac=Z.datepicker({dayNames:ad.dayNames(),dayNamesShort:ad.abbreviatedDayNames(),monthNames:ad.monthNames(),monthNamesShort:ad.abbreviatedMonthNames(),dayNamesMin:ad.shortestDayNames()})});e.OnVisibleChange.addEventHandler(function(ac,ab){if(ab){Z.datepicker("setDate",this.date())}}.bind(this))}.bind(this),0)}}});this.readOnly(true)}});try{var Q=document.createElement("input");Q.type="date";Q.value="><";if(Q.type!=="date"){throw new Error('type "Date" not supported')}else{if(Q.value==="><"){throw new Error('allowed text "><"')}}J.HasNativeSupport=true;r.Log.Debug("Browser has native support for DateInput!")}catch(A){r.Log.Debug("Browser does not have native support for DateInput, error: "+A,"error",A);J.HasNativeSupport=false}var m=function m(e){this.base("popup "+(e||""));this._doPositioning_Bound=this._doPositioning.bind(this);this.visible(false);this.visible.OnChange.addEventHandler(function(W){if(W){if(this._modal){this._pnlBlocker.appendTo(c())}this.appendTo(c())}});this.OnVisibleChange.addEventHandler(function(Y,W){if(W){if(this._onOpening()===false){this.close();return}else{this._doPositioning();setTimeout(this._doPositioning.bind(this),0)}r.addCssClass(document.documentElement,"v3-showing-modal");r.Utils.OnResize.addEventHandler(this._doPositioning_Bound);this.OnShow.fire(this,{})}else{if(this._onClosing()===false){return}var X=c();if(X.contains(this.DOMElement)){X.removeChild(this.DOMElement)}if(X.contains(this._pnlBlocker.DOMElement)){X.removeChild(this._pnlBlocker.DOMElement)}r.Utils.OnResize.removeEventHandler(this._doPositioning_Bound);r.remCssClass(document.documentElement,"v3-showing-modal");this.OnClose.fire(this,{cancelled:this._isCancel!==false});this._isCancel=null}});this.Style({position:"absolute"});this.cssClass.OnChange.addEventHandler(function(W){this._pnlBlocker.cssClass(W)});this.OnKeyEvent.addEventHandler(function(W,X){if(X.Type==q.Down&&X.KeyCode==p.Escape&&this.closeOnEscape()){X.Event.stopPropagation();this.close()}})}.InheritsFrom(b,{OnShow:r.EventPrototype("sender, e"),OnClose:r.EventPrototype("sender, e:{cancel:true/false, product: productEntity, configuration: {}"),_modal:false,_pnlBlocker:b("popup-background-cover").Defaults({Style:{position:"fixed",left:0,top:0,right:0,bottom:0},OnClick:function(W,X){if(this._modal&&this.closeModalOnBackgroundClick()){this.close()}},OnFocus:function(W,X){this.focus()}}),closeOnEscape:r.Property(true),closeModalOnBackgroundClick:r.Property(true),_onOpening:function(){},_onClosing:function(){},_doPositioning:function(){this.Style({left:Math.floor(Math.max(0,(window.innerWidth/2)-(this.DOMElement.offsetWidth/2))+window.pageXOffset),top:Math.floor(Math.max(0,(window.innerHeight/2)-(this.DOMElement.offsetHeight/2))+window.pageYOffset)})},show:function(e){if(this.visible()){return}this._modal=e;if(e){this.cssClassAdd("modal")}else{this.cssClassRem("modal")}this.visible(true);this.focus()},_isCancel:null,close:function(e){this._isCancel=!e;this.visible(false)}});var s=function s(Y,X,W){if(arguments.length==2){if(R.Boolean(X)){W=X;X=null}}this.base("",Y,"toggler");this.OnClick.addEventHandler(this._this_OnClick);this.targetControl(X);if(!R.Boolean(W)){W=true}this.collapsed(W);this.cssClass.OnChange.addEventHandler(function(Z){if(this.collapsed()){this.cssClassAdd("is-collapsed")}else{this.cssClassAdd("is-expanded")}});var e=this;this.collapsed.OnChange.addEventHandler(function(Z){e.OnToggle.fire(e,{collapsed:Z})})}.InheritsFrom(n,{OnToggle:r.EventPrototype("sender, e:{collapsed:true||false}"),_this_OnClick:function(W,X){if(X){X.Event.stopPropagation()}this.collapsed(!this.collapsed())},collapsed:r.Property(null).OnChange(function(e){this._updateTargetObject()}),_updateTargetObject:function(){var e=this.collapsed();if(!e){this.cssClassRem("is-collapsed");this.cssClassAdd("is-expanded");if(this._target){this._target.cssClassRem("collapsed");this._target.cssClassAdd("expanded");this._target.visible(true)}}if(e){this.cssClassRem("is-expanded");this.cssClassAdd("is-collapsed");if(this._target){this._target.cssClassRem("expanded");this._target.cssClassAdd("collapsed");this._target.visible(false)}}},_target:null,targetControl:r.Property(null).OnChange(function(W,e){this._target=W;if(e){e.cssClassRem("toggler-controlled");e.cssClassRem("expanded");e.cssClassRem("collapsed")}if(W){W.cssClassAdd("toggler-controlled");this._updateTargetObject()}})});var f=function f(e,W){this.base(this._OnAddNode,this._OnRemoveNode);this._treeOnAddNode=e;this._treeOnRemoveNode=W}.InheritsFrom(r.Collection,{_treeOnAddNode:null,_treeOnRemoveNode:null,_OnAddNode:function(W,e,X){if(!(W instanceof K)){throw new Error("node must be of type TreeNode")}this._treeOnAddNode(W,e,X)},_OnRemoveNode:function(W,e,X){if(!(W instanceof K)){throw new Error("node must be of type TreeNode")}this._treeOnRemoveNode(W,e,X)}});var K=function K(e){this.base();this.Nodes=new f(this._OnAddNode.bind(this),this._OnRemoveNode.bind(this));this.initialiseComponent();this.Set({OnVisibleChange:function(X,W){this._Wrapper.visible(W)}});this._Wrapper.DOMElement.v3FocusableParent=true;this._SetStateClass()}.InheritsFrom(b,{_Wrapper:b().Defaults({cssClass:"node"}),_Item:b().Defaults({cssClass:"item"}),_Trigger:D().Defaults({cssClass:"trigger",visible:false,text:"",OnClick:function(W,X){this.collapsed(!this.collapsed())}}),_SetStateClass:function(){if(this.Nodes.count()==0){this._Wrapper.cssClassRem("expanded");this._Wrapper.cssClassRem("collapsed")}else{if(this.collapsed()){this._Wrapper.cssClassRem("expanded");this._Wrapper.cssClassAdd("collapsed")}else{this._Wrapper.cssClassRem("collapsed");this._Wrapper.cssClassAdd("expanded")}}},Nodes:new f(),collapsed:r.Property(false),parentNode:r.Property(null),_OnAddNode:function(W,e,X){this._Wrapper.Controls.addAt(e+1,W._Wrapper);this._Wrapper.cssClassAdd("has-children");this._Trigger.visible(true);W.parentNode(this);X();this._SetStateClass()},_OnRemoveNode:function(W,e,X){X();this._Wrapper.Controls.remove(W._Wrapper);if(this.Nodes.count()==0){this._Wrapper.cssClassRem("has-children");this._Trigger.visible(false)}this._SetStateClass()},initialiseComponent:function(){this._Wrapper.Insert(this._Item);this._Item.Insert(this._Trigger,this);this.collapsed.OnChange.addEventHandler(function(){this._SetStateClass()}.bind(this));this.DOMElement.tabIndex=-1;this.Set({OnFocus:function(W,X){this._Wrapper.cssClassAdd("focused")},OnUnfocus:function(W,X){this._Wrapper.cssClassRem("focused")},OnMouseEvent:function(W,X){switch(X.Type){case S.DoubleClick:if(X.Target===this||X.Target===this._label){if(this._Trigger.visible()){this.collapsed(!this.collapsed())}X.Event.preventDefault();return false}break}}.bind(this)});this._Wrapper.DOMElement.V3Ctrl=this},text:r.Property("",function y(e){if(this._label){this._label.text(e)}else{this._label=new r.UI.Label().Set({cssClass:"node-label",text:e});this.Controls.add(this._label)}}),getTree:function(){var e=this.parentNode();while(e){if(e instanceof g){return e}else{e=e.parentNode()}}return null},InsertNode:function(Y,X,e){for(var W=0;W<arguments.length;W++){this.Nodes.add(arguments[W])}return this}});var g=function g(){this.base();this.Controls._onAdd=function(W){if(W instanceof K){this._rootNode.Nodes.add(W);return false}};this.rootNode(new K());var e=function(){this.DOMElement.className=this.cssClass()+" "+this._internalCssClasses.toArray().join(" ")}.bind(this);this._internalCssClasses.OnChange.addEventHandler(e);this.cssClass.OnChange.addEventHandler(e);this._internalCssClasses.add("tree-view")}.InheritsFrom(b,{_internalCssClasses:r.Collection(),rootNode:r.Property(function N(){return this._rootNode},function y(W,e){if(e){e._Wrapper.cssClassRem("root");this.Controls.remove(e._Wrapper)}this._rootNode=W;this._rootNode._Wrapper.cssClassAdd("root");this._rootNode.collapsed.OnChange.addEventHandler(function(X){if(X&&!this.showRootTrigger()){this._rootNode.collapsed(false)}}.bind(this));this.Nodes=this._rootNode.Nodes;this.Controls.add(this._rootNode._Wrapper);this._rootNode.parentNode(this)}),showRootNode:r.Property(true,function y(e){if(e){this._internalCssClasses.remove("no-root")}else{this._internalCssClasses.add("no-root",true)}}),showRootTrigger:r.Property(true,function y(e){if(e){this._internalCssClasses.remove("no-root-trigger")}else{this._internalCssClasses.add("no-root-trigger",true)}}),Insert:function(e){throw new Error("Not supported")},InsertNode:function(Y,X,e){for(var W=0;W<arguments.length;W++){this.Nodes.add(arguments[W])}return this}});var v=function v(e){this.base();this.Controls.add(this._btnDelete.Set({OnClick:function(X,Y){this.parentNode().removeExpression(this)}.bind(this)}));if(!e){var W=r.clone({Id:null,IsGroup:false,IsExpression:true,Expression:{}});W.Id=r.newId();this.bind(W)}}.InheritsFrom(K,{_dto:null,_btnDelete:L("x"),bind:function(W){if(!W){throw new Error("objDTO must be an object instance.")}if(W.IsGroup){throw new Error("objDTO must be a object that represents an expression, not a group.")}if(!W.Expression){W.Expression={}}this._dto=W;var e=this.getTree();if(e instanceof w){e.OnBind.fire(this,{dto:W.Expression})}}});var a=function a(W){this.base(true);this.Insert(this._ddlOperator);this._nodeControls.Insert("Add",this._btnAddGroup," or ",this._btnAddNode);this.Controls.remove(this._btnDelete);if(!W){this.Controls.add(this._btnDelete)}var e=r.clone({Id:null,IsGroup:true,Operator:0,Nodes:[]});e.Id=r.newId();this.bind(e);this.InsertNode(this._nodeControls)}.InheritsFrom(v,{_btnAddGroup:L("Group").Defaults({OnClick:function(){this.addGroupNode()}}),_btnAddNode:L("Add").Defaults({OnClick:function(){this.addNode()}}),_nodeControls:K().Defaults({_Wrapper:{cssClassAdd:"controls"}}),_ddlOperator:o({"All must apply":0,"One or more must apply":1}).Defaults({cssClass:"operator"}),_dto:null,bind:function(e){if(!e){throw new Error("objDTO must be set to an object instance in order for data to be bound to it.")}if(e.IsExpression){throw new Error("objDTO must be a object that represents a group, not an expression.")}this._dto=e;this._doBind()},clear:function(){while(this.Nodes.count()>0){if(this.Nodes.get(0) instanceof v){this.removeExpression(this.Nodes.get(0))}else{break}}},_doBind:function(){this.clear();if(!this._dto.IsGroup){throw Error("root node must be a group")}if(!this._dto.Nodes){this._dto.Nodes=[]}this._ddlOperator.bind(this._dto,"Operator");this._dto.Nodes.forEach(function(W,e){if(W.IsGroup){this.addGroupNode(W)}else{this.addNode(W)}}.bind(this))},addGroupNode:function(){var W=new a();this.Nodes.insertBefore(W,this._nodeControls);this.getTree()._onNodeAdded(W);if(arguments.length===1){W.bind(arguments[0])}else{var e=W._dto;W.bind(e);this._dto.Nodes.add(e)}},addNode:function(){var W=new v();this.Nodes.insertBefore(W,this._nodeControls);this.getTree()._onNodeAdded(W);if(arguments.length===1){W.bind(arguments[0])}else{var e=W._dto;W.bind(e);this._dto.Nodes.add(e)}},removeExpression:function(e){this._dto.Nodes.remove(e._dto);this.Nodes.remove(e)}});var w=function w(){this.base();var e=new a(true);this.rootNode(e);setTimeout(function(){this._onNodeAdded(e)}.bind(this),1)}.InheritsFrom(g,{OnBind:r.EventPrototype("node, e:{dto:{}}",{log:V}),OnNodeAdded:r.EventPrototype("sender, e:{Node:TreeNode, IsRoot:Boolean}",{log:V}),_onNodeAdded:function(e){if(e instanceof a){this.OnNodeAdded.fire(this,{Node:e,IsGroupNode:true,Controls:{btnAddGroup:e._btnAddGroup,btnAddNode:e._btnAddNode,btnDelete:e._btnDelete}})}else{if(e instanceof v){this.OnNodeAdded.fire(this,{Node:e,IsRoot:false,IsGroupNode:false,Controls:{btnDelete:e._btnDelete}})}}},bind:r.Property(null,function y(e){this.rootNode().bind(e)})});var t=function t(e,W){this.base(document.createElementNS("http://www.w3.org/2000/svg","svg"));this._DOMDefinitions=document.createElementNS("http://www.w3.org/2000/svg","defs");this.DOMElement.appendChild(this._DOMDefinitions);this._DOMPath=document.createElementNS("http://www.w3.org/2000/svg","path");this.DOMElement.appendChild(this._DOMPath);if(e){this.size(e);this.viewBox(e)}if(R.String(W)){this.path(W)}}.InheritsFrom(x,{_DOMPath:null,lineColor:r.Property(r.Colors.Black).OnChange(function(e){if(!(e instanceof r.Color)){throw new Error("value is not supported")}this._DOMPath.setAttribute("stroke",e)}),lineThickness:r.Property(1).OnChange(function(e){this._DOMPath.setAttribute("stroke-width",e)}),fillColor:r.Property(r.Colors.Black).OnChange(function y(e){if(!(e instanceof r.Color)){throw new Error("value is not supported")}this._DOMPath.setAttribute("fill",e)}),scale:r.Property(null).OnChange(function(e){}),path:r.Property("").OnChange(function(e){this._DOMPath.setAttribute("d",e)}),size:r.Property({width:10,height:10}).OnChange(function(e){this.DOMElement.setAttribute("width",e.width+"px");this.DOMElement.setAttribute("height",e.height+"px")}),viewBox:r.Property({x:0,y:0,width:10,height:10}).OnChange(function(Y,Z){var e=(r.Is.Specified(Y.x)?Y.x:Z.x);var aa=(r.Is.Specified(Y.y)?Y.y:Z.y);var W=(r.Is.Specified(Y.width)?Y.width:Z.width);var X=(r.Is.Specified(Y.height)?Y.height:Z.height);this.DOMElement.setAttribute("viewBox",e+" "+aa+" "+W+" "+X)}),addFilter:function(W){W='<filter id="fid1" xmlns="http://www.w3.org/2000/svg">'+W+"</filter>";var e=(new DOMParser().parseFromString(W,"text/xml"));this._DOMDefinitions.appendChild(e.firstChild);this._DOMPath.setAttribute("filter",'url("#fid1")')}});t.createStar=function(){return new t({width:200,height:200},"m199.200012,76.897453l-67.433075,-9.659958l-30.166931,-60.2375l-30.166458,60.2375l-67.433548,9.659958l48.800003,46.893753l-11.508995,66.208794l60.308998,-31.262497l60.318008,31.262497l-11.518005,-66.208794l48.800003,-46.893753z").Set({lineThickness:5,lineColor:new r.Color(16360478,0),fillColor:new r.Color(16360478,1)})};r.UI.Utils=I;r.UI.MouseEventType=S;r.UI.Control=u;r.UI.ControlCollection=j;r.UI.WebControlBasic=x;r.UI.WebControl=d;r.UI.HyperLink=n;r.UI.Label=D;r.UI.Panel=b;r.UI.Image=M;r.UI.SpriteImage=C;r.UI.DropDownList=o;r.UI.RadioButton=O;r.UI.CheckBox=l;r.UI.Button=L;r.UI.SpriteGrid=T;r.UI.KeyEventType=q;r.UI.TextBox=U;r.UI.Keys=p;r.UI.TreeView=g;r.UI.TreeNode=K;r.UI.ExpressionTreeView=w;r.UI.FormElement=P;r.UI.DateInput=J;r.UI.Popup=m;r.UI.HyperLinkToggle=s;r.UI.SvgSimple=t;r.UI.getV3BodyRoot=c;r.UI.Images={LoadingCircular:M("data:image/png;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQACgABACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkEAAoAAgAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkEAAoAAwAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkEAAoABAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQACgAFACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQACgAGACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAAKAAcALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==").Defaults({cssClass:"loading-image",Style:{borderRadius:"8px",boxShadow:"0px 0px 5px 2px rgba(255,255,255,0.8)"}})};r.EventType.revertDefaultLoggingStatus()}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ V3.RegisterFile('jQuery', 3.006000, function (V3) {
var jqExists = (!!window.jQuery);
/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),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("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
V3.jQuery = (V3 === window.V3 && !jqExists) ? $ : window.jQuery.noConflict(true); //Not calling jQuery.noConflict() is for backward compatibility with old applications using this jQuery resource, ultimately it would be preferred to always call jQuery.noConflict()
}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ V3.RegisterFile('jQuery.UI', 1.013200, [{ Filename: 'jQuery', Version: 3.006000 }], function (V3) {
/*! jQuery UI - v1.13.2 - 2023-01-20
* http://jqueryui.com
* Includes: disable-selection.js, focusable.js, keycode.js, unique-id.js, widgets/datepicker.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(V){"use strict";V.ui=V.ui||{};var e;V.ui.version="1.13.2",V.fn.extend({disableSelection:(e="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(e+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});V.ui.focusable=function(e,t){var a,i,s,n,r=e.nodeName.toLowerCase();return"area"===r?(i=(a=e.parentNode).name,!(!e.href||!i||"map"!==a.nodeName.toLowerCase())&&(0<(i=V("img[usemap='#"+i+"']")).length&&i.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(r)?(s=!e.disabled)&&(n=V(e).closest("fieldset")[0])&&(s=!n.disabled):s="a"===r&&e.href||t,s&&V(e).is(":visible")&&function(e){var t=e.css("visibility");for(;"inherit"===t;)e=e.parent(),t=e.css("visibility");return"visible"===t}(V(e)))},V.extend(V.expr.pseudos,{focusable:function(e){return V.ui.focusable(e,null!=V.attr(e,"tabindex"))}});var t,r;V.ui.focusable,V.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},V.fn.extend({uniqueId:(t=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&V(this).removeAttr("id")})}});function a(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=i(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function i(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",t,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",t,d)}function d(){V.datepicker._isDisabledDatepicker((r.inline?r.dpDiv.parent():r.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function o(e,t){for(var a in V.extend(e,t),t)null==t[a]&&(e[a]=t[a]);return e}V.extend(V.ui,{datepicker:{version:"1.13.2"}}),V.extend(a.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(e,t){var a,i=e.nodeName.toLowerCase(),s="div"===i||"span"===i;e.id||(this.uuid+=1,e.id="dp"+this.uuid),(a=this._newInst(V(e),s)).settings=V.extend({},t||{}),"input"===i?this._connectDatepicker(e,a):s&&this._inlineDatepicker(e,a)},_newInst:function(e,t){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?i(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,t){var a=V(e);t.append=V([]),t.trigger=V([]),a.hasClass(this.markerClassName)||(this._attachments(a,t),a.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(t),V.data(e,"datepicker",t),t.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,t){var a,i=this._get(t,"appendText"),s=this._get(t,"isRTL");t.append&&t.append.remove(),i&&(t.append=V("<span>").addClass(this._appendClass).text(i),e[s?"before":"after"](t.append)),e.off("focus",this._showDatepicker),t.trigger&&t.trigger.remove(),"focus"!==(a=this._get(t,"showOn"))&&"both"!==a||e.on("focus",this._showDatepicker),"button"!==a&&"both"!==a||(i=this._get(t,"buttonText"),a=this._get(t,"buttonImage"),this._get(t,"buttonImageOnly")?t.trigger=V("<img>").addClass(this._triggerClass).attr({src:a,alt:i,title:i}):(t.trigger=V("<button type='button'>").addClass(this._triggerClass),a?t.trigger.html(V("<img>").attr({src:a,alt:i,title:i})):t.trigger.text(i)),e[s?"before":"after"](t.trigger),t.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===e[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==e[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){var t,a,i,s,n,r;this._get(e,"autoSize")&&!e.inline&&(n=new Date(2009,11,20),(r=this._get(e,"dateFormat")).match(/[DM]/)&&(t=function(e){for(s=i=a=0;s<e.length;s++)e[s].length>a&&(a=e[s].length,i=s);return i},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length))},_inlineDatepicker:function(e,t){var a=V(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv),V.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,a,i,s){var n,r=this._dialogInst;return r||(this.uuid+=1,n="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+n+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(r=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",r)),o(r.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(r,t):t,this._dialogInput.val(t),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(n=document.documentElement.clientWidth,i=document.documentElement.clientHeight,t=document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[n/2-100+t,i/2-150+s]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),r.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",r),this},_destroyDatepicker:function(e){var t,a=V(e),i=V.data(e,"datepicker");a.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),V.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),a.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||a.removeClass(this.markerClassName).empty(),r===i&&(r=null,this._curInst=null))},_enableDatepicker:function(t){var e,a=V(t),i=V.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,a=V(t),i=V.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(e){try{return V.data(e,"datepicker")}catch(e){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,a){var i,s,n=this._getInst(e);if(2===arguments.length&&"string"==typeof t)return"defaults"===t?V.extend({},V.datepicker._defaults):n?"all"===t?V.extend({},n.settings):this._get(n,t):null;i=t||{},"string"==typeof t&&((i={})[t]=a),n&&(this._curInst===n&&this._hideDatepicker(),s=this._getDateDatepicker(e,!0),t=this._getMinMaxDate(n,"min"),a=this._getMinMaxDate(n,"max"),o(n.settings,i),null!==t&&void 0!==i.dateFormat&&void 0===i.minDate&&(n.settings.minDate=this._formatDate(n,t)),null!==a&&void 0!==i.dateFormat&&void 0===i.maxDate&&(n.settings.maxDate=this._formatDate(n,a)),"disabled"in i&&(i.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(V(e),n),this._autoSize(n),this._setDate(n,s),this._updateAlternate(n),this._updateDatepicker(n))},_changeDatepicker:function(e,t,a){this._optionDatepicker(e,t,a)},_refreshDatepicker:function(e){e=this._getInst(e);e&&this._updateDatepicker(e)},_setDateDatepicker:function(e,t){e=this._getInst(e);e&&(this._setDate(e,t),this._updateDatepicker(e),this._updateAlternate(e))},_getDateDatepicker:function(e,t){e=this._getInst(e);return e&&!e.inline&&this._setDateFromField(e,t),e?this._getDate(e):null},_doKeyDown:function(e){var t,a,i=V.datepicker._getInst(e.target),s=!0,n=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,V.datepicker._datepickerShowing)switch(e.keyCode){case 9:V.datepicker._hideDatepicker(),s=!1;break;case 13:return(a=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",i.dpDiv))[0]&&V.datepicker._selectDay(e.target,i.selectedMonth,i.selectedYear,a[0]),(t=V.datepicker._get(i,"onSelect"))?(a=V.datepicker._formatDate(i),t.apply(i.input?i.input[0]:null,[a,i])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(e.target,e.ctrlKey?-V.datepicker._get(i,"stepBigMonths"):-V.datepicker._get(i,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(e.target,e.ctrlKey?+V.datepicker._get(i,"stepBigMonths"):+V.datepicker._get(i,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&V.datepicker._clearDate(e.target),s=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&V.datepicker._gotoToday(e.target),s=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,n?1:-1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&V.datepicker._adjustDate(e.target,e.ctrlKey?-V.datepicker._get(i,"stepBigMonths"):-V.datepicker._get(i,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,-7,"D"),s=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,n?-1:1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&V.datepicker._adjustDate(e.target,e.ctrlKey?+V.datepicker._get(i,"stepBigMonths"):+V.datepicker._get(i,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,7,"D"),s=e.ctrlKey||e.metaKey;break;default:s=!1}else 36===e.keyCode&&e.ctrlKey?V.datepicker._showDatepicker(this):s=!1;s&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t,a=V.datepicker._getInst(e.target);if(V.datepicker._get(a,"constrainInput"))return t=V.datepicker._possibleChars(V.datepicker._get(a,"dateFormat")),a=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||a<" "||!t||-1<t.indexOf(a)},_doKeyUp:function(e){e=V.datepicker._getInst(e.target);if(e.input.val()!==e.lastVal)try{V.datepicker.parseDate(V.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,V.datepicker._getFormatConfig(e))&&(V.datepicker._setDateFromField(e),V.datepicker._updateAlternate(e),V.datepicker._updateDatepicker(e))}catch(e){}return!0},_showDatepicker:function(e){var t,a,i,s;"input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=V("input",e.parentNode)[0]),V.datepicker._isDisabledDatepicker(e)||V.datepicker._lastInput===e||(s=V.datepicker._getInst(e),V.datepicker._curInst&&V.datepicker._curInst!==s&&(V.datepicker._curInst.dpDiv.stop(!0,!0),s&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0])),!1!==(a=(i=V.datepicker._get(s,"beforeShow"))?i.apply(e,[e,s]):{})&&(o(s.settings,a),s.lastVal=null,V.datepicker._lastInput=e,V.datepicker._setDateFromField(s),V.datepicker._inDialog&&(e.value=""),V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(e),V.datepicker._pos[1]+=e.offsetHeight),t=!1,V(e).parents().each(function(){return!(t|="fixed"===V(this).css("position"))}),i={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(s),i=V.datepicker._checkOffset(s,i,t),s.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":t?"fixed":"absolute",display:"none",left:i.left+"px",top:i.top+"px"}),s.inline||(a=V.datepicker._get(s,"showAnim"),i=V.datepicker._get(s,"duration"),s.dpDiv.css("z-index",function(e){for(var t,a;e.length&&e[0]!==document;){if(("absolute"===(t=e.css("position"))||"relative"===t||"fixed"===t)&&(a=parseInt(e.css("zIndex"),10),!isNaN(a)&&0!==a))return a;e=e.parent()}return 0}(V(e))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[a]?s.dpDiv.show(a,V.datepicker._get(s,"showOptions"),i):s.dpDiv[a||"show"](a?i:null),V.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),V.datepicker._curInst=s)))},_updateDatepicker:function(e){this.maxRows=4,(r=e).dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var t,a=this._getNumberOfMonths(e),i=a[1],s=e.dpDiv.find("."+this._dayOverClass+" a"),n=V.datepicker._get(e,"onUpdateDatepicker");0<s.length&&d.apply(s.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<i&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"),e.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(t=e.yearshtml,setTimeout(function(){t===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year").first().replaceWith(e.yearshtml),t=e.yearshtml=null},0)),n&&n.apply(e.input?e.input[0]:null,[e])},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(e,t,a){var i=e.dpDiv.outerWidth(),s=e.dpDiv.outerHeight(),n=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,d=document.documentElement.clientWidth+(a?0:V(document).scrollLeft()),o=document.documentElement.clientHeight+(a?0:V(document).scrollTop());return t.left-=this._get(e,"isRTL")?i-n:0,t.left-=a&&t.left===e.input.offset().left?V(document).scrollLeft():0,t.top-=a&&t.top===e.input.offset().top+r?V(document).scrollTop():0,t.left-=Math.min(t.left,t.left+i>d&&i<d?Math.abs(t.left+i-d):0),t.top-=Math.min(t.top,t.top+s>o&&s<o?Math.abs(s+r):0),t},_findPos:function(e){for(var t=this._getInst(e),a=this._get(t,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||V.expr.pseudos.hidden(e));)e=e[a?"previousSibling":"nextSibling"];return[(t=V(e).offset()).left,t.top]},_hideDatepicker:function(e){var t,a,i=this._curInst;!i||e&&i!==V.data(e,"datepicker")||this._datepickerShowing&&(t=this._get(i,"showAnim"),a=this._get(i,"duration"),e=function(){V.datepicker._tidyDialog(i)},V.effects&&(V.effects.effect[t]||V.effects[t])?i.dpDiv.hide(t,V.datepicker._get(i,"showOptions"),a,e):i.dpDiv["slideDown"===t?"slideUp":"fadeIn"===t?"fadeOut":"hide"](t?a:null,e),t||e(),this._datepickerShowing=!1,(e=this._get(i,"onClose"))&&e.apply(i.input?i.input[0]:null,[i.input?i.input.val():"",i]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI&&(V.unblockUI(),V("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){var t;V.datepicker._curInst&&(t=V(e.target),e=V.datepicker._getInst(t[0]),(t[0].id===V.datepicker._mainDivId||0!==t.parents("#"+V.datepicker._mainDivId).length||t.hasClass(V.datepicker.markerClassName)||t.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)&&(!t.hasClass(V.datepicker.markerClassName)||V.datepicker._curInst===e)||V.datepicker._hideDatepicker())},_adjustDate:function(e,t,a){var i=V(e),e=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(e,t,a),this._updateDatepicker(e))},_gotoToday:function(e){var t=V(e),a=this._getInst(t[0]);this._get(a,"gotoCurrent")&&a.currentDay?(a.selectedDay=a.currentDay,a.drawMonth=a.selectedMonth=a.currentMonth,a.drawYear=a.selectedYear=a.currentYear):(e=new Date,a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear()),this._notifyChange(a),this._adjustDate(t)},_selectMonthYear:function(e,t,a){var i=V(e),e=this._getInst(i[0]);e["selected"+("M"===a?"Month":"Year")]=e["draw"+("M"===a?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(i)},_selectDay:function(e,t,a,i){var s=V(e);V(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(s[0])||((s=this._getInst(s[0])).selectedDay=s.currentDay=parseInt(V("a",i).attr("data-date")),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=a,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear)))},_clearDate:function(e){e=V(e);this._selectDate(e,"")},_selectDate:function(e,t){var a=V(e),e=this._getInst(a[0]);t=null!=t?t:this._formatDate(e),e.input&&e.input.val(t),this._updateAlternate(e),(a=this._get(e,"onSelect"))?a.apply(e.input?e.input[0]:null,[t,e]):e.input&&e.input.trigger("change"),e.inline?this._updateDatepicker(e):(this._hideDatepicker(),this._lastInput=e.input[0],"object"!=typeof e.input[0]&&e.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var t,a,i=this._get(e,"altField");i&&(t=this._get(e,"altFormat")||this._get(e,"dateFormat"),a=this._getDate(e),e=this.formatDate(t,a,this._getFormatConfig(e)),V(document).find(i).val(e))},noWeekends:function(e){e=e.getDay();return[0<e&&e<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),e=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((e-t)/864e5)/7)+1},parseDate:function(t,s,e){if(null==t||null==s)throw"Invalid arguments";if(""===(s="object"==typeof s?s.toString():s+""))return null;for(var a,i,n,r=0,d=(e?e.shortYearCutoff:null)||this._defaults.shortYearCutoff,d="string"!=typeof d?d:(new Date).getFullYear()%100+parseInt(d,10),o=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,c=(e?e.dayNames:null)||this._defaults.dayNames,l=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,u=(e?e.monthNames:null)||this._defaults.monthNames,h=-1,p=-1,g=-1,_=-1,f=!1,k=function(e){e=v+1<t.length&&t.charAt(v+1)===e;return e&&v++,e},m=function(e){var t=k(e),t="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,t=new RegExp("^\\d{"+("y"===e?t:1)+","+t+"}"),t=s.substring(r).match(t);if(!t)throw"Missing number at position "+r;return r+=t[0].length,parseInt(t[0],10)},D=function(e,t,a){var i=-1,t=V.map(k(e)?a:t,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(V.each(t,function(e,t){var a=t[1];if(s.substr(r,a.length).toLowerCase()===a.toLowerCase())return i=t[0],r+=a.length,!1}),-1!==i)return i+1;throw"Unknown name at position "+r},y=function(){if(s.charAt(r)!==t.charAt(v))throw"Unexpected literal at position "+r;r++},v=0;v<t.length;v++)if(f)"'"!==t.charAt(v)||k("'")?y():f=!1;else switch(t.charAt(v)){case"d":g=m("d");break;case"D":D("D",o,c);break;case"o":_=m("o");break;case"m":p=m("m");break;case"M":p=D("M",l,u);break;case"y":h=m("y");break;case"@":h=(n=new Date(m("@"))).getFullYear(),p=n.getMonth()+1,g=n.getDate();break;case"!":h=(n=new Date((m("!")-this._ticksTo1970)/1e4)).getFullYear(),p=n.getMonth()+1,g=n.getDate();break;case"'":k("'")?y():f=!0;break;default:y()}if(r<s.length&&(i=s.substr(r),!/^\s+/.test(i)))throw"Extra/unparsed characters found in date: "+i;if(-1===h?h=(new Date).getFullYear():h<100&&(h+=(new Date).getFullYear()-(new Date).getFullYear()%100+(h<=d?0:-100)),-1<_)for(p=1,g=_;;){if(g<=(a=this._getDaysInMonth(h,p-1)))break;p++,g-=a}if((n=this._daylightSavingAdjust(new Date(h,p-1,g))).getFullYear()!==h||n.getMonth()+1!==p||n.getDate()!==g)throw"Invalid date";return n},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,a){if(!e)return"";function i(e,t,a){var i=""+t;if(l(e))for(;i.length<a;)i="0"+i;return i}function s(e,t,a,i){return(l(e)?i:a)[t]}var n,r=(a?a.dayNamesShort:null)||this._defaults.dayNamesShort,d=(a?a.dayNames:null)||this._defaults.dayNames,o=(a?a.monthNamesShort:null)||this._defaults.monthNamesShort,c=(a?a.monthNames:null)||this._defaults.monthNames,l=function(e){e=n+1<t.length&&t.charAt(n+1)===e;return e&&n++,e},u="",h=!1;if(e)for(n=0;n<t.length;n++)if(h)"'"!==t.charAt(n)||l("'")?u+=t.charAt(n):h=!1;else switch(t.charAt(n)){case"d":u+=i("d",e.getDate(),2);break;case"D":u+=s("D",e.getDay(),r,d);break;case"o":u+=i("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=i("m",e.getMonth()+1,2);break;case"M":u+=s("M",e.getMonth(),o,c);break;case"y":u+=l("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?u+="'":h=!0;break;default:u+=t.charAt(n)}return u},_possibleChars:function(t){for(var e="",a=!1,i=function(e){e=s+1<t.length&&t.charAt(s+1)===e;return e&&s++,e},s=0;s<t.length;s++)if(a)"'"!==t.charAt(s)||i("'")?e+=t.charAt(s):a=!1;else switch(t.charAt(s)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":i("'")?e+="'":a=!0;break;default:e+=t.charAt(s)}return e},_get:function(e,t){return(void 0!==e.settings[t]?e.settings:this._defaults)[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var a=this._get(e,"dateFormat"),i=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(a,i,r)||s}catch(e){i=t?"":i}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=i?n.getDate():0,e.currentMonth=i?n.getMonth():0,e.currentYear=i?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(d,e,t){var a,i,e=null==e||""===e?t:"string"==typeof e?function(e){try{return V.datepicker.parseDate(V.datepicker._get(d,"dateFormat"),e,V.datepicker._getFormatConfig(d))}catch(e){}for(var t=(e.toLowerCase().match(/^c/)?V.datepicker._getDate(d):null)||new Date,a=t.getFullYear(),i=t.getMonth(),s=t.getDate(),n=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,r=n.exec(e);r;){switch(r[2]||"d"){case"d":case"D":s+=parseInt(r[1],10);break;case"w":case"W":s+=7*parseInt(r[1],10);break;case"m":case"M":i+=parseInt(r[1],10),s=Math.min(s,V.datepicker._getDaysInMonth(a,i));break;case"y":case"Y":a+=parseInt(r[1],10),s=Math.min(s,V.datepicker._getDaysInMonth(a,i))}r=n.exec(e)}return new Date(a,i,s)}(e):"number"==typeof e?isNaN(e)?t:(a=e,(i=new Date).setDate(i.getDate()+a),i):new Date(e.getTime());return(e=e&&"Invalid Date"===e.toString()?t:e)&&(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)),this._daylightSavingAdjust(e)},_daylightSavingAdjust:function(e){return e?(e.setHours(12<e.getHours()?e.getHours()+2:0),e):null},_setDate:function(e,t,a){var i=!t,s=e.selectedMonth,n=e.selectedYear,t=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=t.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=t.getMonth(),e.drawYear=e.selectedYear=e.currentYear=t.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||a||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(i?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),a="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){V.datepicker._adjustDate(a,-t,"M")},next:function(){V.datepicker._adjustDate(a,+t,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(a)},selectDay:function(){return V.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(a,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,a,i,s,n,r,d,o,c,l,u,h,p,g,_,f,k,m,D,y,v,M,b,w,C,I,x,Y,S,N,T,F,A=new Date,K=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth(),A.getDate())),j=this._get(e,"isRTL"),O=this._get(e,"showButtonPanel"),E=this._get(e,"hideIfNoPrevNext"),L=this._get(e,"navigationAsDateFormat"),R=this._getNumberOfMonths(e),H=this._get(e,"showCurrentAtPos"),A=this._get(e,"stepMonths"),P=1!==R[0]||1!==R[1],W=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),U=this._getMinMaxDate(e,"min"),z=this._getMinMaxDate(e,"max"),B=e.drawMonth-H,J=e.drawYear;if(B<0&&(B+=12,J--),z)for(t=this._daylightSavingAdjust(new Date(z.getFullYear(),z.getMonth()-R[0]*R[1]+1,z.getDate())),t=U&&t<U?U:t;this._daylightSavingAdjust(new Date(J,B,1))>t;)--B<0&&(B=11,J--);for(e.drawMonth=B,e.drawYear=J,H=this._get(e,"prevText"),H=L?this.formatDate(H,this._daylightSavingAdjust(new Date(J,B-A,1)),this._getFormatConfig(e)):H,a=this._canAdjustMonth(e,-1,J,B)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:H}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(j?"e":"w")).text(H))[0].outerHTML:E?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:H}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(j?"e":"w")).text(H))[0].outerHTML,H=this._get(e,"nextText"),H=L?this.formatDate(H,this._daylightSavingAdjust(new Date(J,B+A,1)),this._getFormatConfig(e)):H,i=this._canAdjustMonth(e,1,J,B)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:H}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(j?"w":"e")).text(H))[0].outerHTML:E?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:H}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(j?"w":"e")).text(H))[0].outerHTML,A=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?W:K,A=L?this.formatDate(A,E,this._getFormatConfig(e)):A,H="",e.inline||(H=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(e,"closeText"))[0].outerHTML),L="",O&&(L=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(j?H:"").append(this._isInRange(e,E)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(A):"").append(j?"":H)[0].outerHTML),s=parseInt(this._get(e,"firstDay"),10),s=isNaN(s)?0:s,n=this._get(e,"showWeek"),r=this._get(e,"dayNames"),d=this._get(e,"dayNamesMin"),o=this._get(e,"monthNames"),c=this._get(e,"monthNamesShort"),l=this._get(e,"beforeShowDay"),u=this._get(e,"showOtherMonths"),h=this._get(e,"selectOtherMonths"),p=this._getDefaultDate(e),g="",f=0;f<R[0];f++){for(k="",this.maxRows=4,m=0;m<R[1];m++){if(D=this._daylightSavingAdjust(new Date(J,B,e.selectedDay)),y=" ui-corner-all",v="",P){if(v+="<div class='ui-datepicker-group",1<R[1])switch(m){case 0:v+=" ui-datepicker-group-first",y=" ui-corner-"+(j?"right":"left");break;case R[1]-1:v+=" ui-datepicker-group-last",y=" ui-corner-"+(j?"left":"right");break;default:v+=" ui-datepicker-group-middle",y=""}v+="'>"}for(v+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+y+"'>"+(/all|left/.test(y)&&0===f?j?i:a:"")+(/all|right/.test(y)&&0===f?j?a:i:"")+this._generateMonthYearHeader(e,B,J,U,z,0<f||0<m,o,c)+"</div><table class='ui-datepicker-calendar'><thead><tr>",M=n?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",_=0;_<7;_++)M+="<th scope='col'"+(5<=(_+s+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+r[b=(_+s)%7]+"'>"+d[b]+"</span></th>";for(v+=M+"</tr></thead><tbody>",C=this._getDaysInMonth(J,B),J===e.selectedYear&&B===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,C)),w=(this._getFirstDayOfMonth(J,B)-s+7)%7,C=Math.ceil((w+C)/7),I=P&&this.maxRows>C?this.maxRows:C,this.maxRows=I,x=this._daylightSavingAdjust(new Date(J,B,1-w)),Y=0;Y<I;Y++){for(v+="<tr>",S=n?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(x)+"</td>":"",_=0;_<7;_++)N=l?l.apply(e.input?e.input[0]:null,[x]):[!0,""],F=(T=x.getMonth()!==B)&&!h||!N[0]||U&&x<U||z&&z<x,S+="<td class='"+(5<=(_+s+6)%7?" ui-datepicker-week-end":"")+(T?" ui-datepicker-other-month":"")+(x.getTime()===D.getTime()&&B===e.selectedMonth&&e._keyEvent||p.getTime()===x.getTime()&&p.getTime()===D.getTime()?" "+this._dayOverClass:"")+(F?" "+this._unselectableClass+" ui-state-disabled":"")+(T&&!u?"":" "+N[1]+(x.getTime()===W.getTime()?" "+this._currentClass:"")+(x.getTime()===K.getTime()?" ui-datepicker-today":""))+"'"+(T&&!u||!N[2]?"":" title='"+N[2].replace(/'/g,"&#39;")+"'")+(F?"":" data-handler='selectDay' data-event='click' data-month='"+x.getMonth()+"' data-year='"+x.getFullYear()+"'")+">"+(T&&!u?"&#xa0;":F?"<span class='ui-state-default'>"+x.getDate()+"</span>":"<a class='ui-state-default"+(x.getTime()===K.getTime()?" ui-state-highlight":"")+(x.getTime()===W.getTime()?" ui-state-active":"")+(T?" ui-priority-secondary":"")+"' href='#' aria-current='"+(x.getTime()===W.getTime()?"true":"false")+"' data-date='"+x.getDate()+"'>"+x.getDate()+"</a>")+"</td>",x.setDate(x.getDate()+1),x=this._daylightSavingAdjust(x);v+=S+"</tr>"}11<++B&&(B=0,J++),k+=v+="</tbody></table>"+(P?"</div>"+(0<R[0]&&m===R[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}g+=k}return g+=L,e._keyEvent=!1,g},_generateMonthYearHeader:function(e,t,a,i,s,n,r,d){var o,c,l,u,h,p,g=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),f=this._get(e,"showMonthAfterYear"),k=this._get(e,"selectMonthLabel"),m=this._get(e,"selectYearLabel"),D="<div class='ui-datepicker-title'>",y="";if(n||!g)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(o=i&&i.getFullYear()===a,c=s&&s.getFullYear()===a,y+="<select class='ui-datepicker-month' aria-label='"+k+"' data-handler='selectMonth' data-event='change'>",l=0;l<12;l++)(!o||l>=i.getMonth())&&(!c||l<=s.getMonth())&&(y+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+d[l]+"</option>");y+="</select>"}if(f||(D+=y+(!n&&g&&_?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",n||!_)D+="<span class='ui-datepicker-year'>"+a+"</span>";else{for(r=this._get(e,"yearRange").split(":"),u=(new Date).getFullYear(),h=(k=function(e){e=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?u+parseInt(e,10):parseInt(e,10);return isNaN(e)?u:e})(r[0]),p=Math.max(h,k(r[1]||"")),h=i?Math.max(h,i.getFullYear()):h,p=s?Math.min(p,s.getFullYear()):p,e.yearshtml+="<select class='ui-datepicker-year' aria-label='"+m+"' data-handler='selectYear' data-event='change'>";h<=p;h++)e.yearshtml+="<option value='"+h+"'"+(h===a?" selected='selected'":"")+">"+h+"</option>";e.yearshtml+="</select>",D+=e.yearshtml,e.yearshtml=null}return D+=this._get(e,"yearSuffix"),f&&(D+=(!n&&g&&_?"":"&#xa0;")+y),D+="</div>"},_adjustInstDate:function(e,t,a){var i=e.selectedYear+("Y"===a?t:0),s=e.selectedMonth+("M"===a?t:0),t=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),t=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,t)));e.selectedDay=t.getDate(),e.drawMonth=e.selectedMonth=t.getMonth(),e.drawYear=e.selectedYear=t.getFullYear(),"M"!==a&&"Y"!==a||this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),e=this._getMinMaxDate(e,"max"),t=a&&t<a?a:t;return e&&e<t?e:t},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){e=this._get(e,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,a,i){var s=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(a,i+(t<0?t:s[0]*s[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var a=this._getMinMaxDate(e,"min"),i=this._getMinMaxDate(e,"max"),s=null,n=null,r=this._get(e,"yearRange");return r&&(e=r.split(":"),r=(new Date).getFullYear(),s=parseInt(e[0],10),n=parseInt(e[1],10),e[0].match(/[+\-].*/)&&(s+=r),e[1].match(/[+\-].*/)&&(n+=r)),(!a||t.getTime()>=a.getTime())&&(!i||t.getTime()<=i.getTime())&&(!s||t.getFullYear()>=s)&&(!n||t.getFullYear()<=n)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);t=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),t,this._getFormatConfig(e))}}),V.fn.datepicker=function(e){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var t=Array.prototype.slice.call(arguments,1);return"string"==typeof e&&("isDisabled"===e||"getDate"===e||"widget"===e)||"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+e+"Datepicker"].apply(V.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?V.datepicker["_"+e+"Datepicker"].apply(V.datepicker,[this].concat(t)):V.datepicker._attachDatepicker(this,e)})},V.datepicker=new a,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker});
}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ V3.RegisterFile('jQuery.UI.Uniform', 1.009002, [{ Filename: 'jQuery', Version: 1.007001 }, { Filename: 'jQuery.UI', Version: 1.009002 }], function (V3) {
//DP: modifiedy char position: 2401, was .text(), now .html()
//DP: added 2x: (a.browser&&) because jQuery 3.0 no longer providers .browser[msie] detection.
//DP: was .attr(), now .prop()
(function(a){a.uniform={options:{selectClass:"selector",radioClass:"radio",checkboxClass:"checker",fileClass:"uploader",filenameClass:"filename",fileBtnClass:"action",fileDefaultText:"No file selected",fileBtnText:"Choose File",checkedClass:"checked",focusClass:"focus",disabledClass:"disabled",buttonClass:"button",activeClass:"active",hoverClass:"hover",useID:true,idPrefix:"uniform",resetSelector:false,autoHide:true},elements:[]};if(a.browser&&a.browser.msie&&a.browser.version<7){a.support.selectOpacity=false}else{a.support.selectOpacity=true}a.fn.uniform=function(k){k=a.extend(a.uniform.options,k);var d=this;if(k.resetSelector!=false){a(k.resetSelector).mouseup(function(){function l(){a.uniform.update(d)}setTimeout(l,10)})}function j(l){$el=a(l);$el.addClass($el.prop("type"));b(l)}function g(l){a(l).addClass("uniform");b(l)}function i(o){var m=a(o);var p=a("<div>"),l=a("<span>");p.addClass(k.buttonClass);if(k.useID&&m.prop("id")!=""){p.prop("id",k.idPrefix+"-"+m.prop("id"))}var n;if(m.is("a")||m.is("button")){n=m.text()}else{if(m.is(":submit")||m.is(":reset")||m.is("input[type=button]")){n=m.prop("value")}}n=n==""?m.is(":reset")?"Reset":"Submit":n;l.html(n);m.css("opacity",0);m.wrap(p);m.wrap(l);p=m.closest("div");l=m.closest("span");if(m.is(":disabled")){p.addClass(k.disabledClass)}p.bind({"mouseenter.uniform":function(){p.addClass(k.hoverClass)},"mouseleave.uniform":function(){p.removeClass(k.hoverClass);p.removeClass(k.activeClass)},"mousedown.uniform touchbegin.uniform":function(){p.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"click.uniform touchend.uniform":function(r){if(a(r.target).is("span")||a(r.target).is("div")){if(o[0].dispatchEvent){var q=document.createEvent("MouseEvents");q.initEvent("click",true,true);o[0].dispatchEvent(q)}else{o[0].click()}}}});o.bind({"focus.uniform":function(){p.addClass(k.focusClass)},"blur.uniform":function(){p.removeClass(k.focusClass)}});a.uniform.noSelect(p);b(o)}function e(o){var m=a(o);var p=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){p.hide()}p.addClass(k.selectClass);if(k.useID&&o.prop("id")!=""){p.prop("id",k.idPrefix+"-"+o.prop("id"))}var n=o.find(":selected:first");if(n.length==0){n=o.find("option:first")}l.html(n.html());o.css("opacity",0);o.wrap(p);o.before(l);p=o.parent("div");l=o.siblings("span");o.bind({"change.uniform":function(){l.html(o.find(":selected").html());p.removeClass(k.activeClass)},"focus.uniform":function(){p.addClass(k.focusClass)},"blur.uniform":function(){p.removeClass(k.focusClass);p.removeClass(k.activeClass)},"mousedown.uniform touchbegin.uniform":function(){p.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"click.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"mouseenter.uniform":function(){p.addClass(k.hoverClass)},"mouseleave.uniform":function(){p.removeClass(k.hoverClass);p.removeClass(k.activeClass)},"keyup.uniform":function(){l.text(o.find(":selected").html())}});if(a(o).prop("disabled")){p.addClass(k.disabledClass)}a.uniform.noSelect(l);b(o)}function f(n){var m=a(n);var o=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){o.hide()}o.addClass(k.checkboxClass);if(k.useID&&n.prop("id")!=""){o.prop("id",k.idPrefix+"-"+n.prop("id"))}a(n).wrap(o);a(n).wrap(l);l=n.parent();o=l.parent();a(n).css("opacity",0).bind({"focus.uniform":function(){o.addClass(k.focusClass)},"blur.uniform":function(){o.removeClass(k.focusClass)},"click.uniform touchend.uniform":function(){if(!a(n).prop("checked")){l.removeClass(k.checkedClass)}else{l.addClass(k.checkedClass)}},"mousedown.uniform touchbegin.uniform":function(){o.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){o.removeClass(k.activeClass)},"mouseenter.uniform":function(){o.addClass(k.hoverClass)},"mouseleave.uniform":function(){o.removeClass(k.hoverClass);o.removeClass(k.activeClass)}});if(a(n).prop("checked")){l.addClass(k.checkedClass)}if(a(n).prop("disabled")){o.addClass(k.disabledClass)}b(n)}function c(n){var m=a(n);var o=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){o.hide()}o.addClass(k.radioClass);if(k.useID&&n.prop("id")!=""){o.prop("id",k.idPrefix+"-"+n.prop("id"))}a(n).wrap(o);a(n).wrap(l);l=n.parent();o=l.parent();a(n).css("opacity",0).bind({"focus.uniform":function(){o.addClass(k.focusClass)},"blur.uniform":function(){o.removeClass(k.focusClass)},"click.uniform touchend.uniform":function(){if(!a(n).prop("checked")){l.removeClass(k.checkedClass)}else{var p=k.radioClass.split(" ")[0];a("."+p+" span."+k.checkedClass+":has([name='"+a(n).prop("name")+"'])").removeClass(k.checkedClass);l.addClass(k.checkedClass)}},"mousedown.uniform touchend.uniform":function(){if(!a(n).is(":disabled")){o.addClass(k.activeClass)}},"mouseup.uniform touchbegin.uniform":function(){o.removeClass(k.activeClass)},"mouseenter.uniform touchend.uniform":function(){o.addClass(k.hoverClass)},"mouseleave.uniform":function(){o.removeClass(k.hoverClass);o.removeClass(k.activeClass)}});if(a(n).prop("checked")){l.addClass(k.checkedClass)}if(a(n).prop("disabled")){o.addClass(k.disabledClass)}b(n)}function h(q){var o=a(q);var r=a("<div />"),p=a("<span>"+k.fileDefaultText+"</span>"),m=a("<span>"+k.fileBtnText+"</span>");if(!o.css("display")=="none"&&k.autoHide){r.hide()}r.addClass(k.fileClass);p.addClass(k.filenameClass);m.addClass(k.fileBtnClass);if(k.useID&&o.prop("id")!=""){r.prop("id",k.idPrefix+"-"+o.prop("id"))}o.wrap(r);o.after(m);o.after(p);r=o.closest("div");p=o.siblings("."+k.filenameClass);m=o.siblings("."+k.fileBtnClass);if(!o.prop("size")){var l=r.width();o.prop("size",l/10)}var n=function(){var s=o.val();if(s===""){s=k.fileDefaultText}else{s=s.split(/[\/\\]+/);s=s[(s.length-1)]}p.text(s)};n();o.css("opacity",0).bind({"focus.uniform":function(){r.addClass(k.focusClass)},"blur.uniform":function(){r.removeClass(k.focusClass)},"mousedown.uniform":function(){if(!a(q).is(":disabled")){r.addClass(k.activeClass)}},"mouseup.uniform":function(){r.removeClass(k.activeClass)},"mouseenter.uniform":function(){r.addClass(k.hoverClass)},"mouseleave.uniform":function(){r.removeClass(k.hoverClass);r.removeClass(k.activeClass)}});if(a.browser&&a.browser.msie){o.bind("click.uniform.ie7",function(){setTimeout(n,0)})}else{o.bind("change.uniform",n)}if(o.prop("disabled")){r.addClass(k.disabledClass)}a.uniform.noSelect(p);a.uniform.noSelect(m);b(q)}a.uniform.restore=function(l){if(l==undefined){l=a(a.uniform.elements)}a(l).each(function(){if(a(this).is(":checkbox")){a(this).unwrap().unwrap()}else{if(a(this).is("select")){a(this).siblings("span").remove();a(this).unwrap()}else{if(a(this).is(":radio")){a(this).unwrap().unwrap()}else{if(a(this).is(":file")){a(this).siblings("span").remove();a(this).unwrap()}else{if(a(this).is("button, :submit, :reset, a, input[type='button']")){a(this).unwrap().unwrap()}}}}}a(this).unbind(".uniform");a(this).css("opacity","1");var m=a.inArray(a(l),a.uniform.elements);a.uniform.elements.splice(m,1)})};function b(l){l=a(l).get();if(l.length>1){a.each(l,function(m,n){a.uniform.elements.push(n)})}else{a.uniform.elements.push(l)}}a.uniform.noSelect=function(l){function m(){return false}a(l).each(function(){this.onselectstart=this.ondragstart=m;a(this).mousedown(m).css({MozUserSelect:"none"})})};a.uniform.update=function(l){if(l==undefined){l=a(a.uniform.elements)}l=a(l);l.each(function(){var n=a(this);if(n.is("select")){var m=n.siblings("span");var p=n.parent("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.html(n.find(":selected").html());if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":checkbox")){var m=n.closest("span");var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.removeClass(k.checkedClass);if(n.is(":checked")){m.addClass(k.checkedClass)}if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":radio")){var m=n.closest("span");var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.removeClass(k.checkedClass);if(n.is(":checked")){m.addClass(k.checkedClass)}if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":file")){var p=n.parent("div");var o=n.siblings(k.filenameClass);btnTag=n.siblings(k.fileBtnClass);p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);o.text(n.val());if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":submit")||n.is(":reset")||n.is("button")||n.is("a")||l.is("input[type=button]")){var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}}}}}})};return this.each(function(){if(a.support.selectOpacity){var l=a(this);if(l.is("select")){if(l.prop("multiple")!=true){if(l.prop("size")==undefined||l.prop("size")<=1){e(l)}}}else{if(l.is(":checkbox")){f(l)}else{if(l.is(":radio")){c(l)}else{if(l.is(":file")){h(l)}else{if(l.is(":text, :password, input[type='email']")){j(l)}else{if(l.is("textarea")){g(l)}else{if(l.is("a")||l.is(":submit")||l.is(":reset")||l.is("button")||l.is("input[type=button]")){i(l)}}}}}}}}})}})(V3.jQuery);
}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ 
(function(V3){
var serviceName="EntityService";
var serverTimeOffset=0;
if(!V3.WebServices){V3.WebServices={__namespace:true};}
if(!V3.WebServices[serviceName]){ V3.WebServices[serviceName]={__class:true, __static: true};}
(function(objTarget){
function doCall(url, webMethodName, args, onSuccess, onError){
  var notifiedApplication = false;
  var timeOffset;

  function success(parsedObj, httpStatusCode){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
      onSuccess(parsedObj, {httpStatusCode:httpStatusCode, xhr: this});
    }
  }

  function error(parsedObj, httpStatusCode, isParseException){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
  
      var e = {
        xhr: this,
        isParseException: !!isParseException,
        isServerException: !!(!isParseException && parsedObj && parsedObj.Type),
        response: parsedObj,
        toString: function(){
          if(this.isServerException){
            var ex = this.response;
            return ex.Type + ': ' + ex.Message + '\r\n' + ex.StackTrace;
          } else if (this.isParseException) {
            return 'Unable to parse JSON: ' + this.xhr.responseText;
          } else {
            return this.message;
          }
        }
      };

      if (e.isServerException) {
          e.message = (parsedObj.Type + ': ' + parsedObj.Message);
      } else if (e.isParseException) {
          e.message = 'Parse error: ' + parsedObj;
      } else {
          e.message = 'HttpCode: ' + this.statusText;
      }

      eval('debugger //webMethodError, http code: ' + httpStatusCode + ', Is Parse Exception: ' + isParseException);
      if(window.V3 && window.V3.Log && window.V3.Log.Error) { 
        V3.Log.Error('Error while calling Web Method ' + webMethodName + ' on URL: ' + url, 'e', e); 
      }
      onError(e);
    }
  }
  
  function jsonReviver(k, v){
    if (typeof v === 'string' && v.substr(0, 6) === '/Date(') { 
        return new Date(parseInt(v.substr(6, v.length - 8), 10) + timeOffset);
    }
    return v;
  }

  var aborting = false;
  var connector;
  var onLoadCallback = function(connectorState, httpStatusCode){
    if(connectorState == 4){ //DONE and HTTP_OK
      var parsedObj = null;
      if(!aborting && httpStatusCode < 100){
        if (httpStatusCode==0) {
           error.call(this, new Error('Unsent, maybe error with CORS or connection timed out without sending (ie browser limited to 2 connections per origin and both choked all subsequent requests)'), httpStatusCode);
        } else if(httpStatusCode==1) {
           error.call(this, new Error('Connection was Opened but an error occurred'), httpStatusCode);
        } else if(httpStatusCode==2) {
          error.call(this, new Error('Headers were received, but an error occurred.'), httpStatusCode);
        } else{
          error.call(this, new Error('Unknown error'), httpStatusCode);
        }
        return;
      }
      try {
          var localTimeOffset = -(new Date()).getTimezoneOffset() * 60 * 1000;
          timeOffset = (serverTimeOffset - localTimeOffset);
          parsedObj = JSON.parse(this.responseText||'',jsonReviver);
      } catch(exception) {
          if(!aborting){
            error.call(this, exception, httpStatusCode, true);
            return;
          }
      }

      if(aborting){
        if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
          window.V3.Log.Warn('Aborting web service request.','details', {'arguments':args, 'responseText':this.responseText, 'parsedResponse': parsedObj, 'xhr': connector}, true);
        }
        return;
      }
      
      if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
        window.V3.Log.Info('RECEIVED ' + (this.responseText||'').length.toLocaleString() + 'chars from: ' + url,'parsedObj', parsedObj);
      }

      if(httpStatusCode === 200){
        success.call(this, parsedObj.hasOwnProperty('d') ? parsedObj.d : parsedObj, httpStatusCode);
      } else {
        error.call(this, parsedObj, httpStatusCode, false);
      }
    }
  };
  

  if (window.XDomainRequest && navigator.userAgent.match(/MSIE 9\./)) {
    connector = new XDomainRequest();
    connector.contentType = 'text/plain';
    connector.onload = function(){ onLoadCallback.call(this, 4, 200); };
    connector.onprogress = function(){}; 
    connector.open('POST', url, true);
  } else {
    connector = new XMLHttpRequest();
    connector.onreadystatechange = function(){ onLoadCallback.call(this, this.readyState, this.status); }
    connector.open('POST', url, true);
    connector.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
    connector.setRequestHeader('Accept', 'application/json; charset=utf-8');
  }
  connector.timeout=timeoutValue;
  connector.ontimeout=function(){ error.call(this, new Error('timed-out')); };
  connector.onerror =function(e){ error.call(this, e||event); };

  var json=JSON.stringify(args);

  if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
    window.V3.Log.Info('SEND ' + json.length.toLocaleString() + 'chars to: ' + url,'args', args);
  }

  connector.send(json);
  
  return {
    xhr: connector,
    abort: function(){
      aborting = true;
      this.xhr.abort();
    }
  };
}
var timeoutValue=120000;
objTarget.Search=function(onSuccess, onError) { 

  var overload=objTarget['_Search' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method Search where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._Search1=function(onSuccess, onError, request) {
var dto={'request':request};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/Search?";
return doCall(url, "Search", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetCampaigns=function(onSuccess, onError) { 

  var overload=objTarget['_GetCampaigns' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetCampaigns where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetCampaigns1=function(onSuccess, onError, request) {
var dto={'request':request};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/GetCampaigns?";
return doCall(url, "GetCampaigns", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetChildLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetChildLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetChildLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetChildLocations1=function(onSuccess, onError, parentLocationId) {
var dto={'parentLocationId':parentLocationId};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/GetChildLocations?";
return doCall(url, "GetChildLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetPrimaryLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetPrimaryLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetPrimaryLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetPrimaryLocations1=function(onSuccess, onError, types) {
var dto={'types':types};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/GetPrimaryLocations?";
return doCall(url, "GetPrimaryLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.QuickSearch=function(onSuccess, onError) { 

  var overload=objTarget['_QuickSearch' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method QuickSearch where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._QuickSearch1=function(onSuccess, onError, rq) {
var dto={'rq':rq};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/QuickSearch?";
return doCall(url, "QuickSearch", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.FindLocationByOldRegionIds=function(onSuccess, onError) { 

  var overload=objTarget['_FindLocationByOldRegionIds' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method FindLocationByOldRegionIds where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._FindLocationByOldRegionIds1=function(onSuccess, onError, regionIds) {
var dto={'regionIds':regionIds};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/FindLocationByOldRegionIds?";
return doCall(url, "FindLocationByOldRegionIds", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetAccreditations=function(onSuccess, onError) { 

  var overload=objTarget['_GetAccreditations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetAccreditations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetAccreditations0=function(onSuccess, onError) {
var dto={};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/GetAccreditations?";
return doCall(url, "GetAccreditations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetMetadata=function(onSuccess, onError) { 

  var overload=objTarget['_GetMetadata' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetMetadata where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetMetadata1=function(onSuccess, onError, request) {
var dto={'request':request};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/GetMetadata?";
return doCall(url, "GetMetadata", dto, onSuccess, onError);
};
})(V3.WebServices[serviceName]);
})(V3);
 })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ 
(function(V3){
var serviceName="LocationService";
var serverTimeOffset=0;
if(!V3.WebServices){V3.WebServices={__namespace:true};}
if(!V3.WebServices[serviceName]){ V3.WebServices[serviceName]={__class:true, __static: true};}
(function(objTarget){
function doCall(url, webMethodName, args, onSuccess, onError){
  var notifiedApplication = false;
  var timeOffset;

  function success(parsedObj, httpStatusCode){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
      onSuccess(parsedObj, {httpStatusCode:httpStatusCode, xhr: this});
    }
  }

  function error(parsedObj, httpStatusCode, isParseException){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
  
      var e = {
        xhr: this,
        isParseException: !!isParseException,
        isServerException: !!(!isParseException && parsedObj && parsedObj.Type),
        response: parsedObj,
        toString: function(){
          if(this.isServerException){
            var ex = this.response;
            return ex.Type + ': ' + ex.Message + '\r\n' + ex.StackTrace;
          } else if (this.isParseException) {
            return 'Unable to parse JSON: ' + this.xhr.responseText;
          } else {
            return this.message;
          }
        }
      };

      if (e.isServerException) {
          e.message = (parsedObj.Type + ': ' + parsedObj.Message);
      } else if (e.isParseException) {
          e.message = 'Parse error: ' + parsedObj;
      } else {
          e.message = 'HttpCode: ' + this.statusText;
      }

      eval('debugger //webMethodError, http code: ' + httpStatusCode + ', Is Parse Exception: ' + isParseException);
      if(window.V3 && window.V3.Log && window.V3.Log.Error) { 
        V3.Log.Error('Error while calling Web Method ' + webMethodName + ' on URL: ' + url, 'e', e); 
      }
      onError(e);
    }
  }
  
  function jsonReviver(k, v){
    if (typeof v === 'string' && v.substr(0, 6) === '/Date(') { 
        return new Date(parseInt(v.substr(6, v.length - 8), 10) + timeOffset);
    }
    return v;
  }

  var aborting = false;
  var connector;
  var onLoadCallback = function(connectorState, httpStatusCode){
    if(connectorState == 4){ //DONE and HTTP_OK
      var parsedObj = null;
      if(!aborting && httpStatusCode < 100){
        if (httpStatusCode==0) {
           error.call(this, new Error('Unsent, maybe error with CORS or connection timed out without sending (ie browser limited to 2 connections per origin and both choked all subsequent requests)'), httpStatusCode);
        } else if(httpStatusCode==1) {
           error.call(this, new Error('Connection was Opened but an error occurred'), httpStatusCode);
        } else if(httpStatusCode==2) {
          error.call(this, new Error('Headers were received, but an error occurred.'), httpStatusCode);
        } else{
          error.call(this, new Error('Unknown error'), httpStatusCode);
        }
        return;
      }
      try {
          var localTimeOffset = -(new Date()).getTimezoneOffset() * 60 * 1000;
          timeOffset = (serverTimeOffset - localTimeOffset);
          parsedObj = JSON.parse(this.responseText||'',jsonReviver);
      } catch(exception) {
          if(!aborting){
            error.call(this, exception, httpStatusCode, true);
            return;
          }
      }

      if(aborting){
        if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
          window.V3.Log.Warn('Aborting web service request.','details', {'arguments':args, 'responseText':this.responseText, 'parsedResponse': parsedObj, 'xhr': connector}, true);
        }
        return;
      }
      
      if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
        window.V3.Log.Info('RECEIVED ' + (this.responseText||'').length.toLocaleString() + 'chars from: ' + url,'parsedObj', parsedObj);
      }

      if(httpStatusCode === 200){
        success.call(this, parsedObj.hasOwnProperty('d') ? parsedObj.d : parsedObj, httpStatusCode);
      } else {
        error.call(this, parsedObj, httpStatusCode, false);
      }
    }
  };
  

  if (window.XDomainRequest && navigator.userAgent.match(/MSIE 9\./)) {
    connector = new XDomainRequest();
    connector.contentType = 'text/plain';
    connector.onload = function(){ onLoadCallback.call(this, 4, 200); };
    connector.onprogress = function(){}; 
    connector.open('POST', url, true);
  } else {
    connector = new XMLHttpRequest();
    connector.onreadystatechange = function(){ onLoadCallback.call(this, this.readyState, this.status); }
    connector.open('POST', url, true);
    connector.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
    connector.setRequestHeader('Accept', 'application/json; charset=utf-8');
  }
  connector.timeout=timeoutValue;
  connector.ontimeout=function(){ error.call(this, new Error('timed-out')); };
  connector.onerror =function(e){ error.call(this, e||event); };

  var json=JSON.stringify(args);

  if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
    window.V3.Log.Info('SEND ' + json.length.toLocaleString() + 'chars to: ' + url,'args', args);
  }

  connector.send(json);
  
  return {
    xhr: connector,
    abort: function(){
      aborting = true;
      this.xhr.abort();
    }
  };
}
var timeoutValue=120000;
objTarget.GetPrimaryLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetPrimaryLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetPrimaryLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetPrimaryLocations1=function(onSuccess, onError, types) {
var dto={'types':types};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/GetPrimaryLocations?";
return doCall(url, "GetPrimaryLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetChildLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetChildLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetChildLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetChildLocations1=function(onSuccess, onError, parentLocationId) {
var dto={'parentLocationId':parentLocationId};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/GetChildLocations?";
return doCall(url, "GetChildLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.FindNearbyLocations=function(onSuccess, onError) { 

  var overload=objTarget['_FindNearbyLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method FindNearbyLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._FindNearbyLocations4=function(onSuccess, onError, latLng, locType, parentLocationId, maxNumber) {
var dto={'latLng':latLng,'locType':locType,'parentLocationId':parentLocationId,'maxNumber':maxNumber};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/FindNearbyLocations?";
return doCall(url, "FindNearbyLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.CreateNewLocations=function(onSuccess, onError) { 

  var overload=objTarget['_CreateNewLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method CreateNewLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._CreateNewLocations1=function(onSuccess, onError, locations) {
var dto={'locations':locations};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/CreateNewLocations?";
return doCall(url, "CreateNewLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.UpdateLocations=function(onSuccess, onError) { 

  var overload=objTarget['_UpdateLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method UpdateLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._UpdateLocations1=function(onSuccess, onError, locations) {
var dto={'locations':locations};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/UpdateLocations?";
return doCall(url, "UpdateLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.DeleteLocations=function(onSuccess, onError) { 

  var overload=objTarget['_DeleteLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method DeleteLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._DeleteLocations1=function(onSuccess, onError, strLocationIds) {
var dto={'strLocationIds':strLocationIds};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/DeleteLocations?";
return doCall(url, "DeleteLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.Search=function(onSuccess, onError) { 

  var overload=objTarget['_Search' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method Search where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._Search1=function(onSuccess, onError, rq) {
var dto={'rq':rq};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/Search?";
return doCall(url, "Search", dto, onSuccess, onError);
};
})(V3.WebServices[serviceName]);
})(V3);
 })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.API.EntityService",1,["V3.Utils","V3.CABS.UI.Common"],function(){V3.Namespace("API");var a=function a(d){if(d&&d._EntityServiceProxy){return d._EntityServiceProxy}this.base();this.OnLoad.addEventHandler(function(){this.IsLoaded=true;if(this._errorTimerId){clearTimeout(this._errorTimerId)}}.bind(this));if(window.vsDesignTime&&!d){d=window.getProviderSearchControlDefaultSettings().GlobalSettings.EntityServiceApiSettings}d._EntityServiceProxy=this;var c=d.EndPoint;this._shortname=d.Shortname;c=c||"http://localhost/CABS4/Services/EntityService.asmx";if(V3.WebServices&&V3.WebServices.EntityService){this.OnLoad.fire()}else{var b=c+"/GetJavascript";V3.Dynamic.LoadScript("EntityWebService",b,this._loadedCallback.bind(this));this._errorTimerId=setTimeout(this._loadTimeout.bind(this),5000)}}.InheritsFrom(V3.Class,{OnLoad:new V3.EventType(null,"",true),IsLoaded:false,_loadedCallback:function(b){this.OnLoad.fire()},_errorTimerId:null,_loadTimeout:function(){V3.Log.Error("BookingWebService API load has timed out.","instance",this)},Search:function(e,d,c){e=this._searchResponseSuccess.bind(this,e);d=this._searchResponseFailure.bind(this,d);var b={abort:function(){b._abortPending=true;if(b._wsRet){b._wsRet.abort()}},xhr:null};this.OnLoad.addEventHandler(function(){if(!c.Shortname){c.Shortname=this._shortname}if(!c.Language){c.Language=V3.CultureInfo.currentUICulture().name()}if(!b._abortPending){b._wsRet=V3.WebServices.EntityService.Search(e,d,c);b.xhr=b._wsRet.xhr}}.bind(this));return b},_searchResponseSuccess:function(c,b){if(b&&b.Entities&&b.Entities.length){V3.forEach(b.Entities,function(d){if(b.Parents&&d.ParentId){d.Parent=b.Parents[d.ParentId]}if(d.Settings&&d.Settings.Terminology){if(d.Children&&d.Children.length){V3.forEach(d.Children,function(e){e.Settings=V3.extend(e.Settings||{},false,d.Settings)})}}})}c(b)},_searchResponseFailure:function(c,b){V3.Log.Error("Failed to invoke EntityService.Search()","response",b);c(b)},FindServicesByProviderShortname:function(f,d,c,b,e){return this.FindServicesByProviderShortnames(f,d,[c],b,e)},FindServicesByProviderShortnames:function(g,e,b,d,f){if(!b||b.length==0){throw new Error("providerShortnames must be specified")}if(!d){d={}}if(!f){f={}}var c={TransactionId:V3.newId(),CurrentCurrency:V3.CultureInfo.currentUICulture().currencyISOAbbreviation(),Language:V3.CultureInfo.currentUICulture().name(),Campaign:d.Campaign,Filter:{Codes:b,Type:V3.CABS.EntityTypeEnum.Provider},Output:{Children:{Filter:d.ServiceFilter,Output:V3.extend(f.ServiceOutput,true,{Children:{Filter:d.ProductFilter,Output:f.ProductOutput}})}}};return this.Search(function(h){var i=[];h.Entities.forEach(function(j){i.addRange(j.Children)});h.Entities=i;g(h)},e,c)},GetServicesByIds:function(f,e,c,d){if(!c||c.length==0){throw new Error("ids must be specified")}if(!d){d={}}var b={Campaign:d.Campaign,Filter:{Ids:c,Type:V3.CABS.EntityTypeEnum.Service,TagCriteria:!d.IndustryCategoryGroup?null:{IndustryCategoryGroups:[d.IndustryCategoryGroup]}},Output:{Output:{Children:{Filter:d.ProductFilter}}}};return this.Search(function(g){f(g)},e,b)},GetServicesByCodes:function(f,e,b,d){if(!b||b.length==0){throw new Error("codes must be specified")}if(!d){d={}}var c={Campaign:d.Campaign,Filter:{Codes:b,Type:V3.CABS.EntityTypeEnum.Service,TagCriteria:!d.IndustryCategoryGroup?null:{IndustryCategoryGroups:[d.IndustryCategoryGroup]}},Output:{Output:{Children:{Filter:d.ProductFilter}}}};return this.Search(function(g){f(g)},e,c)},FindServicesByPartnerShortname:function(f,d,e,c){if(!e){throw new Error("partnerShortname must be specified")}if(!c){c={}}var b={Campaign:c.Campaign,Filter:{Codes:[e],Type:V3.CABS.EntityTypeEnum.Partner},Output:{Children:{Filter:{TagCriteria:!c.IndustryCategoryGroup?null:{IndustryCategoryGroups:[c.IndustryCategoryGroup]}},Output:{Children:{Filter:c.ProductFilter}}}}};return this.Search(function(g){var h=[];g.Entities.forEach(function(i){h.addRange(i.Children)});g.Entities=h;f(g)},d,b)}});V3.API.EntityWebService=a}); })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.CABS.UI.Common",1,["V3.Utils","V3.UI"],function(){var Q=false,p=false,r=false;if(V3.debugMode){Q=V3.debuggingEnabledFor("ccui");p=V3.debuggingEnabledFor("getterm");r=V3.debuggingEnabledFor("restext")}V3.EventType.setDefaultLoggingStatus(Q);var E=V3.Enum({Accommodation:0,Activity:1,Epicurean:2,Shopping:3,Transportation:4});var F=V3.Enum({Accommodation:0,Tours:1,Events:2,Attractions:3,NonServicedAccommodation:4,Restaurant:5,Good:6,Flights:7});var w=V3.Enum({Accommodation:0,Activities:1,Epicurean:2,Shopping:3,Transportation:4});var I=V3.Enum({NoMerge:0,LowestRate:1,LowestRateForCampaign:2});F.prototype.toGroup=function(){switch(this){case F.Accommodation:return E.Accommodation;case F.NonServicedAccommodation:return E.Accommodation;case F.Tours:return E.Activity;case F.Events:return E.Activity;case F.Attractions:return E.Activity;case F.Restaurant:return E.Epicurean;case F.Good:return E.Shopping;case F.Flights:return E.Transportation;default:throw new Error("Unrecognised value")}};var G=V3.Enum({Partner:1,Provider:2,Service:3,Product:4});var D=V3.Enum({Country:10,State:20,Region:30,City:40,Landmark:50});var e=function(R,S){if(!this._pfId){this._pfId=V3.newId();$.fn.prettyPhoto(this._pfId,{opacity:0.4,default_width:800,default_height:344,theme:"V3",allow_resize:true,horizontal_padding:30,modal:false,social_tools:false,inline_markup:'<div class="pp_inline"><div id="tempLightbox">{content}</div></div>'})}$.prettyPhoto.open(R)};var J={ICGAccommodation:"Accommodation",ICGActivity:"Activities",ICGEpicurean:"Epicurean",ICGShopping:"Shopping",ICGTransportation:"Transportation",Business:"Provider",Destination:"Destination",Product:"Product",Products:"Products",Nights:"Nights",DateCommencing:"Commencing",DateConcluding:"Concluding",TimeCheckIn:"Check-In",TimeCheckOut:"Check-Out",Guests:"Guests",GuestAdults:"Adults",GuestChildren:"Children",GuestSeniors:"Seniors"};var j=function(S){if(S){for(var R in J){if(V3.Is.String(S[R])){J[R]=S[R]}}}};var C=function(S){if(!S){S={};V3.Object.addField(S,"___copyOfDefault",true,true)}for(var R in J){if(!V3.Is.String(S[R])){S[R]=J[R]}}return S};var H=V3.Class();H.ProcessPlaceholders=function(V,T){for(var S in T){var R=RegExp.escape(S);var U=new RegExp(R,"g");if(r){V=V.replace(U,S.substr(0,S.length-1)+"="+T[S]+S.substr(S.length-1))}else{V=V.replace(U,T[S])}}return V};H.TryAbbreviateStateName=function(R){switch(R.toLowerCase()){case"south australia":return"SA";case"queensland":return"Qld";case"australian capital territory":return"ACT";case"northern territory":return"NT";case"tasmania":return"Tas";case"victoria":return"Vic";case"western australia":return"WA";case"new south wales":return"NSW";default:return R}};H.GetCssClassNameFromEnum=function(R){if(!V3.Is.Specified(R)){throw new Error("e must be specified")}switch(R){case E.Accommodation:return"icg-accommodation";case E.Activity:return"icg-activity";case E.Epicurean:return"icg-epicurean";case E.Shopping:return"icg-shopping";case E.Transportation:return"icg-transportation";case F.Accommodation:return"ic-accommodation";case F.NonServicedAccommodation:return"ic-accommodation";case F.Tours:return"ic-tour";case F.Events:return"ic-event";case F.Attractions:return"ic-attraction";case F.Restaurant:return"ic-restaurant";case F.Good:return"ic-good";case F.Flights:return"ic-flights";case G.Service:return"type-service";case G.Product:return"type-product";case G.Provider:return"type-business";case G.Partner:return"type-partner";case D.Country:return"location";case D.State:return"location";case D.Region:return"location";case D.City:return"location";case D.Landmark:return"landmark";default:return null}};H.IsValidEntityCode=function(R){return(R&&V3.Is.String(R)&&R.indexOf(" ")==-1&&R.indexOf(".")&&R.indexOf("/")&&R.indexOf("\\")==-1)};H.GetTerm=function(S,R){var T=null;if(R&&R!==J&&!R.___copyOfDefault&&V3.Is.String(R[S])){T=R[S];if(p){T="gt[c:"+T+"]"}}else{if(V3.Res&&V3.Res["Terms."+S]){T=V3.Res["Terms."+S];if(p){T="gt[r:"+T+"]"}}else{T=J[S];if(p){T="gt[d:"+T+"]"}}}return T};H._getDefaultTerminology=C;H.ConvertTxCurrencyToDisplayCurrency=function(S,R,T){if(R==_DisplayCurrencyCode){return S}return(S*T)*_DisplayCurrencyConversionCoefficient};var O=V3.Is;var P=function P(R){this.base("ul","tabs");if(R){V3.forEach(R,this,function(T,S){this.addTab(T)})}}.InheritsFrom(V3.UI.WebControlBasic,{OnTabClicked:V3.EventPrototype("sender, e:{tab:Control, index:clickedTabIndex, currentIndex: tabIndex, changingTabs: true}"),OnSelectedTabIndexChanged:V3.EventPrototype("sender, e:{tab:Control, index: 0}"),selectedTabIndex:V3.Property(-1).OnChange(function(R){this._selectTab(R)}),selectedTabName:V3.Property(function M(){if(!this._currentTab){return null}return this._currentTab.name()},function t(R){this.Controls.forEach(function(T,S){if(T.name().toLowerCase()==R.toLowerCase()){this.selectedTabIndex(S);return false}}.bind(this))}),_currentTab:null,_selectTab:function(S){var R;if(O.Number(S)){R=this.Controls.get(S)}else{R=S;S=this.Controls.indexOf(R)}var T=null;if(this._currentTab){this._currentTab._cssClassAdd(true,"unselected");this._currentTab._cssClassRem(true,"selected");if(this._currentTab.AssociatedControl){this._currentTab.AssociatedControl.visible(false)}T=this._currentTab}this._currentTab=R;this._currentTab._cssClassAdd(true,"selected");this._currentTab._cssClassRem(true,"unselected");if(T&&O.Function(T.OnDeselected)){T.OnDeselected()}if(O.Function(this._currentTab.OnSelected)){this._currentTab.OnSelected()}if(this._currentTab.AssociatedControl){this._currentTab.AssociatedControl.visible(true)}this.OnSelectedTabIndexChanged.fire(this,{tab:R,index:S,tabName:R.name(),previousTab:T})},_onChangeFire:function(R){if(!R.enabled()){return}var T=this.Controls.indexOf(R);var S=this.selectedTabIndex();this.selectedTabIndex(T);this.OnTabClicked.fire(this,{tab:R,tabIndex:T,currentIndex:S,changingTabs:(T!=S),tabName:R.name()})},addTab:function(Z,V,T,U,W){if(arguments.length===1&&arguments[0]&&typeof arguments[0]==="object"){var aa=arguments[0];return this.addTab(O.String(aa)?aa:(aa.name||aa.toString()),aa.control,aa.onSelected,aa.onDeselected,aa.enabled)}var R=new V3.UI.HyperLink("","");var Y=new V3.UI.WebControl("li");Y.cssClass("tab");Y.OnSelected=T;Y.OnDeselected=U;Y.Insert(R);Y.name=R.text.bind(R);Y.name(Z);Y.enabled(W!==false);Y.selected=new V3.Property(this,function S(){return this._currentTab===Y},function X(ab){this.selectedTabIndex(Y.index)});if(V){V.visible(false);Y.AssociatedControl=V}R.OnClick.addEventHandler(function(ac,ab){this._onChangeFire(Y)}.bind(this));Y.index=this.Controls.count();this.Controls.add(Y);setTimeout(function(){if(this.selectedTabIndex()==-1){this.Controls.forEach(function(ab){if(ab.enabled()){ab.selected(true);return false}})}}.bind(this),0);return Y},addTabWithRadio:function(R,ab,W,U,V,X){if(arguments.length===1&&arguments[0]&&typeof arguments[0]==="object"){var ac=arguments[0];return this.addTabWithRadio(O.String(ac)?ac:(ac.name||ac.toString()),O.String(ac)?ac:(ac.text||ac.toString()),ac.control,ac.onSelected,ac.onDeselected,ac.enabled)}var S=new V3.UI.HyperLink("","");var aa=new V3.UI.WebControl("li");var Y=new V3.UI.RadioButton(R).Set({cssClass:"form-check-input"});S.Insert(Y,new V3.UI.Label().Set({text:ab}));if(R=="viewByOption"){aa.cssClass("col-lg-6 col-md-6 col-sm-6 col-6 col-xs-6 tab")}else{aa.cssClass("col-lg-2 col-md-2 col-sm-6 col-6 col-xs-6 tabsearchvaluefont tab")}aa.OnSelected=U;aa.OnDeselected=V;aa.Insert(S);aa.name=S.text.bind(S);aa.enabled(X!==false);aa.selected=new V3.Property(this,function T(){return this._currentTab===aa},function Z(ad){this.selectedTabIndex(aa.index)});if(W){W.visible(false);aa.AssociatedControl=W}S.OnClick.addEventHandler(function(ae,ad){Y.selected(true);this._onChangeFire(aa)}.bind(this));Y.OnClick.addEventHandler(function(ae,ad){this._onChangeFire(aa)}.bind(this));aa.index=this.Controls.count();this.Controls.add(aa);setTimeout(function(){if(this.selectedTabIndex()==-1){this.Controls.forEach(function(ad){if(ad.enabled()){ad.selected(true);if(ad.DOMElement.children.length>0){if(ad.DOMElement.children[0].children.length>0){ad.DOMElement.children[0].children[0].checked=true}}return false}})}}.bind(this),0);return aa},removeTab:function(R){throw new Error("Not supported yet.")}});var m=function m(R){this.base("accreditation-display");this.Insert(this.lblValue,this.lblScheme);this._canBeVisible(false);this.accreditation(R);this.showLarge(false)}.InheritsFrom(V3.UI.Panel,{lblValue:V3.UI.Label(),lblScheme:V3.UI.Label().Defaults({cssClass:"scheme"}),accreditation:V3.Property(null).OnChange(function u(S,R){this._canBeVisible(!!S);if(S){if(R){this._cssClassRem(true,R.SchemeCode.toLowerCase())}this._cssClassAdd(true,S.SchemeCode.toLowerCase());this.tooltip(S.SchemeName+": "+S.ValueName);this.lblValue.text(S.ValueName);this.lblValue.cssClass("value V"+S.NumericValue.toDecimal(4).replace(".","_"));this.lblScheme.text(S.SchemeName)}}),showLarge:V3.Property(true).OnChange(function(R){this._cssClassToggle(true,R,"large","small")})});var g=function g(){this.base("display-images");this.OnVisibleChange.addEventHandler(function(){this._configureCycleTimer()});this.enableLightBox(true);this.preferredSize(640);this._timerOffset=Math.random()*800}.InheritsFrom(V3.UI.Panel,{Images:V3.Collection(function s(T,R,U){U();var S=this.maxVisibleImages();if(S==0||this._visibleImageCount<S){this._addImageToUI(T)}this._configureCycleTimer()},function l(T,R,U){U();this._remImageFromUI(T);if(this.Images.count()>0){var S=this.maxVisibleImages();if(this._visibleImageCount<S&&this._visibleImageCount<this.Images.count()){this.refresh()}}this._configureCycleTimer()}).InjectOwner(),enableLightBox:V3.Property(false).OnChange(function(S,R){if(S){this._cssClassAdd(true,"light-box-enabled")}else{this._cssClassRem(true,"light-box-enabled")}}),maxVisibleImages:V3.Property(0).OnChange(function(S,R){this._cssClassRem(true,"max-visible-"+R);this._cssClassAdd(true,"max-visible-"+S);this.refresh()}),preferredSize:V3.Property(0).OnChange(function(S,R){if(R){this.cssClassRem("preferred-size-"+R)}if(S){this.cssClassAdd("preferred-size-"+S)}this.refresh()}),refresh:function(){var R=this.Images.toArray();this.Images.clear();this.Images.addRange(R)},_currentImageIndex:null,_changeImage:function(T){if(this._currentImageIndex===null){this._currentImageIndex=this.maxVisibleImages()-1}this._currentImageIndex=(this._currentImageIndex+1)%this.Images.count();var S;while(S=this.Controls.get(0)){if(S._cssClassAdd(true,"pending-dispose")){break}else{this._remImageFromUI(S.img)}}this._addImageToUI(this.Images.get(this._currentImageIndex));if(T){var R=this.autoCycleDuration();if(R){this._cycleTimerId=setTimeout(this._changeImage.bind(this,true),R)}}},_cycleTimerId:null,_configureCycleTimer:function(){var R=this.autoCycleDuration();if(!R||!this.isVisible()||this.maxVisibleImages()>=this.Images.count()){if(this._cycleTimerId){this._cssClassRem(true,"auto-cycle-enabled");clearTimeout(this._cycleTimerId);this._cycleTimerId=null}}else{if(!this._cycleTimerId){this._cssClassAdd(true,"auto-cycle-enabled");this._cycleTimerId=setTimeout(this._changeImage.bind(this,true),R+this._timerOffset)}}},autoCycleDuration:V3.Property(0).OnChange(function(R){this._configureCycleTimer()}),_visibleImageCount:0,_ctrlLookup:V3.Object(),_addImageToUI:function(S){var R=this.preferredSize();var U=null;var Y=null;V3.forEach(S.Sizes,function(Z){if(Z.Size>=R){Y=Z.Url;return false}});if(V3.debugMode){Y=null}if(!Y){Y=S.Url}var T=this.Controls.count();var X=S.Id=="00000000-0000-0000-0000-000000000000"?" no-image":"";var V=this;var W=new V3.UI.Panel().Set({cssClass:"image "+(!U?"":" size-"+U)+X,tooltip:S.Name,Style:{display:"inline-block",backgroundImage:'url("'+encodeURI(Y).replace('"','\\"')+'")',backgroundRepeat:"no-repeat"},OnClick:function(Z,aa){if(V.enableLightBox()){V.showLightBox(S)}}}).Insert(new V3.UI.Image(Y).Style({visibility:"hidden"}));W.img=S;this._ctrlLookup[S.Id]=W;this._visibleImageCount++;this.Insert(W)},_remImageFromUI:function(R){if(!R){return}var S=this._ctrlLookup[R.Id];if(S){this.Controls.remove(S);delete this._ctrlLookup[R.Id];this._visibleImageCount--}},showLightBox:function(R){this._showPrettyPhotoLightBox(R)},_showPrettyPhotoLightBox:function(S){var W=[],T=[],V=[],U=[];var R;this.Images.forEach(function(X,Y){if(X===S){R=Y}T.add(X.Name||"");V.add(X.Description||"");W.add((V3.find(X.Sizes,function(Z){return Z.Size==1024})||X).Url);U.add((V3.find(X.Sizes,function(Z){return Z.Size==50})||V3.find(X.Sizes,function(Z){return Z.Size==180})||X).Url)});if(!this._pfId){this._pfId=V3.newId();$.fn.prettyPhoto(this._pfId,{animation_speed:"fast",slideshow:false,autoplay_slideshow:false,opacity:0.4,show_title:true,allow_resize:true,default_width:800,default_height:500,counter_separator_label:"/",theme:"V3",horizontal_padding:30,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:false,overlay_gallery:true,keyboard_shortcuts:true,social_tools:false,markup:'<div class="pp_pic_holder">   <div class="pp_top">     <div class="pp_left"></div>     <div class="pp_middle"></div>     <div class="pp_right"></div>   </div>   <div class="pp_content_container lb-for-grid">     <div class="pp_left">       <div class="pp_right">         <div class="pp_content">           <div class="pp_loaderIcon"></div>           <div class="pp_fade">             <a href="#" class="pp_expand" title="Expand the image">Expand</a>             <div class="pp_hoverContainer">               <a class="pp_next" href="#">next</a>               <a class="pp_previous" href="#">previous</a>             </div>             <div class="pp_top_content">                                 <a class="pp_close" href="#">Close</a>             </div>            <div id="pp_full_res"></div>             <div class="pp_details">               <div class="pp_nav">                 <p class="currentTextHolder">0/0</p>                 <a href="#" class="pp_arrow_previous">Previous</a>                 <a href="#" class="pp_arrow_next">Next</a>               </div>               <div class="ppt">&nbsp;</div>               <p class="pp_description"></p>             </div>           </div>         </div>       </div>     </div>   </div>   <div class="pp_bottom">     <div class="pp_left"></div>     <div class="pp_middle"></div>     <div class="pp_right"></div>   </div> </div> <div class="pp_overlay"></div>',gallery_markup:' <div class="pp_gallery">   <a href="#" class="pp_arrow_previous">Previous</a>   <div>   <ul>     {gallery}   </ul>   </div>   <a href="#" class="pp_arrow_next">Next</a> </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="0" scrolling="auto"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:'<div class="pp_custom_container" id="" + CustomContentContainerId + @""></div>'})}$.prettyPhoto.open(W,T,V,U);if(isFinite(R)&&R!==-1){$.prettyPhoto.changePage(R)}}});var f=function f(){this.base("image-box-container")}.InheritsFrom(V3.UI.Panel,{_addImageToUI:function(S){var R=this.preferredSize();var U=null;var X=null;V3.forEach(S.Sizes,function(Y){if(Y.Size>=R){X=Y.Url;return false}});if(V3.debugMode){X=null}if(!X){X=S.Url}var T=this.Controls.count();var V=this;var W=new V3.UI.Panel().Set({cssClass:"image "+(!U?"":" size-"+U),tooltip:S.Name,Style:{display:"inline-block",backgroundImage:'url("'+encodeURI(X).replace('"','\\"')+'")',backgroundRepeat:"no-repeat"}}).Insert(new V3.UI.Image(X).Style({visibility:"hidden"}));W.img=S;this._ctrlLookup[S.Id]=W;this._visibleImageCount++;this.Insert(W)},_remImageFromUI:function(R){if(!R){return}var S=this._ctrlLookup[R.Id];if(S){this.Controls.remove(S);delete this._ctrlLookup[R.Id];this._visibleImageCount--}}});var v=function v(){this.base("ul","product-names");this._canBeVisible(false)}.InheritsFrom(V3.UI.WebControlBasic,{Products:V3.Collection(function s(T,S,U){U();var R=this.maxVisibleProducts();if(R==0||this._visibleProductCount<R){this._addProductToUI(T)}this._canBeVisible(true)},function l(T,S,U){U();this._removeProductFromUI(T);if(this.Products.count()==0){this._canBeVisible(false)}else{var R=this.maxVisibleProducts();if(this._visibleProductCount<R&&this._visibleProductCount<this.Products.count()){this.refresh()}}}).InjectOwner(),refresh:function(){var R=this.Products.toArray();if(this.randomiseProducts()){R.sort(function(){return(Math.random()-0.5)})}this.Products.clear();this.Products.addRange(R)},_visibleProductCount:0,maxVisibleProducts:V3.Property(0).OnChange(function(R){this.refresh()}),randomiseProducts:V3.Property(0).OnChange(function(R){this.refresh()}),_ctrlLookup:V3.Object(),_addProductToUI:function(R){var S=this._ctrlLookup[R.Id];if(S){return}S=new V3.UI.WebControlBasic("li").Set({}).Insert(R.Name);this._ctrlLookup[R.Id]=S;this._visibleProductCount++;this.Insert(S)},_removeProductFromUI:function(R){var S=this._ctrlLookup[R.Id];if(S){this.Controls.remove(S);delete this._ctrlLookup[R.Id];this._visibleProductCount--}}});var A=function A(){this.base("ul","display-features");this._canBeVisible(false)}.InheritsFrom(V3.UI.WebControlBasic,{Features:V3.Collection(function s(T,S,U){U();var R=this.maxVisibleFeatures();if(R==0||this._visibleFeatureCount<R){this._addFeatureToUI(T)}this._canBeVisible(true)},function l(T,S,U){U();this._removeFeatureFromUI(T);if(this.Features.count()==0){this._canBeVisible(false)}else{var R=this.maxVisibleFeatures();if(this._visibleFeatureCount<R&&this._visibleFeatureCount<this.Features.count()){this.refresh()}}}).InjectOwner(),refresh:function(){var R=this.Features.toArray();this.Features.clear();this.Features.addRange(R)},_visibleFeatureCount:0,maxVisibleFeatures:V3.Property(0).OnChange(function(R){this.refresh()}),_ctrlLookup:V3.Object(),_addFeatureToUI:function(R){var S=this._ctrlLookup[R.Id];if(S){return}S=new V3.UI.WebControlBasic("li").Set({}).Insert(R.Name);this._ctrlLookup[R.Id]=S;this._visibleFeatureCount++;this.Insert(S)},_remFeatureFromUI:function(R){var S=this._ctrlLookup[R.Id];if(S){this.Controls.remove(S);delete this._ctrlLookup[R.Id];this._visibleFeatureCount--}}});var b=function b(R){this.base("display-address");this.Insert(this.lblIcon,this.lblLine1,this.lblLine2,this.lblLine3,this.lblCity,this.lblState,this.lblPostCode,this.lblCountry);this._canBeVisible(false);this.address(R)}.InheritsFrom(V3.UI.Panel,{lblIcon:V3.UI.Label().Defaults({cssClass:"data-icon address",tooltip:"Address"}),lblLine1:V3.UI.Label().Defaults({cssClass:"line1",autoVisibility:true}),lblLine2:V3.UI.Label().Defaults({cssClass:"line2",autoVisibility:true}),lblLine3:V3.UI.Label().Defaults({cssClass:"line3",autoVisibility:true}),lblCity:V3.UI.Label().Defaults({cssClass:"city",autoVisibility:true}),lblState:V3.UI.Label().Defaults({cssClass:"state",autoVisibility:true}),lblPostCode:V3.UI.Label().Defaults({cssClass:"postcode",autoVisibility:true}),lblCountry:V3.UI.Label().Defaults({cssClass:"country",autoVisibility:true}),address:V3.Property(null).OnChange(function(R){if(!R){this._canBeVisible(false)}else{this.lblLine1.text(R.Line1);this.lblLine2.text(R.Line2);this.lblLine3.text(R.Line3);this.lblCity.text(R.City);this.lblState.text(H.TryAbbreviateStateName(R.State));this.lblPostCode.text(R.PostCode);this.lblCountry.text(R.CountryName);this._canBeVisible(true)}})});var k=function k(R){this.base("display-address");this.Insert(this.lblIcon,this.lblCity,this.lblViewOnMap);this._canBeVisible(false);this.city(R)}.InheritsFrom(V3.UI.Panel,{OnShowOnMapClicked:V3.EventPrototype("sender, e:{entity:object}"),lblIcon:V3.UI.Label().Defaults({cssClass:"data-icon address",tooltip:"Address"}),lblCity:V3.UI.Label().Defaults({cssClass:"city",autoVisibility:true}),lblViewOnMap:V3.UI.HyperLink().Defaults({cssClass:"view-on-map btn-link",OnClick:function(R,S){S.Event.stopPropagation();this.OnShowOnMapClicked.fire(this,S)},tooltip:"View on Map"}),city:V3.Property(null).OnChange(function(R){if(!R){this._canBeVisible(false)}else{this.lblCity.text(R.City);this.lblViewOnMap.text(V3.Res["EntityDisplay.VieOnMap.Text"]||"View on Map");this._canBeVisible(true)}})});var K=function K(S,R){this.base("display-rating");this.Insert(this.lblIcon,this.lblRating);this._canBeVisible(false);this._type=R;this.rating(S)}.InheritsFrom(V3.UI.Panel,{lblIcon:V3.UI.Label().Defaults({cssClass:"data-icon rating",tooltip:"Rating"}),lblRating:V3.UI.Label().Defaults({cssClass:"line1",autoVisibility:true}),rating:V3.Property(null).OnChange(function(S){if(!S){this._canBeVisible(false)}else{var R=G.parse(this._type);if(R==G.Product){this.lblIcon._cssClassAdd(true,"orange")}this.lblRating.text(H.ProcessPlaceholders((V3.Res["EntityDisplay.Rating"]||"{score}/{max} by {number} people"),{"{score}":parseFloat(S.Value.toFixed(2)).toString(),"{min}":S.MinInclusive,"{max}":S.MaxInclusive,"{number}":S.RatingCount}));this._canBeVisible(true)}})});var L=function L(R){this.base("ul");if(window.vsDesignTime&&!R){R=window.getProviderSearchControlDefaultSettings(true).PagingSettings}V3.extend(R,false,this._DefaultSettings);this.cssClass("paging "+(R.CssClass||""));this._settings=R;this.maxPageButtonCount(R.MaxNumberOfButtons);this.showFirstPageButton(R.ShowFirstPage);this.showPrevPageButton(R.ShowPrevButton);this.showNextPageButton(R.ShowNextButton);this.showLastPageButton(R.ShowLastPage);this._construct();this.showFirstPageButton.OnChange.addEventHandler(this._construct.bind(this));this.showPrevPageButton.OnChange.addEventHandler(this._construct.bind(this));this.showNextPageButton.OnChange.addEventHandler(this._construct.bind(this));this.showLastPageButton.OnChange.addEventHandler(this._construct.bind(this));this.maxPageButtonCount.OnChange.addEventHandler(this._construct.bind(this))}.InheritsFrom(V3.UI.WebControlBasic,{_DefaultSettings:{ShowFirstPage:true,ShowPrevButton:true,ShowNextButton:true,ShowLastPage:true,MaxNumberOfButtons:10,Labels:{First:null,Prev:null,Next:null,Last:null}},OnChangePage:V3.EventPrototype("sender, e:{newPageNumber:1}"),showFirstPageButton:V3.Property(true),showPrevPageButton:V3.Property(true),showNextPageButton:V3.Property(true),showLastPageButton:V3.Property(true),maxPageButtonCount:V3.Property(5),pageNumber:V3.Property(1).OnChange(function(R){this._construct();this.OnChangePage.fire(this,{newPageNumber:R})}),numberOfPages:V3.Property(0).OnChange(function(R){this._construct()}),_changePage:function(R){this.pageNumber(R)},_construct:function(){this.Controls.clear();if(this.numberOfPages()==0){this.visible(false);return}else{this.visible(true)}if(this.showPrevPageButton()){var aa=new V3.UI.WebControlBasic("li").Set({cssClass:"previous-page",visible:this.maxPageButtonCount()>=1});var T=new V3.UI.HyperLink("",this._settings.Labels.PrevIcon||V3.Res["Paging.PreviousIcon"]||"«").Set({OnClick:this._changePage.bind(this,this.pageNumber()-1),enabled:(this.pageNumber()>1)});this.Insert(aa.Insert(T))}if(this.showFirstPageButton()){var U=new V3.UI.WebControlBasic("li").Set({cssClass:"first-page",visible:this.maxPageButtonCount()>=3});var ad=new V3.UI.HyperLink("",(this._settings.Labels.First||V3.Res["Paging.First"]||"1")).Set({OnClick:this._changePage.bind(this,1),enabled:(this.pageNumber()>1)});if(this.pageNumber()==1){U.cssClassAdd("active")}this.Insert(U.Insert(ad))}var af=0,Y=this.numberOfPages();if(this.maxPageButtonCount()<=6){af=this.pageNumber()-1;Y=af+1}else{if(this.numberOfPages()>1){var ag=this.pageNumber()-1;var Z=(this.maxPageButtonCount()-4);af=ag-Math.floor(Z/2);if(af<0){af=0}Y=af+Z;if(Y>this.numberOfPages()){Y=this.numberOfPages();af=Y-Z;if(af<0){af=0}}}}if(af==0){af=1;if(Y<this.numberOfPages()){Y=Y+1}}if(Y==this.numberOfPages()){Y=Y-1;if(af>1){af=af-1}}var S=(Y-af>=3);if(af<Y){for(var X=af;X<Y;X++){var ae=new V3.UI.WebControlBasic("li").Set({cssClass:"page-number"});var R=new V3.UI.HyperLink("",(X+1).toString()).Set({OnClick:this._changePage.bind(this,X+1)});this.Insert(ae.Insert(R));if(S){if(X==af&&X!=1){if(af!=0){ae.cssClassAdd("more");R.text("...")}}}if(X+1!=this.pageNumber()){R.enabled(true)}else{R.enabled(false);ae.cssClassAdd("active")}if(S){if(X+1==Y&&Y+1!=this.numberOfPages()){if(X+1!=this.numberOfPages()){ae.cssClassAdd("more");R.text("...")}}}}}if(this.numberOfPages()>1){if(this.showLastPageButton()){var V=new V3.UI.WebControlBasic("li").Set({cssClass:"last-page",visible:this.maxPageButtonCount()>=4});var ab=new V3.UI.HyperLink("",V3.CABS.Utils.ProcessPlaceholders((this._settings.Labels.Last||V3.Res["Paging.Last"]||"{page.count}"),{"{page.count}":this.numberOfPages()})).Set({OnClick:this._changePage.bind(this,this.numberOfPages()),enabled:(this.pageNumber()<this.numberOfPages())});if(this.pageNumber()==this.numberOfPages()){V.cssClassAdd("active")}this.Insert(V.Insert(ab))}}if(this.showNextPageButton()){var ac=new V3.UI.WebControlBasic("li").Set({cssClass:"next-page",visible:this.maxPageButtonCount()>=1});var W=new V3.UI.HyperLink("",this._settings.Labels.NextIcon||V3.Res["Paging.NextIcon"]||"»").Set({OnClick:this._changePage.bind(this,this.pageNumber()+1),enabled:(this.pageNumber()<this.numberOfPages())});this.Insert(ac.Insert(W))}}});var q=function(S,W,U){var R="";var V=(S.pageNumber()-1)*providerSearchControlSettings.ReviewPagingSettings.PageSize;var T=U.slice(V,V+providerSearchControlSettings.ReviewPagingSettings.PageSize);for(i=0;i<T.length;i++){R+='<div class="review row">';R+='<div class="review-header col-sm-12 col-md-12 col-lg-12">';if(T[i].Person){R+='<div class="person-name">'+T[i].Person+"</div>"}if(T[i].DateCreated){R+='<div class="date-created">'+T[i].DateCreated.toStringUI("D")+"</div>"}if(T[i].Rating){R+='<div class="row">                                    <div class="score">'+parseFloat(T[i].Rating.Value.toFixed(2))+'</div>                                    <div class="max-score">'+T[i].Rating.MaxInclusive+" "+(V3.Res["EntityDisplay.Review.Text"]||"Review")+"</div>                                </div>"}R+="</div>";R+='<div class="review-body col-sm-12 col-md-12 col-lg-12">';if(T[i].ShortReview&&T[i].ShortReview.Positive){R+='<div class="row pros">                                    <div class="col-sm-12 col-md-12 col-lg-12">                                        <div class="review-title" title="Positives" data-tooltip-text="Positives">'+(V3.Res["EntityDisplay.Review.Pros"]||"Pros")+'</div>                                    </div>                                    <div class="col-sm-12 col-md-12 col-lg-12"><p>'+T[i].ShortReview.Positive+"</p></div>                                </div>"}if(T[i].ShortReview&&T[i].ShortReview.Negative){R+='<div class="row pros">                                    <div class="col-sm-12 col-md-12 col-lg-12">                                        <div class="review-title" title="Negatives" data-tooltip-text="Negatives">'+(V3.Res["EntityDisplay.Review.Cons"]||"Cons")+'</div>                                    </div>                                    <div class="col-sm-12 col-md-12 col-lg-12"><p>'+T[i].ShortReview.Negative+"</p></div>                                </div>"}if(T[i].FullDescription){R+='<div class="row full-description">                                    <div class="col-sm-12 col-md-12 col-lg-12">                                        <div class="review-title" title="General Comment" data-tooltip-text="General Comment">'+(V3.Res["EntityDisplay.Review.GeneralComment"]||"General Comment")+'</div>                                    </div>                                    <div class="col-sm-12 col-md-12 col-lg-12"><p>'+T[i].FullDescription+"</p></div>                                </div>"}R+="</div>                           </div>"}W.Set({DOMElement:{innerHTML:R}})};var N=function N(T){var S;if(!this.pnlReviewsContents){this.pnlReviewsContents=new V3.UI.Panel().Set({cssClass:"reviews-lightbox"});this.pnlReviewsInfo=new V3.UI.Panel().Set({cssClass:"reviews-info"});this.pnlReviewsLightbox=new V3.UI.Panel().Set({visible:false});this.PagingController=new L(providerSearchControlSettings.ReviewPagingSettings);this.pnlReviewsContents.DOMElement.appendChild(this.pnlReviewsInfo.DOMElement);this.pnlReviewsContents.DOMElement.appendChild(this.PagingController.DOMElement);document.body.appendChild(this.pnlReviewsLightbox.DOMElement)}var V=Math.ceil(T.length/providerSearchControlSettings.ReviewPagingSettings.PageSize);this.PagingController.Set({OnChangePage:function(X,Y){q(this.PagingController,this.pnlReviewsInfo,T)}.bind(this)});this.PagingController.numberOfPages(V);this.PagingController.pageNumber(1);q(this.PagingController,this.pnlReviewsInfo,T);this.pnlReviewsLightbox.DOMElement.appendChild(this.pnlReviewsContents.DOMElement);e("#"+this.pnlReviewsContents.DOMElement.id);var U=this.pnlReviewsContents.DOMElement;if(U==null){U=S}else{S=U}var W=0;var R=setInterval(function(){if(W++>10){clearInterval(R)}var X=document.getElementById("tempLightbox");if(X){X.parentElement.appendChild(U);X.parentElement.removeChild(X);clearInterval(R)}},100);return false};var B=function B(R){this.base("display-reviews");this.Insert(this.lblIcon,this.hlReviews=new V3.UI.HyperLink("#").Set({cssClass:"view-reviews",OnClick:function(S,T){N(R);return false}}));this._canBeVisible(false);this.reviews(R)}.InheritsFrom(V3.UI.Panel,{lblIcon:V3.UI.Label().Defaults({cssClass:"data-icon reviews",tooltip:"Reviews"}),reviews:V3.Property(null).OnChange(function(R){if(!R){this._canBeVisible(false)}else{this.hlReviews.text(R.length+" reviews");if(R.length==1){this.hlReviews.text(H.ProcessPlaceholders((V3.Res["EntityDisplay.ReviewsSingular"]||"{number} review"),{"{number}":R.length}))}else{this.hlReviews.text(H.ProcessPlaceholders((V3.Res["EntityDisplay.ReviewsPlural"]||"{number} reviews"),{"{number}":R.length}))}this.hlReviews.OnClick.addEventHandler(function(S,T){N(R);return false});this._canBeVisible(true)}})});var n=function n(S,R){this.base("col-xl-6 col-lg-6 col-md-6 col-8 col-sm-6 col-xs-8 justify-content-between entity-info");this.dbComment=document.createComment("");this.Insert(this.dbComment,this.lblCategory,this.lblHeader,this.lblMaxCapacity,this.ctrlAccreditation,this.ctrlCityWithViewOnMap,this.ctrlRating,this.ctrlReviews,this.ctrlScrollable.Insert(this.ctrlDescription,this.pnlButtonRow.Insert(this.btnViewAvailability)));this.btnViewAvailability.text(V3.Res["EntityDisplay.Button.ViewAvailability.Text"]||"View Availability");this._canBeVisible(false);this.entity(S);this.terminology(R)}.InheritsFrom(V3.UI.Panel,{OnShowOnMapClicked:V3.EventPrototype("sender, e:{entity:object}"),OnMoreClicked:V3.EventPrototype("sender, e:{entity:object}"),lblCategory:V3.UI.Label().Defaults({cssClass:"category data-icon",autoVisibility:true}),lblHeader:V3.UI.Label("h3").Defaults({cssClass:"name",autoVisibility:true}),lblMaxCapacity:V3.UI.Label().Defaults({cssClass:"capacity",autoVisibility:true}),pnlButtonRow:V3.UI.Panel().Defaults({cssClass:"button-row row spacebtwn"}),ctrlAccreditation:m(),ctrlAddress:b(),ctrlCityWithViewOnMap:k(),ctrlRating:K(),ctrlReviews:B(),ctrlScrollable:V3.UI.Panel().Defaults({cssClass:"scrollable"}),ctrlDescription:V3.UI.Panel().Defaults({cssClass:"description row"}),ctrlProductList:V3.UI.Panel().Defaults({cssClass:"product-list"}),showAccreditations:V3.Property(true).OnChange(function u(R){this.ctrlAccreditation.visible(R)}),showMaxPax:V3.Property(true).OnChange(function u(R){this.lblMaxCapacity.visible(R)}),showCategory:V3.Property(true).OnChange(function u(R){this.lblCategory.visible(R)}),showAddress:V3.Property(false).OnChange(function u(R){this.ctrlAddress.visible(R)}),showCityWithViewOnMap:V3.Property(false).OnChange(function u(R){this.ctrlCityWithViewOnMap.visible(R)}),showRating:V3.Property(false).OnChange(function u(R){this.ctrlRating.visible(R)}),showReviews:V3.Property(false).OnChange(function u(R){this.ctrlReviews.visible(R)}),showDescription:V3.Property(false).OnChange(function u(R){this.ctrlDescription.visible(R)}),showViewMoreButton:V3.Property(false).OnChange(function u(R){this.pnlButtonRow.visible(R)}),showProductList:V3.Property(false).OnChange(function u(R){this.ctrlProductList.visible(R)}),terminology:V3.Property(null).OnChange(function u(R){this._updateGuestsLabel()}),entity:V3.Property(null).OnChange(function u(W){this._canBeVisible(!!W);if(W){if(V3.Is.Undefined(W.Type)){throw new "Type is not set, this is required."}var T="Id: "+W.Id;if(W.Type==G.Provider){T=T+", Shortname: "+W.Code}else{if(W.Parent&&W.Parent.Code){if(W.Parent.Type==G.Provider){T=T+", Parent Shortname: "+W.Parent.Code}else{T=T+", Parent Code: "+W.Parent.Code}}}this.dbComment.data=T;var S=W||DebugResponse().Entities[0];this.cssClass("");this.lblCategory.text("category data-icon");var U=G.parse(S.Type);if(U==G.Provider){this.lblCategory._cssClassAdd(true,"business")}else{if(S.IndustryCategoryGroups){var V=this;S.IndustryCategoryGroups.forEach(function(Y){Y=E.parse(Y);var Z=H.GetCssClassNameFromEnum(Y);if(Z){V.cssClassAdd(Z);V.lblCategory.text(Y.toString(true));V.lblCategory.cssClassAdd(Z);return false}})}}this._cssClassAdd(true,H.GetCssClassNameFromEnum(U));if(U==G.Product){this.lblCategory._cssClassAdd(true,"orange")}var R=F.parse(S.IndustryCategory)||(S.IndustryCategoryGroups!=null?F.parse(S.IndustryCategoryGroups[0]):null);if(R){this._cssClassAdd(true,H.GetCssClassNameFromEnum(R));this.lblCategory.text(R.toString(true));this.lblCategory.tooltip(this.lblCategory.text())}if(!V3.debugMode||V3.debugMode==="silent"){this.lblHeader.text(S.Name)}else{if(S.Type==G.Service){this.lblHeader.text(S.Name+" ["+(S.Code||"")+"] ["+((S.Parent&&S.Parent.Code)||"")+"]")}else{this.lblHeader.text(S.Name+" ["+(S.Code||"")+"]")}}this._updateGuestsLabel();if(S.Accreditations&&S.Accreditations.length>0){this.ctrlAccreditation.accreditation(S.Accreditations[0])}else{this.ctrlAccreditation.accreditation(null)}if(this.showAddress()){if(!S.PhysicalAddress||(R&&(R.toGroup()==E.Activity||R.toGroup()==E.Epicurean||R.toGroup()==E.Shopping))){this.ctrlAddress.address(null)}else{if(R&&R.toGroup()==E.Accommodation){this.ctrlAddress.address(S.PhysicalAddress)}else{throw new Error("Unrecognized IndustryCategory: "+R)}}}if(this.showCityWithViewOnMap()){if(!S.Geocodes){this.ctrlCityWithViewOnMap.lblViewOnMap.visible(false)}if(!S.PhysicalAddress||(R&&(R.toGroup()==E.Activity||R.toGroup()==E.Epicurean||R.toGroup()==E.Shopping))){this.ctrlCityWithViewOnMap.city(null,null)}else{if(R&&R.toGroup()==E.Accommodation){this.ctrlCityWithViewOnMap.city(S.PhysicalAddress);this.ctrlCityWithViewOnMap.OnShowOnMapClicked.addEventHandler(function(Y,Z){this.OnShowOnMapClicked.fire(this,{entity:S})}.bind(this))}else{throw new Error("Unrecognized IndustryCategory: "+R)}}}if(this.showRating()){if(S.Rating){this.ctrlRating.rating(S.Rating,S.Type)}}if(this.showReviews()){if(S.Reviews&&S.Reviews.length>0){this.ctrlReviews.lblIcon.cssClassToggle((G.parse(S.Type)==G.Product),"orange","blue");this.ctrlReviews.reviews(S.Reviews)}}var X=S.ShortDescription||S.LongDescription;if(X){this.ctrlDescription.visible(this.showDescription());this.ctrlDescription.Set({DOMElement:{innerHTML:X}});if(!this.showViewMoreButton()){this.pnlButtonRow.visible(false)}}if(this.showProductList()){this.ctrlProductList.Insert(new V3.UI.Label("h5").Set({text:V3.Res["EntityDisplay.ProductListTitle"]||"Available products:"}),new V3.CABS.UI.DisplayProductNames().Set({maxVisibleProducts:10,Products:S.Children,randomiseProducts:true}))}}}),btnViewAvailability:V3.UI.Button().Defaults({cssClass:"btn btn-primary btn-gridview col-lg-6 col-md-8 col-sm-8 col-xs-8",OnClick:function(R){this.OnMoreClicked.fire(this,{entity:this.entity()})}}),showViewAvailabilityButton:V3.Property(true).OnChange(function(S,R){this.btnViewAvailability.visible(S)}),_updateGuestsLabel:function(){var R=this.entity();if(!R||!R.Capacity){this.lblMaxCapacity.text("")}else{this.lblMaxCapacity.text(H.ProcessPlaceholders((V3.Res["EntityDisplay.MaxGuestsText"]||"Max {max} {guests}"),{"{max}":R.Capacity.Max,"{guests}":H.GetTerm("Guests",this.terminology()||(R&&R.Settings&&R.Settings.Terminology))}))}}});var z=function z(S,R){this.base("card-info");this.Insert(this.lblHeader,this.ctrlDescription);this.btnViewAvailability.text(V3.Res["EntityDisplay.Button.ViewAvailability.Text"]||"View Availability");this._canBeVisible(false);this.entity(S)}.InheritsFrom(V3.UI.Panel,{OnMoreClicked:V3.EventPrototype("sender, e:{entity:object}"),lblHeader:V3.UI.Label("h3").Defaults({cssClass:"name",autoVisibility:true}),pnlButtonRow:V3.UI.Panel().Defaults({cssClass:"button-row row spacebtwn"}),ctrlDescription:V3.UI.Panel().Defaults({cssClass:"description row"}),showDescription:V3.Property(false).OnChange(function u(R){this.ctrlDescription.visible(R)}),entity:V3.Property(null).OnChange(function u(V){this._canBeVisible(!!V);if(V){if(V3.Is.Undefined(V.Type)){throw new "Type is not set, this is required."}var S=V||DebugResponse().Entities[0];this.cssClass("");var T=G.parse(S.Type);if(T==G.Provider){}else{if(S.IndustryCategoryGroups){var U=this;S.IndustryCategoryGroups.forEach(function(X){X=E.parse(X);var Y=H.GetCssClassNameFromEnum(X);if(Y){return false}})}}this._cssClassAdd(true,H.GetCssClassNameFromEnum(T));if(T==G.Product){}var R=F.parse(S.IndustryCategory)||F.parse(S.IndustryCategoryGroups[0]);if(R){this._cssClassAdd(true,H.GetCssClassNameFromEnum(R))}if(!V3.debugMode||V3.debugMode==="silent"){this.lblHeader.text(S.Name)}else{if(S.Type==G.Service){this.lblHeader.text(S.Name+" ["+(S.Code||"")+"] ["+((S.Parent&&S.Parent.Code)||"")+"]")}else{this.lblHeader.text(S.Name+" ["+(S.Code||"")+"]")}}var W=S.ShortDescription||S.LongDescription;if(W){this.ctrlDescription.visible(this.showDescription());this.ctrlDescription.Set({DOMElement:{innerHTML:W}})}}}),btnViewAvailability:V3.UI.Button().Defaults({cssClass:"btn btn-primary btn-gridview col-lg-6 col-md-8 col-sm-8 col-xs-8",OnClick:function(R){this.OnMoreClicked.fire(this,{entity:this.entity()})}}),showViewAvailabilityButton:V3.Property(true).OnChange(function(S,R){this.btnViewAvailability.visible(S)})});var y=function y(R,S){this.base("row spacebet entity-tile");this.dbComment=document.createComment("");this.Insert(this.dbComment,this.pnlImages,this.deiDetails,this.pnlPrice);this.btnOrder.text(V3.Res["EntityDisplay.Button.Order.Text"]||"Order");this.btnMore.text(V3.Res["EntityDisplay.Button.More.Text"]||"More");this._canBeVisible(false);this.parentId(S);this.entity(R)}.InheritsFrom(V3.UI.Panel,{OnMoreClicked:V3.EventPrototype("sender, e:{entity:object}"),OnOrderClicked:V3.EventPrototype("sender, e:{productId:guid, serviceId:guid}"),OnShowOnMapClicked:V3.EventPrototype("sender, e:{entity:object}"),pnlImages:V3.UI.Panel().Defaults({cssClass:"col-xl-4 col-lg-4 col-md-4 col-sm-4 col-4 col-xs-4 entity-images"}),deiDetails:n().Defaults({showCityWithViewOnMap:true,showAccreditations:true,showMaxPax:false,showDescription:true,showReviews:false,showViewMoreButton:true}),pnlPrice:V3.UI.Panel().Defaults({cssClass:"col-xl-2 col-lg-2 col-md-2 col-sm-12 col-12 col-xs-6 pricesecondvar pricehideinmobilesearch price-col"}),lblPriceFrom:V3.UI.Label().Defaults({cssClass:"price-from",autoVisibility:true}),lblPrice:V3.UI.Label().Defaults({cssClass:"price",autoVisibility:true}),lblPriceType:V3.UI.Label().Defaults({cssClass:"price-type",autoVisibility:true}),pnlCampaignOffers:V3.UI.Panel().Defaults({cssClass:"campaign-offers"}),lblHavingOffers:V3.UI.Label().Defaults({cssClass:"having-offer",autoVisibility:true}),lblCampaignOfferIconCtrl:V3.UI.Label().Defaults({cssClass:"star-container max-width-4 two-rows"}),btnOrder:V3.UI.Button().Defaults({cssClass:"button orange order",OnClick:function(T,X){this.OnOrderClicked.fire(this,{productId:this.entity().Id,serviceId:this.parentId()});try{var W=this.entity();var S=V3.CABS.IndustryCategoryEnum.fromValue(W.IndustryCategory)._displayName;var R=V3.CABS.IndustryCategoryGroupEnum.fromValue(W.IndustryCategoryGroups[0])._displayName;var U={DistributorName:providerSearchControlSettings.GlobalSettings.Shortname,ProviderName:_gtagConfigParams.provider,CurrencyISOCode:window._DisplayCurrencyCode,ItemCategory:S,ItemCategory2:R,ItemPrice:parseFloat(W.Availability.Calendar.LowestRate)||0,ItemQty:1};V3.CABS.Analytics.sendViewItem(U)}catch(V){V3.Log.Error(V)}}}),btnMore:V3.UI.Button().Defaults({cssClass:"button blue more",OnClick:function(){this.OnMoreClicked.fire(this,{entity:this.entity()})}}),showMoreButton:V3.Property(true).OnChange(function(S,R){this.btnMore.visible(S)}),showOrderButton:V3.Property(true).OnChange(function(S,R){this.btnOrder.visible(S)}),parentId:V3.Property(),entity:V3.Property(null).OnChange(function u(Z){this._canBeVisible(!!Z);if(Z){if(V3.Is.Undefined(Z.Type)){throw new "Type is not set, this is required."}var ac="EntityTile Id: "+Z.Id;if(Z.Parent&&Z.Parent.Code){if(Z.Parent.Type==G.Provider){ac=ac+", Parent Shortname: "+Z.Parent.Code}else{ac=ac+", Parent Code: "+Z.Parent.Code}}this.dbComment.data=ac;var V=Z||DebugResponse().Entities[0];var T=G.parse(V.Type);if(T==G.Service){this._cssClassAdd(true,"service");var Y=null;var S=[];if(V.Children){var X=V.Children;X.forEach(function(ad){if(Y==null){Y=ad.Availability.Calendar.LowestRate}else{if(ad.Availability.Calendar.LowestRate!=null){if(Y>ad.Availability.Calendar.LowestRate){Y=ad.Availability.Calendar.LowestRate}}}var ae=ad.Availability.Calendar.DailyRates;ae.forEach(function(af){if(af.AvailableCampaignCodes!=null){if(S.length==0){S=af.AvailableCampaignCodes}else{S=S.concat(af.AvailableCampaignCodes.filter(function(ag){!S.some(function(ah){ah.Code===ag.Code})}))}}})})}if(Y==null){this.lblPrice.text(V3.Res["EntityDisplay.Messages.Unavailable"]||"Unavailable")}else{this.lblPriceFrom.text(V3.Res["EntityDisplay.Price.From"]||"From:");this.lblPrice.text(Y.toStringFormat("C",V3.CultureInfo.currentUICulture()));var ab=V3.CABS.IndustryCategoryGroupEnum.fromValue(V.IndustryCategoryGroups[0]);switch(ab){case E.Accommodation:this.lblPriceType.text(V3.Res["EntityDisplay.Price.Type.Accomodation"]||"Per Night");this.pnlPrice.Insert(this.lblPriceFrom,this.lblPrice,this.lblPriceType,this.pnlCampaignOffers.Insert(this.lblHavingOffers,this.lblCampaignOfferIconCtrl));break;case E.Activity:this.lblPriceType.text(V3.Res["EntityDisplay.Price.Type.Activity"]||"Per Person");this.pnlPrice.Insert(this.lblPriceFrom,this.lblPrice,this.lblPriceType,this.pnlCampaignOffers.Insert(this.lblHavingOffers,this.lblCampaignOfferIconCtrl));break;case E.Epicurean:this.lblPriceType.text(V3.Res["EntityDisplay.Price.Type.Epicurean"]||"Per Person");this.pnlPrice.Insert(this.lblPriceFrom,this.lblPrice,this.lblPriceType,this.pnlCampaignOffers.Insert(this.lblHavingOffers,this.lblCampaignOfferIconCtrl));break;case E.Shopping:this.pnlPrice.Insert(this.lblPrice,this.pnlCampaignOffers.Insert(this.lblHavingOffers,this.lblCampaignOfferIconCtrl));this.btnOrder.text(V3.Res["EntityDisplay.Button.Order.Text"]||"Order");break}}this.deiDetails.Set({showCategory:false,showProductList:true,entity:V});if(S.length>0){this.lblHavingOffers.text(V3.Res["EntityDisplay.Campaign.HavingOffers"]||"Having Offer(s):");this.lblCampaignOfferIconCtrl.visible(true);var W=0;S.forEach(function(ae){var ad=document.createElement("span");ad.className="star"+W;if(W<5){ad.innerHTML='<svg width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.5584 5.85372L10.5586 5.85392C10.7115 6.00684 10.7875 6.19085 10.7875 6.41875C10.7875 6.64665 10.7115 6.83066 10.5586 6.98358L6.98358 10.5586C6.83127 10.7109 6.64547 10.7875 6.4125 10.7875C6.17953 10.7875 5.99373 10.7109 5.84142 10.5586L1.44142 6.15858C1.36845 6.08561 1.30943 5.99857 1.26476 5.89548C1.22191 5.79658 1.2 5.69043 1.2 5.575V2C1.2 1.77846 1.27655 1.5938 1.43517 1.43517C1.5938 1.27655 1.77846 1.2 2 1.2H5.575C5.69043 1.2 5.79658 1.22191 5.89548 1.26476C5.99856 1.30943 6.08558 1.36843 6.15855 1.44139C6.15856 1.4414 6.15857 1.44141 6.15858 1.44142L10.5584 5.85372ZM3.25 4.2C3.51077 4.2 3.7389 4.10644 3.92267 3.92267C4.10644 3.7389 4.2 3.51077 4.2 3.25C4.2 2.98923 4.10644 2.7611 3.92267 2.57733C3.7389 2.39356 3.51077 2.3 3.25 2.3C2.98923 2.3 2.7611 2.39356 2.57733 2.57733C2.39356 2.7611 2.3 2.98923 2.3 3.25C2.3 3.51077 2.39356 3.7389 2.57733 3.92267C2.7611 4.10644 2.98923 4.2 3.25 4.2Z" fill="url(#tagGradient-'+W+')" stroke="#9FF168" stroke-width="0.4"></path><defs><linearGradient id="tagGradient-'+W+'" x1="5.99375" y1="1" x2="5.99375" y2="10.9875" gradientUnits="userSpaceOnUse"><stop id="gradient-start-'+W+'" stop-color="#9FF168"></stop><stop id="gradient-stop-'+W+'" offset="1" stop-color="#eef168"></stop></linearGradient></defs></svg>';this.lblCampaignOfferIconCtrl.Insert(ad)}if(W==5){ad.innerHTML="...";this.lblCampaignOfferIconCtrl.Insert(ad)}W++}.bind(this))}else{this.pnlCampaignOffers.visible(false)}this.deiDetails.OnShowOnMapClicked.addEventHandler(function(ad,ae){this.OnShowOnMapClicked.fire(this,{entity:V})}.bind(this));this.deiDetails.OnMoreClicked.addEventHandler(function(ad,ae){this.OnMoreClicked.fire(this,ae)}.bind(this))}else{if(T==G.Product){this._cssClassAdd(true,"product col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12 cardrowA");this.deiDetails.Set({showCategory:true,showProductList:false,entity:V});var R=(F.parse(V.IndustryCategory).toGroup()==E.Shopping)?new Date().toStringFormat("date"):new Date().toStringFormat("date");var U=V.Availability.Calendar.DailyRates.find(function(ad){return ad.Date==R&&ad.IsAvailable});if(U==null){this.lblPrice.text(V3.Res["EntityDisplay.Messages.Unavailable"]||"Unavailable")}else{this.lblPrice.text(U.Rate.toStringFormat("C",V3.CultureInfo.currentUICulture()))}}}if(V.Images!=null){var aa=V.Images.filter(function(ad){return ad.Url!=null})[0];ctrlDisplayImages=new V3.CABS.UI.DisplayImages().Set({autoCycleDuration:5000,preferredSize:180,Images:[aa],maxVisibleImages:1});this.pnlImages.Insert(ctrlDisplayImages)}else{ctrlDisplayImages=new V3.CABS.UI.DisplayImages().Set({autoCycleDuration:5000,preferredSize:180,Images:[{Id:"00000000-0000-0000-0000-000000000000",Name:null,Url:providerSearchControlSettings.GlobalSettings.NoImageUrl,Description:null,Sizes:[{Size:300,Url:providerSearchControlSettings.GlobalSettings.NoImageUrl,Width:300,Height:199}]}],maxVisibleImages:1});this.pnlImages.Insert(ctrlDisplayImages)}}})});var x=function x(S,U,R,T){if(U!=null){this.base("col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12 entity-card")}else{this.base("row spacebet entity-tile-card")}this._startDate=R;this._selectedDate=T;this.Insert(new V3.UI.Panel().Set({cssClass:"card cardavailability h-100"}).Insert(this.cardHeader,new V3.UI.Panel().Set({cssClass:"card-body"}).Insert(this.deiDetails),new V3.UI.Panel().Set({cssClass:"card-footer"}).Insert(new V3.UI.Panel().Set({cssClass:"view-more-container"}).Insert(this.lblViewMore),new V3.UI.Panel().Set({cssClass:"pricing-row"}).Insert(this.pnlPrice,new V3.UI.Panel().Set({cssClass:"card-button"}).Insert(this.btnOrder)))));this.btnOrder.text(V3.Res["EntityDisplay.Button.Book.Text"]||"Book");this.btnMore.text(V3.Res["EntityDisplay.Button.More.Text"]||"More");this._canBeVisible(false);this.parentId(U);this.entity(S)}.InheritsFrom(V3.UI.Panel,{OnMoreClicked:V3.EventPrototype("sender, e:{entity:object}"),OnOrderClicked:V3.EventPrototype("sender, e:{productId:guid, serviceId:guid}"),OnShowOnMapClicked:V3.EventPrototype("sender, e:{entity:object}"),_startDate:new Date(),_selectedDate:new Date(),cardHeader:V3.UI.Panel().Defaults({cssClass:"card-header"}),deiDetails:z().Defaults({showDescription:true}),lblViewMore:V3.UI.HyperLink().Defaults({cssClass:"view-more-link btn-link",OnClick:function(R,S){S.Event.stopPropagation();this.showBootstrapModal(this,this.entity())},tooltip:"View more details"}),pnlPrice:V3.UI.Panel().Defaults({cssClass:"price-col"}),lblPriceFrom:V3.UI.Label().Defaults({cssClass:"price-from",autoVisibility:true}),lblPrice:V3.UI.Label().Defaults({cssClass:"price",autoVisibility:true}),lblPriceType:V3.UI.Label().Defaults({cssClass:"price-type",autoVisibility:true}),pnlCampaignOffers:V3.UI.Panel().Defaults({cssClass:"campaign-offers"}),lblHavingOffers:V3.UI.Label().Defaults({cssClass:"having-offer",autoVisibility:true}),lblCampaignOfferIconCtrl:V3.UI.Label().Defaults({cssClass:"star-container max-width-4 two-rows",autoVisibility:false}),btnOrder:V3.UI.Button().Defaults({cssClass:"btn btn-primary btn-gridview",OnClick:function(T,X){this.OnOrderClicked.fire(this,{productId:this.entity().Id,serviceId:this.parentId()});try{var W=this.entity();var S=V3.CABS.IndustryCategoryEnum.fromValue(W.IndustryCategory)._displayName;var R=V3.CABS.IndustryCategoryGroupEnum.fromValue(W.IndustryCategoryGroups[0])._displayName;var U={DistributorName:providerSearchControlSettings.GlobalSettings.Shortname,ProviderName:_gtagConfigParams.provider,CurrencyISOCode:window._DisplayCurrencyCode,ItemCategory:S,ItemCategory2:R,ItemPrice:parseFloat(W.Availability.Calendar.LowestRate)||0,ItemQty:1};V3.CABS.Analytics.sendViewItem(U)}catch(V){V3.Log.Error(V)}}}),btnMore:V3.UI.Button().Defaults({cssClass:"button blue more",OnClick:function(){this.OnMoreClicked.fire(this,{entity:this.entity()})}}),showMoreButton:V3.Property(true).OnChange(function(S,R){this.btnMore.visible(S)}),showOrderButton:V3.Property(true).OnChange(function(S,R){this.btnOrder.visible(S)}),parentId:V3.Property(),entity:V3.Property(null).OnChange(function u(aa){this._canBeVisible(!!aa);if(aa){if(V3.Is.Undefined(aa.Type)){throw new "Type is not set, this is required."}var ae="EntityTile Id: "+aa.Id;if(aa.Parent&&aa.Parent.Code){if(aa.Parent.Type==G.Provider){ae=ae+", Parent Shortname: "+aa.Parent.Code}else{ae=ae+", Parent Code: "+aa.Parent.Code}}var T=[];var W=aa||DebugResponse().Entities[0];var U=G.parse(W.Type);if(U==G.Service){this._cssClassAdd(true,"service");this.deiDetails.Set({entity:W});var Y=W.Children;var Z=null;Y.forEach(function(af){if(Z==null){Z=af.Availability.Calendar.LowestRate}else{if(Z>af.Availability.Calendar.LowestRate){Z=af.Availability.Calendar.LowestRate}}var ag=af.Availability.Calendar.DailyRates;ag.forEach(function(ah){if(ah.AvailableCampaignCodes!=null){if(T.length==0){T=ah.AvailableCampaignCodes}else{T=T.concat(ah.AvailableCampaignCodes.filter(function(ai){!T.some(function(aj){aj.Code===ai.Code})}))}}})});if(Z==null){this.lblPrice.text(V3.Res["EntityDisplay.Messages.Unavailable"]||"Unavailable")}else{this.lblPriceFrom.text(V3.Res["EntityDisplay.Price.From"]||"From:");this.lblPrice.text(Z.toStringFormat("C",V3.CultureInfo.currentUICulture()));this.lblPriceType.text(V3.Res["EntityDisplay.Price.Type"]||"Per Night")}if(T.length>0){this.lblHavingOffers.text(V3.Res["EntityDisplay.Campaign.HavingOffers"]||"Having Offer(s):");this.lblCampaignOfferIconCtrl.visible(true);var X=0;T.forEach(function(ag){var af=document.createElement("span");af.className="star"+X;if(X<5){af.innerHTML='<svg width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.5584 5.85372L10.5586 5.85392C10.7115 6.00684 10.7875 6.19085 10.7875 6.41875C10.7875 6.64665 10.7115 6.83066 10.5586 6.98358L6.98358 10.5586C6.83127 10.7109 6.64547 10.7875 6.4125 10.7875C6.17953 10.7875 5.99373 10.7109 5.84142 10.5586L1.44142 6.15858C1.36845 6.08561 1.30943 5.99857 1.26476 5.89548C1.22191 5.79658 1.2 5.69043 1.2 5.575V2C1.2 1.77846 1.27655 1.5938 1.43517 1.43517C1.5938 1.27655 1.77846 1.2 2 1.2H5.575C5.69043 1.2 5.79658 1.22191 5.89548 1.26476C5.99856 1.30943 6.08558 1.36843 6.15855 1.44139C6.15856 1.4414 6.15857 1.44141 6.15858 1.44142L10.5584 5.85372ZM3.25 4.2C3.51077 4.2 3.7389 4.10644 3.92267 3.92267C4.10644 3.7389 4.2 3.51077 4.2 3.25C4.2 2.98923 4.10644 2.7611 3.92267 2.57733C3.7389 2.39356 3.51077 2.3 3.25 2.3C2.98923 2.3 2.7611 2.39356 2.57733 2.57733C2.39356 2.7611 2.3 2.98923 2.3 3.25C2.3 3.51077 2.39356 3.7389 2.57733 3.92267C2.7611 4.10644 2.98923 4.2 3.25 4.2Z" fill="url(#tagGradient-'+X+')" stroke="#9FF168" stroke-width="0.4"></path><defs><linearGradient id="tagGradient-'+X+'" x1="5.99375" y1="1" x2="5.99375" y2="10.9875" gradientUnits="userSpaceOnUse"><stop id="gradient-start-'+X+'" stop-color="#9FF168"></stop><stop id="gradient-stop-'+X+'" offset="1" stop-color="#eef168"></stop></linearGradient></defs></svg>';this.lblCampaignOfferIconCtrl.Insert(af)}if(X==5){af.innerHTML="...";this.lblCampaignOfferIconCtrl.Insert(af)}X++}.bind(this));this.deiDetails.Insert(this.pnlCampaignOffers.Insert(this.lblHavingOffers,this.lblCampaignOfferIconCtrl))}else{this.pnlCampaignOffers.visible(false);this.deiDetails.cssClassAdd("has-no-offer")}this.deiDetails.OnMoreClicked.addEventHandler(function(af,ag){this.OnMoreClicked.fire(this,ag)}.bind(this))}else{if(U==G.Product){this._cssClassAdd(true,"product");this.deiDetails.Set({entity:W});var ad=F.parse(W.IndustryCategory).toGroup();var S=(ad==E.Shopping)?new Date().toStringFormat("date"):this._selectedDate.toStringFormat("date");var V=W.Availability.Calendar.DailyRates.find(function(af){return af.Date==S&&af.IsAvailable});if(V==null){if(ad!=E.Shopping){this.lblPrice.text(V3.Res["EntityDisplay.Messages.Unavailable"]||"Unavailable");this.btnOrder.cssClassAdd("disabled unavailable");this.btnOrder.enabled(false)}else{this.deiDetails.Set({showDescription:false});this.deiDetails.ctrlDescription.cssClassAdd("d-none");this.deiDetails.Parent.cssClassAdd("min-h-auto");this.lblViewMore.Parent.visible(false);this.pnlPrice.Parent.Parent.cssClassAdd("shopping");this.pnlPrice.Insert(this.lblPrice);this.btnOrder.text((V3.Res["EntityDisplay.ViewDetails.Text"]||"View Details"))}}else{if(V.AvailableCampaignCodes!=null){if(V.AvailableCampaignCodes.length>0){T=V.AvailableCampaignCodes}}if(T.length>0){this.lblHavingOffers.text(V3.Res["EntityDisplay.Campaign.HavingOffers"]||"Having Offer(s):");this.lblCampaignOfferIconCtrl.visible(true);var X=0;T.forEach(function(ah){var af=document.createElement("span");af.className="star"+X;var ag=providerSearchControlSettings.GlobalSettings.Campaign.Offers[ah.Code];if(X<5){af.innerHTML=af.innerHTML+'<svg width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.5584 5.85372L10.5586 5.85392C10.7115 6.00684 10.7875 6.19085 10.7875 6.41875C10.7875 6.64665 10.7115 6.83066 10.5586 6.98358L6.98358 10.5586C6.83127 10.7109 6.64547 10.7875 6.4125 10.7875C6.17953 10.7875 5.99373 10.7109 5.84142 10.5586L1.44142 6.15858C1.36845 6.08561 1.30943 5.99857 1.26476 5.89548C1.22191 5.79658 1.2 5.69043 1.2 5.575V2C1.2 1.77846 1.27655 1.5938 1.43517 1.43517C1.5938 1.27655 1.77846 1.2 2 1.2H5.575C5.69043 1.2 5.79658 1.22191 5.89548 1.26476C5.99856 1.30943 6.08558 1.36843 6.15855 1.44139C6.15856 1.4414 6.15857 1.44141 6.15858 1.44142L10.5584 5.85372ZM3.25 4.2C3.51077 4.2 3.7389 4.10644 3.92267 3.92267C4.10644 3.7389 4.2 3.51077 4.2 3.25C4.2 2.98923 4.10644 2.7611 3.92267 2.57733C3.7389 2.39356 3.51077 2.3 3.25 2.3C2.98923 2.3 2.7611 2.39356 2.57733 2.57733C2.39356 2.7611 2.3 2.98923 2.3 3.25C2.3 3.51077 2.39356 3.7389 2.57733 3.92267C2.7611 4.10644 2.98923 4.2 3.25 4.2Z" fill="url(#tagGradient-'+X+')" stroke="#9FF168" stroke-width="0.4"></path><defs><linearGradient id="tagGradient-'+X+'" x1="5.99375" y1="1" x2="5.99375" y2="10.9875" gradientUnits="userSpaceOnUse"><stop id="gradient-start-'+X+'" stop-color="#9FF168"></stop><stop id="gradient-stop-'+X+'" offset="1" stop-color="#eef168"></stop></linearGradient></defs></svg>';if(ag!=null){this.lblCampaignOfferIconCtrl.Insert(af)}}if(X==5){af.innerHTML="...";if(ag!=null){this.lblCampaignOfferIconCtrl.Insert(af)}}X++}.bind(this));this.deiDetails.Controls.insertAfter(this.pnlCampaignOffers.Insert(this.lblHavingOffers,this.lblCampaignOfferIconCtrl),this.deiDetails.lblHeader)}else{this.pnlCampaignOffers.visible(false)}this.lblPriceFrom.text(V3.Res["EntityDisplay.Price.From"]||"From:");this.lblPrice.text(V.Rate.toStringFormat("C",V3.CultureInfo.currentUICulture()));switch(ad){case E.Accommodation:this.lblPriceType.text(V3.Res["EntityDisplay.Price.Type.Accomodation"]||"Per Night");this.pnlPrice.Insert(this.lblPriceFrom,this.lblPrice,this.lblPriceType);break;case E.Activity:this.lblPriceType.text(V3.Res["EntityDisplay.Price.Type.Activity"]||"Per Person");this.pnlPrice.Insert(this.lblPriceFrom,this.lblPrice,this.lblPriceType);break;case E.Epicurean:this.lblPriceType.text(V3.Res["EntityDisplay.Price.Type.Epicurean"]||"Per Person");this.pnlPrice.Insert(this.lblPriceFrom,this.lblPrice,this.lblPriceType);break;case E.Shopping:this.deiDetails.Set({showDescription:false});this.deiDetails.ctrlDescription.cssClassAdd("d-none");this.deiDetails.Parent.cssClassAdd("min-h-auto");this.lblViewMore.Parent.visible(false);this.pnlPrice.Parent.Parent.cssClassAdd("shopping");this.pnlPrice.Insert(this.lblPrice);this.btnOrder.text((V3.Res["EntityDisplay.ViewDetails.Text"]||"View Details"));break}}}}var ac=providerSearchControlSettings.GlobalSettings.NoImageUrl;var R=null;if(W.Images!=null){var ab=W.Images.filter(function(af){return af.Url!=null})[0];if(ab!=null){R=new V3.UI.Image(ab.Url).Set({cssClass:"card-img-top"})}else{R=new V3.UI.Image(ac).Set({cssClass:"card-img-top"})}this.cardHeader.Insert(R)}else{R=new V3.UI.Image(ac).Set({cssClass:"card-img-top"});this.cardHeader.Insert(R)}this.lblViewMore.text((V3.Res["EntityDisplay.ViewMore.Text"]||"View More"))}}),showBootstrapModal:function(U,ae){var Z=providerSearchControlSettings.GlobalSettings.NoImageUrl;var ac=ae.Images!=null?ae.Images:[{Url:Z}];var R="";var ab=[];for(am=0;am<ac.length;am++){R+="<a href=\"javascript:void(0)\" onclick=\"document.getElementById('main-popup-image').src='"+ac[am].Url+'\'"><img src="'+ac[am].Url+'"></a>'}var ag=ae.Availability.Calendar.DailyRates;ag.forEach(function(aq){if(aq.AvailableCampaignCodes!=null){if(ab.length==0){ab=aq.AvailableCampaignCodes}else{ab=ab.concat(aq.AvailableCampaignCodes.filter(function(ar){!ab.some(function(at){at.Code===ar.Code})}))}}});var Y=document.createElement("div");if(ab.length>0){Y.className="campaign-offers";var W=document.createElement("span");W.className=" having-offer";W.innerHTML=V3.Res["EntityDisplay.Campaign.HavingOffers"]||"Having Offer(s):";Y.append(W);this.lblHavingOffers.text(V3.Res["EntityDisplay.Campaign.HavingOffers"]||"Having Offer(s):");this.lblCampaignOfferIconCtrl.visible(true);var am=0;ab.forEach(function(av){var au=document.createElement("span");au.className="star-container max-width-4 two-rows";var ar=document.createElement("span");ar.className="star"+am;var aq=document.createElement("span");aq.className="offer-description";var at=providerSearchControlSettings.GlobalSettings.Campaign.Offers[av.Code];ar.innerHTML=ar.innerHTML+'<svg width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.5584 5.85372L10.5586 5.85392C10.7115 6.00684 10.7875 6.19085 10.7875 6.41875C10.7875 6.64665 10.7115 6.83066 10.5586 6.98358L6.98358 10.5586C6.83127 10.7109 6.64547 10.7875 6.4125 10.7875C6.17953 10.7875 5.99373 10.7109 5.84142 10.5586L1.44142 6.15858C1.36845 6.08561 1.30943 5.99857 1.26476 5.89548C1.22191 5.79658 1.2 5.69043 1.2 5.575V2C1.2 1.77846 1.27655 1.5938 1.43517 1.43517C1.5938 1.27655 1.77846 1.2 2 1.2H5.575C5.69043 1.2 5.79658 1.22191 5.89548 1.26476C5.99856 1.30943 6.08558 1.36843 6.15855 1.44139C6.15856 1.4414 6.15857 1.44141 6.15858 1.44142L10.5584 5.85372ZM3.25 4.2C3.51077 4.2 3.7389 4.10644 3.92267 3.92267C4.10644 3.7389 4.2 3.51077 4.2 3.25C4.2 2.98923 4.10644 2.7611 3.92267 2.57733C3.7389 2.39356 3.51077 2.3 3.25 2.3C2.98923 2.3 2.7611 2.39356 2.57733 2.57733C2.39356 2.7611 2.3 2.98923 2.3 3.25C2.3 3.51077 2.39356 3.7389 2.57733 3.92267C2.7611 4.10644 2.98923 4.2 3.25 4.2Z" fill="url(#tagGradient-'+am+')" stroke="#9FF168" stroke-width="0.4"></path><defs><linearGradient id="tagGradient-'+am+'" x1="5.99375" y1="1" x2="5.99375" y2="10.9875" gradientUnits="userSpaceOnUse"><stop id="gradient-start-'+am+'" stop-color="#9FF168"></stop><stop id="gradient-stop-'+am+'" offset="1" stop-color="#eef168"></stop></linearGradient></defs></svg>';if(at!=null){au.append(ar);aq.innerHTML=at.Name;au.append(aq)}Y.append(au);am++})}var ai=F.parse(ae.IndustryCategory).toGroup();var ah=V3.Res["EntityDisplay.Price.From"]||"From:";var ad="";var ao=V3.Res["EntityDisplay.Button.Book.Text"]||"Book";var al=U.btnOrder.DOMElement.id;switch(ai){case E.Accommodation:ad=V3.Res["EntityDisplay.Price.Type.Accomodation"]||"Per Night";break;case E.Activity:ad=V3.Res["EntityDisplay.Price.Type.Activity"]||"Per Person";break;case E.Epicurean:ad=V3.Res["EntityDisplay.Price.Type.Epicurean"]||"Per Person";break;case E.Shopping:ah="&nbsp;";ad="&nbsp;";ao=V3.Res["EntityDisplay.Button.Order.Text"]||"Order";break}var V=ae.Features!=null?ae.Features:[];var T=ae.Features!=null?ae.Features:[];var aa=ae.Features!=null?ae.Features:[];var aj="";var X=4;if(aa.length>0){aa.sort(function(ar,aq){return ar.Name.localeCompare(aq.Name)});if(aa.length>8){X=Math.ceil(aa.length/2)}aj='<div class="features row col-lg-12">                                        <div class="features-title row col-lg-12">                                            <h6>'+(V3.Res["EntityDisplay.Features.Text"]||"Features:")+'</h6>                                        </div>                                        <div class="row col-lg-12">                                            <div class="col-lg-6 col-md-6 modal-para">                                                <ul class="list">';var ak=false;for(am=0;am<aa.length;am++){if((am==X)&&!ak){aj+=' </ul ></div><div class="col-lg-6 col-md-6 modal-para">                                            <ul class="list">';ak=true}aj+='<li class="list-item">'+aa[am].Name+"</li>"}aj+="</ul></div></div></div>"}var an=ae.Availability.Calendar.LowestRate!=null?ae.Availability.Calendar.LowestRate.toStringFormat("C",V3.CultureInfo.currentUICulture()):null;var af='<div class="col-8 col-md-8 col-sm-8 col-xs-8">'+ah+'<span class="space4"></span>                                            <div class="mainpriceA">'+an+'</div>                                            <div class="cardheadtextSleft">'+ad+'</div>                                          </div>                                        <div class="col-4 col-md-4 col-sm-4 col-xs-4 modalbtn">                                            <button type="button" class="btn btn-gridbook col-xs-12 col-sm-12 col-md-12 col-lg-12" onclick="document.getElementById(\'closeModal\').click();document.getElementById(\''+al+"').click()\">"+ao+"</button>                                          </div>";if(an==null){af='<div class="col-8 col-md-8 col-sm-8 col-xs-8"><div class="mainpriceA">'+(V3.Res["EntityDisplay.Messages.Unavailable"]||"Unavailable")+"</div></div>"}var ap='<div class="modal-header">                                        <h5 class="modal-title" id="viewmoreModal">'+(V3.Res["EntityDisplay.ViewMore.Text"]||"View More")+'</h5>                                        <button id="closeModal" type="button" class="close" data-dismiss="modal" aria-label="Close">                                          <span aria-hidden="true">&times;</span>                                        </button>                                      </div>                                      <div class="modal-body">                                        <div class="row">                                          <div class="col-md-6">                                            <img id="main-popup-image" class="modalimagebox rounded" src="'+ac[0].Url+'">                                          </div>                                          <div class="col-md-6 thumbnail-container">                                            <div class="test">                                             '+R+'                                            </div>                                          </div>                                        </div>                                        <div class="row">                                          <div class="col-lg-12">                                            <div class="modal-bodycontent">                                              <div class="modal-headtext">'+ae.Name+'</div>                                            </div>                                          </div>                                        </div>                                        <div class="modal-bodycontent">                                          '+Y.outerHTML+aj+'                                          <div class="row">                                            <div class="col-md-12 modal-para">                                              <p>'+ae.LongDescription+'</p>                                            </div>                                          </div>                                        </div>                                      </div>                                      <div class="modal-footer">                                        <div class="row col-12">                                          '+af+"                                        </div>                                      </div>                                    </div>";var S=document.getElementById("viewmoreModal");if(!S){S=document.createElement("div");S.classList.add("modal","fade");S.setAttribute("id","viewmoreModal");S.setAttribute("tabindex","-1");S.setAttribute("aria-labelledby","viewmoreModalLabel");S.setAttribute("aria-hidden","true");S.innerHTML='<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable" role="document"><div class="modal-content"></div></div>';document.body.appendChild(S)}S.querySelector(".modal-content").innerHTML=ap;S.classList.add("show");jQuery(S).modal("show")}});var o=function o(R){this.base("entity-tile-collection row product-row");this.dbComment=document.createComment("");this.Insert(this.dbComment);this.entities(R)}.InheritsFrom(V3.UI.Panel,{OnTileCreated:V3.EventPrototype("sender,e:{Tile}"),OnMoreClicked:V3.EventPrototype("sender, e:{entity:object}"),OnOrderClicked:V3.EventPrototype("sender, e:{productId:guid, serviceId:guid}"),OnShowOnMapClicked:V3.EventPrototype("sender, e:{entity:object}"),showServices:V3.Property(true).OnChange(function(R){this._refreshUI()}),showProducts:V3.Property(false).OnChange(function(R){this._refreshUI()}),entities:V3.Property(null).OnChange(function u(R){this._refreshUI()}),refreshUI:V3.Property(null).OnChange(function u(R){this._startDate=R;this._refreshUI()}),startDate:V3.Property(null).OnChange(function u(R){this._startDate=R}),selectedDate:V3.Property(null).OnChange(function u(R){this._selectedDate=R}),_startDate:new Date(),_selectedDate:new Date(),_refreshUI:function(){this.Controls.clear();var X=this.entities();if(!X){this._canBeVisible(false);return}this._canBeVisible(true);var Y=false;var V=false;for(i=0;i<X.length;i++){var T=X[i];if(V3.Is.Undefined(T.Type)){throw new "Type is not set, this is required."}var S="EntityTile Id: "+T.Id;if(T.Parent&&T.Parent.Code){if(T.Parent.Type==G.Provider){S=S+", Parent Shortname: "+T.Parent.Code}else{S=S+", Parent Code: "+T.Parent.Code}}this.dbComment.data=S;var R=null;var W=null;var U=G.parse(T.Type);if(U==G.Service){R=T;W=T.Children}else{if(U==G.Product){W=[T]}}if(R&&this.showServices()){this._renderService(R);Y=true}if(W&&this.showProducts()&&W.length){V=true;this._renderProductsInCard(W[0],this._startDate,this._selectedDate)}}this._cssClassToggle(true,Y,"has-services");this._cssClassToggle(true,V,"has-products")},_isServiceHavingLowestRate:function(R){var S=R.Children;var T=null;S.forEach(function(U){if(T==null){T=U.Availability.Calendar.LowestRate}else{if(T>U.Availability.Calendar.LowestRate){T=U.Availability.Calendar.LowestRate}}});return T!=null},_renderService:function(R){var S=new y(R).Set({showOrderButton:false,OnMoreClicked:function(T,U){this.OnMoreClicked.fire(self,U)}.bind(this),OnOrderClicked:function(T,U){throw new Error("Not supported")}.bind(this),OnShowOnMapClicked:function(T,U){this.OnShowOnMapClicked.fire(this,U)}.bind(this)});this.Insert(S);this.OnTileCreated.fire(this,{Tile:S,Service:R})},_renderProduct:function(S){var R=new y(S,S.ParentId);R.Set({OnMoreClicked:function(T,U){this.OnMoreClicked.fire(self,U)}.bind(this),OnOrderClicked:function(T,U){this.OnOrderClicked.fire(self,U)}.bind(this)});this.Insert(R);this.OnTileCreated.fire(this,{Tile:R,Service:service})},_renderProduct:function(S){var R=new y(S,S.ParentId);R.Set({OnMoreClicked:function(T,U){this.OnMoreClicked.fire(self,U)}.bind(this),OnOrderClicked:function(T,U){this.OnOrderClicked.fire(self,U)}.bind(this)});this.Insert(R)},_renderProductsInCard:function(U,R,T){var S=new x(U,U.ParentId,R,T);S.Set({OnMoreClicked:function(V,W){this.OnMoreClicked.fire(self,W)}.bind(this),OnOrderClicked:function(V,W){this.OnOrderClicked.fire(self,W)}.bind(this)});this.Insert(S)},_renderThreeProductsInOneRow:function(T){var U=new V3.UI.Panel().Set({cssClass:"row product-row"});for(var S=0;S<T.length;S++){var R=new x(T[S],T[S].ParentId);R.Set({OnMoreClicked:function(V,W){this.OnMoreClicked.fire(self,W)}.bind(this),OnOrderClicked:function(V,W){this.OnOrderClicked.fire(self,W)}.bind(this)});U.Insert(R)}this.Insert(U)}});var a=function a(R,S){this.base(R||"div");this.cssClass("scrolling-panel");this._debugMode=S;this.Style({overflow:"hidden",position:"relative"});this.activateContainer(new V3.UI.WebControlBasic("div").Set({cssClass:"container",Style:{position:"relative",whiteSpace:"nowrap"}}));this._templating=V3.clone(a.prototype._templating,{},this);this.OnVisibleChange.addEventHandler(function(V,U){if(U&&this._templating.shouldBeIndex!==null){var T=this._templating.shouldBeIndex;this._templating.shouldBeIndex=null;this._templating.ensureControlsAreCreatedForIndex(T);this._cssClassRem(true,"animate-scroll");this.scrollToIndex(T,false)}}.bind(this))}.InheritsFrom(V3.UI.WebControlBasic,{_offset:V3.Property(function M(){return -parseInt(this.DOMContainer.style.left,10)},function t(R){this.DOMContainer.style.left=(-R)+"px"}),_isAnimating:false,_delayTimer:0,scrollToControl:function(W,R,S){if(!this.Controls.contains(W)){throw new Error("specified control is not in collection")}var U=W.DOMElement.offsetLeft;if(this._debugMode){V3.Log.Debug("Scrolling panel to offset: "+U+"px")}if(this._isAnimating){$(this.DOMContainer).stop();this._offset(U);if(S){S(-U)}if(this._delayTimer){clearTimeout(this._delayTimer)}this._delayTimer=setTimeout(function(){this._isAnimating=false}.bind(this),800)}else{if(!R){this._offset(U);if(S){S(-U)}}else{var T=this._offset();var Y=T-U;var V;if(Y>0){V={left:"+="+Math.abs(Y)+"px"}}else{V={left:"-="+Math.abs(Y)+"px"}}var X=arguments[2];this._isAnimating=true;$(this.DOMContainer).stop().animate(V,{duration:O.Number(R)?R:400,step:(S?S:null),complete:function(){this._isAnimating=false}.bind(this)})}}},_templating:{index:-1,shouldBeIndex:null,allowedRange:{min:0,max:0},constructedRange:{min:0,max:0,lookup:{}},visibleItemCount:10,buffered:{left:7,right:7},currentSelection:{index:0,length:0},createControlCallback:function(S,R){throw new Error("Not supported")},controlDisposeCallback:function(S,R,T){},pool:[],createIndex:function(R){var S=this._templating;var T=(S.pool.length>0)?S.pool.pop():null;if(this._debugMode&&!T){V3.Log.Debug("creating new control for index: "+R)}T=S.createControlCallback(this,R,T);T.Index=R;if(this._debugMode){T.cssClassAdd("index"+R)}if(R>=S.currentSelection.index&&R<S.currentSelection.index+S.currentSelection.length){T.cssClassAdd(S.currentSelection.cssClass)}return T},removeIndex:function(R){var S=this._templating;var T=S.constructedRange.lookup[R];this.Controls.remove(T);delete S.constructedRange.lookup[R];if(S.currentSelection.cssClass){T.cssClassRem(S.currentSelection.cssClass)}T=S.controlDisposeCallback(this,R,T);if(T){S.pool.add(T)}},ensureControlsAreCreatedForIndex:function(ad){var ah=this._templating;if(!this.isVisible()){ah.shouldBeIndex=ad;return null}if(ad===ah.index){if(this._debugMode){V3.Log.Debug("Good news, no construction required!")}return false}var ac=Math.max(ah.allowedRange.min,ad);var W=Math.min(ah.allowedRange.max,ad+ah.visibleItemCount);var ae=ah.index;if(ah.constructedRange.min<=ac&&W<=ah.constructedRange.max){if(this._debugMode){V3.Log.Debug("Good news, no construction required!")}ah.index=ad;return false}if(this._debugMode){V3.Log.Debug("Making changes");var ag=new V3.Utils.StopWatch()}var Y=false;var U=Math.max(ah.allowedRange.min,ac-ah.buffered.left);var ab=Math.min(ah.allowedRange.max,W+ah.buffered.right);var af=(ah.index>ad);var V=af?(ah.index-ad)>ah.buffered.left:(ad-ah.index)>ah.buffered.right;if(V){Y=true;for(var X=ah.constructedRange.min;X<ah.constructedRange.max;X++){ah.removeIndex(X)}ah.constructedRange.min=U;ah.constructedRange.max=U;ah.index=af?(ab-ah.visibleItemCount):U;if(this._debugMode){V3.Log.Debug("large change detected, replacing contents now")}}else{if(this._debugMode){V3.Log.Debug("Making minor changes")}}var T=(ah.constructedRange.min>ac);var aa=(ah.constructedRange.max<W);var S;if(aa){if(ah.constructedRange.min<U){Y=true;if(this._debugMode){V3.Log.Debug("Removing "+(U-ah.constructedRange.min)+" cells from left")}for(var X=ah.constructedRange.min;X<U;X++){ah.removeIndex(X)}ah.constructedRange.min=U}S=document.createDocumentFragment();if(this._debugMode){V3.Log.Debug("Adding cells to right");ag.reset(true)}this.Controls._modifyDom=false;for(var X=ah.constructedRange.max;X<ab;X++){var R=ah.createIndex(X);this.Controls.add(R);S.appendChild(R.DOMElement);ah.constructedRange.lookup[X]=R}this.Controls._modifyDom=true;if(this._debugMode){ag.stop();var Z=(ab-ah.constructedRange.max);if(ag.getDuration()/Z>5){if(ag.getDuration()/Z>14){V3.Log.Error("adding cells to right took too long: "+ag.getDuration()+"ms to add "+Z)}else{V3.Log.Warn("adding cells to right took a while: "+ag.getDuration()+"ms to add "+Z)}}}ah.constructedRange.max=ab}else{if(T){if(ah.constructedRange.max>ab){if(this._debugMode){V3.Log.Debug("Removing "+(ah.constructedRange.max-ab)+" cells from right")}for(var X=ah.constructedRange.max-1;X>=ab;X--){ah.removeIndex(X)}ah.constructedRange.max=ab}S=document.createDocumentFragment();Y=true;if(this._debugMode){V3.Log.Debug("Adding cells to left");ag.reset(true)}this.Controls._modifyDom=false;for(var X=U;X<ah.constructedRange.min;X++){var R=ah.createIndex(X);this.Controls.addAt(0,R);S.appendChild(R.DOMElement);ah.constructedRange.lookup[X]=R}this.Controls._modifyDom=true;if(this._debugMode){ag.stop();var Z=(ah.constructedRange.min-U);if(ag.getDuration()/Z>3){V3.Log.Warn("adding cells to left took a while: "+ag.getDuration()+"ms to add "+Z)}}ah.constructedRange.min=U}}if(T&&this.DOMContainer.childNodes.length>0){this.DOMContainer.insertBefore(S,this.DOMContainer.childNodes[0])}else{this.DOMContainer.appendChild(S)}if(Y){if(this._debugMode){V3.Log.Debug("Correcting Position Offset to index: "+ah.index+", offset: "+ah.constructedRange.lookup[ah.index].DOMElement.offsetLeft)}this._offset(ah.constructedRange.lookup[ah.index].DOMElement.offsetLeft);this.cssClassTransitionSync("animate-scroll")}if(this._debugMode){V3.Log.Watch("_templating",ah)}ah.index=ad;return V},setCssClassNameOnCells:function(T,W,S,X){if(T>=W){return}var V=this._templating;for(var U=T;U<W;U++){var R=V.constructedRange.lookup[U];if(R){if(X){R.cssClassAdd(S)}else{R.cssClassRem(S)}}}},selectCells:function(V,W,R){var U=this._templating;var S=U.currentSelection;if(V===S.index&&W==S.length){if(this._debugMode){V3.Log.Debug("ensuring cells are highlighted")}U.setCssClassNameOnCells(S.index,S.index+S.length,S.cssClass,true,this)}else{if(this._debugMode){V3.Log.Debug("removing current highlight on cells")}U.setCssClassNameOnCells(S.index,S.index+S.length,S.cssClass,false,this);S.index=V;S.length=W;S.cssClass=R;if(this._debugMode){V3.Log.Debug("adding highlight on cells")}U.setCssClassNameOnCells(S.index,S.index+S.length,S.cssClass,true,this);var T=this._minDate.addDays(V);this.OnChangeSelectedCells.fire(this,{date:T,length:W})}},isInCurrentSelection:function(R){var S=this._templating.currentSelection;return(S.index<=R&&R<S.index+S.length)}},scrollToIndex:function(S,T,U){if(S<this._templating.allowedRange.min||S>=this._templating.allowedRange.max){throw new Error("index out of bounds")}var R=this._templating.ensureControlsAreCreatedForIndex(S);if(R===null){return}if(U!==false){if(V3.Utils.PageIsLoaded){this.scrollToControl(this._templating.constructedRange.lookup[S],!R&&T,U)}else{V3.Utils.OnLoad.addEventHandler(function(){this.scrollToControl(this._templating.constructedRange.lookup[S],!R&&T,U)}.bind(this))}}},enableTemplating:function(R){this._templating.allowedRange.min=R.minIndex;this._templating.allowedRange.max=R.maxIndex;this._templating.buffered.left=R.bufferLeft;this._templating.buffered.right=R.bufferRight;this._templating.visibleItemCount=R.visibleItemCount;if(R.createControlCallback){this._templating.createControlCallback=R.createControlCallback}if(R.controlDisposeCallback){this._templating.controlDisposeCallback=R.controlDisposeCallback}},get:function(R){return this._templating.constructedRange.lookup[R]},OnChangeSelectedCells:V3.EventPrototype("sender, e:{date:Date(), length:0 }"),selectCells:function(S,T,R){this._templating.selectCells(S,T,R||"selected")}});var h=function h(){this.base(this._doAdd,this._doRem)}.InheritsFrom(V3.Collection,{_index:null,_templateSettings:null,_doAdd:function(S,R,T){if(!(S instanceof a)){throw new Error("item must be an instance of ScrollingPanel")}T();this._initStrip(S,R);this._compileAnimationStepCallback()},_doRem:function(S,R,T){T();this._compileAnimationStepCallback()},_initStrip:function(S,R){if(this._templateSettings&&this._index!==null){S.enableTemplating(this._templateSettings);S.scrollToIndex(this._index,false)}},enableTemplating:function(R){this._templateSettings=R;this.forEach(function(S){S.enableTemplating(R)})},_compileAnimationStepCallback:function(){var S="";for(var R=1;R<this._collection.length;R++){S+="s["+R+"]._offset(-o); /*for(var x=0;x<10000;x++) for(var y=0;y<100000;y++);*/"}this._animationStepCallback=new Function("s","o",S).bind(this,this._collection)},_animationStepCallback:function(S){for(var R=1;R<this._collection.length;R++){this._collection[R]._offset(S)}},scrollToIndex:function(S,U,T){this._index=S;if(this.count()==0){return}var R=false;this.forEach(function(V){if(V._templating.ensureControlsAreCreatedForIndex(S)){R=true}if(!U){V._cssClassRem(true,"animate-scroll");V._cssClassRem(true,"fast-scroll")}else{V._cssClassAdd(true,"animate-scroll");if(U){if(R){V._cssClassAdd(true,"fast-scroll")}else{V._cssClassRem(true,"fast-scroll")}}}});this.forEach(function(V){var W=V.get(S);if(W){V.tempNewOffset=W.DOMElement.offsetLeft}});if(O.Function(T)){T(R)}this.forEach(function(V){if(V3.Is.Number(V.tempNewOffset)){V._offset(V.tempNewOffset);delete V.tempNewOffset}})},selectCells:function(R,S){this.forEach(function(T){T.selectCells(R,S)})}});var c=function c(R){if(!R){throw new Error("settings must be supplied")}if(!R.EndPoint){throw new Error("EndPoint must be supplied")}if(!R.Shortname){throw new Error("Shortname must be supplied")}this._endPointUrl=R.EndPoint;this._campaign=R.Campaign;this._channelShortname=R.Shortname;this._providerShortname=R.ProviderShortname;this._partnerShortname=R.PartnerShortname;this._isInternalInjection=R.InternalInjection;this._brandingStyle=R.BrandingStyle;this._brandingView=R.BrandingView}.InheritsFrom(V3.Class,{_endPointUrl:"",_knownUrlKeys:["exl_dn","exl_psn","exl_ptn","exl_cmp","exl_snc","exl_bku","exl_pgc","exl_srt","exl_lng","exl_cur","exl_dtx","exl_lid","exl_sid","exl_grp","exl_dte","exl_nts","exl_ad","exl_ch","exl_co","exl_dof"],_addOverridesThenRemove:function(R,S){this._knownUrlKeys.forEach(function(T){var U=R[T];if(V3.Is.Defined(U)){if(!V3.Is.String(U)){throw new Error("direct url parameter must be of type string, key:"+T+", value:"+U)}S[T]=U;delete R[T]}});if(!S.exl_lng){S.exl_lng=V3.CultureInfo.currentUICulture().name()}if(!S.exl_cur){S.exl_cur=V3.CultureInfo.currentUICulture().currencyISOAbbreviation()}},_doInjection:function(R,X,W){var T=document.createElement("form");T.action=this._endPointUrl;T.method="POST";T.target=(R?"_blank":"_top");var V=function(Z,aa){var Y=document.createElement("input");Y.type="hidden";Y.name=Z;if(aa.toJSON){Y.value=aa.toJSON()}else{Y.value=aa.toString()}T.appendChild(Y)};for(var S in X){var U=X[S];if(V3.Is.Specified(U)){V(S,U)}}if(W){for(var S in W){var U=W[S];if(V3.Is.Specified(U)){V("ext_"+S,U)}}}document.body.appendChild(T);T.submit();document.body.removeChild(T)},searchInjection:function(R){return this._gridPageInjection(R,"SearchInjection")},availabilityInjection:function(R){if((!R.ProviderShortname&&!R.exl_psn)&&(!this._isInternalInjection&&!R.pgid)){throw new Error("ProviderShortname or exl_psn must be supplied")}return this._gridPageInjection(R,"AvailabilityInjection")},_gridPageInjection:function(Z,S){if(!Z){Z={}}if(!Z.Criteria){Z.Criteria={}}if(!Z.Criteria.Pax){Z.Criteria.Pax={}}if(!Z.Criteria.Destination){Z.Criteria.Destination={}}var R=V3.extend(Z.PostDto,false,{Favourites:Z.Favourites,HighlightProductId:Z.HighlightProductId});delete Z.Favourites;var V=Z.exl_cmp||(this._campaign&&this._campaign.CampaignCodes?this._campaign.CampaignCodes.join(","):"");var W=null;if(V){if(Z.exl_snc){W=Z.exl_snc}}delete Z.ShowNonAdCampaignServices;delete Z.ShowNonDealCampaignServices;var Y=Z.Criteria.Date;if(Y){if(V3.Is.Date(Y)){Y=Y.toStringFormat("date")}}var X=null;if(V3.Is.Specified(Z.Criteria.IndustryCategoryGroup)){var X=E.parse(Z.Criteria.IndustryCategoryGroup);if(X==E.Accommodation){X="acc"}else{if(X==E.Activity){X="act"}else{if(X==E.Epicurean){X="epc"}else{if(X==E.Shopping){X="shp"}else{if(X==E.Transportation){X="trn"}else{throw new Error("Unrecognized IndustryCategoryGroup: "+X)}}}}}}var T={type:S,data:JSON.stringify(R),exl_dn:Z.exl_dn||this._channelShortname,exl_bs:Z.exl_bs||this._brandingStyle,exl_bv:Z.exl_bv||this._brandingView,exl_psn:Z.exl_psn||Z.ProviderShortname||this._providerShortname,exl_ptn:Z.exl_ptn||Z.PartnerShortname||this._partnerShortname,exl_lng:Z.exl_lng||V3.CultureInfo.currentUICulture().name(),exl_cur:Z.exl_cur||V3.CultureInfo.currentUICulture().currencyISOAbbreviation(),exl_cmp:V,exl_snc:W,exl_pgc:!Z.ServiceCodes?null:Z.ServiceCodes.join(","),exl_ilc:!Z.IncludedLocationCodes?null:Z.IncludedLocationCodes.join(","),exl_srt:Z.SortBy,exl_grp:X,exl_dtx:Z.Criteria.Destination.Text,exl_lid:Z.Criteria.Destination.LocationId,exl_sid:Z.Criteria.Destination.ServiceId,exl_dte:Y,exl_nts:(Z.Criteria&&Z.Criteria.Nights),exl_ad:(Z.Criteria.Pax.Adults||Z.Criteria.Pax.Guests),exl_ch:(Z.Criteria.Pax.Children),exl_co:(Z.Criteria.Pax.Seniors),db_mod:V3.Utils.QueryString.db_mod};delete Z.Criteria;delete Z.campaignCodes;if(!this._isInternalInjection){if(V3.Is.Specified(Z.BackUrl)){T.exl_bku=Z.BackUrl}else{T.exl_bku=document.location.href}}else{if(Z.pgid){T.pgid=Z.pgid}}this._addOverridesThenRemove(Z,T);T.options=JSON.stringify(Z);var U=Z.OpenInNewWindow;delete Z.OpenInNewWindow;return this._doInjection(U,T,Z.AdditionalParams)},bookingInjection:function(W,S){var R=V3.extend(S.PostDto,false,{Products:[]});if(W){W.forEach(function(X){R.Products.add({AdCampaignCode:X.AdCampaignCode,ProductId:X.ProductId,Commence:X.Commence.toStringFormat(),Conclude:X.Conclude.toStringFormat(),Pax:X.Pax,TotalPrice:X.TotalPrice,DealCampaignCode:X.DealCampaignCode,CampaignCodes:X.CampaignCodes})})}var T=S.exl_cmp||(this._campaign&&this._campaign.CampaignCodes.length>0?this._campaign.CampaignCodes.join(","):"");var V={type:"BookingInjection",data:JSON.stringify(R),exl_dn:S.exl_dn||this._channelShortname,exl_bs:S.exl_bs||this._brandingStyle,exl_bv:S.exl_bv||this._brandingView,exl_psn:S.exl_psn||S.ProviderShortname||this._providerShortname,exl_ptn:S.exl_ptn||S.PartnerShortname||this._partnerShortname,exl_lng:S.exl_lng||V3.CultureInfo.currentUICulture().name(),exl_cur:S.exl_lng||V3.CultureInfo.currentUICulture().currencyISOAbbreviation(),exl_cmp:T,db_dcs:V3.Utils.QueryString.db_dcs,db_mod:V3.Utils.QueryString.db_mod};if(!this._isInternalInjection){V.exl_bku=document.location.href}this._addOverridesThenRemove(S,V);V.options=JSON.stringify(S);var U=S.OpenInNewWindow;delete S.OpenInNewWindow;return this._doInjection(U,V,S.AdditionalParams)}});var d={sendEvent:function(R,S){if(typeof gtag=="function"){gtag("event",R,S)}},sendSearchAvailabilityResult:function(S){var R={send_to:typeof _GlobalMeasurementId!="undefined"?_GlobalMeasurementId:null,availability_perc:S.AvailabilityPerc.value,availability_perc_segment:S.AvailabilityPerc.label,days_out:S.DaysOutAvail.value,products_listed:S.ProductsListed.value,products_listed_segment:S.ProductsListed.label,search_time_sec:S.SearchTimeSec.value,search_time_sec_segment:S.SearchTimeSec.label};if(S.ServiceCount.value){R.service_count=S.ServiceCount.value}if(S.PageCurrent.value){R.page_current=S.PageCurrent.value}if(S.PageCount.value){R.page_count=S.PageCount.value}if(S.IndustryCategoryGroup.value!=""){R.industry_category_group=S.IndustryCategoryGroup.value}this.sendEvent(S.IsSearchPage?"search_availability_result":"provider_availability_result",R)},sendViewItem:function(R){this.sendEvent("view_item",{send_to:_GlobalMeasurementId,currency:R.CurrencyISOCode,value:R.ItemPrice,items:[{item_id:R.ProviderName,item_name:R.ProviderName,affiliation:R.DistributorName,coupon:"",discount:0,index:0,item_brand:"",item_category:R.ItemCategory,item_category2:R.ItemCategory2,item_category3:"",item_category4:"",item_category5:"",item_list_id:"",item_list_name:"",item_variant:"",location_id:"",price:R.ItemPrice,quantity:1}]})},sendAddToCart:function(R){this.sendEvent("add_to_cart",{send_to:_GlobalMeasurementId,currency:R.CurrencyISOCode,value:R.ItemPrice,items:[{item_id:R.ProviderName,item_name:R.ProviderName,affiliation:R.DistributorName,coupon:"",discount:0,index:0,item_brand:"",item_category:R.ItemCategory,item_category2:R.ItemCategory2,item_category3:"",item_category4:"",item_category5:"",item_list_id:"",item_list_name:"",item_variant:"",location_id:"",price:R.ItemPrice,quantity:R.ItemQty}]})},getSearchAvailabilityMetrics:function(W,T,ac){var ab={NormalisedAvailability:0,ProductCount:0,AvailableProductCount:0,ProductListed:0,SearchTime:ac-T,NumberOfDaysOutSearched:0,ServiceCount:W.Paging?W.Paging.NumberOfResults:null,CurrentPage:W.Paging?W.Paging.PageNumber:null,PageCount:W.Paging?W.Paging.NumberOfPages:null,IndustryCategoryGroup:"",IsSearchPage:false};var V=typeof _gtagConfigParams!="undefined"?(typeof _gtagConfigParams.provider=="undefined"?true:false):false;var ad=null;if(W){if(W.Entities){for(var aa in W.Entities){var X=W.Entities[aa].Children!=null?true:false;if(X){var S=W.Entities[aa].Children;for(var U in S){if(S[U].Availability){var Z=S[U].Availability.Calendar.DailyRates;for(var R in Z){var Y=Z[R];ab.ProductCount++;if(Y.IsAvailable){ab.AvailableProductCount++}if(ad==null){ad=Y.Date}}ab.ProductListed++}}}else{if(W.Entities[aa].Availability){var Z=W.Entities[aa].Availability.Calendar.DailyRates;for(var R in Z){var Y=Z[R];ab.ProductCount++;if(Y.IsAvailable){ab.AvailableProductCount++}if(ad==null){ad=Y.Date}}ab.ProductListed++}}}if(!V){ab.ServiceCount=1}if(W.Entities.length>0){if(W.Entities[0].IndustryCategoryGroups){ab.IndustryCategoryGroup=V3.CABS.IndustryCategoryGroupEnumForPresentations.fromValue(W.Entities[0].IndustryCategoryGroups[0])._displayName;window._recentIndustryCategoryGroup=ab.IndustryCategoryGroup}else{ab.IndustryCategoryGroup=window._recentIndustryCategoryGroup}}ab.IsSearchPage=V}if(W.Paging){ab.CurrentPage=W.Paging.PageNumber;ab.PageCount=W.Paging.NumberOfPages}}ab.NumberOfDaysOutSearched=Math.round(this.getDaysDiffWithToday(ad));if(ab.ProductCount>0){ab.NormalisedAvailability=parseInt((100*(ab.AvailableProductCount/ab.ProductCount)),10)}else{ab.NormalisedAvailability=0}return this.mapIntoSearchAvailaiblityMetrics(ab)},mapIntoSearchAvailaiblityMetrics:function(V){var R={SearchTimeSec:{},ProductsListed:{},AvailabilityPerc:{},DaysOutAvail:{},ServiceCount:{},PageCurrent:{},PageCount:{},IndustryCategoryGroup:{},IsSearchPage:false};R.IsSearchPage=V.IsSearchPage;var X=parseInt((V.SearchTime/1000).toFixed(0),10);var T;if(X<=5){T="00-05"}else{if(X<=10){T="06-10"}else{if(X<=15){T="11-15"}else{if(X<=30){T="16-30"}else{if(X<=2000){T="31+"}else{if(X>2000){T="timed_out"}else{T="undefined"}}}}}}R.SearchTimeSec={value:X,label:T};var W=V.ProductListed;if(W==0){T="00"}else{if(W==1){T="01"}else{if(W<=3){T="02-03"}else{if(W<=10){T="04-10"}else{T="11+"}}}}R.ProductsListed={value:W,label:T};var S=parseInt(V.NormalisedAvailability.toFixed(0),10);if(S<=5){T="00-05"}else{if(S<=30){T="06-30"}else{if(S<=70){T="31-70"}else{if(S<=95){T="71-95"}else{T="96-100"}}}}R.AvailabilityPerc={value:S,label:T};var U=V.NumberOfDaysOutSearched;if(U<=6){T="000-006_"+T}else{if(U<=13){T="007-013_"+T}else{if(U<=27){T="014-027_"+T}else{if(U<=60){T="028-060_"+T}else{if(U<=90){T="061-090_"+T}else{if(U<=181){T="091-181_"+T}else{T="182+_"+T}}}}}}R.DaysOutAvail={value:U,label:T};R.ServiceCount={value:V.ServiceCount,label:""};R.PageCurrent={value:V.CurrentPage,label:""};R.PageCount={value:V.PageCount,label:""};R.IndustryCategoryGroup={value:V.IndustryCategoryGroup,label:""};return R},getDaysDiffWithToday:function(W){var U=new Date();var T=new Date(U.getFullYear()+"-"+(parseInt(U.getMonth())+1)+"-"+U.getDate());var S=W?new Date(W):T;var R=S.getTime()-T.getTime();var V=R/(1000*3600*24);return V}};V3.Namespace("CABS");V3.CABS.EntityTypeEnum=G;V3.CABS.IndustryCategoryEnum=F;V3.CABS.IndustryCategoryGroupEnum=E;V3.CABS.IndustryCategoryGroupEnumForPresentations=w;V3.CABS.AvailabilityMergeMethod=I;V3.CABS.Injection=c;V3.CABS.LocationTypeEnum=D;V3.CABS.Analytics=d;V3.Namespace("CABS.UI");V3.CABS.Utils=H;V3.CABS.UI.DisplayFeatures=A;V3.CABS.UI.DisplayProductNames=v;V3.CABS.UI.DisplayEntityInfo=n;V3.CABS.UI.DisplayEntityCardInfo=z;V3.CABS.UI.DisplayEntityTile=y;V3.CABS.UI.DisplayEntityTileCollection=o;V3.CABS.UI.DisplayEntityCard=x;V3.CABS.UI.DisplayAccreditation=m;V3.CABS.UI.DisplayImages=g;V3.CABS.UI.DisplayAddress=b;V3.CABS.UI.DisplayCityWithViewOnMap=k;V3.CABS.UI.DisplayRating=K;V3.CABS.UI.DisplayReviews=B;V3.CABS.UI.ScrollingPanel=a;V3.CABS.UI.ScrollingPanelsManager=h;V3.CABS.UI.TabsControl=P;V3.CABS.UI.ShowPrettyLightBox=e;V3.CABS.UI.PagingNavigation=L;V3.CABS.UI.ShowReviewsLightbox=N;V3.EventType.revertDefaultLoggingStatus()}); })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.CABS.UI.RateGrid",1,[{FileName:"V3.Utils",Version:1.1},"V3.UI","V3.API.EntityService","V3.CABS.UI.Common"],function(){V3.Namespace("CABS.UI");var k=false;if(V3.debugMode){k=V3.debuggingEnabledFor("grid");V3.Log.Info("RateGrid in debug mode: "+k+". (db_mod=grid)")}V3.EventType.setDefaultLoggingStatus(k);var j=V3.Is;var q=V3.CABS.IndustryCategoryGroupEnum;var a=V3.CABS.IndustryCategoryEnum;var e=V3.CABS.EntityTypeEnum;var c=V3.CABS.AvailabilityMergeMethod;var h=V3.CABS.UI.DisplayEntityInfo;var s=V3.CABS.UI.ScrollingPanel;var n=V3.CABS.UI.ScrollingPanelsManager;var i=V3.CultureInfo.invariantCulture().dateTimeFormat().abbreviatedDayNames();var m={Date:new V3Date().date(),MinDate:new V3Date().date(),MaxDate:new V3Date().date().addYears(1),ShowHeader:true,ShowFullRateColumn:false,DayOfWeekAlignment:"Sunday",VisibleDays:14,HeaderRowSettings:{FormatString:'ddd"<span class=\'day\'>"d"</span>"MMM'},RateCellSettings:{Unavailable:{Text:""},Updating:{Text:""}},HighlightedDays:1};var u=function u(x){this.base(null,k);this.cssClassAdd("dates");this._minDate=x.MinDate;this._cellLookup={};this._formatString=x.FormatString}.InheritsFrom(s,{_cellLookup:{},_minDate:new V3Date(),OnDateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),createCell:function(B,A,z){var y=this._minDate.addDays(A);if(!z){var x=this;z=new V3.UI.WebControlBasic("span").Set({OnClick:function(C,D){x.OnDateClicked.fire(x,{date:this.Date,cell:z})}});z.DateLabel=document.createElement("span");z.DateLabel.className="label";z.DOMElement.appendChild(z.DateLabel)}z.Date=y;z.cssClass("cell date "+i[y.getDay()].toLowerCase());z.DateLabel.innerHTML=y.toStringFormat(this._formatString,V3.CultureInfo.currentUICulture());this._cellLookup[A]=z;return z},disposeCell:function(z,y,x){delete this._cellLookup[y];return x}});var b=function b(x){this.base("span");if(window.vsDesignTime&&!x){x=window.getProviderSearchControlDefaultSettings(true).RateGridSettings.RateCellSettings}this._rateCellSettings=x;if(this._rateCellSettings.ShowCurrencySymbol){this._overrideCurrencyFormat=V3.CultureInfo.currentUICulture().currencyNumberFormat()}else{this._overrideCurrencyFormat=new V3.NumberFormatInfo({Symbol:""},V3.CultureInfo.currentUICulture().currencyNumberFormat())}this._lblStar.innerHTML="";this._updatingMarker.innerHTML=(this._rateCellSettings.Updating.Text||"");this.Insert(this._lblStar,this._lblBigStar,this._lbl,this._updatingMarker,this._img);this.reset()}.InheritsFrom(V3.UI.WebControlBasic,{_rateCellSettings:null,_lblStar:V3.AutoConstruct(function(){var x=document.createElement("span");x.className="star-container";return x}),_lbl:V3.AutoConstruct(function(){var x=document.createElement("span");x.className="label";return x}),_updatingMarker:V3.AutoConstruct(function(){var x=document.createElement("span");x.className="updating-marker";x.innerHTML="Updating...";return x}),dailyRate:V3.Property(-1).OnChange(function(z){if(!z){this.cssClassAdd("unknown");this.cssClassRem("unavail");this._lbl.innerHTML="";this._lblStar.innerHTML=""}else{this.cssClassRem("unknown");if(z.IsAvailable&&z.Rate!=null){this.cssClassRem("unavail");var y=z.Rate.toStringFormat("C",this._overrideCurrencyFormat);this._lbl.innerHTML=y}else{this.cssClassAdd("unavail");this._lbl.innerHTML=(this._rateCellSettings.Unavailable.Text||"")}this._lblStar.innerHTML="";if(z.AvailableCampaignCodes){if(this._rateCellSettings.Campaign&&z.IsAvailable){var E=Object.keys(this._rateCellSettings.Campaign.Offers).length!==0&&this._rateCellSettings.Campaign.Offers.constructor===Object;var D=z.AvailableCampaignCodes.map(function(I){return I.Code});var B=D.length>5?5:D.length;if(D.length>0&&E){this._lblStar.className="star-container max-width-"+B+(D.length>3?" two-rows":"");this.cssClassAdd("multiple-promo promo-mark mini star"+B+(D.length>3?" two-rows":""));for(var A=0;A<D.length;A++){if(A<B){var F=this._rateCellSettings.Campaign.Offers[D[A]].Index;var x=this._rateCellSettings.Campaign.Offers[D[A]].StartGradientColour;var H=this._rateCellSettings.Campaign.Offers[D[A]].EndGradientColour;var C=document.createElement("span");C.className="star"+A;C.innerHTML='<svg width= "12" height = "12" viewBox = "0 0 12 12" fill = "none" xmlns = "http://www.w3.org/2000/svg" ><path d="M10.5584 5.85372L10.5586 5.85392C10.7115 6.00684 10.7875 6.19085 10.7875 6.41875C10.7875 6.64665 10.7115 6.83066 10.5586 6.98358L6.98358 10.5586C6.83127 10.7109 6.64547 10.7875 6.4125 10.7875C6.17953 10.7875 5.99373 10.7109 5.84142 10.5586L1.44142 6.15858C1.36845 6.08561 1.30943 5.99857 1.26476 5.89548C1.22191 5.79658 1.2 5.69043 1.2 5.575V2C1.2 1.77846 1.27655 1.5938 1.43517 1.43517C1.5938 1.27655 1.77846 1.2 2 1.2H5.575C5.69043 1.2 5.79658 1.22191 5.89548 1.26476C5.99856 1.30943 6.08558 1.36843 6.15855 1.44139C6.15856 1.4414 6.15857 1.44141 6.15858 1.44142L10.5584 5.85372ZM3.25 4.2C3.51077 4.2 3.7389 4.10644 3.92267 3.92267C4.10644 3.7389 4.2 3.51077 4.2 3.25C4.2 2.98923 4.10644 2.7611 3.92267 2.57733C3.7389 2.39356 3.51077 2.3 3.25 2.3C2.98923 2.3 2.7611 2.39356 2.57733 2.57733C2.39356 2.7611 2.3 2.98923 2.3 3.25C2.3 3.51077 2.39356 3.7389 2.57733 3.92267C2.7611 4.10644 2.98923 4.2 3.25 4.2Z" fill="url(#tagGradient-'+A+')" stroke="#'+x+'" stroke-width="0.4"/></g><defs><linearGradient id="tagGradient-'+A+'" x1="5.99375" y1="1" x2="5.99375" y2="10.9875" gradientUnits="userSpaceOnUse"><stop id="gradient-start-'+A+'" stop-color="#'+x+'"/><stop id="gradient-stop-'+A+'" offset="1" stop-color="#'+H+'" /></linearGradient></defs></svg>';this._lblStar.appendChild(C)}}if(D.length>B){var G=document.createElement("span");G.innerHTML="..";G.className="star-dots";this._lblStar.appendChild(G)}this._lbl.className+=(" with-offer"+(D.length>B?" wrap":""))}else{this.cssClassAdd("single-promo")}}}}}),reset:function(){this.cssClass("cell rate unknown")}});var d=function d(y){this.base(null,k);this._rateCellSettings=y;this._minDate=y.MinDate;this.cssClassAdd("rates");var x=this.selectCells;this.selectCells=function(B,C,z){var A=x.apply(this,arguments);this._checkIfSelectedCellsAreAvailable();return A}}.InheritsFrom(s,{_cellLookup:V3.AutoConstruct(Object),_availabilityLookup:V3.AutoConstruct(Object),OnRateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),OnSelectedCellsAvailabilityChanged:V3.EventPrototype("sender, e:{isAvail:true}"),_selectedCellsAreAvailable:false,createCell:function(B,A,x){var z=new V3Date(this._minDate).addDays(A);if(x){x.reset()}else{var y=this;x=new b(this._rateCellSettings).Set({OnClick:function(C,D){y.OnRateClicked.fire(y,{date:this.Date,cell:x})}})}x.Date=z;x.cssClassAdd(i[x.Date.getDay()].toLowerCase());this._cellLookup[A]=x;x.dailyRate(this._availabilityLookup[A]);return x},disposeCell:function(z,y,x){x.cssClassRem(i[x.Date.getDay()].toLowerCase());delete this._cellLookup[y];return x},_checkIfSelectedCellsAreAvailable:function(){var y=this._templating.currentSelection;var z=true;for(var x=y.index;x<y.index+y.length;x++){if(!this._availabilityLookup[x]||!this._availabilityLookup[x].IsAvailable){z=false;break}}if(z!==this._selectedCellsAreAvailable){this._selectedCellsAreAvailable=z;this.OnSelectedCellsAvailabilityChanged.fire(this,{isAvail:z})}},isMissingAvailability:function(){var x=this._templating.index;var z=x+this._templating.visibleItemCount;for(var y=x;y<z;y++){if(!this._availabilityLookup[y]){return true}}return false},setAvailability:function(A,C){for(var B=0;B<C.Calendar.DailyRates.length;B++){var y=C.Calendar.DailyRates[B];if(typeof providerSearchControlSettings!="undefined"){if(providerSearchControlSettings.GlobalSettings.ExcludedProductIdsFromCampaign.includes(A)){y.AvailableCampaignCodes=""}}var z=new V3Date(y.Date).getDaysBetween(this._minDate);this._availabilityLookup[z]=y;var x=this._cellLookup[z];if(x){x.dailyRate(y)}if(this._templating.isInCurrentSelection(z)){this._checkIfSelectedCellsAreAvailable()}}},hasAvailability:function(z){var y=z.asV3Date().getDaysBetween(this._minDate);var x=this._availabilityLookup[y];if(x&&x.IsAvailable){return true}else{return false}},selectedCellsAreAvailable:function(){return this._selectedCellsAreAvailable}});var f=function f(x){this.base("row");this._owner=x;if(!x.showFullRateColumn()){this.FullRateCell=null}var y=this;this.Controls._onAdd=function(z){if(z instanceof s){y._SP=z}else{z.activateContainer()}};this.OnVisibleChange.addEventHandler(this._onVisibleChanged)}.InheritsFrom(V3.UI.Panel,{AssociatedRows:V3.Collection(function p(A,y,z){A.cssClassAdd("associated");var x=y==0?this:this.AssociatedRows.get(y-1);this._owner.Rows.insertAfter(A,x);z()},function v(z,x,y){z.cssClassRem("associated");this._owner.Rows.remove(z);y()}).InjectOwner(),_expandedHeight:null,recalculateHeight:function(A){var y=this.collapsed();if(A||y||!this._expandedHeight){var z=this.DOMElement.style.height;this.DOMElement.style.height="auto";this._expandedHeight=this.DOMElement.clientHeight;this.DOMElement.style.height=z;var B=this.DOMElement.clientHeight}var x=(y?0:this._expandedHeight);this.DOMElement.style.height=x+"px";if(this._SP){this._SP.DOMContainer.style.height=x+"px"}},_onVisibleChanged:function(y,x){if(x){setTimeout(this.recalculateHeight.bind(this),50)}},collapsed:V3.Property(false).OnChange(function(x){if(!x){this.visible(true);this.cssClassRem("collapsed");this.Style({height:this._expandedHeight})}else{this.cssClassAdd("collapsed");this.visible(false);this.Style({height:0});this.AssociatedRows.forEach(function(y){y.collapsed(true)})}})});var o=function o(x,y){this.base(x);this.enableLeftScroll=this._btnNavLeft.enabled;this.enableRightScroll=this._btnNavRight.enabled;if(!y.MinDate){throw new Error("MinDate must be supplied in the headerRowSettings")}this.Strip=new u({FormatString:y.FormatString,MinDate:y.MinDate}).Set({cssClassAdd:"cell",OnDateClicked:this.OnDateClicked});this.StripCell=this.Strip;if(x.showFullRateColumn()){this.FullRateCell=new V3.UI.Panel().Set({cssClass:"container full-rate"}).Insert("Full Rate")}this.FirstCell.OnClick.addEventHandler(function(z,A){this._btnNavLeft.performClick()}.bind(this));this.LastCell.OnClick.addEventHandler(function(z,A){this._btnNavRight.performClick()}.bind(this));this._btnNavLeft.text("");this._btnNavRight.text("");this.Insert(this.FirstCell.Insert(this._btnNavLeft.Insert(new V3.UI.Label("< Scroll left"))),this.FullRateCell,this.StripCell,this.LastCell.Insert(this._btnNavRight.Insert(new V3.UI.Label("Scroll Right >"))))}.InheritsFrom(f,{OnNavigate:V3.EventPrototype("sender, e:{direction:left | right}"),OnDateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),FirstCell:V3.UI.Panel().Defaults({cssClass:"cell navigate left"}),FullRateCell:null,LastCell:V3.UI.Panel().Defaults({cssClass:"cell navigate right"}),_btnNavLeft:V3.UI.HyperLink("","< Scroll Left").Defaults({OnClick:function(x,y){if(y){y.Event.stopPropagation()}this.OnNavigate.fire(this,{direction:"left"})}}),_btnNavRight:V3.UI.HyperLink("","Scroll Right >").Defaults({OnClick:function(x,y){if(y){y.Event.stopPropagation()}this.OnNavigate.fire(this,{direction:"right"})}}),recalculateHeight:function(){}});var r=function r(y,x){this.base(y);this.cssClassAdd("rates");if(window.vsDesignTime&&!x){x=window.getProviderSearchControlDefaultSettings(true).RateGridSettings}var z=x.RateCellSettings;z.Campaign=x.Campaign;z.ShowCurrencySymbol=x.ShowCurrencySymbol;this._stripContainer=new V3.UI.Panel().Set({cssClass:"cell strip"});this.StripCell=this.Strip=new d(z).Set({cssClassAdd:"cell",OnRateClicked:this.OnRateClicked});if(y.showFullRateColumn()){this.FullRateCell=new V3.UI.Panel().Set({cssClass:"cell full-rate"}).Insert("Full Rate")}this.Insert(this.FirstCell,this.FullRateCell,this.StripCell,this.LastCell)}.InheritsFrom(f,{FirstCell:V3.UI.Panel().Defaults({cssClass:"cell name"}),FullRateCell:null,LastCell:V3.UI.Panel().Defaults({cssClass:"cell controls"}),OnRateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),_fullRate:null});var w=function w(x){this.base("rate-grid");this.Controls=this.Rows;x=V3.extend(x,false,m);this._rateGridSettings=x;this._apiEntityService=new V3.API.EntityWebService(x.EntityServiceApiSettings);var y=new V3Date(x.Date||x.MinDate||x.MaxDate||null).date();this._minDate=new V3Date(x.MinDate||x.MaxDate||y.addDays(-7)).date();if(this._minDate<new V3Date()){this._minDate=new V3Date().date()}this._numberOfDays=new V3Date(x.MaxDate||this._minDate.addMonths(2)).date().getDaysBetween(this._minDate)+1;if(this._numberOfDays<x.VisibleDays){this._numberOfDays=x.VisibleDays}this.dayOfWeekAlignment(x.DayOfWeekAlignment);this.showFullRateColumn(x.ShowFullRateColumn);this.size(x.VisibleDays);this.date(y);this.highlightedDays(x.HighlightedDays);x.RateCellSettings.Date=this.date();x.RateCellSettings.MinDate=this._minDate;x.RateCellSettings.MaxDate=this._minDate.addDays(this._numberOfDays);if(x.ShowHeader){this.Insert(this.createNavigationRow(x.HeaderRowSettings))}this.OnVisibleChange.addEventHandler(function(A,z){if(z){this._updateScrollingPanelWidths()}})}.InheritsFrom(V3.UI.Panel,{OnDateChanged:V3.EventPrototype("sender, e:{date:V3Date}"),OnRowAdded:V3.EventPrototype("sender, e:{Row: row}"),Rows:V3.UI.ControlCollection(f).InjectOwner().Defaults({OnChange:function(y,z){var A=z.item;if(z.action=="add"){this._updateScrollingPanelWidths();this._updateRow(A,this.scrollingPanelWidth());this.OnRowAdded.fire(this,{Row:A})}else{if(z.action=="remove"){A.AssociatedRows.clear();if(A.Strip){this._stripManager.remove(A.Strip)}if(A.Entity){delete this._rowLookup[A.Entity.Id];delete this._pendingRowAvailability[A.Entity.Id];if(A.Entity.Children){for(var x=0;x<A.Entity.Children.length;x++){delete this._pendingRowAvailability[A.Entity.Children[x].Id]}}}}}}}),_apiEntityService:!window.vsDesignTime?null:new V3.API.EntityWebService(),_stripManager:n(),_index:0,_startIndex:0,_numberOfDays:0,_maxIndex:0,_maxVisibleIndex:0,_minDate:new V3Date(),_rowLookup:V3.Object(),_pendingRowAvailability:V3.Object(),_pageInitiallyLoaded:false,_searchTimerStart:null,_searchTimerEnd:null,_rateGridSettings:!window.vsDesignTime?null:window.getProviderSearchControlDefaultSettings(true).RateGridSettings,_createControlCallback:function(y,x,z){var z=y.createCell(y,x,z);return z},_controlDisposeCallback:function(y,x,z){return y.disposeCell(y,x,z)},updateInProgress:V3.Property(false).OnChange(function(y,x){if(y){this.cssClassAdd("updating")}else{this.cssClassRem("updating")}}),_canAlignDOW:function(){return(this.dayOfWeekAlignment()&&this.highlightedDays()+4<=this.size())},_updateStartDate:function(A){var z=this.date().asV3Date();var C=(z<this.startDate());if(A||C){var x=z;if(this._canAlignDOW()){x=x.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture())}x=V3Date.max(this._minDate,x);this.startDate(x)}else{var y=V3Date.max(this._minDate,z.addDays(this.highlightedDays()));var B=y>this.startDate().addDays(this.size());if(B){var x;if(this._canAlignDOW()){x=z.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture())}else{if(this.highlightedDays()<this.size()){x=z.addDays(this.highlightedDays()-this.size())}else{x=z}}x=V3Date.max(this._minDate,x);this.startDate(x)}}},ensureDateVisible:function(){this._updateStartDate()},_createRowForProduct:function(y,B,x){var C=new r(this,this._rateGridSettings).Set({cssClassAdd:"product",OnRateClicked:function(F,I){try{var E=V3.CABS.IndustryCategoryEnum.fromValue(y.IndustryCategory)._displayName;var D=V3.CABS.IndustryCategoryGroupEnum.fromValue(y.IndustryCategoryGroups[0])._displayName;var G={DistributorName:typeof providerSearchControlSettings!="undefined"?providerSearchControlSettings.GlobalSettings.Shortname:null,ProviderName:B?B.Parent.Code:(typeof providerSearchControlSettings!="undefined"?providerSearchControlSettings.GlobalSettings.ProviderShortname:null),CurrencyISOCode:window._DisplayCurrencyCode,ItemCategory:E,ItemCategory2:D,ItemPrice:parseFloat(I.cell.DOMElement.innerText)||0,ItemQty:1};V3.CABS.Analytics.sendViewItem(G)}catch(H){V3.Log.Error(H)}if(!this.date().equals(I.date)){this.date(I.date);I.changedDate=true}}.bind(this)});C.Entity=y;C.FirstCell.Insert(new h(y,B&&B.Settings&&B.Settings.Terminology).Set({showViewMoreButton:false}));if(k){C.FirstCell.Insert(y.Code)}this._rowLookup[C.Entity.Id]=C;this._stripManager.add(C.Strip);C.Strip.selectCells(this._index,this.highlightedDays());if(y.Availability&&y.Availability.Calendar){this._displayAvailabilityForEntity(y)}else{this.cssClassTransitionSync("updating");this._fetchAvailability(true)}var z=this._pendingRowAvailability[y.Id];if(z){delete this._pendingRowAvailability[y.Id];for(var A=0;A<z.length;A++){C.Strip.setAvailability(y.Id,z[A])}}return C},_addProductRowsForService:function(x,A){var z=new V3.UI.HyperLinkToggle("View",true).Set({cssClass:"button blue display-products",OnToggle:function(B,C){A.productRowsVisible(!C.collapsed)}});A.btnView=z;var y=this;A.OnRenderChildren=new V3.EventType("OnRenderChildren","sender",true);A.OnRenderChildren.addEventHandler(function(){A._renderChildren=V3.Constants.EMPTY_FUNCTION;x.Children.forEach(function(B){A.AssociatedRows.add(y._createRowForProduct(B,x,A))})});A.productRowsVisible=new V3.Property(A,true);A.productRowsVisible.OnChange.addEventHandler(function(B){if(B){A.OnRenderChildren.fire(this)}z.collapsed(!B);if(B){z.text(V3.Res["RateGrid.Button.View"]||"View")}else{z.text(V3.Res["RateGrid.Button.View"]||"View")}A.AssociatedRows.forEach(function(C){if(!C.Entity){return}C.collapsed(!B)});if(B){A.cssClassAdd("showing-products");if(A.Parent.Controls.indexOf(A)==1){A.Parent.Controls.get(0).cssClassAdd("showing-products")}}else{A.cssClassRem("showing-products");if(A.Parent.Controls.indexOf(A)==1){A.Parent.Controls.get(0).cssClassRem("showing-products")}}});A.productRowsVisible(false);A.LastCell.Insert(z);A.LastCell.OnClick.addEventHandler(function(B,C){z.performClick()});A.OnRateClicked.addEventHandler(function(B,C){A.productRowsVisible(C.changedDate||!A.productRowsVisible())})},_addRowForService:function(z,y,x){var A=new r(this,this._rateGridSettings).Set({cssClassAdd:"service",OnRateClicked:function(B,C){if(!this.date().equals(C.date)){this.date(C.date);C.changedDate=true}}.bind(this)});A.Entity=z;A.FirstCell.Insert(new h(z).Set({showViewMoreButton:false}));if(k){A.FirstCell.Insert(z.Code)}this._rowLookup[A.Entity.Id]=A;this.Rows.insertAfter(A,x);if(y&&z.Children){this._addProductRowsForService(z,A)}this._stripManager.add(A.Strip);A.Strip.selectCells(this._index,this.highlightedDays());if(z.Availability&&z.Availability.Calendar){this._displayAvailabilityForEntity(z)}else{this.cssClassTransitionSync("updating");this._fetchAvailability(true)}return A},_displayAvailabilityForEntity:function(y){y=y||DebugResponse().Entities[0];if(!y.Availability||!y.Availability.Calendar){throw new Error("entityService has no availability data.")}var z=this._rowLookup[y.Id];if(z){z.Strip.setAvailability(y.Id,y.Availability)}else{var x=this._pendingRowAvailability[y.Id];if(!x){x=this._pendingRowAvailability[y.Id]=[]}x.add(y.Availability)}if(y.Children&&y.Children.length>0){this._displayAvailabilityForEntities(y.Children)}},_displayAvailabilityForEntities:function(y){for(var x=0;x<y.length;x++){this._displayAvailabilityForEntity(y[x])}},_getRequestAvailability:function(){return{StartDate:this.startDate().toStringFormat("yyyy-MM-dd"),NumberOfDays:this.size(),MergeMethod:c.LowestRateForCampaign,IncludeCampaigns:true}},_fetchAvailabilityTransactionId:null,_fetchAvailabilityTimerId:null,_fetchAvailability:function(y){this._fetchAvailabilityTransactionId=null;if(this._fetchAvailabilityTimerId){if(k){V3.Log.Debug("Cancelling ajax request delay timer")}clearTimeout(this._fetchAvailabilityTimerId);this._apiEntityService.Search;this._fetchAvailabilityTimerId=null}if(V3.isEmpty(this._rowLookup)){return}this.updateInProgress(true);if(y){if(k){V3.Log.Debug("Creating ajax request delay timer for 350ms...")}this._fetchAvailabilityTimerId=setTimeout(this._fetchAvailability.bind(this),1200);return}if(k){V3.Log.Debug("Performing call for availability now")}var x=[];var z=null;V3.forEach(this._rowLookup,function(B){if(B.Strip&&B.Strip instanceof d){if(!z){z=B.Entity.Type}x.add(B.Entity.Id,true);if(B.Entity.Children){for(var A=0;A<B.Entity.Children.length;A++){x.add(B.Entity.Children[A].Id,true)}}}});this._searchTimerStart=Date.now();this._apiEntityService.Search(this._apiAvailability_OnSuccess.bind(this),this._apiAvailability_OnFailure.bind(this),{TransactionId:this._fetchAvailabilityTransactionId=V3.newId(),CurrentCurrency:V3.CultureInfo.currentUICulture().currencyISOAbbreviation(),Language:V3.CultureInfo.currentUICulture().name(),Campaign:this._rateGridSettings.Campaign,Filter:{Ids:x,Type:z,MustBeInAdCampaign:false,MustBeInDealCampaign:false},Output:{Availability:this._getRequestAvailability(),Children:z==e.Product?null:{Filter:{Ids:x,Type:e.Product},Output:{Availability:this._getRequestAvailability()}}}})},_apiAvailability_OnSuccess:function(z){this._displayAvailabilityForEntities(z.Entities);if(z.TransactionId===this._fetchAvailabilityTransactionId){this.updateInProgress(false)}this._fetchAvailabilityTransactionId=null;if(typeof providerSearchControlSettings!="undefined"){if(providerSearchControlSettings.GlobalSettings.ProviderShortname!=""){this._pageInitiallyLoaded=true;window._runParentSearch=false}}if(typeof window._runParentSearch!="undefined"){if(window._runParentSearch){this._pageInitiallyLoaded=false}}if(this._pageInitiallyLoaded){try{this._searchTimerEnd=Date.now();var x=V3.CABS.Analytics.getSearchAvailabilityMetrics(z,this._searchTimerStart,this._searchTimerEnd);V3.CABS.Analytics.sendSearchAvailabilityResult(x)}catch(y){V3.Log.Error(y)}}else{this._pageInitiallyLoaded=true;window._runParentSearch=false}},_apiAvailability_OnFailure:function(x){if(!x.TransactionId||data.TransactionId===this._fetchAvailabilityTransactionId){if(x.response.Type==="V3Leisure.CABS.Site.CurrencyCoefficientException"){alert(x.response.Message+"\r\n\r\nPage will now refresh.");document.location.reload(true)}else{alert("Failed to fetch availability. Please try again later.\r\nError: "+x.message);this.updateInProgress(false)}}},showFullRateColumn:V3.Property(false,function l(x){if(x){this._cssClassAdd(true,"has-full-rate")}else{this._cssClassAdd(true,"no-full-rate")}}),highlightedDays:V3.Property(0,function l(z,x,y){if(!j.Number(z)){throw new Error("not a number")}if(z>this._numberOfDays){z=y.value=this._numberOfDays}}).OnChange(function g(x){if(x>1){if(this.date().addDays(x)>this._maxDate){this.date(this._maxDate.addDays(1-x));return}}this._updateStartDate();this._stripManager.selectCells(this._index,this.highlightedDays())}),dayOfWeekAlignment:V3.Property("Sunday",function l(x){new V3Date().getLastDOW(x,V3.CultureInfo.invariantCulture())}).OnChange(function g(x){this._updateStartDate(true)}),size:V3.Property(0,function l(y,x){if(!y||y<=0){throw new Error("size must be greater than zero")}}).OnChange(function g(x){this._maxIndex=(this._numberOfDays)-x;this._stripManager.enableTemplating({createControlCallback:this._createControlCallback.bind(this),controlDisposeCallback:this._controlDisposeCallback.bind(this),minIndex:0,maxIndex:this._numberOfDays,bufferLeft:7,bufferRight:7,visibleItemCount:x});this._updateScrollingPanelWidths()}),_updateNavigation:function(){this._cssClassToggle(true,(this.canScrollLeft()||this.canScrollRight()),"navigation-enabled","navigation-disabled")},canScrollLeft:V3.Property(true).OnChange(function(){this._updateNavigation()}),canScrollRight:V3.Property(true).OnChange(function(){this._updateNavigation()}),startDate:V3.Property(null,function l(z,x,y){z=y.value=V3Date.max(this._minDate,V3Date.min(this._minDate.addDays(this._maxIndex),new V3Date(z)));if(z==x){return false}}).OnChange(function g(y){this._startIndex=y.asV3Date().getDaysBetween(this._minDate);this.canScrollLeft(this._startIndex>0);this.canScrollRight(this._startIndex<this._maxIndex);if(k){var x=new V3.Utils.StopWatch(true)}var z=false;this._stripManager.scrollToIndex(this._startIndex,true,function(A){this._stripManager.forEach(function(B){if(B instanceof d){if(B.isMissingAvailability()){z=true;return false}}}.bind(this))}.bind(this));if(z){this._fetchAvailability(true)}this.cssClassTransitionSync("updating");if(k){x.stop();if(x.getDuration()>10&&x.getDuration()/this._stripManager.count()>35){V3.Log.Warn("Scrolling the rows took "+x.getDuration()+"ms.")}}}),date:V3.Property(null,function l(z,x,y){z=y.value=V3Date.max(this._minDate,V3Date.min(this._minDate.addDays(this._numberOfDays),new V3Date(z)));if(V3Date.equals(z,x)){return false}this._index=z.getDaysBetween(this._minDate)}).OnChange(function g(z,y){var x=(y===null);this._updateStartDate(x);this._stripManager.selectCells(this._index,this.highlightedDays());this.OnDateChanged.fire(this,{date:z})}),minDate:V3.Property(function t(){return new V3Date(this._minDate)}),maxDate:V3.Property(function t(){return this._minDate.addDays(Math.max(0,this._numberOfDays-1))}),createNavigationRow:function(x){x.MinDate=this._minDate;var y=new o(this,x).Set({cssClassAdd:"navigation",enableLeftScroll:this.canScrollLeft,enableRightScroll:this.canScrollRight,OnNavigate:function(z,A){if(A.direction==="left"){this.scrollLeft()}else{this.scrollRight()}}.bind(this),OnDateClicked:function(z,A){this.date(A.date)}.bind(this)});this._stripManager.add(y.Strip);y.Strip.selectCells(this._index,this.highlightedDays());return y},addRowForEntity:function(A,y,x,z){if(A.Type==e.Service){return this._addRowForService(A,y,x)}else{if(A.Type==e.Product){var B=this._createRowForProduct(A,z||(x&&x.Entity),x);this.Rows.add(B);return B}else{throw new Error("The specified entity is not supported.")}}},createRow:function(){var y=new f(this);var x=this;y.Controls.OnChange.addEventHandler(function(){x._updateRow(y,x.scrollingPanelWidth())});return y},scrollLeft:function(y){if(!j.Number(y)){y=7}var x=this.startDate().asV3Date().addDays(-y);if(y>=7&&this._canAlignDOW()){x=x.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture());if(this.startDate().getDaysBetween(x)>7){x=x.addDays(7)}}this.startDate(x)},scrollRight:function(y){if(!j.Number(y)){y=7}var x=this.startDate().asV3Date().addDays(y);if(y>=7&&this._canAlignDOW()){x=x.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture())}this.startDate(x)},cancelUpdate:function(){this._fetchAvailabilityTransactionId=null;if(this._fetchAvailabilityTimerId){clearTimeout(this._fetchAvailabilityTimerId)}this.updateInProgress(false)},scrollingPanelWidth:V3.Property(0).OnChange(function(x){this._updateAllRows()}),_updateAllRows:function(){var z=this.Rows.count();var y=this.scrollingPanelWidth();for(var x=0;x<z;x++){this._updateRow(this.Rows.get(x),y)}},_updateRow:function(y,x){if(y&&y.StripCell&&x){y.StripCell.DOMElement.style.width=x+"px";y.StripCell.DOMElement.style.flexBasis=x+"px";y.StripCell.DOMElement.style.msFlexPreferredSize=x+"px";if(y.StripCell.DOMContainer){y.StripCell.DOMContainer.style.width=x+"px"}}},_updateScrollingPanelWidths:function(){if(this.Rows.count()==0){return}var y=this.Rows.get(0);if(!y){return}if(y.Strip.Controls.count()==0){return}var x=y.Strip.Controls.get(0);var A=x.DOMElement.offsetWidth;var z=this.size()*A;this.scrollingPanelWidth(z)}});V3.CABS.UI.RateGrid=w;V3.CABS.UI.RateRow=r;V3.EventType.revertDefaultLoggingStatus()}); })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.CABS.UI.SearchControl",1,["V3.Utils","V3.UI","V3.CABS.UI.Common"],function(){V3.Namespace("CABS.UI");var p=V3.UI;var k=V3.CABS.IndustryCategoryGroupEnum;var l=V3.CABS.LocationTypeEnum;var g={EntityServiceApiSettings:{},Campaign:null,Terminology:null,InitialDestinations:["Perth, Western Australia","Melbourne, Victoria","Brisbane","Sydney","Darwin","Adelaide","Hobart","Canberra"],CompactPax:false,MaximumPax:20,ShowTabs:true,SmallTabs:false,ShowSearchButton:true,ShowDate:true,ShowDestination:true,ShowViewBy:false,MinDate:new V3Date(new V3Date().toStringFormat("yyyy-MM-dd")),MaxDate:new V3Date(new V3Date().toStringFormat("yyyy-MM-dd")).addDays(365),DateFormatString:"ddd, dd-MMM-yyyy",NightsOptional:false,PaxOptional:false,ButtonText:"Search",ShowChildren:true,ShowSeniors:true,ShowNumberOfProduct:false,NumberOfProduct:0,DestinationCompulsory:false,MaxDestinationsToDisplay:10,IncludeBusinesses:true,AllowedLocationCodes:null,AllowedLocationTypes:[l.City,l.Region],ShowAccommodation:true,ShowActivity:true,ShowEpicurean:false,ShowTransportation:false,ShowShopping:false,PriceRanges:[50,100,150,200,250,300,350,400,450,500],Criteria:{Destination:{LocationId:null,BusinessId:null,Text:null},IndustryCategoryGroup:k.Accommodation,Date:new V3Date(),Nights:2,Pax:{Adults:2,Children:0,Seniors:0}}};var d=function d(r){this.base();var t=r.InitialDestinations;var q=r.ICGroup;var u=r.EntityServiceApiSettings.EndPoint;this._shortname=r.EntityServiceApiSettings.Shortname;this._campaign=r.Campaign;this._terms=r.Terminology;this._includeBusinesses=r.CanIncludeBusinesses;this._allowedLocationParentCodes=r.AllowedLocationCodes;this._allowedLocationTypes=r.AllowedLocationTypes;this.OnVisibleChange.addEventHandler(function(w,v){if(v&&this.Controls.count()==0){this.performSearch(this._lastSearchText)}});if(t&&t.length>0){if(this._allowedLocationParentCodes&&this._allowedLocationParentCodes.length>0&&t===g.InitialDestinations){this._initialDestinations.add("%")}else{this._initialDestinations.addRange(t)}}if(!V3.WebServices||!V3.WebServices.EntityService){var s=u;if(!s){if(!window.vsDesignTime){V3.Log.Error("LocationService cannot be loaded because the serviceEndPointUrl has not been defined")}else{s="/CABS4/Services/LocationService.asmx"}}V3.Dynamic.LoadScript("V3.API.LocationService",s+"/GetJavascript")}}.InheritsFrom(V3.UI.Panel,{_initialDestinations:V3.AutoConstruct(Array),_initialDestinationsResponse:null,_initialDestinationsAreCodes:false,_shortname:null,_searchDelayTimerId:null,_updatingMarker:V3.UI.Label("Updating...").Defaults({cssClass:"updating-marker"}),_lastSearchText:null,OnLocationSelected:new V3.EventPrototype("sender, location"),OnBusinessSelected:new V3.EventPrototype("sender, business"),industryCategoryGroup:V3.Property(k.Accommodation).OnChange(function(q){if(this.visible()){this.performSearch(this._lastSearchText)}else{this.clearResults()}}),_getHeadingName:function(q){switch(q){case l.Country:return"Countries";case l.State:return"States/Territories";case l.Region:return"Regions";case l.City:return"Cities";case l.Landmark:return"Landmarks";case k.Accommodation:return V3.CABS.Utils.GetTerm("ICGAccommodation",this._terms);case k.Activity:return V3.CABS.Utils.GetTerm("ICGActivity",this._terms);case k.Epicurean:return V3.CABS.Utils.GetTerm("ICGEpicurean",this._terms);case k.Shopping:return V3.CABS.Utils.GetTerm("ICGShopping",this._terms)}},_showUpdating:function(){this.cssClassAdd("no-results");this.Controls.clear();this.Insert(this._updatingMarker)},_searchFailed:function(q){this.Controls.clear();this.Insert(new V3.UI.Label(V3.Res["Search.Error.Unexpected"]||"Unexpected error has occurred").Set({cssClass:"error"}))},_searchSuccess:function(s){this.Controls.clear();var q=s.Data;var r=s.Parents;if(q.length==0){this.Insert(new V3.UI.Label(V3.Res["Search.Error.NoDestinationFound"]||"No Destinations found.").Set({cssClass:"no-results"}));return}this.cssClassRem("no-results");var t;t=null;var v=null;var w=this;var u=true;V3.forEach(q,function(z){if(t!=z.Type){t=z.Type;var A=k.parse(z.Type)||l.fromValue(z.Type);var y=new V3.UI.Panel().Set({cssClass:"type "+A.toString().toLowerCase()});if(A!=k.Accommodation&&A!=k.Activity&&A!=k.Epicurean&&A!=k.Shopping){if(u){u=false;y.cssClassAdd("first-location")}}v=new V3.UI.WebControl("ul");var D=w._getHeadingName(A);w.Insert(y.Insert(new V3.UI.Label().Set({cssClass:"data-icon "+V3.CABS.Utils.GetCssClassNameFromEnum(A)}),new V3.UI.Label("h3",D),v))}var C=z.Name;var B=null;if(z.Type==l.City||z.Type==l.Region){var E=r[z.ParentLocationId];if(E){if(w._allowedLocationParentCodes&&w._allowedLocationParentCodes.contains(E.Code)){B=null}else{B=V3.CABS.Utils.TryAbbreviateStateName(E.Name)}}}var x=new V3.UI.HyperLink(null,C).Set({cssClass:"result",OnClick:function(G,H){var F;if(z.Type==k.Accommodation||z.Type==k.Activity||z.Type==k.Epicurean||z.Type==k.Shopping){F=w.OnBusinessSelected.fire(w,z)}else{F=w.OnLocationSelected.fire(w,z)}}});if(B){x.Insert(new V3.UI.Label(" ("+B+")").Set({cssClass:"parent"}))}v.Insert(new V3.UI.WebControl("li").Insert(document.createComment(z.Id),x))})},clearResults:function(){this.Controls.clear()},maxDestinationsToDisplay:V3.Property(10),performSearch:function(s){if(!s){s=""}var q=this;if(s.length>=1){if(this._searchDelayTimerId){clearTimeout(this._searchDelayTimerId);this._searchDelayTimerId=null}this._lastSearchText=s;this._showUpdating();this._searchDelayTimerId=setTimeout(function(){V3.WebServices.EntityService.QuickSearch(q._searchSuccess.bind(q),q._searchFailed.bind(q),{Campaign:{AdCampaignCode:null,DealCampaignCode:this._campaign&&this._campaign.DealCampaignCode},ParentCodes:q._allowedLocationParentCodes,Names:["%"+s+"%"],DistributorShortname:q._shortname,IndustryCategoryGroup:q.industryCategoryGroup(),MaxResultsToReturn:q.maxDestinationsToDisplay(),Types:[].addRange(q._allowedLocationTypes).addRange(!q._includeBusinesses?[]:[k.Accommodation,k.Activity,k.Epicurean,k.Shopping])})},600)}else{if(this._initialDestinations.length==0){this._lastSearchText=null;this.clearResults()}else{this._lastSearchText=null;if(this._initialDestinationsResponse){q._searchSuccess(q._initialDestinationsResponse)}else{this._showUpdating();V3.WebServices.EntityService.QuickSearch(function r(t){q._initialDestinationsResponse=t;q._searchSuccess(q._initialDestinationsResponse)},this._searchFailed.bind(this),{Campaign:{AdCampaignCode:null,DealCampaignCode:this._campaign&&this._campaign.DealCampaignCode},ParentCodes:q._allowedLocationParentCodes,Codes:this._initialDestinationsAreCodes?q._initialDestinations:null,Names:this._initialDestinationsAreCodes?null:q._initialDestinations,DistributorShortname:q._shortname,IndustryCategoryGroup:null,MaxResultsToReturn:q.maxDestinationsToDisplay(),Types:q._allowedLocationTypes})}}}}});var f=function f(r){this.base("destination-selector");if(r&&r.PriceRanges===null){delete r.PriceRanges}var t=V3.extend({},false,g);r=V3.extend(r,false,t);this.Style({position:"relative"});var u;var q=!!r.EntityServiceApiSettings.Shortname&&(r.IncludeBusinesses!==false);this._channelShortname=r.EntityServiceApiSettings.Shortname;var s=new V3.UI.TextBox().Set({OnChange:function(v,w){if(w.changedByUser){u.visible(true);if(!w.text){this._blockFireOnChange=true;this.location(null);this.service(null);this._blockFireOnChange=false}this.text(w.text);this._fireOnChange("text")}}.bind(this),OnFocus:function(){this.selectAll()},placeholder:V3.CABS.Utils.ProcessPlaceholders(q?(V3.Res["Search.Placeholder.DestinationOrBusinessName"]||"{termDestination} or {termBusiness} Name"):(V3.Res["Search.Placeholder.DestinationName"]||"{termDestination} Name"),{"{wordDestination}":V3.CABS.Utils.GetTerm("Destination",r.Terminology),"{wordBusiness}":V3.CABS.Utils.GetTerm("Business",r.Terminology),"{termBusiness}":V3.CABS.Utils.GetTerm("Business",r.Terminology),"{termDestination}":V3.CABS.Utils.GetTerm("Destination",r.Terminology)}),maxLength:100});this.Insert(s);r.CanIncludeBusinesses=q;u=new d(r).Set({cssClass:"location-search-results",visible:false,maxDestinationsToDisplay:r.MaxDestinationsToDisplay,OnLocationSelected:function(w,v){w.visible(false);this.location(v)}.bind(this),OnBusinessSelected:function(w,v){w.visible(false);this.service(v)}.bind(this)});s.attachedPanel(u);this.industryCategoryGroup=u.industryCategoryGroup;if(r.Criteria&&r.Criteria.Destination){if(r.Criteria.Destination.LocationId){this.setLocationFromId(r.Criteria.Destination.LocationId)}else{if(r.Criteria.Destination.ServiceId){this.setServiceFromId(r.Criteria.Destination.ServiceId)}else{if(r.Criteria.Destination.Text){s.text(r.Criteria.Destination.Text)}}}}if(s.text()!=""){u.performSearch(s.text())}this._ctrlResults=u;this.TextBox=s}.InheritsFrom(V3.UI.Panel,{OnChange:V3.EventPrototype("sender, e"),_blockFireOnChange:false,_fireOnChange:function(q){if(!this._blockFireOnChange){this.OnChange.fire(this,{})}},_bound:!window.vsDesignTime?null:{obj:null,field:null},bind:function(t,s){var q=this._bound;if(t){q=this._bound={obj:t,field:s};if(!t[s]){t[s]={}}}var r;if(r=q.obj[q.field].Text){this.text(r)}if(r=q.obj[q.field].Location){this.location(r)}else{if(r=q.obj[q.field].LocationId){this.setLocationFromId(r)}}if(r=q.obj[q.field].Service){this.service(r)}else{if(r=q.obj[q.field].ServiceId){this.setServiceFromId(r)}}},setLocationFromId:function(s,r,q){var u=this;var t=function(w){if(q){q(sender,w)}};var v=function(w){if(w.Data.length==1){u.text("");u.location(w.Data[0]);if(r){r(sender,w)}}else{t({message:"Not found"})}};V3.WebServices.EntityService.QuickSearch(v,t,{Ids:[s],Types:[l.State,l.City,l.Region]})},setServiceFromId:function(u,r,q){if(!this._channelShortname){throw new Error("Channel Shortname must be set in order to display Services in the Search control")}var t=this;var s=function(w){if(q){q(sender,w)}};var v=function(w){if(w.Data.length==1){t.text(w.Data[0].Name);t.service(w.Data[0]);if(r){r(sender,w)}}else{s({message:"Not found"})}};V3.WebServices.EntityService.QuickSearch(v,s,{Ids:[u],Types:[k.Accommodation,k.Activity,k.Epicurean,k.Shopping],DistributorShortname:this._channelShortname})},location:V3.Property(null,function m(r){var q=this._bound;if(q){q.obj[q.field].LocationId=(r&&r.Id);q.obj[q.field].Location=r}}).OnChange(function(q){this.service(null);if(q){this.TextBox.text(q.Name)}this._fireOnChange("location")}),service:V3.Property(null,function m(r){var q=this._bound;if(q){q.obj[q.field].ServiceId=(r&&r.Id);q.obj[q.field].Service=r}}).OnChange(function(q){this.location(null);if(q){this.TextBox.text(q.Name)}this._fireOnChange("service")}),text:V3.Property(null,function m(r){var q=this._bound;if(q){q.obj[q.field].Text=r}}).OnChange(function(q){this.location(null);this.service(null);if(V3.Is.String(q)){this.TextBox.text(q);this._ctrlResults.performSearch(q)}})});var n=function n(q){var r=V3.extend({},false,g);if(V3.CABS.UI.SearchControlDefaults){r=V3.extend(r,true,V3.CABS.UI.SearchControlDefaults)}q=V3.extend(q,false,r);this.base(q.DOMElement||"search-control");this._OnChange_Bound=this._OnChange_Bound.bind(this);if(!q.AllowedLocationTypes||q.AllowedLocationTypes.length==0){q.AllowedLocationTypes=g.AllowedLocationTypes}this._verticalMode=false;this._searchSettings=q;this._destinationCompulsory=q.DestinationCompulsory;this._boundTerms={ICGAccommodation:new V3.Property(""),ICGActivity:new V3.Property(""),ICGEpicurean:new V3.Property(""),ICGTransportation:new V3.Property(""),ICGShopping:new V3.Property(""),Destination:new V3.Property(""),DateCommencing:new V3.Property(""),Guests:new V3.Property(""),GuestAdults:new V3.Property(""),GuestChildren:new V3.Property(""),GuestSeniors:new V3.Property(""),Products:new V3.Property(""),Product:new V3.Property(""),Rooms:new V3.Property(""),Room:new V3.Property("")};this.quickSearchFlightControl=new V3.CABS.UI.QuickSearchFlightControl(q).Set({ChannelShortName:q.Shortname,DateFormat:q.DateFormatString,OnClick:function(s,t){if(typeof t.Event.srcElement!="undefined"){var u=typeof t.Event.srcElement.classList!="undefined"?t.Event.srcElement.classList:[];if(u.length>0&&u[0]=="close-dropdown"){this.quickSearchFlightControl._hideDropDownInTripControls()}}}.bind(this),OnSearchFlightExecuted:function(t,s){this._onSearchFlightExecuted(t,s);if(!this.flightCompomentLoaded){this.flightCompomentLoaded=true;this.OnSearchFlightComponentsLoaded.fire(this)}}.bind(this)});this.Insert(this._pnlContent.Insert(this.lblError),this._pnlSearchFlights);if(q.CssClass){this.cssClass(q.CssClass)}this._Storage={Criteria:{IndustryCategoryGroup:k.Accommodation,Destination:{Text:null,LocationId:null,ServiceId:null},Pax:{Adults:null,Children:null,Seniors:null},Nights:null,Date:null,DateIsFlexible:true,HideUnavailableProduct:true,MinPrice:null,MaxPrice:null},MaxPax:q.MaximumPax||20};this.configure=function(s){this._setDTOCriteria(s.Criteria);this.showAccommodation(s.ShowAccommodation);this.showActivity(s.ShowActivity);this.showEpicurean(s.ShowEpicurean);this.showTransportation(s.ShowTransportation);this.showShopping(s.ShowShopping);this.minDate(s.MinDate);this.maxDate(s.MaxDate);this.compactPax(!!s.CompactPax);this.maxNights(s.MaxNights);this.nightsOptional(!!s.NightsOptional);this.maxPax(this._Storage.MaxPax);this.paxOptional(!!s.PaxOptional);this.showHeader(s.ShowHeader!==false);this.showTabs(s.ShowTabs!==false);this.showDate(s.ShowDate!==false);this.showNights(s.ShowNights!==false);this.showNightsInVertical(s.ShowNightsInVertical!==false);this.showButton(s.ShowButton!==false);this.showPax(s.ShowPax!==false);this.showViewBy(s.ShowViewBy!==false);this.setNumberOfProduct(s.numberOfAvailable);this.showNumberOfProduct(s.ShowNumberOfProduct!==false);this.showChildren(s.ShowChildren!==false);this.showSeniors(s.ShowSeniors!==false);this.showAdvancedSearch(s.ShowAdvancedSearch!==false);if(s.SmallTabs){this.Tabs.cssClass("")}this.terminology(s.Terminology);this.buttonText(s.ButtonText);this.criteria(s.Criteria);this.VerticalMode(s.VerticalMode);this._isReady=true;this._OnChange_Bound()}.bind(this);this.configure(q);this.flightCompomentLoaded=false}.InheritsFrom(V3.UI.Panel,{OnFailedValidation:V3.EventPrototype("sender, e"),OnPerformSearch:V3.EventPrototype("sender, e:{Criteria:{Date:V3Date, Nights:2, Pax:{Adults:2,Children:0,Seniors:0}}"),OnCriteriaChanged:V3.EventPrototype("sender, e:{Criteria:{Date:V3Date, Nights:2, Pax:{Adults:2,Children:0,Seniors:0}}"),OnViewByChanged:V3.EventPrototype("sender, viewByValue"),OnBackFromMapView:V3.EventPrototype("sender, viewByValue"),OnNumberOfProductChanged:V3.EventPrototype("sender, viewByValue"),OnSearchFlightActivated:V3.EventPrototype("sender"),OnSearchFlightDeactivated:V3.EventPrototype("sender, e"),OnSearchFlightComponentsLoaded:V3.EventPrototype("sender"),OnSearchFlightExecuted:V3.EventPrototype("sender, flag"),_isReady:false,VerticalMode:V3.Property(false).OnChange(function(q){this._verticalMode=q}),lblError:V3.UI.Label().Defaults({cssClass:"error",autoVisibility:true}),TabsHeader:V3.CABS.UI.TabsControl().Defaults({cssClass:"large header",visible:false}),Tabs:V3.CABS.UI.TabsControl().Defaults({cssClass:"large col-lg-10 col-md-12 col-sm-12 col-12 row",visible:false}),_pnlContent:V3.UI.Panel().Defaults({cssClass:"row container"}),_pnlSearchFlights:V3.UI.Panel().Defaults({cssClass:"search-flights-container"}),_Storage:null,_setDTOCriteria:function(r){if(V3.Is.Specified(r.IndustryCategoryGroup)){this._Storage.Criteria.IndustryCategoryGroup=k.parse(r.IndustryCategoryGroup)}if(V3.Is.Boolean(r.DateIsFlexible)){this._Storage.Criteria.DateIsFlexible=r.DateIsFlexible;this._Storage.Criteria.HideUnavailableProduct=!r.DateIsFlexible}if(V3.Is.Number(r.MinPrice)){this._Storage.Criteria.MinPrice=r.MinPrice}if(V3.Is.Number(r.MaxPrice)){this._Storage.Criteria.MaxPrice=r.MaxPrice}if(r.Destination){if(V3.Is.Specified(r.Destination.LocationId)){this._Storage.Criteria.Destination.LocationId=r.Destination.LocationId}if(V3.Is.Specified(r.Destination.ServiceId)){this._Storage.Criteria.Destination.ServiceId=r.Destination.ServiceId}if(V3.Is.Specified(r.Destination.Text)){this._Storage.Criteria.Destination.Text=r.Destination.Text}}if(V3.Is.Specified(r.Date)){this._Storage.Criteria.Date=r.Date}if(V3.Is.Number(r.Nights)){this._Storage.Criteria.Nights=r.Nights}if(V3.Is.Specified(r.Pax)){var q=this.maxPax();if(V3.Is.Number(r.Pax.Adults)){this._Storage.Criteria.Pax.Adults=Math.min(q,r.Pax.Adults)}if(V3.Is.Number(r.Pax.Children)){this._Storage.Criteria.Pax.Children=Math.min(q,r.Pax.Children)}if(V3.Is.Number(r.Pax.Seniors)){this._Storage.Criteria.Pax.Seniors=Math.min(q,r.Pax.Seniors)}if(this.compactPax()){this._Storage.Criteria.Pax.Adults=Math.min(q,(this._Storage.Criteria.Pax.Adults||0)+(this._Storage.Criteria.Pax.Children||0)+(this._Storage.Criteria.Pax.Seniors||0));this._Storage.Criteria.Pax.Children=0;this._Storage.Criteria.Pax.Seniors=0}}else{if(this._getTotalPax()===0){this._Storage.Criteria.Pax.Adults=1}}},_OnChange_Bound:function(q,r){if(!this._isReady){return}if(this.isValid()){this.OnCriteriaChanged.fire(this,{Criteria:this.criteria()})}else{this.OnFailedValidation.fire(this)}},_getTotalPax:function(){var q=null;if(this._ddlGuests){q=this._ddlGuests.selectedValue()}else{if(this._ddlAdults){q=q+this._ddlAdults.selectedValue()}if(this._ddlChildren){q=q+this._ddlChildren.selectedValue()}if(this._ddlSeniors){q=q+this._ddlSeniors.selectedValue()}}return q},isValid:function(){this.Controls.remove(this.lblError);this.Controls.add(this.lblError);var r=this._getTotalPax();var q=this._boundTerms.Guests();var s=this._Storage.Criteria.IndustryCategoryGroup==k.Shopping;if(r==0){this.lblError.text(s?V3.Res["Search.Error.NoGoods"]||"Please enter the number of products.":V3.CABS.Utils.ProcessPlaceholders((V3.Res["Search.Error.NoGuest"]||"Please enter the number of {guest}"),{"{guest}":q}));return false}else{if(r>this._Storage.MaxPax){this.lblError.text(s?V3.CABS.Utils.ProcessPlaceholders((V3.Res["Search.Error.MaxGoods"]||"The number of products is too high, please select {maxProducts} or less."),{"{maxProducts}":this._Storage.MaxPax}):V3.CABS.Utils.ProcessPlaceholders((V3.Res["Search.Error.MaxGuest"]||"The number of {guest} are too high, please select {maxGuest} or less {guest}."),{"{guest}":q,"{maxGuest}":this._Storage.MaxPax}));return false}}if(this._destinationCompulsory&&this.showDestination()){if(!this._Storage.Criteria.Destination.LocationId&&!this._Storage.Criteria.Destination.ServiceId){this._ctrlDestinationBox.Parent.cssClassAdd("error");this.lblError.text((V3.Res["Search.Error.NoDestination"]||"Please enter a Destination"));return false}this._ctrlDestinationBox.Parent.cssClassRem("error")}this.lblError.text("");return true},_rebind:function(){if(this._ctrlDestinationBox){this._ctrlDestinationBox.bind()}if(this._txtDate){this._txtDate.bind()}if(this._ddlNights){this._ddlNights.bind()}if(this._ddlGuests){this._ddlGuests.bind()}if(this._ddlAdults){this._ddlAdults.bind()}if(this._ddlChildren){this._ddlChildren.bind()}if(this._ddlSeniors){this._ddlSeniors.bind()}this.industryCategoryGroup(k.parse(this._Storage.Criteria.IndustryCategoryGroup))},_NightOpts:null,_updateNightOpts:function(){this._NightOpts=[];if(this.nightsOptional()){this._NightOpts.add({label:V3.Res["Search.AnyOption"]||"Any",value:null})}for(var q=1;q<=Math.min(100,this.maxNights());q++){this._NightOpts.add(q)}if(this._ddlNights){var r=this._ddlNights.selectedValue();this._ddlNights.clear();this._ddlNights.addRange(this._NightOpts);if(this._ddlNights.containsValue(r)){this._ddlNights.selectedValue(r)}}},maxNights:V3.Property(0).OnChange(function(q){this._updateNightOpts()}),nightsOptional:V3.Property(false).OnChange(function(q){this._updateNightOpts()}),_updatePaxDroplists:function(){var r=this._PaxOpts=[];if(this.compactPax()&&this.paxOptional()){this._PaxOpts.add({label:V3.Res["Search.AnyOption"]||"Any",value:null})}for(var q=(this.compactPax()?1:0);q<=Math.min(100,this._Storage.MaxPax);q++){this._PaxOpts.add(q)}[this._ddlGuests,this._ddlAdults,this._ddlChildren,this._ddlSeniors].forEach(function(t){if(t){var s=t.selectedValue();t.clear();t.addRange(r);if(t.containsValue(s)){t.selectedValue(s)}}});if(this._ddlGuests){if(this.paxOptional()){if(!this._ddlGuests.containsValue(null)){this._ddlGuests.addAt(0,V3.Res["Search.AnyOption"]||"Any",null)}}else{this._ddlGuests.remove(null)}}},paxOptional:V3.Property(false).OnChange(function(q){this._updatePaxDroplists()}),maxPax:V3.Property(0).OnChange(function(q){this._Storage.MaxPax=q;this._updatePaxDroplists()}),showChildren:V3.Property(false).OnChange(function(q){this._addOrRemovePaxBoxes();this._refreshPaxFields()}),showSeniors:V3.Property(false).OnChange(function(q){this._addOrRemovePaxBoxes();this._refreshPaxFields()}),terminology:V3.Property(null).OnChange(function(q){this._boundTerms.DateCommencing(V3.CABS.Utils.GetTerm("DateCommencing",q));this._boundTerms.Product(V3.CABS.Utils.GetTerm("Product",q));this._boundTerms.Products(V3.CABS.Utils.GetTerm("Products",q));this._boundTerms.Rooms(V3.CABS.Utils.GetTerm("Rooms",q));this._boundTerms.Room(V3.CABS.Utils.GetTerm("Room",q));this._boundTerms.Guests(V3.CABS.Utils.GetTerm("Guests",q));this._boundTerms.GuestAdults(V3.CABS.Utils.GetTerm("GuestAdults",q));this._boundTerms.GuestChildren(V3.CABS.Utils.GetTerm("GuestChildren",q));this._boundTerms.GuestSeniors(V3.CABS.Utils.GetTerm("GuestSeniors",q));this._boundTerms.Destination(V3.CABS.Utils.GetTerm("Destination",q));this._boundTerms.ICGAccommodation(V3.CABS.Utils.GetTerm("ICGAccommodation",q));this._boundTerms.ICGActivity(V3.CABS.Utils.GetTerm("ICGActivity",q));this._boundTerms.ICGEpicurean(V3.CABS.Utils.GetTerm("ICGEpicurean",q));this._boundTerms.ICGTransportation(V3.CABS.Utils.GetTerm("ICGTransportation",q));this._boundTerms.ICGShopping(V3.CABS.Utils.GetTerm("ICGShopping",q));this.isValid()}),compactPax:V3.Property(null).OnChange(function(q){this._addOrRemovePaxBoxes()}),criteria:V3.Property(function c(){var q=V3.clone(this._Storage.Criteria);return q},function m(q){if(!q){throw new Error("value must be supplied")}this._setDTOCriteria(q);this._rebind();this._refreshPaxFields()}),industryCategoryGroup:V3.Property(k.Accommodation,function m(r,s,q){r=q.value=k.parse(r)}).OnChange(function(r,s){this._Storage.Criteria.IndustryCategoryGroup=r;var q=(r==k.Shopping);var t=(s==k.Shopping);if(r==k.Transportation){if(this._tabFlights){this._tabFlights.selected(true)}this.showViewBy(false);this.quickSearchFlightControl.FlighSearchActive=true;this.showTransportationSearch();return}else{this.quickSearchFlightControl.FlighSearchActive=false;this.hideTransportationSearch();this.OnSearchFlightDeactivated.fire(this,{})}if(this._txtDate){this._txtDate.Parent.visible(!q);this._txtDate.Parent.enabled(!q)}if(this._ddlGuests){this._ddlGuests.Parent.visible(!q);this._ddlGuests.Parent.enabled(!q)}if(this._chkDateIsFlexible){this._chkDateIsFlexible.Parent.visible(!q);this._chkDateIsFlexible.Parent.enabled(!q)}if(this._chkHideUnavailableProduct){this._chkHideUnavailableProduct.Parent.visible(!q)}if(r==k.Accommodation){if(this._ddlNights){this._ddlNights.Parent.visible(true);this._ddlNights.Parent.enabled(true)}this.showViewBy(true);this._cssClassAdd(true,"icg-acc");this._cssClassRem(true,"icg-act");this._cssClassRem(true,"icg-epc");this._cssClassRem(true,"icg-shp");if(this._tabAccommodation){this._tabAccommodation.selected(true)}}else{if(r==k.Activity){this._cssClassAdd(true,"icg-act");this._cssClassRem(true,"icg-acc");this._cssClassRem(true,"icg-epc");this._cssClassRem(true,"icg-shp");if(this._ddlNights){this._ddlNights.Parent.visible(false);this._ddlNights.Parent.enabled(false)}this.showViewBy(true);if(this._tabActivity){this._tabActivity.selected(true)}}else{if(r==k.Epicurean){this._cssClassAdd(true,"icg-epc");this._cssClassRem(true,"icg-acc");this._cssClassRem(true,"icg-act");this._cssClassRem(true,"icg-shp");if(this._ddlNights){this._ddlNights.Parent.visible(false);this._ddlNights.Parent.enabled(false)}this.showViewBy(true);if(this._tabEpicurean){this._tabEpicurean.selected(true)}}else{if(r==k.Shopping){this._cssClassAdd(true,"icg-shp");this._cssClassRem(true,"icg-epc");this._cssClassRem(true,"icg-acc");this._cssClassRem(true,"icg-act");if(this._ctrlDestinationBox){}if(this._txtDate){this._txtDate.Parent.visible(false)}if(this._ddlNights){this._ddlNights.Parent.visible(false);this._ddlNights.Parent.enabled(false)}this.showViewBy(false);if(this._tabShopping){this._tabShopping.selected(true)}}else{this._cssClassRem(true,"icg-acc");this._cssClassRem(true,"icg-act");this._cssClassRem(true,"icg-epc");this._cssClassRem(true,"icg-shp");if(this._ddlNights&&this.showAccommodation()){this._ddlNights.Parent.visible(true);this._ddlNights.Parent.enabled(true)}}}}}if(this._ctrlDestinationBox&&(r!=k.Shopping)){if(!r){this._ctrlDestinationBox.Parent.visible(false)}else{this._ctrlDestinationBox.industryCategoryGroup(r);this._ctrlDestinationBox.Parent.visible(true)}this._pnlAdvancedSearch.DOMElement.previousSibling.style.visibility="visible"}this._refreshPaxFields();this._OnChange_Bound(this.Tabs,{})}),_refreshPaxLabels:function(){var q=this.industryCategoryGroup();if(V3.Is.Specified(q)){q=k.parse(q)}var r=q==k.Shopping;if(this._adultsLabel){this._adultsLabel.Set({text:r?"":this._boundTerms.GuestAdults})}if(this._guestIcon&&this._guestLabel){this._guestIcon.Set({cssClass:r?"data-icon quantity":"data-icon guests"});this._guestLabel.Set({cssClass:"data-label",text:r?(V3.Res["Terms.Quantity"]||"Quantity"):this._boundTerms.Guests})}if(this._guestIconEx&&this._guestLabelEx){this._guestIconEx.Set({cssClass:r?"data-icon quantity":"data-icon guests"});this._guestLabelEx.Set({cssClass:"data-label",text:r?(V3.Res["Terms.Quantity"]||"Quantity"):this._boundTerms.Guests})}},_refreshPaxFields:function(){if(this.compactPax()){return}var q=this.industryCategoryGroup();if(V3.Is.Specified(q)){q=k.parse(q)}if(this._ddlChildren){if(this.showChildren()&&q!=k.Shopping){this._ddlChildren.Parent.visible(true)}else{this._ddlChildren.Parent.visible(false);this._ddlChildren.selectedValue(0)}}if(this._ddlSeniors){if(q==k.Accommodation||q==k.Shopping||!this.showSeniors()){this._ddlSeniors.Parent.visible(false);this._ddlSeniors.selectedValue(0)}else{this._ddlSeniors.Parent.visible(true)}}this._refreshPaxLabels()},performSearch:function(){var q=this.criteria();this.OnPerformSearch.fire(this,{Criteria:q})},showTransportationSearch:function(){this._pnlContent.cssClassAdd("showing-flight-search d-none");this._pnlContent.visible(false);this._pnlSearchFlights.visible(true);this._pnlSearchFlights.cssClassAdd("show");if(this.Tabs.Parent){this.Tabs.Parent.cssClassAdd("flights")}if(!this.quickSearchFlightControl.FlightSearchComponentsIsLoaded){this._pnlSearchFlights.Controls.clear();this._pnlSearchFlights.Insert(this.quickSearchFlightControl);this.quickSearchFlightControl.Initialize();this.OnSearchFlightActivated.fire(this)}else{if(this.quickSearchFlightControl.PendingSearch){this.quickSearchFlightControl.PerformPendingSearch()}}},hideTransportationSearch:function(){this._pnlContent.cssClassRem("showing-flight-search d-none");this._pnlContent.visible(true);this._pnlSearchFlights.visible(false);this._pnlSearchFlights.cssClassRem("show");if(this.Tabs.Parent){this.Tabs.Parent.cssClassRem("flights")}},_onSearchFlightExecuted:function(r,q){this.OnSearchFlightExecuted.fire(r,q)},minDate:V3.Property(null,function m(s,q,r){if(!s){throw new Error("value must be supplied")}r.value=s.asV3Date().date()}).OnChange(function(q){if(this._txtDate){this._txtDate.minDate(q)}}),maxDate:V3.Property(null,function m(s,q,r){if(!s){throw new Error("value must be supplied")}r.value=s.asV3Date().date()}).OnChange(function(q){if(this._txtDate){this._txtDate.maxDate(q)}}),_addOrRemovePaxBoxes:function(){var s=this.showPax();var r=this.compactPax();var q=this.industryCategoryGroup()==k.Shopping;if(!s||!r){if(this._paxContainerCompact){this._ddlGuests.bind(null);this._paxContainerCompact.visible(false)}}if(!s||r){if(this._paxContainerExpanded){if(this._ddlAdults){this._ddlAdults.bind(null)}if(this._ddlChildren){this._ddlChildren.bind(null)}if(this._ddlSeniors){this._ddlSeniors.bind(null)}this._paxContainerExpanded.visible(false)}}if(s){if(r){if(!this._paxContainerCompact){this._paxContainerCompact=new V3.UI.Panel(" col-lg-8 col-md-6 col-sm-6 col-12 field-container pax compact");this._ddlGuests=new V3.UI.DropDownList(this._PaxOpts).Set({cssClass:"custom-select",OnChange:this._OnChange_Bound});this._Storage.Criteria.Pax.Adults=(this._Storage.Criteria.Pax.Adults||0)+(this._Storage.Criteria.Pax.Children||0)+(this._Storage.Criteria.Pax.Seniors||0);this._Storage.Criteria.Pax.Children=0;this._Storage.Criteria.Pax.Seniors=0;this._guestIcon=new V3.UI.Label();this._guestLabel=new V3.UI.Label();this._paxContainerCompact.Insert(new V3.UI.Panel().Set({cssClass:"field guests"}).Insert(new V3.UI.Label("",this._ddlGuests).Insert(this._guestIcon,this._guestLabel),this._ddlGuests));this._updatePaxDroplists()}this._ddlGuests.bind(this._Storage.Criteria.Pax,"Adults");this._paxContainerCompact.visible(true)}else{if(!this._paxContainerExpanded){this._paxContainerExpanded=new V3.UI.Panel("field-container pax expanded");this._pnlContent.Controls.insertBefore(this._paxContainerExpanded,(this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch);this._ddlAdults=new V3.UI.DropDownList(this._PaxOpts).Set({cssClass:"custom-select",OnChange:this._OnChange_Bound});this._guestIconEx=new V3.UI.Label();this._guestLabelEx=new V3.UI.Label();this._adultsLabel=new V3.UI.Label("",this._ddlAdults);this._paxContainerExpanded.Insert(new V3.UI.Label("",this._ddlAdults).Insert(this._guestIconEx,this._guestLabelEx),new V3.UI.Panel().Set({cssClass:"field adults"}).Insert(this._ddlAdults,this._adultsLabel))}this._ddlAdults.bind(this._Storage.Criteria.Pax,"Adults");if(!this._ddlChildren&&this.showChildren()){this._ddlChildren=new V3.UI.DropDownList(this._PaxOpts).Set({cssClass:"custom-select",OnChange:this._OnChange_Bound});this._paxContainerExpanded.Controls.insertAfter(new V3.UI.Panel().Set({cssClass:"field children"}).Insert(this._ddlChildren,new V3.UI.Label("",this._ddlChildren).Set({text:this._boundTerms.GuestChildren})),this._ddlAdults.Parent);this._ddlChildren.bind(this._Storage.Criteria.Pax,"Children")}if(!this._ddlSeniors&&this.showSeniors()){this._ddlSeniors=new V3.UI.DropDownList(this._PaxOpts).Set({cssClass:"custom-select",OnChange:this._OnChange_Bound});this._paxContainerExpanded.Controls.insertAfter(new V3.UI.Panel().Set({cssClass:"field seniors"}).Insert(this._ddlSeniors,new V3.UI.Label("",this._ddlSeniors).Set({text:this._boundTerms.GuestSeniors})),(this._ddlChildren||this._ddlAdults).Parent);this._ddlSeniors.bind(this._Storage.Criteria.Pax,"Seniors")}this._paxContainerExpanded.visible(true)}this._refreshPaxLabels()}},_updateCssClassForTabs:function(){this._cssClassToggle(true,this.showTabs()&&this.showAccommodation(),"has-tab-acc");this._cssClassToggle(true,this.showTabs()&&this.showActivity(),"has-tab-act");this._cssClassToggle(true,this.showTabs()&&this.showEpicurean(),"has-tab-epc");this._cssClassToggle(true,this.showTabs()&&this.showTransportation(),"has-tab-tpt");this._cssClassToggle(true,this.showTabs()&&this.showShopping(),"has-tab-shp")},showHeader:V3.Property(false).OnChange(function(q){if(q){this.TabsHeader.addTab({name:V3.Res["Search.Discover.Text"]||"Discover",onSelected:function(){}.bind(this),onDeselected:function(){}});this.Controls.addAt(0,this.TabsHeader)}this.TabsHeader.visible(q)}),showTabs:V3.Property(false).OnChange(function(r){if(!this.Tabs.Parent){var q=new V3.UI.WebControlBasic("div").Set({cssClass:"tabs-container field categories row",visible:true});q.Insert(new V3.UI.Label("",q).Insert(new V3.UI.Label().Set({cssClass:"data-icon categories"}),new V3.UI.Label().Set({cssClass:"data-label",text:V3.Res["Search.Categories.Label"]||"Categories"})).Set({cssClass:"col-lg-2 col-md-12 col-sm-12 col-12"}),this.Tabs);this.Controls.addAt(1,q)}this.Tabs.visible(r);this._updateCssClassForTabs()}),showAccommodation:V3.Property(false).OnChange(function(q){if(!q){if(this._tabAccommodation){this._tabAccommodation.visible(false)}}else{if(!this._tabAccommodation){this._tabAccommodation=this.Tabs.addTabWithRadio({name:"ICGSelector",text:this._boundTerms.ICGAccommodation,onSelected:function(){this.industryCategoryGroup(k.Accommodation)}.bind(this),onDeselected:function(){}})}this._tabAccommodation.visible(true)}this._updateCssClassForTabs()}),showActivity:V3.Property(false).OnChange(function(q){if(!q){if(this._tabActivity){this._tabActivity.visible(false)}}else{if(!this._tabActivity){this._tabActivity=this.Tabs.addTabWithRadio({name:"ICGSelector",text:this._boundTerms.ICGActivity,onSelected:function(){this.industryCategoryGroup(k.Activity)}.bind(this),onDeselected:function(){}})}this._tabActivity.visible(true)}this._updateCssClassForTabs()}),showEpicurean:V3.Property(false).OnChange(function(q){if(!q){if(this._tabEpicurean){this._tabEpicurean.visible(false)}}else{if(!this._tabEpicurean){this._tabEpicurean=this.Tabs.addTabWithRadio({name:"ICGSelector",text:this._boundTerms.ICGEpicurean,onSelected:function(){this.industryCategoryGroup(k.Epicurean)}.bind(this),onDeselected:function(){}})}this._tabEpicurean.visible(true)}this._updateCssClassForTabs()}),showTransportation:V3.Property(false).OnChange(function(q){if(!q){if(this._tabFlights){this._tabFlights.visible(false)}}else{if(!this._tabFlights){this._tabFlights=this.Tabs.addTabWithRadio({name:"ICGSelector",text:this._boundTerms.ICGTransportation,onSelected:function(){this.industryCategoryGroup(k.Transportation);this.OnSearchFlightActivated.fire(this)}.bind(this),onDeselected:function(){}})}this._tabFlights.visible(true)}this._updateCssClassForTabs()}),showShopping:V3.Property(false).OnChange(function(q){if(!q){if(this._tabShopping){this._tabShopping.visible(false)}}else{if(!this._tabShopping){this._tabShopping=this.Tabs.addTabWithRadio({name:"ICGSelector",text:this._boundTerms.ICGShopping,onSelected:function(){this.industryCategoryGroup(k.Shopping)}.bind(this),onDeselected:function(){}})}this._tabShopping.visible(true)}this._updateCssClassForTabs()}),showDestination:V3.Property(false).OnChange(function(q){if(!q){if(this._ctrlDestinationBox){this._ctrlDestinationBox.bind(null);this._ctrlDestinationBox.visible(false)}}else{if(!this._ctrlDestinationBox){this._ctrlDestinationBox=new f(this._searchSettings).Set({OnChange:this._OnChange_Bound});this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"col-lg-12 col-md-12 col-sm-12 field destination"}).Insert(new V3.UI.Label("",this._ctrlDestinationBox.TextBox).Insert(new V3.UI.Label().Set({cssClass:"data-icon location"}),new V3.UI.Label().Set({cssClass:"data-label",text:this._boundTerms.Destination})),this._ctrlDestinationBox),(this._txtDate||this._ddlNights||this._ddlGuests||this._ddlAdults||this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}this._ctrlDestinationBox.bind(this._Storage.Criteria,"Destination")}}),showDate:V3.Property(false).OnChange(function(q){if(!q){if(this._txtDate){this._txtDate.bind(null);this._txtDate.Parent.visible(false)}}else{if(!this._txtDate){this._txtDate=new V3.UI.DateInput().Set({isRequired:true,bind:[this._Storage.Criteria,"Date"],formatString:this._searchSettings.DateFormatString,OnDateSelected:this._OnChange_Bound});this._txtDate.minDate(this.minDate());this._txtDate.maxDate(this.maxDate());this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"col-lg-3 col-md-4 col-sm-6 col-12 field commencing"}).Insert(new V3.UI.Label("",this._txtDate).Insert(new V3.UI.Label().Set({cssClass:"data-icon commencing"}),new V3.UI.Label().Set({cssClass:"data-label",text:this._boundTerms.DateCommencing})),this._txtDate),(this._ddlNights||this._ddlGuests||this._ddlAdults||this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}}}),showNights:V3.Property(false).OnChange(function(q){if(!q){if(this._ddlNights){this._ddlNights.bind(null);this._ddlNights.Parent.visible(false)}}else{if(!this._ddlNights){this._ddlNights=new V3.UI.DropDownList(this._NightOpts).Set({cssClass:"custom-select",OnChange:this._OnChange_Bound})}this._ddlNights.bind(this._Storage.Criteria,"Nights")}}),showNightsInVertical:V3.Property(false).OnChange(function(q){if(!q){if(this._ddlNights){this._ddlNights.bind(null);this._ddlNights.Parent.visible(false)}}else{if(!this._ddlNights){this._ddlNights=new V3.UI.DropDownList(this._NightOpts).Set({cssClass:"custom-select",OnChange:this._OnChange_Bound});this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"field nights"}).Insert(new V3.UI.Label("",this._ddlNights).Insert(new V3.UI.Label().Set({cssClass:"data-icon nights"}),new V3.UI.Label(V3.Res["Terms.Nights"]||"Nights")),this._ddlNights),(this._ddlGuests||this._ddlAdults||this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}else{this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"field nights"}).Insert(new V3.UI.Label("",this._ddlNights).Insert(new V3.UI.Label().Set({cssClass:"data-icon nights"}),new V3.UI.Label(V3.Res["Terms.Nights"]||"Nights")),this._ddlNights),(this._ddlGuests||this._ddlAdults||this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}this._ddlNights.bind(this._Storage.Criteria,"Nights")}}),showPax:V3.Property(false).OnChange(function(q){this._addOrRemovePaxBoxes()}),showButton:V3.Property(false).OnChange(function(q){if(!q){if(this._btnSearch){this._btnSearch.Parent.visible(false)}this.defaultButton(null)}else{if(!this._btnSearch){this._btnSearch=new V3.UI.Button(this.buttonText()).Set({cssClass:"btn btn-primary btn-gridview",OnClick:function(r){r.focus();if(this.isValid()){this.performSearch()}}.bind(this)});this._pnlContent.Insert(new V3.UI.Panel("field search-button-container").Insert(this._btnSearch))}this.defaultButton(this._btnSearch);this._btnSearch.Parent.visible(true)}}),showViewBy:V3.Property(false).OnChange(function(q){if(!q){if(this._tabsViewBy){this._tabsViewBy.Parent.Parent.visible(false)}}else{if(!this._tabsViewBy){this._tabsViewBy=new V3.CABS.UI.TabsControl().Set({cssClass:"large",visible:false});if(!this._tabViewByList){this._tabViewByList=this._tabsViewBy.addTabWithRadio({name:"viewByOption",text:V3.Res["ViewBy.List"]||"List",onSelected:function(){this.OnViewByChanged.fire(this,"List")}.bind(this),onDeselected:function(){}})}this._tabViewByList.visible(true);if(!this._tabViewByMap){this._tabViewByMap=this._tabsViewBy.addTabWithRadio({name:"viewByOption",text:V3.Res["ViewBy.Map"]||"Map",onSelected:function(){this.OnViewByChanged.fire(this,"Map")}.bind(this),onDeselected:function(){}})}this._tabViewByMap.visible(true);this._tabsViewBy.visible(true);this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"col-lg-9 col-md-8 col-sm-6 col-12 tabs-container field view-by"}).Insert(new V3.UI.Panel().Set({cssClass:"view-by-content"}).Insert(new V3.UI.Label("",this._txtDate).Insert(new V3.UI.Label().Set({cssClass:"data-icon view-by"}),new V3.UI.Label().Set({cssClass:"data-label",text:V3.Res["ViewBy.Label"]||"View By"})),this._tabsViewBy)),(this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}else{this._tabsViewBy.Parent.Parent.visible(true)}}}),showViewByDropdown:V3.Property(false).OnChange(function(q){if(!q){if(this._ddlViewBy){this._ddlViewBy.Parent.visible(false)}}else{if(!this._ddlViewBy){var r=[{label:V3.Res["ViewBy.Map"]||"Map",value:"Map"}];this._ddlViewBy=new V3.UI.DropDownList([{label:V3.Res["ViewBy.List"]||"List",value:"List"}].addRange(r)).Set({cssClass:"custom-select viewby-option",visible:true,selectedValue:null,OnChange:function(s,t){if(!t.changedByUser){return}this.OnViewByChanged.fire(this,t.selectedValue)}.bind(this)});this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"field view-by"}).Insert(new V3.UI.Label("",this._txtDate).Insert(new V3.UI.Label().Set({cssClass:"data-icon view-by"}),new V3.UI.Label().Set({cssClass:"data-label",text:"View By"})),this._ddlViewBy),(this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}}}),setNumberOfProduct:V3.Property(0).OnChange(function(r){if(r){this.NumberOfProduct=r;if(this._ddlNumberOfProduct){var q=this._populateNumberOfProductOption();this._ddlNumberOfProduct.clear();this._ddlNumberOfProduct.addRange(q)}}}),showNumberOfProduct:V3.Property(false).OnChange(function(t){if(!t){if(this._ddlNumberOfProduct){this._ddlNumberOfProduct.Parent.visible(false)}}else{if(!this._ddlNumberOfProduct){var s=this._populateNumberOfProductOption();this._ddlNumberOfProduct=new V3.UI.DropDownList(s).Set({cssClass:"custom-select number-of-product-option",visible:true,selectedValue:null,OnChange:function(v,w){if(!w.changedByUser){return}this.OnNumberOfProductChanged.fire(this,w.selectedValue)}.bind(this)});var r=this.industryCategoryGroup();if(V3.Is.Specified(r)){r=k.parse(r)}var q=this._boundTerms.Products();var u=" col-sm-12 col-12 non-aco";if(r==k.Accommodation){q=this._boundTerms.Rooms();u=" col-sm-6 col-6"}this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"field number-of-product col-lg-4 col-md-4"+u}).Insert(new V3.UI.Label("",this._txtDate).Insert(new V3.UI.Label().Set({cssClass:"data-icon"}),new V3.UI.Label().Set({cssClass:"data-label",text:V3.CABS.Utils.ProcessPlaceholders((V3.Res["Product.NumberOfProduct"]||"Number of {products}"),{"{products}":q})})),this._ddlNumberOfProduct),(this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}}}),_populateNumberOfProductOption:function(){var q=[];for(i=0;i<this.NumberOfProduct;i++){q.add({label:i+1,value:i+1})}return q},_renderAdvancedSections:function(){var w=this.showAdvancedSearch()&&this.showPriceFilter();if(!w){if(this._hlMoreOptions){this._hlMoreOptions.collapsed(true);this._hlMoreOptions.Parent.visible(false)}return}if(this._hlMoreOptions){this._hlMoreOptions.Parent.visible(true)}if(!this._pnlAdvancedSearch){this._pnlAdvancedSearch=new V3.UI.Panel("col-lg-12 col-md-12 col-sm-12 field-container advanced-options");this._pnlContent.Controls.insertBefore(this._pnlAdvancedSearch,(this._btnSearch||{}).Parent);var v=this._pnlAdvancedSearch;this._hlMoreOptions=new V3.UI.HyperLinkToggle(V3.Res["Search.MoreOptions"]||"More options",this._pnlAdvancedSearch,true).Set({cssClass:"btn-link"});this._pnlContent.Controls.insertBefore(new V3.UI.Panel("field more-options-container").Insert(this._hlMoreOptions),this._pnlAdvancedSearch)}var u=this;if(!w||!this.showPriceFilter()){if(this.pnlPriceFilter){this.pnlPriceFilter.visible(false)}}else{if(!this.pnlPriceFilter){this.pnlPriceFilter=new V3.UI.Panel("row field price-filter");var q=[];var t=1;if(typeof _DisplayCurrencyConversionCoefficient!=="undefined"){t=_DisplayCurrencyConversionCoefficient}this._searchSettings.PriceRanges.forEach(function(x){q.add({label:(x*t).toStringFormat("C0",V3.CultureInfo.currentUICulture()),value:x})});var s=new V3.UI.DropDownList([{label:V3.Res["Search.AnyMinPrice"]||"Min",value:null}].addRange(q)).Set({cssClass:"custom-select",selectedValue:null,bind:[this._Storage.Criteria,"MinPrice"],OnChange:function(x,y){if(!y.changedByUser){return}var A=y.selectedValue;var z=r.selectedValue();if(V3.Is.Number(A)&&V3.Is.Number(z)){if(A>=z){r.selectedIndex(s.selectedIndex())}}u._OnChange_Bound(x,y)}});var r=new V3.UI.DropDownList(q.addRange([{label:V3.Res["Search.AnyMaxPrice"]||"Max",value:null}])).Set({cssClass:"custom-select",selectedValue:null,bind:[this._Storage.Criteria,"MaxPrice"],OnChange:function(x,y){if(!y.changedByUser){return}var A=s.selectedValue();var z=y.selectedValue;if(V3.Is.Number(A)&&V3.Is.Number(z)){if(A>=z){s.selectedIndex(Math.max(0,r.selectedIndex()))}}u._OnChange_Bound(x,y)}});this.pnlPriceFilter.Insert(new V3.UI.Panel().Set({cssClass:"col-lg-4 col-md-6 col-sm-6 col-12"}).Insert(new V3.UI.Label(s).Insert(new V3.UI.Label().Set({cssClass:"data-icon price"}),new V3.UI.Label(V3.Res["Search.PriceFrom"]||"Price from ").Set({cssClass:"data-label"})),s),new V3.UI.Panel().Set({cssClass:"col-lg-8 col-md-6 col-sm-6 col-12"}).Insert(new V3.UI.Label(V3.Res["Search.PriceFrom.To"]||" to ",r).Set({cssClass:"data-label price-to"}),r));this._pnlAdvancedSearch.Insert(new V3.UI.Panel().Set({cssClass:"row inline-field-container"}).Insert(new V3.UI.Panel().Set({cssClass:"col-lg-4 col-md-6 col-sm-6 col-12 field nights"}).Insert(new V3.UI.Label("",this._ddlNights).Insert(new V3.UI.Label().Set({cssClass:"data-icon nights"}),new V3.UI.Label(V3.Res["Terms.Nights"]||"Nights").Set({cssClass:"data-label"})),this._ddlNights),this._paxContainerCompact),this.pnlPriceFilter)}}if(!w||!this.showUnavailableProduct()){if(this._chkHideUnavailableProduct){this._chkHideUnavailableProduct.Parent.visible(false)}}else{if(!this._chkHideUnavailableProduct){this._chkHideUnavailableProduct=new V3.UI.CheckBox().Set({bind:[this._Storage.Criteria,"HideUnavailableProduct"],OnChange:this._OnChange_Bound});this._pnlAdvancedSearch.Insert(new V3.UI.Panel("field hide-unavilable-product").Insert(this._chkHideUnavailableProduct,new V3.UI.Label(this._chkHideUnavailableProduct).Set({cssClass:"data-label",text:V3.Res["Search.HideUnavailableProduct"]||"Hide results with no availability"})))}}},showAdvancedSearch:V3.Property(false).OnChange(function(q){this._renderAdvancedSections()}),showTravelDateFlexible:V3.Property(true).OnChange(function(q){this._renderAdvancedSections()}),showUnavailableProduct:V3.Property(true).OnChange(function(q){this._renderAdvancedSections()}),showPriceFilter:V3.Property(true).OnChange(function(q){this._renderAdvancedSections()}),buttonText:V3.Property("Search").OnChange(function(q){if(this._btnSearch){this._btnSearch.text(q)}}),setLimitsFromEntities:function(w){if(!w||!w.length){throw new Error("entities must be supplied")}var r=null;var v=null;var q=null;var z=false;var s=false;var y=false;var u=false;var x=false;var t=0;w.forEach(function(C){if(C.Capacity&&(r==null||r<C.Capacity.Max)){r=C.Capacity.Max}if(C.IndustryCategoryGroups&&C.IndustryCategoryGroups.length){C.IndustryCategoryGroups.forEach(function(D){switch(k.parse(D)){case k.Activity:t+=s?0:1;s=true;break;case k.Accommodation:t+=z?0:1;z=true;break;case k.Epicurean:t+=y?0:1;y=true;break;case k.Transportation:t+=u?0:1;u=true;break;case k.Shopping:t+=x?0:1;x=true;break}})}if(C.Bookability){var B=new V3Date(C.Bookability.AvailabilityDateRange.Min);var A=new V3Date(C.Bookability.AvailabilityDateRange.Max);if(v==null||B<v){v=B}if(q==null||A>q){q=A}}});if(v<new V3Date()){v=new V3Date()}if(providerSearchControlSettings.GlobalSettings.Campaign.CampaignCodes.length>0){x=false}this.maxPax(r);this.minDate(v);this.maxDate(q);this.showAccommodation(z);this.showActivity(s);this.showEpicurean(y);this.showTransportation(u);this.showShopping(x);if(t>1){this.showHeader(true);this.showTabs(true)}else{if(z){this.industryCategoryGroup(k.Accommodation)}else{if(s){this.industryCategoryGroup(k.Activity)}else{if(y){this.industryCategoryGroup(k.Epicurean)}else{if(x){this.industryCategoryGroup(k.Shopping)}}}}}}});var j=Object.freeze({Inbound:"Inbound",Outbound:"Outbound",RoundTrip:"RoundTrip",MultiCity:"MultiCity"});var a=function a(q){this.base("quick-search-flight col-12");this.DateFormat=q.DateFormatString;this.TripType=Object.freeze({InboundTerritory:{text:V3.Res["FlightSearch.Terms.InboundTerritory"]||"Inbound Territory",value:j.Inbound},OutboundTerritory:{text:V3.Res["FlightSearch.Terms.OutboundTerritory"]||"Outbound Territory",value:j.Outbound},RoundTrip:{text:V3.Res["FlightSearch.Terms.RoundTrip"]||"Round Trip",value:j.RoundTrip},MultiCity:{text:V3.Res["FlightSearch.Terms.MultiCity"]||"Multi-city",value:j.MultiCity}});this.SearchFilterMode=Object.freeze({Vertical:"Vertical",Horizontal:"Horizontal"});this.FlightPreference=Object.freeze({Cabin:"CABIN",Passenger:"PASSENGER",Bags:"BAGS",Sort:"SORT",Stop:"STOP",TransPortProvider:"TRANSPORT_PROVIDER"});this.AdvanceMode=false;this._pnlUpdating=new V3.UI.Panel().Set({cssClass:"updating-marker large"}).Insert(new V3.UI.Label(V3.Res["RateGrid.UpdatingNotification.Text"]||"Updating, Please wait..."));this.Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown col-12 d-flex flex-column"}).Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown row"}).Insert(new V3.UI.Panel().Set({cssClass:"col-12"}).Insert(this._lblTitle)),this._pnlReferenceSelector,this._pnlErrorMessage,this._pnlTripSelector,this._pnlAdvanceSection),this._pnlUpdating);this._pnlDropDownMenuPassengerSelector.Insert(new V3.UI.Panel().Set({cssClass:"passenger-settings"}).Insert(new V3.UI.Panel().Set({cssClass:"group-title first"}).Insert(this._lblPassengerGroupTitle),this._pnlPassengerGroup,new V3.UI.Panel().Set({cssClass:"group-title"}).Insert(this._lblBagsGroupTitle),this._pnlBagsGroup));this.FlixebleDateSlider=new V3.CABS.UI.FlightFlexibleDateSlider().Set({OnPopulatePreviousItems:function(s,u,r,t){this._runSearchForFlexibleDateOnly(true,u,r,false,t)}.bind(this),OnPopulateNextItems:function(r,t,u,s){this._runSearchForFlexibleDateOnly(true,t,u,true,s)}.bind(this)});this._lblTitle.text(V3.Res["FlightSearch.Title.LandingPage"]||"Search Available Flights");this._lblErrorMessage.text(V3.Res["FlightSearch.Error.NoTerritoryAirport"]||"One of the airports need to be within territory");this._btnSearch.text(V3.Res["FlightSearch.Label.Search"]||"Search");this._lnkAddTrip.text(V3.Res["FlightSearch.Label.AddFlight"]||"+ Add flight");this._btnLoadMoreFlightCard.text(V3.Res["FlightSearch.Label.LoadMore"]||"load more");this._btnClearCarrierFilters.text(V3.Res["FlightSearch.Label.ClearCarrierFilter"]||"Airlines / Carriers");this.FlighSearchActive=false;this.FlightSearchComponentsIsLoaded=false;this.FlexibleDateExist=false;this.PendingSearch=false}.InheritsFrom(V3.UI.Panel,{OnSearchFlightExecuted:V3.EventPrototype("sender, flag"),ChannelShortName:null,DateFormat:null,_lblTitle:V3.UI.Label("h2").Defaults({cssClass:"service-name"}),_lnkTripSelector:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"dropdown-link dropdown-toggle",OnClick:function(){this._hideDropDownInTripControls();this._pnlDropDownMenuTripSelector.cssClassAdd("show")},OnUnfocus:function(q,r){if(r.newFocus){if(r.newFocus==document.body){this._pnlDropDownMenuTripSelector.cssClassRem("show")}}}}),_lnkClassSelector:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"dropdown-link dropdown-toggle",OnClick:function(){this._hideDropDownInTripControls();this._pnlDropDownMenuClassSelector.cssClassAdd("show")},OnUnfocus:function(q,r){if(r.newFocus){if(r.newFocus==document.body){this._pnlDropDownMenuClassSelector.cssClassRem("show")}}}}),_lnkPassengerSelector:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"dropdown-link dropdown-toggle",OnClick:function(q,r){this._hideDropDownInTripControls();this._pnlDropDownMenuPassengerSelector.cssClassAdd("show")},OnUnfocus:function(q,r){if(r.newFocus==document.body){this._pnlDropDownMenuPassengerSelector.cssClassRem("show")}}}),_btnLoadMoreFlightCard:V3.UI.Button().Defaults({cssClass:"button btn-load-more-flight-card flex-fill w-100",OnClick:function(q,r){this._loadMoreFlightSearchCards()}}),_btnClearCarrierFilters:V3.UI.Button().Defaults({cssClass:"button btn-clear-carrier-filter flex-fill w-100",OnClick:function(q,r){if(!this._allCarriersAreSelected){this._selectAllCarriers()}this._runSearch(false)}}),_lblErrorMessage:V3.UI.Label().Defaults({cssClass:"error-message"}),_lblTripSelector:V3.UI.Label().Defaults({cssClass:""}),_lblClassSelector:V3.UI.Label().Defaults({cssClass:""}),_lblPassengerSelector:V3.UI.Label().Defaults({cssClass:""}),_lblPassengerGroupTitle:V3.UI.Label().Defaults({cssClass:""}),_lblBagsGroupTitle:V3.UI.Label().Defaults({cssClass:""}),_pnlReferenceSelector:V3.UI.Panel().Defaults({cssClass:"row mt-2"}),_pnlDropDownTripSelectorContainer:V3.UI.Panel().Defaults({cssClass:"dropdown"}),_pnlDropDownMenuTripSelector:V3.UI.Panel().Defaults({cssClass:"dropdown-menu shadow"}),_pnlDropDownMenuClassSelector:V3.UI.Panel().Defaults({cssClass:"dropdown-menu shadow"}),_pnlDropDownMenuPassengerSelector:V3.UI.Panel().Defaults({cssClass:"passenger-and-bags dropdown-menu shadow",OnUnfocus:function(q,r){if(r.newFocus){if(r.newFocus.Parent!=this._pnlDropDownMenuPassengerSelector){this._pnlDropDownMenuPassengerSelector.cssClassRem("show")}}}}),_pnlPassengerGroup:V3.UI.Panel().Defaults({cssClass:"passenger-group"}),_pnlBagsGroup:V3.UI.Panel().Defaults({cssClass:"passenger-group"}),_pnlErrorMessage:V3.UI.Panel().Defaults({cssClass:"error-wrapper"}),_pnlTripSelector:V3.UI.Panel().Defaults({cssClass:"trip-selector"}),_pnlInbound:V3.UI.Panel().Defaults({cssClass:"inbound-container"}),_pnlOutbond:V3.UI.Panel().Defaults({cssClass:"outbond-container"}),_pnlRoundTrip:V3.UI.Panel().Defaults({cssClass:"roundtrip-container"}),_pnlMultiTripContainer:V3.UI.Panel().Defaults({cssClass:"multitrip-container"}),_pnlMultiTrip:V3.UI.Panel().Defaults({cssClass:"multitrip"}),_pnlAdvanceSection:V3.UI.Panel().Defaults({cssClass:"close-dropdown advance-section w-100 p-4 d-none"}),_pnlAdvanceInnerSection:V3.UI.Panel().Defaults({cssClass:"close-dropdown advance-inner-section w-100 d-flex gap-12"}),_pnlAdvanceFilter:V3.UI.Panel().Defaults({cssClass:"close-dropdown advance-filter d-md-block d-none"}),_pnlAdvanceFilterSort:V3.UI.Panel().Defaults({cssClass:"close-dropdown sort-wrapper group"}),_pnlAdvanceFilterStop:V3.UI.Panel().Defaults({cssClass:"close-dropdown stop-wrapper group"}),_pnlAdvanceFilterAirplanes:V3.UI.Panel().Defaults({cssClass:"close-dropdown airlines-wrapper group"}),_pnlSearchResultContainer:V3.UI.Panel().Defaults({cssClass:"close-dropdown flight-search-result-container d-flex flex-column w-100"}),_pnlDateFilterSlider:V3.UI.Panel().Defaults({cssClass:"date-filter-slider w-100"}),_pnlMainResult:V3.UI.Panel().Defaults({cssClass:"close-dropdown flight-search-main-result w-100 h-100"}),_pnlSearchResult:V3.UI.Panel().Defaults({cssClass:"close-dropdown search-result-wrapper d-flex flex-column w-100 gap-12"}),_pnlLoadMoreButtonContainer:V3.UI.Panel().Defaults({cssClass:"d-flex w-100 py-4",visible:false}),_lnkAddTrip:V3.UI.HyperLink("javascript:void(0);").Defaults({cssClass:"btn-add-trip add-a-flight",OnClick:function(q,r){this._addTripControl({mode:this.SearchFilterMode.Horizontal,multiTrip:true,showReturnDate:false,tripType:j.MultiCity},this._pnlMultiTrip)}}),_btnSearch:V3.UI.Button().Defaults({cssClass:"button btn-primary btn-search",OnClick:function(q,r){this._runSearch(true)}}),_lnkShowFilter:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"btn-show-filter",OnClick:function(q,r){if(!this._pnlAdvanceFilter._cssClassListPublic.includes("show-on-mobile")){this._pnlAdvanceFilter.cssClassAdd("show-on-mobile");this._pnlAdvanceFilter.cssClassRem("d-none");this._lblShowFilter.text(V3.Res["FlightSearch.Label.HideFilter"]||"Hide Filters")}else{this._pnlAdvanceFilter.cssClassRem("show-on-mobile");this._pnlAdvanceFilter.cssClassAdd("d-none");this._lblShowFilter.text(V3.Res["FlightSearch.Label.ShowFilter"]||"Show Filters")}}}),_lnkSelectAllCarriers:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"btn-select-all-carriers",OnClick:function(q,r){this._selectAllCarriers()}}),_lblShowFilter:V3.UI.Label().Defaults({cssClass:""}),_minDate:new V3Date(new V3Date().toStringFormat("yyyy-MM-dd")),_flightSearchPassengersAndBagControls:V3.Object(),_flightSearchTripControls:V3.Object(),_airlinesPreferences:V3.Object(),_selectedTripMode:null,_numberToIncreaseDate:3,_maxiumumTripForMultiCity:6,_showUpdating:V3.Property(false,function m(q){if(q){this._pnlUpdating.Parent.cssClassRem("has-error");this._pnlUpdating.Parent.cssClassAdd("updating")}else{this._pnlUpdating.Parent.cssClassRem("updating")}}),_onSearchFlightExecuted:function(r,q){this.OnSearchFlightExecuted.fire(r,q);this._showUpdating(q)},_init:function(){var q=[this.TripType.InboundTerritory,this.TripType.OutboundTerritory,this.TripType.RoundTrip,this.TripType.MultiCity];this.searchRequest={tripType:this.TripType.InboundTerritory.value,tripTypeText:this.TripType.InboundTerritory.text,seatClass:null,routes:[],preferences:[]};this.initialPreference={cabin:null,passengers:{adult:0,child:0,infant:0},sortBy:null,stopBy:null,carriers:[]};this._showUpdating(false);this._reset();this._populateDropDownOptions(this._pnlDropDownMenuTripSelector,this._lblTripSelector,q,true);this._lblTripSelector.text(this.searchRequest.tripTypeText);this._lblClassSelector.text(this.searchRequest.seatClass);this._populateReferenceSelector();this._pnlErrorMessage.Insert(new V3.UI.Panel().Set({cssClass:"d-flex align-items-center gap-4 my-4"}).Insert(new V3.UI.Panel().Set({cssClass:"d-flex align-items-center "}).Insert(new V3.UI.Image("../Resources/Images/Icons/alert-circle-sharp.svg")),new V3.UI.Panel().Set({cssClass:"flex-fill"}).Insert(this._lblErrorMessage)));this._lnkShowFilter.Insert(new V3.UI.Panel().Set({cssClass:"d-flex align-items-center gap-4"}).Insert(new V3.UI.Panel().Set({cssClass:"filter-result-icon d-flex align-items-center "}).Insert(new V3.UI.Image("../Resources/Images/Icons/filter.svg")),new V3.UI.Panel().Set({cssClass:"filter-result-label"}).Insert(this._lblShowFilter)));this.FlightSearchComponentsIsLoaded=true},_reset:function(){this._pnlDropDownMenuTripSelector.Controls.clear();this._pnlReferenceSelector.Controls.clear();this._pnlErrorMessage.Controls.clear();this._pnlSearchResult.Controls.clear();this._pnlAdvanceFilterAirplanes.Controls.clear();this._lnkTripSelector.Controls.clear();this._lnkClassSelector.Controls.clear();this._lnkPassengerSelector.Controls.clear();this._lnkShowFilter.Controls.clear();this._pnlDateFilterSlider.DOMElement.innerHTML="";this._pnlLoadMoreButtonContainer.visible(false);this.PendingSearch=false},_populateReferenceSelector:function(){this._pnlReferenceSelector.Insert(new V3.UI.Panel().Set({cssClass:"d-inline-flex justify-content-start align-items-center dropdown-selector"}).Insert(new V3.UI.Panel().Set({cssClass:"dropdown"}).Insert(this._lnkTripSelector.Insert(new V3.UI.Panel().Set({cssClass:"d-inline-flex justify-content-start align-items-center gap-8"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(this._lblTripSelector),new V3.UI.Panel().Set({cssClass:"dds-icon-container"}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-down.svg")))),this._pnlDropDownMenuTripSelector),new V3.UI.Panel().Set({cssClass:"dropdown d-inline-flex justify-content-start align-items-center gap-8"}).Insert(this._lnkClassSelector.Insert(new V3.UI.Panel().Set({cssClass:"d-inline-flex justify-content-start align-items-center gap-8"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(this._lblClassSelector),new V3.UI.Panel().Set({cssClass:"dds-icon-container"}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-down.svg")))),this._pnlDropDownMenuClassSelector),new V3.UI.Panel().Set({cssClass:"dropdown d-inline-flex justify-content-start align-items-center"}).Insert(this._lnkPassengerSelector.Insert(new V3.UI.Panel().Set({cssClass:"d-inline-flex justify-content-start align-items-center"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(this._lblPassengerSelector),new V3.UI.Panel().Set({cssClass:"dds-icon-container"}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-down.svg")))),this._pnlDropDownMenuPassengerSelector)))},_populateDropDownLinkAttribute:function(r,s,q){r.Attributes.add("role","button");r.Attributes.add("data-toggle","dropdown");r.Attributes.add("aria-expanded","false");if(s&&q){r.Attributes.add("data-offset",q)}},_populateDropDownOptions:function(v,u,r,q){for(var s in r){const t=r[s];v.Insert(new V3.UI.HyperLink("javascript:void(0)").Set({cssClass:"dropdown-item",text:t.text,OnClick:function(w,x){u.text(t.text);if(q){this._loadTripMode(t.value);this.searchRequest.tripType=t.value;v.cssClassRem("show")}}.bind(this)}))}},_populateDropDownPreferences:function(w,v,r,t){w.Controls.clear();var q=this.searchRequest.preferences.filter(function(y){return y.Code==t});var x=null;if(q.length>0){x=q[0].Value}r.sort(function(z,y){if(z.Description.toLowerCase()<y.Description.toLowerCase()){return -1}if(z.Description.toLowerCase()>y.Description.toLowerCase()){return 1}return 0});for(var s in r){const u=r[s];if(x==null&&u.Recommended){v.text(u.Description);this.initialPreference.cabin={Code:t,Value:u.Code};this.searchRequest.seatClass={Code:t,Value:u.Code}}else{if(x!=null&&u.Code==x){v.text(u.Description);this.searchRequest.seatClass={Code:t,Value:u.Code}}}w.Insert(new V3.UI.HyperLink("javascript:void(0)").Set({cssClass:"dropdown-item",text:u.Description,OnClick:function(y,z){v.text(u.Description);this.searchRequest.seatClass={Code:t,Value:u.Code};w.cssClassRem("show")}.bind(this)}))}},_populateRadioOptionPreferences:function(z,A,t,x){z.Controls.clear();z.Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown group-title"}).Insert(new V3.UI.Label().Set({cssClass:"",text:x})));var r=this.searchRequest.preferences.filter(function(B){return B.Code==t});var v=null;if(r.length>0){v=r[0].Value}for(var u in A){const y=A[u];var s=false;if(v==null&&y.Recommended){this.initialPreference.sortBy={Code:t,Value:y.Code};this.searchRequest.sortBy={Code:t,Value:y.Code};s=true}else{if(v!=null&&y.Code==v){this.searchRequest.sortBy={Code:t,Value:y.Code};s=true}}const q=new V3.UI.HyperLink("","");q.code=y.Code;const w=new V3.UI.RadioButton(t).Set({cssClass:"form-check-input sort-by-input",value:y.Code,selected:s});q.Insert(w,new V3.UI.Label().Set({text:y.Description}));q.OnClick.addEventHandler(function(C,B){w.selected(true);this.searchRequest.sortBy={Code:t,Value:y.Code};this._runSearch(false)}.bind(this));z.Insert(new V3.UI.Panel().Set({cssClass:"setting-title"}).Insert(q))}},_populateRadioOptionForStopPreference:function(C,w,u,z){C.Controls.clear();C.Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown group-title"}).Insert(new V3.UI.Label().Set({cssClass:"",text:z})));if(w.Min==0&&w.Max==2){var B=[(V3.Res["FlightSearch.Terms.Direct"]||"Direct"),(V3.Res["FlightSearch.Terms.OneStop"]||"1 Stop"),(V3.Res["FlightSearch.Terms.UpTwoStops"]||"Up to 2 Stops")];var D=[{Code:null,Description:(V3.Res["FlightSearch.Terms.Any"]||"Any"),Recommended:true}];for(var v=w.Min;v<w.Max+1;v++){D.push({Code:v,Description:B[v],Recommended:false})}this.initialPreference.stopBy={Code:null,Value:null}}var s=this.searchRequest.preferences.filter(function(E){return E.Code==u});var r=null;if(s.length>0){r=s[0].Value}for(var x in D){const A=D[x];var t=false;if(r==null&&A.Recommended){this.searchRequest.stopBy={Code:u,Value:A.Code};t=true}else{if(r!=null&&A.Code==r){this.searchRequest.stopBy={Code:u,Value:A.Code};t=true}}const q=new V3.UI.HyperLink("","");q.code=A.Code;const y=new V3.UI.RadioButton(u).Set({cssClass:"form-check-input sort-by-input",value:A.Code,selected:t});q.Insert(y,new V3.UI.Label().Set({text:A.Description}));q.OnClick.addEventHandler(function(F,E){y.selected(true);this.searchRequest.stopBy={Code:u,Value:A.Code};this._runSearch(false)}.bind(this));C.Insert(new V3.UI.Panel().Set({cssClass:"setting-title"}).Insert(q))}},_populateAirlineOptionPreferences:function(E,F,C){var B=[];this._airlinesPreferences={};E.Controls.clear();E.Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown group-title"}).Insert(new V3.UI.Panel().Set({cssClass:"d-flex justify-content-between"}).Insert(new V3.UI.Label().Set({cssClass:"",text:C}),this._lnkSelectAllCarriers.Set({text:V3.Res["FlightSearch.Label.Deselect"]||"Deselect"}))));this._allCarriersAreSelected=true;if(this.initialPreference.carriers.length==0){this.initialPreference.carriers=this.initialPreference.carriers.concat(F)}else{for(var v in F){const A=F[v];var z=this.initialPreference.carriers.filter(function(G){return G.Code==A.Code});if(z.length==0){this.initialPreference.carriers.push(A)}}}B=B.concat(this.initialPreference.carriers);B.sort(function(H,G){if(H.Description.toLowerCase()<G.Description.toLowerCase()){return -1}if(H.Description.toLowerCase()>G.Description.toLowerCase()){return 1}return 0});var w=V3.Res["FlightSearch.Label.Only"]||"Only";for(var y in B){const D=B[y];var t=this.searchRequest.preferences.filter(function(G){return G.Code==this.FlightPreference.TransPortProvider}.bind(this));var r=true;if(t.length>0){r=false;var x=this.searchRequest.preferences.filter(function(G){return G.Value==D.Code});if(x.length>0){r=true;this._lnkSelectAllCarriers.text(V3.Res["FlightSearch.Label.SelectAll"]||"Select all");this._allCarriersAreSelected=false}}const s=new V3.UI.Panel().Set({cssClass:"d-flex align-items-center gap-4"});s.controlId=V3.newId();s.code=this.FlightPreference.TransPortProvider;s.value=D.Code;s.selected=r;s.isOnlyMode=false;const q=new V3.UI.HyperLink("","").Set({cssClass:""});const u=new V3.UI.CheckBox().Set({cssClass:"form-checkbox-input",value:D.Code,selected:r,OnChange:function(){s.selected=u.selected();if(!s.isOnlyMode){this._runSearch(false)}}.bind(this)});s.Insert(u,q.Insert(new V3.UI.Label().Set({text:D.Description})));q.OnClick.addEventHandler(function(H,G){if(u.selected()){u.selected(false)}else{u.selected(true)}}.bind(this));u.OnClick.addEventHandler(function(H,G){}.bind(this));E.Insert(new V3.UI.Panel().Set({cssClass:"setting-title d-flex justify-content-between"}).Insert(s,new V3.UI.Panel().Set({cssClass:"setting-title-action"}).Insert(new V3.UI.HyperLink("","").Set({cssClass:"",OnClick:function(){this._selectThisAirlineOnly(s.controlId)}.bind(this)}).Insert(new V3.UI.Label().Set({text:w})))));this._airlinesPreferences[s.controlId]=s}},_selectThisAirlineOnly:function(q){V3.forEach(this._airlinesPreferences,function(r){r.isOnlyMode=true;if(r.controlId!=q){r.Controls._collection[0].selected(false)}else{r.Controls._collection[0].selected(true)}});this._lnkSelectAllCarriers.text(V3.Res["FlightSearch.Label.SelectAll"]||"Select all");this._allCarriersAreSelected=false;this._resetOnlyModeForCarriers();this._runSearch(false)},_selectAllCarriers:function(){V3.forEach(this._airlinesPreferences,function(q){q.isOnlyMode=true;if(q.Controls._collection.length>0){if(this._allCarriersAreSelected){q.Controls._collection[0].selected(false)}else{q.Controls._collection[0].selected(true)}}}.bind(this));if(this._allCarriersAreSelected){this._lnkSelectAllCarriers.text(V3.Res["FlightSearch.Label.SelectAll"]||"Select all");this._allCarriersAreSelected=false}else{this._lnkSelectAllCarriers.text(V3.Res["FlightSearch.Label.Deselect"]||"Deselect");this._allCarriersAreSelected=true}this._resetOnlyModeForCarriers()},_resetOnlyModeForCarriers:function(){V3.forEach(this._airlinesPreferences,function(q){q.isOnlyMode=false}.bind(this))},_loadAvailablePreferences:function(u){if(u.AvailablePreferences==null){return}var y=u.AvailablePreferences.Preferences.filter(function(D){return D.Code.toLowerCase()===this.FlightPreference.Cabin.toLowerCase()}.bind(this));if(y.length>0){this._populateDropDownPreferences(this._pnlDropDownMenuClassSelector,this._lblClassSelector,y[0].Select.Options,y[0].Code)}var r=u.AvailablePreferences.Preferences.filter(function(D){return D.Code.toLowerCase()===this.FlightPreference.Sort.toLowerCase()}.bind(this));if(r.length>0){this._populateRadioOptionPreferences(this._pnlAdvanceFilterSort,r[0].Select.Options,r[0].Code,r[0].Name)}var z=u.AvailablePreferences.Preferences.filter(function(D){return D.Code.toLowerCase()===this.FlightPreference.Stop.toLowerCase()}.bind(this));if(z.length>0){this._populateRadioOptionForStopPreference(this._pnlAdvanceFilterStop,z[0].Units,z[0].Code,z[0].Name)}var t=u.AvailablePreferences.Preferences.filter(function(D){return D.Code.toLowerCase()===this.FlightPreference.TransPortProvider.toLowerCase()}.bind(this));if(t.length>0){this._populateAirlineOptionPreferences(this._pnlAdvanceFilterAirplanes,t[0].Select.Options,t[0].Name)}var v=u.AvailablePreferences.PreferenceGroups.filter(function(D){return D.PreferenceType.toLowerCase()===this.FlightPreference.Passenger.toLowerCase()}.bind(this));this._pnlPassengerGroup.Controls.clear();this._flightSearchPassengersAndBagControls={};if(v.length>0){const q=v[0];this._lblPassengerGroupTitle.text(q.GroupName);for(var A in q.Preferences){var C=q.Preferences[A];var s=this.searchRequest.preferences.filter(function(D){return D.Code==C.Code});var B=null;if(s.length>0){B=s[0].Value}this._addPreferenceControl({group:q.PreferenceType.toLowerCase(),code:C.Code,title:C.Units.UnitName,description:"",defaultValue:B==null?C.Units.DefaultValue:B,min:C.Units.Min,max:C.Units.Max},this._pnlPassengerGroup)}this._recalculatePassengerCount()}var x=u.AvailablePreferences.PreferenceGroups.filter(function(D){return D.PreferenceType.toLowerCase()===this.FlightPreference.Bags.toLowerCase()}.bind(this));this._pnlBagsGroup.Controls.clear();if(x.length>0){const w=x[0];this._lblBagsGroupTitle.text(w.GroupName);for(var A in w.Preferences){var C=w.Preferences[A];this._addPreferenceControl({group:w.PreferenceType.toLowerCase(),code:C.Code,title:C.Name,description:"",defaultValue:C.Units.DefaultValue,min:C.Units.Min,max:C.Units.Max},this._pnlBagsGroup)}}},_flightSearchResults:null,_maxFlightCardToShow:5,_currentSearchResultStartIndex:0,_currentSearchResultEndIndex:5,_resetFlightResultSettings:function(){this._flightSearchResults=null;this._maxFlightCardToShow=5;this._currentSearchResultStartIndex=0;this._currentSearchResultEndIndex=5},_populateFlightSearchResult:function(q){this._resetFlightResultSettings();this._pnlSearchResult.Controls.clear();if(q!=null&&q.length>0){this._flightSearchResults=q;if(this._flightSearchResults.length<this._maxFlightCardToShow){this._currentSearchResultEndIndex=this._flightSearchResults.length}else{this._currentSearchResultEndIndex=this._maxFlightCardToShow}this._currentSearchResultStartIndex=0;this._populateFlightResultCards(this._currentSearchResultStartIndex,this._currentSearchResultEndIndex)}else{this._showNoSearchResultMessage();this._btnLoadMoreFlightCard.Parent.visible(false)}},_populateFlightResultCards:function(u,t){if(u>this._flightSearchResults.length){return}if(t>this._flightSearchResults.length){return}var s=this.searchRequest.tripType==this.TripType.MultiCity.value;for(var r=u;r<t;r++){var q=new V3.CABS.UI.FlightResultCard(this._flightSearchResults[r],s,this.searchRequest.preferences);this._pnlSearchResult.Insert(q)}this._currentSearchResultStartIndex=t;if(this._currentSearchResultStartIndex>=this._flightSearchResults.length){}if(this._currentSearchResultStartIndex>=this._flightSearchResults.length){this._btnLoadMoreFlightCard.Parent.visible(false)}else{if(this._maxFlightCardToShowNow>this._flightSearchResults.length){this._btnLoadMoreFlightCard.Parent.visible(false)}else{this._btnLoadMoreFlightCard.Parent.visible(true)}}},_loadMoreFlightSearchCards:function(){if(this._currentSearchResultStartIndex>=this._flightSearchResults.length){return}if(this._flightSearchResults.length<(this._currentSearchResultStartIndex+this._maxFlightCardToShow)){this._currentSearchResultEndIndex=this._flightSearchResults.length}else{this._currentSearchResultEndIndex=this._currentSearchResultStartIndex+this._maxFlightCardToShow}this._populateFlightResultCards(this._currentSearchResultStartIndex,this._currentSearchResultEndIndex)},_populateFlexibleDates:function(u,r,q,s,t){var v=this._mapDataForFlexibleDates(u,r,q,s,t);if(q){this.FlixebleDateSlider.AddNewItems(v,s)}else{this.FlixebleDateSlider.PopulateSliderItems(v,this._pnlDateFilterSlider)}this.FlexibleDateExist=true},_mapDataForFlexibleDates:function(S,w,A,q,R){var s=[];var J="yyyy-MM-dd";var u=A?new V3Date(w):new V3Date(this.searchRequest.routes[0].DepartureDate);var E=new V3Date();var N=this._getDaysDiff(E,u);var L=-2;var r=N<2?(4-N):3;var z=document.body.clientWidth>767?5:3;if(A&&q){L=0;r=R-1}if(A&&!q){L=0-(R);r=0}for(var M=L;M<(r+1);M++){if(s.length<z){var t=new V3Date(u).addDays(M);var F=S.filter(function(x){return new V3Date(x.Routes[0].Depart.LocalDateTime).toStringFormat(J)==t.toStringFormat(J)});if(F.length>0){var P=F[0];var G=[];for(var y in P.Routes){const Q=P.Routes[y];var D=new V3Date(Q.Depart.LocalDateTime);G.push({shortDate:D.toStringUI("MMM dd"),shortDay:D.toStringUI("ddd"),fullDate:D.toStringFormat(J)})}s.push({startDate:G[0].fullDate,routes:G,price:this._formatCurrency(P.CostBreakdown.Total),selected:new V3Date(this.searchRequest.routes[0].DepartureDate).toStringFormat(J)==G[0].fullDate?true:false})}}}if(s.length<z){for(var C=L;C<(r+1);C++){var v=new V3Date(u).addDays(C);if(new V3Date(v).toStringFormat(J)>=new V3Date().toStringFormat(J)){var F=s.filter(function(x){return x.startDate==v.toStringFormat(J)});if(F.length==0){var H=[{shortDate:v.toStringUI("MMM dd"),shortDay:v.toStringUI("ddd"),fullDate:v.toStringFormat(J)}];if(this.searchRequest.tripType==j.RoundTrip&&this.searchRequest.routes.length>1){var K=new V3Date(this.searchRequest.routes[0].DepartureDate);var I=new V3Date(this.searchRequest.routes[1].DepartureDate);var O=this._getDaysDiff(K,I);var B=new V3Date(v).addDays(O);H.push({shortDate:B.toStringUI("MMM dd"),shortDay:B.toStringUI("ddd"),fullDate:B.toStringFormat(J)})}s.push({startDate:v.toStringFormat(J),routes:H,price:null,selected:new V3Date(this.searchRequest.routes[0].DepartureDate).toStringFormat(J)==v.toStringFormat(J)?true:false})}}}}if(q){s.sort(function(T,x){if(T.startDate.toLowerCase()<x.startDate.toLowerCase()){return -1}if(T.startDate.toLowerCase()>x.startDate.toLowerCase()){return 1}return 0})}else{s.sort(function(T,x){if(T.startDate.toLowerCase()>x.startDate.toLowerCase()){return -1}if(T.startDate.toLowerCase()<x.startDate.toLowerCase()){return 1}return 0})}return s},_formatCurrency:function(t){var s=V3.CultureInfo.currentUICulture().currencyISOAbbreviation();var r=0;var q=new V3.NumberFormatInfo({DecimalDigits:r,Symbol:s},V3.CultureInfo.currentUICulture().currencyNumberFormat());return t.toStringFormat("C",q)},_getDaysDiff:function(r,u){var v=new Date(r);var q=u?new Date(u):v;var t=q.getTime()-v.getTime();var s=Math.round(t/(24*60*60*1000));return s},_loadAdvanceSearchMode:function(){this._pnlAdvanceSection.cssClassRem("d-none");this._pnlAdvanceSection.Insert(this._pnlAdvanceInnerSection.Insert(this._pnlAdvanceFilter,this._pnlSearchResultContainer.Insert(this._pnlDateFilterSlider,this._pnlMainResult)));this._pnlAdvanceFilter.Insert(this._pnlAdvanceFilterSort,this._pnlAdvanceFilterStop,this._pnlAdvanceFilterAirplanes);this._pnlMainResult.Insert(this._pnlSearchResult,this._pnlLoadMoreButtonContainer.Insert(this._btnLoadMoreFlightCard));this._loadTripMode(this._selectedTripMode)},_loadTripMode:function(s){this._pnlTripSelector.Controls.clear();this._flightSearchTripControls={};this._selectedTripMode=s;this._pnlTripSelector.Parent.cssClassAdd("vertical align-items-center py-5");var t=this.AdvanceMode?this.SearchFilterMode.Horizontal:this.SearchFilterMode.Vertical;if(this.AdvanceMode){this._pnlReferenceSelector.cssClassRem("mt-2");this._pnlReferenceSelector.cssClassAdd("mt-3 mb-3 px-4 dd-menu-container");this._pnlTripSelector.cssClassAdd("d-flex flex-lg-row flex-column justify-content-between gap-12 w-100 px-4");this._pnlTripSelector.Parent.cssClassRem("vertical align-items-center py-5");this._pnlTripSelector.Parent.cssClassAdd("horizontal align-items-start py-0");this._lblTitle.Parent.Parent.visible(false)}this._showErrorMesssage(false);switch(s){case this.TripType.InboundTerritory.value:this._pnlInbound.Controls.clear();this._addTripControl({mode:t,multiTrip:false,showReturnDate:false,tripType:j.Inbound,defaultData:this.searchRequest.routes.length>0?this.searchRequest.routes[0]:null},this._pnlInbound);var u="d-flex justify-content-between align-items-center mt-4";if(this.AdvanceMode){u=" d-flex justify-content-between align-items-center";this._pnlInbound.cssClassAdd("w-100")}this._pnlTripSelector.Insert(this._pnlInbound,new V3.UI.Panel().Set({cssClass:u}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(this._lnkShowFilter),new V3.UI.Panel().Set({cssClass:"flex-fill h-100 text-right"}).Insert(this._btnSearch)));break;case this.TripType.OutboundTerritory.value:this._pnlOutbond.Controls.clear();this._addTripControl({mode:t,multiTrip:false,showReturnDate:false,tripType:j.Outbound,defaultData:this.searchRequest.routes.length>0?this.searchRequest.routes[0]:null},this._pnlOutbond);var u="d-flex justify-content-between align-items-center mt-4";if(this.AdvanceMode){u="d-flex justify-content-between align-items-center";this._pnlOutbond.cssClassAdd("w-100")}this._pnlTripSelector.Insert(this._pnlOutbond,new V3.UI.Panel().Set({cssClass:u}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(this._lnkShowFilter),new V3.UI.Panel().Set({cssClass:"flex-fill h-100 text-right"}).Insert(this._btnSearch)));break;case this.TripType.RoundTrip.value:this._pnlRoundTrip.Controls.clear();var r=this.searchRequest.routes.length>0?this.searchRequest.routes[0]:null;if(r){r.ReturnDate=this.searchRequest.routes.length==2?this.searchRequest.routes[1].DepartureDate:null}this._addTripControl({mode:t,multiTrip:false,showReturnDate:true,tripType:j.RoundTrip,defaultData:r},this._pnlRoundTrip);var u="d-flex justify-content-between align-items-center mt-4";if(this.AdvanceMode){u="d-flex justify-content-between align-items-center";this._pnlRoundTrip.cssClassAdd("w-100")}this._pnlTripSelector.Insert(this._pnlRoundTrip,new V3.UI.Panel().Set({cssClass:u}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(this._lnkShowFilter),new V3.UI.Panel().Set({cssClass:"flex-fill h-100 text-right"}).Insert(this._btnSearch)));break;case this.TripType.MultiCity.value:this._pnlMultiTrip.Controls.clear();this._pnlMultiTripContainer.Controls.clear();this._pnlMultiTripContainer.Insert(this._pnlMultiTrip,new V3.UI.Panel().Set({cssClass:"d-flex justify-content-between align-items-center gap-12 mt-4"}).Insert(new V3.UI.Panel().Set({cssClass:"d-flex flex-row justify-content-between align-items-center flex-fill "}).Insert(this._lnkShowFilter,this._lnkAddTrip),new V3.UI.Panel().Set({cssClass:"text-right"}).Insert(this._btnSearch)));if(this.AdvanceMode){this._pnlMultiTrip.cssClassAdd("w-100");this._pnlMultiTripContainer.cssClassAdd("w-100")}var v=this.searchRequest.routes.length>1?this.searchRequest.routes:[null,null];for(var q=0;q<v.length;q++){this._addTripControl({mode:this.SearchFilterMode.Horizontal,multiTrip:true,showReturnDate:false,tripType:j.MultiCity,defaultData:v[q]},this._pnlMultiTrip)}this._pnlTripSelector.Insert(this._pnlMultiTripContainer);break}},_addPreferenceControl:function(q,r){var s=new V3.CABS.UI.PreferenceControl(q).Set({OnQtyUpdated:function(t,u){this._recalculatePassengerCount()}.bind(this),OnObjectLostfocus:function(t){this._pnlDropDownMenuPassengerSelector.cssClassRem("show")}.bind(this)});s.Configure();this._flightSearchPassengersAndBagControls[s.controlId]=s;r.Insert(s)},_addTripControl:function(q,z){var r=Object.keys(this._flightSearchTripControls).length;var t=r==0?1:(parseInt(r)+1);var y=new V3.CABS.UI.FlightSearchFilter({mode:q.mode,dateFormatString:this.DateFormat,showReturnDate:q.showReturnDate,tripNumber:t,tripType:q.tripType,defaultData:q.defaultData}).Set({ChannelShortName:this.ChannelShortName,DateFormat:this.DateFormat,OnDropDownDisplayed:function(A){this._pnlDropDownMenuPassengerSelector.cssClassRem("show")}.bind(this),OnControlRemoved:function(A,B){this._removeTripControl(this._pnlMultiTrip,B)}.bind(this),OnDestinationChanged:function(B,C){if(this._selectedTripMode==this.TripType.MultiCity.value){var A=false;V3.forEach(this._flightSearchTripControls,function(D){if(A){D.SetFlightFromLocation(C.text);D.SetFlightFromCode(C.code);A=false}if(this._flightSearchTripControls[C.controlId]==D){A=true}}.bind(this))}}.bind(this),OnDateChangedForRoundTrip:function(A,B){this._resetDepartureDatesForRoundTrip(B)}.bind(this),OnDepartureDateChangedForMultiCity:function(A,B){this._resetDepartureDatesForMultiCity(B)}.bind(this)});if(q.multiTrip){y.cssClassAdd("mt-2")}this._flightSearchTripControls[y.controlId]=y;z.Insert(y);r=Object.keys(this._flightSearchTripControls).length;if(!q.defaultData){var x=r<2?0:this._numberToIncreaseDate;if(q.multiTrip){var v=new V3Date(this._minDate);V3.forEach(this._flightSearchTripControls,function(A){if(A.controlId!=y.controlId){v=new V3Date(A.GetDepartureDate())}});y.Configure({maxDate:v.addDays(365+x),selectedDate:v.addDays(x)});var s=Object.keys(this._flightSearchTripControls);if(s.length>2){var w=s.length-2;var u=this._flightSearchTripControls[s[w]];if(u){y.SetFlightFromLocation(u.GetFlightToLocation());y.SetFlightFromCode(u.GetFlightToCode())}}}else{y.Configure({maxDate:this._minDate.addDays(365+x),selectedDate:this._minDate.addDays(x)})}}if(r>2){V3.forEach(this._flightSearchTripControls,function(A){A.ShowRemoveButton(true)})}if(r>=this._maxiumumTripForMultiCity){this._lnkAddTrip.visible(false)}else{this._lnkAddTrip.visible(true)}this._setMultiTripInputTitle()},_removeTripControl:function(r,s){var t=this._flightSearchTripControls[s];r.Controls.remove(t);delete this._flightSearchTripControls[s];var q=Object.keys(this._flightSearchTripControls).length;if(q<3){V3.forEach(this._flightSearchTripControls,function(u){u.ShowRemoveButton(false)})}if(q<this._maxiumumTripForMultiCity){this._lnkAddTrip.visible(true)}this._setMultiTripInputTitle()},_setMultiTripInputTitle:function(){var q=1;V3.forEach(this._flightSearchTripControls,function(r){r.SetInputTitle((V3.Res["FlightSearch.Terms.Flight"]||"Flight")+" "+q);q++})},_hideDropDownInTripControls:function(){this._pnlDropDownMenuTripSelector.cssClassRem("show");this._pnlDropDownMenuClassSelector.cssClassRem("show");this._pnlDropDownMenuPassengerSelector.cssClassRem("show");V3.forEach(this._flightSearchTripControls,function(q){q.HideDropDown()})},_recalculatePassengerCount:function(){var q=0;V3.forEach(this._flightSearchPassengersAndBagControls,function(r){if(r.GetGroup().toLowerCase()==this.FlightPreference.Passenger.toLowerCase()){q+=parseInt(r.GetValue())}}.bind(this));this._lblPassengerSelector.text(V3.CABS.Utils.ProcessPlaceholders((V3.Res["FlightSearch.Label.NumberOfPassenger"]||"{quantity} {passenger}"),{"{quantity}":q,"{passenger}":q>1?(V3.Res["FlightSearch.Terms.Passengers"]||"Passengers"):(V3.Res["FlightSearch.Terms.Passenger"]||"Passenger")}))},_resetAllPreferences:function(){this._allCarriersAreSelected=false;this._selectAllCarriers()},_resetDepartureDatesForRoundTrip:function(r){var q=this._numberToIncreaseDate;V3.forEach(this._flightSearchTripControls,function(t){if(this._flightSearchTripControls[r]==t){var u=new V3Date(t.GetDepartureDate());var s=new V3Date(t.GetReturnDate());if(s<u){t.ConfigureRoundTrip({selectedDate:u,returnDate:u.addDays(q)})}else{t.ConfigureRoundTrip({minReturnDate:u})}return}}.bind(this))},_resetDepartureDatesForMultiCity:function(r){var t=false;var s=new V3Date();var q=this._numberToIncreaseDate;V3.forEach(this._flightSearchTripControls,function(u){if(t){var v=new V3Date(u.GetDepartureDate());if(v<s){u.Configure({maxDate:s.addDays(365+q),selectedDate:s.addDays(q)})}s=v}if(this._flightSearchTripControls[r]==u){s=new V3Date(u.GetDepartureDate());t=true}}.bind(this))},_generateRequest:function(){var r=[];if(this.searchRequest.seatClass!=null){r.push(this.searchRequest.seatClass)}if(this.searchRequest.sortBy!=null){r.push(this.searchRequest.sortBy)}if(this.searchRequest.stopBy!=null){if(this.searchRequest.stopBy.Value!=null){r.push(this.searchRequest.stopBy)}}V3.forEach(this._flightSearchPassengersAndBagControls,function(s){r.push({Code:s.GetCode(),Value:s.GetValue()})});if(!this._allCarriersAreSelected){V3.forEach(this._airlinesPreferences,function(s){if(s.selected){r.push({Code:s.code,Value:s.value})}})}var q=[];V3.forEach(this._flightSearchTripControls,function(s){q.push({DepartureDate:s.GetDepartureDate(),FromLocation:s.GetFlightFromLocation(),FromCode:s.GetFlightFromCode(),ToLocation:s.GetFlightToLocation(),ToCode:s.GetFlightToCode()});if(this.searchRequest.tripType==this.TripType.RoundTrip.value){q.push({DepartureDate:s.GetReturnDate(),FromLocation:s.GetFlightFromLocation(),FromCode:s.GetFlightToCode(),ToLocation:s.GetFlightToLocation(),ToCode:s.GetFlightFromCode()})}}.bind(this));this.searchRequest.routes=q;this.searchRequest.preferences=r},_validateRequest:function(){var q=this.searchRequest.routes;if(q.length==0){return false}var t=false;if(this.searchRequest.tripType==j.Inbound){if(!providerSearchControlSettings.InTerritoryLocation.includes(q[0].ToCode)){return false}}if(this.searchRequest.tripType==j.Outbound){if(!providerSearchControlSettings.InTerritoryLocation.includes(q[0].FromCode)){return false}}for(var s=0;s<q.length;s++){const r=q[s];if(r.FromCode==""||r.ToCode==""){return false;break}if(providerSearchControlSettings.InTerritoryLocation.includes(r.FromCode)||providerSearchControlSettings.InTerritoryLocation.includes(r.ToCode)){t=true;break}}return t},_showNoSearchResultMessage:function(){this._pnlSearchResult.Controls.clear();var q=Object.keys(this._airlinesPreferences).length;if(q>0&&!this._allCarriersAreSelected){this._btnClearCarrierFilters.visible(true)}this._pnlSearchResult.Insert(new V3.UI.Panel().Set({cssClass:"flex-fill pt-5 pb-2 text-center"}).Insert(new V3.UI.Label().Set({cssClass:"flight-search-error",text:(V3.Res["FlightSearch.Error.NoFlightResult"]||"Sorry, we couldn’t find your trip. Try different dates?")})),new V3.UI.Panel().Set({cssClass:"flex-fill text-center"}).Insert(new V3.UI.Label().Set({cssClass:"flight-search-error-action",text:(V3.Res["FlightSearch.Error.NextAction"]||"Try selecting different dates or change your search criteria to get better results.")})),new V3.UI.Panel().Set({cssClass:"flex-fill pt-2 text-center"}).Insert(this._btnClearCarrierFilters))},_showErrorMesssage:function(q){this._pnlErrorMessage.visible(q)},_runSearch:function(q){this._btnClearCarrierFilters.visible(false);this._generateRequest();this._showErrorMesssage(false);if(!this._validateRequest()){this._showErrorMesssage(true);return false}else{if(!this.AdvanceMode){this.AdvanceMode=true;this._loadAdvanceSearchMode()}this._onSearchFlightExecuted(this,true);this._pnlDateFilterSlider.DOMElement.innerHTML="";this._btnLoadMoreFlightCard.Parent.visible(false);if(!q){this._pnlAdvanceFilter.cssClassRem("show-on-mobile");this._pnlAdvanceFilter.cssClassAdd("d-none");this._lblShowFilter.text(V3.Res["FlightSearch.Label.ShowFilter"]||"Show Filter")}if(this.searchRequest==null){return}var r=this.searchRequest;r.ChannelShortName=this.ChannelShortName;r.Language=V3.CultureInfo.currentUICulture().twoLetterISOLanguageName();r.CurrencyCode=V3.CultureInfo.currentUICulture().currencyISOAbbreviation();this._pnlSearchResult.Controls.clear();this.PerformSearchFlights(r,function(s){if(!s.AvailablePreferences){this._onSearchFlightExecuted(this,false);this._showNoSearchResultMessage();return}if(q){this._loadAvailablePreferences(s)}this._populateFlightSearchResult(s.SearchResults);if(this.searchRequest.tripType!=j.MultiCity){this._runSearchForFlexibleDateOnly(false,null,null,true,5)}else{this._pnlDateFilterSlider.DOMElement.innerHTML="";this._onSearchFlightExecuted(this,false)}}.bind(this))}},_runSearchForFlexibleDateOnly:function(s,r,x,t,w){var u=Object.assign({},this.searchRequest);u.ChannelShortName=this.ChannelShortName;u.Language=V3.CultureInfo.currentUICulture().twoLetterISOLanguageName();u.CurrencyCode=V3.CultureInfo.currentUICulture().currencyISOAbbreviation();u.DaysToInclude=s?6:5;var q=u.routes[0].DepartureDate;var v=u.routes.length>1?u.routes[1].DepartureDate:null;if(s){u.routes[0].DepartureDate=r;if(u.routes.length>1){u.routes[1].DepartureDate=x}}this._onSearchFlightExecuted(this,true);this.PerformSearchFlights(u,function(y){if(y.SearchResults){this.searchRequest.routes[0].DepartureDate=q;if(this.searchRequest.routes.length>1){this.searchRequest.routes[1].DepartureDate=v}this._populateFlexibleDates(y.SearchResults,r,s,t,w)}this._onSearchFlightExecuted(this,false)}.bind(this))},AdvanceMode:V3.Property(false).OnChange(function(q){}),Initialize:function(){this._init();this._loadTripMode(this.TripType.InboundTerritory.value);this._onSearchFlightExecuted(this,true);var q={ChannelShortName:this.ChannelShortName,Language:V3.CultureInfo.currentUICulture().twoLetterISOLanguageName(),CurrencyCode:V3.CultureInfo.currentUICulture().currencyISOAbbreviation()};this.PerformSearchFlights(q,function(r){this._loadAvailablePreferences(r);this._onSearchFlightExecuted(this,false)}.bind(this))},Configure:function(q){},UpdateDepartureDate:function(r,q){V3.forEach(this._flightSearchTripControls,function(s){s.SetDepartureDate(r,q)}.bind(this));this._runSearch(true)},ReInitDateSlider:function(){if(this.FlighSearchActive&&this.FlexibleDateExist){this._runSearch(true)}else{if(!this.FlighSearchActive&&this.FlexibleDateExist){this.PendingSearch=true}}},PerformPendingSearch:function(){this.PendingSearch=false;this._runSearch(true)},PerformSearchFlights:function(q,r){if(!V3.WebServices||!V3.WebServices.FlightService){setTimeout(function(){this.ExecuteSearchFlights(q,r)}.bind(this),1000)}else{this.ExecuteSearchFlights(q,r)}},ExecuteSearchFlights:function(r,t){V3.WebServices.FlightService.FlightSearch(function s(u){t(u)}.bind(this),function q(u){V3.Log.Error("Error while trying to make AJAX call","error",error);this.lblError.text(V3.Res["ProviderSearch.Error.Unexpected"]||"Unexpected error")}.bind(this),r)}});var b=function b(q){this.base("reference-control setting pt-2 d-flex justify-content-between align-items-center");this.Settings=q;this.Insert(new V3.UI.Panel().Set({cssClass:"d-flex gap-8"}).Insert(new V3.UI.Label().Set({cssClass:"setting-title",text:this.Settings.title}),new V3.UI.Label().Set({cssClass:"setting-description",text:this.Settings.description})),new V3.UI.Panel().Set({cssClass:"setting-inputs d-inline-flex justify-contents-between align-items-center gap-8"}).Insert(this._lnkReduceQty,this._txtInput,this._lblQty,this._lnkAddQty));this._lnkReduceQty.DOMElement.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="10" height="10" viewBox="0 0 256 256" xml:space="preserve"><defs></defs><g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"><path d="M 82 53 H 8 c -4.418 0 -8 -3.582 -8 -8 c 0 -4.418 3.582 -8 8 -8 h 74 c 4.418 0 8 3.582 8 8 C 90 49.418 86.418 53 82 53 z" style="stroke: none;stroke-width: 1;stroke-dasharray: none;stroke-linecap: butt;stroke-linejoin: miter;stroke-miterlimit: 10;fill: #000;fill-rule: nonzero;opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"></path></g></svg>';this._lnkAddQty.DOMElement.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="10" height="10" viewBox="0 0 256 256" xml:space="preserve"><defs></defs><g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"><path d="M 45 90 c -4.418 0 -8 -3.582 -8 -8 V 8 c 0 -4.418 3.582 -8 8 -8 c 4.418 0 8 3.582 8 8 v 74 C 53 86.418 49.418 90 45 90 z" style="stroke: none;stroke-width: 1;stroke-dasharray: none;stroke-linecap: butt;stroke-linejoin: miter;stroke-miterlimit: 10;fill: #000;fill-rule: nonzero;opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"></path><path d="M 82 53 H 8 c -4.418 0 -8 -3.582 -8 -8 c 0 -4.418 3.582 -8 8 -8 h 74 c 4.418 0 8 3.582 8 8 C 90 49.418 86.418 53 82 53 z" style="stroke: none;stroke-width: 1;stroke-dasharray: none;stroke-linecap: butt;stroke-linejoin: miter;stroke-miterlimit: 10;fill: #000;fill-rule: nonzero;opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"></path></g></svg>';this.controlId=V3.newId()}.InheritsFrom(V3.UI.Panel,{OnQtyUpdated:V3.EventPrototype("sender, controlId"),OnObjectLostfocus:V3.EventPrototype("sender"),_lnkReduceQty:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"qty-btn qty-minplus flex-fill",OnClick:function(q,r){this._decreaseQuantity()},OnUnfocus:function(q,r){if(r.newFocus==document.body){this.OnObjectLostfocus.fire(this)}}}),_lnkAddQty:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"qty-btn qty-minplus flex-fill",OnClick:function(q,r){this._increaseQuantity()},OnUnfocus:function(q,r){if(r.newFocus==document.body){this.OnObjectLostfocus.fire(this)}}}),_lblQty:V3.UI.Label().Defaults({cssClass:"qty-label flex-fill"}),_txtInput:V3.UI.TextBox().Defaults({cssClass:"qty-input d-none",text:"-1",OnChange:function(q,r){this._onQtyUpdated()}}),_decreaseQuantity:function(){var r=parseInt(this._txtInput.text());if(r>parseInt(this.Settings.min)){var q=parseInt(r)-1;this._txtInput.text(q)}},_increaseQuantity:function(){var r=parseInt(this._txtInput.text());if(r<(parseInt(this.Settings.max))){var q=parseInt(r)+1;this._txtInput.text(q)}},_onQtyUpdated:function(){var q=parseInt(this._txtInput.text());if(q<(parseInt(this.Settings.min)+1)){this._lnkReduceQty.cssClassAdd("disabled");this._lnkReduceQty.enabled(false)}else{this._lnkReduceQty.cssClassRem("disabled");this._lnkReduceQty.enabled(true)}if(q>(parseInt(this.Settings.max)-1)){this._lnkAddQty.cssClassAdd("disabled");this._lnkAddQty.enabled(false)}else{this._lnkAddQty.cssClassRem("disabled");this._lnkAddQty.enabled(true)}this._lblQty.text(q);this.OnQtyUpdated.fire(this,this.controlId)},Configure:function(){this._txtInput.text(this.Settings.defaultValue)},GetGroup:function(){return this.Settings.group},GetCode:function(){return this.Settings.code},GetValue:function(){return this._txtInput.text()}});var o=function o(q){this.base("flight-search-filter d-flex flex-column flex-lg-row justify-content-between");this._displayMode=q?q.mode:"";this._showReturnDate(q?q.showReturnDate:false);this._tripType=q.tripType;this._defaultData=q.defaultData;this.DateFormat=q.dateFormatString;if(this._displayMode.toLowerCase()=="vertical"){this.Insert(new V3.UI.Panel().Set({cssClass:"col-12 d-flex flex-column place-input-container vertical"}).Insert(this._pnlOrigin.Insert(new V3.UI.Panel().Set({cssClass:"col-12 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"from-airport"}).Insert(new V3.UI.Image("../Resources/Images/Icons/plane-departure.svg")),new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.From"]||"From")})),new V3.UI.Panel().Set({cssClass:"dropdown"}).Insert(this._lnkFlightFrom,this._pnlDropDownFlightFromSelector)))),this._pnlDestination.Insert(new V3.UI.Panel().Set({cssClass:"col-12 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"to-airport"}).Insert(new V3.UI.Image("../Resources/Images/Icons/pin.svg")),new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.To"]||"To")})),new V3.UI.Panel().Set({cssClass:"dropdown"}).Insert(this._lnkFlightTo,this._pnlDropDownFlightToSelector)))),this._pnlDeparture.Insert(new V3.UI.Panel().Set({cssClass:"col-12 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"",OnClick:function(){this._txtDepartureDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/calendar.svg")),new V3.UI.Panel().Set({cssClass:"w-100"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.Departure"]||"Departure")})),new V3.UI.Panel().Set({cssClass:"place-input-date-container"}).Insert(this._txtDepartureDateReal,this._txtDepartureDate,this._lblDepartureDate)),new V3.UI.Panel().Set({cssClass:"dds-icon-container",OnClick:function(){this._txtDepartureDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-down.svg")))),this._pnlReturn.Insert(new V3.UI.Panel().Set({cssClass:"col-12 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"",OnClick:function(){this._txtReturnDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/calendar.svg")),new V3.UI.Panel().Set({cssClass:"w-100"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.Return"]||"Return")})),new V3.UI.Panel().Set({cssClass:"place-input-date-container"}).Insert(this._txtReturnDateReal,this._txtReturnDate,this._lblReturnDate)),new V3.UI.Panel().Set({cssClass:"dds-icon-container",OnClick:function(){this._txtReturnDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-down.svg"))))))}else{this.Insert(this._pnlInputContainer.Insert(new V3.UI.Panel().Set({cssClass:"d-flex flex-column flex-lg-row justify-content-between place-input-container horizontal "+this._tripType}).Insert(new V3.UI.Panel().Set({cssClass:"d-sm-block d-lg-none trip-title-container"}).Insert(new V3.UI.Panel().Set({cssClass:"d-flex align-items-center justify-content-between"}).Insert(this._lblTripTitle,this._btnRemoveForSmallScreen)),this._pnlOrigin.Set({cssClass:"origin flex-fill w-100 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"from-airport"}).Insert(new V3.UI.Image("../Resources/Images/Icons/plane-departure.svg")),new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.From"]||"From")})),new V3.UI.Panel().Set({cssClass:"dropdown"}).Insert(this._txtFlightFromCode,this._lnkFlightFrom,this._pnlDropDownFlightFromSelector))),this._pnlDestination.Set({cssClass:"destination flex-fill w-100 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"to-airport"}).Insert(new V3.UI.Image("../Resources/Images/Icons/pin.svg")),new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.To"]||"To")})),new V3.UI.Panel().Set({cssClass:"dropdown"}).Insert(this._txtFlightToCode,this._lnkFlightTo,this._pnlDropDownFlightToSelector))),this._pnlDeparture.Set({cssClass:"departure flex-fill w-100 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"",OnClick:function(){this._txtDepartureDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/calendar.svg")),new V3.UI.Panel().Set({cssClass:"w-100"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.Departure"]||"Departure")})),new V3.UI.Panel().Set({cssClass:"place-input-date-container"}).Insert(this._txtDepartureDateReal,this._txtDepartureDate,this._lblDepartureDate)),new V3.UI.Panel().Set({cssClass:"dds-icon-container",OnClick:function(){this._txtDepartureDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-down.svg"))),this._pnlReturn.visible()?this._pnlReturn.Set({cssClass:"return flex-fill w-100 d-inline-flex justify-content-start align-items-center place-input"}).Insert(new V3.UI.Panel().Set({cssClass:"",OnClick:function(){this._txtReturnDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/calendar.svg")),new V3.UI.Panel().Set({cssClass:"w-100"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:(V3.Res["FlightSearch.Label.Return"]||"Return")})),new V3.UI.Panel().Set({cssClass:"place-input-date-container"}).Insert(this._txtReturnDateReal,this._txtReturnDate,this._lblReturnDate)),new V3.UI.Panel().Set({cssClass:"dds-icon-container",OnClick:function(){this._txtReturnDate.DOMElement.showPicker()}.bind(this)}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-down.svg"))):"")),this._pnlBtnContainer.Insert(this._btnRemove.Insert(new V3.UI.Image("../Resources/Images/Icons/close.svg"))))}this.controlId=V3.newId();this._lnkFlightFrom.text(V3.Res["FlightSearch.Label.ChooseAirport"]||"Choose your airport");this._lnkFlightTo.text(V3.Res["FlightSearch.Label.ChooseAirport"]||"Choose your airport");this._txtInputFrom.placeholder(V3.Res["FlightSearch.Label.ChooseAirport"]||"Choose your airport");this._txtInputTo.placeholder(V3.Res["FlightSearch.Label.ChooseAirport"]||"Choose your airport");this._init()}.InheritsFrom(V3.UI.Panel,{OnDropDownDisplayed:V3.EventPrototype("sender"),OnControlRemoved:V3.EventPrototype("sender, controlId"),OnDestinationChanged:V3.EventPrototype("sender, e:{controlId:guid,tripType:string,code:string,text:string}"),OnDateChangedForRoundTrip:V3.EventPrototype("sender, controlId"),OnDepartureDateChangedForMultiCity:V3.EventPrototype("sender, controlId"),ChannelShortName:null,RequestDateFormat:"yyyy-MM-dd",_itemClicked:false,_lnkFlightFrom:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"flight-place-link",OnClick:function(q,r){if(this._tripType==j.Outbound){this._populateDropDownOptionFromTopLocation(this._pnlResultFromSelector,this._txtFlightFromCode,this._lnkFlightFrom)}this.OnDropDownDisplayed.fire(this);this._pnlDropDownFlightFromSelector.cssClassAdd("show");this._pnlDropDownFlightToSelector.cssClassRem("show");this._txtInputFrom.focus()}}),_lnkFlightTo:V3.UI.HyperLink("javascript:void(0)").Defaults({cssClass:"flight-place-link",OnClick:function(q,r){if(this._tripType==j.Inbound){this._populateDropDownOptionFromTopLocation(this._pnlResultToSelector,this._txtFlightToCode,this._lnkFlightTo)}this.OnDropDownDisplayed.fire(this);this._pnlDropDownFlightToSelector.cssClassAdd("show");this._pnlDropDownFlightFromSelector.cssClassRem("show");this._txtInputTo.focus()}}),_txtInputFrom:V3.UI.TextBox().Defaults({OnChange:function(r,s){if(r.text().length>2){var q=this._tripType==j.Outbound?"Inside":"All";this.PerformSearchLocation(r.text(),q,this._pnlResultFromSelector,this._txtFlightFromCode,this._lnkFlightFrom)}else{this._pnlResultFromSelector.Controls.clear()}},maxLength:45}),_txtInputTo:V3.UI.TextBox().Defaults({OnChange:function(r,s){if(r.text().length>2){var q=this._tripType==j.Inbound?"Inside":"All";this.PerformSearchLocation(r.text(),q,this._pnlResultToSelector,this._txtFlightToCode,this._lnkFlightTo)}else{this._pnlResultToSelector.Controls.clear()}},maxLength:45}),_txtFlightFromCode:V3.UI.TextBox().Defaults({cssClass:"d-none",visible:false}),_txtFlightToCode:V3.UI.TextBox().Defaults({cssClass:"d-none",visible:false,OnChange:function(q,r){this.OnDestinationChanged.fire(this,{controlId:this.controlId,tripType:this._tripType,code:this._txtFlightToCode.text(),text:this._lnkFlightTo.text()})}}),_txtDepartureDateReal:V3.UI.TextBox().Defaults({cssClass:"d-none",visible:false}),_txtDepartureDate:V3.UI.DateInput().Defaults({cssClass:"flight-date-input",isRequired:true,formatString:this.DateFormat,OnClick:function(q,r){this._pnlDropDownFlightToSelector.cssClassRem("show");this._pnlDropDownFlightFromSelector.cssClassRem("show")},OnDateSelected:function(q,r){this._onDepartureDateSelected()}}),_txtReturnDateReal:V3.UI.TextBox().Defaults({cssClass:"d-none",visible:false}),_txtReturnDate:V3.UI.DateInput().Defaults({cssClass:"flight-date-input",isRequired:true,formatString:this.DateFormat,OnClick:function(q,r){this._pnlDropDownFlightToSelector.cssClassRem("show");this._pnlDropDownFlightFromSelector.cssClassRem("show")},OnDateSelected:function(q,r){this._onReturnDateSelected()}}),_lblDepartureDate:V3.UI.Label().Defaults({cssClass:"place-input-date"}),_lblReturnDate:V3.UI.Label().Defaults({cssClass:"place-input-date"}),_lblTripTitle:V3.UI.Label().Defaults({cssClass:"w-100 place-input-title trip-title",text:"Trip"}),_btnRemove:V3.UI.Button().Defaults({cssClass:"button btn-remove-trip",OnClick:function(q,r){this._onControlRemoved()}}),_btnRemoveForSmallScreen:V3.UI.Button("Delete").Defaults({cssClass:"button btn-remove-trip small-screen d-block text-right",OnClick:function(q,r){this._onControlRemoved()}}),_pnlInputContainer:V3.UI.Panel().Defaults({cssClass:"flex-fill"}),_pnlBtnContainer:V3.UI.Panel().Defaults({cssClass:"btn-container flex-fill text-right"}),_pnlOrigin:V3.UI.Panel().Defaults({cssClass:"origin row"}),_pnlDestination:V3.UI.Panel().Defaults({cssClass:"destination row"}),_pnlDeparture:V3.UI.Panel().Defaults({cssClass:"departure row"}),_pnlReturn:V3.UI.Panel().Defaults({cssClass:"return row"}),_pnlDropDownFlightFromSelector:V3.UI.Panel().Defaults({cssClass:"dropdown-menu shadow place"}),_pnlDropDownFlightToSelector:V3.UI.Panel().Defaults({cssClass:"dropdown-menu shadow place"}),_pnlDropDownInputFromSelector:V3.UI.Panel().Defaults({cssClass:"dropdown"}),_pnlDropDownInputToSelector:V3.UI.Panel().Defaults({cssClass:"dropdown"}),_pnlResultFromSelector:V3.UI.Panel().Defaults({cssClass:"location-result d-flex flex-column pb-3"}),_pnlResultToSelector:V3.UI.Panel().Defaults({cssClass:"location-result d-flex flex-column pb-3"}),_minDate:new V3Date(new V3Date().toStringFormat(this.DateFormat)),_maxDate:new V3Date(new V3Date().toStringFormat(this.DateFormat)).addDays(365),_selectedDate:new V3Date(new V3Date().toStringFormat(this.DateFormat)),_init:function(){this.searchRequest={tripType:null,seatClass:null,passenger:{adults:0,children:0,infants:0},route:{from:null,to:null,departure:null,returnDate:null}};this._pnlBtnContainer.visible(false);this._btnRemoveForSmallScreen.visible(false);this._populateDropDownOptionForPlaceFilter((V3.Res["FlightSearch.Label.From"]||"From"),"plane-departure.svg",this._pnlDropDownFlightFromSelector,this._pnlDropDownInputFromSelector,this._pnlResultFromSelector);this._populateDropDownOptionForPlaceFilter((V3.Res["FlightSearch.Label.To"]||"To"),"pin.svg",this._pnlDropDownFlightToSelector,this._pnlDropDownInputToSelector,this._pnlResultToSelector);this._pnlDropDownInputFromSelector.Insert(this._txtInputFrom);this._pnlDropDownInputToSelector.Insert(this._txtInputTo);this._setupDateElements();if(this._defaultData){var r={};var t={};if(providerSearchControlSettings.InTerritoryLocation.includes(this._defaultData.FromCode)){r={code:this._defaultData.FromCode,name:this._defaultData.FromLocation};t={code:this._defaultData.ToCode,name:this._defaultData.ToLocation}}else{r={code:this._defaultData.ToCode,name:this._defaultData.ToLocation};t={code:this._defaultData.FromCode,name:this._defaultData.FromLocation}}if(this._tripType==j.Inbound){this._lnkFlightFrom.text(t.name);this._lnkFlightTo.text(r.name);this._txtFlightFromCode.text(t.code);this._txtFlightToCode.text(r.code)}else{if(this._tripType==j.Outbound){this._lnkFlightFrom.text(r.name);this._lnkFlightTo.text(t.name);this._txtFlightFromCode.text(r.code);this._txtFlightToCode.text(t.code)}else{this._lnkFlightFrom.text(this._defaultData.FromLocation);this._lnkFlightTo.text(this._defaultData.ToLocation);this._txtFlightFromCode.text(this._defaultData.FromCode);this._txtFlightToCode.text(this._defaultData.ToCode)}}var s=new V3Date(new V3Date(this._defaultData.DepartureDate).toStringFormat(this.RequestDateFormat));var q=this._defaultData.ReturnDate?new V3Date(new V3Date(this._defaultData.ReturnDate).toStringFormat(this.RequestDateFormat)):s;this._setTextForDateElements(s,q)}},_setupDateElements:function(){this._txtDepartureDate.minDate(this._minDate);this._txtDepartureDate.maxDate(this._maxDate);this._txtDepartureDate.date(this._selectedDate);if(this._tripType==j.RoundTrip){this._txtReturnDate.minDate(this._selectedDate)}else{this._txtReturnDate.minDate(this._minDate)}this._txtReturnDate.maxDate(this._maxDate);this._txtReturnDate.date(this._selectedDate);this._setTextForDateElements(this._selectedDate,this._selectedDate.addDays(3))},_setTextForDateElements:function(r,q){this._txtDepartureDate.date(r);this._txtDepartureDateReal.text(r.toStringFormat(this.RequestDateFormat));this._txtReturnDate.date(q);this._txtReturnDateReal.text(q.toStringFormat(this.RequestDateFormat));this._lblDepartureDate.text(r.toStringFormat(this.DateFormat));this._lblReturnDate.text(q.toStringFormat(this.DateFormat))},_populateDropDownOptionForPlaceFilter:function(u,r,t,s,q){t.Insert(new V3.UI.Panel().Set({cssClass:"place-finder-input d-flex flex-row justify-content-start align-items-center gap-12"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Image("../Resources/Images/Icons/"+r)),new V3.UI.Panel().Set({cssClass:"w-100"}).Insert(new V3.UI.Panel().Set({cssClass:""}).Insert(new V3.UI.Label().Set({cssClass:"place-input-title",text:u})),s)),q)},_populateDropDownOptionFromTopLocation:function(r,q,s){if(providerSearchControlSettings.TopTerritoryLocation==null||providerSearchControlSettings.TopTerritoryLocation==""){return}var t=JSON.parse(providerSearchControlSettings.TopTerritoryLocation);if(t.length>0){this._populateLocationSearchResult(t,r,q,s);r.Insert(new V3.UI.Panel().Set({cssClass:"info-message"}).Insert(new V3.UI.Label().Set({cssClass:"",text:V3.Res["FlightSearch.Text.LocationInfoMessage"]||"Use search box for other airport options"})))}},_showReturnDate:function(q){this._pnlReturn.visible(q)},_showDropDown:function(q){switch(q){case"flightFromSelector":if(!this._pnlDropDownFlightFromSelector.visible()){this._pnlDropDownFlightFromSelector.cssClassAdd("show");this._pnlDropDownFlightFromSelector.visible(true)}else{this._pnlDropDownFlightFromSelector.cssClassRem("show");this._pnlDropDownFlightFromSelector.visible(false)}this._pnlDropDownFlightToSelector.cssClassRem("show");this._pnlDropDownFlightToSelector.visible(false);break;case"flightToSelector":if(!this._pnlDropDownFlightToSelector.visible()){this._pnlDropDownFlightToSelector.cssClassAdd("show");this._pnlDropDownFlightToSelector.visible(true)}else{this._pnlDropDownFlightToSelector.cssClassRem("show");this._pnlDropDownFlightToSelector.visible(false)}this._pnlDropDownFlightFromSelector.cssClassRem("show");this._pnlDropDownFlightFromSelector.visible(false);break}},_onDepartureDateSelected:function(){this._txtDepartureDateReal.text(new V3Date(this._txtDepartureDate.text()).toStringFormat(this.RequestDateFormat));this._lblDepartureDate.text(new V3Date(this._txtDepartureDate.text()).toStringFormat(this.DateFormat));if(this._tripType==j.RoundTrip){this.OnDateChangedForRoundTrip.fire(this,this.controlId)}else{if(this._tripType==j.MultiCity){this.OnDepartureDateChangedForMultiCity.fire(this,this.controlId)}}},_onReturnDateSelected:function(){this._txtReturnDateReal.text(new V3Date(this._txtReturnDate.text()).toStringFormat(this.RequestDateFormat));this._lblReturnDate.text(new V3Date(this._txtReturnDate.text()).toStringFormat(this.DateFormat));if(this._tripType==j.RoundTrip){this.OnDateChangedForRoundTrip.fire(this,this.controlId)}},_onControlRemoved:function(){this.OnControlRemoved.fire(this,this.controlId)},_populateLocationSearchResult:function(v,u,q,t){u.Controls.clear();if(v.length>0){for(var s in v){const r=v[s];u.Insert(new V3.UI.Panel().Set({cssClass:"location-item d-flex align-items-center px-4 py-2 gap-12",OnClick:function(w,x){u.Parent.cssClassRem("show");t.text(r.Code+" "+r.Name);q.text(r.IataCode)}}).Insert(new V3.UI.Panel().Set({cssClass:"d-flex justify-content-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/airplane.svg")),new V3.UI.Panel().Set({cssClass:"flex-fill d-flex flex-column"}).Insert(new V3.UI.Panel().Set({cssClass:"flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"",text:r.Code})),new V3.UI.Panel().Set({cssClass:"flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"",text:r.Name}))),new V3.UI.Panel().Set({cssClass:"flex-fill text-right"}).Insert(new V3.UI.Button("+").Set({cssClass:"button btn-select-airport ",OnClick:function(w,x){u.Parent.cssClassRem("show");t.text(r.Code+" "+r.Name);q.text(r.IataCode)}}))))}}else{u.Insert(new V3.UI.Panel().Set({cssClass:"location-item d-flex align-items-center px-4 py-2 gap-12"}).Insert(new V3.UI.Panel().Set({cssClass:"flex-fill text-center"}).Insert(new V3.UI.Label().Set({cssClass:"",text:(V3.Res["FlightSearch.Error.NoLocationResult"]||"We couldn’t find what you were looking for.")}))))}},Configure:function(q){if(q.minDate){this._minDate=q.minDate}if(q.maxDate){this._maxDate=q.maxDate}if(q.selectedDate){this._selectedDate=q.selectedDate}if(q.minDate||q.maxDate||q.selectedDate){this._setupDateElements()}},ConfigureRoundTrip:function(r){if(r.minReturnDate){this._txtReturnDate.minDate(new V3Date(r.minReturnDate))}if(r.returnDate){var q=new V3Date(r.returnDate);this._txtReturnDate.minDate(new V3Date(r.selectedDate));this._txtReturnDate.date(q);this._setTextForDateElements(new V3Date(r.selectedDate),q)}},HideDropDown:function(){this._pnlDropDownFlightFromSelector.cssClassRem("show");this._pnlDropDownFlightToSelector.cssClassRem("show")},ShowRemoveButton:function(q){if(q){this.cssClassAdd("has-button");this._pnlBtnContainer.visible(true);this._btnRemoveForSmallScreen.visible(true)}else{this.cssClassRem("has-button");this._pnlBtnContainer.visible(false);this._btnRemoveForSmallScreen.visible(false)}},SetInputTitle:function(q){this._lblTripTitle.text(q)},GetFlightFromLocation:function(){return this._lnkFlightFrom.text()},SetFlightFromLocation:function(q){this._lnkFlightFrom.text(q)},GetFlightToLocation:function(){return this._lnkFlightTo.text()},GetFlightFromCode:function(){return this._txtFlightFromCode.text()},SetFlightFromCode:function(q){this._txtFlightFromCode.text(q)},GetFlightToCode:function(){return this._txtFlightToCode.text()},GetDepartureDate:function(){return new V3Date(this._txtDepartureDateReal.text()).toStringFormat(this.RequestDateFormat)},SetDepartureDate:function(q,r){if(typeof q==="undefined"){return}if(q==""||q==null){return}var t=new V3Date(new V3Date(q).toStringFormat(this.RequestDateFormat));var s=t;if(r!=null&&r!=""){s=new V3Date(new V3Date(r).toStringFormat(this.RequestDateFormat))}this._setTextForDateElements(t,s)},GetReturnDate:function(){return new V3Date(this._txtReturnDateReal.text()).toStringFormat(this.RequestDateFormat)},PerformSearchLocation:function(v,q,t,s,x){var u={ChannelShortName:this.ChannelShortName,Language:V3.CultureInfo.currentUICulture().twoLetterISOLanguageName(),Keyword:v,TerritoryType:q};var w=this;t.Controls.clear();V3.WebServices.FlightService.FindLocation(function y(z){w._populateLocationSearchResult(z,t,s,x)}.bind(this),function r(z){V3.Log.Error("Error while trying to make AJAX call","error",z);t.DOMElement.innerHTML=z;this.lblError.text(V3.Res["ProviderSearch.Error.Unexpected"]||"Unexpected error")}.bind(this),u)}});var e=function e(s,r,q){this.base("close-dropdown result-item d-flex flex-lg-row flex-column align-items-center justify-content-center w-100 gap-15");this.flightData=s;this.MultiCity=r;this.Preferences=q;this.Insert(this._pnlFlight.Insert(this._pnlFlightRoutes),this._pnlPricing.Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown price text-center"}).Insert(this._lblFlightRate),new V3.UI.Panel().Set({cssClass:"select-button"}).Insert(this._btnSelect)));this.controlId=V3.newId();this._btnSelect.text(V3.Res["FlightSearch.Label.Select"]||"Select");this._init(s)}.InheritsFrom(V3.UI.Panel,{_lblFlightRate:V3.UI.Label().Defaults({cssClass:""}),_btnSelect:V3.UI.Button().Defaults({cssClass:"button btn-primary btn-select",OnClick:function(q,r){this._showFlightModal(this.flightData)}}),_pnlFlight:V3.UI.Panel().Defaults({cssClass:"close-dropdown flight-wrapper w-100"}),_pnlFlightRoutes:V3.UI.Panel().Defaults({cssClass:"close-dropdown flight-routes flex-fill d-flex flex-column w-100 gap-12"}),_pnlStopers:V3.UI.Panel().Defaults({cssClass:"stopers d-flex align-items-center position-absolute gap-2"}),_pnlPricing:V3.UI.Panel().Defaults({cssClass:"close-dropdown flight-pricing d-flex flex-column justify-content-center gap-12"}),_init:function(q){this._lblFlightRate.text(this._formatCurrency(q.CostBreakdown.Total));this._populateFlightRoutes(q.Routes)},_formatCurrency:function(t){var s=V3.CultureInfo.currentUICulture().currencyISOAbbreviation();var r=0;var q=new V3.NumberFormatInfo({DecimalDigits:r,Symbol:s},V3.CultureInfo.currentUICulture().currencyNumberFormat());return t.toStringFormat("C",q)},_populateFlightRoutes:function(r){var w=false;var t=false;var H=this.MultiCity;for(var x=0;x<r.length;x++){const L=r[x];var u=(H?(V3.Res["FlightSearch.Terms.Flight"]||"Flight")+" "+(x+1)+" - ":"")+new V3Date(L.Depart.LocalDateTime).toStringFormat("D",V3.CultureInfo.currentUICulture());var I=this._convertTo24HourFormat(L.Depart.LocalDateTime);var s=this._convertTo24HourFormat(L.Arrive.LocalDateTime);var M=L.Depart.Code.replace("IATA:","");var G=L.Arrive.Code.replace("IATA:","");var J=L.Duration.split(".");var C=this._formatFlightDuration(L.Duration);var F=this._getDaysDiff(L.Depart.LocalDateTime,L.Arrive.LocalDateTime);var N=document.createElement("sup");N.innerHTML=F<0?"-1":(parseInt(F)>0?"+1":"");var A=new V3.UI.Panel().Set({cssClass:"stopers d-flex align-items-center position-absolute gap-2"});var B=[];var D=[];if(L.Legs.length>0){for(var E=0;E<L.Legs.length;E++){const K=L.Legs[E];if(K.Arrive.Code!=L.Arrive.Code){B.push(K)}var v=D.filter(function(O){return O.Name==K.OperatedBy.Name});if(v.length<1){D.push(K.OperatedBy)}}var q=B.length>0?B.length+(B.length>1?" "+(V3.Res["FlightSearch.Terms.Stops"]||"Stops"):" "+(V3.Res["FlightSearch.Terms.Stop"]||"Stop")):(V3.Res["FlightSearch.Terms.Direct"]||"Direct");A.Insert(new V3.UI.Label().Set({cssClass:"stop-flag direct",text:q}));for(var E=0;E<D.length;E++){const y=D[E];var z=document.createElement("img");z.className="stop-airline-logo";z.src=y.LogoURL;z.title=y.Name;A.Insert(z)}}if(r.length>1&&x<(r.length-1)){t=true}else{t=false}if(r.length>1){w=true}this._pnlFlightRoutes.Insert(w?new V3.UI.Panel().Set({cssClass:" close-dropdown flight-trip-wrapper d-flex justify-content-start"}).Insert(new V3.UI.Panel().Set({cssClass:"flight-trip-date w-100"}).Insert(new V3.UI.Label().Set({cssClass:"",text:u}))):"",new V3.UI.Panel().Set({cssClass:"close-dropdown flight-route flight-summary flex-fill d-flex flex-column justify-content-center w-100 gap-15"}).Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown flight-timing flex-fill d-flex justify-content-between w-100"}).Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown flight-origin d-flex flex-column text-center gap-8"}).Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown flight-time"}).Insert(new V3.UI.Label().Set({cssClass:"",text:I})),new V3.UI.Panel().Set({cssClass:"close-dropdown airport-code"}).Insert(new V3.UI.Label().Set({cssClass:"",text:M}))),new V3.UI.Panel().Set({cssClass:"close-dropdown flight-destination d-flex flex-column text-center gap-8"}).Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown flight-time"}).Insert(new V3.UI.Label().Set({cssClass:"",text:s}),N),new V3.UI.Panel().Set({cssClass:"close-dropdown airport-code"}).Insert(new V3.UI.Label().Set({cssClass:"",text:G})))),new V3.UI.Panel().Set({cssClass:"close-dropdown flight-route-wrapper d-flex flex-column gap-8"}).Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown flight-route d-flex justify-content-between align-items-center"}).Insert(new V3.UI.Panel().Set({cssClass:"close-dropdown origin-route d-flex justify-content-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/airplane.svg")),new V3.UI.Panel().Set({cssClass:"close-dropdown route-line-wrapper flex-fill d-flex justify-content-center align-items-center position-relative"}).Insert(new V3.UI.Panel().Set({cssClass:"route-line w-100"}),A),new V3.UI.Panel().Set({cssClass:"close-dropdown destination-route d-flex justify-content-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/pin.svg"))),new V3.UI.Panel().Set({cssClass:"close-dropdown flight-duration d-flex justify-content-center"}).Insert(new V3.UI.Label().Set({cssClass:"",text:C})))),t?new V3.UI.Panel().Set({cssClass:" close-dropdown flight-gap d-flex justify-content-center"}).Insert(new V3.UI.Panel().Set({cssClass:"flight-trip-splitter w-100"})):"")}},_populateFlightStopers:function(q){this._lblStopFlag.text(q.stopFlag);for(var r in q.airLines){this._pnlStopers.Insert(new V3.CABS.UI.CustomImage(q.airLines[r]).Set({cssClass:"stop-airline-logo",title:"testing"}))}},_populatePassengersInfo:function(){var q=this.Preferences.filter(function(v){return v.Code=="ADULT"});var u=this.Preferences.filter(function(v){return v.Code=="CHILD"});var t=this.Preferences.filter(function(v){return v.Code=="INFANT"});var r={adults:q.length>0?parseInt(q[0].Value):0,children:u.length>0?parseInt(u[0].Value):0,infants:t.length>0?parseInt(t[0].Value):0};var s=[];if(r.adults>0){s.push((V3.Res["FlightSearch.Terms.Adults"]||"Adults")+": "+r.adults)}if(r.children>0){s.push((V3.Res["FlightSearch.Terms.Children"]||"Children")+": "+r.children)}if(r.infants>0){s.push((V3.Res["FlightSearch.Terms.Infants"]||"Infants")+": "+r.infants)}return s.join(" | ")},_showFlightModal:function(P){var I=P.Routes;var F=new V3.UI.Panel().Set({cssClass:"modal-body"});var L=this.MultiCity;var w=false;for(var y in I){const O=I[y];var u=(L?(V3.Res["FlightSearch.Terms.Flight"]||"Flight")+" "+(parseInt(y)+1)+" - ":"")+new V3Date(O.Depart.LocalDateTime).toStringFormat("D",V3.CultureInfo.currentUICulture());var v=this._populatePassengersInfo();var C=new V3.UI.Panel().Set({cssClass:"router-leg-stop d-flex flex-column align-items-center gap-2"});var G=this._formatFlightDuration(O.Duration);if(I.length>1){w=true}if(O.Legs.length>0){F.Insert(w?new V3.UI.Panel().Set({cssClass:" close-dropdown flight-trip-wrapper d-flex justify-content-start"}).Insert(new V3.UI.Panel().Set({cssClass:"flight-trip-date w-100"}).Insert(new V3.UI.Label().Set({cssClass:"",text:u}))):"",new V3.UI.Panel().Set({cssClass:" d-flex flex-row justify-content-between align-items-center w-100"}).Insert(new V3.UI.Panel().Set({cssClass:"flex-fill d-flex flex-column w-100"}).Insert(new V3.UI.Label().Set({cssClass:"font-weight-bold",text:V3.CABS.Utils.ProcessPlaceholders((V3.Res["FlightSearch.Label.TripName"]||"{departureName} to {arrivalName}"),{"{departureName}":O.Depart.Name,"{arrivalName}":O.Arrive.Name})}),new V3.UI.Label().Set({cssClass:"",text:v})),new V3.UI.Panel().Set({cssClass:"d-flex flex-column text-right"}).Insert(new V3.UI.Panel().Set({cssClass:"flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"",text:(V3.Res["FlightSearch.Label.Duration"]||"Duration")})),new V3.UI.Panel().Set({cssClass:"flight-duration-wrapper d-flex flex-row justify-content-end  align-items-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/clock.svg").Set({cssClass:"stop-clock-logo"}),new V3.UI.Label().Set({cssClass:"font-weight-bold",text:G})))),C);for(var K=0;K<O.Legs.length;K++){const t=O.Legs[K];var M=this._convertTo24HourFormat(t.Depart.LocalDateTime);var B=new V3Date(t.Depart.LocalDateTime).toStringFormat("D",V3.CultureInfo.currentUICulture());var r=this._convertTo24HourFormat(t.Arrive.LocalDateTime);var H=new V3Date(t.Arrive.LocalDateTime).toStringFormat("D",V3.CultureInfo.currentUICulture());var N=this._formatFlightDuration(t.StopOver);var D=this._formatFlightDuration(t.Duration);const z=new V3.UI.Panel().Set({cssClass:"leg-info flex-column flex-fill d-none"});if(t.Warnings.length>0){for(var A=0;A<t.Warnings.length;A++){z.Insert(new V3.UI.Label().Set({cssClass:"",text:"* "+t.Warnings[A].Description}))}z.cssClassRem("d-none");z.cssClassAdd(" d-flex ")}C.Insert(t.StopOver==null?"":new V3.UI.Panel().Set({cssClass:"stop-over d-flex flex-column justify-content-center align-items-center flex-fill w-100"}).Insert(new V3.UI.Panel().Set({cssClass:"stop-over-wrapper d-flex flex-row justify-content-center align-items-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/red-clock.svg").Set({cssClass:"stop-clock-logo"}),new V3.UI.Label().Set({cssClass:"font-weight-bold stop-over-text",text:V3.CABS.Utils.ProcessPlaceholders((V3.Res["FlightSearch.Label.LayOverDuration"]||"{layOverDuration} Layover"),{"{layOverDuration}":N})}))),new V3.UI.Panel().Set({cssClass:"leg d-flex flex-column w-100"}).Insert(new V3.UI.Panel().Set({cssClass:"leg-info-wrapper d-flex flex-column flex-fill"}).Insert(z),new V3.UI.Panel().Set({cssClass:"leg-summary d-flex flex-row flex-fill gap-10"}).Insert(new V3.UI.Panel().Set({cssClass:"leg-timing d-flex flex-column flex-fill text-right"}).Insert(new V3.UI.Panel().Set({cssClass:"d-flex flex-column justify-content-start flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"font-weight-bold",text:M}),new V3.UI.Label().Set({cssClass:"",text:B})),new V3.UI.Panel().Set({cssClass:"d-flex flex-column justify-content-center flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"",text:D})),new V3.UI.Panel().Set({cssClass:"d-flex flex-column justify-content-end flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"font-weight-bold",text:r}),new V3.UI.Label().Set({cssClass:"",text:H}))),new V3.UI.Panel().Set({cssClass:"d-flex flex-column flex-fill"}).Insert(new V3.UI.Panel().Set({cssClass:"ellipse el-start d-flex flex-column justify-content-center align-items-center h-100 pt-3"}).Insert(new V3.UI.Image("../Resources/Images/Icons/ellipse-2.svg").Set({cssClass:"stop-ellipse-logo"})),new V3.UI.Panel().Set({cssClass:"d-flex justify-content-center align-items-center h-100"}).Insert(new V3.UI.Image("../Resources/Images/Icons/airplane.svg").Set({cssClass:"stop-airplane-logo"})),new V3.UI.Panel().Set({cssClass:"ellipse el-end d-flex flex-column justify-content-center align-items-center h-100 pb-3"}).Insert(new V3.UI.Image("../Resources/Images/Icons/ellipse-2.svg").Set({cssClass:"stop-ellipse-logo"}))),new V3.UI.Panel().Set({cssClass:"leg-airport d-flex flex-column flex-fill w-100"}).Insert(new V3.UI.Panel().Set({cssClass:"d-flex flex-column flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"font-weight-bold",text:t.Depart.Code.replace("IATA:","")}),new V3.UI.Label().Set({cssClass:"",text:t.Depart.Name})),new V3.UI.Panel().Set({cssClass:"d-flex flex-column flex-fill gap-5"}).Insert(new V3.UI.Panel().Set({cssClass:"airline-info d-flex flex-row align-items-center w-100 gap-5"}).Insert(new V3.UI.Image(t.OperatedBy.LogoURL).Set({cssClass:"stop-airline-logo"}),new V3.UI.Label().Set({cssClass:"",text:t.OperatedBy.Name})),new V3.UI.Label().Set({cssClass:"font-weight-bold",text:V3.CABS.Utils.ProcessPlaceholders((V3.Res["FlightSearch.Label.FlightNumber"]||"Flight: {airlineCode}{flightNumber}"),{"{airlineCode}":t.OperatedBy.Code,"{flightNumber}":t.OperatedBy.FlightNumber})})),new V3.UI.Panel().Set({cssClass:"d-flex flex-column flex-fill"}).Insert(new V3.UI.Label().Set({cssClass:"font-weight-bold",text:t.Arrive.Code.replace("IATA:","")}),new V3.UI.Label().Set({cssClass:"",text:t.Arrive.Name}))))))}}}var q=document.getElementById("viewmoreModal");var E=document.getElementById("secondModal");if(!q){var J=new V3.UI.Panel().Set({cssClass:"modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable",Attributes:[{name:"role",value:"document"}]}).Insert(new V3.UI.Panel().Set({cssClass:"modal-content"}).Insert(new V3.UI.Panel().Set({cssClass:"modal-header"}).Insert(new V3.UI.Panel().Set({cssClass:"modal-title"}).Insert(new V3.UI.Label().Set({cssClass:"",text:(V3.Res["FlightSearch.Label.TripSummary"]||"Trip Summary")})),new V3.UI.Button().Set({cssClass:"close",Attributes:[{name:"data-dismiss",value:"modal"},{name:"aria-label",value:"Close"}]}).Insert(new V3.UI.Label().Set({text:"×"}))),new V3.UI.Panel().Set({cssClass:"modal-body"}),new V3.UI.Panel().Set({cssClass:"modal-footer d-flex justify-content-between"}).Insert(new V3.UI.Panel().Set({cssClass:"price-container d-flex"}).Insert(new V3.UI.Label().Set({text:this._formatCurrency(P.CostBreakdown.Total)})),new V3.UI.Panel().Set({cssClass:"button-container d-flex"}).Insert(new V3.UI.HyperLink("javascript:void(0)").Set({cssClass:"modal-btn btn btn-cancel-booking",Attributes:[{name:"data-dismiss",value:"modal"}],text:(V3.Res["FlightSearch.Label.CloseModal"]||"Close")}),new V3.UI.HyperLink("#secondModal").Set({cssClass:"modal-btn btn btn-booking",Attributes:[{name:"data-toggle",value:"modal"}]}).Insert(new V3.UI.Label().Set({text:V3.Res["FlightSearch.Label.Continue"]||"Continue"}))))));q=document.createElement("div");q.classList.add("flight-summary-modal","modal");q.setAttribute("id","viewmoreModal");q.setAttribute("tabindex","-1");q.innerHTML=J.DOMElement.outerHTML;document.body.appendChild(q)}if(!E){var s=new V3.UI.Panel().Set({cssClass:"modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable",Attributes:[{name:"role",value:"document"}]}).Insert(new V3.UI.Panel().Set({cssClass:"modal-content"}).Insert(new V3.UI.Panel().Set({cssClass:"modal-header"}).Insert(new V3.UI.Panel().Set({cssClass:"modal-title"}).Insert(new V3.UI.Label().Set({cssClass:"",text:(V3.Res["FlightSearch.Label.BookingConfirmation"]||"Booking Confirmation")})),new V3.UI.Button().Set({cssClass:"close",Attributes:[{name:"data-dismiss",value:"modal"},{name:"aria-label",value:"Close"}]}).Insert(new V3.UI.Label().Set({text:"×"}))),new V3.UI.Panel().Set({cssClass:"modal-body"}).Insert(new V3.UI.Panel().Set({cssClass:"booking-confirmation"}).Insert(new V3.UI.Label().Set({cssClass:"confirmation-text",text:V3.Res["FlightSearch.Text.ProceedConfirmation"]||"You will be transacting directly with the industry to complete your flight booking. After booking your flight you will need to come back to this page to book other items. Do you wish to proceed?"}))),new V3.UI.Panel().Set({cssClass:"modal-footer"}).Insert(new V3.UI.Panel().Set({cssClass:"button-container d-flex"}).Insert(new V3.UI.HyperLink("javascript:void(0)").Set({cssClass:"modal-btn btn btn-cancel-booking",Attributes:[{name:"data-dismiss",value:"modal"}],text:V3.Res["FlightSearch.Label.CloseModal"]||"Cancel"}),new V3.UI.HyperLink(P.InitiateBooking.RedirectUrl).Set({cssClass:"modal-btn btn btn-booking",target:"_blank",text:V3.Res["FlightSearch.Label.Proceed"]||"Yes Proceed"})))));E=document.createElement("div");E.classList.add("flight-summary-modal","modal");E.setAttribute("id","secondModal");E.setAttribute("tabindex","-1");E.innerHTML=s.DOMElement.outerHTML;document.body.appendChild(E)}q.querySelector(".modal-body").innerHTML=F.DOMElement.innerHTML;q.classList.add("show");$(q).modal("show");$(E).on("show.bs.modal",function(x){$(q).modal("dispose");$(q).remove()});$(q).on("hide.bs.modal",function(x){$(q).modal("dispose");$(q).remove();$(E).modal("dispose");$(E).remove();$(".modal-backdrop.show").remove()});$(E).on("hide.bs.modal",function(x){$(E).modal("dispose");$(E).remove();$(".modal-backdrop.show").remove()})},_getDaysDiff:function(r,u){var v=new Date(r);var q=u?new Date(u):v;var t=q.getTime()-v.getTime();var s=Math.round(t/(24*60*60*1000));return s},_convertTo24HourFormat:function(r){var q=new Date(r);var s=q.toLocaleTimeString(V3.CultureInfo.currentUICulture().name(),{hour12:false});var t=s.split(":");return t.length>1?(t[0].concat(":",t[1])):s},_formatFlightDuration:function(s){if(s==null){return""}var r=s.split(".");var t=r.length>1?r[0]+"d ":"";var u=r.length>1?r[1]:s;var q=u.split(":");if(q.length>1){u=t+q[0].replace(/^0/,"")+"h "+q[1].replace(/^0/,"")+"m"}return u}});var h=function h(q){this.base("flexible-date-slider align-items-center w-100 px-0 mb-2 position-relative");this.Insert(new V3.UI.Panel().Set({cssClass:"slider-wrapper align-items-center w-100 px-3 mb-3 position-relative"}).Insert(this._pnlLeftNavigation.Insert(new V3.UI.Panel().Set({cssClass:"dds-icon-container d-flex align-items-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-left.svg"))),this._pnlSliderContent,this._pnlRightNavigation.Set({cssClass:"slider-nav next d-flex align-items-center justify-content-center position-absolute"}).Insert(new V3.UI.Panel().Set({cssClass:"dds-icon-container d-flex align-items-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/chevron-left.svg")))))}.InheritsFrom(V3.UI.Panel,{OnPopulateNextItems:V3.EventPrototype("sender, nextDate, nextReturnDate, slideToShow"),OnPopulatePreviousItems:V3.EventPrototype("sender, prevDate, prevReturnDate"),_pnlLeftNavigation:V3.UI.Panel().Defaults({cssClass:"slider-nav prev d-flex align-items-center justify-content-center position-absolute"}),_pnlRightNavigation:V3.UI.Panel().Defaults({cssClass:"slider-nav next d-flex align-items-center justify-content-center position-absolute"}),_pnlSliderContent:V3.UI.Panel().Defaults({cssClass:"slider-content d-flex justify-content-center align-items-start gap-15"}),_sliderItemControls:V3.Object(),_sliderData:[],_selectedData:null,_dateFormatForRequest:"yyyy-MM-dd",_addSliderItem:function(r,s){const q=this._createItemPanel(s);this._sliderItemControls[q.controlId]=q;r.Insert(q)},_createItemPanel:function(v){var r=V3.Res["EntityDisplay.Price.From"]||"From:";var t=new V3.UI.Panel().Set({cssClass:"routes-container text-left"});var q=true;for(var s in v.routes){route=v.routes[s];if(v.routes.length==1){t.Insert(new V3.UI.Panel().Set({cssClass:"title"}).Insert(new V3.UI.Label().Set({cssClass:"",text:route.shortDate.toUpperCase()})),new V3.UI.Panel().Set({cssClass:"small-title"}).Insert(new V3.UI.Label().Set({cssClass:"",text:route.shortDay.toUpperCase()})))}else{t.Insert(new V3.UI.Panel().Set({cssClass:"title d-flex justify-content-center"}).Insert(new V3.UI.Image("../Resources/Images/Icons/airplane.svg").Set({cssClass:"plane-icon "+(q?"odd":"even")}),new V3.UI.Label().Set({cssClass:"",text:route.shortDate.toUpperCase()})))}q=!q}var w=V3.Res["EntityDisplay.Messages.Unavailable"]||"Unavailable";var u=new V3.UI.Panel().Set({Attributes:[{name:"onclick",value:'Page.Controller.SearchBox.quickSearchFlightControl.UpdateDepartureDate("'+v.routes[0].fullDate+'", "'+(v.routes.length>1?v.routes[1].fullDate:"")+'")'}],cssClass:"flexible-card slider d-flex flex-column justify-content-center align-items-start gap-2"}).Insert(t,new V3.UI.Panel().Set({cssClass:"splitter my-1"}),new V3.UI.Panel().Set({cssClass:"small-sub-title"}).Insert(new V3.UI.Label().Set({cssClass:"force-display",text:r,visible:(v.price!=null?true:false)})),new V3.UI.Panel().Set({cssClass:"sub-title"+(v.price!=null?"":" unavailable")}).Insert(new V3.UI.Label().Set({cssClass:"",text:(v.price!=null?v.price:w)})));u.controlId=V3.newId();if(v.selected){u.cssClassAdd("selected");this._selectedData=v.startDate}return u},_populatePreviousItems:function(s){var r=this._sliderData[0];if(r){var t=new V3Date(new V3Date(r.startDate)).toStringFormat(this._dateFormatForRequest);var q=null;if(r.routes.length>1){q=new V3Date(new V3Date(r.routes[1].fullDate).addDays(1)).toStringFormat(this._dateFormatForRequest)}this.OnPopulatePreviousItems.fire(this,t,q,s)}},_populateNextItems:function(q){var s=this._sliderData[parseInt(this._maxItems-1)];if(s){var r=new V3Date(new V3Date(s.startDate).addDays(1)).toStringFormat(this._dateFormatForRequest);var t=null;if(s.routes.length>1){t=new V3Date(new V3Date(s.routes[1].fullDate).addDays(1)).toStringFormat(this._dateFormatForRequest)}this.OnPopulateNextItems.fire(this,r,t,q)}},PopulateSliderItems:function(v,u){var t=v;this._sliderData=[];this._sliderData=this._sliderData.concat(t);this._pnlSliderContent.Controls.clear();this._maxItems=t.length;this._maxItemToShow=5;this._maxItemToShowInMobile=3;u.DOMElement.innerHTML="";for(var r in t){const s=t[r];this._addSliderItem(this._pnlSliderContent,s)}u.DOMElement.innerHTML=this.DOMElement.outerHTML;var q=(typeof $.fn.Slick!=="undefined");if(!q){setTimeout(function(){this.MakeItSlick()}.bind(this),500)}else{this.MakeItSlick()}},_atLeastOneSliderItemIsSelected:function(){var r=$(this._elementTarget).slick("getSlick");if(r){var t=r.$slides;for(var s=0;s<t.length;s++){var q=t[s];if(q.classList.contains("selected")){return true}}}return false},_reselectSliderItem:function(){if(!this._atLeastOneSliderItemIsSelected()){for(var r=0;r<this._sliderData.length;r++){var s=this._sliderData[r];if(this._selectedData==s.startDate){var q=$(this._elementTarget).slick("getSlick");if(q){q.$slides[r].classList.add("selected")}return}}}},AddNewItems:function(x,r){for(var t in x){const u=x[t];var w=this._sliderData.filter(function(y){return y.startDate==u.startDate});if(w.length<1){var q=this._createItemPanel(u);if(r){$(this._elementTarget).slick("slickAdd",q.DOMElement.outerHTML)}else{$(this._elementTarget).slick("slickAdd",q.DOMElement.outerHTML,0,true)}this._sliderData.push(u);this._maxItems=parseInt(this._maxItems)+1}}this._sliderData.sort(function(z,y){if(z.startDate.toLowerCase()<y.startDate.toLowerCase()){return -1}if(z.startDate.toLowerCase()>y.startDate.toLowerCase()){return 1}return 0});var v=this._maxItems%this._activeItemToShow;if(v>0){for(var s=0;s<v;s++){$(this._elementTarget).slick("slickRemove",this._maxItems-1,false);this._sliderData=this._sliderData.slice(0,-1);this._maxItems=parseInt(this._maxItems)-1}this._reselectSliderItem()}if(r){this.MoveNext()}else{this.MovePrevious()}},MakeItSlick:function(){this._elementTarget="#"+this._pnlSliderContent.DOMElement.id;$(this._elementTarget).on("init",function(r,q){if(q.activeBreakpoint==null){this._activeItemToShow=this._maxItemToShow;this._isMobileDevice=false}else{this._isMobileDevice=true}}.bind(this));$(this._elementTarget).slick({infinite:false,slidesToShow:this._maxItemToShow,slidesToScroll:this._maxItemToShow,arrows:false,prevArrow:$("#"+this._pnlLeftNavigation.DOMElement.id),nextArrow:$("#"+this._pnlRightNavigation.DOMElement.id),rtl:(document.dir.toLowerCase()==="rtl"),responsive:[{breakpoint:768,settings:{slidesToShow:this._maxItemToShowInMobile,slidesToScroll:this._maxItemToShowInMobile}},{breakpoint:480,settings:{slidesToShow:this._maxItemToShowInMobile,slidesToScroll:this._maxItemToShowInMobile}}]});$(this._elementTarget).on("edge",function(r,q,s){if(s.toLowerCase()=="left"){this._getNextItems()}else{if(s.toLowerCase()=="right"){this._getPreviousItems()}}}.bind(this));$("#"+this._pnlLeftNavigation.DOMElement.id).click(function(){this._getPreviousItems()}.bind(this));$("#"+this._pnlRightNavigation.DOMElement.id).click(function(){this._getNextItems()}.bind(this))},_getPreviousItems:function(){var q=$(this._elementTarget).slick("getSlick");var t=q.currentSlide;var s=this._maxItemToShow;if(q&&q.activeBreakpoint!=null){var r=q.breakpointSettings[q.activeBreakpoint];if(r!=null){s=r.slidesToShow;this._isMobileDevice=true}}else{this._isMobileDevice=false}this._activeItemToShow=s;if(parseInt(t)==0){this._populatePreviousItems(s)}else{$(this._elementTarget).slick("slickPrev")}},_getNextItems:function(){var q=$(this._elementTarget).slick("getSlick");var t=q.currentSlide;var s=this._maxItemToShow;if(q&&q.activeBreakpoint!=null){var r=q.breakpointSettings[q.activeBreakpoint];if(r!=null){s=r.slidesToShow;this._isMobileDevice=true}}else{this._isMobileDevice=false}this._activeItemToShow=s;var u=parseInt(this._maxItems-t);u=u>=s?s:parseInt(u);if((parseInt(t)+u)>=parseInt(this._sliderData.length)){this._populateNextItems(s)}else{$(this._elementTarget).slick("slickNext")}},MovePrevious:function(){$(this._elementTarget).slick("slickPrev")},MoveNext:function(){var q=this._isMobileDevice?500:100;setTimeout(function(){$(this._elementTarget).slick("slickNext")}.bind(this),q)}});V3.CABS.UI.DestinationSelector=f;V3.CABS.UI.SearchControl=n;V3.CABS.UI.QuickSearchFlightControl=a;V3.CABS.UI.FlightSearchFilter=o;V3.CABS.UI.PreferenceControl=b;V3.CABS.UI.FlightResultCard=e;V3.CABS.UI.FlightFlexibleDateSlider=h}); })(V3);
V3.Res={"Product.MultipleStartTimes.ItemConstantCost":"{time}","Product.MultipleStartTimes.ItemVariableCost":"{time} Cost: {price} {feemessage}","CabsSite.Cart.Name":"Cart","Campaign.Popup.BookingCommencinngDateRanges":"Bookings commencing <span class='date-bold'>{commencingMinBookingDate}</span> to <span class='date-bold'>{commencingMaxBookingDate}</span>.","Campaign.Popup.OfferAvailableDateRanges":"Offer available from <span class='date-bold'>{campaignStartDate} at {campaignStartTime}</span> to <span class='date-bold'>{campaignEndDate} at {campaignEndTime} (UTC)</span>.","Campaign.CampaignTermConditionConsumerHeader":"Terms and Conditions","Campaign.ViewTOC":"Terms and Conditions","Terms.GuestAdults":"Adults","Terms.GuestChildren":"Children","Terms.GuestSeniors":"Seniors","Terms.DateCommencing":"Commencing","Terms.DateConcluding":"Concluding","Terms.Guests":"Guests","Terms.Quantity":"Quantity","Terms.ICGAccommodation":"Accommodation","Terms.ICGActivity":"Activity","Terms.ICGEpicurean":"Epicurean","Terms.ICGShopping":"Shopping","Terms.ICGTransportation":"Transportation","Terms.Nights":"Nights","Terms.Products":"Products","Terms.Product":"Product","Terms.Business":"Provider","Terms.TimeCheckIn":"Check In","Terms.TimeCheckOut":"Check Out","Terms.Destination":"Destination","Terms.Rooms":"Rooms","Terms.Room":"Room","Cart.Label.Total":"Total:","Cart.Label.AddSuccess":"Item added successfully","Cart.Label.UpdateSuccess":"Item updated successfully","Cart.Label.Cost":"Cost","Cart.Label.TotalCost":"Total cost","Cart.Label.For":"for","Cart.Label.PlusFees":"plus fees","Cart.Label.Night":"Night","Cart.Label.RunsFor":"Runs for","Cart.Label.ShowOtherTimes":"Show other times","Cart.Label.OffersAvailable":"Offers Available","Cart.Notice.IsEmpty":"Cart is empty.","Cart.Button.CheckOutNow":"Check-Out Now","Cart.Button.Remove":"Remove","Cart.Button.Edit":"Edit","Cart.Button.ContinueShopping":"Continue Shopping","Cart.Button.ProceedToCheckOut":"Proceed to Checkout","Product.Label.Instruction":"Please enter the details of your booking","Product.Label.Goods.Instruction":"Please select your {quantity}","Product.Label.Goods.Header":"Product Details","Product.Label.ReferralBooking":"This booking will be completed by a third party, click Book Now to start the booking process in a new window.","Product.Label.SoloBooking":"This booking can only booked on its own, click Book Now to start the booking process in a new window.","Product.Label.BestOfferDiscount":"Best Offer Discount","Product.Label.SubjectToTermsAndConditions":"subject to Terms and Conditions","Product.Label.Total":"Total","Product.Label.NotAvailable":"NA","Product.Note.Duration":"Note: At some times of the year this {product} requires at least {duration} Nights to be booked","Product.Button.BookNow":"Book Now","Product.Button.AddToCart":"Add to cart","Product.Button.Cancel":"Close","Product.Error.Unavailable":"Unavailable, please try a different {commencing} date or number of {guest}","Product.Error.Goods.Unavailable":"Unavailable, please try a different {quantity}.","Product.Error.FutureDate":"Please select a future date.","Product.Error.Duration":"This {product} requires at least {duration} Nights to be booked.","Product.Error.Unexpected":"An unexpected error has occured.","Product.Error.Fetch":"An error occured while trying to fetch a quote. Please try again later.","Search.Wishlist.Label.Empty":"Wishlist","Search.Wishlist.Label.WithItems":"Wishlist ({count})","Search.Button.Text":"Search","Search.MoreOptions":"More options","Search.DateIsFlexible":" is flexible","Search.PriceFrom":"Price from","Search.PriceFrom.To":"to","Search.AnyOption":"Any","Search.AnyMinPrice":"Min","Search.AnyMaxPrice":"Max","Search.Placeholder.DestinationName":"{wordDestination} Name","Search.Placeholder.DestinationOrBusinessName":"{wordDestination} or {wordBusiness} Name","Search.Categories.Label":"Categories","Search.Discover.Text":"Discover","Search.HideUnavailableProduct":"Hide results with no availability","Search.Error.NoGuest":"Please enter the number of {guest}","Search.Error.NoGoods":"Please enter the number of Products","Search.Error.MaxGuest":"The number of {guest} are too high, please select {maxGuest} or less {guest}.","Search.Error.MaxGoods":"The number of Products is too high, please select {maxProducts} or less.","Search.Error.NoDestination":"Please enter a Destination","Search.Error.Unexpected":"Unexpected error has occurred","Search.Error.NoDestinationFound":"No Destinations found.","FlightSearch.Terms.InboundTerritory":"Inbound Territory","FlightSearch.Terms.OutboundTerritory":"Outbound Territory","FlightSearch.Terms.RoundTrip":"Round Trip","FlightSearch.Terms.MultiCity":"Multi-city","FlightSearch.Terms.Flight":"Flight","FlightSearch.Terms.Any":"Any","FlightSearch.Terms.Direct":"Direct","FlightSearch.Terms.Stop":"Stop","FlightSearch.Terms.Stops":"Stops","FlightSearch.Terms.Passenger":"Passenger","FlightSearch.Terms.Passengers":"Passengers","FlightSearch.Terms.Adults":"Adults","FlightSearch.Terms.Children":"Children","FlightSearch.Terms.Infants":"Infants","FlightSearch.Terms.OneStop":"1 Stop","FlightSearch.Terms.UpTwoStops":"Up to 2 Stops","FlightSearch.Label.Search":"Search","FlightSearch.Label.Select":"Select","FlightSearch.Label.AddFlight":"+ Add flight","FlightSearch.Label.LoadMore":"load more","FlightSearch.Label.ShowFilter":"Show Filters","FlightSearch.Label.HideFilter":"Hide Filters","FlightSearch.Label.CloseModal":"Cancel","FlightSearch.Label.Continue":"Continue","FlightSearch.Label.Proceed":"Yes Proceed","FlightSearch.Label.TripSummary":"Trip Summary","FlightSearch.Label.Duration":"Duration","FlightSearch.Label.ChooseAirport":"Choose your airport","FlightSearch.Label.From":"From","FlightSearch.Label.To":"To","FlightSearch.Label.Departure":"Departure","FlightSearch.Label.Return":"Return","FlightSearch.Label.SelectAll":"Select all","FlightSearch.Label.Deselect":"Deselect","FlightSearch.Label.Only":"Only","FlightSearch.Label.FlightNumber":"Flight: {airlineCode}{flightNumber}","FlightSearch.Label.LayOverDuration":"{layOverDuration} Layover","FlightSearch.Label.TripName":"{departureName} to {arrivalName}","FlightSearch.Label.BookingConfirmation":"Booking Confirmation","FlightSearch.Label.NumberOfPassenger":"{quantity} {passenger}","FlightSearch.Label.ClearCarrierFilter":"Airlines / Carriers","FlightSearch.Title.LandingPage":"Search Available Flights","FlightSearch.Error.NoLocationResult":"We couldn’t find what you were looking for.","FlightSearch.Error.NoFlightResult":"Sorry, we couldn’t find your trip. Try different dates?","FlightSearch.Error.NextAction":"Try selecting different dates or change your search criteria to get better results.","FlightSearch.Error.NoTerritoryAirport":"One of the airports need to be within territory","FlightSearch.Text.LocationInfoMessage":"Use search box for other airport options","FlightSearch.Text.ProceedConfirmation":"You will be transacting directly with the industry to complete your flight booking. After booking your flight you will need to come back to this page to book other items. Do you wish to proceed?","RateGrid.Button.View":"View","RateGrid.UpdatingNotification.Text":"Updating, Please wait...","RateGrid.NextButton":"Book","RateGrid.FooterMessage[aud]":"Rates displayed are the cheapest available, inclusive of VAT and are in Australian dollar (AUD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[bhd]":"Rates displayed are the cheapest available, inclusive of VAT and are in Bahraini dinar (BHD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[cny]":"Rates displayed are the cheapest available, inclusive of VAT and are in Chinese yuan (CNY). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[inr]":"Rates displayed are the cheapest available, inclusive of VAT and are in Indian rupee (INR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[jpy]":"Rates displayed are the cheapest available, inclusive of VAT and are in Japanese Yen (JPY). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[kwd]":"Rates displayed are the cheapest available, inclusive of VAT and are in Kuwaiti dinar (KWD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[omr]":"Rates displayed are the cheapest available, inclusive of VAT and are in Omani rial (OMR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[qar]":"Rates displayed are the cheapest available, inclusive of VAT and are in Qatari riyal (QAR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[sar]":"Rates displayed are the cheapest available, inclusive of VAT and are in Saudi riyal (SAR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[aed]":"Rates displayed are the cheapest available, inclusive of VAT and are in United Arab Emirates dirham (AED). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[gbp]":"Rates displayed are the cheapest available, inclusive of VAT and are in Pound Sterling (GBP).","RateGrid.FooterMessage[usd]":"Rates displayed are the cheapest available, inclusive of VAT and are in United States dollar (USD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[eur]":"Rates displayed are the cheapest available, inclusive of VAT and are in Euro (EUR). However the transactions shall be performed using Pound Sterling (GBP).","Paging.First":"1","Paging.Previous":"Previous","Paging.Next":"Next","Paging.Last":"{page.count}","Paging.PreviousIcon":"«","Paging.NextIcon":"»","ProviderSearch.Error.Unexpected":"Unfortunately there was an unexpected error and the results could not be updated. Please try again later.","ProviderSearch.Error.FailedEdit":"Unexpected error - could not edit product. Please remove from cart and try again.","ProviderSearch.Error.NoResult":"No results found.","ProviderSearch.ShowMap":"Show Map","ProviderSearch.ViewProduct":"View Products","ViewBy.Label":"View by","ViewBy.Map":"Map","ViewBy.List":"List","SortBy.Label":"Sort By","SortBy.Default":"Default","SortBy.NameInAscending":"Name (ascending)","SortBy.NameInDescending":"Name (descending)","SortBy.PriceLowestFirst":"Price (lowest first)","SortBy.PriceHighestFirst":"Price (highest first)","SortBy.RatingLowestFirst":"Rating (lowest first)","SortBy.RatingHighestFirst":"Rating (highest first)","FlexibleDate.Title":"Is your commencing date flexible?","FlexibleDate.IntroText":"Find more availability on an alternate date.","FlexibleDate.DateRange.OneMonthOneYear":"{startDate:y}","FlexibleDate.DateRange.TwoMonthOneYear":"{startDate:MMM} - {endDate:MMM}, {startDate:yyyy}","FlexibleDate.DateRange.TwoMonthTwoYear":"{startDate:y} - {endDate:y}","EntityDisplay.MaxGuestsText":" ","EntityDisplay.MaxGuestsLabel":"Max {guests}","EntityDisplay.ProductListTitle":"Available products:","EntityDisplay.Link.Info":"Info","EntityDisplay.Rating":"{score}/{max} by {number} people","EntityDisplay.ReviewsSingular":"{number} review","EntityDisplay.ReviewsPlural":"{number} reviews","EntityDisplay.By":"by {name}","EntityDisplay.Messages.Unavailable":"Unavailable","EntityDisplay.Messages.OutOfStock":"Out of stock","EntityDisplay.Button.Book.Text":"Book","EntityDisplay.Button.Order.Text":"Order","EntityDisplay.Button.More.Text":"More","EntityDisplay.Button.ViewAvailability.Text":"View Availability","EntityDisplay.Campaign.HavingOffers":"Having Offer(s):","EntityDisplay.Price.From":"From","EntityDisplay.Price.Type.Accomodation":"Per Night","EntityDisplay.Price.Type.Activity":" ","EntityDisplay.Price.Type.Epicurean":"Per Person","EntityDisplay.VieOnMap.Text":"View on Map","EntityDisplay.ViewMore.Text":"View More","EntityDisplay.Features.Text":"Features:","EntityDisplay.Review.Text":"Review","EntityDisplay.Review.Pros":"Pros","EntityDisplay.Review.Cons":"Cons","EntityDisplay.Review.GeneralComment":"General Comment","EntityDisplay.ProductSelector.Title":"Please select {productTerm} according to your dates","EntityDisplay.ProductSelector.DateAndNight.Title":"Please select Dates and Nights","EntityDisplay.ProductSelector.SelectTime.Label":"Select Time","EntityDisplay.ProductSelector.Price.Label":"Price","Map.Link.ViewRates":"View Rates","Map.Button.Overview":"Overview","Map.Button.Back":"Back","Words.And":"And","TimeComponent.Day":"Day","TimeComponent.Days":"Days","TimeComponent.Hour":"Hour","TimeComponent.Hours":"Hours","TimeComponent.Minute":"Minute","TimeComponent.Minutes":"Minutes","TimeComponent.Second":"Second","TimeComponent.Seconds":"Seconds","BookingProcessor.Failure.MultipleBookings":"Multiple bookings are not permitted.","BookingProcessor.Failure.ExternalPayment":"Bookings cannot be added to the cart when they are placed via a third party.","BookingProcessor.Failure.ExistInCart":"{serviceName} - {productName} is already in your cart. Only one {wordProduct} at a time can be booked for this {wordBusiness}.","BookingProcessor.Failure.DateExistInCart":"{productName} is already in your cart for this date. If you'd like to add more {wordProducts} to your cart, please click Close and choose a different {wordProduct} or date.","BookingProcessor.Failure.NightExistInCart":"{productName} is already in your cart for at least one of this nights. If you'd like to add more {wordProducts} to your cart, please click Close and choose a different {wordProduct}.","BookingProcessor.Failure.NoItem":"Please place some items into your cart before proceeding to the check-out.","Site.ViewImportantInformationOrPolicyLinkText":"View Booking Terms & Conditions","TXGB.ShoppingCart.AccommodationRestrictionNotice":"Due to UK legislation we are unable to allow the booking of Accommodation while packaged with other bookings. In order to book this Accommodation you must use the Book Now button to clear your current cart and to proceed to book this Accommodation on its own."};
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("CabsToolkit",1,["V3.Utils","V3.UI","V3.API.EntityService","V3.CABS.UI.Common"],function(){V3.Namespace("CABS");var f={DistributorShortname:"TestDistributor",ProviderShortname:"TestProviderHotel",BrandingStyle:"",BrandingView:"",EndPoints:{BookingService:"http://localhost/CABS4/Services/BookingService.asmx",EntityService:"http://localhost/CABS4/Services/EntityService.asmx",LocationService:"http://localhost/CABS4/Services/LocationService.asmx",InjectionPage:"http://localhost/CABS4/Services/Injection.aspx",SearchPage:"http://localhost/CABS4/Pages/Search.aspx",AvailabilityPage:"http://localhost/CABS4/Pages/Availability.aspx"},StyleSheetFiles:{},StyleSheetIncludes:{SearchBox:[],RateGrid:[]},Settings:{Terminology:{},PresentChildren:true,PresentSeniors:true},Overrides:{SearchBox:{},RateGrid:{}}};var e=V3.Is;var c=V3.CABS.EntityTypeEnum;var a=V3.CABS.IndustryCategoryGroupEnum;var d=V3.Enum({HyperLink:0,Image:1,Button1:2});var b=function b(g){this.base();if(window.vsDesignTime){g=f}this._config=g;this._channelShortname=g.DistributorShortname;this._providerShortname=g.ProviderShortname;this._brandingStyle=g.BrandingStyle;this._brandingView=g.BrandingView;this._isOptedIn=g.ProviderIsOptedIn;this._demoMode=g.DemoMode;this._endPoints.BookingService=g.EndPoints.BookingService;this._endPoints.EntityService=g.EndPoints.EntityService;this._endPoints.LocationService=g.EndPoints.LocationService;this._endPoints.InjectionPage=g.EndPoints.InjectionPage;this._endPoints.SearchPage=g.EndPoints.SearchPage;this._endPoints.AvailabilityPage=g.EndPoints.AvailabilityPage;this._settings=g.Settings||{};this._overrides=g.Overrides||{};this._styleSheetFiles=g.StyleSheetFiles;this._styleSheetIncludes.SearchBox=g.StyleSheetIncludes.SearchBox;this._styleSheetIncludes.RateGrid=g.StyleSheetIncludes.RateGrid;this._styleSheetIncludes.BookNowButtonStyles=g.StyleSheetIncludes.BookNowButtonStyles;this._setInjectionInstance();this._setEntityService();if(this._providerShortname){this._addProviderToolkitMethods();this._addProviderToolkitOverrides()}else{this._addDistributorToolkitMethods();this._addDistributorToolkitOverrides()}this.BookButtonStyle=d}.InheritsFrom(V3.Class,{_demoMode:false,_channelShortname:null,_providerShortname:null,_settings:null,_overrides:null,_injection:!window.vsDesignTime?null:new V3.CABS.Injection({}),_entityService:!window.vsDesignTime?null:new V3.API.EntityWebService({}),_endPoints:V3.Object({BookingService:null,EntityService:null,LocationService:null}),_styleSheetFiles:null,_styleSheetIncludes:V3.Object({SearchBox:null,RateGrid:null}),_loadStyleSheets:function(l,k,j){if(!l){return}k=!!k;j=j||0;for(var m=0,g=l.length;m<g;m++){var o=l[m];var n=(o.Id||o);var h=this._styleSheetFiles[n];V3.Dynamic.LoadSheet(n,h,(o.Prepend===true)||k,j);j++}},_getSearchboxPresetSizes:function(){return{small_accommodation:{ShowTabs:false,ShowActivity:false,ShowEpicurean:false,ShowShopping:false,ShowDestination:false,ShowDate:true,ShowNights:true,ShowPax:false,ShowAdvancedSearch:false},small_activity:{ShowTabs:false,ShowAccommodation:false,ShowEpicurean:false,ShowShopping:false,ShowDestination:false,ShowDate:true,CompactPax:true,PaxOptional:true,ShowAdvancedSearch:false,Terminology:{Guests:"Tickets"}},small_epicurean:{ShowTabs:false,ShowAccommodation:false,ShowActivity:false,ShowShopping:false,ShowDestination:false,ShowDate:true,CompactPax:true,PaxOptional:true,ShowAdvancedSearch:false,Terminology:{Guests:"Tickets"}},small_shopping:{ShowTabs:false,ShowAccommodation:false,ShowActivity:false,ShowEpicurean:false,ShowDestination:false,ShowDate:false,CompactPax:true,PaxOptional:true,ShowAdvancedSearch:false,Terminology:{Guests:"Tickets"}},large:{ShowDestination:false,ShowNights:true,CompactPax:true,PaxOptional:false,ShowSeniors:false}}},_setInjectionInstance:function(){if(!this._injection){this._injection=new V3.CABS.Injection({EndPoint:this._endPoints.InjectionPage,Shortname:this._channelShortname,BrandingStyle:this._brandingStyle,BrandingView:this._brandingView})}this.Services.InjectionService=this._injection},_setEntityService:function(){if(!this._entityService){this._entityService=new V3.API.EntityWebService({Shortname:this._channelShortname,EndPoing:this._endPoints.EntityService})}this.Services.EntityService=this._entityService},_addProviderToolkitOverrides:function(){this._overrides.SearchBox.ShowDestination=false;this._overrides.SearchBox.ShowNights=false;this._overrides.SearchBox.ShowPax=false;this._overrides.SearchBox.ShowAdvancedSearch=false},_addProviderToolkitMethods:function(){this.createBookButton=function(h,g,i){return this._createBookButton.apply(this,[this._providerShortname].addRange(arguments))};this.createRateGridForProduct=function(h,g){return this.createRateGridForProducts([h],g)};this.createRateGridForProducts=function(g,h){if(!h){h={}}if(!h.ProductFilter){h.ProductFilter={}}h.ProviderShortname=this._providerShortname;h.ProductFilter.Codes=g;h.ShowServices=false;return this.createRateGrid(h)};this.createSearchBoxForProduct=function(h,g){return this.createSearchBoxForProducts([h],V3.extend(g,false,{ShowTabs:false}))};this.createSearchBoxForProducts=function(g,h){if(!V3.Is.Array(g)){throw new Error("productCodes must be an array")}h=V3.extend(h,false,{ProductFilter:{},ShowTabs:true});h.ProductFilter.Codes=g;return this.createSearchBox(h)}},_addDistributorToolkitOverrides:function(){},_addDistributorToolkitMethods:function(){var g=this;this.createBookButton=function(j,k,i,l){return this._createBookButton.apply(this,arguments)};this.createRateGridForProvider=function(j,i){return this.createRateGrid(V3.extend(i,true,{ProviderShortname:j}))};this.createSearchBoxForProvider=function(j,i){i=V3.extend(i,false,{});i.ProviderShortname=j;return this.createSearchBox(i)};var h={};this.checkProviderOptIn=function(i,j){return this.checkProviderOptIns(V3.Is.Array(i)?i:[i],function(k){return j(k[0])})};this.checkProviderOptIns=function(i,o){if(!i){throw new Error("providerShortnames must be a string")}if(!V3.Is.Function(o)){throw new Error("fCallback must be a function")}var j=[];var m=[];var l=function(){m.sort(function(q,p){return p.IsOptedIn-q.IsOptedIn});o(m)};i.forEach(function(q){var p=h[q.toLowerCase()];if(p){m.add({IsOptedIn:p.OptedIn,ProviderShortname:p.Shortname,Url:!p.OptedIn?null:g.getBookButtonUrl(q),ProviderEntity:p.Entity,Error:null})}else{if(q){j.add(q)}else{m.add({IsOptedIn:false,ProviderShortname:"",Url:null,ProviderEntity:null,Error:null})}}});if(j.length==0){l();return}return this._entityService.Search(function n(p){j.forEach(function(s){var r=p.Entities.find(function(t){return t.Code.toLowerCase()==s.toLowerCase()});var q={OptedIn:!!r,Entity:r,Shortname:r?r.Code:s};h[s.toLowerCase()]=q;m.add({IsOptedIn:q.OptedIn,ProviderShortname:q.Shortname,Url:!q.OptedIn?null:g.getBookButtonUrl(q.Shortname),ProviderEntity:q.Entity,Error:null})});l()},function k(p){j.forEach(function(q){m.add({IsOptedIn:false,ProviderShortname:q,Url:null,ProviderEntity:null,Error:p})});l()},{Filter:{Codes:j,Type:c.Provider},Output:{CommonContent:{Name:true}}})}},Services:V3.Object(),getBookButtonUrl:function(){var j,k,l;var h=0;if(this._providerShortname){j=this._providerShortname;h++}else{if(arguments[h]){j=arguments[h++]}}if(arguments[h]||arguments[h]===""){k=arguments[h++]}if(arguments[h]){l=arguments[h++]}var g=this._endPoints.AvailabilityPage+"?exl_dn="+encodeURI(this._channelShortname)+"&exl_psn="+encodeURI(j);if(this._brandingStyle){g+="&exl_bs="+encodeURI(this._brandingStyle);if(this._brandingView){g+="&exl_bv="+encodeURI(this._brandingView)}}if(k){g+="&exl_pgc="+encodeURI(k)}if(l){g+="&exl_prd="+encodeURI(l)}return g},_createBookButton:function(){var s,k,p,h,r,l,o;var n=0;if(V3.CABS.Utils.IsValidEntityCode(arguments[n])||V3.Is.Array(arguments[n])){s=arguments[n++]}else{s=null}if(arguments[n]===""||arguments[n]===null||V3.CABS.Utils.IsValidEntityCode(arguments[n])){k=arguments[n++]}else{k=null}if(arguments[n]===""||V3.CABS.Utils.IsValidEntityCode(arguments[n])){p=arguments[n++]}else{p=null}if(d.parse(arguments[n])){h=d.parse(arguments[n++])}else{h=null}if(V3.Is.String(arguments[n])){r=arguments[n++]}else{r=null}if(arguments[n]===true){o="_blank";n++}else{if(V3.Is.String(arguments[n])){o=arguments[n++]}else{o="_parent"}}if(V3.Is.String(arguments[n])){l=arguments[n++]}else{l=null}if(V3.Is.PlainObject(arguments[n])){var m=arguments[n++];if(V3.Is.String(m.ProviderShortname)||V3.Is.Array(m.ProviderShortname)){s=m.ProviderShortname}if(V3.Is.String(m.ServiceCode)){k=m.ServiceCode}if(V3.Is.String(m.ProductCode)){p=m.ProductCode}if(d.parse(m.Style)){h=d.parse(m.Style)}if(V3.Is.String(m.Text)){r=m.Text}if(V3.Is.String(m.Text2)){l=m.Text2}if(m.OpenInNewWindow===true){o="_blank"}if(V3.Is.String(m.Target)){o=m.Target}if(V3.Is.String(m.ImageUrl)){if(!h||h==d.Image){r=m.ImageUrl;h=d.Image}}}if(!V3.Is.Specified(r)){r=(s?"Check Availability":"Search")}if(!V3.Is.Specified(l)){l="Live Booking System"}var j=new V3.UI.HyperLink().Set({cssClass:"book-now-button",target:o});var g=new V3.UI.Label().Set({cssClass:"V3"}).Insert(j);g.BookButton=g;if(!h){if(/^(http:)?\/\//.test(r)){h=d.Image}else{h=d.Button1}}j.cssClassAdd("style-"+h.toString().toLowerCase());switch(d.parse(h)){case d.Button1:this._loadStyleSheets(this._styleSheetIncludes.BookNowButtonStyles,true,0);j.Insert(new V3.UI.Label(r),new V3.UI.Label().Insert(new V3.UI.SvgSimple({x:1,y:-2,width:18,height:23},"m3,9h1V6a5,5 0 0,1 12,0V9h1v11H3M14,9V6a4,4 0 1,0-8,0v3").Set({fillColor:new V3.Color(16777215),size:{width:12,height:12},addFilter:'<feGaussianBlur in="SourceAlpha" stdDeviation="0 1" result="blur"/><feOffset in="blur" dx="0" dy="-1.5" result="offsetBlur"/><feFlood flood-color="#000" flood-opacity="0.4" result="offsetColor"/><feComposite in="offsetColor" in2="offsetBlur" operator="in" result="offsetBlur"/><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>'}),new V3.UI.Label(l)));break;case d.Image:j.Insert(new V3.UI.Image(r));break;case d.HyperLink:j.text(r);break}if(!s){j.href(this._endPoints.SearchPage+"?exl_dn="+this._channelShortname)}else{if(this._providerShortname){j.href(this.getBookButtonUrl(this._providerShortname,k,p))}else{j.visible(false);var q=function(i){if(V3.Is.Array(i)){i=i.find(function(t){return t.IsOptedIn})||{IsOptedIn:false}}j.href(this.getBookButtonUrl(i.ProviderShortname,k,p));j.visible(i.IsOptedIn);if(this._demoMode&&!i.IsOptedIn){g.Insert(new V3.UI.Label("Not opted-in or a web call error occurred so no button was rendered").Set({cssClass:"demo error"}))}}.bind(this);if(V3.Is.Array(s)){this.checkProviderOptIns(s,q)}else{this.checkProviderOptIn(s,q)}}}return g},createSearchBox:function(l){var v=(!this._demoMode?null:{Minimal:V3.createJsonForDebug(l||{},4)});var t=V3.extend({EnableUniform:true,IncludeStyleSheet:{Prepend:true},PresetSize:"large",ProviderShortname:null,ServiceFilter:null,ProductFilter:null,SortBy:null,BeforePresentation:function(z,y,x){return(y&&x.Entities.length>0)},AdditionalParams:null,EntityServiceApiSettings:{Shortname:this._channelShortname},CssClass:"",ButtonText:"Search"},true,this._overrides.SearchBox);l=V3.extend(l,true,this._overrides.SearchBox);l.Terminology=V3.extend(l.Terminology,true,this._settings.Terminology);l.Criteria=V3.extend(l.Criteria,false,this._settings.DefaultCriteria);l=V3.extend(l,false,t);l=V3.extend(l,false,this._settings);if(this._demoMode){v.Short=V3.createJsonForDebug(l,4)}if(this._providerShortname){l.ProviderShortname=this._providerShortname}var g,u,r,m=null;if(l.ProductFilter&&!(l.ProviderShortname||l.ServiceFilter)){throw new Error("ProductFilter can only be used when ProviderShortname or ServiceFilter are also supplied.")}var j=null;var o=null;if(l.ProviderShortname){l.showTabs=false;var p=false;var n={Filter:{Type:c.Provider,Codes:V3.Is.Array(l.ProviderShortname)?l.ProviderShortname:[l.ProviderShortname]},Output:{Children:{},Settings:true}};if(l.ProductFilter){n.Output.Children.Filter=l.ProductFilter||{};n.Output.Children.Filter.Type=c.Product;p=true}else{if(l.ServiceFilter){n.Output.Children.Filter=l.ServiceFilter||{};n.Output.Children.Filter.Type=c.Service;p=true}}n.Output.Children.Output={Bookability:{},CommonContent:{Capabilities:true,IndustryCategories:true}};var q=this._demoMode;var s=function(x){try{if(x.Entities.length>0){m=x.Entities[0];if(p){if(x.Entities[0].Children.length==1&&x.Entities[0].Children[0].Type==c.Product){j=x.Entities[0].Children[0].Id}else{if(x.Entities[0].Children[0].Type==c.Service){if(!o){o=[];x.Entities[0].Children.forEach(function(z){o.add(z.Code)})}}}}u.setLimitsFromEntities(x.Entities[0].Children);u.criteria(x.Entities[0].Settings.DefaultCriteria);u.configure(l)}}catch(y){V3.Log.Error("Error thrown while trying to setup searchbox with provider/service/product defaults","err",y)}if(!l.BeforePresentation||l.BeforePresentation(u,true,x)){u.visible(true)}else{if(x.Entities.length==0&&q){g.Insert(new V3.UI.Label("No results returned so no search box rendered, please check filters").Set({cssClass:"demo error"}))}}};var i=function(x){if(!l.BeforePresentation||l.BeforePresentation(u,false,x)){u.visible(true)}if(q){g.Insert(new V3.UI.Label("There was a Web Call Error so the searchbox was not rendered, error: "+x).Set({cssClass:"demo error"}))}};var h=this._entityService.Search(s,i,n);r=true}var w=this._getSearchboxPresetSizes();var k=w[(l.PresetSize||"").toLowerCase()]||w.large;if(r){k.Terminology=null}l=V3.extend(l,false,k);if(!l.CssClass.contains("horizontal")&&!l.CssClass.contains("vertical")){if((l.Orientation+"").toLowerCase()=="horizontal"){l.CssClass=l.CssClass+" horizontal"}else{l.CssClass=l.CssClass+" vertical"}}if(l.IncludeStyleSheet){this._loadStyleSheets(this._styleSheetIncludes.SearchBox,l.IncludeStyleSheet.Prepend,l.IncludeStyleSheet.NumberToSkip)}u=new V3.CABS.UI.SearchControl(l).Set({visible:!r,OnPerformSearch:function(x,y){if(l.ProviderShortname){this._injection.availabilityInjection({ProviderShortname:m.Code,Criteria:y.Criteria,IncludedLocationCodes:l.AllowedLocationCodes,SortBy:l.SortBy,HighlightProductId:j,ServiceCodes:o,AdditionalParams:l.AdditionalParams})}else{this._injection.searchInjection({Criteria:y.Criteria,IncludedLocationCodes:l.AllowedLocationCodes,SortBy:l.SortBy,AdditionalParams:l.AdditionalParams})}}.bind(this),OnVisibleChange:function(x,y){if(l.EnableUniform&&V3.jQuery&&V3.jQuery.uniform){V3.jQuery(document).ready(function(){var z={selectClass:"selector uniform double-digit",checkboxClass:"checker uniform"};var A="#"+x.DOMElement.id+".search-control select, #"+x.DOMElement.id+".search-control input[type='checkbox']";V3.jQuery(A).uniform(z);u.Tabs.OnSelectedTabIndexChanged.addEventHandler(function(B,C){V3.jQuery.uniform.update(A)})})}}});g=new V3.UI.Panel("V3");g.SearchBox=u;g.Insert(u);if(this._demoMode){V3.CABS.Utils._getDefaultTerminology(l.Terminology);v.Verbose=V3.createJsonForDebug(l,4);g.DemoJson=v}return g},createSearchBoxForService:function(h,i,g){if(arguments.length==1){i=arguments[0];h=null;g=null}else{if(arguments.length==2){if(!V3.Is.String(i)){g=arguments[1];i=arguments[0];h=null}}}return this.createSearchBoxForServices(h,[i],g)},createSearchBoxForServices:function(i,g,h){if(arguments.length==1){g=arguments[0];i=null;h=null}else{if(arguments.length==2){if(!V3.Is.String(i)){h=arguments[1];g=arguments[0];i=null}}}if(!V3.Is.Array(g)){throw new Error("productGroupCodes must be an array")}h=V3.extend(h,false,{ServiceFilter:{},ShowTabs:true});h.ProviderShortname=i;h.ServiceFilter.Codes=g;return this.createSearchBox(h)},createRateGrid:function(t){var g=this;var m=this._demoMode;var s=(!m?null:{Minimal:V3.createJsonForDebug(t||{},4)});if(!t){t={}}var w=!!t.Date;var n=!!t.MinDate;var p=!!t.MaxDate;var y=V3.extend({EnableUniform:true,IncludeStyleSheet:{Prepend:true},ShowServices:true,ShowProducts:true,ExpandProducts:false,ShowBookButtons:true,AllowDateNavigation:true,OpenInNewWindow:false,PreloadAvailability:true,ShowLoadingImage:true,BeforePresentation:function(B,A,z){return(A&&B.Rows.count()>1)},IndustryCategoryGroup:null,SortBy:null,ProductFilter:{},ServiceFilter:{TagCriteria:{}},AdditionalParams:null,ServiceCodes:null,PartnerShortname:null,ProviderShortname:null,EntityServiceApiSettings:{Shortname:this._channelShortname},HighlightedDays:t.AllowDateNavigation===false?0:1},true,this._overrides.RateGrid);t=V3.extend(t,false,y);t=V3.extend(t,false,this._settings.RateGrid);if(t.IndustryCategoryGroup){t.ServiceFilter.TagCriteria.IndustryCategoryGroups=[t.IndustryCategoryGroup]}if(m){s.Short=V3.createJsonForDebug(t,4)}t=V3.extend(t,true,this._overrides.RateGrid);t.Terminology=V3.extend(t.Terminology,true,this._settings.Terminology);t.Criteria=V3.extend(t.Criteria,false,this._settings.DefaultCriteria);if(t.IncludeStyleSheet){this._loadStyleSheets(this._styleSheetIncludes.RateGrid,t.IncludeStyleSheet.Prepend,t.IncludeStyleSheet.NumberToSkip)}if(!t.ShowServices&&!t.ShowProducts){V3.Log.Warn("ShowServices and ShowProducts is set to false, this is invalid so turning on ShowServices");t.ShowServices=true}var l=new V3.UI.Panel("V3 rate-grid-container");var r=!m?null:function(){s.Verbose=V3.createJsonForDebug(t,4);l.DemoJson=s};var i=function(A){if(m){r(t)}l.RateGrid=A;l.Insert(A);if(!t.ShowServices){A.cssClassAdd("products-only")}if(!t.ShowBookButtons){if(!t.ShowServices||!t.ShowProducts){A.cssClassAdd("no-controls")}}else{var z=function(F,E,D,C){var B={OpenInNewWindow:t.OpenInNewWindow,Criteria:{Destination:g._providerShortname?null:{ServiceId:F},IndustryCategoryGroup:D,Date:(C||(t.Criteria&&t.Criteria.Date))||(A.highlightedDays()&&A.date())},SortBy:t.SortBy,HighlightProductId:E||F,AdditionalParams:t.AdditionalParams};if(B.Criteria.Date){B.Criteria.Date=new V3Date(B.Criteria.Date).date()}if(g._providerShortname){if(E){}B.ProviderShortname=q._providerShortname;g._injection.availabilityInjection(B)}else{B.ProviderShortname=t.ProviderShortname;g._injection.availabilityInjection(B)}};A.OnRowAdded.addEventHandler(function(D,E){if(!E.Row.Entity){return}E.Row.OnRateClicked.addEventHandler(function(F,G){A.date(G.date)});if(E.Row.Entity.Type==V3.CABS.EntityTypeEnum.Service){var C=E.Row.Entity;if(!t.ShowProducts){E.Row.OnRateClicked.addEventHandler(function(F,G){z(C.Id,null,C.IndustryCategoryGroups[0],G.date)});E.Row.LastCell.Insert(new V3.UI.Button("View").Set({cssClass:"button blue",OnClick:function(F,G){z(C.Id,null,C.IndustryCategoryGroups[0],null)}}))}}else{if(E.Row.Entity.Type==V3.CABS.EntityTypeEnum.Product){var B=E.Row.Entity;E.Row.OnRateClicked.addEventHandler(function(F,G){z(B.ParentId,B.Id,B.IndustryCategoryGroups[0],G.date)});E.Row.LastCell.Insert(new V3.UI.Button("View").Set({cssClass:"button orange",OnClick:function(F,G){z(B.ParentId,B.Id,B.IndustryCategoryGroups[0],null)}}))}}})}};var x;var q=this;if(t.MinDate&&t.MaxDate){if(!t.AllowDateNavigation){t.MinDate=t.MaxDate=new V3Date(t.MinDate||t.MaxDate||t.Date||null).date()}x=new V3.CABS.UI.RateGrid(t).Set({visible:false});i(x)}else{x=null}var h=function(B){var D=null,A=null,C;B.Entities.forEach(function(G){if(G){if(G.Bookability&&G.Bookability.AvailabilityDateRange){if(D==null||D>G.Bookability.AvailabilityDateRange.Min){D=G.Bookability.AvailabilityDateRange.Min}if(A==null||A<G.Bookability.AvailabilityDateRange.Max){A=G.Bookability.AvailabilityDateRange.Max}}if(G.Settings&&G.Settings.DefaultCriteria&&G.Settings.DefaultCriteria.DateIsCustomised){if(C==null||C<G.Settings.DefaultCriteria.Date){C=G.Settings.DefaultCriteria.Date}}}});if(D&&D<new Date()){D=new V3Date()}if(x){if(!w&&C){x.date(C)}}else{if(!w&&C){t.Date=C}if(!n&&D){t.MinDate=D}if(!p&&A){t.MaxDate=A}if(!t.AllowDateNavigation){t.MinDate=t.MaxDate=new V3Date(t.Date||t.MinDate||t.MaxDate||null).date()}x=new V3.CABS.UI.RateGrid(t).Set({visible:false});i(x)}if(!t.AllowDateNavigation){t.MinDate=t.MaxDate=new V3Date(t.Date||t.MinDate||t.MaxDate||null).asV3Date().date()}x.beginBulkLoad();var F;var z=new V3.Utils.StopWatch(true);B.Entities.forEach(function(H){if(!H.Children||H.Children.length==0){return}if(t.ShowServices){var G=x.addRowForEntity(H,t.ShowProducts,null);if(t.ShowProducts&&t.ExpandProducts){G.productRowsVisible(true)}F=G}else{H.Children.forEach(function(J){var I=x.addRowForEntity(J,false,null,H)})}});z.stop();V3.Log.Info("Time to render "+x.Rows.count()+" services on grid: "+z.getDuration()+"ms");x.endBulkLoad();var E=(B.Entities.length>0);if(t.BeforePresentation&&t.BeforePresentation(x,E,B)===false){E=false}x.visible(E);if(o){o.Parent.Controls.remove(o)}if(m&&!E){l.Insert(new V3.UI.Label("No results returned so the rate grid was not rendered, please check filters").Set({cssClass:"demo error"}))}};var v=function(z){if(t.BeforePresentation){t.BeforePresentation(x,false,z)}if(l.Controls.count()==2){l.Controls.removeAt(1)}if(m){l.Insert(new V3.UI.Label("Web Call Error so no rate grid rendered, error: "+z).Set({cssClass:"demo error"}))}};var k={ProductFilter:t.ProductFilter,ServiceFilter:t.ServiceFilter};var j={ServiceOutput:V3.extend(t.ServiceOutput,false,{CommonContent:{All:false,Name:true,IndustryCategories:true,Capabilities:true},Bookability:{},Settings:true}),ProductOutput:V3.extend(t.ProductOutput,false,{CommonContent:{All:false,Name:true,IndustryCategories:true,Capabilities:true}})};if(t.PreloadAvailability){if(x){j.ServiceOutput.Availability=V3.extend(j.ServiceOutput.Availability,false,{StartDate:x.startDate(),NumberOfDays:x.size()}),j.ProductOutput.Availability=V3.extend(j.ProductOutput.Availability,false,{StartDate:x.startDate(),NumberOfDays:x.size()})}else{V3.Log.Warn("To preload availability then MinDate and MaxDate must be supplied")}}if(this._providerShortname){t.PartnerShortname=null;t.ProviderShortname=this._providerShortname}var u=null;if(this._providerShortname&&!this._isOptedIn){if(m){l.Insert(new V3.UI.Label("No results returned so no rate grid rendered, please check filters").Set({cssClass:"demo error"}))}}else{if(t.PartnerShortname){u=this._entityService.FindServicesByPartnerShortname(h,v,t.PartnerShortname,k,j)}else{if(t.ProviderShortname){u=this._entityService.FindServicesByProviderShortname(h,v,t.ProviderShortname,k,j)}else{if(t.ServiceCodes!=null&&t.ServiceCodes.length>0){u=this._entityService.GetServicesByCodes(h,v,t.ServiceCodes,k,j)}else{throw new Error("Not enough information supplied to search for Services")}}}}if(u){var o=V3.UI.Images.LoadingCircular.createInstance();if(t.ShowLoadingImage){l.Insert(o)}}else{if(x&&t.BeforePresentation&&t.BeforePresentation(x,true,null)!==false){x.visible(true)}}if(m){V3.CABS.Utils._getDefaultTerminology(t.Terminology);r()}return l},createRateGridForService:function(h,i,g){if(arguments.length==1){i=arguments[0];h=null;g=null}else{if(arguments.length==2){if(!V3.Is.String(i)){g=arguments[1];i=arguments[0];h=null}}}return this.createRateGridForServices(h,[i],g)},createRateGridForServices:function(i,g,h){if(arguments.length==1){g=arguments[0];i=null;h=null}else{if(arguments.length==2){if(!V3.Is.String(i)){h=arguments[1];g=arguments[0];i=null}}}if(!h){h={}}if(!h.ServiceFilter){h.ServiceFilter={}}h.ProviderShortname=i;h.ServiceFilter.Codes=g;h.ShowProducts=false;return this.createRateGrid(h)}});V3.CABS.Toolkit=b}); })(V3);

(function(V3){
    var settings = { 
        DistributorShortname: "visitnorthumberland",
        ProviderShortname: null,
        ProviderIsOptedIn: false,
        BrandingStyle: null,
        BrandingView: null,
        EndPoints: {
            BookingService: "https://book.txgb.co.uk/v4/Services/BookingService.asmx",
            EntityService: "https://book.txgb.co.uk/v4/Services/EntityService.asmx",
            LocationService: "https://book.txgb.co.uk/v4/Services/LocationService.asmx",
            InjectionPage: "https://book.txgb.co.uk/v4/Services/Injection.aspx",
            SearchPage: "https://book.txgb.co.uk/v4/Pages/Search.aspx",
            AvailabilityPage: "https://book.txgb.co.uk/v4/Pages/Availability.aspx"
        },
        StyleSheetFiles:{
            Base: "https://book.txgb.co.uk/v4/Resources/Styles/base.min.css",
            Site: "https://book.txgb.co.uk/v4/Resources/Styles/site.min.css",
            BaseUtils: "https://book.txgb.co.uk/v4/Resources/Styles/base.utils.min.css",
            Search: "https://book.txgb.co.uk/v4/Resources/Styles/search.min.css",
            jQueryUI: "https://book.txgb.co.uk/v4/Resources/Libraries/jquery-theme/jquery-ui-1.8.17.custom.min.css",
        },
        StyleSheetIncludes: {
            SearchBox: [{Id:'Base', Prepend:true},'BaseUtils', 'jQueryUI', 'Site', 'Search'],
            RateGrid: [{Id:'Base', Prepend:true},'BaseUtils', 'Site', 'Search'],
            BookNowButtonStyles: ['Search']
        },
        Settings: {"MaxNights":30,"RateGrid":{"ShowCurrencySymbol":false}},
        Overrides: {
            SearchBox: null,
            RateGrid: null
        }
    };
    var varName = 'DistributorToolkit';
window[varName] = new V3.CABS.Toolkit(settings);
})(V3);
