<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">function Player(e,t,n,r){function i(){if(f.getPlayerState=function(){return _?"flash"===b.tech?h.getPlayerElement().getState():b:C?void P(h.getPlayerState(n),"onplayerstatebroadcast"):w?void P(null,"onplayerstatebroadcast"):void 0},f.play=function(e){return _||C?h.play():void(w&amp;&amp;P(e,"play"))},f.pause=function(e){return _||C?h.pause():void(w&amp;&amp;P(e,"pause"))},f.turnOffCaptions=function(e){return _||C?h.turnOffCaptions():void(w&amp;&amp;P(e,"turnoffcaptions"))},f.restart=function(e){return _||C?h.restart():void(w&amp;&amp;P(e,"restart"))},f.changeTime=function(e){return _||C?h.changeTime(e):void(w&amp;&amp;P(e,"timechange"))},f.changeCaption=function(e){return _||C?h.changeCaption(e):void(w&amp;&amp;P(e,"captionchange"))},f.changeVolume=function(e){return _||C?h.changeVolume(e):void(w&amp;&amp;P(e,"volumechange"))},f.changeQuality=function(e){return _||C?h.changeQuality(e):void(w&amp;&amp;P(e,"qualitychange"))},f.changeColor=function(e){return _||C?h.changeColor(e):void(w&amp;&amp;P(e,"colorchange"))},f.kill=function(e){return _||C?h.kill():void(w&amp;&amp;P(e,"kill"))},f.on=function(e,t){var n=e.toLowerCase();if(typeof p[n]===d){var r=s+" : The event "+n+" is not supported for binding. Supported events are : "+Object.keys(p).join(", ");throw b.exceptions.push(r),y.eventHandler("exception"),r}y.internalFlags.consoleLogs&amp;&amp;console.log(s+" : Registering callback for event "+n),p[n].push(t)},f.off=function(e,t){var n=e.toLowerCase();if(typeof p[n]===d){var r=s+" : The event "+n+" is not supported for binding. Supported events are : "+Object.keys(p).join(", ");throw b.exceptions.push(r),y.eventHandler("exception"),r}y.internalFlags.consoleLogs&amp;&amp;console.log(s+" : Removing callback for event "+n),p[n].indexOf(t)&gt;-1&amp;&amp;p[n].splice(p[n].indexOf(t),1)},w){f.releaseUserInteractionHold=function(){$("releaseuserinteractionhold")};var e=function(e){var t,n=e.data.eventAlias.toLowerCase();y.internalFlags.consoleLogs&amp;&amp;console.log(s+" Listener received a message for event "+n,e);try{t=JSON.parse(e.data.args)}catch(r){t=e.data.args}if(y.internalFlags.consoleLogs){var i=p[n].length;console.log(0===i?s+" : No callbacks registered for event "+n:s+" : Executing "+i+" callbacks for event "+n)}for(var o in p[n])p[n][o](n,t)};l(u,e,!1)}if(C){var t=function(e,t){y.internalFlags.consoleLogs&amp;&amp;console.log(s+" : Sending message for event "+e),P(t,e)},n=Object.keys(p);for(var r in n){var i=n[r];f.on(i,t)}}return f}var o="ADOBEMPCVP",s=document.domain+window.location.pathname;window[o]||(window[o]={},window[o].players={});var a=window.addEventListener?"addEventListener":"attachEvent",l=window[a],u="attachEvent"==a?"onmessage":"message",c=window.location.protocol+"//",d="undefined",h=this,p={play:[],pause:[],videoready:[],exception:[],restart:[],milestone:[],videocomplete:[],timechange:[],captionchange:[],speedchange:[],qualitychange:[],volumechange:[],screenchange:[],colorchange:[],turnoffcaptions:[],holdforuserinteraction:[],userinteractionholdreleased:[],onplayerstatebroadcast:[],kill:[]},f={},v={},g={enableSC:!1,forceTech:"detect",logDebugMessages:!0,data:null,sitecatalyst:{account:"adbadobenonacdcprod"}};if(typeof r===d)r=g;else for(var m in g)typeof r[m]===d&amp;&amp;(r[m]=g[m]);var y={internalFlags:{timeUpdate:!0,consoleLogs:!1}};y.eventHandler=function(e){var t=e.toLowerCase();if(y.internalFlags.consoleLogs){var n=p[t].length;console.log(p[t].length&gt;0?s+": Executing "+n+" callbacks for event "+t:s+": No callbacks registered for event "+t)}for(var r in p[t]){var i=h.getPlayerState();p[t][r](t,i)}};var b={tech:"Unknown",playerID:"Unknown",supportedPlayerTechnology:"Unknown",networking:{domain:c+"video.tv.adobe.com",detectedEnvironment:"prd-video"},constructorArguments:{mode:e,hasIframe:window.location!==window.parent.location,bootstrap:t,hostContainerID:n,options:r},videoState:{currentTime:0,duration:0,screenState:"normal",volume:0,milestone:0,color:0,translations:[],qualities:[],playing:!0,captions:{key:"Unkown",language:"Unknown"},quality:{label:"Unknown",labelid:0,bitrate:0},holdingForUserInteraction:!1},log:[],exceptions:[]};y.playerState=b,h.getPlayerState=function(){return"flash"===b.tech&amp;&amp;"undefined"!=typeof h.getPlayerElement()&amp;&amp;"undefined"!=typeof h.getPlayerElement().getState?h.getPlayerElement().getState():b},h.play=function(){b.videoState.holdingForUserInteraction?R():h.getPlayerElement().play()},h.pause=function(){h.getPlayerElement().pause()},h.changeTime=function(e){h.getPlayerElement().changeTime("object"==typeof e?e.seconds:e)},h.changeCaption=function(e){h.getPlayerElement().changeCaption("object"==typeof e?e.language:e)},h.turnOffCaptions=function(){h.getPlayerElement().turnOffCaptions()},h.restart=function(){h.getPlayerElement().restart()},h.changeVolume=function(e){h.getPlayerElement().changeVolume("object"==typeof e?e.volume:e)},h.changeQuality=function(e){h.getPlayerElement().changeQuality("object"==typeof e?e.quality:e)},h.changeColor=function(e){h.getPlayerElement().setSkinColor("object"==typeof e?e.color:e)},h.setData=function(){var e=setInterval(function(){if(typeof h.getPlayerElement()!==d&amp;&amp;h.getPlayerElement().setData){var t=Helper.merge(h.videoMetadata,r);h.getPlayerElement().setData(t),b.log.push("Player data has been sent to Flash"),clearInterval(e)}},50)},h.getPlayerElement=function(){var e=null;switch(b.supportedPlayerTechnology){case"html5":e=h.html5Player;break;case"flash":var t=K();e=t===!1?document[h.$el.getAttribute("id")]:document.all[h.$el.getAttribute("id")];break;case"html":e=h.nativePlayer}return e},h.kill=function(){h.getPlayerElement().kill(),delete window.ADOBEMPCVP.players[b.playerID]};var _,C,w;if("string"!=typeof e){var S="A mode is required to construct a player object. Please provide a string to identify the mode.";throw b.exceptions.push(S),y.eventHandler("exception"),S}if(_="component"==e.toLowerCase(),C="embed"==e.toLowerCase(),w="embedwindowapimanager"==e.toLowerCase(),!_&amp;&amp;!C&amp;&amp;!w){var x="Invalid mode provided. Please provide either `component` or `embed`.";throw b.exceptions.push(x),y.eventHandler("exception"),x}if(b.log.push("Player context validated (mode)."),_){if("string"!=typeof t){var E="A viewBucketID is required as the second argument when using the player component.";throw b.exceptions.push(E),y.eventHandler("exception"),E}b.viewBucketID=t,b.log.push("Component bootstrapped")}if(C){if("object"!=typeof t){var L="The second argument is required to be an object capable of bootstrapping the player when using the player embed behavior.";throw b.exceptions.push(L),y.eventHandler("exception"),L}b.viewBucketID=t.viewBucketID,b.log.push("Embed bootstrapped")}f.isComponentContext=_,f.isEmbedContext=C,f.isEmbedAPIContext=w;var k="The ID of a valid HTML element must be provided as the third argument (hostContainerID). Please provide the ID of your host container (example: `#videoContainer`). You provided: "+n;if("string"!=typeof n)throw b.exceptions.push(k),y.eventHandler("exception"),k;if(0===n.length||"#"!=n.charAt(0))throw b.exceptions.push(k),y.eventHandler("exception"),k;b.playerID=n.slice(1);var T=document.getElementById(b.playerID);if(null==T){var H="The player was unable to find the DOM element for the provided ID `"+b.playerID+"`. Please verify the DOM element exists.";throw b.exceptions.push(H),y.eventHandler("exception"),H}b.log.push("Player container validated");var $=function(e){if(w){if(typeof T===d){var t="Unable to find the DOM element with an ID of "+n;throw b.exceptions.push(t),y.eventHandler("exception"),t}if(typeof T.contentWindow===d){var r="The DOM element with an ID of "+n+" does not appear to be a valid iFrame";throw b.exceptions.push(r),y.eventHandler("exception"),r}return null===T.contentWindow&amp;&amp;(T=document.getElementById(T.getAttribute("id"))),void T.contentWindow.postMessage(e,"*")}C&amp;&amp;parent.postMessage(e,"*")},P=function(e,t){if(typeof e!==d){var n={eventAlias:t,args:JSON.stringify(e,function(e,t){return"function"==typeof t?t.toString():t})};return $(n)}return $(t)};if(w)return p.onplayerstatebroadcast=[],i();if(window.ADOBEMPCVP.players[b.playerID]=y,"#"!==n.charAt(0))throw"Please provide an ID with a #";var A=n.substr(1);this.$el=Helper.select(A),Helper.hasClass(this.$el,"pearl-player")||Helper.addClass(this.$el,"pearl-player",!0),Helper.hasClass(this.$el,"pearl-default-skin")||Helper.hasClass(this.$el,"pearl-screen-skin")||Helper.addClass(this.$el,"pearl-default-skin",!0);var q=function(){if("object"==typeof r&amp;&amp;r.enableSC&amp;&amp;typeof s_adobe===d&amp;&amp;typeof s_adobe===d&amp;&amp;!window.sAdobeLoaded){window.sAdobeLoaded=!0;var e="https:"==document.location.protocol?"https://":"http://";!function(t,n){var r,i=t.getElementsByTagName(n)[0],o=t.createDocumentFragment(),s=function(e,i){t.getElementById(i)||(r=t.createElement(n),r.src=e,i&amp;&amp;(r.id=i),o.appendChild(r))};s(e+"assets.adobedtm.com/659ec8ada5450db95675e43beaaae92399591a11/satelliteLib-46e65db5bb0c375f8f64619be31cc9b29acf4867.js"),i.parentNode.insertBefore(o,i),"undefined"!=typeof _satellite&amp;&amp;_satellite.pageBottom()}(document,"script")}},N="prd-video";if(null!=r&amp;&amp;"object"==typeof r){var I=typeof r.environment;"string"==I&amp;&amp;(N=r.environment)}var O=!1;switch(N){case"local-video":b.networking.domain=c+"local-video.tv.adobe.com",O=!0;break;case"local-publish":b.networking.domain=c+"local-publish.tv.adobe.com",O=!0;break;case"development-video":b.networking.domain=c+"dev-video.tv.adobe.com",O=!0;break;case"development-publish":b.networking.domain=c+"dev-publish.tv.adobe.com",O=!0;break;case"production-publish":b.networking.domain=c+"publish.tv.adobe.com",O=!0;break;case"detect":var D=window.location.href.split("/");b.networking.domain=c+D[2],O=!0}O&amp;&amp;(b.networking.detectedEnvironment=N);var M=function(){b.supportedPlayerTechnology=Z();var e="null"!=J("nosc")?e=J("nosc"):!1;switch("string"==typeof e&amp;&amp;(e="true"===e?!0:!1),b.supportedPlayerTechnology){case"html5":b.log.push("Building HTML5 player"),b.tech="html5",W(),e||typeof s_adobe===d||U(h.$el);break;case"flash":b.log.push("Building flash player"),b.tech="flash",X();break;case"html":case"native":b.log.push("Building native player"),b.tech="html",z(),e||typeof s_adobe===d||U(h.$el);break;default:var t="The player is in an unknown state.";throw b.exceptions.push(t),y.eventHandler("exception"),t}},j=function(e,t){if(typeof t===d)t=!1;else if("boolean"!=typeof t){var n="You must provide a boolean as the default second parameter in normaizeParam()";throw b.exceptions.push(n),y.eventHandler("exception"),n}var r="null"!=J(e)?r=J(e):t;return"string"==typeof r&amp;&amp;(r="true"===r?!0:!1),r},F=function(){b.log.push("Constructing the player"),_?V():B()},B=function(){function e(t){R(),self.location!=top.location&amp;&amp;y.eventHandler("play"),t.target.classList.contains("pearl-large-play")&gt;-1&amp;&amp;t.target.removeEventListener("click",e)}if(b.log.push("Constructing embedded player"),h.videoMetadata=Helper.merge(PlayerSettings["interface"](),t),h.autoplay=j("autoplay"),h.videoMetadata.chaptermarkers="off"===J("chaptermarkers")?"off":"on",h.videoMetadata.enable10seconds=J("enable10seconds"),h.videoMetadata.speedcontrol=J("speedcontrol"),h.videoMetadata.playicon=J("playicon"),"null"!=h.videoMetadata.playicon&amp;&amp;(h.videoMetadata.playicon="white"===h.videoMetadata.playicon?"white":"blue"),h.learn=J("learn"),h.videoMetadata.t=Q("t"),"on"===h.learn){h.videoMetadata.enable10seconds="on",h.videoMetadata.speedcontrol="on";var n=J("hidetitle");"false"===n?h.videoMetadata.hidetitle=!1:("null"===n||"true"===n)&amp;&amp;(h.videoMetadata.hidetitle=!0)}else h.videoMetadata.hidetitle=j("hidetitle");if(q(),b.supportedPlayerTechnology=Z(),!h.autoplay&amp;&amp;"html"!=b.supportedPlayerTechnology){y.playerState.videoState.holdingForUserInteraction=!0;var r=T.offsetWidth&lt;500||T.offsetHeight&lt;350?"small":"",i=document.createElement("div");i.className="pearl-pre-face",i.setAttribute("id","preface-"+b.playerID);var o=h.videoMetadata.playicon&amp;&amp;"white"===h.videoMetadata.playicon?"large-play.png":"blue-play-button.svg";if(i.innerHTML='&lt;div class="play-large-holder show none" aria-live="polite" aria-label="Play video"&gt;&lt;img class="pearl-large-play '+r+' mpc" src="'+h.videoMetadata.asseturl+o+'" /&gt;&lt;/div&gt;&lt;div class="pre-poster"&gt;&lt;/div&gt;',T.appendChild(i),i.querySelector(".pre-poster").style.backgroundImage="url("+h.videoMetadata.video.poster+")",!h.videoMetadata.hidetitle){var s=document.createElement("div"),a=i.querySelector(".poster");s.className="title",s.innerHTML="&lt;span&gt;"+h.videoMetadata.title+"&lt;/span&gt;",i.querySelector(".pre-poster").parentNode.insertBefore(s,i.querySelector(".pre-poster")),a&amp;&amp;a.parentNode.insertBefore(s.cloneNode(!0),a)}return v.playerPreface=i,v.pearlLargePlay=i.querySelector(".pearl-large-play"),window.onresize=function(){if(T.offsetWidth&lt;500||T.offsetHeight&lt;350){if(!Helper.hasClass(v.pearlLargePlay,"small"))return void Helper.addClass(v.pearlLargePlay,"small")}else if(Helper.hasClass(v.pearlLargePlay,"small"))return void Helper.removeClass(v.pearlLargePlay,"small")},p.videoready.push(function(){h.play()}),v.playerPreface.querySelector(".pre-poster").addEventListener("click",e,!1),void v.playerPreface.querySelector(".play-large-holder").addEventListener("click",e,!1)}M()},R=function(){if(v.playerPreface.parentNode.removeChild(v.playerPreface),M(),self.location==top.location)var e=document.getElementById("html5-"+b.playerID),t=setInterval(function(){4===e.readyState&amp;&amp;(h.play(),clearInterval(t))},50);y.playerState.videoState.holdingForUserInteraction=!1},V=function(){if(b.log.push("Constructing component player"),null!==r.data)h.videoMetadata=Helper.merge(PlayerSettings["interface"](),r.data),b.log.push("Building video player"),q(),M();else{var e=b.networking.domain+"/v/"+t+"/?format=json";b.log.push("Making network call to obtain video metadata");var n=window.superagent;n.get(e).end(function(e,t){var n=JSON.parse(t.text);h.videoMetadata=Helper.merge(PlayerSettings["interface"](),n),b.log.push("Building video player"),q(),M()})}},U=function(e){e.addEventListener("videoplayer:canplay",function(e){s_adobe.Media.open(s_adobe.pageName,Math.floor(e.data.duration),"MPC HTML5 Player v1")},!1),e.addEventListener("videoplayer:playing",function(e){s_adobe.Media.play(s_adobe.pageName,Math.floor(e.data.currentTime))},!1),e.addEventListener("videoplayer:pause",function(e){s_adobe.Media.stop(s_adobe.pageName,Math.floor(e.data.currentTime))},!1),e.addEventListener("videoplayer:ended",function(e){s_adobe.Media.close(e.data.title)})},W=function(){return h.html5Player=new VideoPlayer(y,b,h.$el,h.videoMetadata,_),h.html5Player},z=function(){return h.nativePlayer=new NativePlayer(y,b,h.$el,h.videoMetadata,_),h.nativePlayer},X=function(){var e,t,n="10.3.0";if(!swfobject.hasFlashPlayerVersion(n)){var r=document.getElementById(h.$el.getAttribute("id"));0===r.length&amp;&amp;b.exceptions.push("Unable to construct Flash Player Upgrade Message because the host element is not defined");var i=document.createElement("img");i.setAttribute("alt","Click to Download Flash"),i.setAttribute("title","Click to Download Flash"),i.setAttribute("src",h.videoMetadata.asseturl+"/upgrade-box.png");var o=document.createElement("div");return o.className="player-upgrade",o.innerHTML='&lt;div class="upgrade-wrapper"&gt;&lt;h5&gt;Upgrade Adobe Flash Player to Play Video&lt;/h5&gt;&lt;br&gt;&lt;a class="upgrade-clickthrough" href="http://get.adobe.com/flashplayer/" target="_blank"&gt;&lt;/a&gt;&lt;/div&gt;',r.appendChild(o),r.querySelector(".upgrade-clickthrough").appendChild(i),void b.log.push("Required flash version "+n+" not found.")}h.setData();var s=JSON.stringify(b);e={embedded:h.videoMetadata.embedded,volume:h.videoMetadata.volume,noendscreen:h.videoMetadata.noendscreen,quality:h.videoMetadata.quality,autoplay:h.videoMetadata.autoplay,fullscreen:j("fullscreen",!0),skins:h.videoMetadata.skins,screenSkins:h.videoMetadata.screenSkins,loadSC:typeof window.sAdobeLoaded===d?!0:!1,playerState:encodeURIComponent(s),isComponent:_},t={width:"100%",height:"100%",allowfullscreen:!0,allowscriptaccess:"always",wmode:"direct",bgcolor:"#000000"};var a=function(e){b.log.push(e.success?"Successfully created a flash plug-in object on the page":"Could not create flash object on the page")};swfobject.embedSWF(h.videoMetadata.swf,h.$el.getAttribute("id"),"100%","100%",n,"",e,t,{},a),b.log.push("Delegated to SWFObject to launch SWF")},J=function(e){return decodeURI((new RegExp(e+"=(.+?)(&amp;|$)").exec(location.search)||[,null])[1])},Q=function(e){var t=parseInt(J(e));return isNaN(t)?0:t},Z=function(e){if(e=e||navigator.userAgent,e=e.toLowerCase(),"null"!=J("forcetech"))switch(J("forcetech")){case"html5":return"html5";case"flash":return"flash";case"native":case"html":return"html"}if(typeof r.forceTech!==d&amp;&amp;"detect"!=r.forceTech)return r.forceTech;if(Y(e)||G(e))return"html";var t=function(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?(e=/\brv[ :]+(\d+)/g.exec(t)||[],"IE "+(e[1]||"")):"Chrome"===n[1]&amp;&amp;(e=t.match(/\b(OPR|Edge)\/(\d+)/),null!=e)?e.slice(1).join(" ").replace("OPR","Opera"):(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&amp;&amp;n.splice(1,1,e[1]),n.join(" "))}(),n=!!window.opera||navigator.userAgent.indexOf(" OPR/")&gt;=0,i=typeof InstallTrigger!==d,o=t.toLowerCase().indexOf("safari")&gt;=0,s=!!window.chrome&amp;&amp;!n,a="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"11"===Helper.checkIEBrowser().version[0],l="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0],u=function(){var e=!1,t=window.location!=window.parent.location?document.referrer:document.location;return(a||l&amp;&amp;-1!==t.indexOf("adobe.com"))&amp;&amp;(e=!0),e};return o||s||i||n||a||l||u()?(b.log.push("HTML5 tech selected"),"html5"):(b.log.push("Flash tech selected"),"flash")},G=function(e){return e=e||navigator.userAgent,e.match(/Android/i)?!0:!1},Y=function(e){return e=e||navigator.userAgent,null!==e.match(/iP(hone|ad|od)/i)},K=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");return t&gt;0||navigator.userAgent.match(/Trident.*rv\:11\./)?{version:parseInt(e.substring(t+5,e.indexOf(".",t))),isIE:!0}:!1},et=i();if(F(),C){var tt=function(e){var t="string"==typeof e.data?e.data:e.data.eventAlias.toLowerCase();if(!(t.indexOf("destpub-to-parent")&gt;-1)){switch(t){case"releaseuserinteractionhold":R();break;case"play":et.play();break;case"pause":et.pause();break;case"restart":et.restart();break;case"turnoffcaptions":et.turnOffCaptions(e.data.args);break;case"timechange":et.changeTime(e.data.args);break;case"captionchange":et.changeCaption(e.data.args);break;case"volumechange":et.changeVolume(e.data.args);break;case"speedchange":et.changeSpeed(e.data.args);break;case"qualitychange":et.changeQuality(e.data.args);break;case"colorchange":et.changeColor(e.data.args);break;case"onplayerstatebroadcast":case"holdforuserinteraction":case"userinteractionholdreleased":case"videoready":}P(h.getPlayerState(),t)}};l(u,tt,!1),b.log.push(document.domain+" - Registered Embed Page Event Listener")}return et}function PlayerMessenger(e,t){var n="The ID of a valid HTML container for the iFrame must be provided as the only argument (hostContainerID). Please provide the ID of your host container (example: `#videoContainer`). You provided: "+e;if("string"!=typeof e)throw n;if(0===e.length||"#"!=e.charAt(0))throw n;var r=Player("EmbedWindowAPIManager","n/a",e,t);r.playerID=e.slice(1);var i=document.getElementById(r.playerID);if(null==i)throw"The player was unable to find the DOM element for the provided ID `"+r.playerID+"`. Please verify the DOM element exists.";return r}function ChapterMarker(e,t){var n=this,r={content:null,containerEl:".progress-bar",markerOffset:0};this.$el=e,n.settings=Helper.merge(r,t);var i,o=function(){n.$marker=document.createElement("div"),n.$marker.classList.add("marker"),n.$marker.setAttribute("data-time",n.settings.marker),n.$marker.setAttribute("data-title",n.settings.languages[0].title);var e=n.settings.marker/n.settings.duration;n.$marker.style.left="calc("+Math.floor(100*e)+"% - 4px)",n.settings.container.appendChild(n.$marker)},s=function(){i=null!==n.settings.container?n.settings.container:document.body},a=function(){n.ttCaption=new ControlTooltip(n.$marker,{containerEl:n.$el,content:null!==n.settings.content?n.settings.content:""})},l=function(){n.$marker.addEventListener("mouseenter",function(){u()},!1),n.$marker.addEventListener("mouseout",function(){c()},!1)},u=function(){if(c(),$(".tt-duration.show")&amp;&amp;($(".tt-duration").removeClass("show"),$(".tt-duration").addClass("hide")),n.ttCaption&amp;&amp;n.settings.languages&amp;&amp;n.settings.languages.length){n.$currentLanguage="english";var e=n.$el.querySelector(".language-list");if(null!==e){var t=e.querySelector("li.selected a");null!==t&amp;&amp;"turn off"!==t.innerText.trim().toLowerCase()&amp;&amp;(n.$currentLanguage=t.innerText.trim().toLowerCase())}var r=n.settings.languages.filter(function(e){return e.language_display.trim().toLowerCase()===n.$currentLanguage}),i=r.length&amp;&amp;r[0].title&amp;&amp;r[0].title.trim().length?r[0].title.trim():"";i+="&lt;br/&gt;&lt;br/&gt;",i+=StringUtil.formatTime(n.settings.marker),n.ttCaption.changeText(i),i.length?n.ttCaption.show():c()}return this},c=function(){return n.ttCaption&amp;&amp;n.ttCaption.hide(),this};o(),s(),a(),l()}function AdobeBug(e,t){var n=this;this.$el=e,this.options=t;var r=function(){var e=document.createElement("div");e.classList.add("pearl-adobe-bug"),e.classList.add("showing"),e.classList.add(n.options.position),e.innterHTML='&lt;a href="http://adobe.com/" target="_blank"&gt;&lt;/a&gt;',n.options.container.appendChild(e)};this.showing=function(){return Helper.removeClass(n.options.container.querySelector(".pearl-adobe-bug"),"showing"),this},this.animateUp=function(){return("bottomRight"===n.options.position||"bottomLeft"===n.options.position)&amp;&amp;(Helper.addClass(n.options.container.querySelector(".pearl-adobe-bug"),"animate-up"),Helper.removeClass(n.options.container.querySelector(".pearl-adobe-bug"),"animate-down")),this},this.animateDown=function(){return("bottomRight"===n.options.position||"bottomLeft"===n.options.position)&amp;&amp;(Helper.addClass(n.options.container.querySelector(".pearl-adobe-bug"),"animate-down"),Helper.removeClass(n.options.container.querySelector(".pearl-adobe-bug"),"animate-up")),this},r()}function Captions($el,options){var _this=this,isIE10="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0];this.$el=$el,this.options=options;var superagent=window.superagent,render=function(){var e='&lt;svg xmlns="http://www.w3.org/2000/svg" width="22" height="17" viewBox="0 0 22 17"&gt;&lt;title&gt;  Closed CaptionsCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;g fill="#A6A9AB"&gt;&lt;path d="M17.3 5.5C17.3 5.6 17.2 5.6 17.2 5.6 16.8 5.4 16.3 5.3 15.6 5.3 14 5.3 12.9 6.4 12.9 8.1 12.9 10.2 14.4 10.9 15.7 10.9 16.3 10.9 16.7 10.8 17.1 10.7 17.2 10.6 17.2 10.7 17.2 10.7L17.2 11.8C17.2 11.9 17.2 11.9 17.1 11.9 16.7 12.1 16.2 12.2 15.5 12.2 13.3 12.2 11.4 10.9 11.4 8.1 11.4 5.7 13 4 15.7 4 16.4 4 16.9 4.1 17.2 4.2 17.3 4.3 17.3 4.3 17.3 4.4L17.3 5.5ZM9.8 5.5C9.8 5.6 9.7 5.6 9.7 5.6 9.3 5.4 8.7 5.3 8.1 5.3 6.4 5.3 5.3 6.4 5.3 8.1 5.3 10.2 6.9 10.9 8.1 10.9 8.7 10.9 9.2 10.8 9.6 10.7 9.7 10.6 9.7 10.7 9.7 10.7L9.7 11.8C9.7 11.9 9.7 11.9 9.6 11.9 9.2 12.1 8.6 12.2 7.9 12.2 5.7 12.2 3.8 10.9 3.8 8.1 3.8 5.7 5.5 4 8.1 4 8.9 4 9.4 4.1 9.7 4.2 9.7 4.3 9.8 4.3 9.8 4.4L9.8 5.5ZM17.9 0L4 0C1.8 0 0 1.8 0 4L0 12.1C0 14.3 1.8 16.1 4 16.1L17.9 16.1C20.1 16.1 21.9 14.3 21.9 12.1L21.9 4C21.9 1.8 20.1 0 17.9 0L17.9 0Z"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;',t=document.createElement("div");t.className="translation-holder",t.innerHTML='&lt;button class="ui-control ui-btn control-translation" aria-haspopup="true" aria-owns="translation-list" data-title="Turn on Captions" role="button"&gt;'+e+'&lt;/button&gt;&lt;div class="language-list hide"&gt;&lt;span&gt;Captions&lt;/span&gt;&lt;ol class="translation-list" role="listbox" aria-hidden="true"&gt;&lt;/ol&gt;&lt;/div&gt;';var n=document.createElement("div");n.className="caption-holder",n.innerHTML='&lt;div class="caption"&gt;&amp;nbsp;&lt;/div&gt;',_this.options.container.appendChild(n),_this.options.container.appendChild(t)},setupSelectors=function(){_this.$languageListHolder=_this.$el.querySelector(".language-list"),_this.$control=_this.$el.querySelector(".control-translation"),_this.$translationList=_this.$el.querySelector(".translation-list"),_this.$caption=_this.$el.querySelector(".caption"),_this.$captionHolder=_this.$el.querySelector(".caption-holder")},setupDefaults=function(){_this.languages=[],_this.selectedItem=null,_this.arrCaptions=[],_this.captionText="",_this.lastCaption="",_this.languageSelected=!1,renderLanguageList(),isIE10&amp;&amp;Helper.addClass(_this.$languageListHolder,"ie10")},renderLanguageList=function(){for(var e=_this.options.languages.length,t=0;e&gt;t;t++){var n=_this.options.languages[t],r={id:parseInt(t+1,10),label:n.language,language_medium:n.language_medium,endpoint:n.xmlPath};0===t&amp;&amp;_this.$translationList.appendChild(buildOffCaptionListItem()),_this.$translationList.appendChild(buildListItem(r)),_this.languages.push(n)}"null"!=_this.options.maskLanguageList&amp;&amp;maskList(),_this.$languageListHolder.style.top=-_this.$languageListHolder.offsetHeight+"px",_this.$languageListHolder.style.left=-(_this.$languageListHolder.offsetWidth/2)+20+"px",_this.selectedItem=_this.$translationList.children[0],_this.selectedItem.setAttribute("aria-selected","true"),Helper.addClass(_this.selectedItem,"selected")},maskList=function(){_this.$translationList.style.maxHeight=_this.options.maskLanguageList+"px",_this.$translationList.style.overflowY="auto",_this.$translationList.style.overflowX="hidden"},buildListItem=function(e){var t=document.createElement("li");return t.setAttribute("role","option"),t.setAttribute("aria-selected","false"),t.setAttribute("aria-posinset",e.id),t.setAttribute("aria-label",e.label),t.setAttribute("data-language",e.language_medium),t.innerHTML='&lt;a href="#"&gt;'+e.label+"&lt;/a&gt;",t},buildOffCaptionListItem=function(){var e=document.createElement("li");return e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.setAttribute("aria-posinset","0"),e.setAttribute("aria-label","Turn off"),e.innerHTML='&lt;a href="#"&gt;Turn off&lt;/a&gt;',e},addEvents=function(){_this.$control.addEventListener("click",onLanguageClick,!1);for(var e=_this.$translationList.querySelectorAll("li"),t=e.length,n=0;t&gt;n;n++)e[n].addEventListener("click",onLanguageItemClick,!1)},onLanguageItemClick=function(e){e.preventDefault();var t=e.currentTarget;if(null!==_this.selectedItem&amp;&amp;(_this.selectedItem.setAttribute("aria-selected","false"),Helper.removeClass(_this.selectedItem,"selected")),t.setAttribute("aria-selected","true"),Helper.addClass(t,"selected"),_this.selectedItem=t,"undefined"==typeof _this.languages[t.getAttribute("aria-posinset")-1])_this.languageSelected=!1,_this.hideCaptions();else{_this.languageSelected=!0,_this.showCaptions(),_this.changeLanguage(_this.languages[t.getAttribute("aria-posinset")-1].xmlPath);var n={key:t.getAttribute("data-language"),language:t.getAttribute("aria-label")},r=document.createEvent("Event");r.initEvent("control:languageselect",!1,!1),r.data=n,_this.options.container.dispatchEvent(r)}!_this.languageSelected&amp;&amp;_this.options.isNotShare&amp;&amp;_this.options.binder.eventHandler("turnoffcaptions"),_this.hideTranslations(),_this.selectedItem=t},onLanguageClick=function(){if(Helper.hasClass(_this.$languageListHolder,"show"))_this.hideTranslations();else{_this.showTranslations();var e=document.createEvent("Event");e.initEvent("control:languageopen",!1,!1),_this.options.container.dispatchEvent(e)}return!1},convertToSeconds=function(e){var t=e.split(":"),n=60*parseInt(t[0],10)*60,r=60*parseInt(t[1],10),i=Number(t[2]);return n+r+i},is_child_of=function(e,t){if(null!=t)for(;t.parentNode;)if((t=t.parentNode)==e)return!0;return!1},fixOnMouseOut=function(element,event,JavaScript_code){var current_mouse_target=null;event&amp;&amp;(event.toElement?current_mouse_target=event.toElement:event.relatedTarget&amp;&amp;(current_mouse_target=event.relatedTarget),is_child_of(element,current_mouse_target)||element==current_mouse_target||eval(JavaScript_code))},hideFromView=function(e){fixOnMouseOut(this,e,"_this.hideTranslations()")};this.turnOffLanguage=function(){_this.languageSelected=!1,_this.hideCaptions(),_this.selectedItem.setAttribute("aria-selected","false"),Helper.removeClass(_this.selectedItem,"selected"),this.selectedItem=_this.$el.querySelector(".translation-list li:first-child"),this.selectedItem.setAttribute("aria-selected","true"),Helper.addClass(_this.selectedItem,"selected")},this.showCaptions=function(){_this.$captionHolder.style.opacity=1},this.hideCaptions=function(){_this.$captionHolder.style.opacity=0},this.showTranslations=function(){return Helper.addClass(_this.$languageListHolder,"show"),Helper.removeClass(_this.$languageListHolder,"hide"),Helper.addClass(_this.$control,"active"),_this.$translationList.setAttribute("aria-hidden","false"),_this.options.container.querySelector(".translation-holder").addEventListener("mouseout",hideFromView,!1),this},this.hideTranslations=function(){return Helper.addClass(_this.$languageListHolder,"hide"),Helper.removeClass(_this.$languageListHolder,"show"),Helper.removeClass(_this.$control,"active"),_this.$translationList.setAttribute("aria-hidden","true"),_this.options.container.querySelector(".translation-holder").removeEventListener("mouseout",hideFromView),this},this.isOpen=function(){return Helper.hasClass(_this.$languageListHolder,"show")},this.stripTrailingSlash=function(e){return"/"==e.substr(-1)?e.substr(0,e.length-1):e},this.getLanguageByMedium=function(e){for(var t=this,n=t.languages.length,r=0;n&gt;r;r++){var i=t.languages[r];if(e===i.language_medium)return t.languageSelected=!0,t.selectedItem.setAttribute("aria-selected","false"),Helper.removeClass(t.selectedItem,"selected"),t.selectedItem=t.$translationList.children[r+1],t.selectedItem.setAttribute("aria-selected","true"),Helper.addClass(t.selectedItem,"selected"),t.changeLanguage(i.xmlPath).showCaptions(),t.options.playerState.videoState.captions={key:i.language_medium,language:i.language},void(t.options.isNotShare&amp;&amp;t.options.isComponent&amp;&amp;t.options.binder.eventHandler("captionchange"))}return this},this.changeLanguage=function(e){var t=this;t.arrCaptions.length=0;return jQuery.support.cors=!0,$.ajax({url:e,method:"GET",success:function(e){for(var n=e.getElementsByTagName("p"),r=n.length,i=0;r&gt;i;i++){var o=n[i];t.arrCaptions.push({time:convertToSeconds(o.getAttribute("begin")),caption:"undefined"!=typeof o.innerHTML?o.innerHTML:o.textContent,index:i})}},error:function(e,t,n){console.log("!!!!!! ERROR !!!!!"),console.log(t),console.log(n)}}),this},this.isCaptionSelected=function(){return _this.languageSelected},this.getLanguageMediumFromURL=function(){var e=window.location.href,t=_this.stripTrailingSlash(e),n=t.split("/").pop();return _this.getLanguageByMedium(n),this},this.changeCaption=function(e){++e;var t=_this.arrCaptions.length;if(1===t)_this.$caption.innerHTML=_this.arrCaptions[0].caption;else for(var n=0;t&gt;n;n++){var r=_this.arrCaptions[n];if(r.time&gt;=e-1)return _this.arrCaptions[t-1].time&lt;=parseInt(e)&amp;&amp;(_this.$caption.innerHTML=_this.arrCaptions[t-1].caption),0!==n&amp;&amp;(_this.captionText=_this.arrCaptions[n-1].caption,_this.lastCaption!=_this.captionText&amp;&amp;(_this.$caption.innerHTML=_this.captionText)),void(_this.lastCaption=_this.captionText)}},render(),setupSelectors(),setupDefaults(),addEvents()}function Duration(e,t){var n=this;this.$el=e,this.options=t;var r=function(){var e=document.createElement("div");e.classList.add("duration-holder"),e.classList.add("ui-control"),e.innerHTML='&lt;div class="time-holder"&gt;&lt;time class="time"&gt;00:00&lt;/time&gt;&lt;span&gt;&amp;nbsp;/&amp;nbsp;&lt;/span&gt;&lt;time class="duration"&gt;00:00&lt;/time&gt;&lt;/div&gt;',n.options.container.appendChild(e)},i=function(){n.$duration=n.$el.querySelector(".duration-holder .duration"),n.$time=n.$el.querySelector(".duration-holder .time")},o=function(){n.duration=0};this.setDuration=function(e){return this.$duration.innerHTML=StringUtil.formatTime(e),this},this.getDuration=function(){return this.duration},this.updateCurrentTime=function(e){return StringUtil&amp;&amp;(this.$time.innerHTML=StringUtil.formatTime(e)),this
},r(),i(),o()}function GoBack(e,t){{var n=this;"undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0]}this.$el=e,this.options=t;var r=function(){var e='&lt;svg xmlns="http://www.w3.org/2000/svg" width="19" height="18" viewBox="0 0 19 18"&gt;&lt;style&gt;.a{fill:#A6A9AB;}&lt;/style&gt;&lt;title&gt;  Rewind 10secCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;defs&gt;&lt;polygon points="0 0.2 0 7.9 2.8 7.9 2.8 0.2 0 0.2"/&gt;&lt;/defs&gt;&lt;g fill="none"&gt;&lt;g transform="translate(-635 -525)translate(239 494)translate(396 31)"&gt;&lt;g transform="translate(0 9.9181)"&gt;&lt;mask fill="white"&gt;&lt;use xlink:href="#path-1"/&gt;&lt;/mask&gt;&lt;path d="M1.5 7.9C1.4 7.9 1.4 7.9 1.4 7.8L1.4 1.8C1 2 0.4 2.1 0.1 2.2 0 2.2 0 2.2 0 2.1L0 1.1C0 1 0 1 0.1 1 0.6 0.9 1.3 0.6 1.7 0.3 1.8 0.3 1.9 0.2 1.9 0.2L2.7 0.2C2.8 0.2 2.8 0.3 2.8 0.3L2.8 7.8C2.8 7.9 2.8 7.9 2.7 7.9L1.5 7.9Z" mask="url(#mask-2)" class="a"/&gt;&lt;/g&gt;&lt;path d="M5.8 13.9C5.8 15.7 6.3 16.7 7.2 16.7 8.1 16.7 8.5 15.7 8.5 14 8.5 12.1 8.1 11.3 7.2 11.3 6.4 11.3 5.8 12.1 5.8 13.9M4.4 14C4.4 11.8 5.4 10.1 7.2 10.1 9.4 10.1 9.9 12.2 9.9 14 9.9 16 9.2 17.9 7.2 17.9 5.2 17.9 4.4 16.2 4.4 14" class="a"/&gt;&lt;polygon points="2 3.8 5.7 7.6 5.7 0" class="a"/&gt;&lt;path d="M11.7 3L4.9 3 4.9 4.5 11.7 4.5C14.5 4.5 16.8 6.8 16.8 9.6 16.8 11.6 15.6 13.3 13.9 14.1L13.9 15.8C16.5 14.9 18.3 12.4 18.3 9.6 18.3 6 15.3 3 11.7 3" class="a"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;',t=document.createElement("button");t.classList.add("ui-btn"),t.classList.add("go-back"),t.setAttribute("data-title","Go back 10 secs"),t.setAttribute("role","button"),t.innerHTML=e,n.options.container.appendChild(t)},i=function(){n.$goBack=n.$el.querySelector(".go-back")},o=function(){null!==n.$el.querySelector(".go-back")&amp;&amp;n.$el.querySelector(".go-back").addEventListener("click",s,!1)},s=function(){var e=document.createEvent("Event");e.initEvent("control:ongoback",!1,!1),n.options.container.dispatchEvent(e)};r(),i(),o()}function LargePlay(e,t){var n=this;this.$el=e,this.options=t;var r=function(){var e=n.options.autoplay?"hide":"show",t=document.createElement("div");t.classList.add("play-large-holder"),t.classList.add(e),t.setAttribute("aria-live","polite"),t.setAttribute("aria-label","Play video");var r,i;n.options.playicon&amp;&amp;"white"===n.options.playicon?(i="large-play.png",r=document.createElement("i"),r.classList.add("icon-play"),r.innerHTML='&lt;img src="'+n.options.asseturl+i+'"&gt;'):(r=document.createElement("img"),r.classList.add("blue"),i="blue-play-button.svg",r.classList.add(n.options.isScreen?"big":"mpc"),r.setAttribute("src",n.options.asseturl+i)),r.classList.add("pearl-large-play"),n.$el.appendChild(t),window.onresize=function(){if(n.$el.offsetWidth&lt;500||n.$el.offsetHeight&lt;350){if(!Helper.hasClass(n.$el.querySelector(".pearl-large-play"),"small"))return Helper.addClass(n.$el.querySelector(".pearl-large-play"),"small"),void(null==n.$el.querySelector(".icon-play")||Helper.hasClass(n.$el.querySelector(".icon-play"),"reg")||Helper.addClass(n.$el.querySelector(".icon-play"),"reg"))}else if(Helper.hasClass(n.$el.querySelector(".pearl-large-play"),"small"))return Helper.removeClass(n.$el.querySelector(".pearl-large-play"),"small"),void(null!=n.$el.querySelector(".icon-play")&amp;&amp;Helper.hasClass(n.$el.querySelector(".icon-play"),"reg")&amp;&amp;Helper.removeClass(n.$el.querySelector(".icon-play"),"reg"))},n.largePlayEl=n.$el.querySelector(".play-large-holder"),"white"===n.options.playicon&amp;&amp;Helper.addClass(n.$el.querySelector(".play-large-holder"),"none"),n.largePlayEl.appendChild(r),n.$el.offsetWidth&lt;500||n.$el.offsetHeight&lt;350?Helper.hasClass(n.$el.querySelector(".pearl-large-play"),"small")||(Helper.addClass(n.$el.querySelector(".pearl-large-play"),"small"),null==n.$el.querySelector(".icon-play")||Helper.hasClass(n.$el.querySelector(".icon-play"),"reg")||Helper.addClass(n.$el.querySelector(".icon-play"),"reg")):Helper.hasClass(n.$el.querySelector(".pearl-large-play"),"small")&amp;&amp;(Helper.removeClass(n.$el.querySelector(".pearl-large-play"),"small"),null!=n.$el.querySelector(".icon-play")&amp;&amp;Helper.hasClass(n.$el.querySelector(".icon-play"),"reg")&amp;&amp;Helper.removeClass(n.$el.querySelector(".icon-play"),"reg"))};this.hide=function(){Helper.removeClass(n.largePlayEl,"show")},this.show=function(){Helper.addClass(n.largePlayEl,"show")},r()}function Loader(e,t){var n=this;this.$el=e,this.options=t;var r=function(){var e=document.createElement("img");e.classList.add("main-loader"),e.classList.add("icon-spin"),e.classList.add("hide"),e.setAttribute("src",n.options.asseturl+"i-spin.png"),n.$el.appendChild(e),n.$loader=n.$el.querySelector(".main-loader")};this.hide=function(){Helper.addClass(n.$loader,"hide")},this.show=function(){Helper.removeClass(n.$loader,"hide")},r()}function PlayPause(e,t){var n=this;this.$el=e,this.options=t;var r=function(){n.iconPause='&lt;svg xmlns="http://www.w3.org/2000/svg" width="9" height="16" viewBox="0 0 9 16"&gt;&lt;title&gt;  PauseCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;g fill="#A6A9AB"&gt;&lt;rect width="3" height="16"/&gt;&lt;rect x="6" width="3" height="16"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;',n.iconPlay='&lt;svg xmlns="http://www.w3.org/2000/svg" width="8" height="16" viewBox="0 0 8 16"&gt;&lt;title&gt;  PlayCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;g fill="#A6A9AB"&gt;&lt;polygon transform="translate(-259 -526)translate(239 494)translate(24 40)scale(-1 1)translate(-24 -40)" points="28 32 28 48 20 40"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;';var e=document.createElement("button");e.classList.add("ui-control"),e.classList.add("ui-btn"),e.classList.add("control-play"),e.setAttribute("data-title","Play"),e.setAttribute("role","button"),e.innerHTML=n.iconPause,n.options.container.appendChild(e)},i=function(){n.$play=n.$el.querySelector(null!==n.$el.querySelector(".control-play")?".control-play":".control-pause")},o=function(){null!==n.$el.querySelector(".control-play")&amp;&amp;n.$el.querySelector(".control-play").addEventListener("click",s,!1),null!==n.$el.querySelector(".control-pause")&amp;&amp;n.$el.querySelector(".control-pause").addEventListener("click",a,!1)},s=function(){n.showPauseState();var e=document.createEvent("Event");e.initEvent("control:onplay",!1,!1),n.options.container.dispatchEvent(e)},a=function(){n.showPlayState();var e=document.createEvent("Event");e.initEvent("control:onpause",!1,!1),n.options.container.dispatchEvent(e)};this.showPlayState=function(){return null!==n.$el.querySelector(".control-pause")&amp;&amp;n.$el.querySelector(".control-pause").removeEventListener("click",a),Helper.removeClass(n.$play,"control-pause"),Helper.addClass(n.$play,"control-play"),n.$play.innerHTML=n.iconPlay,n.$el.querySelector(".control-play").addEventListener("click",s,!1),this},this.showPauseState=function(){return null!==n.$el.querySelector(".control-play")&amp;&amp;n.$el.querySelector(".control-play").removeEventListener("click",s),Helper.removeClass(n.$play,"control-play"),Helper.addClass(n.$play,"control-pause"),n.$play.innerHTML=n.iconPause,n.$el.querySelector(".control-pause").addEventListener("click",a,!1),this},r(),i(),o()}function Poster(e,t){var n=this,r="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0];this.$el=e,this.options=t;var i=function(){var e=document.createElement("div");if(e.classList.add("html5-video-poster"),n.options.container.appendChild(e),!n.options.hideTitle){var t=n.options.container.querySelector(".html5-video-poster"),i=document.createElement("div");i.className="title",i.innerHTML="&lt;span&gt;"+n.options.title+"&lt;/span&gt;",t.appendChild(i)}n.posterEl=n.options.container.querySelector(".html5-video-poster"),o(),r&amp;&amp;Helper.addClass(n.options.container.querySelector(".html5-video-poster"),"ie10")},o=function(){n.poster=n.$el.getAttribute("poster"),n.$el.removeAttribute("poster");var e=document.createElement("div");e.className="back-poster",n.posterEl.appendChild(e),n.posterEl.addEventListener("click",function(){var e=document.createEvent("Event");e.initEvent("control:posterclick",!1,!1),n.options.container.dispatchEvent(e)},!1),n.posterEl.querySelector(".back-poster").style.backgroundImage="url("+n.poster+")"};this.hide=function(){return Helper.addClass(n.posterEl,"fadeout"),this},this.show=function(){return Helper.removeClass(n.posterEl,"hide"),Helper.removeClass(n.posterEl,"fadeout"),this},this.isVisible=function(){return Helper.hasClass(n.posterEl,"fadeout")||Helper.hasClass(n.posterEl,"hide")?!1:!0},i()}function Progress($el,options){var _this=this,isIE10="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0];this.$el=$el,this.options=options;var render=function(){var e=document.createElement("div");e.classList.add("progressbar-holder"),e.classList.add("translate-anim"),e.innerHTML='&lt;div class="slider-holder"&gt;&lt;div class="progress-bar" role="progressbar"&gt;&lt;/div&gt;&lt;div class="level" role="slider"&gt;&lt;/div&gt;&lt;span class="level-indicator hide"&gt;&lt;/span&gt;&lt;div class="tt-duration hide"&gt;&lt;div class="tt-duration-cone"&gt;&lt;/div&gt;&lt;time&gt;'+StringUtil.formatTime(_this.options.t)+"&lt;/time&gt;&lt;/div&gt;&lt;/div&gt;",_this.options.container.appendChild(e),isIE10&amp;&amp;Helper.addClass(_this.$el.querySelector(".tt-duration"),"ie10")},setupSelectors=function(){_this.$progressBar=_this.$el.querySelector(".progress-bar"),_this.$sliderHolder=_this.$el.querySelector(".slider-holder"),_this.$level=_this.$el.querySelector(".level"),_this.$levelIndicator=_this.$el.querySelector(".level-indicator"),_this.$ttDuration=_this.$el.querySelector(".tt-duration"),_this.$ttDurationCone=_this.$el.querySelector(".tt-duration-cone"),_this.$tooltipTxt=_this.$ttDuration.querySelector("time"),_this.$document=document},setupDefaults=function(){_this.ttWidth=_this.$ttDuration.offsetWidth,_this.levelOffset=_this.$levelIndicator.getBoundingClientRect().width/2,_this.ttOffset=_this.ttWidth/2,_this.ttConeOffset=_this.$ttDurationCone.offsetWidth/2,_this.duration=0},addEvents=function(){_this.$sliderHolder.addEventListener("mouseenter",onProgressOver,!1),_this.$sliderHolder.addEventListener("mouseout",onProgressOut,!1)},onProgressOver=function(){Helper.addClass(_this.$levelIndicator,"show"),Helper.removeClass(_this.$levelIndicator,"hide"),Helper.addClass(_this.$ttDuration,"show"),Helper.removeClass(_this.$ttDuration,"hide"),_this.$document.addEventListener("mousemove",onProgressMouseMove,!1)},is_child_of=function(e,t){if(null!=t)for(;t.parentNode;)if((t=t.parentNode)==e)return!0;return!1},fixOnMouseOut=function(element,event,JavaScript_code){var current_mouse_target=null;event&amp;&amp;(event.toElement?current_mouse_target=event.toElement:event.relatedTarget&amp;&amp;(current_mouse_target=event.relatedTarget),is_child_of(element,current_mouse_target)||element==current_mouse_target||eval(JavaScript_code))},onProgressOut=function(e){fixOnMouseOut(this,e,"progOut()")},progOut=function(){Helper.addClass(_this.$levelIndicator,"hide"),Helper.removeClass(_this.$levelIndicator,"show"),Helper.addClass(_this.$ttDuration,"hide"),Helper.removeClass(_this.$ttDuration,"show"),_this.$document.removeEventListener("mousemove",onProgressMouseMove)},onProgressMouseMove=function(e){var t,n,r=_this.$el.clientWidth,i=e.pageX-_this.$el.getBoundingClientRect().left-20,o=i/_this.$sliderHolder.clientWidth,s=_this.duration*o;i&lt;=_this.ttOffset?(t=0,n=Math.ceil(i-_this.levelOffset-_this.ttConeOffset+1)):(t=i-_this.ttOffset,n=_this.ttOffset-_this.ttConeOffset),i&gt;=r-_this.ttOffset&amp;&amp;(t=r-_this.$ttDuration.clientWidth,n=Math.ceil(i-r+_this.ttWidth-_this.ttConeOffset)),_this.$ttDuration.style.left=t+"px",_this.$ttDurationCone.style.left=n+"px",updateProgressTooltip(s),_this.$levelIndicator.style.left=i-_this.levelOffset+"px"},updateProgressTooltip=function(e){_this.$tooltipTxt.innerHTML=StringUtil.formatTime(e)},setupSlider=function(){var e=_this.$el.querySelector(".progressbar-holder");_this.slider=Slider(e,{}),e.addEventListener("slider:update",function(e){var t=document.createEvent("Event");t.initEvent("control:sliderupdate",!1,!1),t.data=e.data,t.action=e.action,_this.options.container.dispatchEvent(t)},!1)};this.setDuration=function(e){return _this.duration=e,this},this.getDuration=function(){return _this.duration},this.updateProgressBar=function(e){_this.$progressBar.style.width=e+"%",_this.$progressBar.setAttribute("aria-valuenow",e)},this.updateDurationBar=function(e){_this.slider.updateAttributes(e),_this.$level.style.width=e+"%"},render(),setupSelectors(),setupDefaults(),setupSlider(),addEvents()}function Screen(e,t){var n=this;this.$el=e,this.options=t;var r=function(){n.svgImageContract='&lt;svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"&gt;&lt;title&gt;  Full Screen ContractCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;g fill="#A6A8AB"&gt;&lt;path d="M11 5.5L11 7 18 7 18 5 13 5 13 0 11 0 11 5.5ZM12.5 11L11.1 11 11.1 18 13.1 18 13.1 13 18 13 18 11 12.5 11ZM7 12.5L7 11 0 11 0 13 5 13 5 18 7 18 7 12.5ZM5.6 7L7.1 7 7.1 0 5.1 0 5.1 5 0.1 5 0.1 7 5.6 7Z"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;',n.svgImageExpand='&lt;svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"&gt;&lt;title&gt;  Full Screen ExpandCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;g fill="#A6A8AB"&gt;&lt;path d="M18 1.5L18 0 11 0 11 2 16 2 16 7 18 7 18 1.5ZM16.5 18L18 18 18 11 16 11 16 16 11 16 11 18 16.5 18ZM0 16.5L0 18 7 18 7 16 2 16 2 11 0 11 0 16.5ZM1.5 0L0 0 0 7 2 7 2 2 7 2 7 0 1.5 0Z"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;';var e=document.createElement("button");e.classList.add("ui-control"),e.classList.add("ui-btn"),e.classList.add("control-fullscreen"),e.classList.add("control-screen"),e.setAttribute("data-title","Full screen"),e.setAttribute("role","button"),e.innerHTML=n.svgImageExpand,n.options.container.appendChild(e)},i=function(){n.$controlScreen=n.$el.querySelector(".control-screen")},o=function(){n.$controlScreen.addEventListener("click",s,!1)},s=function(e){e.preventDefault();var t=Helper.hasClass(n.$controlScreen,"control-fullscreen");t?n.showNormalState():n.showFullscreenState();var r=document.createEvent("Event");return r.initEvent("control:onfullscreen",!1,!1),r.data=t,n.options.container.dispatchEvent(r),!1};this.setTabIndex=function(){n.options.container.querySelector(".control-fullscreen").setAttribute("tabindex",VideoPlayer.index)},this.showNormalState=function(){return Helper.removeClass(n.$controlScreen,"control-fullscreen"),Helper.addClass(n.$controlScreen,"control-normal"),n.$controlScreen.innerHTML=n.svgImageContract,this},this.showFullscreenState=function(){return Helper.removeClass(n.$controlScreen,"control-normal"),Helper.addClass(n.$controlScreen,"control-fullscreen"),n.$controlScreen.innerHTML=n.svgImageExpand,this},r(),i(),o()}function Settings($el,options){var _this=this,undefined="undefined",isIE10="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0];this.$el=$el,this.options=options,this.tabbing=!1;var render=function(){_this.cog='&lt;svg xmlns="http://www.w3.org/2000/svg" width="20" height="19" viewBox="0 0 20 19"&gt;&lt;title&gt;  SettingsCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;g fill="#BBBDBF"&gt;&lt;path d="M5.4 9.2C5.4 6.7 7.4 4.7 9.9 4.7 12.5 4.7 14.5 6.7 14.5 9.2 14.5 11.7 12.5 13.8 9.9 13.8 7.4 13.8 5.4 11.7 5.4 9.2L5.4 9.2ZM19.4 11L19.4 7.4 16.2 7.4C15.9 6.4 15.4 5.5 14.7 4.7L16.4 1.8 13.3 0 11.6 2.9C11.1 2.7 10.5 2.7 9.9 2.7 9.5 2.7 9 2.7 8.6 2.8L7.1 0 3.9 1.8 5.4 4.5C4.6 5.3 4 6.3 3.7 7.4L0.4 7.4 0.4 11 3.7 11C4 12.1 4.5 13 5.3 13.8L3.8 16.5 6.9 18.3 8.5 15.6C9 15.7 9.4 15.8 9.9 15.8 10.5 15.8 11 15.7 11.5 15.6L13.2 18.4 16.3 16.7 14.7 13.7C15.4 13 15.9 12 16.2 11L19.4 11Z"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;',_this.hdCog='&lt;svg xmlns="http://www.w3.org/2000/svg" width="17" height="10" viewBox="0 0 17 10"&gt;&lt;style&gt;.a{fill:#FEFEFE;}&lt;/style&gt;&lt;title&gt;  HDCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;path d="M14.9 10L2.1 10C0.9 10 0 9.1 0 8L0 2C0 0.9 0.9 0 2.1 0L14.9 0C16.1 0 17 0.9 17 2L17 8C17 9.1 16.1 10 14.9 10" fill="#ED1F24"/&gt;&lt;path d="M6.6 8.2C6.5 8.2 6.5 8.1 6.5 8.1L6.5 5.3 3.7 5.3 3.7 8.1C3.7 8.1 3.7 8.2 3.6 8.2L2.6 8.2C2.5 8.2 2.5 8.1 2.5 8.1L2.5 1.7C2.5 1.6 2.5 1.6 2.6 1.6L3.6 1.6C3.7 1.6 3.7 1.6 3.7 1.7L3.7 4.2 6.5 4.2 6.5 1.7C6.5 1.6 6.5 1.6 6.6 1.6L7.7 1.6C7.7 1.6 7.7 1.6 7.7 1.7L7.7 8.1C7.7 8.1 7.7 8.2 7.6 8.2L6.6 8.2Z" class="a"/&gt;&lt;path d="M10.4 7.1C10.6 7.1 10.8 7.1 11.1 7.1 12.5 7.1 13.5 6.3 13.5 4.8 13.5 3.3 12.5 2.6 11.2 2.6 10.9 2.6 10.7 2.6 10.4 2.6L10.4 7.1ZM9.2 1.7C9.2 1.6 9.2 1.6 9.3 1.6 9.6 1.6 10.2 1.6 11.2 1.6 13.5 1.6 14.7 2.9 14.7 4.8 14.7 7.2 12.8 8.2 11.1 8.2 10.5 8.2 9.6 8.2 9.3 8.2 9.2 8.2 9.2 8.1 9.2 8.1L9.2 1.7Z" class="a"/&gt;&lt;/g&gt;&lt;/svg&gt;';var e=document.createElement("div");e.className="settings-holder",e.innerHTML='&lt;button tabindex="3" class="ui-control ui-btn control-settings" aria-haspopup="true" aria-owns="quality-list" data-title="Settings" role="button"&gt;&lt;span class="i-cog"&gt;'+_this.cog+'&lt;/span&gt;&lt;span class="i-hd"&gt;'+_this.hdCog+'&lt;/span&gt;&lt;/button&gt;&lt;div class="settings-list-holder hide"&gt;&lt;span&gt;Quality&lt;/span&gt;&lt;ol class="quality-list" role="listbox" aria-hidden="true"&gt;&lt;/ol&gt;&lt;/div&gt;',_this.options.container.appendChild(e)},setupSelectors=function(){_this.$settingsListHolder=_this.$el.querySelector(".settings-list-holder"),_this.$control=_this.$el.querySelector(".control-settings"),_this.$hdIcon=_this.$el.querySelector(".i-hd"),_this.$qualityList=_this.$el.querySelector(".quality-list")},setupDefaults=function(){_this.videos=[],_this.selectedItem=null,renderQualityList(),isIE10&amp;&amp;Helper.addClass(_this.$settingsListHolder,"ie10")},renderQualityList=function(){for(var e=null,t=_this.options.sources.length,n=0;t&gt;n;n++){var r=_this.options.sources[n],i={id:parseInt(n,10),bitrate:r.bitrate,label:r.label,hd:r.hd,active:r.active,labelid:r.labelid};_this.$qualityList.appendChild(buildListItem(i)),_this.videos.push(r)}if(typeof _this.options.quality!==undefined&amp;&amp;""!==_this.options.quality)for(var o=_this.videos.length,s=0;o&gt;s;s++){var a=_this.videos[s];a.labelid===_this.options.quality&amp;&amp;(_this.selectedItem=_this.$qualityList.children[s],typeof a.hd!==undefined&amp;&amp;a.hd&amp;&amp;Helper.addClass(_this.$hdIcon,"show"),e=a)}else e=getDefaultVideo();null===e&amp;&amp;(e=getDefaultVideo()),_this.$settingsListHolder.style.top=-_this.$settingsListHolder.offsetHeight+"px",_this.$settingsListHolder.style.left=isIE10?-(_this.$settingsListHolder.offsetWidth/2)-10+"px":-(_this.$settingsListHolder.offsetWidth/2)+20+"px";var l=document.createEvent("Event");l.initEvent("control:ondefaultquality",!1,!1),l.data=e,_this.options.container.dispatchEvent(l),_this.selectedItem.setAttribute("aria-selected","true"),Helper.addClass(_this.selectedItem,"selected")},buildListItem=function(e){var t=document.createElement("li");return t.setAttribute("role","option"),t.setAttribute("aria-selected","false"),t.setAttribute("aria-posinset",e.id),t.setAttribute("aria-label",e.label),t.setAttribute("aria-labelid",e.labelid),t.innerHTML='&lt;a href="#"&gt;'+e.label+"&lt;/a&gt;",t},getDefaultVideo=function(){for(var e={},t=_this.videos.length,n=0;t&gt;n;n++){var r=_this.videos[n];5===r.labelid&amp;&amp;(_this.selectedItem=_this.$qualityList.children[n],typeof r.hd!==undefined&amp;&amp;r.hd&amp;&amp;Helper.addClass(_this.$hdIcon,"show"),e=r)}return e},addEvents=function(){_this.$control.addEventListener("click",onSettingsClick,!1);for(var e=_this.$qualityList.querySelectorAll("li"),t=e.length,n=0;t&gt;n;n++)e[n].addEventListener("click",onQualityItemClick,!1)},onSettingsClick=function(){if(Helper.hasClass(_this.$settingsListHolder,"show"))_this.hide();else{_this.show();var e=document.createEvent("Event");e.initEvent("control:onsettingsopen",!1,!1),_this.options.container.dispatchEvent(e)}return!1},onQualityItemClick=function(e){e.preventDefault();var t=e.currentTarget;null!==_this.selectedItem&amp;&amp;(_this.selectedItem.setAttribute("aria-selected","false"),Helper.removeClass(_this.selectedItem,"selected")),t.setAttribute("aria-selected","true"),Helper.addClass(t,"selected");var n=_this.videos[t.getAttribute("aria-posinset")];typeof n.hd!==undefined&amp;&amp;n.hd?Helper.addClass(_this.$hdIcon,"show"):Helper.removeClass(_this.$hdIcon,"show");var r=document.createEvent("Event");r.initEvent("control:onchangequality",!1,!1),r.data=n,_this.options.container.dispatchEvent(r),_this.selectedItem=t,_this.options.isNotShare&amp;&amp;!_this.options.isComponent&amp;&amp;_this.options.binder.eventHandler("qualitychange"),_this.hide()};this.setQuality=function(e){var t=this.$el.querySelector('[aria-labelid="'+e.replace(/['"]+/g,"")+'"]');null!==_this.selectedItem&amp;&amp;(_this.selectedItem.setAttribute("aria-selected","false"),Helper.removeClass(_this.selectedItem,"selected")),t.setAttribute("aria-selected","true"),Helper.addClass(t,"selected");var n=_this.videos[t.getAttribute("aria-posinset")];typeof n.hd!==undefined&amp;&amp;n.hd?Helper.addClass(_this.$hdIcon,"show"):Helper.removeClass(_this.$hdIcon,"show");var r=document.createEvent("Event");r.initEvent("control:onchangequality",!1,!1),r.data=n,_this.options.container.dispatchEvent(r),_this.selectedItem=t};var is_child_of=function(e,t){if(null!=t)for(;t.parentNode;)if((t=t.parentNode)==e)return!0;return!1},fixOnMouseOut=function(element,event,JavaScript_code){var current_mouse_target=null;event&amp;&amp;(event.toElement?current_mouse_target=event.toElement:event.relatedTarget&amp;&amp;(current_mouse_target=event.relatedTarget),is_child_of(element,current_mouse_target)||element==current_mouse_target||eval(JavaScript_code))};this.show=function(){return Helper.removeClass(_this.$settingsListHolder,"hide"),Helper.addClass(_this.$settingsListHolder,"show"),Helper.addClass(_this.$control,"active"),_this.$qualityList.setAttribute("aria-hidden","false"),_this.options.container.querySelector(".settings-holder").addEventListener("mouseout",hideFromView,!1),this};var hideFromView=function(e){fixOnMouseOut(this,e,"_this.hide()")};this.hide=function(){return Helper.addClass(_this.$settingsListHolder,"hide"),Helper.removeClass(_this.$settingsListHolder,"show"),Helper.removeClass(_this.$control,"active"),_this.$qualityList.setAttribute("aria-hidden","true"),_this.options.container.querySelector(".settings-holder").removeEventListener("mouseout",hideFromView),this},this.isOpen=function(){return Helper.hasClass(_this.$settingsListHolder,"show")},render(),setupSelectors(),setupDefaults(),addEvents()}function SpeedControl($el,options){var _this=this,isIE10="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0];this.$el=$el,this.options=options;var render=function(){var e=document.createElement("div");e.className="speed-control-holder",e.innerHTML='&lt;button class="ui-control ui-btn control-speed" aria-haspopup="true" aria-owns="speeds-list" data-title="Change speed" role="button"&gt;&lt;span class="speed"&gt;1x&lt;/span&gt;&lt;/button&gt;&lt;div class="speed-control-list-holder hide"&gt;&lt;span class="speeds-header"&gt;Speed control&lt;/span&gt;&lt;ol class="speeds-list" role="listbox" aria-hidden="true"&gt;&lt;/ol&gt;&lt;/div&gt;',_this.options.container.appendChild(e)},setupSelectors=function(){_this.$speedControlListHolder=_this.$el.querySelector(".speed-control-list-holder"),_this.$speedControlHolder=_this.$el.querySelector(".speed-control-holder"),_this.$control=_this.$el.querySelector(".control-speed"),_this.$speedsList=_this.$el.querySelector(".speeds-list"),_this.$speedLabel=_this.$el.querySelector(".control-speed .speed")},setupDefaults=function(){_this.selectedItem="1x",_this.speeds=["0.5x","0.75x","1x","1.25x","1.5x","1.75x","2x"],renderSpeedControlList(),isIE10&amp;&amp;Helper.addClass(_this.$speedControlListHolder,"ie10")},renderSpeedControlList=function(){for(var e=_this.speeds.length,t=0;e&gt;t;t++){var n=_this.speeds[t],r={id:parseInt(t+1,10),label:n.toString(),multiplier:parseFloat(n.toString())};_this.$speedsList.appendChild(buildListItem(r))}_this.$speedControlListHolder.style.top=-_this.$speedControlListHolder.offsetHeight+"px",_this.$speedControlListHolder.style.left=isIE10?-(_this.$speedControlListHolder.offsetWidth/2)-10+"px":-(_this.$speedControlListHolder.offsetWidth/2)+20+"px",_this.selectedItem=_this.$speedsList.children[2],_this.selectedItem.setAttribute("aria-selected","true"),Helper.addClass(_this.selectedItem,"selected")},buildListItem=function(e){var t=document.createElement("li");return t.setAttribute("role","option"),t.setAttribute("aria-selected","false"),t.setAttribute("aria-posinset",e.id),t.setAttribute("aria-label",e.label),t.setAttribute("aria-multiplier",e.multiplier),t.innerHTML='&lt;span class="speed-item"&gt;'+e.label+"&lt;/span&gt;",t},addEvents=function(){_this.$speedControlHolder.addEventListener("click",onSpeedClick,!1);for(var e=_this.$speedsList.querySelectorAll("li"),t=e.length,n=0;t&gt;n;n++)e[n].addEventListener("click",onSpeedItemClick,!1)},onSpeedItemClick=function(e){e.preventDefault();var t=e.currentTarget;if(null!==_this.selectedItem&amp;&amp;(_this.selectedItem.setAttribute("aria-selected","false"),Helper.removeClass(_this.selectedItem,"selected")),t.setAttribute("aria-selected","true"),Helper.addClass(t,"selected"),_this.selectedItem=t,"undefined"==typeof _this.speeds[t.getAttribute("aria-posinset")-1])console.log("there was an error while attempting to change speeds");else{_this.changeSpeed(t.getAttribute("aria-label"));var n=t.getAttribute("aria-label");n.length&gt;2?Helper.hasClass(_this.$control,"wider")||(Helper.addClass(_this.$control,"wider"),_this.$speedControlListHolder.style.left=-(_this.$speedControlListHolder.offsetWidth/2)+30+"px"):Helper.hasClass(_this.$control,"wider")&amp;&amp;(Helper.removeClass(_this.$control,"wider"),_this.$speedControlListHolder.style.left=-(_this.$speedControlListHolder.offsetWidth/2)+20+"px"),_this.$speedLabel.innerHTML=n;var r=document.createEvent("Event");r.initEvent("control:onchangespeed",!1,!1),r.data=n,_this.options.container.dispatchEvent(r)}_this.selectedItem=t,_this.options.isNotShare&amp;&amp;!_this.options.isComponent&amp;&amp;_this.options.binder.eventHandler("speedchange"),_this.hideSpeeds()},onSpeedClick=function(){if(Helper.hasClass(_this.$speedControlListHolder,"show"))_this.hideSpeeds();else{_this.showSpeeds();var e=document.createEvent("Event");e.initEvent("control:onspeedsopen",!1,!1),_this.options.container.dispatchEvent(e)}return!1},is_child_of=function(e,t){if(null!=t)for(;t.parentNode;)if((t=t.parentNode)==e)return!0;return!1},fixOnMouseOut=function(element,event,JavaScript_code){var current_mouse_target=null;event&amp;&amp;(event.toElement?current_mouse_target=event.toElement:event.relatedTarget&amp;&amp;(current_mouse_target=event.relatedTarget),is_child_of(element,current_mouse_target)||element==current_mouse_target||eval(JavaScript_code))};this.showSpeeds=function(){return Helper.removeClass(_this.$speedControlListHolder,"hide"),Helper.addClass(_this.$speedControlListHolder,"show"),Helper.addClass(_this.$control,"active"),_this.$speedsList.setAttribute("aria-hidden","false"),_this.options.container.querySelector(".speed-control-holder").addEventListener("mouseout",hideFromView,!1),this};var hideFromView=function(e){fixOnMouseOut(this,e,"_this.hideSpeeds()")};this.hideSpeeds=function(){return Helper.addClass(_this.$speedControlListHolder,"hide"),Helper.removeClass(_this.$speedControlListHolder,"show"),Helper.removeClass(_this.$control,"active"),_this.$speedsList.setAttribute("aria-hidden","true"),_this.options.container.querySelector(".speed-control-holder").removeEventListener("mouseout",hideFromView),this},this.isOpen=function(){return Helper.hasClass(_this.$speedControlListHolder,"show")},this.changeSpeed=function(e){var t=this.$el.querySelector('[aria-label="'+e.replace(/['"]+/g,"")+'"]');null!==_this.selectedItem&amp;&amp;(_this.selectedItem.setAttribute("aria-selected","false"),Helper.removeClass(_this.selectedItem,"selected")),t.setAttribute("aria-selected","true"),Helper.addClass(t,"selected"),_this.playbackRate=e},render(),setupSelectors(),setupDefaults(),addEvents()}function Tooltip(e,t){var n=this;this.$el=e,this.options=t;var r=function(){var e=document.createElement("div");e.className="tt",e.setAttribute("role","tooltip"),e.innerHTML='&lt;div class="tt-arrow"&gt;&lt;/div&gt;&lt;div class="tt-content" aria-label="tooltip"&gt;&lt;/div&gt;',n.$el.appendChild(e)};r()}function Volume($el,options){function outputUpdate(e){_this.$el.querySelector("#volume").value=e}function showValue(e,t){var n=e/(_this.$slider.max-_this.$slider.min),r=8,i=100,o=8,s=i-r,a=8,l=0,u=0,c=t?(1-n)*s:n*s;_this.$fill.style.top=(t?c+r/2:l+u)+4+"px",_this.$fill.style.height=n?(t?i-l-a-c:a)+"px":0,_this.$shell.style.height=(t?i:o)+"px",_this.$track.style.height=(t?i:a)+"px",_this.$track.style.top=(t?0:l+u)+"px",0&gt;=n?_this.$thumb.style.height=0:(_this.$thumb.style.top=(t?c:0)+(100==e?0:4)+"px",_this.$thumb.style.height="8px")}function setVolume(e,t){_this.$el.querySelector("#slider").value=e,showValue(e,t),_this.options.volume=e}var _this=this;this.$el=$el,this.options=options;var isIE10="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0],render=function(){_this.iconVolumeOn='&lt;svg xmlns="http://www.w3.org/2000/svg" width="19" height="15" viewBox="0 0 19 15"&gt;&lt;style&gt;.a{fill:#BBBDBF;}&lt;/style&gt;&lt;title&gt;  Sound OnCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;g fill="none"&gt;&lt;path d="M8.5 0.2L4.3 4.6 3.2 4.6C1.6 4.6 0.4 5.9 0.4 7.4 0.4 8.9 1.6 10.2 3.2 10.2L4.3 10.2 8.5 14.6 8.5 0.2Z" fill="#A6A9AB"/&gt;&lt;path d="M14.3 0L14.3 1.2C16.5 2.5 17.8 4.8 17.8 7.4 17.8 10 16.5 12.3 14.3 13.6L14.3 14.8C17.1 13.3 18.8 10.5 18.8 7.4 18.8 4.3 17.1 1.4 14.3 0" class="a"/&gt;&lt;path d="M11.7 4L11.7 5C12.7 5.6 13 6.4 13 7.4 13.1 8.3 12.7 9.2 11.7 9.8L11.7 10.8C12.9 10.1 13.7 8.8 13.7 7.4 13.7 6 12.9 4.7 11.7 4" class="a"/&gt;&lt;/g&gt;&lt;/svg&gt;',_this.iconVolumeOff='&lt;svg xmlns="http://www.w3.org/2000/svg" width="19" height="15" viewBox="0 0 19 15"&gt;&lt;style&gt;.a{fill:white;}.b{fill:#D8D8D8;stroke-width:2;stroke:#979797;}&lt;/style&gt;&lt;title&gt;  Sound OffCntrl&lt;/title&gt;&lt;desc&gt;  Created with Sketch.&lt;/desc&gt;&lt;defs&gt;&lt;rect x="14.2" y="3.1" width="1" height="9"/&gt;&lt;mask maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" width="1" height="9" class="a"&gt;&lt;use xlink:href="#path-1"/&gt;&lt;/mask&gt;&lt;rect x="14.2" y="3.1" width="1" height="9"/&gt;&lt;mask maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" width="1" height="9" class="a"&gt;&lt;use xlink:href="#path-3"/&gt;&lt;/mask&gt;&lt;/defs&gt;&lt;g fill="none"&gt;&lt;g transform="translate(-761 -527)translate(239 494)translate(522.38696 33)"&gt;&lt;path d="M8.1 0.2L3.9 4.6 2.8 4.6C1.2 4.6 0 5.9 0 7.4 0 8.9 1.2 10.2 2.8 10.2L3.9 10.2 8.1 14.6 8.1 0.2Z" fill="#A6A9AB"/&gt;&lt;use mask="url(#mask-2)" transform="translate(14.709234 7.596194)rotate(-45)translate(-14.709234 -7.596194)" xlink:href="#path-1" class="b"/&gt;&lt;use mask="url(#mask-4)" transform="translate(14.709234 7.596194)rotate(-315)translate(-14.709234 -7.596194)" xlink:href="#path-3" class="b"/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;';var e=document.createElement("div");e.className="volume-holder",e.innerHTML='&lt;button tabindex="2" class="ui-control ui-btn control-volume" data-title="Mute" role="button"&gt;'+_this.iconVolumeOn+'&lt;/button&gt;&lt;div class="volume-bar-holder hide"&gt;&lt;div class="slider-holder"&gt;&lt;div class="volume-header"&gt;Volume&lt;/div&gt;&lt;div class="slidershell" id="slidershell" aria-hidden="true"&gt;&lt;div class="sliderfill" id="sliderfill"&gt;&lt;/div&gt;&lt;div class="slidertrack" id="slidertrack"&gt;&lt;/div&gt;&lt;div class="sliderthumb" id="sliderthumb"&gt;&lt;/div&gt;&lt;input class="slidervertical" id="slider" type="range" min="0" max="100" value="0" orient="vertical" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',_this.options.container.appendChild(e)},setupSelectors=function(){_this.$volumeHolder=_this.$el.querySelector(".volume-bar-holder"),_this.$sliderHolder=_this.$el.querySelector(".slider-holder"),_this.$controlVolume=_this.$el.querySelector(".control-volume"),_this.$header=_this.$el.querySelector(".volume-header"),_this.$thumb=_this.$el.querySelector(".sliderthumb"),_this.$shell=_this.$el.querySelector(".slidershell"),_this.$track=_this.$el.querySelector(".slidertrack"),_this.$fill=_this.$el.querySelector(".sliderfill"),_this.$slider=_this.$el.querySelector("#slider")},setupDefaults=function(){_this.isVolumeClicked=!1,setVolume(100*_this.options.volume,!0)},addEvents=function(){_this.$controlVolume.addEventListener("focus",function(){onVolumeOver()},!1),_this.$slider.addEventListener("input",onVolumeUpdate,!1),_this.$slider.addEventListener("change",onVolumeUpdate,!1),_this.$controlVolume.addEventListener("mouseenter",onVolumeOver,!1),_this.$controlVolume.addEventListener("click",onVolumeClick,!1),_this.$el.querySelector(".volume-holder").addEventListener("mouseleave",function(){_this.hide()
},!1)},onVolumeOver=function(){if(Helper.hasClass(_this.$volumeHolder,"show"))_this.hide();else{_this.show();var e=document.createEvent("Event");e.initEvent("control:onvolumeopen",!1,!1),_this.options.container.dispatchEvent(e)}return!1},onVolumeUpdate=function(e){e&amp;&amp;(0===_this.$slider.value?(_this.isVolumeClicked=!0,_this.$controlVolume.innerHTML=_this.iconVolumeOff):(_this.isVolumeClicked=!1,_this.$controlVolume.innerHTML=_this.iconVolumeOn)),e.preventDefault();var t=document.createEvent("Event");t.initEvent("control:volumeupdate",!1,!1),t.data=_this.$slider.value,t.clicked=_this.isVolumeClicked,setVolume(_this.$slider.value,!0),_this.options.container.dispatchEvent(t)},onVolumeClick=function(e){e.preventDefault(),_this.isVolumeClicked?(_this.isVolumeClicked=!1,setVolume(_this.lastValue,!0),_this.$controlVolume.innerHTML=_this.iconVolumeOn):(_this.isVolumeClicked=!0,_this.lastValue=_this.$slider.value,setVolume(0,!0),_this.$controlVolume.innerHTML=_this.iconVolumeOff);var t=document.createEvent("Event");t.initEvent("control:volumeclick",!1,!1),t.data=_this.$slider.value,t.clicked=_this.isVolumeClicked,_this.options.container.dispatchEvent(t)};this.show=function(){return Helper.removeClass(_this.$volumeHolder,"hide"),Helper.addClass(_this.$volumeHolder,"show"),_this.$shell.setAttribute("aria-hidden","false"),_this.options.container.querySelector(".volume-bar-holder").addEventListener("mouseout",hideFromView,!1),this};var is_child_of=function(e,t){if(null!=t)for(;t.parentNode;)if((t=t.parentNode)==e)return!0;return!1},fixOnMouseOut=function(element,event,JavaScript_code){var current_mouse_target=null;event&amp;&amp;(event.toElement?current_mouse_target=event.toElement:event.relatedTarget&amp;&amp;(current_mouse_target=event.relatedTarget),is_child_of(element,current_mouse_target)||element==current_mouse_target||eval(JavaScript_code))},hideFromView=function(e){fixOnMouseOut(this,e,"_this.hide()")};this.hide=function(){return Helper.addClass(_this.$volumeHolder,"hide"),Helper.removeClass(_this.$volumeHolder,"show"),_this.$shell.setAttribute("aria-hidden","true"),_this.options.container.querySelector(".volume-bar-holder").removeEventListener("mouseout",hideFromView),this},this.isOpen=function(){Helper.hasClass(_this.$volumeHolder,"show")},render(),setupSelectors(),setupDefaults(),addEvents()}function Watermark(e,t){var n=this;this.$el=e,this.options=t;var r=function(){var e=document.createElement("img");e.classList.add("watermark"),e.classList.add("translate-anim"),e.setAttribute("src",n.options.watermark),n.options.container.appendChild(e),setTimeout(function(){n.options.container.querySelector(".watermark").style.top=-n.options.container.querySelector(".watermark").offsetHeight},500)};r()}function PlayerSettings(){}function FullscreenUtil(){}function StringUtil(){}function VideoPlayer(binder,playerState,$el,options,isComponent){var undefined="undefined",_this=this,isIE10="undefined"!=typeof Helper.checkIEBrowser().name&amp;&amp;"10"===Helper.checkIEBrowser().version[0];this.$el=$el,this.options=options;for(var isNotShareable=playerState.constructorArguments.hasIframe||"component"===playerState.constructorArguments.mode,isFirefox=typeof InstallTrigger!==undefined,isOpera=!!window.opera||navigator.userAgent.indexOf(" OPR/")&gt;=0,tempSource=this.options.sources,index=tempSource.length-1;index&gt;=0;index--){var sources=tempSource[index],found=sources.src.lastIndexOf(".")+1,ext=found&gt;0?sources.src.substr(found):"";isFirefox||isOpera?"mp4"==ext&amp;&amp;tempSource.splice(index,1):"webm"==ext&amp;&amp;tempSource.splice(index,1)}this.options.sources=tempSource;var superagent=window.superagent,setupDefaults=function(){playerState.videoState.screenState="normal",_this.playing=!1,_this.hasSources=!1,_this.lastTime=0,_this.changedQuality=!1,_this.clickedExpand=!1,_this.complete=!1,_this.isOver=!1,_this.changeFromButton=!1,_this.fireOne=!1,_this.fireTwo=!1,_this.fireThree=!1,_this.fireFour=!1,_this.autoplay=normalizeParam("autoplay"),_this.chrome=normalizeParam("chrome",!0)},normalizeParam=function(e,t){typeof t===undefined?t=!1:"boolean"!=typeof t&amp;&amp;throwError("You must provide a boolean as the default second parameter in normaizeParam()");var n="null"!=getURLParameter(e)?n=getURLParameter(e):t;return"string"==typeof n&amp;&amp;(n="true"===n?!0:!1),n},buildVideoTag=function(){var e=document.createElement("video");e.setAttribute("id","html5-"+_this.$el.getAttribute("id")),typeof _this.options.video.poster!==undefined&amp;&amp;""!==_this.options.video.poster&amp;&amp;_this.options.embedded&amp;&amp;e.setAttribute("poster",_this.options.video.poster),e.setAttribute("allowairplay",_this.options.video.allowairplay),e.setAttribute("src",""),_this.$el.appendChild(e),_this.playerHolder=document.getElementById(_this.$el.getAttribute("id")),_this.videoPlayer=document.getElementById(e.getAttribute("id"))},buildAdobeBug=function(){var e=_this.options.adobebugposition;"null"!=getURLParameter("adobebugposition")&amp;&amp;(e=getURLParameter("adobebugposition")),_this.adobeBug=new AdobeBug(_this.videoPlayer,{container:_this.$el,position:e})},buildPoster=function(){_this.posterControl=new Poster(_this.videoPlayer,{container:_this.$el,title:_this.options.title,hideTitle:_this.options.hidetitle}),_this.$el.addEventListener("control:posterclick",function(){_this.posterControl.hide(),_this.chrome===!0&amp;&amp;_this.largePlayControl.hide(),isIE10||_this.loaderControl.hide(),_this.play(),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("play"),_this.chrome===!0&amp;&amp;onShowControls()},!1),_this.$poster=_this.$el.querySelector(".html5-video-poster")},buildLargePlay=function(){_this.largePlay="null"==getURLParameter("playicon")?_this.options.playicon:getURLParameter("playicon"),_this.largePlayControl=new LargePlay(_this.playerHolder,{autoplay:_this.autoplay,playicon:_this.largePlay,asseturl:_this.options.asseturl,isScreen:Helper.hasClass(_this.$el,"pearl-screen-skin")}),_this.$el.querySelector(".play-large-holder").addEventListener("click",onPlayPauseVideoContainer,!1)},buildControlBarWrapper=function(){_this.controlbar=document.createElement("div"),_this.controlbar.classList.add("controlbar-holder"),_this.controlbar.classList.add("hide"),_this.$el.appendChild(_this.controlbar),_this.$controlBar=_this.$el.querySelector(".controlbar-holder")},buildControlsWrapper=function(){_this.controlsWrapper=document.createElement("div"),_this.controlsWrapper.classList.add("control-holder"),_this.controlsWrapper.classList.add("translate-anim"),_this.controlsWrapper.classList.add("group"),_this.$controlBar.appendChild(_this.controlsWrapper),_this.$controlHolder=_this.$el.querySelector(".control-holder")},buildWatermark=function(){_this.watermarkControl=new Watermark(_this.$el,{container:_this.$controlBar,watermark:_this.options.watermark})},buildPlayPause=function(){_this.playPauseControl=new PlayPause(_this.$el,{container:_this.controlsWrapper,asseturl:_this.options.asseturl}),_this.controlsWrapper.addEventListener("control:onplay",function(){_this.complete&amp;&amp;isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("restart"),_this.play(),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("play")},!1),_this.controlsWrapper.addEventListener("control:onpause",function(){_this.pause(),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("pause")},!1)},buildGoBack=function(){_this.goBackControl=new GoBack(_this.$el,{container:_this.controlsWrapper,asseturl:_this.options.asseturl}),_this.controlsWrapper.addEventListener("control:ongoback",function(){if(!isNaN(_this.videoPlayer.duration)){var e=_this.videoPlayer.currentTime&gt;10?_this.videoPlayer.currentTime-10:0;_this.changeTime(e)}},!1)},buildSpeedControl=function(){_this.options.speeds;_this.controlsWrapper.addEventListener("control:onchangespeed",function(e){_this.videoPlayer.playbackRate=parseFloat(e.data)},!1),_this.controlsWrapper.addEventListener("control:onspeedsopen",function(){_this.settingsControl&amp;&amp;_this.settingsControl.isOpen()&amp;&amp;_this.settingsControl.hide(),_this.captionControl&amp;&amp;_this.captionControl.isOpen()&amp;&amp;_this.captionControl.hideTranslations(),_this.volumeControl&amp;&amp;_this.volumeControl.isOpen()&amp;&amp;_this.volumeControl.hide()},!1),_this.speedControl=new SpeedControl(_this.$el,{container:_this.controlsWrapper,embedded:_this.options.embedded,asseturl:_this.options.asseturl,playerState:playerState,isComponent:isComponent})},buildDuration=function(){_this.durationControl=new Duration(_this.$el,{container:_this.controlsWrapper})},buildChapterMarkers=function(){for(var e=[],t=_this.options.video.markers,n=0;n&lt;t.length;n++)e.push(new ChapterMarker(_this.$el,{container:_this.progressControl.$sliderHolder,asseturl:_this.options.asseturl,marker:t[n].marker,languages:t[n].languages,duration:_this.videoPlayer.duration}));_this.progressControl.chapterMarkers=e},buildFullScreen=function(){_this.screenControl=new Screen(_this.$el,{container:_this.controlsWrapper,asseturl:_this.options.asseturl}),_this.controlsWrapper.addEventListener("control:onfullscreen",function(e){e.data?(FullscreenUtil.goFullscreen(_this.playerHolder),playerState.videoState.screenState="fullscreen"):_this.clickedExpand?_this.screenControl.showFullscreenState():(FullscreenUtil.exitFullscreen(),playerState.videoState.screenState="normal"),_this.screenControl&amp;&amp;_this.screenControl.hideTT()},!1)},buildQualitySettings=function(){var e="",t=getURLParameter("quality"),n=[];if(n.length=0,"null"!=t)e=t;else{for(var r=_this.options.sources.length,i=0;r&gt;i;i++){var o=_this.options.sources[i];if(typeof o.active!==undefined){if(o.active){e=o.labelid;break}n.push(o)}}if(n.length===r)for(var s=Math.min.apply(Math,n.map(function(e){return e.bitrate})),a=n.length,l=0;a&gt;l;l++){var u=n[l];if(u.bitrate===s){e=u.labelid;break}}""===e&amp;&amp;localStorage.getItem("quality")&amp;&amp;(e=localStorage.getItem("quality"))}for(var c=_this.options.sources.length,d=0;c&gt;d;d++)playerState.videoState.qualities.push({label:_this.options.sources[d].label,labelid:_this.options.sources[d].labelid,bitrate:_this.options.sources[d].bitrate});_this.controlsWrapper.addEventListener("control:ondefaultquality",function(e){playerState.videoState.quality={label:e.data.label,labelid:e.data.labelid,bitrate:e.data.bitrate},setVideoSource(e.data.src)},!1),_this.settingsControl=new Settings(_this.$el,{container:_this.controlsWrapper,sources:_this.options.sources,quality:parseInt(e,10),feedbackurl:_this.options.feedbackurl,asseturl:_this.options.asseturl,binder:binder,isNotShare:isNotShareable,isComponent:isComponent}),_this.controlsWrapper.addEventListener("control:onsettingsopen",function(){_this.captionControl&amp;&amp;_this.captionControl.isOpen()&amp;&amp;_this.captionControl.hideTranslations(),_this.speedControl&amp;&amp;_this.speedControl.isOpen()&amp;&amp;_this.speedControl.hideSpeeds(),_this.volumeControl&amp;&amp;_this.volumeControl.isOpen()&amp;&amp;_this.volumeControl.hide()},!1),_this.controlsWrapper.addEventListener("control:onchangequality",function(e){_this.changeFromButton=!0,playerState.videoState.quality={label:e.data.label,labelid:e.data.labelid,bitrate:e.data.bitrate},isNotShareable&amp;&amp;isComponent&amp;&amp;binder.eventHandler("qualitychange"),changeVideo(e.data.src),checkLocalStorage()&amp;&amp;localStorage.setItem("quality",e.data.labelid)},!1)},buildCaptions=function(){for(var e=_this.options.translations.length,t=0;e&gt;t;t++)playerState.videoState.translations.push({key:_this.options.translations[t].language_medium,language:_this.options.translations[t].language});if(_this.captionControl=new Captions(_this.$el,{container:_this.controlsWrapper,embedded:_this.options.embedded,languages:_this.options.translations,asseturl:_this.options.asseturl,binder:binder,playerState:playerState,isNotShare:isNotShareable,isComponent:isComponent,maskLanguageList:getURLParameter("masklanguagelist")}),_this.controlsWrapper.addEventListener("control:languageopen",function(){_this.settingsControl&amp;&amp;_this.settingsControl.isOpen()&amp;&amp;_this.settingsControl.hide(),_this.speedControl&amp;&amp;_this.speedControl.isOpen()&amp;&amp;_this.speedControl.hideSpeeds(),_this.volumeControl&amp;&amp;_this.volumeControl.isOpen()&amp;&amp;_this.volumeControl.hide()},!1),_this.controlsWrapper.addEventListener("control:languageselect",function(e){playerState.videoState.captions=e.data,isNotShareable&amp;&amp;binder.eventHandler("captionchange")},!1),"null"!=getURLParameter("captions")||"null"!=getURLParameter("language"))"null"!=getURLParameter("captions")?_this.captionControl.getLanguageByMedium(getURLParameter("captions")):"null"!=getURLParameter("language")&amp;&amp;_this.captionControl.getLanguageByMedium(getURLParameter("language"));else for(var n=_this.options.translations.length,r=0;n&gt;r;r++){var i=_this.options.translations[r];typeof i.active!==undefined&amp;&amp;i.active&amp;&amp;_this.captionControl.getLanguageByMedium(i.language_medium)}},buildLoader=function(){_this.loaderControl=new Loader(_this.$el,{asseturl:_this.options.asseturl})},buildTooltip=function(){_this.tooltipControl=new Tooltip(_this.$el)},buildVolume=function(){_this.hasChangedVolume=!1;var e=parseInt(localStorage.getItem("volume"),10);_this.volumeControl=new Volume(_this.$el,{container:_this.controlsWrapper,volume:isNaN(e)?_this.options.volume:e/100,asseturl:_this.options.asseturl}),_this.controlsWrapper.addEventListener("control:volumeclick",function(e){_this.videoPlayer.volume=e.clicked?0:e.data/100,playerState.videoState.volume!==_this.videoPlayer.volume&amp;&amp;(_this.hasChangedVolume=!0),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("volumechange"),_this.hasChangedVolume&amp;&amp;(checkLocalStorage()&amp;&amp;localStorage.setItem("volume",e.data),playerState.videoState.volume=_this.videoPlayer.volume),_this.hasChangedVolume=!1},!1),_this.controlsWrapper.addEventListener("control:onvolumeopen",function(){_this.captionControl&amp;&amp;_this.captionControl.isOpen()&amp;&amp;_this.captionControl.hideTranslations(),_this.speedControl&amp;&amp;_this.speedControl.isOpen()&amp;&amp;_this.speedControl.hideSpeeds(),_this.settingsControl&amp;&amp;_this.settingsControl.isOpen()&amp;&amp;_this.settingsControl.hide()},!1),_this.controlsWrapper.addEventListener("control:volumeupdate",function(e){_this.videoPlayer.volume=e.data/100,playerState.videoState.volume!==_this.videoPlayer.volume&amp;&amp;(_this.hasChangedVolume=!0),("down"===e.action||"update"===e.action&amp;&amp;!isComponent)&amp;&amp;isNotShareable&amp;&amp;binder.eventHandler("volumechange"),isNotShareable&amp;&amp;isComponent&amp;&amp;binder.eventHandler("volumechange"),_this.hasChangedVolume&amp;&amp;(checkLocalStorage()&amp;&amp;localStorage.setItem("volume",e.data),playerState.videoState.volume=_this.videoPlayer.volume),_this.hasChangedVolume=!1},!1)},buildProgress=function(){_this.t="null"==getURLParameter("t")?_this.options.t:getURLParameter("t");var e=!1;_this.progressControl=new Progress(_this.$el,{container:_this.controlsWrapper,t:_this.options.t}),_this.controlsWrapper.addEventListener("control:sliderupdate",function(t){if(!isNaN(_this.videoPlayer.duration)){var n=t.action,r=0;switch(n){case"up":_this.loaderControl.hide(),_this.videoPlayer.currentTime=_this.videoPlayer.duration*t.data,_this.play(),clearTimeout(r);break;case"down":e=_this.playing,_this.pause(!1),_this.loaderControl.show(),r=setTimeout(function(){moveDurationBar(100*t.data,_this.videoPlayer.duration*t.data)},100);break;case"update":moveDurationBar(100*t.data,_this.videoPlayer.duration*t.data)}}},!1),_this.$progressbarHolder=_this.$el.querySelector(".progressbar-holder")},moveDurationBar=function(e,t){_this.chrome===!0&amp;&amp;(_this.progressControl&amp;&amp;_this.progressControl.updateDurationBar(e),_this.durationControl.updateCurrentTime(t))},changeVideo=function(e){_this.changedQuality=!0,_this.changeFromButton&amp;&amp;(_this.loaderControl.show(),hasFiredReady=!1,_this.changeFromButton=!1),setVideoSource(e),_this.destroy(),_this.videoPlayer.load();var t=setInterval(function(){4===_this.videoPlayer.readyState&amp;&amp;(_this.loaderControl.hide(),clearInterval(t))},50);return this};this.destroy=function(){_this.videoPlayer.removeEventListener("error",onVideoHasError),_this.videoPlayer.removeEventListener("timeupdate",onVideoTimeUpdate),_this.videoPlayer.removeEventListener("progress",onVideoProgress)},window.addEventListener("unload",function(){_this.destroy()}),this.getState=function(){return playerState};var addDOMEvents=function(){_this.chrome===!0&amp;&amp;(_this.$el.addEventListener("mousemove",onShowControls,!1),_this.$el.addEventListener("mouseout",onHideControls,!1),_this.$controlHolder.addEventListener("mouseenter",onStopHideControls,!1),_this.$controlHolder.addEventListener("mouseout",onStartHideControls,!1),_this.$progressbarHolder&amp;&amp;(_this.$progressbarHolder.addEventListener("mouseenter",onStopHideControls,!1),_this.$progressbarHolder.addEventListener("mouseout",onStartHideControls,!1)),_this.$el.addEventListener("keyup",function(e){27==e.keyCode&amp;&amp;(FullscreenUtil.full()||(playerState.videoState.screenState="normal",FullscreenUtil.setFull(!1)))},!1),document.addEventListener(FullscreenUtil.requestPrefix(_this.playerHolder),function(){FullscreenUtil.full()?(playerState.videoState.screenState="fullscreen",FullscreenUtil.setFull(!1)):(_this.screenControl&amp;&amp;_this.screenControl.showFullscreenState(),playerState.videoState.screenState="normal"),isNotShareable&amp;&amp;binder.eventHandler("screenchange")},!1)),_this.$el.querySelector("video").addEventListener("click",onPlayPauseVideoContainer,!1),_this.$el.setAttribute("tabindex",0),_this.$el.addEventListener("keydown",onVideoKeyDown,!1),_this.videoPlayer.addEventListener("contextmenu",function(e){return e.preventDefault(),e.stopImmediatePropagation(),!1},!1)},is_child_of=function(e,t){if(null!=t)for(;t.parentNode;)if((t=t.parentNode)==e)return!0;return!1},fixOnMouseOut=function(element,event,JavaScript_code){var current_mouse_target=null;event&amp;&amp;(event.toElement?current_mouse_target=event.toElement:event.relatedTarget&amp;&amp;(current_mouse_target=event.relatedTarget),is_child_of(element,current_mouse_target)||element==current_mouse_target||eval(JavaScript_code))},onStopHideControls=function(){_this.isOver=!0},onStartHideControls=function(e){fixOnMouseOut(this,e,"hideControlsBool()")},hideControlsBool=function(){_this.isOver=!1},onShowControls=function(){Helper.removeClass(_this.controlbar,"hide"),Helper.addClass(_this.controlbar,"show"),null!==_this.controlTime&amp;&amp;(clearTimeout(_this.controlTime),_this.controlTime=null),_this.adobeBug&amp;&amp;_this.posterControl&amp;&amp;(_this.posterControl.isVisible()||_this.adobeBug.showing().animateUp()),_this.isOver||(_this.controlTime=setTimeout(function(){onHideControls(),clearTimeout(_this.controlTime)},5e3))},onHideControls=function(e){fixOnMouseOut(this,e,"onHideControlsFromPlayer()")},onHideControlsFromPlayer=function(){Helper.removeClass(_this.controlbar,"show"),Helper.addClass(_this.controlbar,"hide"),_this.settingsControl&amp;&amp;_this.settingsControl.hide(),_this.volumeControl&amp;&amp;_this.volumeControl.hide(),_this.speedControl&amp;&amp;_this.speedControl.hideSpeeds(),_this.adobeBug&amp;&amp;_this.adobeBug.animateDown(),_this.captionControl&amp;&amp;_this.captionControl.hideTranslations(),clearTimeout(_this.controlTime),_this.controlTime=null},onVideoKeyDown=function(e){32===e.keyCode&amp;&amp;(e.preventDefault(),_this.videoPlayer.paused?(_this.complete&amp;&amp;isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("restart"),_this.play(),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("play")):(_this.pause(),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("pause")))},onPlayPauseVideoContainer=function(e){e.preventDefault(),_this.videoPlayer.paused?(_this.complete&amp;&amp;isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("restart"),_this.play(),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("play")):(_this.pause(),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("pause"))},getURLParameter=function(e){return decodeURI((new RegExp(e+"=(.+?)(&amp;|$)").exec(location.search)||[,null])[1])},checkLocalStorage=function(){try{return"localStorage"in window&amp;&amp;null!==window.localStorage}catch(e){return!1}},initializeVideo=function(){if((typeof _this.options.video.src===undefined||""===_this.options.video.src&amp;&amp;typeof _this.options.sources!==undefined)&amp;&amp;(_this.hasSources=!0),_this.hasSources&amp;&amp;1==_this.options.sources.length&amp;&amp;(playerState.videoState.quality={label:_this.options.sources[0].label,labelid:_this.options.sources[0].labelid,bitrate:_this.options.sources[0].bitrate},setVideoSource(_this.options.sources[0].src)),_this.hasSources&amp;&amp;_this.options.sources.length&gt;1&amp;&amp;_this.chrome===!1)for(var e=_this.options.sources.length,t=0;e&gt;t;t++){var n=_this.options.sources[t];if(n.active===!0){playerState.videoState.quality={label:_this.options.sources[t].label,labelid:_this.options.sources[t].labelid,bitrate:_this.options.sources[t].bitrate},setVideoSource(_this.options.sources[t].src);break}}if(isFirefox){var r="",i=getURLParameter("quality"),o=_this.options.sources.length;if("null"!=i){r=i;for(var s=0;o&gt;s;s++){var a=_this.options.sources[s];if(parseInt(r,10)===a.labelid){playerState.videoState.quality={label:a.label,labelid:a.labelid,bitrate:a.bitrate},setVideoSource(a.src);break}}}else for(var l=_this.options.sources.length,u=0;l&gt;u;u++){var c=_this.options.sources[u];if(typeof c.active!==undefined&amp;&amp;c.active===!0){playerState.videoState.quality={label:c.label,labelid:c.labelid,bitrate:c.bitrate},setVideoSource(c.src);break}}}var d=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")&gt;0;(!d||isFirefox)&amp;&amp;_this.videoPlayer.load(),_this.autoplay&amp;&amp;_this.play()},addVideoSubscribers=function(){_this.videoPlayer.addEventListener("canplay",onVideoCanPlay,!1),_this.videoPlayer.addEventListener("ended",onVideoComplete,!1),_this.videoPlayer.addEventListener("error",onVideoHasError,!1)},setVideoSource=function(e){return _this.videoPlayer.setAttribute("src",e),this},onVideoComplete=function(){var e="";e="null"!=getURLParameter("end")?getURLParameter("end"):_this.options.end,"nothing"===e?_this.pause():"replay"===e?_this.play():"rewind"===e?(_this.pause(),_this.videoPlayer.currentTime=0):"hidebutton"===e&amp;&amp;_this.pause(!1),_this.captionControl&amp;&amp;_this.captionControl.hideCaptions();var t=document.createEvent("Event");t.initEvent("videoplayer:ended",!1,!1),t.data={title:_this.options.title},_this.$el.dispatchEvent(t),isNotShareable&amp;&amp;!isComponent&amp;&amp;binder.eventHandler("pause"),isNotShareable&amp;&amp;binder.eventHandler("videocomplete"),_this.complete=!0},onVideoHasError=function(e){throwError("There was an error loading your video "+e.target.src)},hasFiredReady=!1,onVideoCanPlay=function(e){if(!hasFiredReady){if(isNotShareable&amp;&amp;binder.eventHandler("videoready"),_this.videoPlayer.addEventListener("timeupdate",onVideoTimeUpdate,!1),_this.chrome===!0&amp;&amp;_this.videoPlayer.addEventListener("progress",onVideoProgress,!1),playerState.videoState.duration=_this.videoPlayer.duration,_this.options.t&amp;&amp;(_this.videoPlayer.currentTime=_this.options.t,playerState.videoState.currentTime=_this.videoPlayer.currentTime),_this.chrome===!0&amp;&amp;(_this.durationControl.setDuration(_this.videoPlayer.duration),_this.progressControl&amp;&amp;_this.progressControl.setDuration(_this.videoPlayer.duration),"on"===_this.options.chaptermarkers&amp;&amp;buildChapterMarkers(),_this.videoPlayer.paused?_this.playPauseControl.showPlayState():_this.playPauseControl.showPauseState()),_this.changedQuality&amp;&amp;(_this.videoPlayer.currentTime=_this.lastTime,_this.play()),!_this.firstOpen){_this.firstOpen=!0;var t=document.createEvent("Event");t.initEvent("videoplayer:canplay",!1,!1),t.data={event:e,duration:_this.videoPlayer.duration,currentTime:_this.videoPlayer.currentTime},_this.$el.dispatchEvent(t)}hasFiredReady=!0}},onVideoTimeUpdate=function(e){if(binder.internalFlags.timeUpdate){var t=100*_this.videoPlayer.currentTime/_this.videoPlayer.duration;if(_this.options.analytics.active&amp;&amp;(t&gt;=25&amp;&amp;(_this.fireOne||(_this.fireOne=!0,createTrackingCall(25),playerState.videoState.milestone=t,isNotShareable&amp;&amp;binder.eventHandler("milestone"))),t&gt;=50&amp;&amp;(_this.fireTwo||(_this.fireTwo=!0,createTrackingCall(50),playerState.videoState.milestone=t,isNotShareable&amp;&amp;binder.eventHandler("milestone"))),t&gt;=75&amp;&amp;(_this.fireThree||(_this.fireThree=!0,createTrackingCall(75),playerState.videoState.milestone=t,isNotShareable&amp;&amp;binder.eventHandler("milestone"))),100==t&amp;&amp;(_this.fireFour||(_this.fireFour=!0,createTrackingCall(100),playerState.videoState.milestone=t,isNotShareable&amp;&amp;binder.eventHandler("milestone")))),_this.chrome===!0&amp;&amp;(_this.progressControl&amp;&amp;_this.progressControl.updateDurationBar(t),_this.durationControl.updateCurrentTime(_this.videoPlayer.currentTime)),_this.captionControl&amp;&amp;_this.captionControl.changeCaption(_this.videoPlayer.currentTime),_this.playing){var n=document.createEvent("Event");n.initEvent("videoplayer:playing",!1,!1),n.data={event:e,currentTime:_this.videoPlayer.currentTime},_this.$el.dispatchEvent(n)}_this.lastTime=_this.videoPlayer.currentTime,playerState.videoState.currentTime=_this.videoPlayer.currentTime,isNotShareable&amp;&amp;binder.eventHandler("timechange")}},onVideoProgress=function(){if(_this.videoPlayer.duration&amp;&amp;_this.videoPlayer.buffered.length){var e=_this.videoPlayer.buffered.end(0),t=Number(e/_this.videoPlayer.duration*100);_this.progressControl.updateProgressBar(t)}},throwError=function(e){throw playerState.exceptions.push(e),isNotShareable&amp;&amp;binder.eventHandler("exception"),e},colorLuminance=function(e,t){e=String(e).replace(/[^0-9a-f]/gi,""),e.length&lt;6&amp;&amp;(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,r,i="#";for(r=0;3&gt;r;r++)n=parseInt(e.substr(2*r,2),16),n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16),i+=("00"+n).substr(n.length);return i},createTrackingCall=function(e){return Helper.checkIEBrowser().name&amp;&amp;"11"===Helper.checkIEBrowser().version[0]?void 0:(superagent.get(_this.options.analytics.endpoint+e).end(function(e,t){playerState.log.push("made an internal tracking call",t)}),this)};this.setSkinColor=function(e){_this.skinColor=e.replace(/['"]+/g,""),_this.chrome===!0&amp;&amp;(Helper.hasClass(_this.$el,"pearl-default-skin")?(_this.$el.querySelector(".progressbar-holder .level").style.backgroundImage="-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #"+_this.skinColor+"), color-stop(100%, "+colorLuminance("#"+_this.skinColor,-.5)+"))",_this.$el.querySelector(".progressbar-holder .level").style.backgroundImage="-webkit-linear-gradient(#"+_this.skinColor+", "+colorLuminance("#"+_this.skinColor,-.5)+")",_this.$el.querySelector(".progressbar-holder .level").style.backgroundImage="-moz-linear-gradient(#"+_this.skinColor+", "+colorLuminance("#"+_this.skinColor,-.5)+")",_this.$el.querySelector(".progressbar-holder .level").style.backgroundImage="-o-linear-gradient(#"+_this.skinColor+", "+colorLuminance("#"+_this.skinColor,-.5)+")",_this.$el.querySelector(".progressbar-holder .level").style.backgroundImage="linear-gradient(#"+_this.skinColor+", "+colorLuminance("#"+_this.skinColor,-.5)+")"):_this.$el.querySelector(".progressbar-holder .level").style.background="#"+_this.skinColor),playerState.videoState.color=_this.skinColor},this.play=function(){return _this.videoPlayer.play(),_this.firstPlay||(_this.firstPlay=!0,_this.options.analytics.active&amp;&amp;(createTrackingCall("play"),createTrackingCall(0))),_this.posterControl&amp;&amp;_this.posterControl.isVisible()&amp;&amp;_this.posterControl.hide(),_this.playPauseControl&amp;&amp;_this.playPauseControl.showPauseState(),null!=_this.largePlayControl&amp;&amp;typeof _this.largePlayControl!==undefined&amp;&amp;_this.largePlayControl.hide(),_this.playing=!0,playerState.videoState.playing=_this.playing,_this.complete&amp;&amp;(_this.captionControl&amp;&amp;_this.captionControl.isCaptionSelected()&amp;&amp;_this.captionControl.showCaptions(),isNotShareable&amp;&amp;isComponent&amp;&amp;binder.eventHandler("restart"),_this.complete=!1),isNotShareable&amp;&amp;isComponent&amp;&amp;binder.eventHandler("play"),this},this.pause=function(e){typeof e===undefined&amp;&amp;(e=!0),_this.videoPlayer.pause();var t=document.createEvent("Event");return t.initEvent("videoplayer:pause",!1,!1),t.data={duration:_this.videoPlayer.duration,currentTime:_this.videoPlayer.currentTime,playing:_this.playing},_this.$el.dispatchEvent(t),_this.options.analytics.active&amp;&amp;!_this.complete&amp;&amp;createTrackingCall("pause"),_this.playPauseControl&amp;&amp;_this.playPauseControl.showPlayState(),null!=_this.largePlayControl&amp;&amp;typeof _this.largePlayControl!==undefined&amp;&amp;e&amp;&amp;_this.largePlayControl.show(),_this.playing=!1,playerState.videoState.playing=_this.playing,isNotShareable&amp;&amp;isComponent&amp;&amp;binder.eventHandler("pause"),this},this.changeTime=function(e){this.videoPlayer.currentTime=e},this.changeCaption=function(e){_this.captionControl&amp;&amp;_this.captionControl.getLanguageByMedium(e.replace(/['"]+/g,""))},this.toggleCaptions=function(){_this.captionControl&amp;&amp;(_this.captionControl.isCaptionSelected()?_this.captionControl.hideCaptions():_this.captionControl.showCaptions())},this.turnOffCaptions=function(){_this.captionControl&amp;&amp;_this.captionControl.languageSelected&amp;&amp;_this.captionControl.turnOffLanguage(),isNotShareable&amp;&amp;isComponent&amp;&amp;binder.eventHandler("turnoffcaptions")},this.restart=function(){_this.videoPlayer.currentTime=0,isNotShareable&amp;&amp;isComponent&amp;&amp;binder.eventHandler("restart"),_this.videoPlayer.paused&amp;&amp;_this.play()},this.changeVolume=function(e){_this.volumeControl.setVolume(e),playerState.videoState.volume=e},this.changeQuality=function(e){_this.settingsControl.setQuality(e)},this.getTime=function(){return _this.videoPlayer.currentTime},this.getDuration=function(){return _this.videoPlayer.duration},this.getAvailableCaptions=function(){if(typeof _this.options.translations!==undefined&amp;&amp;_this.options.translations.length&gt;0){for(var e=_this.options.translations.length,t=[],n=0;e&gt;n;n++){var r=_this.options.translations[n];t.push({key:r.language_medium,language:r.language})}return t}return[]},this.getAvailableQualities=function(){if(typeof _this.options.sources!==undefined&amp;&amp;_this.options.sources.length&gt;1){for(var e=_this.options.sources.length,t=[],n=0;e&gt;n;n++){var r=_this.options.sources[n];t.push({label:r.label,labelid:r.labelid,bitrate:r.bitrate})}return t}return[]},this.getVolume=function(){return playerState.videoState.volume},this.getScreenState=function(){return playerState.videoState.screenState},this.kill=function(){for(;_this.$el.firstChild;)_this.$el.removeChild(_this.$el.firstChild);_this.$el.removeAttribute("class"),_this.$el.removeAttribute("tabindex"),playerState.log.push("Player has been killed!")},setupDefaults(),buildVideoTag();var bug=normalizeParam("showadobebug");bug&amp;&amp;buildAdobeBug(),typeof _this.options.video.poster!==undefined&amp;&amp;""!==_this.options.video.poster&amp;&amp;_this.options.embedded&amp;&amp;(buildPoster(),_this.autoplay&amp;&amp;_this.posterControl.hide()),_this.chrome===!0&amp;&amp;(buildLargePlay(),buildControlBarWrapper(),""!==_this.options.watermark&amp;&amp;buildWatermark(),buildTooltip(),buildControlsWrapper(),buildProgress(),buildPlayPause(),buildDuration(),normalizeParam("fullscreen",!0)&amp;&amp;(isIE10||buildFullScreen()),typeof _this.options.sources!==undefined&amp;&amp;_this.options.sources.length&gt;1&amp;&amp;buildQualitySettings(),buildVolume(),_this.screenControl&amp;&amp;_this.screenControl.setTabIndex(),_this.options.translations.length&gt;0&amp;&amp;buildCaptions(),"on"===_this.options.speedcontrol&amp;&amp;buildSpeedControl(),"on"===_this.options.enable10seconds&amp;&amp;buildGoBack()),"null"!=getURLParameter("skincolor")&amp;&amp;(_this.setSkinColor(getURLParameter("skincolor")),_this.skinColor=getURLParameter("skincolor"),isNotShareable&amp;&amp;binder.eventHandler("colorchange")),buildLoader(),addDOMEvents(),initializeVideo(),addVideoSubscribers()}function NativePlayer(e,t,n,r,i){var o="undefined",s=this;this.$el=this.el=n,this.options=r;var a=t.constructorArguments.hasIframe||"component"===t.constructorArguments.mode,l=window.superagent,u=function(){s.complete=!1,s.fireOne=!1,s.fireTwo=!1,s.fireThree=!1,s.fireFour=!1,Helper.removeClass(s.$el,"pearl-player"),Helper.removeClass(s.$el,"pearl-default-skin"),s.$el.style.width="100%",s.$el.style.height="100%",s.$el.appendChild(h()),s.videoPlayer=document.getElementById("html5-"+s.$el.getAttribute("id")),c(),(s.options.translations&amp;&amp;"null"!=b("captions")||"null"!=b("language"))&amp;&amp;s.options.translations.length&gt;0&amp;&amp;p(),e.eventHandler("videoready")},c=function(){s.videoPlayer.addEventListener("canplay",function(e){if(!s.firstOpen){s.firstOpen=!0;var t=document.createEvent("Event");t.initEvent("videoplayer:canplay",!1,!1),t.data={event:e,duration:s.videoPlayer.duration},s.$el.dispatchEvent(t)}},!1),s.videoPlayer.addEventListener("play",function(){s.complete&amp;&amp;(a&amp;&amp;i&amp;&amp;e.eventHandler("restart"),s.complete=!1),a&amp;&amp;i&amp;&amp;e.eventHandler("play")
},!1),s.videoPlayer.addEventListener("pause",function(){var n=document.createEvent("Event");n.initEvent("videoplayer:pause",!1,!1),n.data={duration:s.videoPlayer.duration,currentTime:s.videoPlayer.currentTime,playing:t.videoState.playing},s.$el.dispatchEvent(n),a&amp;&amp;i&amp;&amp;e.eventHandler("pause")},!1),s.videoPlayer.addEventListener("ended",function(){s.complete=!0;var t=document.createEvent("Event");t.initEvent("videoplayer:ended",!1,!1),t.data={title:s.options.title},s.$el.dispatchEvent(t),a&amp;&amp;e.eventHandler("videocomplete")},!1),s.videoPlayer.addEventListener("timeupdate",function(n){var r=100*s.videoPlayer.currentTime/s.videoPlayer.duration;s.options.analytics.active&amp;&amp;(r&gt;=25&amp;&amp;(s.fireOne||(s.fireOne=!0,d(25),t.videoState.milestone=r,a&amp;&amp;e.eventHandler("milestone"))),r&gt;=50&amp;&amp;(s.fireTwo||(s.fireTwo=!0,d(50),t.videoState.milestone=r,a&amp;&amp;e.eventHandler("milestone"))),r&gt;=75&amp;&amp;(s.fireThree||(s.fireThree=!0,d(75),t.videoState.milestone=r,a&amp;&amp;e.eventHandler("milestone"))),100==r&amp;&amp;(s.fireFour||(s.fireFour=!0,d(100),t.videoState.milestone=r,a&amp;&amp;e.eventHandler("milestone"))));var i=document.createEvent("Event");i.initEvent("videoplayer:playing",!1,!1),i.data={event:n,currentTime:s.videoPlayer.currentTime},s.$el.dispatchEvent(i),t.videoState.currentTime=s.videoPlayer.currentTime,a&amp;&amp;e.eventHandler("timechange")},!1),s.videoPlayer.addEventListener("volumechange",function(){t.videoState.volume=s.videoPlayer.volume,a&amp;&amp;i&amp;&amp;e.eventHandler("volumechange")},!1),s.$el.addEventListener("keyup",function(e){27==e.keyCode&amp;&amp;(FullscreenUtil.full()||(t.videoState.screenState="normal",FullscreenUtil.setFull(!1)))},!1),document.addEventListener(FullscreenUtil.requestPrefix(s.videoPlayer),function(){FullscreenUtil.full()?(t.videoState.screenState="fullscreen",FullscreenUtil.setFull(!1)):t.videoState.screenState="normal",a&amp;&amp;e.eventHandler("screenchange")},!1)},d=function(e){return l.get(s.options.analytics.endpoint+e).end(function(e,n){t.log.push("made an internal tracking call",n)}),this},h=function(){var e=document.createElement("video");return e.id="html5-"+s.$el.getAttribute("id"),e.setAttribute("src",v()),e.setAttribute("controls","controls"),e.setAttribute("preload",s.options.video.preload),e.setAttribute("poster",s.options.video.poster),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.style.backgroundColor="transparent",e},p=function(){for(var e=b("null"!=b("captions")?"captions":"language"),t=s.options.translations.length,n=e,r=b("captions"),i=document.getElementById("html5-"+s.$el.getAttribute("id")),a=0;t&gt;a;a++){var l=s.options.translations[a];if(typeof l.vttPath!==o&amp;&amp;l.language_medium===r){n=f(l,a);break}}i.appendChild(n),i.getElementsByTagName("track")[0].setAttribute("default","")},f=function(n,r){var i=document.createElement("track"),o="";try{return i.setAttribute("id",s.$el.getAttribute("id")+"-"+r),i.setAttribute("label",n.language),i.setAttribute("src",n.vttPath),i.setAttribute("srclang",n.w3c),i.setAttribute("kind","subtitles"),i.setAttribute("data-medium",n.language_medium),i}catch(l){o="Error creating VTT tracks node: "+l.message}throw t.exceptions.push(o),a&amp;&amp;e.eventHandler("exception"),"There was no vttPath specified in any of the translations"},v=function(){for(var n=5,r="",i=s.options.sources,o=i.length-1;o&gt;=0;o--){var l=i[o],u=l.src.lastIndexOf(".")+1,c=u&gt;0?l.src.substr(u):"";m()||y()?"webm"==c&amp;&amp;i.splice(o,1):"mp4"==c&amp;&amp;i.splice(o,1)}s.options.sources=i;var d=s.options.sources.length;if(0===d){var h="You must provide at least one source video in the sources array -"+s.options.sources;throw t.exceptions.push(h),a&amp;&amp;e.eventHandler("exception"),h}if(1===d)r=s.options.sources[0].src,g(s.options.sources[0]);else if(d&gt;1)for(var p=0;d&gt;p;p++)if(n===s.options.sources[p].labelid){r=s.options.sources[p].src,g(s.options.sources[p]);break}return r},g=function(e){t.videoState.quality={label:e.label,labelid:e.labelid,bitrate:e.bitrate}},m=function(e){return e=e||navigator.userAgent,null!==e.match(/iP(ad)/i)},y=function(e){return e=e||navigator.userAgent,m(e)?!1:null!==e.match(/iP(hone|od)/i)},b=function(e){return decodeURI((new RegExp(e+"=(.+?)(&amp;|$)").exec(location.search)||[,null])[1])};this.play=function(){s.videoPlayer.play(),t.videoState.playing=!0},this.pause=function(){s.videoPlayer.pause(),t.videoState.playing=!1},this.restart=function(){s.videoPlayer.currentTime=0,s.videoPlayer.play(),t.videoState.playing=!0},this.changeTime=function(e){s.videoPlayer.currentTime=e,t.videoState.currentTime=e},this.changeVolume=function(e){s.videoPlayer.volume=e,t.videoState.volume=e},this.changeQuality=function(t){s.cacheTime=s.videoPlayer.currentTime;for(var n=s.options.sources.length,r="",o=0;n&gt;o;o++){var l=s.options.sources[o];if(l.labelid===parseInt(t.replace(/['"]+/g,""),10)){r=l;break}}s.videoPlayer.setAttribute("src",r.src),s.videoPlayer.load(),s.videoPlayer.play(),setTimeout(function(){s.videoPlayer.currentTime=s.cacheTime,g(r),a&amp;&amp;i&amp;&amp;e.eventHandler("qualitychange")},50)},this.kill=function(){for(;s.$el.firstChild;)s.$el.removeChild(s.$el.firstChild);s.$el.removeAttribute("class"),t.log.push("Player has been killed!")},this.getState=function(){return t},u()}(function(){function e(t,r){function o(e){if(o[e]!==g)return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&amp;&amp;o("json-parse");else{var n;if("json-stringify"==e){t=r.stringify;var i="function"==typeof t&amp;&amp;y;if(i){(n=function(){return 1}).toJSON=n;try{i="0"===t(0)&amp;&amp;"0"===t(new s)&amp;&amp;'""'==t(new a)&amp;&amp;t(m)===g&amp;&amp;t(g)===g&amp;&amp;t()===g&amp;&amp;"1"===t(n)&amp;&amp;"[1]"==t([n])&amp;&amp;"[null]"==t([g])&amp;&amp;"null"==t(null)&amp;&amp;"[null,null,null]"==t([g,m,null])&amp;&amp;'{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'==t({a:[n,!0,!1,null,"\x00\b\n\f\r	"]})&amp;&amp;"1"===t(null,n)&amp;&amp;"[\n 1,\n 2\n]"==t([1,2],null,1)&amp;&amp;'"-271821-04-20T00:00:00.000Z"'==t(new u(-864e13))&amp;&amp;'"+275760-09-13T00:00:00.000Z"'==t(new u(864e13))&amp;&amp;'"-000001-01-01T00:00:00.000Z"'==t(new u(-621987552e5))&amp;&amp;'"1969-12-31T23:59:59.999Z"'==t(new u(-1))}catch(l){i=!1}}t=i}if("json-parse"==e){if(t=r.parse,"function"==typeof t)try{if(0===t("0")&amp;&amp;!t(!1)){n=t('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}');var c=5==n.a.length&amp;&amp;1===n.a[0];if(c){try{c=!t('"	"')}catch(d){}if(c)try{c=1!==t("01")}catch(h){}if(c)try{c=1!==t("1.")}catch(p){}}}}catch(f){c=!1}t=c}}return o[e]=!!t}t||(t=i.Object()),r||(r=i.Object());var s=t.Number||i.Number,a=t.String||i.String,l=t.Object||i.Object,u=t.Date||i.Date,c=t.SyntaxError||i.SyntaxError,d=t.TypeError||i.TypeError,h=t.Math||i.Math,p=t.JSON||i.JSON;"object"==typeof p&amp;&amp;p&amp;&amp;(r.stringify=p.stringify,r.parse=p.parse);var f,v,g,l=l.prototype,m=l.toString,y=new u(-0xc782b5b800cec);try{y=-109252==y.getUTCFullYear()&amp;&amp;0===y.getUTCMonth()&amp;&amp;1===y.getUTCDate()&amp;&amp;10==y.getUTCHours()&amp;&amp;37==y.getUTCMinutes()&amp;&amp;6==y.getUTCSeconds()&amp;&amp;708==y.getUTCMilliseconds()}catch(b){}if(!o("json")){var _=o("bug-string-char-index");if(!y)var C=h.floor,w=[0,31,59,90,120,151,181,212,243,273,304,334],S=function(e,t){return w[t]+365*(e-1970)+C((e-1969+(t=+(t&gt;1)))/4)-C((e-1901+t)/100)+C((e-1601+t)/400)};if((f=l.hasOwnProperty)||(f=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=m?f=function(e){var t=this.__proto__;return e=e in(this.__proto__=null,this),this.__proto__=t,e}:(t=n.constructor,f=function(e){var n=(this.constructor||t).prototype;return e in this&amp;&amp;!(e in n&amp;&amp;this[e]===n[e])}),n=null,f.call(this,e)}),v=function(e,t){var r,i,o,s=0;(r=function(){this.valueOf=0}).prototype.valueOf=0,i=new r;for(o in i)f.call(i,o)&amp;&amp;s++;return r=i=null,s?v=2==s?function(e,t){var n,r={},i="[object Function]"==m.call(e);for(n in e)i&amp;&amp;"prototype"==n||f.call(r,n)||!(r[n]=1)||!f.call(e,n)||t(n)}:function(e,t){var n,r,i="[object Function]"==m.call(e);for(n in e)i&amp;&amp;"prototype"==n||!f.call(e,n)||(r="constructor"===n)||t(n);(r||f.call(e,n="constructor"))&amp;&amp;t(n)}:(i="valueOf toString toLocaleString propertyIsEnumerable isPrototypeOf hasOwnProperty constructor".split(" "),v=function(e,t){var r,o="[object Function]"==m.call(e),s=!o&amp;&amp;"function"!=typeof e.constructor&amp;&amp;n[typeof e.hasOwnProperty]&amp;&amp;e.hasOwnProperty||f;for(r in e)o&amp;&amp;"prototype"==r||!s.call(e,r)||t(r);for(o=i.length;r=i[--o];s.call(e,r)&amp;&amp;t(r));}),v(e,t)},!o("json-stringify")){var x={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},E=function(e,t){return("000000"+(t||0)).slice(-e)},L=function(e){for(var t='"',n=0,r=e.length,i=!_||r&gt;10,o=i&amp;&amp;(_?e.split(""):e);r&gt;n;n++){var s=e.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=x[s];break;default:if(32&gt;s){t+="\\u00"+E(2,s.toString(16));break}t+=i?o[n]:e.charAt(n)}}return t+'"'},k=function(e,t,n,r,i,o,s){var a,l,u,c,h,p,y,b,_;try{a=t[e]}catch(w){}if("object"==typeof a&amp;&amp;a)if(l=m.call(a),"[object Date]"!=l||f.call(a,"toJSON"))"function"==typeof a.toJSON&amp;&amp;("[object Number]"!=l&amp;&amp;"[object String]"!=l&amp;&amp;"[object Array]"!=l||f.call(a,"toJSON"))&amp;&amp;(a=a.toJSON(e));else if(a&gt;-1/0&amp;&amp;1/0&gt;a){if(S){for(c=C(a/864e5),l=C(c/365.2425)+1970-1;S(l+1,0)&lt;=c;l++);for(u=C((c-S(l,0))/30.42);S(l,u+1)&lt;=c;u++);c=1+c-S(l,u),h=(a%864e5+864e5)%864e5,p=C(h/36e5)%24,y=C(h/6e4)%60,b=C(h/1e3)%60,h%=1e3}else l=a.getUTCFullYear(),u=a.getUTCMonth(),c=a.getUTCDate(),p=a.getUTCHours(),y=a.getUTCMinutes(),b=a.getUTCSeconds(),h=a.getUTCMilliseconds();a=(0&gt;=l||l&gt;=1e4?(0&gt;l?"-":"+")+E(6,0&gt;l?-l:l):E(4,l))+"-"+E(2,u+1)+"-"+E(2,c)+"T"+E(2,p)+":"+E(2,y)+":"+E(2,b)+"."+E(3,h)+"Z"}else a=null;if(n&amp;&amp;(a=n.call(t,e,a)),null===a)return"null";if(l=m.call(a),"[object Boolean]"==l)return""+a;if("[object Number]"==l)return a&gt;-1/0&amp;&amp;1/0&gt;a?""+a:"null";if("[object String]"==l)return L(""+a);if("object"==typeof a){for(e=s.length;e--;)if(s[e]===a)throw d();if(s.push(a),_=[],t=o,o+=i,"[object Array]"==l){for(u=0,e=a.length;e&gt;u;u++)l=k(u,a,n,r,i,o,s),_.push(l===g?"null":l);e=_.length?i?"[\n"+o+_.join(",\n"+o)+"\n"+t+"]":"["+_.join(",")+"]":"[]"}else v(r||a,function(e){var t=k(e,a,n,r,i,o,s);t!==g&amp;&amp;_.push(L(e)+":"+(i?" ":"")+t)}),e=_.length?i?"{\n"+o+_.join(",\n"+o)+"\n"+t+"}":"{"+_.join(",")+"}":"{}";return s.pop(),e}};r.stringify=function(e,t,r){var i,o,s,a;if(n[typeof t]&amp;&amp;t)if("[object Function]"==(a=m.call(t)))o=t;else if("[object Array]"==a){s={};for(var l,u=0,c=t.length;c&gt;u;l=t[u++],a=m.call(l),("[object String]"==a||"[object Number]"==a)&amp;&amp;(s[l]=1));}if(r)if("[object Number]"==(a=m.call(r))){if(0&lt;(r-=r%1))for(i="",r&gt;10&amp;&amp;(r=10);i.length&lt;r;i+=" ");}else"[object String]"==a&amp;&amp;(i=10&gt;=r.length?r:r.slice(0,10));return k("",(l={},l[""]=e,l),o,s,i,"",[])}}if(!o("json-parse")){var T,H,$=a.fromCharCode,P={92:"\\",34:'"',47:"/",98:"\b",116:"	",110:"\n",102:"\f",114:"\r"},A=function(){throw T=H=null,c()},q=function(){for(var e,t,n,r,i,o=H,s=o.length;s&gt;T;)switch(i=o.charCodeAt(T)){case 9:case 10:case 13:case 32:T++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=_?o.charAt(T):o[T],T++,e;case 34:for(e="@",T++;s&gt;T;)if(i=o.charCodeAt(T),32&gt;i)A();else if(92==i)switch(i=o.charCodeAt(++T)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=P[i],T++;break;case 117:for(t=++T,n=T+4;n&gt;T;T++)i=o.charCodeAt(T),i&gt;=48&amp;&amp;57&gt;=i||i&gt;=97&amp;&amp;102&gt;=i||i&gt;=65&amp;&amp;70&gt;=i||A();e+=$("0x"+o.slice(t,T));break;default:A()}else{if(34==i)break;for(i=o.charCodeAt(T),t=T;i&gt;=32&amp;&amp;92!=i&amp;&amp;34!=i;)i=o.charCodeAt(++T);e+=o.slice(t,T)}if(34==o.charCodeAt(T))return T++,e;A();default:if(t=T,45==i&amp;&amp;(r=!0,i=o.charCodeAt(++T)),i&gt;=48&amp;&amp;57&gt;=i){for(48==i&amp;&amp;(i=o.charCodeAt(T+1),i&gt;=48&amp;&amp;57&gt;=i)&amp;&amp;A();s&gt;T&amp;&amp;(i=o.charCodeAt(T),i&gt;=48&amp;&amp;57&gt;=i);T++);if(46==o.charCodeAt(T)){for(n=++T;s&gt;n&amp;&amp;(i=o.charCodeAt(n),i&gt;=48&amp;&amp;57&gt;=i);n++);n==T&amp;&amp;A(),T=n}if(i=o.charCodeAt(T),101==i||69==i){for(i=o.charCodeAt(++T),43!=i&amp;&amp;45!=i||T++,n=T;s&gt;n&amp;&amp;(i=o.charCodeAt(n),i&gt;=48&amp;&amp;57&gt;=i);n++);n==T&amp;&amp;A(),T=n}return+o.slice(t,T)}if(r&amp;&amp;A(),"true"==o.slice(T,T+4))return T+=4,!0;if("false"==o.slice(T,T+5))return T+=5,!1;if("null"==o.slice(T,T+4))return T+=4,null;A()}return"$"},N=function(e){var t,n;if("$"==e&amp;&amp;A(),"string"==typeof e){if("@"==(_?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=q(),"]"!=e;n||(n=!0))n&amp;&amp;(","==e?(e=q(),"]"==e&amp;&amp;A()):A()),","==e&amp;&amp;A(),t.push(N(e));return t}if("{"==e){for(t={};e=q(),"}"!=e;n||(n=!0))n&amp;&amp;(","==e?(e=q(),"}"==e&amp;&amp;A()):A()),","!=e&amp;&amp;"string"==typeof e&amp;&amp;"@"==(_?e.charAt(0):e[0])&amp;&amp;":"==q()||A(),t[e.slice(1)]=N(q());return t}A()}return e},I=function(e,t,n){n=O(e,t,n),n===g?delete e[t]:e[t]=n},O=function(e,t,n){var r,i=e[t];if("object"==typeof i&amp;&amp;i)if("[object Array]"==m.call(i))for(r=i.length;r--;)I(i,r,n);else v(i,function(e){I(i,e,n)});return n.call(e,t,i)};r.parse=function(e,t){var n,r;return T=0,H=""+e,n=N(q()),"$"!=q()&amp;&amp;A(),T=H=null,t&amp;&amp;"[object Function]"==m.call(t)?O((r={},r[""]=n,r),"",t):n}}}return r.runInContext=e,r}var t="function"==typeof define&amp;&amp;define.amd,n={"function":!0,object:!0},r=n[typeof exports]&amp;&amp;exports&amp;&amp;!exports.nodeType&amp;&amp;exports,i=n[typeof window]&amp;&amp;window||this,o=r&amp;&amp;n[typeof module]&amp;&amp;module&amp;&amp;!module.nodeType&amp;&amp;"object"==typeof global&amp;&amp;global;if(!o||o.global!==o&amp;&amp;o.window!==o&amp;&amp;o.self!==o||(i=o),r&amp;&amp;!t)e(i,r);else{var s=i.JSON,a=i.JSON3,l=!1,u=e(i,i.JSON3={noConflict:function(){return l||(l=!0,i.JSON=s,i.JSON3=a,s=a=null),u}});i.JSON={parse:u.parse,stringify:u.stringify}}t&amp;&amp;define(function(){return u})}).call(this);var swfobject=function(){function e(){if(!V){try{var e=O.getElementsByTagName("body")[0].appendChild(g("span"));e.parentNode.removeChild(e)}catch(t){return}V=!0;for(var n=j.length,r=0;n&gt;r;r++)j[r]()}}function t(e){V?e():j[j.length]=e}function n(e){if(typeof I.addEventListener!=T)I.addEventListener("load",e,!1);else if(typeof O.addEventListener!=T)O.addEventListener("load",e,!1);else if(typeof I.attachEvent!=T)m(I,"onload",e);else if("function"==typeof I.onload){var t=I.onload;I.onload=function(){t(),e()}}else I.onload=e}function r(){M?i():o()}function i(){var e=O.getElementsByTagName("body")[0],t=g(H);t.setAttribute("type",A);var n=e.appendChild(t);if(n){var r=0;!function(){if(typeof n.GetVariable!=T){var i=n.GetVariable("$version");i&amp;&amp;(i=i.split(" ")[1].split(","),z.pv=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)])}else if(10&gt;r)return r++,void setTimeout(arguments.callee,10);e.removeChild(t),n=null,o()}()}else o()}function o(){var e=F.length;if(e&gt;0)for(var t=0;e&gt;t;t++){var n=F[t].id,r=F[t].callbackFn,i={success:!1,id:n};if(z.pv[0]&gt;0){var o=v(n);if(o)if(!y(F[t].swfVersion)||z.wk&amp;&amp;z.wk&lt;312)if(F[t].expressInstall&amp;&amp;a()){var c={};c.data=F[t].expressInstall,c.width=o.getAttribute("width")||"0",c.height=o.getAttribute("height")||"0",o.getAttribute("class")&amp;&amp;(c.styleclass=o.getAttribute("class")),o.getAttribute("align")&amp;&amp;(c.align=o.getAttribute("align"));for(var d={},h=o.getElementsByTagName("param"),p=h.length,f=0;p&gt;f;f++)"movie"!=h[f].getAttribute("name").toLowerCase()&amp;&amp;(d[h[f].getAttribute("name")]=h[f].getAttribute("value"));l(c,d,n,r)}else u(o),r&amp;&amp;r(i);else _(n,!0),r&amp;&amp;(i.success=!0,i.ref=s(n),r(i))}else if(_(n,!0),r){var g=s(n);g&amp;&amp;typeof g.SetVariable!=T&amp;&amp;(i.success=!0,i.ref=g),r(i)}}}function s(e){var t=null,n=v(e);if(n&amp;&amp;"OBJECT"==n.nodeName)if(typeof n.SetVariable!=T)t=n;else{var r=n.getElementsByTagName(H)[0];r&amp;&amp;(t=r)}return t}function a(){return!U&amp;&amp;y("6.0.65")&amp;&amp;(z.win||z.mac)&amp;&amp;!(z.wk&amp;&amp;z.wk&lt;312)}function l(e,t,n,r){U=!0,x=r||null,E={success:!1,id:n};var i=v(n);if(i){"OBJECT"==i.nodeName?(w=c(i),S=null):(w=i,S=n),e.id=q,(typeof e.width==T||!/%$/.test(e.width)&amp;&amp;parseInt(e.width,10)&lt;310)&amp;&amp;(e.width="310"),(typeof e.height==T||!/%$/.test(e.height)&amp;&amp;parseInt(e.height,10)&lt;137)&amp;&amp;(e.height="137"),O.title=O.title.slice(0,47)+" - Flash Player Installation";var o=z.ie&amp;&amp;z.win?"ActiveX":"PlugIn",s="MMredirectURL="+I.location.toString().replace(/&amp;/g,"%26")+"&amp;MMplayerType="+o+"&amp;MMdoctitle="+O.title;if(typeof t.flashvars!=T?t.flashvars+="&amp;"+s:t.flashvars=s,z.ie&amp;&amp;z.win&amp;&amp;4!=i.readyState){var a=g("div");n+="SWFObjectNew",a.setAttribute("id",n),i.parentNode.insertBefore(a,i),i.style.display="none",function(){4==i.readyState?i.parentNode.removeChild(i):setTimeout(arguments.callee,10)}()}d(e,t,n)}}function u(e){if(z.ie&amp;&amp;z.win&amp;&amp;4!=e.readyState){var t=g("div");e.parentNode.insertBefore(t,e),t.parentNode.replaceChild(c(e),t),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}else e.parentNode.replaceChild(c(e),e)}function c(e){var t=g("div");if(z.win&amp;&amp;z.ie)t.innerHTML=e.innerHTML;else{var n=e.getElementsByTagName(H)[0];if(n){var r=n.childNodes;if(r)for(var i=r.length,o=0;i&gt;o;o++)1==r[o].nodeType&amp;&amp;"PARAM"==r[o].nodeName||8==r[o].nodeType||t.appendChild(r[o].cloneNode(!0))}}return t}function d(e,t,n){var r,i=v(n);if(z.wk&amp;&amp;z.wk&lt;312)return r;if(i)if(typeof e.id==T&amp;&amp;(e.id=n),z.ie&amp;&amp;z.win){var o="";for(var s in e)e[s]!=Object.prototype[s]&amp;&amp;("data"==s.toLowerCase()?t.movie=e[s]:"styleclass"==s.toLowerCase()?o+=' class="'+e[s]+'"':"classid"!=s.toLowerCase()&amp;&amp;(o+=" "+s+'="'+e[s]+'"'));var a="";for(var l in t)t[l]!=Object.prototype[l]&amp;&amp;(a+='&lt;param name="'+l+'" value="'+t[l]+'" /&gt;');i.outerHTML='&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+o+"&gt;"+a+"&lt;/object&gt;",B[B.length]=e.id,r=v(e.id)}else{var u=g(H);u.setAttribute("type",A);for(var c in e)e[c]!=Object.prototype[c]&amp;&amp;("styleclass"==c.toLowerCase()?u.setAttribute("class",e[c]):"classid"!=c.toLowerCase()&amp;&amp;u.setAttribute(c,e[c]));for(var d in t)t[d]!=Object.prototype[d]&amp;&amp;"movie"!=d.toLowerCase()&amp;&amp;h(u,d,t[d]);i.parentNode.replaceChild(u,i),r=u}return r}function h(e,t,n){var r=g("param");r.setAttribute("name",t),r.setAttribute("value",n),e.appendChild(r)}function p(e){var t=v(e);t&amp;&amp;"OBJECT"==t.nodeName&amp;&amp;(z.ie&amp;&amp;z.win?(t.style.display="none",function(){4==t.readyState?f(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))}function f(e){var t=v(e);if(t){for(var n in t)"function"==typeof t[n]&amp;&amp;(t[n]=null);t.parentNode.removeChild(t)}}function v(e){var t=null;try{t=O.getElementById(e)}catch(n){}return t}function g(e){return O.createElement(e)}function m(e,t,n){e.attachEvent(t,n),R[R.length]=[e,t,n]}function y(e){var t=z.pv,n=e.split(".");return n[0]=parseInt(n[0],10),n[1]=parseInt(n[1],10)||0,n[2]=parseInt(n[2],10)||0,t[0]&gt;n[0]||t[0]==n[0]&amp;&amp;t[1]&gt;n[1]||t[0]==n[0]&amp;&amp;t[1]==n[1]&amp;&amp;t[2]&gt;=n[2]?!0:!1}function b(e,t,n,r){if(!z.ie||!z.mac){var i=O.getElementsByTagName("head")[0];if(i){var o=n&amp;&amp;"string"==typeof n?n:"screen";if(r&amp;&amp;(L=null,k=null),!L||k!=o){var s=g("style");s.setAttribute("type","text/css"),s.setAttribute("media",o),L=i.appendChild(s),z.ie&amp;&amp;z.win&amp;&amp;typeof O.styleSheets!=T&amp;&amp;O.styleSheets.length&gt;0&amp;&amp;(L=O.styleSheets[O.styleSheets.length-1]),k=o}z.ie&amp;&amp;z.win?L&amp;&amp;typeof L.addRule==H&amp;&amp;L.addRule(e,t):L&amp;&amp;typeof O.createTextNode!=T&amp;&amp;L.appendChild(O.createTextNode(e+" {"+t+"}"))}}}function _(e,t){if(W){var n=t?"visible":"hidden";V&amp;&amp;v(e)?v(e).style.visibility=n:b("#"+e,"visibility:"+n)}}function C(e){var t=/[\\\"&lt;&gt;\.;]/,n=null!=t.exec(e);return n&amp;&amp;typeof encodeURIComponent!=T?encodeURIComponent(e):e}{var w,S,x,E,L,k,T="undefined",H="object",$="Shockwave Flash",P="ShockwaveFlash.ShockwaveFlash",A="application/x-shockwave-flash",q="SWFObjectExprInst",N="onreadystatechange",I=window,O=document,D=navigator,M=!1,j=[r],F=[],B=[],R=[],V=!1,U=!1,W=!0,z=function(){var e=typeof O.getElementById!=T&amp;&amp;typeof O.getElementsByTagName!=T&amp;&amp;typeof O.createElement!=T,t=D.userAgent.toLowerCase(),n=D.platform.toLowerCase(),r=/win/.test(n?n:t),i=/mac/.test(n?n:t),o=/webkit/.test(t)?parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,s=!1,a=[0,0,0],l=null;if(typeof D.plugins!=T&amp;&amp;typeof D.plugins[$]==H)l=D.plugins[$].description,!l||typeof D.mimeTypes!=T&amp;&amp;D.mimeTypes[A]&amp;&amp;!D.mimeTypes[A].enabledPlugin||(M=!0,s=!1,l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),a[0]=parseInt(l.replace(/^(.*)\..*$/,"$1"),10),a[1]=parseInt(l.replace(/^.*\.(.*)\s.*$/,"$1"),10),a[2]=/[a-zA-Z]/.test(l)?parseInt(l.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof I.ActiveXObject!=T)try{var u=new ActiveXObject(P);u&amp;&amp;(l=u.GetVariable("$version"),l&amp;&amp;(s=!0,l=l.split(" ")[1].split(","),a=[parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)]))}catch(c){}return{w3:e,pv:a,wk:o,ie:s,win:r,mac:i}}();!function(){z.w3&amp;&amp;((typeof O.readyState!=T&amp;&amp;"complete"==O.readyState||typeof O.readyState==T&amp;&amp;(O.getElementsByTagName("body")[0]||O.body))&amp;&amp;e(),V||(typeof O.addEventListener!=T&amp;&amp;O.addEventListener("DOMContentLoaded",e,!1),z.ie&amp;&amp;z.win&amp;&amp;(O.attachEvent(N,function(){"complete"==O.readyState&amp;&amp;(O.detachEvent(N,arguments.callee),e())}),I==top&amp;&amp;!function(){if(!V){try{O.documentElement.doScroll("left")}catch(t){return void setTimeout(arguments.callee,0)}e()}}()),z.wk&amp;&amp;!function(){return V?void 0:/loaded|complete/.test(O.readyState)?void e():void setTimeout(arguments.callee,0)}(),n(e)))}(),function(){z.ie&amp;&amp;z.win&amp;&amp;window.attachEvent("onunload",function(){for(var e=R.length,t=0;e&gt;t;t++)R[t][0].detachEvent(R[t][1],R[t][2]);for(var n=B.length,r=0;n&gt;r;r++)p(B[r]);for(var i in z)z[i]=null;z=null;for(var o in swfobject)swfobject[o]=null;swfobject=null})}()}return{registerObject:function(e,t,n,r){if(z.w3&amp;&amp;e&amp;&amp;t){var i={};i.id=e,i.swfVersion=t,i.expressInstall=n,i.callbackFn=r,F[F.length]=i,_(e,!1)}else r&amp;&amp;r({success:!1,id:e})},getObjectById:function(e){return z.w3?s(e):void 0},embedSWF:function(e,n,r,i,o,s,u,c,h,p){var f={success:!1,id:n};z.w3&amp;&amp;!(z.wk&amp;&amp;z.wk&lt;312)&amp;&amp;e&amp;&amp;n&amp;&amp;r&amp;&amp;i&amp;&amp;o?(_(n,!1),t(function(){r+="",i+="";var t={};if(h&amp;&amp;typeof h===H)for(var v in h)t[v]=h[v];t.data=e,t.width=r,t.height=i;var g={};if(c&amp;&amp;typeof c===H)for(var m in c)g[m]=c[m];if(u&amp;&amp;typeof u===H)for(var b in u)typeof g.flashvars!=T?g.flashvars+="&amp;"+b+"="+u[b]:g.flashvars=b+"="+u[b];if(y(o)){var C=d(t,g,n);t.id==n&amp;&amp;_(n,!0),f.success=!0,f.ref=C}else{if(s&amp;&amp;a())return t.data=s,void l(t,g,n,p);_(n,!0)}p&amp;&amp;p(f)})):p&amp;&amp;p(f)},switchOffAutoHideShow:function(){W=!1},ua:z,getFlashPlayerVersion:function(){return{major:z.pv[0],minor:z.pv[1],release:z.pv[2]}},hasFlashPlayerVersion:y,createSWF:function(e,t,n){return z.w3?d(e,t,n):void 0},showExpressInstall:function(e,t,n,r){z.w3&amp;&amp;a()&amp;&amp;l(e,t,n,r)},removeSWF:function(e){z.w3&amp;&amp;p(e)},createCSS:function(e,t,n,r){z.w3&amp;&amp;b(e,t,n,r)},addDomLoadEvent:t,addLoadEvent:n,getQueryParamValue:function(e){var t=O.location.search||O.location.hash;if(t){if(/\?/.test(t)&amp;&amp;(t=t.split("?")[1]),null==e)return C(t);for(var n=t.split("&amp;"),r=0;r&lt;n.length;r++)if(n[r].substring(0,n[r].indexOf("="))==e)return C(n[r].substring(n[r].indexOf("=")+1))}return""},expressInstallCallback:function(){if(U){var e=v(q);e&amp;&amp;w&amp;&amp;(e.parentNode.replaceChild(w,e),S&amp;&amp;(_(S,!0),z.ie&amp;&amp;z.win&amp;&amp;(w.style.display="block")),x&amp;&amp;x(E)),U=!1}}}}();!function(e){if("object"==typeof exports&amp;&amp;"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&amp;&amp;define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&amp;&amp;(t=self),t.superagent=e()}}(function(){return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&amp;&amp;require;if(!a&amp;&amp;l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&amp;&amp;require,s=0;s&lt;r.length;s++)i(r[s]);return i}({1:[function(e,t){function n(e){return e?r(e):void 0}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;i&lt;n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;i&gt;r;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],2:[function(e,t){t.exports=function(e,t,n){for(var r=0,i=e.length,o=3==arguments.length?n:e[r++];i&gt;r;)o=t.call(null,o,e[r],++r,e);return o}},{}],3:[function(e,t){function n(){}function r(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function i(e){return e===Object(e)}function o(e){if(!i(e))return e;var t=[];for(var n in e)null!=e[n]&amp;&amp;t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&amp;")}function s(e){for(var t,n,r={},i=e.split("&amp;"),o=0,s=i.length;s&gt;o;++o)n=i[o],t=n.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function a(e){var t,n,r,i,o=e.split(/\r?\n/),s={};o.pop();for(var a=0,l=o.length;l&gt;a;++a)n=o[a],t=n.indexOf(":"),r=n.slice(0,t).toLowerCase(),i=g(n.slice(t+1)),s[r]=i;return s}function l(e){return e.split(/ *; */).shift()}function u(e){return f(e.split(/ *; */),function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&amp;&amp;i&amp;&amp;(e[r]=i),e},{})}function c(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&amp;&amp;(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=a(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function d(e,t){var n=this;p.call(this),this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new c(n)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,n.callback(e)}if(n.emit("response",t),e)return n.callback(e,t);if(t.status&gt;=200&amp;&amp;t.status&lt;300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(e||i,t)})}function h(e,t){return"function"==typeof t?new d("GET",e).end(t):1==arguments.length?new d("GET",e):new d(e,t)}var p=e("emitter"),f=e("reduce"),v="undefined"==typeof window?this||self:window;h.getXHR=function(){if(!(!v.XMLHttpRequest||v.location&amp;&amp;"file:"==v.location.protocol&amp;&amp;v.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var g="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};h.serializeObject=o,h.parseString=s,h.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},h.serialize={"application/x-www-form-urlencoded":o,"application/json":JSON.stringify},h.parse={"application/x-www-form-urlencoded":s,"application/json":JSON.parse},c.prototype.get=function(e){return this.header[e.toLowerCase()]},c.prototype.setHeaderProperties=function(){var e=this.header["content-type"]||"";this.type=l(e);var t=u(e);for(var n in t)this[n]=t[n]},c.prototype.parseBody=function(e){var t=h.parse[this.type];return t&amp;&amp;e&amp;&amp;(e.length||e instanceof Object)?t(e):null},c.prototype.setStatusProperties=function(e){1223===e&amp;&amp;(e=204);var t=e/100|0;this.status=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},c.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},h.Response=c,p(d.prototype),d.prototype.use=function(e){return e(this),this},d.prototype.timeout=function(e){return this._timeout=e,this},d.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},d.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},d.prototype.set=function(e,t){if(i(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},d.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},d.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},d.prototype.type=function(e){return this.set("Content-Type",h.types[e]||e),this},d.prototype.accept=function(e){return this.set("Accept",h.types[e]||e),this},d.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},d.prototype.query=function(e){return"string"!=typeof e&amp;&amp;(e=o(e)),e&amp;&amp;this._query.push(e),this},d.prototype.field=function(e,t){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t),this},d.prototype.attach=function(e,t,n){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t,n),this},d.prototype.send=function(e){var t=i(e),n=this.getHeader("Content-Type");if(t&amp;&amp;i(this._data))for(var o in e)this._data[o]=e[o];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),this._data="application/x-www-form-urlencoded"==n?this._data?this._data+"&amp;"+e:e:(this._data||"")+e):this._data=e;return!t||r(e)?this:(n||this.type("json"),this)},d.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},d.prototype.crossDomainError=function(){var e=new Error("Origin is not allowed by Access-Control-Allow-Origin");e.crossDomain=!0,this.callback(e)},d.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},d.prototype.withCredentials=function(){return this._withCredentials=!0,this},d.prototype.end=function(e){var t=this,i=this.xhr=h.getXHR(),o=this._query.join("&amp;"),s=this._timeout,a=this._formData||this._data;this._callback=e||n,i.onreadystatechange=function(){if(4==i.readyState){var e;try{e=i.status}catch(n){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var l=function(e){e.total&gt;0&amp;&amp;(e.percent=e.loaded/e.total*100),t.emit("progress",e)};this.hasListeners("progress")&amp;&amp;(i.onprogress=l);try{i.upload&amp;&amp;this.hasListeners("progress")&amp;&amp;(i.upload.onprogress=l)}catch(u){}if(s&amp;&amp;!this._timer&amp;&amp;(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),o&amp;&amp;(o=h.serializeObject(o),this.url+=~this.url.indexOf("?")?"&amp;"+o:"?"+o),i.open(this.method,this.url,!0),this._withCredentials&amp;&amp;(i.withCredentials=!0),"GET"!=this.method&amp;&amp;"HEAD"!=this.method&amp;&amp;"string"!=typeof a&amp;&amp;!r(a)){var c=h.serialize[this.getHeader("Content-Type")];c&amp;&amp;(a=c(a))}for(var d in this.header)null!=this.header[d]&amp;&amp;i.setRequestHeader(d,this.header[d]);return this.emit("request",this),i.send(a),this},h.Request=d,h.get=function(e,t,n){var r=h("GET",e);return"function"==typeof t&amp;&amp;(n=t,t=null),t&amp;&amp;r.query(t),n&amp;&amp;r.end(n),r},h.head=function(e,t,n){var r=h("HEAD",e);return"function"==typeof t&amp;&amp;(n=t,t=null),t&amp;&amp;r.send(t),n&amp;&amp;r.end(n),r},h.del=function(e,t){var n=h("DELETE",e);return t&amp;&amp;n.end(t),n},h.patch=function(e,t,n){var r=h("PATCH",e);return"function"==typeof t&amp;&amp;(n=t,t=null),t&amp;&amp;r.send(t),n&amp;&amp;r.end(n),r},h.post=function(e,t,n){var r=h("POST",e);return"function"==typeof t&amp;&amp;(n=t,t=null),t&amp;&amp;r.send(t),n&amp;&amp;r.end(n),r},h.put=function(e,t,n){var r=h("PUT",e);return"function"==typeof t&amp;&amp;(n=t,t=null),t&amp;&amp;r.send(t),n&amp;&amp;r.end(n),r
},t.exports=h},{emitter:1,reduce:2}]},{},[3])(3)});var Slider=function(e){return function(t,n){var r,i,o,s,a,l,u,c,d,h,p,f,v,g,m,y,b,_,C,w,S={showTrack:!0,defaultValue:0,orientation:"horizontal",inverse:!1,offsetOverride:87},x=Helper.merge(S,n),E=function(){L(),k(),T(),q(x.defaultValue)},L=function(){r=e,i=t.querySelector(".level"),o=t.querySelector(".slider-holder"),null!==t.querySelector(".btn-handle")&amp;&amp;(s=t.querySelector(".btn-handle")),null!==t.querySelector(".slider-view")&amp;&amp;(a=t.querySelector(".slider-view"),l=t.querySelector(".slider-inner-view"))},k=function(){u=!1,c=o.offsetWidth,d=t.getBoundingClientRect().left,h=t.getBoundingClientRect().top,p=x.defaultValue,s?(f=s.offsetWidth,v=s.offsetHeight,g=f/2,m=v/2,y=g,b=c-y,s.setAttribute("role","slider")):i.setAttribute("role","slider"),a&amp;&amp;(_=l.offsetWidth,C=a.offsetWidth),x.showTrack||Helper.addClass(i,"hid")},T=function(){o.addEventListener("mousedown",function(t){w=Helper.checkIEBrowser()&amp;&amp;FullscreenUtil.full()?x.offsetOverride:o.getBoundingClientRect().left,u=!0,P(t.pageX-w,"down"),e.addEventListener("mousemove",H,!1),e.addEventListener("mouseup",$,!1)},!1)},H=function(e){e.preventDefault(),e.stopImmediatePropagation(),u&amp;&amp;P(e.pageX-w,"update")},$=function(t){t.preventDefault(),t.stopImmediatePropagation(),u&amp;&amp;(u=!1,P(t.pageX-w,"up")),e.removeEventListener("mousemove",H),e.removeEventListener("mouseup",$)},P=function(e,t){var n;n=100*e/o.clientWidth;var r=n/100;p=r,q(r,t)},A=function(e){l.style.left=-e*(_-C)+"px"},q=function(e,n){var r=o.clientHeight,l=o.clientWidth,u="horizontal"==x.orientation?x.inverse?-(e*l-l):e*l:x.inverse?e*r:-(e*r-r);s?(u&gt;b&amp;&amp;(u=b),y&gt;u&amp;&amp;(u=y),u+g&gt;=l&amp;&amp;(e=x.inverse?0:1),g&gt;=u&amp;&amp;(e=x.inverse?1:0),s.style.left=u-g+"px"):(e&gt;=1&amp;&amp;(u="horizontal"==x.orientation?x.inverse?0:c:x.inverse?c:0,e=1),0&gt;=e&amp;&amp;(u="horizontal"==x.orientation?x.inverse?c:0:x.inverse?0:c,e=0)),i.style.width=u+"px",a&amp;&amp;A(e);var d=document.createEvent("Event");d.initEvent("slider:update",!1,!1),d.data=e,d.action=n,t.dispatchEvent(d),N(100*e)},N=function(e){var t=s?s:i;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuemin",0),t.setAttribute("aria-valuemax",100)},I=function(){return p},O=function(){return x};return E(),{updatePosition:q,updateAttributes:N,lastValue:I,getSettings:O}}}(window),ControlTooltip=function(){return function(e,t){var n,r,i,o,s,a,l={activation:"hover",delay:0,content:null,containerEl:null,containerPadding:5,tooltipOffset:0,dataAttribute:"title"},u=Helper.merge(l,t),c=function(){d(),h(),p(),null!==u.content&amp;&amp;"string"!=typeof u.content&amp;&amp;i.removeAttribute("aria-label")},d=function(){n=u.containerEl.querySelector(".tt"),r=u.containerEl.querySelector(".tt-arrow"),i=u.containerEl.querySelector(".tt-content"),o=null!==u.containerEl?u.containerEl:document.body},h=function(){s=r.offsetHeight,a=0},p=function(){e.addEventListener("hover"==u.activation?"mouseenter":"click",function(t){m();var n=document.createEvent("Event");n.initEvent("tooltip:show",!1,!1),n.data=t,e.dispatchEvent(n)},!1),e.addEventListener("mouseleave",function(t){y();var n=document.createEvent("Event");n.initEvent("tooltip:hide",!1,!1),n.data=t,e.dispatchEvent(n)},!1)},f=function(){n.style.zIndex=10,n.style.display="block",g(e.getAttribute("data-"+u.dataAttribute)),C()},v=function(){n.style.zIndex=9,n.style.display="none"},g=function(e){i.innerHTML=e,i.setAttribute("aria-label",e)},m=function(){null!==u.delay&amp;&amp;u.delay&gt;0?a=setTimeout(function(){a&amp;&amp;clearTimeout(a),f()},u.delay):f()},y=function(){v()},b=function(t){e.setAttribute("data-"+u.dataAttribute,t),g(t),C()},_=function(){n.style.display="none"},C=function(){var t=u.containerEl.querySelector(".tt-arrow").clientHeight,s=u.containerEl.querySelector(".tt-arrow").clientWidth/2,a=e.getBoundingClientRect().top,l=e.clientHeight,c=i.clientWidth,d=c/2,h=e.getBoundingClientRect().left+e.clientWidth/2-d,p=a-i.clientHeight-t-u.tooltipOffset,f=o.getBoundingClientRect().left,v=o.clientWidth,g=d-s;if(h+c&gt;=f+v){var m=h+c-(f+v);h=h-m-u.containerPadding,g=g+m+u.containerPadding}if(f&gt;=h){var y=f-h;h=h+y+u.containerPadding,g=g-y-u.containerPadding}o.getBoundingClientRect().top&gt;=p||Helper.hasClass(e,"ui-tt-down")?(p=a+l+t+u.tooltipOffset,Helper.removeClass(r,"up"),Helper.addClass(r,"down")):(Helper.removeClass(r,"down"),Helper.addClass(r,"up")),n.style.left=Math.round(h-o.getBoundingClientRect().left)+"px",n.style.top=p-o.getBoundingClientRect().top+"px",r.style.left=Math.round(g)+"px"};c();var w=function(){return u},S=function(){return{tooltipLeft:n.style.left,tooltipTop:n.style.top,tooltipArrow:r.style.left}};return{show:m,hide:y,setText:g,changeText:b,realhide:_,getSettings:w,deactivate:v,activate:f,getCurrentPosition:S}}}();!function(e,t){"object"==typeof module&amp;&amp;"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(e,t){function n(e){var t="length"in e&amp;&amp;e.length,n=K.type(e);return"function"===n||K.isWindow(e)?!1:1===e.nodeType&amp;&amp;t?!0:"array"===n||0===t||"number"==typeof t&amp;&amp;t&gt;0&amp;&amp;t-1 in e}function r(e,t,n){if(K.isFunction(t))return K.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return K.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(at.test(t))return K.filter(t,e,n);t=K.filter(t,e)}return K.grep(e,function(e){return z.call(t,e)&gt;=0!==n})}function i(e,t){for(;(e=e[t])&amp;&amp;1!==e.nodeType;);return e}function o(e){var t=ft[e]={};return K.each(e.match(pt)||[],function(e,n){t[n]=!0}),t}function s(){G.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1),K.ready()}function a(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=K.expando+a.uid++}function l(e,t,n){var r;if(void 0===n&amp;&amp;1===e.nodeType)if(r="data-"+t.replace(_t,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:bt.test(n)?K.parseJSON(n):n}catch(i){}yt.set(e,t,n)}else n=void 0;return n}function u(){return!0}function c(){return!1}function d(){try{return G.activeElement}catch(e){}}function h(e,t){return K.nodeName(e,"table")&amp;&amp;K.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function f(e){var t=Ot.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function v(e,t){for(var n=0,r=e.length;r&gt;n;n++)mt.set(e[n],"globalEval",!t||mt.get(t[n],"globalEval"))}function g(e,t){var n,r,i,o,s,a,l,u;if(1===t.nodeType){if(mt.hasData(e)&amp;&amp;(o=mt.access(e),s=mt.set(t,o),u=o.events)){delete s.handle,s.events={};for(i in u)for(n=0,r=u[i].length;r&gt;n;n++)K.event.add(t,i,u[i][n])}yt.hasData(e)&amp;&amp;(a=yt.access(e),l=K.extend({},a),yt.set(t,l))}}function m(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&amp;&amp;K.nodeName(e,t)?K.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&amp;&amp;xt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&amp;&amp;(t.defaultValue=e.defaultValue)}function b(t,n){var r,i=K(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&amp;&amp;(r=e.getDefaultComputedStyle(i[0]))?r.display:K.css(i[0],"display");return i.detach(),o}function _(e){var t=G,n=Ft[e];return n||(n=b(e,t),"none"!==n&amp;&amp;n||(jt=(jt||K("&lt;iframe frameborder='0' width='0' height='0'/&gt;")).appendTo(t.documentElement),t=jt[0].contentDocument,t.write(),t.close(),n=b(e,t),jt.detach()),Ft[e]=n),n}function C(e,t,n){var r,i,o,s,a=e.style;return n=n||Vt(e),n&amp;&amp;(s=n.getPropertyValue(t)||n[t]),n&amp;&amp;(""!==s||K.contains(e.ownerDocument,e)||(s=K.style(e,t)),Rt.test(s)&amp;&amp;Bt.test(t)&amp;&amp;(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o)),void 0!==s?s+"":s}function w(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function S(e,t){if(t in e)return t;for(var n=t[0].toUpperCase()+t.slice(1),r=t,i=Qt.length;i--;)if(t=Qt[i]+n,t in e)return t;return r}function x(e,t,n){var r=Wt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function E(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;4&gt;o;o+=2)"margin"===n&amp;&amp;(s+=K.css(e,n+wt[o],!0,i)),r?("content"===n&amp;&amp;(s-=K.css(e,"padding"+wt[o],!0,i)),"margin"!==n&amp;&amp;(s-=K.css(e,"border"+wt[o]+"Width",!0,i))):(s+=K.css(e,"padding"+wt[o],!0,i),"padding"!==n&amp;&amp;(s+=K.css(e,"border"+wt[o]+"Width",!0,i)));return s}function L(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Vt(e),s="border-box"===K.css(e,"boxSizing",!1,o);if(0&gt;=i||null==i){if(i=C(e,t,o),(0&gt;i||null==i)&amp;&amp;(i=e.style[t]),Rt.test(i))return i;r=s&amp;&amp;(Z.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+E(e,t,n||(s?"border":"content"),r,o)+"px"}function k(e,t){for(var n,r,i,o=[],s=0,a=e.length;a&gt;s;s++)r=e[s],r.style&amp;&amp;(o[s]=mt.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&amp;&amp;St(r)&amp;&amp;(o[s]=mt.access(r,"olddisplay",_(r.nodeName)))):(i=St(r),"none"===n&amp;&amp;i||mt.set(r,"olddisplay",i?n:K.css(r,"display"))));for(s=0;a&gt;s;s++)r=e[s],r.style&amp;&amp;(t&amp;&amp;"none"!==r.style.display&amp;&amp;""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}function T(e,t,n,r,i){return new T.prototype.init(e,t,n,r,i)}function H(){return setTimeout(function(){Zt=void 0}),Zt=K.now()}function $(e,t){var n,r=0,i={height:e};for(t=t?1:0;4&gt;r;r+=2-t)n=wt[r],i["margin"+n]=i["padding"+n]=e;return t&amp;&amp;(i.opacity=i.width=e),i}function P(e,t,n){for(var r,i=(nn[t]||[]).concat(nn["*"]),o=0,s=i.length;s&gt;o;o++)if(r=i[o].call(n,t,e))return r}function A(e,t,n){var r,i,o,s,a,l,u,c,d=this,h={},p=e.style,f=e.nodeType&amp;&amp;St(e),v=mt.get(e,"fxshow");n.queue||(a=K._queueHooks(e,"fx"),null==a.unqueued&amp;&amp;(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,K.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&amp;&amp;("height"in t||"width"in t)&amp;&amp;(n.overflow=[p.overflow,p.overflowX,p.overflowY],u=K.css(e,"display"),c="none"===u?mt.get(e,"olddisplay")||_(e.nodeName):u,"inline"===c&amp;&amp;"none"===K.css(e,"float")&amp;&amp;(p.display="inline-block")),n.overflow&amp;&amp;(p.overflow="hidden",d.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Yt.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;f=!0}h[r]=v&amp;&amp;v[r]||K.style(e,r)}else u=void 0;if(K.isEmptyObject(h))"inline"===("none"===u?_(e.nodeName):u)&amp;&amp;(p.display=u);else{v?"hidden"in v&amp;&amp;(f=v.hidden):v=mt.access(e,"fxshow",{}),o&amp;&amp;(v.hidden=!f),f?K(e).show():d.done(function(){K(e).hide()}),d.done(function(){var t;mt.remove(e,"fxshow");for(t in h)K.style(e,t,h[t])});for(r in h)s=P(f?v[r]:0,r,d),r in v||(v[r]=s.start,f&amp;&amp;(s.end=s.start,s.start="width"===r||"height"===r?1:0))}}function q(e,t){var n,r,i,o,s;for(n in e)if(r=K.camelCase(n),i=t[r],o=e[n],K.isArray(o)&amp;&amp;(i=o[1],o=e[n]=o[0]),n!==r&amp;&amp;(e[r]=o,delete e[n]),s=K.cssHooks[r],s&amp;&amp;"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function N(e,t,n){var r,i,o=0,s=tn.length,a=K.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Zt||H(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,s=0,l=u.tweens.length;l&gt;s;s++)u.tweens[s].run(o);return a.notifyWith(e,[u,o,n]),1&gt;o&amp;&amp;l?n:(a.resolveWith(e,[u]),!1)},u=a.promise({elem:e,props:K.extend({},t),opts:K.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Zt||H(),duration:n.duration,tweens:[],createTween:function(t,n){var r=K.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r&gt;n;n++)u.tweens[n].run(1);return t?a.resolveWith(e,[u,t]):a.rejectWith(e,[u,t]),this}}),c=u.props;for(q(c,u.opts.specialEasing);s&gt;o;o++)if(r=tn[o].call(u,e,c,u.opts))return r;return K.map(c,P,u),K.isFunction(u.opts.start)&amp;&amp;u.opts.start.call(e,u),K.fx.timer(K.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function I(e){return function(t,n){"string"!=typeof t&amp;&amp;(n=t,t="*");var r,i=0,o=t.toLowerCase().match(pt)||[];if(K.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function O(e,t,n,r){function i(a){var l;return o[a]=!0,K.each(e[a]||[],function(e,a){var u=a(t,n,r);return"string"!=typeof u||s||o[u]?s?!(l=u):void 0:(t.dataTypes.unshift(u),i(u),!1)}),l}var o={},s=e===_n;return i(t.dataTypes[0])||!o["*"]&amp;&amp;i("*")}function D(e,t){var n,r,i=K.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&amp;&amp;((i[n]?e:r||(r={}))[n]=t[n]);return r&amp;&amp;K.extend(!0,e,r),e}function M(e,t,n){for(var r,i,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&amp;&amp;(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&amp;&amp;a[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}s||(s=i)}o=o||s}return o?(o!==l[0]&amp;&amp;l.unshift(o),n[o]):void 0}function j(e,t,n,r){var i,o,s,a,l,u={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)u[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&amp;&amp;(n[e.responseFields[o]]=t),!l&amp;&amp;r&amp;&amp;e.dataFilter&amp;&amp;(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&amp;&amp;l!==o){if(s=u[l+" "+o]||u["* "+o],!s)for(i in u)if(a=i.split(" "),a[1]===o&amp;&amp;(s=u[l+" "+a[0]]||u["* "+a[0]])){s===!0?s=u[i]:u[i]!==!0&amp;&amp;(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&amp;&amp;e["throws"])t=s(t);else try{t=s(t)}catch(d){return{state:"parsererror",error:s?d:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}function F(e,t,n,r){var i;if(K.isArray(t))K.each(t,function(t,i){n||En.test(e)?r(e,i):F(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==K.type(t))r(e,t);else for(i in t)F(e+"["+i+"]",t[i],n,r)}function B(e){return K.isWindow(e)?e:9===e.nodeType&amp;&amp;e.defaultView}var R=[],V=R.slice,U=R.concat,W=R.push,z=R.indexOf,X={},J=X.toString,Q=X.hasOwnProperty,Z={},G=e.document,Y="2.1.4",K=function(e,t){return new K.fn.init(e,t)},et=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,tt=/^-ms-/,nt=/-([\da-z])/gi,rt=function(e,t){return t.toUpperCase()};K.fn=K.prototype={jquery:Y,constructor:K,selector:"",length:0,toArray:function(){return V.call(this)},get:function(e){return null!=e?0&gt;e?this[e+this.length]:this[e]:V.call(this)},pushStack:function(e){var t=K.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return K.each(this,e,t)},map:function(e){return this.pushStack(K.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(V.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0&gt;e?t:0);return this.pushStack(n&gt;=0&amp;&amp;t&gt;n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:W,sort:R.sort,splice:R.splice},K.extend=K.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&amp;&amp;(u=s,s=arguments[a]||{},a++),"object"==typeof s||K.isFunction(s)||(s={}),a===l&amp;&amp;(s=this,a--);l&gt;a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&amp;&amp;(u&amp;&amp;r&amp;&amp;(K.isPlainObject(r)||(i=K.isArray(r)))?(i?(i=!1,o=n&amp;&amp;K.isArray(n)?n:[]):o=n&amp;&amp;K.isPlainObject(n)?n:{},s[t]=K.extend(u,o,r)):void 0!==r&amp;&amp;(s[t]=r));return s},K.extend({expando:"jQuery"+(Y+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===K.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&amp;&amp;e===e.window},isNumeric:function(e){return!K.isArray(e)&amp;&amp;e-parseFloat(e)+1&gt;=0},isPlainObject:function(e){return"object"!==K.type(e)||e.nodeType||K.isWindow(e)?!1:e.constructor&amp;&amp;!Q.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?X[J.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;e=K.trim(e),e&amp;&amp;(1===e.indexOf("use strict")?(t=G.createElement("script"),t.text=e,G.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(tt,"ms-").replace(nt,rt)},nodeName:function(e,t){return e.nodeName&amp;&amp;e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,s=e.length,a=n(e);if(r){if(a)for(;s&gt;o&amp;&amp;(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(a)for(;s&gt;o&amp;&amp;(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(et,"")},makeArray:function(e,t){var r=t||[];return null!=e&amp;&amp;(n(Object(e))?K.merge(r,"string"==typeof e?[e]:e):W.call(r,e)),r},inArray:function(e,t,n){return null==t?-1:z.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n&gt;r;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,s=e.length,a=!n;s&gt;o;o++)r=!t(e[o],o),r!==a&amp;&amp;i.push(e[o]);return i},map:function(e,t,r){var i,o=0,s=e.length,a=n(e),l=[];if(a)for(;s&gt;o;o++)i=t(e[o],o,r),null!=i&amp;&amp;l.push(i);else for(o in e)i=t(e[o],o,r),null!=i&amp;&amp;l.push(i);return U.apply([],l)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&amp;&amp;(n=e[t],t=e,e=n),K.isFunction(e)?(r=V.call(arguments,2),i=function(){return e.apply(t||this,r.concat(V.call(arguments)))},i.guid=e.guid=e.guid||K.guid++,i):void 0},now:Date.now,support:Z}),K.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){X["[object "+t+"]"]=t.toLowerCase()});var it=function(e){function t(e,t,n,r){var i,o,s,a,l,u,d,p,f,v;if((t?t.ownerDocument||t:F)!==A&amp;&amp;P(t),t=t||A,n=n||[],a=t.nodeType,"string"!=typeof e||!e||1!==a&amp;&amp;9!==a&amp;&amp;11!==a)return n;if(!r&amp;&amp;N){if(11!==a&amp;&amp;(i=yt.exec(e)))if(s=i[1]){if(9===a){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&amp;&amp;(o=t.ownerDocument.getElementById(s))&amp;&amp;M(t,o)&amp;&amp;o.id===s)return n.push(o),n}else{if(i[2])return Y.apply(n,t.getElementsByTagName(e)),n;if((s=i[3])&amp;&amp;C.getElementsByClassName)return Y.apply(n,t.getElementsByClassName(s)),n}if(C.qsa&amp;&amp;(!I||!I.test(e))){if(p=d=j,f=t,v=1!==a&amp;&amp;e,1===a&amp;&amp;"object"!==t.nodeName.toLowerCase()){for(u=E(e),(d=t.getAttribute("id"))?p=d.replace(_t,"\\$&amp;"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=u.length;l--;)u[l]=p+h(u[l]);f=bt.test(e)&amp;&amp;c(t.parentNode)||t,v=u.join(",")}if(v)try{return Y.apply(n,f.querySelectorAll(v)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(lt,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")&gt;w.cacheLength&amp;&amp;delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[j]=!0,e}function i(e){var t=A.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&amp;&amp;t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function s(e,t){var n=t&amp;&amp;e,r=n&amp;&amp;1===e.nodeType&amp;&amp;1===t.nodeType&amp;&amp;(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&amp;&amp;t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&amp;&amp;t.type===e}}function u(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&amp;&amp;(n[i]=!(r[i]=n[i]))})})}function c(e){return e&amp;&amp;"undefined"!=typeof e.getElementsByTagName&amp;&amp;e}function d(){}function h(e){for(var t=0,n=e.length,r="";n&gt;t;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,i=n&amp;&amp;"parentNode"===r,o=R++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,s){var a,l,u=[B,o];if(s){for(;t=t[r];)if((1===t.nodeType||i)&amp;&amp;e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[j]||(t[j]={}),(a=l[r])&amp;&amp;a[0]===B&amp;&amp;a[1]===o)return u[2]=a[2];if(l[r]=u,u[2]=e(t,n,s))return!0}}}function f(e){return e.length&gt;1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function v(e,n,r){for(var i=0,o=n.length;o&gt;i;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,s=[],a=0,l=e.length,u=null!=t;l&gt;a;a++)(o=e[a])&amp;&amp;(!n||n(o,r,i))&amp;&amp;(s.push(o),u&amp;&amp;t.push(a));return s}function m(e,t,n,i,o,s){return i&amp;&amp;!i[j]&amp;&amp;(i=m(i)),o&amp;&amp;!o[j]&amp;&amp;(o=m(o,s)),r(function(r,s,a,l){var u,c,d,h=[],p=[],f=s.length,m=r||v(t||"*",a.nodeType?[a]:a,[]),y=!e||!r&amp;&amp;t?m:g(m,h,e,a,l),b=n?o||(r?e:f||i)?[]:s:y;if(n&amp;&amp;n(y,b,a,l),i)for(u=g(b,p),i(u,[],a,l),c=u.length;c--;)(d=u[c])&amp;&amp;(b[p[c]]=!(y[p[c]]=d));if(r){if(o||e){if(o){for(u=[],c=b.length;c--;)(d=b[c])&amp;&amp;u.push(y[c]=d);o(null,b=[],u,l)}for(c=b.length;c--;)(d=b[c])&amp;&amp;(u=o?et(r,d):h[c])&gt;-1&amp;&amp;(r[u]=!(s[u]=d))}}else b=g(b===s?b.splice(f,b.length):b),o?o(null,s,b,l):Y.apply(s,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],s=o||w.relative[" "],a=o?1:0,l=p(function(e){return e===t},s,!0),u=p(function(e){return et(t,e)&gt;-1},s,!0),c=[function(e,n,r){var i=!o&amp;&amp;(r||n!==T)||((t=n).nodeType?l(e,n,r):u(e,n,r));return t=null,i}];i&gt;a;a++)if(n=w.relative[e[a].type])c=[p(f(c),n)];else{if(n=w.filter[e[a].type].apply(null,e[a].matches),n[j]){for(r=++a;i&gt;r&amp;&amp;!w.relative[e[r].type];r++);return m(a&gt;1&amp;&amp;f(c),a&gt;1&amp;&amp;h(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(lt,"$1"),n,r&gt;a&amp;&amp;y(e.slice(a,r)),i&gt;r&amp;&amp;y(e=e.slice(r)),i&gt;r&amp;&amp;h(e))}c.push(n)}return f(c)}function b(e,n){var i=n.length&gt;0,o=e.length&gt;0,s=function(r,s,a,l,u){var c,d,h,p=0,f="0",v=r&amp;&amp;[],m=[],y=T,b=r||o&amp;&amp;w.find.TAG("*",u),_=B+=null==y?1:Math.random()||.1,C=b.length;for(u&amp;&amp;(T=s!==A&amp;&amp;s);f!==C&amp;&amp;null!=(c=b[f]);f++){if(o&amp;&amp;c){for(d=0;h=e[d++];)if(h(c,s,a)){l.push(c);break}u&amp;&amp;(B=_)}i&amp;&amp;((c=!h&amp;&amp;c)&amp;&amp;p--,r&amp;&amp;v.push(c))}if(p+=f,i&amp;&amp;f!==p){for(d=0;h=n[d++];)h(v,m,s,a);if(r){if(p&gt;0)for(;f--;)v[f]||m[f]||(m[f]=Z.call(l));m=g(m)}Y.apply(l,m),u&amp;&amp;!r&amp;&amp;m.length&gt;0&amp;&amp;p+n.length&gt;1&amp;&amp;t.uniqueSort(l)}return u&amp;&amp;(B=_,T=y),v};return i?r(s):s}var _,C,w,S,x,E,L,k,T,H,$,P,A,q,N,I,O,D,M,j="sizzle"+1*new Date,F=e.document,B=0,R=0,V=n(),U=n(),W=n(),z=function(e,t){return e===t&amp;&amp;($=!0),0},X=1&lt;&lt;31,J={}.hasOwnProperty,Q=[],Z=Q.pop,G=Q.push,Y=Q.push,K=Q.slice,et=function(e,t){for(var n=0,r=e.length;r&gt;n;n++)if(e[n]===t)return n;return-1},tt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="\\["+nt+"*("+rt+")(?:"+nt+"*([*^$|!~]?=)"+nt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+nt+"*\\]",st=":("+rt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ot+")*)|.*)\\)|)",at=new RegExp(nt+"+","g"),lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ut=new RegExp("^"+nt+"*,"+nt+"*"),ct=new RegExp("^"+nt+"*([&gt;+~]|"+nt+")"+nt+"*"),dt=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),ht=new RegExp(st),pt=new RegExp("^"+it+"$"),ft={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+ot),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+tt+")$","i"),needsContext:new RegExp("^"+nt+"*[&gt;+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},vt=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,mt=/^[^{]+\{\s*\[native \w/,yt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,bt=/[+~]/,_t=/'|\\/g,Ct=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),wt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0&gt;r?String.fromCharCode(r+65536):String.fromCharCode(r&gt;&gt;10|55296,1023&amp;r|56320)},St=function(){P()};try{Y.apply(Q=K.call(F.childNodes),F.childNodes),Q[F.childNodes.length].nodeType}catch(xt){Y={apply:Q.length?function(e,t){G.apply(e,K.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}C=t.support={},x=t.isXML=function(e){var t=e&amp;&amp;(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},P=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:F;return r!==A&amp;&amp;9===r.nodeType&amp;&amp;r.documentElement?(A=r,q=r.documentElement,n=r.defaultView,n&amp;&amp;n!==n.top&amp;&amp;(n.addEventListener?n.addEventListener("unload",St,!1):n.attachEvent&amp;&amp;n.attachEvent("onunload",St)),N=!x(r),C.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),C.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),C.getElementsByClassName=mt.test(r.getElementsByClassName),C.getById=i(function(e){return q.appendChild(e).id=j,!r.getElementsByName||!r.getElementsByName(j).length}),C.getById?(w.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&amp;&amp;N){var n=t.getElementById(e);return n&amp;&amp;n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ct,wt);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ct,wt);return function(e){var n="undefined"!=typeof e.getAttributeNode&amp;&amp;e.getAttributeNode("id");return n&amp;&amp;n.value===t}}),w.find.TAG=C.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):C.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&amp;&amp;r.push(n);return r}return o},w.find.CLASS=C.getElementsByClassName&amp;&amp;function(e,t){return N?t.getElementsByClassName(e):void 0},O=[],I=[],(C.qsa=mt.test(r.querySelectorAll))&amp;&amp;(i(function(e){q.appendChild(e).innerHTML="&lt;a id='"+j+"'&gt;&lt;/a&gt;&lt;select id='"+j+"-\f]' msallowcapture=''&gt;&lt;option selected=''&gt;&lt;/option&gt;&lt;/select&gt;",e.querySelectorAll("[msallowcapture^='']").length&amp;&amp;I.push("[*^$]="+nt+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||I.push("\\["+nt+"*(?:value|"+tt+")"),e.querySelectorAll("[id~="+j+"-]").length||I.push("~="),e.querySelectorAll(":checked").length||I.push(":checked"),e.querySelectorAll("a#"+j+"+*").length||I.push(".#.+[+~]")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&amp;&amp;I.push("name"+nt+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||I.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),I.push(",.*:")})),(C.matchesSelector=mt.test(D=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&amp;&amp;i(function(e){C.disconnectedMatch=D.call(e,"div"),D.call(e,"[s!='']:x"),O.push("!=",st)}),I=I.length&amp;&amp;new RegExp(I.join("|")),O=O.length&amp;&amp;new RegExp(O.join("|")),t=mt.test(q.compareDocumentPosition),M=t||mt.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&amp;&amp;t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&amp;&amp;16&amp;e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},z=t?function(e,t){if(e===t)return $=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&amp;n||!C.sortDetached&amp;&amp;t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===F&amp;&amp;M(F,e)?-1:t===r||t.ownerDocument===F&amp;&amp;M(F,t)?1:H?et(H,e)-et(H,t):0:4&amp;n?-1:1)}:function(e,t){if(e===t)return $=!0,0;var n,i=0,o=e.parentNode,a=t.parentNode,l=[e],u=[t];if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:H?et(H,e)-et(H,t):0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;l[i]===u[i];)i++;return i?s(l[i],u[i]):l[i]===F?-1:u[i]===F?1:0},r):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&amp;&amp;P(e),n=n.replace(dt,"='$1']"),!(!C.matchesSelector||!N||O&amp;&amp;O.test(n)||I&amp;&amp;I.test(n)))try{var r=D.call(e,n);if(r||C.disconnectedMatch||e.document&amp;&amp;11!==e.document.nodeType)return r}catch(i){}return t(n,A,null,[e]).length&gt;0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&amp;&amp;P(e),M(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&amp;&amp;P(e);var n=w.attrHandle[t.toLowerCase()],r=n&amp;&amp;J.call(w.attrHandle,t.toLowerCase())?n(e,t,!N):void 0;return void 0!==r?r:C.attributes||!N?e.getAttribute(t):(r=e.getAttributeNode(t))&amp;&amp;r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if($=!C.detectDuplicates,H=!C.sortStable&amp;&amp;e.slice(0),e.sort(z),$){for(;t=e[i++];)t===e[i]&amp;&amp;(r=n.push(i));for(;r--;)e.splice(n[r],1)}return H=null,e},S=t.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+=S(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=S(t);return n},w=t.selectors={cacheLength:50,createPseudo:r,match:ft,attrHandle:{},find:{},relative:{"&gt;":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ct,wt),e[3]=(e[3]||e[4]||e[5]||"").replace(Ct,wt),"~="===e[2]&amp;&amp;(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]||t.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]&amp;&amp;t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&amp;&amp;e[2];return ft.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&amp;&amp;ht.test(n)&amp;&amp;(t=E(n,!0))&amp;&amp;(t=n.indexOf(")",n.length-t)-n.length)&amp;&amp;(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(Ct,wt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&amp;&amp;e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+nt+")"+e+"("+nt+"|$)"))&amp;&amp;V(e,function(e){return t.test("string"==typeof e.className&amp;&amp;e.className||"undefined"!=typeof e.getAttribute&amp;&amp;e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&amp;&amp;0===o.indexOf(r):"*="===n?r&amp;&amp;o.indexOf(r)&gt;-1:"$="===n?r&amp;&amp;o.slice(-r.length)===r:"~="===n?(" "+o.replace(at," ")+" ").indexOf(r)&gt;-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&amp;&amp;0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,h,p,f,v=o!==s?"nextSibling":"previousSibling",g=t.parentNode,m=a&amp;&amp;t.nodeName.toLowerCase(),y=!l&amp;&amp;!a;if(g){if(o){for(;v;){for(d=t;d=d[v];)if(a?d.nodeName.toLowerCase()===m:1===d.nodeType)return!1;f=v="only"===e&amp;&amp;!f&amp;&amp;"nextSibling"}return!0}if(f=[s?g.firstChild:g.lastChild],s&amp;&amp;y){for(c=g[j]||(g[j]={}),u=c[e]||[],p=u[0]===B&amp;&amp;u[1],h=u[0]===B&amp;&amp;u[2],d=p&amp;&amp;g.childNodes[p];d=++p&amp;&amp;d&amp;&amp;d[v]||(h=p=0)||f.pop();)if(1===d.nodeType&amp;&amp;++h&amp;&amp;d===t){c[e]=[B,p,h];break}}else if(y&amp;&amp;(u=(t[j]||(t[j]={}))[e])&amp;&amp;u[0]===B)h=u[1];else for(;(d=++p&amp;&amp;d&amp;&amp;d[v]||(h=p=0)||f.pop())&amp;&amp;((a?d.nodeName.toLowerCase()!==m:1!==d.nodeType)||!++h||(y&amp;&amp;((d[j]||(d[j]={}))[e]=[B,h]),d!==t)););return h-=i,h===r||h%r===0&amp;&amp;h/r&gt;=0}}},PSEUDO:function(e,n){var i,o=w.pseudos[e]||w.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[j]?o(n):o.length&gt;1?(i=[e,e,"",n],w.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),s=i.length;s--;)r=et(e,i[s]),e[r]=!(t[r]=i[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=L(e.replace(lt,"$1"));return i[j]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&amp;&amp;(e[a]=!(t[a]=o))
}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length&gt;0}}),contains:r(function(e){return e=e.replace(Ct,wt),function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)&gt;-1}}),lang:r(function(e){return pt.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(Ct,wt).toLowerCase(),function(t){var n;do if(n=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&amp;&amp;1===t.nodeType);return!1}}),target:function(t){var n=e.location&amp;&amp;e.location.hash;return n&amp;&amp;n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===A.activeElement&amp;&amp;(!A.hasFocus||A.hasFocus())&amp;&amp;!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&amp;&amp;!!e.checked||"option"===t&amp;&amp;!!e.selected},selected:function(e){return e.parentNode&amp;&amp;e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType&lt;6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return gt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&amp;&amp;"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&amp;&amp;"text"===e.type&amp;&amp;(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0&gt;n?n+t:n]}),even:u(function(e,t){for(var n=0;t&gt;n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t&gt;n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=0&gt;n?n+t:n;--r&gt;=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=0&gt;n?n+t:n;++r&lt;t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(_ in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[_]=a(_);for(_ in{submit:!0,reset:!0})w.pseudos[_]=l(_);return d.prototype=w.filters=w.pseudos,w.setFilters=new d,E=t.tokenize=function(e,n){var r,i,o,s,a,l,u,c=U[e+" "];if(c)return n?0:c.slice(0);for(a=e,l=[],u=w.preFilter;a;){(!r||(i=ut.exec(a)))&amp;&amp;(i&amp;&amp;(a=a.slice(i[0].length)||a),l.push(o=[])),r=!1,(i=ct.exec(a))&amp;&amp;(r=i.shift(),o.push({value:r,type:i[0].replace(lt," ")}),a=a.slice(r.length));for(s in w.filter)!(i=ft[s].exec(a))||u[s]&amp;&amp;!(i=u[s](i))||(r=i.shift(),o.push({value:r,type:s,matches:i}),a=a.slice(r.length));if(!r)break}return n?a.length:a?t.error(e):U(e,l).slice(0)},L=t.compile=function(e,t){var n,r=[],i=[],o=W[e+" "];if(!o){for(t||(t=E(e)),n=t.length;n--;)o=y(t[n]),o[j]?r.push(o):i.push(o);o=W(e,b(i,r)),o.selector=e}return o},k=t.select=function(e,t,n,r){var i,o,s,a,l,u="function"==typeof e&amp;&amp;e,d=!r&amp;&amp;E(e=u.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length&gt;2&amp;&amp;"ID"===(s=o[0]).type&amp;&amp;C.getById&amp;&amp;9===t.nodeType&amp;&amp;N&amp;&amp;w.relative[o[1].type]){if(t=(w.find.ID(s.matches[0].replace(Ct,wt),t)||[])[0],!t)return n;u&amp;&amp;(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=ft.needsContext.test(e)?0:o.length;i--&amp;&amp;(s=o[i],!w.relative[a=s.type]);)if((l=w.find[a])&amp;&amp;(r=l(s.matches[0].replace(Ct,wt),bt.test(o[0].type)&amp;&amp;c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&amp;&amp;h(o),!e)return Y.apply(n,r),n;break}}return(u||L(e,d))(r,t,!N,n,bt.test(e)&amp;&amp;c(t.parentNode)||t),n},C.sortStable=j.split("").sort(z).join("")===j,C.detectDuplicates=!!$,P(),C.sortDetached=i(function(e){return 1&amp;e.compareDocumentPosition(A.createElement("div"))}),i(function(e){return e.innerHTML="&lt;a href='#'&gt;&lt;/a&gt;","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),C.attributes&amp;&amp;i(function(e){return e.innerHTML="&lt;input/&gt;",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(tt,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&amp;&amp;r.specified?r.value:null}),t}(e);K.find=it,K.expr=it.selectors,K.expr[":"]=K.expr.pseudos,K.unique=it.uniqueSort,K.text=it.getText,K.isXMLDoc=it.isXML,K.contains=it.contains;var ot=K.expr.match.needsContext,st=/^&lt;(\w+)\s*\/?&gt;(?:&lt;\/\1&gt;|)$/,at=/^.[^:#\[\.,]*$/;K.filter=function(e,t,n){var r=t[0];return n&amp;&amp;(e=":not("+e+")"),1===t.length&amp;&amp;1===r.nodeType?K.find.matchesSelector(r,e)?[r]:[]:K.find.matches(e,K.grep(t,function(e){return 1===e.nodeType}))},K.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(K(e).filter(function(){for(t=0;n&gt;t;t++)if(K.contains(i[t],this))return!0}));for(t=0;n&gt;t;t++)K.find(e,i[t],r);return r=this.pushStack(n&gt;1?K.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&amp;&amp;ot.test(e)?K(e):e||[],!1).length}});var lt,ut=/^(?:\s*(&lt;[\w\W]+&gt;)[^&gt;]*|#([\w-]*))$/,ct=K.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="&lt;"===e[0]&amp;&amp;"&gt;"===e[e.length-1]&amp;&amp;e.length&gt;=3?[null,e,null]:ut.exec(e),!n||!n[1]&amp;&amp;t)return!t||t.jquery?(t||lt).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof K?t[0]:t,K.merge(this,K.parseHTML(n[1],t&amp;&amp;t.nodeType?t.ownerDocument||t:G,!0)),st.test(n[1])&amp;&amp;K.isPlainObject(t))for(n in t)K.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=G.getElementById(n[2]),r&amp;&amp;r.parentNode&amp;&amp;(this.length=1,this[0]=r),this.context=G,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):K.isFunction(e)?"undefined"!=typeof lt.ready?lt.ready(e):e(K):(void 0!==e.selector&amp;&amp;(this.selector=e.selector,this.context=e.context),K.makeArray(e,this))};ct.prototype=K.fn,lt=K(G);var dt=/^(?:parents|prev(?:Until|All))/,ht={children:!0,contents:!0,next:!0,prev:!0};K.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&amp;&amp;9!==e.nodeType;)if(1===e.nodeType){if(i&amp;&amp;K(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&amp;&amp;e!==t&amp;&amp;n.push(e);return n}}),K.fn.extend({has:function(e){var t=K(e,this),n=t.length;return this.filter(function(){for(var e=0;n&gt;e;e++)if(K.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],s=ot.test(e)||"string"!=typeof e?K(e,t||this.context):0;i&gt;r;r++)for(n=this[r];n&amp;&amp;n!==t;n=n.parentNode)if(n.nodeType&lt;11&amp;&amp;(s?s.index(n)&gt;-1:1===n.nodeType&amp;&amp;K.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length&gt;1?K.unique(o):o)},index:function(e){return e?"string"==typeof e?z.call(K(e),this[0]):z.call(this,e.jquery?e[0]:e):this[0]&amp;&amp;this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(K.unique(K.merge(this.get(),K(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),K.each({parent:function(e){var t=e.parentNode;return t&amp;&amp;11!==t.nodeType?t:null},parents:function(e){return K.dir(e,"parentNode")},parentsUntil:function(e,t,n){return K.dir(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return K.dir(e,"nextSibling")},prevAll:function(e){return K.dir(e,"previousSibling")},nextUntil:function(e,t,n){return K.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return K.dir(e,"previousSibling",n)},siblings:function(e){return K.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return K.sibling(e.firstChild)},contents:function(e){return e.contentDocument||K.merge([],e.childNodes)}},function(e,t){K.fn[e]=function(n,r){var i=K.map(this,t,n);return"Until"!==e.slice(-5)&amp;&amp;(r=n),r&amp;&amp;"string"==typeof r&amp;&amp;(i=K.filter(r,i)),this.length&gt;1&amp;&amp;(ht[e]||K.unique(i),dt.test(e)&amp;&amp;i.reverse()),this.pushStack(i)}});var pt=/\S+/g,ft={};K.Callbacks=function(e){e="string"==typeof e?ft[e]||o(e):K.extend({},e);var t,n,r,i,s,a,l=[],u=!e.once&amp;&amp;[],c=function(o){for(t=e.memory&amp;&amp;o,n=!0,a=i||0,i=0,s=l.length,r=!0;l&amp;&amp;s&gt;a;a++)if(l[a].apply(o[0],o[1])===!1&amp;&amp;e.stopOnFalse){t=!1;break}r=!1,l&amp;&amp;(u?u.length&amp;&amp;c(u.shift()):t?l=[]:d.disable())},d={add:function(){if(l){var n=l.length;!function o(t){K.each(t,function(t,n){var r=K.type(n);"function"===r?e.unique&amp;&amp;d.has(n)||l.push(n):n&amp;&amp;n.length&amp;&amp;"string"!==r&amp;&amp;o(n)})}(arguments),r?s=l.length:t&amp;&amp;(i=n,c(t))}return this},remove:function(){return l&amp;&amp;K.each(arguments,function(e,t){for(var n;(n=K.inArray(t,l,n))&gt;-1;)l.splice(n,1),r&amp;&amp;(s&gt;=n&amp;&amp;s--,a&gt;=n&amp;&amp;a--)}),this},has:function(e){return e?K.inArray(e,l)&gt;-1:!(!l||!l.length)},empty:function(){return l=[],s=0,this},disable:function(){return l=u=t=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,t||d.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||n&amp;&amp;!u||(t=t||[],t=[e,t.slice?t.slice():t],r?u.push(t):c(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},K.extend({Deferred:function(e){var t=[["resolve","done",K.Callbacks("once memory"),"resolved"],["reject","fail",K.Callbacks("once memory"),"rejected"],["notify","progress",K.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return K.Deferred(function(n){K.each(t,function(t,o){var s=K.isFunction(e[t])&amp;&amp;e[t];i[o[1]](function(){var e=s&amp;&amp;s.apply(this,arguments);e&amp;&amp;K.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?K.extend(e,r):r}},i={};return r.pipe=r.then,K.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&amp;&amp;s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&amp;&amp;e.call(i,i),i},when:function(e){var t,n,r,i=0,o=V.call(arguments),s=o.length,a=1!==s||e&amp;&amp;K.isFunction(e.promise)?s:0,l=1===a?e:K.Deferred(),u=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length&gt;1?V.call(arguments):i,r===t?l.notifyWith(n,r):--a||l.resolveWith(n,r)}};if(s&gt;1)for(t=new Array(s),n=new Array(s),r=new Array(s);s&gt;i;i++)o[i]&amp;&amp;K.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,t)):--a;return a||l.resolveWith(r,o),l.promise()}});var vt;K.fn.ready=function(e){return K.ready.promise().done(e),this},K.extend({isReady:!1,readyWait:1,holdReady:function(e){e?K.readyWait++:K.ready(!0)},ready:function(e){(e===!0?--K.readyWait:K.isReady)||(K.isReady=!0,e!==!0&amp;&amp;--K.readyWait&gt;0||(vt.resolveWith(G,[K]),K.fn.triggerHandler&amp;&amp;(K(G).triggerHandler("ready"),K(G).off("ready"))))}}),K.ready.promise=function(t){return vt||(vt=K.Deferred(),"complete"===G.readyState?setTimeout(K.ready):(G.addEventListener("DOMContentLoaded",s,!1),e.addEventListener("load",s,!1))),vt.promise(t)},K.ready.promise();var gt=K.access=function(e,t,n,r,i,o,s){var a=0,l=e.length,u=null==n;if("object"===K.type(n)){i=!0;for(a in n)K.access(e,t,a,n[a],!0,o,s)}else if(void 0!==r&amp;&amp;(i=!0,K.isFunction(r)||(s=!0),u&amp;&amp;(s?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(K(e),n)})),t))for(;l&gt;a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:u?t.call(e):l?t(e[0],n):o};K.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},a.uid=1,a.accepts=K.acceptData,a.prototype={key:function(e){if(!a.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=a.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,K.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(K.isEmptyObject(o))K.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&amp;&amp;"string"==typeof t&amp;&amp;void 0===n?(r=this.get(e,t),void 0!==r?r:this.get(e,K.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),s=this.cache[o];if(void 0===t)this.cache[o]={};else{K.isArray(t)?r=t.concat(t.map(K.camelCase)):(i=K.camelCase(t),t in s?r=[t,i]:(r=i,r=r in s?[r]:r.match(pt)||[])),n=r.length;for(;n--;)delete s[r[n]]}},hasData:function(e){return!K.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&amp;&amp;delete this.cache[e[this.expando]]}};var mt=new a,yt=new a,bt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_t=/([A-Z])/g;K.extend({hasData:function(e){return yt.hasData(e)||mt.hasData(e)},data:function(e,t,n){return yt.access(e,t,n)},removeData:function(e,t){yt.remove(e,t)},_data:function(e,t,n){return mt.access(e,t,n)},_removeData:function(e,t){mt.remove(e,t)}}),K.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&amp;&amp;o.attributes;if(void 0===e){if(this.length&amp;&amp;(i=yt.get(o),1===o.nodeType&amp;&amp;!mt.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&amp;&amp;(r=s[n].name,0===r.indexOf("data-")&amp;&amp;(r=K.camelCase(r.slice(5)),l(o,r,i[r])));mt.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){yt.set(this,e)}):gt(this,function(t){var n,r=K.camelCase(e);if(o&amp;&amp;void 0===t){if(n=yt.get(o,e),void 0!==n)return n;if(n=yt.get(o,r),void 0!==n)return n;if(n=l(o,r,void 0),void 0!==n)return n}else this.each(function(){var n=yt.get(this,r);yt.set(this,r,t),-1!==e.indexOf("-")&amp;&amp;void 0!==n&amp;&amp;yt.set(this,e,t)})},null,t,arguments.length&gt;1,null,!0)},removeData:function(e){return this.each(function(){yt.remove(this,e)})}}),K.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=mt.get(e,t),n&amp;&amp;(!r||K.isArray(n)?r=mt.access(e,t,K.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=K.queue(e,t),r=n.length,i=n.shift(),o=K._queueHooks(e,t),s=function(){K.dequeue(e,t)};"inprogress"===i&amp;&amp;(i=n.shift(),r--),i&amp;&amp;("fx"===t&amp;&amp;n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&amp;&amp;o&amp;&amp;o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return mt.get(e,n)||mt.access(e,n,{empty:K.Callbacks("once memory").add(function(){mt.remove(e,[t+"queue",n])})})}}),K.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&amp;&amp;(t=e,e="fx",n--),arguments.length&lt;n?K.queue(this[0],e):void 0===t?this:this.each(function(){var n=K.queue(this,e,t);K._queueHooks(this,e),"fx"===e&amp;&amp;"inprogress"!==n[0]&amp;&amp;K.dequeue(this,e)})},dequeue:function(e){return this.each(function(){K.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=K.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&amp;&amp;(t=e,e=void 0),e=e||"fx";s--;)n=mt.get(o[s],e+"queueHooks"),n&amp;&amp;n.empty&amp;&amp;(r++,n.empty.add(a));return a(),i.promise(t)}});var Ct=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,wt=["Top","Right","Bottom","Left"],St=function(e,t){return e=t||e,"none"===K.css(e,"display")||!K.contains(e.ownerDocument,e)},xt=/^(?:checkbox|radio)$/i;!function(){var e=G.createDocumentFragment(),t=e.appendChild(G.createElement("div")),n=G.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),Z.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="&lt;textarea&gt;x&lt;/textarea&gt;",Z.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Et="undefined";Z.focusinBubbles="onfocusin"in e;var Lt=/^key/,kt=/^(?:mouse|pointer|contextmenu)|click/,Tt=/^(?:focusinfocus|focusoutblur)$/,Ht=/^([^.]*)(?:\.(.+)|)$/;K.event={global:{},add:function(e,t,n,r,i){var o,s,a,l,u,c,d,h,p,f,v,g=mt.get(e);if(g)for(n.handler&amp;&amp;(o=n,n=o.handler,i=o.selector),n.guid||(n.guid=K.guid++),(l=g.events)||(l=g.events={}),(s=g.handle)||(s=g.handle=function(t){return typeof K!==Et&amp;&amp;K.event.triggered!==t.type?K.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(pt)||[""],u=t.length;u--;)a=Ht.exec(t[u])||[],p=v=a[1],f=(a[2]||"").split(".").sort(),p&amp;&amp;(d=K.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=K.event.special[p]||{},c=K.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&amp;&amp;K.expr.match.needsContext.test(i),namespace:f.join(".")},o),(h=l[p])||(h=l[p]=[],h.delegateCount=0,d.setup&amp;&amp;d.setup.call(e,r,f,s)!==!1||e.addEventListener&amp;&amp;e.addEventListener(p,s,!1)),d.add&amp;&amp;(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),K.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,s,a,l,u,c,d,h,p,f,v,g=mt.hasData(e)&amp;&amp;mt.get(e);if(g&amp;&amp;(l=g.events)){for(t=(t||"").match(pt)||[""],u=t.length;u--;)if(a=Ht.exec(t[u])||[],p=v=a[1],f=(a[2]||"").split(".").sort(),p){for(d=K.event.special[p]||{},p=(r?d.delegateType:d.bindType)||p,h=l[p]||[],a=a[2]&amp;&amp;new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)c=h[o],!i&amp;&amp;v!==c.origType||n&amp;&amp;n.guid!==c.guid||a&amp;&amp;!a.test(c.namespace)||r&amp;&amp;r!==c.selector&amp;&amp;("**"!==r||!c.selector)||(h.splice(o,1),c.selector&amp;&amp;h.delegateCount--,d.remove&amp;&amp;d.remove.call(e,c));s&amp;&amp;!h.length&amp;&amp;(d.teardown&amp;&amp;d.teardown.call(e,f,g.handle)!==!1||K.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)K.event.remove(e,p+t[u],n,r,!0);K.isEmptyObject(l)&amp;&amp;(delete g.handle,mt.remove(e,"events"))}},trigger:function(t,n,r,i){var o,s,a,l,u,c,d,h=[r||G],p=Q.call(t,"type")?t.type:t,f=Q.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||G,3!==r.nodeType&amp;&amp;8!==r.nodeType&amp;&amp;!Tt.test(p+K.event.triggered)&amp;&amp;(p.indexOf(".")&gt;=0&amp;&amp;(f=p.split("."),p=f.shift(),f.sort()),u=p.indexOf(":")&lt;0&amp;&amp;"on"+p,t=t[K.expando]?t:new K.Event(p,"object"==typeof t&amp;&amp;t),t.isTrigger=i?2:3,t.namespace=f.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:K.makeArray(n,[t]),d=K.event.special[p]||{},i||!d.trigger||d.trigger.apply(r,n)!==!1)){if(!i&amp;&amp;!d.noBubble&amp;&amp;!K.isWindow(r)){for(l=d.delegateType||p,Tt.test(l+p)||(s=s.parentNode);s;s=s.parentNode)h.push(s),a=s;a===(r.ownerDocument||G)&amp;&amp;h.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=h[o++])&amp;&amp;!t.isPropagationStopped();)t.type=o&gt;1?l:d.bindType||p,c=(mt.get(s,"events")||{})[t.type]&amp;&amp;mt.get(s,"handle"),c&amp;&amp;c.apply(s,n),c=u&amp;&amp;s[u],c&amp;&amp;c.apply&amp;&amp;K.acceptData(s)&amp;&amp;(t.result=c.apply(s,n),t.result===!1&amp;&amp;t.preventDefault());return t.type=p,i||t.isDefaultPrevented()||d._default&amp;&amp;d._default.apply(h.pop(),n)!==!1||!K.acceptData(r)||u&amp;&amp;K.isFunction(r[p])&amp;&amp;!K.isWindow(r)&amp;&amp;(a=r[u],a&amp;&amp;(r[u]=null),K.event.triggered=p,r[p](),K.event.triggered=void 0,a&amp;&amp;(r[u]=a)),t.result}},dispatch:function(e){e=K.event.fix(e);var t,n,r,i,o,s=[],a=V.call(arguments),l=(mt.get(this,"events")||{})[e.type]||[],u=K.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(s=K.event.handlers.call(this,e,l),t=0;(i=s[t++])&amp;&amp;!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&amp;&amp;!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(o.namespace))&amp;&amp;(e.handleObj=o,e.data=o.data,r=((K.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),void 0!==r&amp;&amp;(e.result=r)===!1&amp;&amp;(e.preventDefault(),e.stopPropagation()));return u.postDispatch&amp;&amp;u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,l=e.target;if(a&amp;&amp;l.nodeType&amp;&amp;(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(r=[],n=0;a&gt;n;n++)o=t[n],i=o.selector+" ",void 0===r[i]&amp;&amp;(r[i]=o.needsContext?K(i,this).index(l)&gt;=0:K.find(i,this,null,[l]).length),r[i]&amp;&amp;r.push(o);r.length&amp;&amp;s.push({elem:l,handlers:r})}return a&lt;t.length&amp;&amp;s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&amp;&amp;(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&amp;&amp;null!=t.clientX&amp;&amp;(n=e.target.ownerDocument||G,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&amp;&amp;r.scrollLeft||i&amp;&amp;i.scrollLeft||0)-(r&amp;&amp;r.clientLeft||i&amp;&amp;i.clientLeft||0),e.pageY=t.clientY+(r&amp;&amp;r.scrollTop||i&amp;&amp;i.scrollTop||0)-(r&amp;&amp;r.clientTop||i&amp;&amp;i.clientTop||0)),e.which||void 0===o||(e.which=1&amp;o?1:2&amp;o?3:4&amp;o?2:0),e}},fix:function(e){if(e[K.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=kt.test(i)?this.mouseHooks:Lt.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new K.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=G),3===e.target.nodeType&amp;&amp;(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==d()&amp;&amp;this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===d()&amp;&amp;this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&amp;&amp;this.click&amp;&amp;K.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return K.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&amp;&amp;e.originalEvent&amp;&amp;(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=K.extend(new K.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?K.event.trigger(i,null,t):K.event.dispatch.call(t,i),i.isDefaultPrevented()&amp;&amp;n.preventDefault()}},K.removeEvent=function(e,t,n){e.removeEventListener&amp;&amp;e.removeEventListener(t,n,!1)},K.Event=function(e,t){return this instanceof K.Event?(e&amp;&amp;e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&amp;&amp;e.returnValue===!1?u:c):this.type=e,t&amp;&amp;K.extend(this,t),this.timeStamp=e&amp;&amp;e.timeStamp||K.now(),void(this[K.expando]=!0)):new K.Event(e,t)},K.Event.prototype={isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&amp;&amp;e.preventDefault&amp;&amp;e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&amp;&amp;e.stopPropagation&amp;&amp;e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=u,e&amp;&amp;e.stopImmediatePropagation&amp;&amp;e.stopImmediatePropagation(),this.stopPropagation()}},K.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){K.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&amp;&amp;!K.contains(r,i))&amp;&amp;(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),Z.focusinBubbles||K.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){K.event.simulate(t,e.target,K.event.fix(e),!0)};K.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=mt.access(r,t);i||r.addEventListener(e,n,!0),mt.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=mt.access(r,t)-1;i?mt.access(r,t,i):(r.removeEventListener(e,n,!0),mt.remove(r,t))}}}),K.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&amp;&amp;(n=n||t,t=void 0);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&amp;&amp;null==r?(r=t,n=t=void 0):null==r&amp;&amp;("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=c;else if(!r)return this;return 1===i&amp;&amp;(o=r,r=function(e){return K().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=K.guid++)),this.each(function(){K.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&amp;&amp;e.preventDefault&amp;&amp;e.handleObj)return r=e.handleObj,K(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(t===!1||"function"==typeof t)&amp;&amp;(n=t,t=void 0),n===!1&amp;&amp;(n=c),this.each(function(){K.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){K.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?K.event.trigger(e,t,n,!0):void 0}});var $t=/&lt;(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^&gt;]*)\/&gt;/gi,Pt=/&lt;([\w:]+)/,At=/&lt;|&amp;#?\w+;/,qt=/&lt;(?:script|style|link)/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,It=/^$|\/(?:java|ecma)script/i,Ot=/^true\/(.*)/,Dt=/^\s*&lt;!(?:\[CDATA\[|--)|(?:\]\]|--)&gt;\s*$/g,Mt={option:[1,"&lt;select multiple='multiple'&gt;","&lt;/select&gt;"],thead:[1,"&lt;table&gt;","&lt;/table&gt;"],col:[2,"&lt;table&gt;&lt;colgroup&gt;","&lt;/colgroup&gt;&lt;/table&gt;"],tr:[2,"&lt;table&gt;&lt;tbody&gt;","&lt;/tbody&gt;&lt;/table&gt;"],td:[3,"&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;","&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;"],_default:[0,"",""]};Mt.optgroup=Mt.option,Mt.tbody=Mt.tfoot=Mt.colgroup=Mt.caption=Mt.thead,Mt.th=Mt.td,K.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),l=K.contains(e.ownerDocument,e);if(!(Z.noCloneChecked||1!==e.nodeType&amp;&amp;11!==e.nodeType||K.isXMLDoc(e)))for(s=m(a),o=m(e),r=0,i=o.length;i&gt;r;r++)y(o[r],s[r]);if(t)if(n)for(o=o||m(e),s=s||m(a),r=0,i=o.length;i&gt;r;r++)g(o[r],s[r]);else g(e,a);return s=m(a,"script"),s.length&gt;0&amp;&amp;v(s,!l&amp;&amp;m(e,"script")),a},buildFragment:function(e,t,n,r){for(var i,o,s,a,l,u,c=t.createDocumentFragment(),d=[],h=0,p=e.length;p&gt;h;h++)if(i=e[h],i||0===i)if("object"===K.type(i))K.merge(d,i.nodeType?[i]:i);else if(At.test(i)){for(o=o||c.appendChild(t.createElement("div")),s=(Pt.exec(i)||["",""])[1].toLowerCase(),a=Mt[s]||Mt._default,o.innerHTML=a[1]+i.replace($t,"&lt;$1&gt;&lt;/$2&gt;")+a[2],u=a[0];u--;)o=o.lastChild;K.merge(d,o.childNodes),o=c.firstChild,o.textContent=""}else d.push(t.createTextNode(i));for(c.textContent="",h=0;i=d[h++];)if((!r||-1===K.inArray(i,r))&amp;&amp;(l=K.contains(i.ownerDocument,i),o=m(c.appendChild(i),"script"),l&amp;&amp;v(o),n))for(u=0;i=o[u++];)It.test(i.type||"")&amp;&amp;n.push(i);return c},cleanData:function(e){for(var t,n,r,i,o=K.event.special,s=0;void 0!==(n=e[s]);s++){if(K.acceptData(n)&amp;&amp;(i=n[mt.expando],i&amp;&amp;(t=mt.cache[i]))){if(t.events)for(r in t.events)o[r]?K.event.remove(n,r):K.removeEvent(n,r,t.handle);mt.cache[i]&amp;&amp;delete mt.cache[i]}delete yt.cache[n[yt.expando]]}}}),K.fn.extend({text:function(e){return gt(this,function(e){return void 0===e?K.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&amp;&amp;(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=h(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=h(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&amp;&amp;this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&amp;&amp;this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?K.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||K.cleanData(m(n)),n.parentNode&amp;&amp;(t&amp;&amp;K.contains(n.ownerDocument,n)&amp;&amp;v(m(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&amp;&amp;(K.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return K.clone(this,e,t)})},html:function(e){return gt(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&amp;&amp;1===t.nodeType)return t.innerHTML;if("string"==typeof e&amp;&amp;!qt.test(e)&amp;&amp;!Mt[(Pt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace($t,"&lt;$1&gt;&lt;/$2&gt;");try{for(;r&gt;n;n++)t=this[n]||{},1===t.nodeType&amp;&amp;(K.cleanData(m(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&amp;&amp;this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,K.cleanData(m(this)),e&amp;&amp;e.replaceChild(t,this)}),e&amp;&amp;(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=U.apply([],e);var n,r,i,o,s,a,l=0,u=this.length,c=this,d=u-1,h=e[0],v=K.isFunction(h);if(v||u&gt;1&amp;&amp;"string"==typeof h&amp;&amp;!Z.checkClone&amp;&amp;Nt.test(h))return this.each(function(n){var r=c.eq(n);v&amp;&amp;(e[0]=h.call(this,n,r.html())),r.domManip(e,t)});if(u&amp;&amp;(n=K.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&amp;&amp;(n=r),r)){for(i=K.map(m(n,"script"),p),o=i.length;u&gt;l;l++)s=n,l!==d&amp;&amp;(s=K.clone(s,!0,!0),o&amp;&amp;K.merge(i,m(s,"script"))),t.call(this[l],s,l);if(o)for(a=i[i.length-1].ownerDocument,K.map(i,f),l=0;o&gt;l;l++)s=i[l],It.test(s.type||"")&amp;&amp;!mt.access(s,"globalEval")&amp;&amp;K.contains(a,s)&amp;&amp;(s.src?K._evalUrl&amp;&amp;K._evalUrl(s.src):K.globalEval(s.textContent.replace(Dt,"")))}return this}}),K.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){K.fn[e]=function(e){for(var n,r=[],i=K(e),o=i.length-1,s=0;o&gt;=s;s++)n=s===o?this:this.clone(!0),K(i[s])[t](n),W.apply(r,n.get());return this.pushStack(r)}});var jt,Ft={},Bt=/^margin/,Rt=new RegExp("^("+Ct+")(?!px)[a-z%]+$","i"),Vt=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)};!function(){function t(){s.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",s.innerHTML="",i.appendChild(o);var t=e.getComputedStyle(s,null);n="1%"!==t.top,r="4px"===t.width,i.removeChild(o)}var n,r,i=G.documentElement,o=G.createElement("div"),s=G.createElement("div");s.style&amp;&amp;(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",Z.clearCloneStyle="content-box"===s.style.backgroundClip,o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",o.appendChild(s),e.getComputedStyle&amp;&amp;K.extend(Z,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return null==r&amp;&amp;t(),r},reliableMarginRight:function(){var t,n=s.appendChild(G.createElement("div"));return n.style.cssText=s.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",s.style.width="1px",i.appendChild(o),t=!parseFloat(e.getComputedStyle(n,null).marginRight),i.removeChild(o),s.removeChild(n),t}}))}(),K.swap=function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i};var Ut=/^(none|table(?!-c[ea]).+)/,Wt=new RegExp("^("+Ct+")(.*)$","i"),zt=new RegExp("^([+-])=("+Ct+")","i"),Xt={position:"absolute",visibility:"hidden",display:"block"},Jt={letterSpacing:"0",fontWeight:"400"},Qt=["Webkit","O","Moz","ms"];K.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=C(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&amp;&amp;3!==e.nodeType&amp;&amp;8!==e.nodeType&amp;&amp;e.style){var i,o,s,a=K.camelCase(t),l=e.style;return t=K.cssProps[a]||(K.cssProps[a]=S(l,a)),s=K.cssHooks[t]||K.cssHooks[a],void 0===n?s&amp;&amp;"get"in s&amp;&amp;void 0!==(i=s.get(e,!1,r))?i:l[t]:(o=typeof n,"string"===o&amp;&amp;(i=zt.exec(n))&amp;&amp;(n=(i[1]+1)*i[2]+parseFloat(K.css(e,t)),o="number"),void(null!=n&amp;&amp;n===n&amp;&amp;("number"!==o||K.cssNumber[a]||(n+="px"),Z.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&amp;&amp;"set"in s&amp;&amp;void 0===(n=s.set(e,n,r))||(l[t]=n))))}},css:function(e,t,n,r){var i,o,s,a=K.camelCase(t);return t=K.cssProps[a]||(K.cssProps[a]=S(e.style,a)),s=K.cssHooks[t]||K.cssHooks[a],s&amp;&amp;"get"in s&amp;&amp;(i=s.get(e,!0,n)),void 0===i&amp;&amp;(i=C(e,t,r)),"normal"===i&amp;&amp;t in Jt&amp;&amp;(i=Jt[t]),""===n||n?(o=parseFloat(i),n===!0||K.isNumeric(o)?o||0:i):i
}}),K.each(["height","width"],function(e,t){K.cssHooks[t]={get:function(e,n,r){return n?Ut.test(K.css(e,"display"))&amp;&amp;0===e.offsetWidth?K.swap(e,Xt,function(){return L(e,t,r)}):L(e,t,r):void 0},set:function(e,n,r){var i=r&amp;&amp;Vt(e);return x(e,n,r?E(e,t,r,"border-box"===K.css(e,"boxSizing",!1,i),i):0)}}}),K.cssHooks.marginRight=w(Z.reliableMarginRight,function(e,t){return t?K.swap(e,{display:"inline-block"},C,[e,"marginRight"]):void 0}),K.each({margin:"",padding:"",border:"Width"},function(e,t){K.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4&gt;r;r++)i[e+wt[r]+t]=o[r]||o[r-2]||o[0];return i}},Bt.test(e)||(K.cssHooks[e+t].set=x)}),K.fn.extend({css:function(e,t){return gt(this,function(e,t,n){var r,i,o={},s=0;if(K.isArray(t)){for(r=Vt(e),i=t.length;i&gt;s;s++)o[t[s]]=K.css(e,t[s],!1,r);return o}return void 0!==n?K.style(e,t,n):K.css(e,t)},e,t,arguments.length&gt;1)},show:function(){return k(this,!0)},hide:function(){return k(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){St(this)?K(this).show():K(this).hide()})}}),K.Tween=T,T.prototype={constructor:T,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(K.cssNumber[n]?"":"px")},cur:function(){var e=T.propHooks[this.prop];return e&amp;&amp;e.get?e.get(this):T.propHooks._default.get(this)},run:function(e){var t,n=T.propHooks[this.prop];return this.pos=t=this.options.duration?K.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&amp;&amp;this.options.step.call(this.elem,this.now,this),n&amp;&amp;n.set?n.set(this):T.propHooks._default.set(this),this}},T.prototype.init.prototype=T.prototype,T.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&amp;&amp;null!=e.elem.style[e.prop]?(t=K.css(e.elem,e.prop,""),t&amp;&amp;"auto"!==t?t:0):e.elem[e.prop]},set:function(e){K.fx.step[e.prop]?K.fx.step[e.prop](e):e.elem.style&amp;&amp;(null!=e.elem.style[K.cssProps[e.prop]]||K.cssHooks[e.prop])?K.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},T.propHooks.scrollTop=T.propHooks.scrollLeft={set:function(e){e.elem.nodeType&amp;&amp;e.elem.parentNode&amp;&amp;(e.elem[e.prop]=e.now)}},K.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},K.fx=T.prototype.init,K.fx.step={};var Zt,Gt,Yt=/^(?:toggle|show|hide)$/,Kt=new RegExp("^(?:([+-])=|)("+Ct+")([a-z%]*)$","i"),en=/queueHooks$/,tn=[A],nn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Kt.exec(t),o=i&amp;&amp;i[3]||(K.cssNumber[e]?"":"px"),s=(K.cssNumber[e]||"px"!==o&amp;&amp;+r)&amp;&amp;Kt.exec(K.css(n.elem,e)),a=1,l=20;if(s&amp;&amp;s[3]!==o){o=o||s[3],i=i||[],s=+r||1;do a=a||".5",s/=a,K.style(n.elem,e,s+o);while(a!==(a=n.cur()/r)&amp;&amp;1!==a&amp;&amp;--l)}return i&amp;&amp;(s=n.start=+s||+r||0,n.unit=o,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};K.Animation=K.extend(N,{tweener:function(e,t){K.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i&gt;r;r++)n=e[r],nn[n]=nn[n]||[],nn[n].unshift(t)},prefilter:function(e,t){t?tn.unshift(e):tn.push(e)}}),K.speed=function(e,t,n){var r=e&amp;&amp;"object"==typeof e?K.extend({},e):{complete:n||!n&amp;&amp;t||K.isFunction(e)&amp;&amp;e,duration:e,easing:n&amp;&amp;t||t&amp;&amp;!K.isFunction(t)&amp;&amp;t};return r.duration=K.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in K.fx.speeds?K.fx.speeds[r.duration]:K.fx.speeds._default,(null==r.queue||r.queue===!0)&amp;&amp;(r.queue="fx"),r.old=r.complete,r.complete=function(){K.isFunction(r.old)&amp;&amp;r.old.call(this),r.queue&amp;&amp;K.dequeue(this,r.queue)},r},K.fn.extend({fadeTo:function(e,t,n,r){return this.filter(St).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=K.isEmptyObject(e),o=K.speed(t,n,r),s=function(){var t=N(this,K.extend({},e),o);(i||mt.get(this,"finish"))&amp;&amp;t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&amp;&amp;(n=t,t=e,e=void 0),t&amp;&amp;e!==!1&amp;&amp;this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&amp;&amp;e+"queueHooks",o=K.timers,s=mt.get(this);if(i)s[i]&amp;&amp;s[i].stop&amp;&amp;r(s[i]);else for(i in s)s[i]&amp;&amp;s[i].stop&amp;&amp;en.test(i)&amp;&amp;r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&amp;&amp;o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&amp;&amp;K.dequeue(this,e)})},finish:function(e){return e!==!1&amp;&amp;(e=e||"fx"),this.each(function(){var t,n=mt.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=K.timers,s=r?r.length:0;for(n.finish=!0,K.queue(this,e,[]),i&amp;&amp;i.stop&amp;&amp;i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&amp;&amp;o[t].queue===e&amp;&amp;(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s&gt;t;t++)r[t]&amp;&amp;r[t].finish&amp;&amp;r[t].finish.call(this);delete n.finish})}}),K.each(["toggle","show","hide"],function(e,t){var n=K.fn[t];K.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate($(t,!0),e,r,i)}}),K.each({slideDown:$("show"),slideUp:$("hide"),slideToggle:$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){K.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),K.timers=[],K.fx.tick=function(){var e,t=0,n=K.timers;for(Zt=K.now();t&lt;n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||K.fx.stop(),Zt=void 0},K.fx.timer=function(e){K.timers.push(e),e()?K.fx.start():K.timers.pop()},K.fx.interval=13,K.fx.start=function(){Gt||(Gt=setInterval(K.fx.tick,K.fx.interval))},K.fx.stop=function(){clearInterval(Gt),Gt=null},K.fx.speeds={slow:600,fast:200,_default:400},K.fn.delay=function(e,t){return e=K.fx?K.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=G.createElement("input"),t=G.createElement("select"),n=t.appendChild(G.createElement("option"));e.type="checkbox",Z.checkOn=""!==e.value,Z.optSelected=n.selected,t.disabled=!0,Z.optDisabled=!n.disabled,e=G.createElement("input"),e.value="t",e.type="radio",Z.radioValue="t"===e.value}();var rn,on,sn=K.expr.attrHandle;K.fn.extend({attr:function(e,t){return gt(this,K.attr,e,t,arguments.length&gt;1)},removeAttr:function(e){return this.each(function(){K.removeAttr(this,e)})}}),K.extend({attr:function(e,t,n){var r,i,o=e.nodeType;return e&amp;&amp;3!==o&amp;&amp;8!==o&amp;&amp;2!==o?typeof e.getAttribute===Et?K.prop(e,t,n):(1===o&amp;&amp;K.isXMLDoc(e)||(t=t.toLowerCase(),r=K.attrHooks[t]||(K.expr.match.bool.test(t)?on:rn)),void 0===n?r&amp;&amp;"get"in r&amp;&amp;null!==(i=r.get(e,t))?i:(i=K.find.attr(e,t),null==i?void 0:i):null!==n?r&amp;&amp;"set"in r&amp;&amp;void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void K.removeAttr(e,t)):void 0},removeAttr:function(e,t){var n,r,i=0,o=t&amp;&amp;t.match(pt);if(o&amp;&amp;1===e.nodeType)for(;n=o[i++];)r=K.propFix[n]||n,K.expr.match.bool.test(n)&amp;&amp;(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!Z.radioValue&amp;&amp;"radio"===t&amp;&amp;K.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&amp;&amp;(e.value=n),t}}}}}),on={set:function(e,t,n){return t===!1?K.removeAttr(e,n):e.setAttribute(n,n),n}},K.each(K.expr.match.bool.source.match(/\w+/g),function(e,t){var n=sn[t]||K.find.attr;sn[t]=function(e,t,r){var i,o;return r||(o=sn[t],sn[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,sn[t]=o),i}});var an=/^(?:input|select|textarea|button)$/i;K.fn.extend({prop:function(e,t){return gt(this,K.prop,e,t,arguments.length&gt;1)},removeProp:function(e){return this.each(function(){delete this[K.propFix[e]||e]})}}),K.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;return e&amp;&amp;3!==s&amp;&amp;8!==s&amp;&amp;2!==s?(o=1!==s||!K.isXMLDoc(e),o&amp;&amp;(t=K.propFix[t]||t,i=K.propHooks[t]),void 0!==n?i&amp;&amp;"set"in i&amp;&amp;void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&amp;&amp;"get"in i&amp;&amp;null!==(r=i.get(e,t))?r:e[t]):void 0},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||an.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),Z.optSelected||(K.propHooks.selected={get:function(e){var t=e.parentNode;return t&amp;&amp;t.parentNode&amp;&amp;t.parentNode.selectedIndex,null}}),K.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){K.propFix[this.toLowerCase()]=this});var ln=/[\t\r\n\f]/g;K.fn.extend({addClass:function(e){var t,n,r,i,o,s,a="string"==typeof e&amp;&amp;e,l=0,u=this.length;if(K.isFunction(e))return this.each(function(t){K(this).addClass(e.call(this,t,this.className))});if(a)for(t=(e||"").match(pt)||[];u&gt;l;l++)if(n=this[l],r=1===n.nodeType&amp;&amp;(n.className?(" "+n.className+" ").replace(ln," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")&lt;0&amp;&amp;(r+=i+" ");s=K.trim(r),n.className!==s&amp;&amp;(n.className=s)}return this},removeClass:function(e){var t,n,r,i,o,s,a=0===arguments.length||"string"==typeof e&amp;&amp;e,l=0,u=this.length;if(K.isFunction(e))return this.each(function(t){K(this).removeClass(e.call(this,t,this.className))});if(a)for(t=(e||"").match(pt)||[];u&gt;l;l++)if(n=this[l],r=1===n.nodeType&amp;&amp;(n.className?(" "+n.className+" ").replace(ln," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")&gt;=0;)r=r.replace(" "+i+" "," ");s=e?K.trim(r):"",n.className!==s&amp;&amp;(n.className=s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&amp;&amp;"string"===n?t?this.addClass(e):this.removeClass(e):this.each(K.isFunction(e)?function(n){K(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,r=0,i=K(this),o=e.match(pt)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===Et||"boolean"===n)&amp;&amp;(this.className&amp;&amp;mt.set(this,"__className__",this.className),this.className=this.className||e===!1?"":mt.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r&gt;n;n++)if(1===this[n].nodeType&amp;&amp;(" "+this[n].className+" ").replace(ln," ").indexOf(t)&gt;=0)return!0;return!1}});var un=/\r/g;K.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=K.isFunction(e),this.each(function(n){var i;1===this.nodeType&amp;&amp;(i=r?e.call(this,n,K(this).val()):e,null==i?i="":"number"==typeof i?i+="":K.isArray(i)&amp;&amp;(i=K.map(i,function(e){return null==e?"":e+""})),t=K.valHooks[this.type]||K.valHooks[this.nodeName.toLowerCase()],t&amp;&amp;"set"in t&amp;&amp;void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=K.valHooks[i.type]||K.valHooks[i.nodeName.toLowerCase()],t&amp;&amp;"get"in t&amp;&amp;void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(un,""):null==n?"":n)):void 0}}),K.extend({valHooks:{option:{get:function(e){var t=K.find.attr(e,"value");return null!=t?t:K.trim(K.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0&gt;i,s=o?null:[],a=o?i+1:r.length,l=0&gt;i?a:o?i:0;a&gt;l;l++)if(n=r[l],!(!n.selected&amp;&amp;l!==i||(Z.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&amp;&amp;K.nodeName(n.parentNode,"optgroup"))){if(t=K(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=K.makeArray(t),s=i.length;s--;)r=i[s],(r.selected=K.inArray(r.value,o)&gt;=0)&amp;&amp;(n=!0);return n||(e.selectedIndex=-1),o}}}}),K.each(["radio","checkbox"],function(){K.valHooks[this]={set:function(e,t){return K.isArray(t)?e.checked=K.inArray(K(e).val(),t)&gt;=0:void 0}},Z.checkOn||(K.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),K.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){K.fn[t]=function(e,n){return arguments.length&gt;0?this.on(t,null,e,n):this.trigger(t)}}),K.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},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)}});var cn=K.now(),dn=/\?/;K.parseJSON=function(e){return JSON.parse(e+"")},K.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&amp;&amp;K.error("Invalid XML: "+e),t};var hn=/#.*$/,pn=/([?&amp;])_=[^&amp;]*/,fn=/^(.*?):[ \t]*([^\r\n]*)$/gm,vn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,gn=/^(?:GET|HEAD)$/,mn=/^\/\//,yn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,bn={},_n={},Cn="*/".concat("*"),wn=e.location.href,Sn=yn.exec(wn.toLowerCase())||[];K.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:wn,type:"GET",isLocal:vn.test(Sn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Cn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":K.parseJSON,"text xml":K.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?D(D(e,K.ajaxSettings),t):D(K.ajaxSettings,e)},ajaxPrefilter:I(bn),ajaxTransport:I(_n),ajax:function(e,t){function n(e,t,n,s){var l,c,m,y,_,w=t;2!==b&amp;&amp;(b=2,a&amp;&amp;clearTimeout(a),r=void 0,o=s||"",C.readyState=e&gt;0?4:0,l=e&gt;=200&amp;&amp;300&gt;e||304===e,n&amp;&amp;(y=M(d,C,n)),y=j(d,y,C,l),l?(d.ifModified&amp;&amp;(_=C.getResponseHeader("Last-Modified"),_&amp;&amp;(K.lastModified[i]=_),_=C.getResponseHeader("etag"),_&amp;&amp;(K.etag[i]=_)),204===e||"HEAD"===d.type?w="nocontent":304===e?w="notmodified":(w=y.state,c=y.data,m=y.error,l=!m)):(m=w,(e||!w)&amp;&amp;(w="error",0&gt;e&amp;&amp;(e=0))),C.status=e,C.statusText=(t||w)+"",l?f.resolveWith(h,[c,w,C]):f.rejectWith(h,[C,w,m]),C.statusCode(g),g=void 0,u&amp;&amp;p.trigger(l?"ajaxSuccess":"ajaxError",[C,d,l?c:m]),v.fireWith(h,[C,w]),u&amp;&amp;(p.trigger("ajaxComplete",[C,d]),--K.active||K.event.trigger("ajaxStop")))}"object"==typeof e&amp;&amp;(t=e,e=void 0),t=t||{};var r,i,o,s,a,l,u,c,d=K.ajaxSetup({},t),h=d.context||d,p=d.context&amp;&amp;(h.nodeType||h.jquery)?K(h):K.event,f=K.Deferred(),v=K.Callbacks("once memory"),g=d.statusCode||{},m={},y={},b=0,_="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!s)for(s={};t=fn.exec(o);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2&gt;b)for(t in e)g[t]=[g[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||_;return r&amp;&amp;r.abort(t),n(0,t),this}};if(f.promise(C).complete=v.add,C.success=C.done,C.error=C.fail,d.url=((e||d.url||wn)+"").replace(hn,"").replace(mn,Sn[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=K.trim(d.dataType||"*").toLowerCase().match(pt)||[""],null==d.crossDomain&amp;&amp;(l=yn.exec(d.url.toLowerCase()),d.crossDomain=!(!l||l[1]===Sn[1]&amp;&amp;l[2]===Sn[2]&amp;&amp;(l[3]||("http:"===l[1]?"80":"443"))===(Sn[3]||("http:"===Sn[1]?"80":"443")))),d.data&amp;&amp;d.processData&amp;&amp;"string"!=typeof d.data&amp;&amp;(d.data=K.param(d.data,d.traditional)),O(bn,d,t,C),2===b)return C;u=K.event&amp;&amp;d.global,u&amp;&amp;0===K.active++&amp;&amp;K.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!gn.test(d.type),i=d.url,d.hasContent||(d.data&amp;&amp;(i=d.url+=(dn.test(i)?"&amp;":"?")+d.data,delete d.data),d.cache===!1&amp;&amp;(d.url=pn.test(i)?i.replace(pn,"$1_="+cn++):i+(dn.test(i)?"&amp;":"?")+"_="+cn++)),d.ifModified&amp;&amp;(K.lastModified[i]&amp;&amp;C.setRequestHeader("If-Modified-Since",K.lastModified[i]),K.etag[i]&amp;&amp;C.setRequestHeader("If-None-Match",K.etag[i])),(d.data&amp;&amp;d.hasContent&amp;&amp;d.contentType!==!1||t.contentType)&amp;&amp;C.setRequestHeader("Content-Type",d.contentType),C.setRequestHeader("Accept",d.dataTypes[0]&amp;&amp;d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Cn+"; q=0.01":""):d.accepts["*"]);for(c in d.headers)C.setRequestHeader(c,d.headers[c]);if(d.beforeSend&amp;&amp;(d.beforeSend.call(h,C,d)===!1||2===b))return C.abort();_="abort";for(c in{success:1,error:1,complete:1})C[c](d[c]);if(r=O(_n,d,t,C)){C.readyState=1,u&amp;&amp;p.trigger("ajaxSend",[C,d]),d.async&amp;&amp;d.timeout&gt;0&amp;&amp;(a=setTimeout(function(){C.abort("timeout")},d.timeout));try{b=1,r.send(m,n)}catch(w){if(!(2&gt;b))throw w;n(-1,w)}}else n(-1,"No Transport");return C},getJSON:function(e,t,n){return K.get(e,t,n,"json")},getScript:function(e,t){return K.get(e,void 0,t,"script")}}),K.each(["get","post"],function(e,t){K[t]=function(e,n,r,i){return K.isFunction(n)&amp;&amp;(i=i||r,r=n,n=void 0),K.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),K._evalUrl=function(e){return K.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},K.fn.extend({wrapAll:function(e){var t;return K.isFunction(e)?this.each(function(t){K(this).wrapAll(e.call(this,t))}):(this[0]&amp;&amp;(t=K(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&amp;&amp;t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return this.each(K.isFunction(e)?function(t){K(this).wrapInner(e.call(this,t))}:function(){var t=K(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=K.isFunction(e);return this.each(function(n){K(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){K.nodeName(this,"body")||K(this).replaceWith(this.childNodes)}).end()}}),K.expr.filters.hidden=function(e){return e.offsetWidth&lt;=0&amp;&amp;e.offsetHeight&lt;=0},K.expr.filters.visible=function(e){return!K.expr.filters.hidden(e)};var xn=/%20/g,En=/\[\]$/,Ln=/\r?\n/g,kn=/^(?:submit|button|image|reset|file)$/i,Tn=/^(?:input|select|textarea|keygen)/i;K.param=function(e,t){var n,r=[],i=function(e,t){t=K.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&amp;&amp;(t=K.ajaxSettings&amp;&amp;K.ajaxSettings.traditional),K.isArray(e)||e.jquery&amp;&amp;!K.isPlainObject(e))K.each(e,function(){i(this.name,this.value)});else for(n in e)F(n,e[n],t,i);return r.join("&amp;").replace(xn,"+")},K.fn.extend({serialize:function(){return K.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=K.prop(this,"elements");return e?K.makeArray(e):this}).filter(function(){var e=this.type;return this.name&amp;&amp;!K(this).is(":disabled")&amp;&amp;Tn.test(this.nodeName)&amp;&amp;!kn.test(e)&amp;&amp;(this.checked||!xt.test(e))}).map(function(e,t){var n=K(this).val();return null==n?null:K.isArray(n)?K.map(n,function(e){return{name:t.name,value:e.replace(Ln,"\r\n")}}):{name:t.name,value:n.replace(Ln,"\r\n")}}).get()}}),K.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Hn=0,$n={},Pn={0:200,1223:204},An=K.ajaxSettings.xhr();e.attachEvent&amp;&amp;e.attachEvent("onunload",function(){for(var e in $n)$n[e]()}),Z.cors=!!An&amp;&amp;"withCredentials"in An,Z.ajax=An=!!An,K.ajaxTransport(function(e){var t;return Z.cors||An&amp;&amp;!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),s=++Hn;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&amp;&amp;o.overrideMimeType&amp;&amp;o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&amp;&amp;(delete $n[s],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Pn[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=$n[s]=t("abort");try{o.send(e.hasContent&amp;&amp;e.data||null)}catch(a){if(t)throw a}},abort:function(){t&amp;&amp;t()}}:void 0}),K.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return K.globalEval(e),e}}}),K.ajaxPrefilter("script",function(e){void 0===e.cache&amp;&amp;(e.cache=!1),e.crossDomain&amp;&amp;(e.type="GET")}),K.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=K("&lt;script&gt;").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&amp;&amp;i("error"===e.type?404:200,e.type)}),G.head.appendChild(t[0])},abort:function(){n&amp;&amp;n()}}}});var qn=[],Nn=/(=)\?(?=&amp;|$)|\?\?/;K.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=qn.pop()||K.expando+"_"+cn++;return this[e]=!0,e}}),K.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&amp;&amp;(Nn.test(t.url)?"url":"string"==typeof t.data&amp;&amp;!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&amp;&amp;Nn.test(t.data)&amp;&amp;"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=K.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Nn,"$1"+i):t.jsonp!==!1&amp;&amp;(t.url+=(dn.test(t.url)?"&amp;":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||K.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&amp;&amp;(t.jsonpCallback=n.jsonpCallback,qn.push(i)),s&amp;&amp;K.isFunction(o)&amp;&amp;o(s[0]),s=o=void 0}),"script"):void 0}),K.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&amp;&amp;(n=t,t=!1),t=t||G;var r=st.exec(e),i=!n&amp;&amp;[];return r?[t.createElement(r[1])]:(r=K.buildFragment([e],t,i),i&amp;&amp;i.length&amp;&amp;K(i).remove(),K.merge([],r.childNodes))};var In=K.fn.load;K.fn.load=function(e,t,n){if("string"!=typeof e&amp;&amp;In)return In.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a&gt;=0&amp;&amp;(r=K.trim(e.slice(a)),e=e.slice(0,a)),K.isFunction(t)?(n=t,t=void 0):t&amp;&amp;"object"==typeof t&amp;&amp;(i="POST"),s.length&gt;0&amp;&amp;K.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?K("&lt;div&gt;").append(K.parseHTML(e)).find(r):e)}).complete(n&amp;&amp;function(e,t){s.each(n,o||[e.responseText,t,e])}),this},K.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){K.fn[t]=function(e){return this.on(t,e)}}),K.expr.filters.animated=function(e){return K.grep(K.timers,function(t){return e===t.elem}).length};var On=e.document.documentElement;K.offset={setOffset:function(e,t,n){var r,i,o,s,a,l,u,c=K.css(e,"position"),d=K(e),h={};"static"===c&amp;&amp;(e.style.position="relative"),a=d.offset(),o=K.css(e,"top"),l=K.css(e,"left"),u=("absolute"===c||"fixed"===c)&amp;&amp;(o+l).indexOf("auto")&gt;-1,u?(r=d.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),K.isFunction(t)&amp;&amp;(t=t.call(e,n,a)),null!=t.top&amp;&amp;(h.top=t.top-a.top+s),null!=t.left&amp;&amp;(h.left=t.left-a.left+i),"using"in t?t.using.call(e,h):d.css(h)}},K.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){K.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&amp;&amp;r.ownerDocument;return o?(t=o.documentElement,K.contains(t,r)?(typeof r.getBoundingClientRect!==Et&amp;&amp;(i=r.getBoundingClientRect()),n=B(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===K.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),K.nodeName(e[0],"html")||(r=e.offset()),r.top+=K.css(e[0],"borderTopWidth",!0),r.left+=K.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-K.css(n,"marginTop",!0),left:t.left-r.left-K.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||On;e&amp;&amp;!K.nodeName(e,"html")&amp;&amp;"static"===K.css(e,"position");)e=e.offsetParent;return e||On})}}),K.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;K.fn[t]=function(i){return gt(this,function(t,i,o){var s=B(t);return void 0===o?s?s[n]:t[i]:void(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o)},t,i,arguments.length,null)}}),K.each(["top","left"],function(e,t){K.cssHooks[t]=w(Z.pixelPosition,function(e,n){return n?(n=C(e,t),Rt.test(n)?K(e).position()[t]+"px":n):void 0})}),K.each({Height:"height",Width:"width"},function(e,t){K.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){K.fn[r]=function(r,i){var o=arguments.length&amp;&amp;(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return gt(this,function(t,n,r){var i;return K.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?K.css(t,n,s):K.style(t,n,r,s)},t,o?r:void 0,o,null)}})}),K.fn.size=function(){return this.length},K.fn.andSelf=K.fn.addBack,"function"==typeof define&amp;&amp;define.amd&amp;&amp;define("jquery",[],function(){return K});var Dn=e.jQuery,Mn=e.$;return K.noConflict=function(t){return e.$===K&amp;&amp;(e.$=Mn),t&amp;&amp;e.jQuery===K&amp;&amp;(e.jQuery=Dn),K},typeof t===Et&amp;&amp;(e.jQuery=e.$=K),K});var Helper=function(){var e=function(e){return document.getElementById(e)},t=function(e,t){return(" "+e.className+" ").indexOf(" "+t+" ")&gt;-1},n=function(e,t,n){if("undefined"==typeof n&amp;&amp;(n=!1),n)e.classList.add(t);else{var r=e.length;if("undefined"!=typeof r)for(var i=0;r&gt;i;++i){var o=e[i];o.classList.add(t)}else e.classList.add(t)}},r=function(e,t,n){if("undefined"==typeof n&amp;&amp;(n=!1),n)e.classList.remove(t);else{var r=e.length;if("undefined"!=typeof r)for(var i=0;r&gt;i;++i){var o=e[i];o.classList.remove(t)}else e.classList.remove(t)}},i=function(e,t){if(null==e||"object"!=typeof e)return e;if(e.constructor!=Object&amp;&amp;e.constructor!=Array)return e;if(e.constructor==Date||e.constructor==RegExp||e.constructor==Function||e.constructor==String||e.constructor==Number||e.constructor==Boolean)return new e.constructor(e);t=t||new e.constructor;for(var n in e)t[n]="undefined"==typeof t[n]?i(e[n],null):t[n];return t},o=function(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("GET",e),r.onload=function(){200==r.status?t(r.response):n(Error(r.statusText))},r.onerror=function(){n(Error("Network Error"))},r.send()})},s=function(){var e=window.navigator.userAgent,t=/[\/\.]/i,n=/(Version)\/([\w.\/]+)/i,r=/(Opera|OPR)[\/ ]([\w.\/]+)/i,i=/(?:(MSIE) |(Trident)\/.+rv:)([\w.]+)/i,o=e.match(r)||e.match(i);if(!o)return!1;if(Array.prototype.filter)o=o.filter(function(e){return null!=e});else for(var s=0;s&lt;o.length;s++){var a=o[s];(null==a||""===a)&amp;&amp;(o.splice(s,1),s--)}var l=o[1].replace("Trident","MSIE").replace("OPR","Opera"),u=e.match(n)||o,c=u[2].split(t);return{name:l,version:c}};return{select:e,hasClass:t,addClass:n,removeClass:r,merge:i,checkIEBrowser:s,getLoad:o}}();PlayerSettings["interface"]=function(){return{title:"",volume:.8,embedded:!0,autoplay:!1,noendscreen:!0,end:"nothing",watermark:"",skins:"",host:"",video:{poster:"",allowairplay:"",preload:""},analytics:{active:!1,endpoint:""},tracking:{analyticsKey:"",trackId:"",trackingServer:"",trackingSecureServer:"",movieId:""},i18n:{},sources:[],translations:[]}};var isfull=!1;FullscreenUtil.goFullscreen=function(e){"string"==typeof e&amp;&amp;(e=document.getElementById(e)),e.requestFullScreen?e.requestFullScreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen&amp;&amp;e.msRequestFullscreen(),isfull=!0},FullscreenUtil.exitFullscreen=function(e){"undefined"==typeof e&amp;&amp;(e=document),e.cancelFullScreen?e.cancelFullScreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.msExitFullscreen&amp;&amp;e.msExitFullscreen(),isfull=!1},FullscreenUtil.requestPrefix=function(e){return e.fullscreenchange?"fullscreenchange":e.webkitRequestFullScreen?"webkitfullscreenchange":e.mozRequestFullScreen?"mozfullscreenchange":e.msRequestFullscreen?"MSFullscreenChange":void 0},FullscreenUtil.setFull=function(e){isfull=e},FullscreenUtil.full=function(){return isfull},FullscreenUtil.isFullScreen=function(){return void 0!==document.fullscreen&amp;&amp;!document.fullscreen||void 0!==document.webkitIsFullScreen&amp;&amp;!document.webkitIsFullScreen||void 0!==document.mozFullScreen&amp;&amp;!document.mozFullScreen||void 0!==document.mozFullScreen&amp;&amp;!document.mozFullScreen||void 0!==document.msFullScreen&amp;&amp;!document.msFullScreen?!1:!0},StringUtil.generateRandomString=function(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;e&gt;r;r++){var i=Math.floor(Math.random()*t.length);n+=t.substring(i,i+1)}return n},StringUtil.formatDoubleDigit=function(e){return 10&gt;e?"0"+e:String(e)},StringUtil.formatTime=function(e){var t=Math.round(e),n=0,r=0;if(t&gt;0){for(;t&gt;59;)r++,t-=60;for(;r&gt;59;)n++,r-=60;return n&gt;0?StringUtil.formatDoubleDigit(n)+":"+StringUtil.formatDoubleDigit(r)+":"+StringUtil.formatDoubleDigit(t):StringUtil.formatDoubleDigit(r)+":"+StringUtil.formatDoubleDigit(t)}return"00:00"},StringUtil.getExtension=function(e){var t=e.lastIndexOf(".");return e.substr(t+1,e.length)},StringUtil.getPrefix=function(e){return e.substring(0,e.indexOf("://"))},StringUtil.getFilename=function(e){return e.substr(e.lastIndexOf("/")+1)},StringUtil.reverse=function(e){return null===e?"":e.split("").reverse().join("")},StringUtil.reverseWords=function(e){return null===e?"":e.split(/\s+/).reverse().join(" ")},StringUtil.stripExtension=function(e){var t=StringUtil.getExtension(e).length;return e.substr(0,e.length-(t+1))},StringUtil.getPart=function(e,t,n){var r=e.split(t);return n&gt;r.length?null:r[n]},StringUtil.insert=function(e,t,n){var r=e.split(t),i=r[0]+n+r[1];return i};
/*! ics.js Wed Aug 20 2014 17:23:02 */
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&amp;&amp;/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&amp;&amp;i)&amp;&amp;e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&amp;&amp;navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&amp;&amp;self||typeof window!=="undefined"&amp;&amp;window||this.content);if(typeof module!=="undefined"&amp;&amp;module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&amp;&amp;define!==null&amp;&amp;define.amd!==null){define("FileSaver.js",function(){return saveAs})}

var ics=function(e,t){"use strict";{if(!(navigator.userAgent.indexOf("MSIE")&gt;-1&amp;&amp;-1==navigator.userAgent.indexOf("MSIE 10"))){void 0===e&amp;&amp;(e="default"),void 0===t&amp;&amp;(t="Calendar");var r=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",n=[],i=["BEGIN:VCALENDAR","PRODID:"+t,"VERSION:2.0"].join(r),o=r+"END:VCALENDAR",a=["SU","MO","TU","WE","TH","FR","SA"];return{events:function(){return n},calendar:function(){return i+r+n.join(r)+o},addEvent:function(t,i,o,l,u,s){if(void 0===t||void 0===i||void 0===o||void 0===l||void 0===u)return!1;if(s&amp;&amp;!s.rrule){if("YEARLY"!==s.freq&amp;&amp;"MONTHLY"!==s.freq&amp;&amp;"WEEKLY"!==s.freq&amp;&amp;"DAILY"!==s.freq)throw"Recurrence rrule frequency must be provided and be one of the following: 'YEARLY', 'MONTHLY', 'WEEKLY', or 'DAILY'";if(s.until&amp;&amp;isNaN(Date.parse(s.until)))throw"Recurrence rrule 'until' must be a valid date string";if(s.interval&amp;&amp;isNaN(parseInt(s.interval)))throw"Recurrence rrule 'interval' must be an integer";if(s.count&amp;&amp;isNaN(parseInt(s.count)))throw"Recurrence rrule 'count' must be an integer";if(void 0!==s.byday){if("[object Array]"!==Object.prototype.toString.call(s.byday))throw"Recurrence rrule 'byday' must be an array";if(s.byday.length&gt;7)throw"Recurrence rrule 'byday' array must not be longer than the 7 days in a week";s.byday=s.byday.filter(function(e,t){return s.byday.indexOf(e)==t});for(var c in s.byday)if(a.indexOf(s.byday[c])&lt;0)throw"Recurrence rrule 'byday' values must include only the following: 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'"}}var g=new Date(l),d=new Date(u),f=new Date,S=("0000"+g.getFullYear().toString()).slice(-4),E=("00"+(g.getMonth()+1).toString()).slice(-2),v=("00"+g.getDate().toString()).slice(-2),y=("00"+g.getHours().toString()).slice(-2),A=("00"+g.getMinutes().toString()).slice(-2),T=("00"+g.getSeconds().toString()).slice(-2),b=("0000"+d.getFullYear().toString()).slice(-4),D=("00"+(d.getMonth()+1).toString()).slice(-2),N=("00"+d.getDate().toString()).slice(-2),h=("00"+d.getHours().toString()).slice(-2),I=("00"+d.getMinutes().toString()).slice(-2),R=("00"+d.getMinutes().toString()).slice(-2),M=("0000"+f.getFullYear().toString()).slice(-4),w=("00"+(f.getMonth()+1).toString()).slice(-2),L=("00"+f.getDate().toString()).slice(-2),O=("00"+f.getHours().toString()).slice(-2),p=("00"+f.getMinutes().toString()).slice(-2),Y=("00"+f.getMinutes().toString()).slice(-2),U="",V="";y+A+T+h+I+R!=0&amp;&amp;(U="T"+y+A+T,V="T"+h+I+R);var B,C=S+E+v+U,j=b+D+N+V,m=M+w+L+("T"+O+p+Y);if(s)if(s.rrule)B=s.rrule;else{if(B="rrule:FREQ="+s.freq,s.until){var x=new Date(Date.parse(s.until)).toISOString();B+=";UNTIL="+x.substring(0,x.length-13).replace(/[-]/g,"")+"000000Z"}s.interval&amp;&amp;(B+=";INTERVAL="+s.interval),s.count&amp;&amp;(B+=";COUNT="+s.count),s.byday&amp;&amp;s.byday.length&gt;0&amp;&amp;(B+=";BYDAY="+s.byday.join(","))}(new Date).toISOString();var H=["BEGIN:VEVENT","UID:"+n.length+"@"+e,"CLASS:PUBLIC","DESCRIPTION:"+i,"DTSTAMP;VALUE=DATE-TIME:"+m,"DTSTART;VALUE=DATE-TIME:"+C,"DTEND;VALUE=DATE-TIME:"+j,"LOCATION:"+o,"SUMMARY;LANGUAGE=en-us:"+t,"TRANSP:TRANSPARENT","END:VEVENT"];return B&amp;&amp;H.splice(4,0,B),H=H.join(r),n.push(H),H},download:function(e,t){if(n.length&lt;1)return!1;t=void 0!==t?t:".ics",e=void 0!==e?e:"calendar";var a,l=i+r+n.join(r)+o;if(-1===navigator.userAgent.indexOf("MSIE 10"))a=new Blob([l]);else{var u=new BlobBuilder;u.append(l),a=u.getBlob("text/x-vCalendar;charset="+document.characterSet)}return saveAs(a,e+t),l},build:function(){return!(n.length&lt;1)&amp;&amp;i+r+n.join(r)+o}}}console.log("Unsupported Browser")}};

/* global saveAs, Blob, BlobBuilder, console */
/* exported ics */

var ics = function(uidDomain, prodId) {
  'use strict';

  if (navigator.userAgent.indexOf('MSIE') &gt; -1 &amp;&amp; navigator.userAgent.indexOf('MSIE 10') == -1) {
    console.log('Unsupported Browser');
    return;
  }

  if (typeof uidDomain === 'undefined') { uidDomain = 'default'; }
  if (typeof prodId === 'undefined') { prodId = 'Calendar'; }

  var SEPARATOR = (navigator.appVersion.indexOf('Win') !== -1) ? '\r\n' : '\n';
  var calendarEvents = [];
  var calendarStart = [
    'BEGIN:VCALENDAR',
    'PRODID:' + prodId,
    'VERSION:2.0'
  ].join(SEPARATOR);
  var calendarEnd = SEPARATOR + 'END:VCALENDAR';
  var BYDAY_VALUES = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];

  return {
    /**
     * Returns events array
     * @return {array} Events
     */
    'events': function() {
      return calendarEvents;
    },

    /**
     * Returns calendar
     * @return {string} Calendar in iCalendar format
     */
    'calendar': function() {
      return calendarStart + SEPARATOR + calendarEvents.join(SEPARATOR) + calendarEnd;
    },

    /**
     * Add event to the calendar
     * @param  {string} subject     Subject/Title of event
     * @param  {string} description Description of event
     * @param  {string} location    Location of event
     * @param  {string} begin       Beginning date of event
     * @param  {string} stop        Ending date of event
     */
    'addEvent': function(subject, description, location, begin, stop, rrule) {
      // I'm not in the mood to make these optional... So they are all required
      if (typeof subject === 'undefined' ||
        typeof description === 'undefined' ||
        typeof location === 'undefined' ||
        typeof begin === 'undefined' ||
        typeof stop === 'undefined'
      ) {
        return false;
      }

      // validate rrule
      if (rrule) {
        if (!rrule.rrule) {
          if (rrule.freq !== 'YEARLY' &amp;&amp; rrule.freq !== 'MONTHLY' &amp;&amp; rrule.freq !== 'WEEKLY' &amp;&amp; rrule.freq !== 'DAILY') {
            throw "Recurrence rrule frequency must be provided and be one of the following: 'YEARLY', 'MONTHLY', 'WEEKLY', or 'DAILY'";
          }

          if (rrule.until) {
            if (isNaN(Date.parse(rrule.until))) {
              throw "Recurrence rrule 'until' must be a valid date string";
            }
          }

          if (rrule.interval) {
            if (isNaN(parseInt(rrule.interval))) {
              throw "Recurrence rrule 'interval' must be an integer";
            }
          }

          if (rrule.count) {
            if (isNaN(parseInt(rrule.count))) {
              throw "Recurrence rrule 'count' must be an integer";
            }
          }

          if (typeof rrule.byday !== 'undefined') {
            if ((Object.prototype.toString.call(rrule.byday) !== '[object Array]')) {
              throw "Recurrence rrule 'byday' must be an array";
            }

            if (rrule.byday.length &gt; 7) {
              throw "Recurrence rrule 'byday' array must not be longer than the 7 days in a week";
            }

            // Filter any possible repeats
            rrule.byday = rrule.byday.filter(function(elem, pos) {
              return rrule.byday.indexOf(elem) == pos;
            });

            for (var d in rrule.byday) {
              if (BYDAY_VALUES.indexOf(rrule.byday[d]) &lt; 0) {
                throw "Recurrence rrule 'byday' values must include only the following: 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'";
              }
            }
          }
        }
      }

      //TODO add time and time zone? use moment to format?
      var start_date = new Date(begin);
      var end_date = new Date(stop);
      var now_date = new Date();

      var start_year = ("0000" + (start_date.getFullYear().toString())).slice(-4);
      var start_month = ("00" + ((start_date.getMonth() + 1).toString())).slice(-2);
      var start_day = ("00" + ((start_date.getDate()).toString())).slice(-2);
      var start_hours = ("00" + (start_date.getHours().toString())).slice(-2);
      var start_minutes = ("00" + (start_date.getMinutes().toString())).slice(-2);
      var start_seconds = ("00" + (start_date.getSeconds().toString())).slice(-2);

      var end_year = ("0000" + (end_date.getFullYear().toString())).slice(-4);
      var end_month = ("00" + ((end_date.getMonth() + 1).toString())).slice(-2);
      var end_day = ("00" + ((end_date.getDate()).toString())).slice(-2);
      var end_hours = ("00" + (end_date.getHours().toString())).slice(-2);
      var end_minutes = ("00" + (end_date.getMinutes().toString())).slice(-2);
      var end_seconds = ("00" + (end_date.getSeconds().toString())).slice(-2);

      var now_year = ("0000" + (now_date.getFullYear().toString())).slice(-4);
      var now_month = ("00" + ((now_date.getMonth() + 1).toString())).slice(-2);
      var now_day = ("00" + ((now_date.getDate()).toString())).slice(-2);
      var now_hours = ("00" + (now_date.getHours().toString())).slice(-2);
      var now_minutes = ("00" + (now_date.getMinutes().toString())).slice(-2);
      var now_seconds = ("00" + (now_date.getSeconds().toString())).slice(-2);

      // Since some calendars don't add 0 second events, we need to remove time if there is none...
      var start_time = '';
      var end_time = '';
      if (start_hours + start_minutes + start_seconds + end_hours + end_minutes + end_seconds != 0) {
        start_time = 'T' + start_hours + start_minutes + start_seconds;
        end_time = 'T' + end_hours + end_minutes + end_seconds;
      }
      var now_time = 'T' + now_hours + now_minutes + now_seconds;

      var start = start_year + start_month + start_day + start_time;
      var end = end_year + end_month + end_day + end_time;
      var now = now_year + now_month + now_day + now_time;

      // recurrence rrule vars
      var rruleString;
      if (rrule) {
        if (rrule.rrule) {
          rruleString = rrule.rrule;
        } else {
          rruleString = 'rrule:FREQ=' + rrule.freq;

          if (rrule.until) {
            var uDate = new Date(Date.parse(rrule.until)).toISOString();
            rruleString += ';UNTIL=' + uDate.substring(0, uDate.length - 13).replace(/[-]/g, '') + '000000Z';
          }

          if (rrule.interval) {
            rruleString += ';INTERVAL=' + rrule.interval;
          }

          if (rrule.count) {
            rruleString += ';COUNT=' + rrule.count;
          }

          if (rrule.byday &amp;&amp; rrule.byday.length &gt; 0) {
            rruleString += ';BYDAY=' + rrule.byday.join(',');
          }
        }
      }

      var stamp = new Date().toISOString();

      var calendarEvent = [
        'BEGIN:VEVENT',
        'UID:' + calendarEvents.length + "@" + uidDomain,
        'CLASS:PUBLIC',
        'DESCRIPTION:' + description,
        'DTSTAMP;VALUE=DATE-TIME:' + now,
        'DTSTART;VALUE=DATE-TIME:' + start,
        'DTEND;VALUE=DATE-TIME:' + end,
        'LOCATION:' + location,
        'SUMMARY;LANGUAGE=en-us:' + subject,
        'TRANSP:TRANSPARENT',
        'END:VEVENT'
      ];

      if (rruleString) {
        calendarEvent.splice(4, 0, rruleString);
      }

      calendarEvent = calendarEvent.join(SEPARATOR);

      calendarEvents.push(calendarEvent);
      return calendarEvent;
    },

    /**
     * Download calendar using the saveAs function from filesave.js
     * @param  {string} filename Filename
     * @param  {string} ext      Extention
     */
    'download': function(filename, ext) {
      if (calendarEvents.length &lt; 1) {
        return false;
      }

      ext = (typeof ext !== 'undefined') ? ext : '.ics';
      filename = (typeof filename !== 'undefined' &amp;&amp; filename.length &gt; 0) ? filename : 'calendar';
      var calendar = calendarStart + SEPARATOR + calendarEvents.join(SEPARATOR) + calendarEnd;

      var blob;
      if (navigator.userAgent.indexOf('MSIE 10') === -1) { // chrome or firefox
        blob = new Blob([calendar]);
      } else { // ie
        var bb = new BlobBuilder();
        bb.append(calendar);
        blob = bb.getBlob('text/x-vCalendar;charset=' + document.characterSet);
      }
      saveAs(blob, filename + ext);
      return calendar;
    },

    /**
     * Build and return the ical contents
     */
    'build': function() {
      if (calendarEvents.length &lt; 1) {
        return false;
      }

      var calendar = calendarStart + SEPARATOR + calendarEvents.join(SEPARATOR) + calendarEnd;

      return calendar;
    }
  };
};

;(function (global, factory) {
    typeof exports === 'object' &amp;&amp; typeof module !== 'undefined' ? module.exports = factory() :
    typeof define === 'function' &amp;&amp; define.amd ? define(factory) :
    global.moment = factory()
}(this, (function () { 'use strict';

    var hookCallback;

    function hooks () {
        return hookCallback.apply(null, arguments);
    }

    // This is done to register the method called with moment()
    // without creating circular dependencies.
    function setHookCallback (callback) {
        hookCallback = callback;
    }

    function isArray(input) {
        return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
    }

    function isObject(input) {
        // IE8 will treat undefined and null as object if it wasn't for
        // input != null
        return input != null &amp;&amp; Object.prototype.toString.call(input) === '[object Object]';
    }

    function isObjectEmpty(obj) {
        if (Object.getOwnPropertyNames) {
            return (Object.getOwnPropertyNames(obj).length === 0);
        } else {
            var k;
            for (k in obj) {
                if (obj.hasOwnProperty(k)) {
                    return false;
                }
            }
            return true;
        }
    }

    function isUndefined(input) {
        return input === void 0;
    }

    function isNumber(input) {
        return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
    }

    function isDate(input) {
        return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
    }

    function map(arr, fn) {
        var res = [], i;
        for (i = 0; i &lt; arr.length; ++i) {
            res.push(fn(arr[i], i));
        }
        return res;
    }

    function hasOwnProp(a, b) {
        return Object.prototype.hasOwnProperty.call(a, b);
    }

    function extend(a, b) {
        for (var i in b) {
            if (hasOwnProp(b, i)) {
                a[i] = b[i];
            }
        }

        if (hasOwnProp(b, 'toString')) {
            a.toString = b.toString;
        }

        if (hasOwnProp(b, 'valueOf')) {
            a.valueOf = b.valueOf;
        }

        return a;
    }

    function createUTC (input, format, locale, strict) {
        return createLocalOrUTC(input, format, locale, strict, true).utc();
    }

    function defaultParsingFlags() {
        // We need to deep clone this object.
        return {
            empty           : false,
            unusedTokens    : [],
            unusedInput     : [],
            overflow        : -2,
            charsLeftOver   : 0,
            nullInput       : false,
            invalidMonth    : null,
            invalidFormat   : false,
            userInvalidated : false,
            iso             : false,
            parsedDateParts : [],
            meridiem        : null,
            rfc2822         : false,
            weekdayMismatch : false
        };
    }

    function getParsingFlags(m) {
        if (m._pf == null) {
            m._pf = defaultParsingFlags();
        }
        return m._pf;
    }

    var some;
    if (Array.prototype.some) {
        some = Array.prototype.some;
    } else {
        some = function (fun) {
            var t = Object(this);
            var len = t.length &gt;&gt;&gt; 0;

            for (var i = 0; i &lt; len; i++) {
                if (i in t &amp;&amp; fun.call(this, t[i], i, t)) {
                    return true;
                }
            }

            return false;
        };
    }

    function isValid(m) {
        if (m._isValid == null) {
            var flags = getParsingFlags(m);
            var parsedParts = some.call(flags.parsedDateParts, function (i) {
                return i != null;
            });
            var isNowValid = !isNaN(m._d.getTime()) &amp;&amp;
                flags.overflow &lt; 0 &amp;&amp;
                !flags.empty &amp;&amp;
                !flags.invalidMonth &amp;&amp;
                !flags.invalidWeekday &amp;&amp;
                !flags.weekdayMismatch &amp;&amp;
                !flags.nullInput &amp;&amp;
                !flags.invalidFormat &amp;&amp;
                !flags.userInvalidated &amp;&amp;
                (!flags.meridiem || (flags.meridiem &amp;&amp; parsedParts));

            if (m._strict) {
                isNowValid = isNowValid &amp;&amp;
                    flags.charsLeftOver === 0 &amp;&amp;
                    flags.unusedTokens.length === 0 &amp;&amp;
                    flags.bigHour === undefined;
            }

            if (Object.isFrozen == null || !Object.isFrozen(m)) {
                m._isValid = isNowValid;
            }
            else {
                return isNowValid;
            }
        }
        return m._isValid;
    }

    function createInvalid (flags) {
        var m = createUTC(NaN);
        if (flags != null) {
            extend(getParsingFlags(m), flags);
        }
        else {
            getParsingFlags(m).userInvalidated = true;
        }

        return m;
    }

    // Plugins that add properties should also add the key here (null value),
    // so we can properly clone ourselves.
    var momentProperties = hooks.momentProperties = [];

    function copyConfig(to, from) {
        var i, prop, val;

        if (!isUndefined(from._isAMomentObject)) {
            to._isAMomentObject = from._isAMomentObject;
        }
        if (!isUndefined(from._i)) {
            to._i = from._i;
        }
        if (!isUndefined(from._f)) {
            to._f = from._f;
        }
        if (!isUndefined(from._l)) {
            to._l = from._l;
        }
        if (!isUndefined(from._strict)) {
            to._strict = from._strict;
        }
        if (!isUndefined(from._tzm)) {
            to._tzm = from._tzm;
        }
        if (!isUndefined(from._isUTC)) {
            to._isUTC = from._isUTC;
        }
        if (!isUndefined(from._offset)) {
            to._offset = from._offset;
        }
        if (!isUndefined(from._pf)) {
            to._pf = getParsingFlags(from);
        }
        if (!isUndefined(from._locale)) {
            to._locale = from._locale;
        }

        if (momentProperties.length &gt; 0) {
            for (i = 0; i &lt; momentProperties.length; i++) {
                prop = momentProperties[i];
                val = from[prop];
                if (!isUndefined(val)) {
                    to[prop] = val;
                }
            }
        }

        return to;
    }

    var updateInProgress = false;

    // Moment prototype object
    function Moment(config) {
        copyConfig(this, config);
        this._d = new Date(config._d != null ? config._d.getTime() : NaN);
        if (!this.isValid()) {
            this._d = new Date(NaN);
        }
        // Prevent infinite loop in case updateOffset creates new moment
        // objects.
        if (updateInProgress === false) {
            updateInProgress = true;
            hooks.updateOffset(this);
            updateInProgress = false;
        }
    }

    function isMoment (obj) {
        return obj instanceof Moment || (obj != null &amp;&amp; obj._isAMomentObject != null);
    }

    function absFloor (number) {
        if (number &lt; 0) {
            // -0 -&gt; 0
            return Math.ceil(number) || 0;
        } else {
            return Math.floor(number);
        }
    }

    function toInt(argumentForCoercion) {
        var coercedNumber = +argumentForCoercion,
            value = 0;

        if (coercedNumber !== 0 &amp;&amp; isFinite(coercedNumber)) {
            value = absFloor(coercedNumber);
        }

        return value;
    }

    // compare two arrays, return the number of differences
    function compareArrays(array1, array2, dontConvert) {
        var len = Math.min(array1.length, array2.length),
            lengthDiff = Math.abs(array1.length - array2.length),
            diffs = 0,
            i;
        for (i = 0; i &lt; len; i++) {
            if ((dontConvert &amp;&amp; array1[i] !== array2[i]) ||
                (!dontConvert &amp;&amp; toInt(array1[i]) !== toInt(array2[i]))) {
                diffs++;
            }
        }
        return diffs + lengthDiff;
    }

    function warn(msg) {
        if (hooks.suppressDeprecationWarnings === false &amp;&amp;
                (typeof console !==  'undefined') &amp;&amp; console.warn) {
            console.warn('Deprecation warning: ' + msg);
        }
    }

    function deprecate(msg, fn) {
        var firstTime = true;

        return extend(function () {
            if (hooks.deprecationHandler != null) {
                hooks.deprecationHandler(null, msg);
            }
            if (firstTime) {
                var args = [];
                var arg;
                for (var i = 0; i &lt; arguments.length; i++) {
                    arg = '';
                    if (typeof arguments[i] === 'object') {
                        arg += '\n[' + i + '] ';
                        for (var key in arguments[0]) {
                            arg += key + ': ' + arguments[0][key] + ', ';
                        }
                        arg = arg.slice(0, -2); // Remove trailing comma and space
                    } else {
                        arg = arguments[i];
                    }
                    args.push(arg);
                }
                warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
                firstTime = false;
            }
            return fn.apply(this, arguments);
        }, fn);
    }

    var deprecations = {};

    function deprecateSimple(name, msg) {
        if (hooks.deprecationHandler != null) {
            hooks.deprecationHandler(name, msg);
        }
        if (!deprecations[name]) {
            warn(msg);
            deprecations[name] = true;
        }
    }

    hooks.suppressDeprecationWarnings = false;
    hooks.deprecationHandler = null;

    function isFunction(input) {
        return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
    }

    function set (config) {
        var prop, i;
        for (i in config) {
            prop = config[i];
            if (isFunction(prop)) {
                this[i] = prop;
            } else {
                this['_' + i] = prop;
            }
        }
        this._config = config;
        // Lenient ordinal parsing accepts just a number in addition to
        // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
        // TODO: Remove "ordinalParse" fallback in next major release.
        this._dayOfMonthOrdinalParseLenient = new RegExp(
            (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
                '|' + (/\d{1,2}/).source);
    }

    function mergeConfigs(parentConfig, childConfig) {
        var res = extend({}, parentConfig), prop;
        for (prop in childConfig) {
            if (hasOwnProp(childConfig, prop)) {
                if (isObject(parentConfig[prop]) &amp;&amp; isObject(childConfig[prop])) {
                    res[prop] = {};
                    extend(res[prop], parentConfig[prop]);
                    extend(res[prop], childConfig[prop]);
                } else if (childConfig[prop] != null) {
                    res[prop] = childConfig[prop];
                } else {
                    delete res[prop];
                }
            }
        }
        for (prop in parentConfig) {
            if (hasOwnProp(parentConfig, prop) &amp;&amp;
                    !hasOwnProp(childConfig, prop) &amp;&amp;
                    isObject(parentConfig[prop])) {
                // make sure changes to properties don't modify parent config
                res[prop] = extend({}, res[prop]);
            }
        }
        return res;
    }

    function Locale(config) {
        if (config != null) {
            this.set(config);
        }
    }

    var keys;

    if (Object.keys) {
        keys = Object.keys;
    } else {
        keys = function (obj) {
            var i, res = [];
            for (i in obj) {
                if (hasOwnProp(obj, i)) {
                    res.push(i);
                }
            }
            return res;
        };
    }

    var defaultCalendar = {
        sameDay : '[Today at] LT',
        nextDay : '[Tomorrow at] LT',
        nextWeek : 'dddd [at] LT',
        lastDay : '[Yesterday at] LT',
        lastWeek : '[Last] dddd [at] LT',
        sameElse : 'L'
    };

    function calendar (key, mom, now) {
        var output = this._calendar[key] || this._calendar['sameElse'];
        return isFunction(output) ? output.call(mom, now) : output;
    }

    var defaultLongDateFormat = {
        LTS  : 'h:mm:ss A',
        LT   : 'h:mm A',
        L    : 'MM/DD/YYYY',
        LL   : 'MMMM D, YYYY',
        LLL  : 'MMMM D, YYYY h:mm A',
        LLLL : 'dddd, MMMM D, YYYY h:mm A'
    };

    function longDateFormat (key) {
        var format = this._longDateFormat[key],
            formatUpper = this._longDateFormat[key.toUpperCase()];

        if (format || !formatUpper) {
            return format;
        }

        this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
            return val.slice(1);
        });

        return this._longDateFormat[key];
    }

    var defaultInvalidDate = 'Invalid date';

    function invalidDate () {
        return this._invalidDate;
    }

    var defaultOrdinal = '%d';
    var defaultDayOfMonthOrdinalParse = /\d{1,2}/;

    function ordinal (number) {
        return this._ordinal.replace('%d', number);
    }

    var defaultRelativeTime = {
        future : 'in %s',
        past   : '%s ago',
        s  : 'a few seconds',
        ss : '%d seconds',
        m  : 'a minute',
        mm : '%d minutes',
        h  : 'an hour',
        hh : '%d hours',
        d  : 'a day',
        dd : '%d days',
        M  : 'a month',
        MM : '%d months',
        y  : 'a year',
        yy : '%d years'
    };

    function relativeTime (number, withoutSuffix, string, isFuture) {
        var output = this._relativeTime[string];
        return (isFunction(output)) ?
            output(number, withoutSuffix, string, isFuture) :
            output.replace(/%d/i, number);
    }

    function pastFuture (diff, output) {
        var format = this._relativeTime[diff &gt; 0 ? 'future' : 'past'];
        return isFunction(format) ? format(output) : format.replace(/%s/i, output);
    }

    var aliases = {};

    function addUnitAlias (unit, shorthand) {
        var lowerCase = unit.toLowerCase();
        aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
    }

    function normalizeUnits(units) {
        return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
    }

    function normalizeObjectUnits(inputObject) {
        var normalizedInput = {},
            normalizedProp,
            prop;

        for (prop in inputObject) {
            if (hasOwnProp(inputObject, prop)) {
                normalizedProp = normalizeUnits(prop);
                if (normalizedProp) {
                    normalizedInput[normalizedProp] = inputObject[prop];
                }
            }
        }

        return normalizedInput;
    }

    var priorities = {};

    function addUnitPriority(unit, priority) {
        priorities[unit] = priority;
    }

    function getPrioritizedUnits(unitsObj) {
        var units = [];
        for (var u in unitsObj) {
            units.push({unit: u, priority: priorities[u]});
        }
        units.sort(function (a, b) {
            return a.priority - b.priority;
        });
        return units;
    }

    function zeroFill(number, targetLength, forceSign) {
        var absNumber = '' + Math.abs(number),
            zerosToFill = targetLength - absNumber.length,
            sign = number &gt;= 0;
        return (sign ? (forceSign ? '+' : '') : '-') +
            Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
    }

    var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;

    var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;

    var formatFunctions = {};

    var formatTokenFunctions = {};

    // token:    'M'
    // padded:   ['MM', 2]
    // ordinal:  'Mo'
    // callback: function () { this.month() + 1 }
    function addFormatToken (token, padded, ordinal, callback) {
        var func = callback;
        if (typeof callback === 'string') {
            func = function () {
                return this[callback]();
            };
        }
        if (token) {
            formatTokenFunctions[token] = func;
        }
        if (padded) {
            formatTokenFunctions[padded[0]] = function () {
                return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
            };
        }
        if (ordinal) {
            formatTokenFunctions[ordinal] = function () {
                return this.localeData().ordinal(func.apply(this, arguments), token);
            };
        }
    }

    function removeFormattingTokens(input) {
        if (input.match(/\[[\s\S]/)) {
            return input.replace(/^\[|\]$/g, '');
        }
        return input.replace(/\\/g, '');
    }

    function makeFormatFunction(format) {
        var array = format.match(formattingTokens), i, length;

        for (i = 0, length = array.length; i &lt; length; i++) {
            if (formatTokenFunctions[array[i]]) {
                array[i] = formatTokenFunctions[array[i]];
            } else {
                array[i] = removeFormattingTokens(array[i]);
            }
        }

        return function (mom) {
            var output = '', i;
            for (i = 0; i &lt; length; i++) {
                output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
            }
            return output;
        };
    }

    // format date using native date object
    function formatMoment(m, format) {
        if (!m.isValid()) {
            return m.localeData().invalidDate();
        }

        format = expandFormat(format, m.localeData());
        formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);

        return formatFunctions[format](m);
    }

    function expandFormat(format, locale) {
        var i = 5;

        function replaceLongDateFormatTokens(input) {
            return locale.longDateFormat(input) || input;
        }

        localFormattingTokens.lastIndex = 0;
        while (i &gt;= 0 &amp;&amp; localFormattingTokens.test(format)) {
            format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
            localFormattingTokens.lastIndex = 0;
            i -= 1;
        }

        return format;
    }

    var match1         = /\d/;            //       0 - 9
    var match2         = /\d\d/;          //      00 - 99
    var match3         = /\d{3}/;         //     000 - 999
    var match4         = /\d{4}/;         //    0000 - 9999
    var match6         = /[+-]?\d{6}/;    // -999999 - 999999
    var match1to2      = /\d\d?/;         //       0 - 99
    var match3to4      = /\d\d\d\d?/;     //     999 - 9999
    var match5to6      = /\d\d\d\d\d\d?/; //   99999 - 999999
    var match1to3      = /\d{1,3}/;       //       0 - 999
    var match1to4      = /\d{1,4}/;       //       0 - 9999
    var match1to6      = /[+-]?\d{1,6}/;  // -999999 - 999999

    var matchUnsigned  = /\d+/;           //       0 - inf
    var matchSigned    = /[+-]?\d+/;      //    -inf - inf

    var matchOffset    = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
    var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z

    var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123

    // any word (or two) characters or numbers including two/three word month in arabic.
    // includes scottish gaelic two word and hyphenated months
    var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;

    var regexes = {};

    function addRegexToken (token, regex, strictRegex) {
        regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
            return (isStrict &amp;&amp; strictRegex) ? strictRegex : regex;
        };
    }

    function getParseRegexForToken (token, config) {
        if (!hasOwnProp(regexes, token)) {
            return new RegExp(unescapeFormat(token));
        }

        return regexes[token](config._strict, config._locale);
    }

    // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
    function unescapeFormat(s) {
        return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
            return p1 || p2 || p3 || p4;
        }));
    }

    function regexEscape(s) {
        return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&amp;');
    }

    var tokens = {};

    function addParseToken (token, callback) {
        var i, func = callback;
        if (typeof token === 'string') {
            token = [token];
        }
        if (isNumber(callback)) {
            func = function (input, array) {
                array[callback] = toInt(input);
            };
        }
        for (i = 0; i &lt; token.length; i++) {
            tokens[token[i]] = func;
        }
    }

    function addWeekParseToken (token, callback) {
        addParseToken(token, function (input, array, config, token) {
            config._w = config._w || {};
            callback(input, config._w, config, token);
        });
    }

    function addTimeToArrayFromToken(token, input, config) {
        if (input != null &amp;&amp; hasOwnProp(tokens, token)) {
            tokens[token](input, config._a, config, token);
        }
    }

    var YEAR = 0;
    var MONTH = 1;
    var DATE = 2;
    var HOUR = 3;
    var MINUTE = 4;
    var SECOND = 5;
    var MILLISECOND = 6;
    var WEEK = 7;
    var WEEKDAY = 8;

    // FORMATTING

    addFormatToken('Y', 0, 0, function () {
        var y = this.year();
        return y &lt;= 9999 ? '' + y : '+' + y;
    });

    addFormatToken(0, ['YY', 2], 0, function () {
        return this.year() % 100;
    });

    addFormatToken(0, ['YYYY',   4],       0, 'year');
    addFormatToken(0, ['YYYYY',  5],       0, 'year');
    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');

    // ALIASES

    addUnitAlias('year', 'y');

    // PRIORITIES

    addUnitPriority('year', 1);

    // PARSING

    addRegexToken('Y',      matchSigned);
    addRegexToken('YY',     match1to2, match2);
    addRegexToken('YYYY',   match1to4, match4);
    addRegexToken('YYYYY',  match1to6, match6);
    addRegexToken('YYYYYY', match1to6, match6);

    addParseToken(['YYYYY', 'YYYYYY'], YEAR);
    addParseToken('YYYY', function (input, array) {
        array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
    });
    addParseToken('YY', function (input, array) {
        array[YEAR] = hooks.parseTwoDigitYear(input);
    });
    addParseToken('Y', function (input, array) {
        array[YEAR] = parseInt(input, 10);
    });

    // HELPERS

    function daysInYear(year) {
        return isLeapYear(year) ? 366 : 365;
    }

    function isLeapYear(year) {
        return (year % 4 === 0 &amp;&amp; year % 100 !== 0) || year % 400 === 0;
    }

    // HOOKS

    hooks.parseTwoDigitYear = function (input) {
        return toInt(input) + (toInt(input) &gt; 68 ? 1900 : 2000);
    };

    // MOMENTS

    var getSetYear = makeGetSet('FullYear', true);

    function getIsLeapYear () {
        return isLeapYear(this.year());
    }

    function makeGetSet (unit, keepTime) {
        return function (value) {
            if (value != null) {
                set$1(this, unit, value);
                hooks.updateOffset(this, keepTime);
                return this;
            } else {
                return get(this, unit);
            }
        };
    }

    function get (mom, unit) {
        return mom.isValid() ?
            mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
    }

    function set$1 (mom, unit, value) {
        if (mom.isValid() &amp;&amp; !isNaN(value)) {
            if (unit === 'FullYear' &amp;&amp; isLeapYear(mom.year()) &amp;&amp; mom.month() === 1 &amp;&amp; mom.date() === 29) {
                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
            }
            else {
                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
            }
        }
    }

    // MOMENTS

    function stringGet (units) {
        units = normalizeUnits(units);
        if (isFunction(this[units])) {
            return this[units]();
        }
        return this;
    }


    function stringSet (units, value) {
        if (typeof units === 'object') {
            units = normalizeObjectUnits(units);
            var prioritized = getPrioritizedUnits(units);
            for (var i = 0; i &lt; prioritized.length; i++) {
                this[prioritized[i].unit](units[prioritized[i].unit]);
            }
        } else {
            units = normalizeUnits(units);
            if (isFunction(this[units])) {
                return this[units](value);
            }
        }
        return this;
    }

    function mod(n, x) {
        return ((n % x) + x) % x;
    }

    var indexOf;

    if (Array.prototype.indexOf) {
        indexOf = Array.prototype.indexOf;
    } else {
        indexOf = function (o) {
            // I know
            var i;
            for (i = 0; i &lt; this.length; ++i) {
                if (this[i] === o) {
                    return i;
                }
            }
            return -1;
        };
    }

    function daysInMonth(year, month) {
        if (isNaN(year) || isNaN(month)) {
            return NaN;
        }
        var modMonth = mod(month, 12);
        year += (month - modMonth) / 12;
        return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);
    }

    // FORMATTING

    addFormatToken('M', ['MM', 2], 'Mo', function () {
        return this.month() + 1;
    });

    addFormatToken('MMM', 0, 0, function (format) {
        return this.localeData().monthsShort(this, format);
    });

    addFormatToken('MMMM', 0, 0, function (format) {
        return this.localeData().months(this, format);
    });

    // ALIASES

    addUnitAlias('month', 'M');

    // PRIORITY

    addUnitPriority('month', 8);

    // PARSING

    addRegexToken('M',    match1to2);
    addRegexToken('MM',   match1to2, match2);
    addRegexToken('MMM',  function (isStrict, locale) {
        return locale.monthsShortRegex(isStrict);
    });
    addRegexToken('MMMM', function (isStrict, locale) {
        return locale.monthsRegex(isStrict);
    });

    addParseToken(['M', 'MM'], function (input, array) {
        array[MONTH] = toInt(input) - 1;
    });

    addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
        var month = config._locale.monthsParse(input, token, config._strict);
        // if we didn't find a month name, mark the date as invalid.
        if (month != null) {
            array[MONTH] = month;
        } else {
            getParsingFlags(config).invalidMonth = input;
        }
    });

    // LOCALES

    var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
    var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
    function localeMonths (m, format) {
        if (!m) {
            return isArray(this._months) ? this._months :
                this._months['standalone'];
        }
        return isArray(this._months) ? this._months[m.month()] :
            this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
    }

    var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
    function localeMonthsShort (m, format) {
        if (!m) {
            return isArray(this._monthsShort) ? this._monthsShort :
                this._monthsShort['standalone'];
        }
        return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
            this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
    }

    function handleStrictParse(monthName, format, strict) {
        var i, ii, mom, llc = monthName.toLocaleLowerCase();
        if (!this._monthsParse) {
            // this is not used
            this._monthsParse = [];
            this._longMonthsParse = [];
            this._shortMonthsParse = [];
            for (i = 0; i &lt; 12; ++i) {
                mom = createUTC([2000, i]);
                this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
                this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
            }
        }

        if (strict) {
            if (format === 'MMM') {
                ii = indexOf.call(this._shortMonthsParse, llc);
                return ii !== -1 ? ii : null;
            } else {
                ii = indexOf.call(this._longMonthsParse, llc);
                return ii !== -1 ? ii : null;
            }
        } else {
            if (format === 'MMM') {
                ii = indexOf.call(this._shortMonthsParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._longMonthsParse, llc);
                return ii !== -1 ? ii : null;
            } else {
                ii = indexOf.call(this._longMonthsParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._shortMonthsParse, llc);
                return ii !== -1 ? ii : null;
            }
        }
    }

    function localeMonthsParse (monthName, format, strict) {
        var i, mom, regex;

        if (this._monthsParseExact) {
            return handleStrictParse.call(this, monthName, format, strict);
        }

        if (!this._monthsParse) {
            this._monthsParse = [];
            this._longMonthsParse = [];
            this._shortMonthsParse = [];
        }

        // TODO: add sorting
        // Sorting makes sure if one month (or abbr) is a prefix of another
        // see sorting in computeMonthsParse
        for (i = 0; i &lt; 12; i++) {
            // make the regex if we don't have it already
            mom = createUTC([2000, i]);
            if (strict &amp;&amp; !this._longMonthsParse[i]) {
                this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
                this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
            }
            if (!strict &amp;&amp; !this._monthsParse[i]) {
                regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
                this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
            }
            // test the regex
            if (strict &amp;&amp; format === 'MMMM' &amp;&amp; this._longMonthsParse[i].test(monthName)) {
                return i;
            } else if (strict &amp;&amp; format === 'MMM' &amp;&amp; this._shortMonthsParse[i].test(monthName)) {
                return i;
            } else if (!strict &amp;&amp; this._monthsParse[i].test(monthName)) {
                return i;
            }
        }
    }

    // MOMENTS

    function setMonth (mom, value) {
        var dayOfMonth;

        if (!mom.isValid()) {
            // No op
            return mom;
        }

        if (typeof value === 'string') {
            if (/^\d+$/.test(value)) {
                value = toInt(value);
            } else {
                value = mom.localeData().monthsParse(value);
                // TODO: Another silent failure?
                if (!isNumber(value)) {
                    return mom;
                }
            }
        }

        dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
        mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
        return mom;
    }

    function getSetMonth (value) {
        if (value != null) {
            setMonth(this, value);
            hooks.updateOffset(this, true);
            return this;
        } else {
            return get(this, 'Month');
        }
    }

    function getDaysInMonth () {
        return daysInMonth(this.year(), this.month());
    }

    var defaultMonthsShortRegex = matchWord;
    function monthsShortRegex (isStrict) {
        if (this._monthsParseExact) {
            if (!hasOwnProp(this, '_monthsRegex')) {
                computeMonthsParse.call(this);
            }
            if (isStrict) {
                return this._monthsShortStrictRegex;
            } else {
                return this._monthsShortRegex;
            }
        } else {
            if (!hasOwnProp(this, '_monthsShortRegex')) {
                this._monthsShortRegex = defaultMonthsShortRegex;
            }
            return this._monthsShortStrictRegex &amp;&amp; isStrict ?
                this._monthsShortStrictRegex : this._monthsShortRegex;
        }
    }

    var defaultMonthsRegex = matchWord;
    function monthsRegex (isStrict) {
        if (this._monthsParseExact) {
            if (!hasOwnProp(this, '_monthsRegex')) {
                computeMonthsParse.call(this);
            }
            if (isStrict) {
                return this._monthsStrictRegex;
            } else {
                return this._monthsRegex;
            }
        } else {
            if (!hasOwnProp(this, '_monthsRegex')) {
                this._monthsRegex = defaultMonthsRegex;
            }
            return this._monthsStrictRegex &amp;&amp; isStrict ?
                this._monthsStrictRegex : this._monthsRegex;
        }
    }

    function computeMonthsParse () {
        function cmpLenRev(a, b) {
            return b.length - a.length;
        }

        var shortPieces = [], longPieces = [], mixedPieces = [],
            i, mom;
        for (i = 0; i &lt; 12; i++) {
            // make the regex if we don't have it already
            mom = createUTC([2000, i]);
            shortPieces.push(this.monthsShort(mom, ''));
            longPieces.push(this.months(mom, ''));
            mixedPieces.push(this.months(mom, ''));
            mixedPieces.push(this.monthsShort(mom, ''));
        }
        // Sorting makes sure if one month (or abbr) is a prefix of another it
        // will match the longer piece.
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        for (i = 0; i &lt; 12; i++) {
            shortPieces[i] = regexEscape(shortPieces[i]);
            longPieces[i] = regexEscape(longPieces[i]);
        }
        for (i = 0; i &lt; 24; i++) {
            mixedPieces[i] = regexEscape(mixedPieces[i]);
        }

        this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
        this._monthsShortRegex = this._monthsRegex;
        this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
        this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
    }

    function createDate (y, m, d, h, M, s, ms) {
        // can't just apply() to create a date:
        // https://stackoverflow.com/q/181348
        var date = new Date(y, m, d, h, M, s, ms);

        // the date constructor remaps years 0-99 to 1900-1999
        if (y &lt; 100 &amp;&amp; y &gt;= 0 &amp;&amp; isFinite(date.getFullYear())) {
            date.setFullYear(y);
        }
        return date;
    }

    function createUTCDate (y) {
        var date = new Date(Date.UTC.apply(null, arguments));

        // the Date.UTC function remaps years 0-99 to 1900-1999
        if (y &lt; 100 &amp;&amp; y &gt;= 0 &amp;&amp; isFinite(date.getUTCFullYear())) {
            date.setUTCFullYear(y);
        }
        return date;
    }

    // start-of-first-week - start-of-year
    function firstWeekOffset(year, dow, doy) {
        var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
            fwd = 7 + dow - doy,
            // first-week day local weekday -- which local weekday is fwd
            fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;

        return -fwdlw + fwd - 1;
    }

    // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
    function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
        var localWeekday = (7 + weekday - dow) % 7,
            weekOffset = firstWeekOffset(year, dow, doy),
            dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
            resYear, resDayOfYear;

        if (dayOfYear &lt;= 0) {
            resYear = year - 1;
            resDayOfYear = daysInYear(resYear) + dayOfYear;
        } else if (dayOfYear &gt; daysInYear(year)) {
            resYear = year + 1;
            resDayOfYear = dayOfYear - daysInYear(year);
        } else {
            resYear = year;
            resDayOfYear = dayOfYear;
        }

        return {
            year: resYear,
            dayOfYear: resDayOfYear
        };
    }

    function weekOfYear(mom, dow, doy) {
        var weekOffset = firstWeekOffset(mom.year(), dow, doy),
            week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
            resWeek, resYear;

        if (week &lt; 1) {
            resYear = mom.year() - 1;
            resWeek = week + weeksInYear(resYear, dow, doy);
        } else if (week &gt; weeksInYear(mom.year(), dow, doy)) {
            resWeek = week - weeksInYear(mom.year(), dow, doy);
            resYear = mom.year() + 1;
        } else {
            resYear = mom.year();
            resWeek = week;
        }

        return {
            week: resWeek,
            year: resYear
        };
    }

    function weeksInYear(year, dow, doy) {
        var weekOffset = firstWeekOffset(year, dow, doy),
            weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
        return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
    }

    // FORMATTING

    addFormatToken('w', ['ww', 2], 'wo', 'week');
    addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');

    // ALIASES

    addUnitAlias('week', 'w');
    addUnitAlias('isoWeek', 'W');

    // PRIORITIES

    addUnitPriority('week', 5);
    addUnitPriority('isoWeek', 5);

    // PARSING

    addRegexToken('w',  match1to2);
    addRegexToken('ww', match1to2, match2);
    addRegexToken('W',  match1to2);
    addRegexToken('WW', match1to2, match2);

    addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
        week[token.substr(0, 1)] = toInt(input);
    });

    // HELPERS

    // LOCALES

    function localeWeek (mom) {
        return weekOfYear(mom, this._week.dow, this._week.doy).week;
    }

    var defaultLocaleWeek = {
        dow : 0, // Sunday is the first day of the week.
        doy : 6  // The week that contains Jan 1st is the first week of the year.
    };

    function localeFirstDayOfWeek () {
        return this._week.dow;
    }

    function localeFirstDayOfYear () {
        return this._week.doy;
    }

    // MOMENTS

    function getSetWeek (input) {
        var week = this.localeData().week(this);
        return input == null ? week : this.add((input - week) * 7, 'd');
    }

    function getSetISOWeek (input) {
        var week = weekOfYear(this, 1, 4).week;
        return input == null ? week : this.add((input - week) * 7, 'd');
    }

    // FORMATTING

    addFormatToken('d', 0, 'do', 'day');

    addFormatToken('dd', 0, 0, function (format) {
        return this.localeData().weekdaysMin(this, format);
    });

    addFormatToken('ddd', 0, 0, function (format) {
        return this.localeData().weekdaysShort(this, format);
    });

    addFormatToken('dddd', 0, 0, function (format) {
        return this.localeData().weekdays(this, format);
    });

    addFormatToken('e', 0, 0, 'weekday');
    addFormatToken('E', 0, 0, 'isoWeekday');

    // ALIASES

    addUnitAlias('day', 'd');
    addUnitAlias('weekday', 'e');
    addUnitAlias('isoWeekday', 'E');

    // PRIORITY
    addUnitPriority('day', 11);
    addUnitPriority('weekday', 11);
    addUnitPriority('isoWeekday', 11);

    // PARSING

    addRegexToken('d',    match1to2);
    addRegexToken('e',    match1to2);
    addRegexToken('E',    match1to2);
    addRegexToken('dd',   function (isStrict, locale) {
        return locale.weekdaysMinRegex(isStrict);
    });
    addRegexToken('ddd',   function (isStrict, locale) {
        return locale.weekdaysShortRegex(isStrict);
    });
    addRegexToken('dddd',   function (isStrict, locale) {
        return locale.weekdaysRegex(isStrict);
    });

    addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
        var weekday = config._locale.weekdaysParse(input, token, config._strict);
        // if we didn't get a weekday name, mark the date as invalid
        if (weekday != null) {
            week.d = weekday;
        } else {
            getParsingFlags(config).invalidWeekday = input;
        }
    });

    addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
        week[token] = toInt(input);
    });

    // HELPERS

    function parseWeekday(input, locale) {
        if (typeof input !== 'string') {
            return input;
        }

        if (!isNaN(input)) {
            return parseInt(input, 10);
        }

        input = locale.weekdaysParse(input);
        if (typeof input === 'number') {
            return input;
        }

        return null;
    }

    function parseIsoWeekday(input, locale) {
        if (typeof input === 'string') {
            return locale.weekdaysParse(input) % 7 || 7;
        }
        return isNaN(input) ? null : input;
    }

    // LOCALES

    var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
    function localeWeekdays (m, format) {
        if (!m) {
            return isArray(this._weekdays) ? this._weekdays :
                this._weekdays['standalone'];
        }
        return isArray(this._weekdays) ? this._weekdays[m.day()] :
            this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
    }

    var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
    function localeWeekdaysShort (m) {
        return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
    }

    var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
    function localeWeekdaysMin (m) {
        return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
    }

    function handleStrictParse$1(weekdayName, format, strict) {
        var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
        if (!this._weekdaysParse) {
            this._weekdaysParse = [];
            this._shortWeekdaysParse = [];
            this._minWeekdaysParse = [];

            for (i = 0; i &lt; 7; ++i) {
                mom = createUTC([2000, 1]).day(i);
                this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
                this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
                this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
            }
        }

        if (strict) {
            if (format === 'dddd') {
                ii = indexOf.call(this._weekdaysParse, llc);
                return ii !== -1 ? ii : null;
            } else if (format === 'ddd') {
                ii = indexOf.call(this._shortWeekdaysParse, llc);
                return ii !== -1 ? ii : null;
            } else {
                ii = indexOf.call(this._minWeekdaysParse, llc);
                return ii !== -1 ? ii : null;
            }
        } else {
            if (format === 'dddd') {
                ii = indexOf.call(this._weekdaysParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._shortWeekdaysParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._minWeekdaysParse, llc);
                return ii !== -1 ? ii : null;
            } else if (format === 'ddd') {
                ii = indexOf.call(this._shortWeekdaysParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._weekdaysParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._minWeekdaysParse, llc);
                return ii !== -1 ? ii : null;
            } else {
                ii = indexOf.call(this._minWeekdaysParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._weekdaysParse, llc);
                if (ii !== -1) {
                    return ii;
                }
                ii = indexOf.call(this._shortWeekdaysParse, llc);
                return ii !== -1 ? ii : null;
            }
        }
    }

    function localeWeekdaysParse (weekdayName, format, strict) {
        var i, mom, regex;

        if (this._weekdaysParseExact) {
            return handleStrictParse$1.call(this, weekdayName, format, strict);
        }

        if (!this._weekdaysParse) {
            this._weekdaysParse = [];
            this._minWeekdaysParse = [];
            this._shortWeekdaysParse = [];
            this._fullWeekdaysParse = [];
        }

        for (i = 0; i &lt; 7; i++) {
            // make the regex if we don't have it already

            mom = createUTC([2000, 1]).day(i);
            if (strict &amp;&amp; !this._fullWeekdaysParse[i]) {
                this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
                this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
                this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
            }
            if (!this._weekdaysParse[i]) {
                regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
                this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
            }
            // test the regex
            if (strict &amp;&amp; format === 'dddd' &amp;&amp; this._fullWeekdaysParse[i].test(weekdayName)) {
                return i;
            } else if (strict &amp;&amp; format === 'ddd' &amp;&amp; this._shortWeekdaysParse[i].test(weekdayName)) {
                return i;
            } else if (strict &amp;&amp; format === 'dd' &amp;&amp; this._minWeekdaysParse[i].test(weekdayName)) {
                return i;
            } else if (!strict &amp;&amp; this._weekdaysParse[i].test(weekdayName)) {
                return i;
            }
        }
    }

    // MOMENTS

    function getSetDayOfWeek (input) {
        if (!this.isValid()) {
            return input != null ? this : NaN;
        }
        var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
        if (input != null) {
            input = parseWeekday(input, this.localeData());
            return this.add(input - day, 'd');
        } else {
            return day;
        }
    }

    function getSetLocaleDayOfWeek (input) {
        if (!this.isValid()) {
            return input != null ? this : NaN;
        }
        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
        return input == null ? weekday : this.add(input - weekday, 'd');
    }

    function getSetISODayOfWeek (input) {
        if (!this.isValid()) {
            return input != null ? this : NaN;
        }

        // behaves the same as moment#day except
        // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
        // as a setter, sunday should belong to the previous week.

        if (input != null) {
            var weekday = parseIsoWeekday(input, this.localeData());
            return this.day(this.day() % 7 ? weekday : weekday - 7);
        } else {
            return this.day() || 7;
        }
    }

    var defaultWeekdaysRegex = matchWord;
    function weekdaysRegex (isStrict) {
        if (this._weekdaysParseExact) {
            if (!hasOwnProp(this, '_weekdaysRegex')) {
                computeWeekdaysParse.call(this);
            }
            if (isStrict) {
                return this._weekdaysStrictRegex;
            } else {
                return this._weekdaysRegex;
            }
        } else {
            if (!hasOwnProp(this, '_weekdaysRegex')) {
                this._weekdaysRegex = defaultWeekdaysRegex;
            }
            return this._weekdaysStrictRegex &amp;&amp; isStrict ?
                this._weekdaysStrictRegex : this._weekdaysRegex;
        }
    }

    var defaultWeekdaysShortRegex = matchWord;
    function weekdaysShortRegex (isStrict) {
        if (this._weekdaysParseExact) {
            if (!hasOwnProp(this, '_weekdaysRegex')) {
                computeWeekdaysParse.call(this);
            }
            if (isStrict) {
                return this._weekdaysShortStrictRegex;
            } else {
                return this._weekdaysShortRegex;
            }
        } else {
            if (!hasOwnProp(this, '_weekdaysShortRegex')) {
                this._weekdaysShortRegex = defaultWeekdaysShortRegex;
            }
            return this._weekdaysShortStrictRegex &amp;&amp; isStrict ?
                this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
        }
    }

    var defaultWeekdaysMinRegex = matchWord;
    function weekdaysMinRegex (isStrict) {
        if (this._weekdaysParseExact) {
            if (!hasOwnProp(this, '_weekdaysRegex')) {
                computeWeekdaysParse.call(this);
            }
            if (isStrict) {
                return this._weekdaysMinStrictRegex;
            } else {
                return this._weekdaysMinRegex;
            }
        } else {
            if (!hasOwnProp(this, '_weekdaysMinRegex')) {
                this._weekdaysMinRegex = defaultWeekdaysMinRegex;
            }
            return this._weekdaysMinStrictRegex &amp;&amp; isStrict ?
                this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
        }
    }


    function computeWeekdaysParse () {
        function cmpLenRev(a, b) {
            return b.length - a.length;
        }

        var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
            i, mom, minp, shortp, longp;
        for (i = 0; i &lt; 7; i++) {
            // make the regex if we don't have it already
            mom = createUTC([2000, 1]).day(i);
            minp = this.weekdaysMin(mom, '');
            shortp = this.weekdaysShort(mom, '');
            longp = this.weekdays(mom, '');
            minPieces.push(minp);
            shortPieces.push(shortp);
            longPieces.push(longp);
            mixedPieces.push(minp);
            mixedPieces.push(shortp);
            mixedPieces.push(longp);
        }
        // Sorting makes sure if one weekday (or abbr) is a prefix of another it
        // will match the longer piece.
        minPieces.sort(cmpLenRev);
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        for (i = 0; i &lt; 7; i++) {
            shortPieces[i] = regexEscape(shortPieces[i]);
            longPieces[i] = regexEscape(longPieces[i]);
            mixedPieces[i] = regexEscape(mixedPieces[i]);
        }

        this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
        this._weekdaysShortRegex = this._weekdaysRegex;
        this._weekdaysMinRegex = this._weekdaysRegex;

        this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
        this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
        this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
    }

    // FORMATTING

    function hFormat() {
        return this.hours() % 12 || 12;
    }

    function kFormat() {
        return this.hours() || 24;
    }

    addFormatToken('H', ['HH', 2], 0, 'hour');
    addFormatToken('h', ['hh', 2], 0, hFormat);
    addFormatToken('k', ['kk', 2], 0, kFormat);

    addFormatToken('hmm', 0, 0, function () {
        return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
    });

    addFormatToken('hmmss', 0, 0, function () {
        return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
            zeroFill(this.seconds(), 2);
    });

    addFormatToken('Hmm', 0, 0, function () {
        return '' + this.hours() + zeroFill(this.minutes(), 2);
    });

    addFormatToken('Hmmss', 0, 0, function () {
        return '' + this.hours() + zeroFill(this.minutes(), 2) +
            zeroFill(this.seconds(), 2);
    });

    function meridiem (token, lowercase) {
        addFormatToken(token, 0, 0, function () {
            return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
        });
    }

    meridiem('a', true);
    meridiem('A', false);

    // ALIASES

    addUnitAlias('hour', 'h');

    // PRIORITY
    addUnitPriority('hour', 13);

    // PARSING

    function matchMeridiem (isStrict, locale) {
        return locale._meridiemParse;
    }

    addRegexToken('a',  matchMeridiem);
    addRegexToken('A',  matchMeridiem);
    addRegexToken('H',  match1to2);
    addRegexToken('h',  match1to2);
    addRegexToken('k',  match1to2);
    addRegexToken('HH', match1to2, match2);
    addRegexToken('hh', match1to2, match2);
    addRegexToken('kk', match1to2, match2);

    addRegexToken('hmm', match3to4);
    addRegexToken('hmmss', match5to6);
    addRegexToken('Hmm', match3to4);
    addRegexToken('Hmmss', match5to6);

    addParseToken(['H', 'HH'], HOUR);
    addParseToken(['k', 'kk'], function (input, array, config) {
        var kInput = toInt(input);
        array[HOUR] = kInput === 24 ? 0 : kInput;
    });
    addParseToken(['a', 'A'], function (input, array, config) {
        config._isPm = config._locale.isPM(input);
        config._meridiem = input;
    });
    addParseToken(['h', 'hh'], function (input, array, config) {
        array[HOUR] = toInt(input);
        getParsingFlags(config).bigHour = true;
    });
    addParseToken('hmm', function (input, array, config) {
        var pos = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos));
        array[MINUTE] = toInt(input.substr(pos));
        getParsingFlags(config).bigHour = true;
    });
    addParseToken('hmmss', function (input, array, config) {
        var pos1 = input.length - 4;
        var pos2 = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos1));
        array[MINUTE] = toInt(input.substr(pos1, 2));
        array[SECOND] = toInt(input.substr(pos2));
        getParsingFlags(config).bigHour = true;
    });
    addParseToken('Hmm', function (input, array, config) {
        var pos = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos));
        array[MINUTE] = toInt(input.substr(pos));
    });
    addParseToken('Hmmss', function (input, array, config) {
        var pos1 = input.length - 4;
        var pos2 = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos1));
        array[MINUTE] = toInt(input.substr(pos1, 2));
        array[SECOND] = toInt(input.substr(pos2));
    });

    // LOCALES

    function localeIsPM (input) {
        // IE8 Quirks Mode &amp; IE7 Standards Mode do not allow accessing strings like arrays
        // Using charAt should be more compatible.
        return ((input + '').toLowerCase().charAt(0) === 'p');
    }

    var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
    function localeMeridiem (hours, minutes, isLower) {
        if (hours &gt; 11) {
            return isLower ? 'pm' : 'PM';
        } else {
            return isLower ? 'am' : 'AM';
        }
    }


    // MOMENTS

    // Setting the hour should keep the time, because the user explicitly
    // specified which hour they want. So trying to maintain the same hour (in
    // a new timezone) makes sense. Adding/subtracting hours does not follow
    // this rule.
    var getSetHour = makeGetSet('Hours', true);

    var baseConfig = {
        calendar: defaultCalendar,
        longDateFormat: defaultLongDateFormat,
        invalidDate: defaultInvalidDate,
        ordinal: defaultOrdinal,
        dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
        relativeTime: defaultRelativeTime,

        months: defaultLocaleMonths,
        monthsShort: defaultLocaleMonthsShort,

        week: defaultLocaleWeek,

        weekdays: defaultLocaleWeekdays,
        weekdaysMin: defaultLocaleWeekdaysMin,
        weekdaysShort: defaultLocaleWeekdaysShort,

        meridiemParse: defaultLocaleMeridiemParse
    };

    // internal storage for locale config files
    var locales = {};
    var localeFamilies = {};
    var globalLocale;

    function normalizeLocale(key) {
        return key ? key.toLowerCase().replace('_', '-') : key;
    }

    // pick the locale from the array
    // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
    // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
    function chooseLocale(names) {
        var i = 0, j, next, locale, split;

        while (i &lt; names.length) {
            split = normalizeLocale(names[i]).split('-');
            j = split.length;
            next = normalizeLocale(names[i + 1]);
            next = next ? next.split('-') : null;
            while (j &gt; 0) {
                locale = loadLocale(split.slice(0, j).join('-'));
                if (locale) {
                    return locale;
                }
                if (next &amp;&amp; next.length &gt;= j &amp;&amp; compareArrays(split, next, true) &gt;= j - 1) {
                    //the next array item is better than a shallower substring of this one
                    break;
                }
                j--;
            }
            i++;
        }
        return globalLocale;
    }

    function loadLocale(name) {
        var oldLocale = null;
        // TODO: Find a better way to register and load all the locales in Node
        if (!locales[name] &amp;&amp; (typeof module !== 'undefined') &amp;&amp;
                module &amp;&amp; module.exports) {
            try {
                oldLocale = globalLocale._abbr;
                var aliasedRequire = require;
                aliasedRequire('./locale/' + name);
                getSetGlobalLocale(oldLocale);
            } catch (e) {}
        }
        return locales[name];
    }

    // This function will load locale and then set the global locale.  If
    // no arguments are passed in, it will simply return the current global
    // locale key.
    function getSetGlobalLocale (key, values) {
        var data;
        if (key) {
            if (isUndefined(values)) {
                data = getLocale(key);
            }
            else {
                data = defineLocale(key, values);
            }

            if (data) {
                // moment.duration._locale = moment._locale = data;
                globalLocale = data;
            }
            else {
                if ((typeof console !==  'undefined') &amp;&amp; console.warn) {
                    //warn user if arguments are passed but the locale could not be set
                    console.warn('Locale ' + key +  ' not found. Did you forget to load it?');
                }
            }
        }

        return globalLocale._abbr;
    }

    function defineLocale (name, config) {
        if (config !== null) {
            var locale, parentConfig = baseConfig;
            config.abbr = name;
            if (locales[name] != null) {
                deprecateSimple('defineLocaleOverride',
                        'use moment.updateLocale(localeName, config) to change ' +
                        'an existing locale. moment.defineLocale(localeName, ' +
                        'config) should only be used for creating a new locale ' +
                        'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
                parentConfig = locales[name]._config;
            } else if (config.parentLocale != null) {
                if (locales[config.parentLocale] != null) {
                    parentConfig = locales[config.parentLocale]._config;
                } else {
                    locale = loadLocale(config.parentLocale);
                    if (locale != null) {
                        parentConfig = locale._config;
                    } else {
                        if (!localeFamilies[config.parentLocale]) {
                            localeFamilies[config.parentLocale] = [];
                        }
                        localeFamilies[config.parentLocale].push({
                            name: name,
                            config: config
                        });
                        return null;
                    }
                }
            }
            locales[name] = new Locale(mergeConfigs(parentConfig, config));

            if (localeFamilies[name]) {
                localeFamilies[name].forEach(function (x) {
                    defineLocale(x.name, x.config);
                });
            }

            // backwards compat for now: also set the locale
            // make sure we set the locale AFTER all child locales have been
            // created, so we won't end up with the child locale set.
            getSetGlobalLocale(name);


            return locales[name];
        } else {
            // useful for testing
            delete locales[name];
            return null;
        }
    }

    function updateLocale(name, config) {
        if (config != null) {
            var locale, tmpLocale, parentConfig = baseConfig;
            // MERGE
            tmpLocale = loadLocale(name);
            if (tmpLocale != null) {
                parentConfig = tmpLocale._config;
            }
            config = mergeConfigs(parentConfig, config);
            locale = new Locale(config);
            locale.parentLocale = locales[name];
            locales[name] = locale;

            // backwards compat for now: also set the locale
            getSetGlobalLocale(name);
        } else {
            // pass null for config to unupdate, useful for tests
            if (locales[name] != null) {
                if (locales[name].parentLocale != null) {
                    locales[name] = locales[name].parentLocale;
                } else if (locales[name] != null) {
                    delete locales[name];
                }
            }
        }
        return locales[name];
    }

    // returns locale data
    function getLocale (key) {
        var locale;

        if (key &amp;&amp; key._locale &amp;&amp; key._locale._abbr) {
            key = key._locale._abbr;
        }

        if (!key) {
            return globalLocale;
        }

        if (!isArray(key)) {
            //short-circuit everything else
            locale = loadLocale(key);
            if (locale) {
                return locale;
            }
            key = [key];
        }

        return chooseLocale(key);
    }

    function listLocales() {
        return keys(locales);
    }

    function checkOverflow (m) {
        var overflow;
        var a = m._a;

        if (a &amp;&amp; getParsingFlags(m).overflow === -2) {
            overflow =
                a[MONTH]       &lt; 0 || a[MONTH]       &gt; 11  ? MONTH :
                a[DATE]        &lt; 1 || a[DATE]        &gt; daysInMonth(a[YEAR], a[MONTH]) ? DATE :
                a[HOUR]        &lt; 0 || a[HOUR]        &gt; 24 || (a[HOUR] === 24 &amp;&amp; (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
                a[MINUTE]      &lt; 0 || a[MINUTE]      &gt; 59  ? MINUTE :
                a[SECOND]      &lt; 0 || a[SECOND]      &gt; 59  ? SECOND :
                a[MILLISECOND] &lt; 0 || a[MILLISECOND] &gt; 999 ? MILLISECOND :
                -1;

            if (getParsingFlags(m)._overflowDayOfYear &amp;&amp; (overflow &lt; YEAR || overflow &gt; DATE)) {
                overflow = DATE;
            }
            if (getParsingFlags(m)._overflowWeeks &amp;&amp; overflow === -1) {
                overflow = WEEK;
            }
            if (getParsingFlags(m)._overflowWeekday &amp;&amp; overflow === -1) {
                overflow = WEEKDAY;
            }

            getParsingFlags(m).overflow = overflow;
        }

        return m;
    }

    // Pick the first defined of two or three arguments.
    function defaults(a, b, c) {
        if (a != null) {
            return a;
        }
        if (b != null) {
            return b;
        }
        return c;
    }

    function currentDateArray(config) {
        // hooks is actually the exported moment object
        var nowValue = new Date(hooks.now());
        if (config._useUTC) {
            return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
        }
        return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
    }

    // convert an array to a date.
    // the array should mirror the parameters below
    // note: all values past the year are optional and will default to the lowest possible value.
    // [year, month, day , hour, minute, second, millisecond]
    function configFromArray (config) {
        var i, date, input = [], currentDate, expectedWeekday, yearToUse;

        if (config._d) {
            return;
        }

        currentDate = currentDateArray(config);

        //compute day of the year from weeks and weekdays
        if (config._w &amp;&amp; config._a[DATE] == null &amp;&amp; config._a[MONTH] == null) {
            dayOfYearFromWeekInfo(config);
        }

        //if the day of the year is set, figure out what it is
        if (config._dayOfYear != null) {
            yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);

            if (config._dayOfYear &gt; daysInYear(yearToUse) || config._dayOfYear === 0) {
                getParsingFlags(config)._overflowDayOfYear = true;
            }

            date = createUTCDate(yearToUse, 0, config._dayOfYear);
            config._a[MONTH] = date.getUTCMonth();
            config._a[DATE] = date.getUTCDate();
        }

        // Default to current date.
        // * if no year, month, day of month are given, default to today
        // * if day of month is given, default month and year
        // * if month is given, default only year
        // * if year is given, don't default anything
        for (i = 0; i &lt; 3 &amp;&amp; config._a[i] == null; ++i) {
            config._a[i] = input[i] = currentDate[i];
        }

        // Zero out whatever was not defaulted, including time
        for (; i &lt; 7; i++) {
            config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
        }

        // Check for 24:00:00.000
        if (config._a[HOUR] === 24 &amp;&amp;
                config._a[MINUTE] === 0 &amp;&amp;
                config._a[SECOND] === 0 &amp;&amp;
                config._a[MILLISECOND] === 0) {
            config._nextDay = true;
            config._a[HOUR] = 0;
        }

        config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
        expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();

        // Apply timezone offset from input. The actual utcOffset can be changed
        // with parseZone.
        if (config._tzm != null) {
            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
        }

        if (config._nextDay) {
            config._a[HOUR] = 24;
        }

        // check for mismatching day of week
        if (config._w &amp;&amp; typeof config._w.d !== 'undefined' &amp;&amp; config._w.d !== expectedWeekday) {
            getParsingFlags(config).weekdayMismatch = true;
        }
    }

    function dayOfYearFromWeekInfo(config) {
        var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;

        w = config._w;
        if (w.GG != null || w.W != null || w.E != null) {
            dow = 1;
            doy = 4;

            // TODO: We need to take the current isoWeekYear, but that depends on
            // how we interpret now (local, utc, fixed offset). So create
            // a now version of current config (take local/utc/offset flags, and
            // create now).
            weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
            week = defaults(w.W, 1);
            weekday = defaults(w.E, 1);
            if (weekday &lt; 1 || weekday &gt; 7) {
                weekdayOverflow = true;
            }
        } else {
            dow = config._locale._week.dow;
            doy = config._locale._week.doy;

            var curWeek = weekOfYear(createLocal(), dow, doy);

            weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);

            // Default to current week.
            week = defaults(w.w, curWeek.week);

            if (w.d != null) {
                // weekday -- low day numbers are considered next week
                weekday = w.d;
                if (weekday &lt; 0 || weekday &gt; 6) {
                    weekdayOverflow = true;
                }
            } else if (w.e != null) {
                // local weekday -- counting starts from begining of week
                weekday = w.e + dow;
                if (w.e &lt; 0 || w.e &gt; 6) {
                    weekdayOverflow = true;
                }
            } else {
                // default to begining of week
                weekday = dow;
            }
        }
        if (week &lt; 1 || week &gt; weeksInYear(weekYear, dow, doy)) {
            getParsingFlags(config)._overflowWeeks = true;
        } else if (weekdayOverflow != null) {
            getParsingFlags(config)._overflowWeekday = true;
        } else {
            temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
            config._a[YEAR] = temp.year;
            config._dayOfYear = temp.dayOfYear;
        }
    }

    // iso 8601 regex
    // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
    var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
    var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;

    var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;

    var isoDates = [
        ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
        ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
        ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
        ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
        ['YYYY-DDD', /\d{4}-\d{3}/],
        ['YYYY-MM', /\d{4}-\d\d/, false],
        ['YYYYYYMMDD', /[+-]\d{10}/],
        ['YYYYMMDD', /\d{8}/],
        // YYYYMM is NOT allowed by the standard
        ['GGGG[W]WWE', /\d{4}W\d{3}/],
        ['GGGG[W]WW', /\d{4}W\d{2}/, false],
        ['YYYYDDD', /\d{7}/]
    ];

    // iso time formats and regexes
    var isoTimes = [
        ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
        ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
        ['HH:mm:ss', /\d\d:\d\d:\d\d/],
        ['HH:mm', /\d\d:\d\d/],
        ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
        ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
        ['HHmmss', /\d\d\d\d\d\d/],
        ['HHmm', /\d\d\d\d/],
        ['HH', /\d\d/]
    ];

    var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;

    // date from iso format
    function configFromISO(config) {
        var i, l,
            string = config._i,
            match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
            allowTime, dateFormat, timeFormat, tzFormat;

        if (match) {
            getParsingFlags(config).iso = true;

            for (i = 0, l = isoDates.length; i &lt; l; i++) {
                if (isoDates[i][1].exec(match[1])) {
                    dateFormat = isoDates[i][0];
                    allowTime = isoDates[i][2] !== false;
                    break;
                }
            }
            if (dateFormat == null) {
                config._isValid = false;
                return;
            }
            if (match[3]) {
                for (i = 0, l = isoTimes.length; i &lt; l; i++) {
                    if (isoTimes[i][1].exec(match[3])) {
                        // match[2] should be 'T' or space
                        timeFormat = (match[2] || ' ') + isoTimes[i][0];
                        break;
                    }
                }
                if (timeFormat == null) {
                    config._isValid = false;
                    return;
                }
            }
            if (!allowTime &amp;&amp; timeFormat != null) {
                config._isValid = false;
                return;
            }
            if (match[4]) {
                if (tzRegex.exec(match[4])) {
                    tzFormat = 'Z';
                } else {
                    config._isValid = false;
                    return;
                }
            }
            config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
            configFromStringAndFormat(config);
        } else {
            config._isValid = false;
        }
    }

    // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
    var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;

    function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
        var result = [
            untruncateYear(yearStr),
            defaultLocaleMonthsShort.indexOf(monthStr),
            parseInt(dayStr, 10),
            parseInt(hourStr, 10),
            parseInt(minuteStr, 10)
        ];

        if (secondStr) {
            result.push(parseInt(secondStr, 10));
        }

        return result;
    }

    function untruncateYear(yearStr) {
        var year = parseInt(yearStr, 10);
        if (year &lt;= 49) {
            return 2000 + year;
        } else if (year &lt;= 999) {
            return 1900 + year;
        }
        return year;
    }

    function preprocessRFC2822(s) {
        // Remove comments and folding whitespace and replace multiple-spaces with a single space
        return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
    }

    function checkWeekday(weekdayStr, parsedInput, config) {
        if (weekdayStr) {
            // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
            var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
                weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
            if (weekdayProvided !== weekdayActual) {
                getParsingFlags(config).weekdayMismatch = true;
                config._isValid = false;
                return false;
            }
        }
        return true;
    }

    var obsOffsets = {
        UT: 0,
        GMT: 0,
        EDT: -4 * 60,
        EST: -5 * 60,
        CDT: -5 * 60,
        CST: -6 * 60,
        MDT: -6 * 60,
        MST: -7 * 60,
        PDT: -7 * 60,
        PST: -8 * 60
    };

    function calculateOffset(obsOffset, militaryOffset, numOffset) {
        if (obsOffset) {
            return obsOffsets[obsOffset];
        } else if (militaryOffset) {
            // the only allowed military tz is Z
            return 0;
        } else {
            var hm = parseInt(numOffset, 10);
            var m = hm % 100, h = (hm - m) / 100;
            return h * 60 + m;
        }
    }

    // date and time from ref 2822 format
    function configFromRFC2822(config) {
        var match = rfc2822.exec(preprocessRFC2822(config._i));
        if (match) {
            var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
            if (!checkWeekday(match[1], parsedArray, config)) {
                return;
            }

            config._a = parsedArray;
            config._tzm = calculateOffset(match[8], match[9], match[10]);

            config._d = createUTCDate.apply(null, config._a);
            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);

            getParsingFlags(config).rfc2822 = true;
        } else {
            config._isValid = false;
        }
    }

    // date from iso format or fallback
    function configFromString(config) {
        var matched = aspNetJsonRegex.exec(config._i);

        if (matched !== null) {
            config._d = new Date(+matched[1]);
            return;
        }

        configFromISO(config);
        if (config._isValid === false) {
            delete config._isValid;
        } else {
            return;
        }

        configFromRFC2822(config);
        if (config._isValid === false) {
            delete config._isValid;
        } else {
            return;
        }

        // Final attempt, use Input Fallback
        hooks.createFromInputFallback(config);
    }

    hooks.createFromInputFallback = deprecate(
        'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
        'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
        'discouraged and will be removed in an upcoming major release. Please refer to ' +
        'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
        function (config) {
            config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
        }
    );

    // constant that refers to the ISO standard
    hooks.ISO_8601 = function () {};

    // constant that refers to the RFC 2822 form
    hooks.RFC_2822 = function () {};

    // date from string and format string
    function configFromStringAndFormat(config) {
        // TODO: Move this to another part of the creation flow to prevent circular deps
        if (config._f === hooks.ISO_8601) {
            configFromISO(config);
            return;
        }
        if (config._f === hooks.RFC_2822) {
            configFromRFC2822(config);
            return;
        }
        config._a = [];
        getParsingFlags(config).empty = true;

        // This array is used to make a Date, either with `new Date` or `Date.UTC`
        var string = '' + config._i,
            i, parsedInput, tokens, token, skipped,
            stringLength = string.length,
            totalParsedInputLength = 0;

        tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];

        for (i = 0; i &lt; tokens.length; i++) {
            token = tokens[i];
            parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
            // console.log('token', token, 'parsedInput', parsedInput,
            //         'regex', getParseRegexForToken(token, config));
            if (parsedInput) {
                skipped = string.substr(0, string.indexOf(parsedInput));
                if (skipped.length &gt; 0) {
                    getParsingFlags(config).unusedInput.push(skipped);
                }
                string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
                totalParsedInputLength += parsedInput.length;
            }
            // don't parse if it's not a known token
            if (formatTokenFunctions[token]) {
                if (parsedInput) {
                    getParsingFlags(config).empty = false;
                }
                else {
                    getParsingFlags(config).unusedTokens.push(token);
                }
                addTimeToArrayFromToken(token, parsedInput, config);
            }
            else if (config._strict &amp;&amp; !parsedInput) {
                getParsingFlags(config).unusedTokens.push(token);
            }
        }

        // add remaining unparsed input length to the string
        getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
        if (string.length &gt; 0) {
            getParsingFlags(config).unusedInput.push(string);
        }

        // clear _12h flag if hour is &lt;= 12
        if (config._a[HOUR] &lt;= 12 &amp;&amp;
            getParsingFlags(config).bigHour === true &amp;&amp;
            config._a[HOUR] &gt; 0) {
            getParsingFlags(config).bigHour = undefined;
        }

        getParsingFlags(config).parsedDateParts = config._a.slice(0);
        getParsingFlags(config).meridiem = config._meridiem;
        // handle meridiem
        config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);

        configFromArray(config);
        checkOverflow(config);
    }


    function meridiemFixWrap (locale, hour, meridiem) {
        var isPm;

        if (meridiem == null) {
            // nothing to do
            return hour;
        }
        if (locale.meridiemHour != null) {
            return locale.meridiemHour(hour, meridiem);
        } else if (locale.isPM != null) {
            // Fallback
            isPm = locale.isPM(meridiem);
            if (isPm &amp;&amp; hour &lt; 12) {
                hour += 12;
            }
            if (!isPm &amp;&amp; hour === 12) {
                hour = 0;
            }
            return hour;
        } else {
            // this is not supposed to happen
            return hour;
        }
    }

    // date from string and array of format strings
    function configFromStringAndArray(config) {
        var tempConfig,
            bestMoment,

            scoreToBeat,
            i,
            currentScore;

        if (config._f.length === 0) {
            getParsingFlags(config).invalidFormat = true;
            config._d = new Date(NaN);
            return;
        }

        for (i = 0; i &lt; config._f.length; i++) {
            currentScore = 0;
            tempConfig = copyConfig({}, config);
            if (config._useUTC != null) {
                tempConfig._useUTC = config._useUTC;
            }
            tempConfig._f = config._f[i];
            configFromStringAndFormat(tempConfig);

            if (!isValid(tempConfig)) {
                continue;
            }

            // if there is any input that was not parsed add a penalty for that format
            currentScore += getParsingFlags(tempConfig).charsLeftOver;

            //or tokens
            currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;

            getParsingFlags(tempConfig).score = currentScore;

            if (scoreToBeat == null || currentScore &lt; scoreToBeat) {
                scoreToBeat = currentScore;
                bestMoment = tempConfig;
            }
        }

        extend(config, bestMoment || tempConfig);
    }

    function configFromObject(config) {
        if (config._d) {
            return;
        }

        var i = normalizeObjectUnits(config._i);
        config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
            return obj &amp;&amp; parseInt(obj, 10);
        });

        configFromArray(config);
    }

    function createFromConfig (config) {
        var res = new Moment(checkOverflow(prepareConfig(config)));
        if (res._nextDay) {
            // Adding is smart enough around DST
            res.add(1, 'd');
            res._nextDay = undefined;
        }

        return res;
    }

    function prepareConfig (config) {
        var input = config._i,
            format = config._f;

        config._locale = config._locale || getLocale(config._l);

        if (input === null || (format === undefined &amp;&amp; input === '')) {
            return createInvalid({nullInput: true});
        }

        if (typeof input === 'string') {
            config._i = input = config._locale.preparse(input);
        }

        if (isMoment(input)) {
            return new Moment(checkOverflow(input));
        } else if (isDate(input)) {
            config._d = input;
        } else if (isArray(format)) {
            configFromStringAndArray(config);
        } else if (format) {
            configFromStringAndFormat(config);
        }  else {
            configFromInput(config);
        }

        if (!isValid(config)) {
            config._d = null;
        }

        return config;
    }

    function configFromInput(config) {
        var input = config._i;
        if (isUndefined(input)) {
            config._d = new Date(hooks.now());
        } else if (isDate(input)) {
            config._d = new Date(input.valueOf());
        } else if (typeof input === 'string') {
            configFromString(config);
        } else if (isArray(input)) {
            config._a = map(input.slice(0), function (obj) {
                return parseInt(obj, 10);
            });
            configFromArray(config);
        } else if (isObject(input)) {
            configFromObject(config);
        } else if (isNumber(input)) {
            // from milliseconds
            config._d = new Date(input);
        } else {
            hooks.createFromInputFallback(config);
        }
    }

    function createLocalOrUTC (input, format, locale, strict, isUTC) {
        var c = {};

        if (locale === true || locale === false) {
            strict = locale;
            locale = undefined;
        }

        if ((isObject(input) &amp;&amp; isObjectEmpty(input)) ||
                (isArray(input) &amp;&amp; input.length === 0)) {
            input = undefined;
        }
        // object construction must be done this way.
        // https://github.com/moment/moment/issues/1423
        c._isAMomentObject = true;
        c._useUTC = c._isUTC = isUTC;
        c._l = locale;
        c._i = input;
        c._f = format;
        c._strict = strict;

        return createFromConfig(c);
    }

    function createLocal (input, format, locale, strict) {
        return createLocalOrUTC(input, format, locale, strict, false);
    }

    var prototypeMin = deprecate(
        'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
        function () {
            var other = createLocal.apply(null, arguments);
            if (this.isValid() &amp;&amp; other.isValid()) {
                return other &lt; this ? this : other;
            } else {
                return createInvalid();
            }
        }
    );

    var prototypeMax = deprecate(
        'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
        function () {
            var other = createLocal.apply(null, arguments);
            if (this.isValid() &amp;&amp; other.isValid()) {
                return other &gt; this ? this : other;
            } else {
                return createInvalid();
            }
        }
    );

    // Pick a moment m from moments so that m[fn](other) is true for all
    // other. This relies on the function fn to be transitive.
    //
    // moments should either be an array of moment objects or an array, whose
    // first element is an array of moment objects.
    function pickBy(fn, moments) {
        var res, i;
        if (moments.length === 1 &amp;&amp; isArray(moments[0])) {
            moments = moments[0];
        }
        if (!moments.length) {
            return createLocal();
        }
        res = moments[0];
        for (i = 1; i &lt; moments.length; ++i) {
            if (!moments[i].isValid() || moments[i][fn](res)) {
                res = moments[i];
            }
        }
        return res;
    }

    // TODO: Use [].sort instead?
    function min () {
        var args = [].slice.call(arguments, 0);

        return pickBy('isBefore', args);
    }

    function max () {
        var args = [].slice.call(arguments, 0);

        return pickBy('isAfter', args);
    }

    var now = function () {
        return Date.now ? Date.now() : +(new Date());
    };

    var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];

    function isDurationValid(m) {
        for (var key in m) {
            if (!(indexOf.call(ordering, key) !== -1 &amp;&amp; (m[key] == null || !isNaN(m[key])))) {
                return false;
            }
        }

        var unitHasDecimal = false;
        for (var i = 0; i &lt; ordering.length; ++i) {
            if (m[ordering[i]]) {
                if (unitHasDecimal) {
                    return false; // only allow non-integers for smallest unit
                }
                if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
                    unitHasDecimal = true;
                }
            }
        }

        return true;
    }

    function isValid$1() {
        return this._isValid;
    }

    function createInvalid$1() {
        return createDuration(NaN);
    }

    function Duration (duration) {
        var normalizedInput = normalizeObjectUnits(duration),
            years = normalizedInput.year || 0,
            quarters = normalizedInput.quarter || 0,
            months = normalizedInput.month || 0,
            weeks = normalizedInput.week || 0,
            days = normalizedInput.day || 0,
            hours = normalizedInput.hour || 0,
            minutes = normalizedInput.minute || 0,
            seconds = normalizedInput.second || 0,
            milliseconds = normalizedInput.millisecond || 0;

        this._isValid = isDurationValid(normalizedInput);

        // representation for dateAddRemove
        this._milliseconds = +milliseconds +
            seconds * 1e3 + // 1000
            minutes * 6e4 + // 1000 * 60
            hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
        // Because of dateAddRemove treats 24 hours as different from a
        // day when working around DST, we need to store them separately
        this._days = +days +
            weeks * 7;
        // It is impossible to translate months into days without knowing
        // which months you are are talking about, so we have to store
        // it separately.
        this._months = +months +
            quarters * 3 +
            years * 12;

        this._data = {};

        this._locale = getLocale();

        this._bubble();
    }

    function isDuration (obj) {
        return obj instanceof Duration;
    }

    function absRound (number) {
        if (number &lt; 0) {
            return Math.round(-1 * number) * -1;
        } else {
            return Math.round(number);
        }
    }

    // FORMATTING

    function offset (token, separator) {
        addFormatToken(token, 0, 0, function () {
            var offset = this.utcOffset();
            var sign = '+';
            if (offset &lt; 0) {
                offset = -offset;
                sign = '-';
            }
            return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
        });
    }

    offset('Z', ':');
    offset('ZZ', '');

    // PARSING

    addRegexToken('Z',  matchShortOffset);
    addRegexToken('ZZ', matchShortOffset);
    addParseToken(['Z', 'ZZ'], function (input, array, config) {
        config._useUTC = true;
        config._tzm = offsetFromString(matchShortOffset, input);
    });

    // HELPERS

    // timezone chunker
    // '+10:00' &gt; ['10',  '00']
    // '-1530'  &gt; ['-15', '30']
    var chunkOffset = /([\+\-]|\d\d)/gi;

    function offsetFromString(matcher, string) {
        var matches = (string || '').match(matcher);

        if (matches === null) {
            return null;
        }

        var chunk   = matches[matches.length - 1] || [];
        var parts   = (chunk + '').match(chunkOffset) || ['-', 0, 0];
        var minutes = +(parts[1] * 60) + toInt(parts[2]);

        return minutes === 0 ?
          0 :
          parts[0] === '+' ? minutes : -minutes;
    }

    // Return a moment from input, that is local/utc/zone equivalent to model.
    function cloneWithOffset(input, model) {
        var res, diff;
        if (model._isUTC) {
            res = model.clone();
            diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
            // Use low-level api, because this fn is low-level api.
            res._d.setTime(res._d.valueOf() + diff);
            hooks.updateOffset(res, false);
            return res;
        } else {
            return createLocal(input).local();
        }
    }

    function getDateOffset (m) {
        // On Firefox.24 Date#getTimezoneOffset returns a floating point.
        // https://github.com/moment/moment/pull/1871
        return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
    }

    // HOOKS

    // This function will be called whenever a moment is mutated.
    // It is intended to keep the offset in sync with the timezone.
    hooks.updateOffset = function () {};

    // MOMENTS

    // keepLocalTime = true means only change the timezone, without
    // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--&gt;
    // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
    // +0200, so we adjust the time as needed, to be valid.
    //
    // Keeping the time actually adds/subtracts (one hour)
    // from the actual represented time. That is why we call updateOffset
    // a second time. In case it wants us to change the offset again
    // _changeInProgress == true case, then we have to adjust, because
    // there is no such time in the given timezone.
    function getSetOffset (input, keepLocalTime, keepMinutes) {
        var offset = this._offset || 0,
            localAdjust;
        if (!this.isValid()) {
            return input != null ? this : NaN;
        }
        if (input != null) {
            if (typeof input === 'string') {
                input = offsetFromString(matchShortOffset, input);
                if (input === null) {
                    return this;
                }
            } else if (Math.abs(input) &lt; 16 &amp;&amp; !keepMinutes) {
                input = input * 60;
            }
            if (!this._isUTC &amp;&amp; keepLocalTime) {
                localAdjust = getDateOffset(this);
            }
            this._offset = input;
            this._isUTC = true;
            if (localAdjust != null) {
                this.add(localAdjust, 'm');
            }
            if (offset !== input) {
                if (!keepLocalTime || this._changeInProgress) {
                    addSubtract(this, createDuration(input - offset, 'm'), 1, false);
                } else if (!this._changeInProgress) {
                    this._changeInProgress = true;
                    hooks.updateOffset(this, true);
                    this._changeInProgress = null;
                }
            }
            return this;
        } else {
            return this._isUTC ? offset : getDateOffset(this);
        }
    }

    function getSetZone (input, keepLocalTime) {
        if (input != null) {
            if (typeof input !== 'string') {
                input = -input;
            }

            this.utcOffset(input, keepLocalTime);

            return this;
        } else {
            return -this.utcOffset();
        }
    }

    function setOffsetToUTC (keepLocalTime) {
        return this.utcOffset(0, keepLocalTime);
    }

    function setOffsetToLocal (keepLocalTime) {
        if (this._isUTC) {
            this.utcOffset(0, keepLocalTime);
            this._isUTC = false;

            if (keepLocalTime) {
                this.subtract(getDateOffset(this), 'm');
            }
        }
        return this;
    }

    function setOffsetToParsedOffset () {
        if (this._tzm != null) {
            this.utcOffset(this._tzm, false, true);
        } else if (typeof this._i === 'string') {
            var tZone = offsetFromString(matchOffset, this._i);
            if (tZone != null) {
                this.utcOffset(tZone);
            }
            else {
                this.utcOffset(0, true);
            }
        }
        return this;
    }

    function hasAlignedHourOffset (input) {
        if (!this.isValid()) {
            return false;
        }
        input = input ? createLocal(input).utcOffset() : 0;

        return (this.utcOffset() - input) % 60 === 0;
    }

    function isDaylightSavingTime () {
        return (
            this.utcOffset() &gt; this.clone().month(0).utcOffset() ||
            this.utcOffset() &gt; this.clone().month(5).utcOffset()
        );
    }

    function isDaylightSavingTimeShifted () {
        if (!isUndefined(this._isDSTShifted)) {
            return this._isDSTShifted;
        }

        var c = {};

        copyConfig(c, this);
        c = prepareConfig(c);

        if (c._a) {
            var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
            this._isDSTShifted = this.isValid() &amp;&amp;
                compareArrays(c._a, other.toArray()) &gt; 0;
        } else {
            this._isDSTShifted = false;
        }

        return this._isDSTShifted;
    }

    function isLocal () {
        return this.isValid() ? !this._isUTC : false;
    }

    function isUtcOffset () {
        return this.isValid() ? this._isUTC : false;
    }

    function isUtc () {
        return this.isValid() ? this._isUTC &amp;&amp; this._offset === 0 : false;
    }

    // ASP.NET json date format regex
    var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;

    // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
    // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
    // and further modified to allow for strings containing both week and day
    var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;

    function createDuration (input, key) {
        var duration = input,
            // matching against regexp is expensive, do it on demand
            match = null,
            sign,
            ret,
            diffRes;

        if (isDuration(input)) {
            duration = {
                ms : input._milliseconds,
                d  : input._days,
                M  : input._months
            };
        } else if (isNumber(input)) {
            duration = {};
            if (key) {
                duration[key] = input;
            } else {
                duration.milliseconds = input;
            }
        } else if (!!(match = aspNetRegex.exec(input))) {
            sign = (match[1] === '-') ? -1 : 1;
            duration = {
                y  : 0,
                d  : toInt(match[DATE])                         * sign,
                h  : toInt(match[HOUR])                         * sign,
                m  : toInt(match[MINUTE])                       * sign,
                s  : toInt(match[SECOND])                       * sign,
                ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
            };
        } else if (!!(match = isoRegex.exec(input))) {
            sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1;
            duration = {
                y : parseIso(match[2], sign),
                M : parseIso(match[3], sign),
                w : parseIso(match[4], sign),
                d : parseIso(match[5], sign),
                h : parseIso(match[6], sign),
                m : parseIso(match[7], sign),
                s : parseIso(match[8], sign)
            };
        } else if (duration == null) {// checks for null or undefined
            duration = {};
        } else if (typeof duration === 'object' &amp;&amp; ('from' in duration || 'to' in duration)) {
            diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));

            duration = {};
            duration.ms = diffRes.milliseconds;
            duration.M = diffRes.months;
        }

        ret = new Duration(duration);

        if (isDuration(input) &amp;&amp; hasOwnProp(input, '_locale')) {
            ret._locale = input._locale;
        }

        return ret;
    }

    createDuration.fn = Duration.prototype;
    createDuration.invalid = createInvalid$1;

    function parseIso (inp, sign) {
        // We'd normally use ~~inp for this, but unfortunately it also
        // converts floats to ints.
        // inp may be undefined, so careful calling replace on it.
        var res = inp &amp;&amp; parseFloat(inp.replace(',', '.'));
        // apply sign while we're at it
        return (isNaN(res) ? 0 : res) * sign;
    }

    function positiveMomentsDifference(base, other) {
        var res = {milliseconds: 0, months: 0};

        res.months = other.month() - base.month() +
            (other.year() - base.year()) * 12;
        if (base.clone().add(res.months, 'M').isAfter(other)) {
            --res.months;
        }

        res.milliseconds = +other - +(base.clone().add(res.months, 'M'));

        return res;
    }

    function momentsDifference(base, other) {
        var res;
        if (!(base.isValid() &amp;&amp; other.isValid())) {
            return {milliseconds: 0, months: 0};
        }

        other = cloneWithOffset(other, base);
        if (base.isBefore(other)) {
            res = positiveMomentsDifference(base, other);
        } else {
            res = positiveMomentsDifference(other, base);
            res.milliseconds = -res.milliseconds;
            res.months = -res.months;
        }

        return res;
    }

    // TODO: remove 'name' arg after deprecation is removed
    function createAdder(direction, name) {
        return function (val, period) {
            var dur, tmp;
            //invert the arguments, but complain about it
            if (period !== null &amp;&amp; !isNaN(+period)) {
                deprecateSimple(name, 'moment().' + name  + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
                'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
                tmp = val; val = period; period = tmp;
            }

            val = typeof val === 'string' ? +val : val;
            dur = createDuration(val, period);
            addSubtract(this, dur, direction);
            return this;
        };
    }

    function addSubtract (mom, duration, isAdding, updateOffset) {
        var milliseconds = duration._milliseconds,
            days = absRound(duration._days),
            months = absRound(duration._months);

        if (!mom.isValid()) {
            // No op
            return;
        }

        updateOffset = updateOffset == null ? true : updateOffset;

        if (months) {
            setMonth(mom, get(mom, 'Month') + months * isAdding);
        }
        if (days) {
            set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
        }
        if (milliseconds) {
            mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
        }
        if (updateOffset) {
            hooks.updateOffset(mom, days || months);
        }
    }

    var add      = createAdder(1, 'add');
    var subtract = createAdder(-1, 'subtract');

    function getCalendarFormat(myMoment, now) {
        var diff = myMoment.diff(now, 'days', true);
        return diff &lt; -6 ? 'sameElse' :
                diff &lt; -1 ? 'lastWeek' :
                diff &lt; 0 ? 'lastDay' :
                diff &lt; 1 ? 'sameDay' :
                diff &lt; 2 ? 'nextDay' :
                diff &lt; 7 ? 'nextWeek' : 'sameElse';
    }

    function calendar$1 (time, formats) {
        // We want to compare the start of today, vs this.
        // Getting start-of-today depends on whether we're local/utc/offset or not.
        var now = time || createLocal(),
            sod = cloneWithOffset(now, this).startOf('day'),
            format = hooks.calendarFormat(this, sod) || 'sameElse';

        var output = formats &amp;&amp; (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);

        return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
    }

    function clone () {
        return new Moment(this);
    }

    function isAfter (input, units) {
        var localInput = isMoment(input) ? input : createLocal(input);
        if (!(this.isValid() &amp;&amp; localInput.isValid())) {
            return false;
        }
        units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
        if (units === 'millisecond') {
            return this.valueOf() &gt; localInput.valueOf();
        } else {
            return localInput.valueOf() &lt; this.clone().startOf(units).valueOf();
        }
    }

    function isBefore (input, units) {
        var localInput = isMoment(input) ? input : createLocal(input);
        if (!(this.isValid() &amp;&amp; localInput.isValid())) {
            return false;
        }
        units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
        if (units === 'millisecond') {
            return this.valueOf() &lt; localInput.valueOf();
        } else {
            return this.clone().endOf(units).valueOf() &lt; localInput.valueOf();
        }
    }

    function isBetween (from, to, units, inclusivity) {
        inclusivity = inclusivity || '()';
        return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &amp;&amp;
            (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
    }

    function isSame (input, units) {
        var localInput = isMoment(input) ? input : createLocal(input),
            inputMs;
        if (!(this.isValid() &amp;&amp; localInput.isValid())) {
            return false;
        }
        units = normalizeUnits(units || 'millisecond');
        if (units === 'millisecond') {
            return this.valueOf() === localInput.valueOf();
        } else {
            inputMs = localInput.valueOf();
            return this.clone().startOf(units).valueOf() &lt;= inputMs &amp;&amp; inputMs &lt;= this.clone().endOf(units).valueOf();
        }
    }

    function isSameOrAfter (input, units) {
        return this.isSame(input, units) || this.isAfter(input,units);
    }

    function isSameOrBefore (input, units) {
        return this.isSame(input, units) || this.isBefore(input,units);
    }

    function diff (input, units, asFloat) {
        var that,
            zoneDelta,
            output;

        if (!this.isValid()) {
            return NaN;
        }

        that = cloneWithOffset(input, this);

        if (!that.isValid()) {
            return NaN;
        }

        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;

        units = normalizeUnits(units);

        switch (units) {
            case 'year': output = monthDiff(this, that) / 12; break;
            case 'month': output = monthDiff(this, that); break;
            case 'quarter': output = monthDiff(this, that) / 3; break;
            case 'second': output = (this - that) / 1e3; break; // 1000
            case 'minute': output = (this - that) / 6e4; break; // 1000 * 60
            case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60
            case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst
            case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst
            default: output = this - that;
        }

        return asFloat ? output : absFloor(output);
    }

    function monthDiff (a, b) {
        // difference in months
        var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
            // b is in (anchor - 1 month, anchor + 1 month)
            anchor = a.clone().add(wholeMonthDiff, 'months'),
            anchor2, adjust;

        if (b - anchor &lt; 0) {
            anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
            // linear across the month
            adjust = (b - anchor) / (anchor - anchor2);
        } else {
            anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
            // linear across the month
            adjust = (b - anchor) / (anchor2 - anchor);
        }

        //check for negative zero, return zero if negative zero
        return -(wholeMonthDiff + adjust) || 0;
    }

    hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
    hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';

    function toString () {
        return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
    }

    function toISOString(keepOffset) {
        if (!this.isValid()) {
            return null;
        }
        var utc = keepOffset !== true;
        var m = utc ? this.clone().utc() : this;
        if (m.year() &lt; 0 || m.year() &gt; 9999) {
            return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
        }
        if (isFunction(Date.prototype.toISOString)) {
            // native implementation is ~50x faster, use it when we can
            if (utc) {
                return this.toDate().toISOString();
            } else {
                return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
            }
        }
        return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
    }

    /**
     * Return a human readable representation of a moment that can
     * also be evaluated to get a new moment which is the same
     *
     * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
     */
    function inspect () {
        if (!this.isValid()) {
            return 'moment.invalid(/* ' + this._i + ' */)';
        }
        var func = 'moment';
        var zone = '';
        if (!this.isLocal()) {
            func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
            zone = 'Z';
        }
        var prefix = '[' + func + '("]';
        var year = (0 &lt;= this.year() &amp;&amp; this.year() &lt;= 9999) ? 'YYYY' : 'YYYYYY';
        var datetime = '-MM-DD[T]HH:mm:ss.SSS';
        var suffix = zone + '[")]';

        return this.format(prefix + year + datetime + suffix);
    }

    function format (inputString) {
        if (!inputString) {
            inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
        }
        var output = formatMoment(this, inputString);
        return this.localeData().postformat(output);
    }

    function from (time, withoutSuffix) {
        if (this.isValid() &amp;&amp;
                ((isMoment(time) &amp;&amp; time.isValid()) ||
                 createLocal(time).isValid())) {
            return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
        } else {
            return this.localeData().invalidDate();
        }
    }

    function fromNow (withoutSuffix) {
        return this.from(createLocal(), withoutSuffix);
    }

    function to (time, withoutSuffix) {
        if (this.isValid() &amp;&amp;
                ((isMoment(time) &amp;&amp; time.isValid()) ||
                 createLocal(time).isValid())) {
            return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
        } else {
            return this.localeData().invalidDate();
        }
    }

    function toNow (withoutSuffix) {
        return this.to(createLocal(), withoutSuffix);
    }

    // If passed a locale key, it will set the locale for this
    // instance.  Otherwise, it will return the locale configuration
    // variables for this instance.
    function locale (key) {
        var newLocaleData;

        if (key === undefined) {
            return this._locale._abbr;
        } else {
            newLocaleData = getLocale(key);
            if (newLocaleData != null) {
                this._locale = newLocaleData;
            }
            return this;
        }
    }

    var lang = deprecate(
        'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
        function (key) {
            if (key === undefined) {
                return this.localeData();
            } else {
                return this.locale(key);
            }
        }
    );

    function localeData () {
        return this._locale;
    }

    function startOf (units) {
        units = normalizeUnits(units);
        // the following switch intentionally omits break keywords
        // to utilize falling through the cases.
        switch (units) {
            case 'year':
                this.month(0);
                /* falls through */
            case 'quarter':
            case 'month':
                this.date(1);
                /* falls through */
            case 'week':
            case 'isoWeek':
            case 'day':
            case 'date':
                this.hours(0);
                /* falls through */
            case 'hour':
                this.minutes(0);
                /* falls through */
            case 'minute':
                this.seconds(0);
                /* falls through */
            case 'second':
                this.milliseconds(0);
        }

        // weeks are a special case
        if (units === 'week') {
            this.weekday(0);
        }
        if (units === 'isoWeek') {
            this.isoWeekday(1);
        }

        // quarters are also special
        if (units === 'quarter') {
            this.month(Math.floor(this.month() / 3) * 3);
        }

        return this;
    }

    function endOf (units) {
        units = normalizeUnits(units);
        if (units === undefined || units === 'millisecond') {
            return this;
        }

        // 'date' is an alias for 'day', so it should be considered as such.
        if (units === 'date') {
            units = 'day';
        }

        return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
    }

    function valueOf () {
        return this._d.valueOf() - ((this._offset || 0) * 60000);
    }

    function unix () {
        return Math.floor(this.valueOf() / 1000);
    }

    function toDate () {
        return new Date(this.valueOf());
    }

    function toArray () {
        var m = this;
        return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
    }

    function toObject () {
        var m = this;
        return {
            years: m.year(),
            months: m.month(),
            date: m.date(),
            hours: m.hours(),
            minutes: m.minutes(),
            seconds: m.seconds(),
            milliseconds: m.milliseconds()
        };
    }

    function toJSON () {
        // new Date(NaN).toJSON() === null
        return this.isValid() ? this.toISOString() : null;
    }

    function isValid$2 () {
        return isValid(this);
    }

    function parsingFlags () {
        return extend({}, getParsingFlags(this));
    }

    function invalidAt () {
        return getParsingFlags(this).overflow;
    }

    function creationData() {
        return {
            input: this._i,
            format: this._f,
            locale: this._locale,
            isUTC: this._isUTC,
            strict: this._strict
        };
    }

    // FORMATTING

    addFormatToken(0, ['gg', 2], 0, function () {
        return this.weekYear() % 100;
    });

    addFormatToken(0, ['GG', 2], 0, function () {
        return this.isoWeekYear() % 100;
    });

    function addWeekYearFormatToken (token, getter) {
        addFormatToken(0, [token, token.length], 0, getter);
    }

    addWeekYearFormatToken('gggg',     'weekYear');
    addWeekYearFormatToken('ggggg',    'weekYear');
    addWeekYearFormatToken('GGGG',  'isoWeekYear');
    addWeekYearFormatToken('GGGGG', 'isoWeekYear');

    // ALIASES

    addUnitAlias('weekYear', 'gg');
    addUnitAlias('isoWeekYear', 'GG');

    // PRIORITY

    addUnitPriority('weekYear', 1);
    addUnitPriority('isoWeekYear', 1);


    // PARSING

    addRegexToken('G',      matchSigned);
    addRegexToken('g',      matchSigned);
    addRegexToken('GG',     match1to2, match2);
    addRegexToken('gg',     match1to2, match2);
    addRegexToken('GGGG',   match1to4, match4);
    addRegexToken('gggg',   match1to4, match4);
    addRegexToken('GGGGG',  match1to6, match6);
    addRegexToken('ggggg',  match1to6, match6);

    addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
        week[token.substr(0, 2)] = toInt(input);
    });

    addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
        week[token] = hooks.parseTwoDigitYear(input);
    });

    // MOMENTS

    function getSetWeekYear (input) {
        return getSetWeekYearHelper.call(this,
                input,
                this.week(),
                this.weekday(),
                this.localeData()._week.dow,
                this.localeData()._week.doy);
    }

    function getSetISOWeekYear (input) {
        return getSetWeekYearHelper.call(this,
                input, this.isoWeek(), this.isoWeekday(), 1, 4);
    }

    function getISOWeeksInYear () {
        return weeksInYear(this.year(), 1, 4);
    }

    function getWeeksInYear () {
        var weekInfo = this.localeData()._week;
        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
    }

    function getSetWeekYearHelper(input, week, weekday, dow, doy) {
        var weeksTarget;
        if (input == null) {
            return weekOfYear(this, dow, doy).year;
        } else {
            weeksTarget = weeksInYear(input, dow, doy);
            if (week &gt; weeksTarget) {
                week = weeksTarget;
            }
            return setWeekAll.call(this, input, week, weekday, dow, doy);
        }
    }

    function setWeekAll(weekYear, week, weekday, dow, doy) {
        var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
            date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);

        this.year(date.getUTCFullYear());
        this.month(date.getUTCMonth());
        this.date(date.getUTCDate());
        return this;
    }

    // FORMATTING

    addFormatToken('Q', 0, 'Qo', 'quarter');

    // ALIASES

    addUnitAlias('quarter', 'Q');

    // PRIORITY

    addUnitPriority('quarter', 7);

    // PARSING

    addRegexToken('Q', match1);
    addParseToken('Q', function (input, array) {
        array[MONTH] = (toInt(input) - 1) * 3;
    });

    // MOMENTS

    function getSetQuarter (input) {
        return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
    }

    // FORMATTING

    addFormatToken('D', ['DD', 2], 'Do', 'date');

    // ALIASES

    addUnitAlias('date', 'D');

    // PRIORITY
    addUnitPriority('date', 9);

    // PARSING

    addRegexToken('D',  match1to2);
    addRegexToken('DD', match1to2, match2);
    addRegexToken('Do', function (isStrict, locale) {
        // TODO: Remove "ordinalParse" fallback in next major release.
        return isStrict ?
          (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
          locale._dayOfMonthOrdinalParseLenient;
    });

    addParseToken(['D', 'DD'], DATE);
    addParseToken('Do', function (input, array) {
        array[DATE] = toInt(input.match(match1to2)[0]);
    });

    // MOMENTS

    var getSetDayOfMonth = makeGetSet('Date', true);

    // FORMATTING

    addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');

    // ALIASES

    addUnitAlias('dayOfYear', 'DDD');

    // PRIORITY
    addUnitPriority('dayOfYear', 4);

    // PARSING

    addRegexToken('DDD',  match1to3);
    addRegexToken('DDDD', match3);
    addParseToken(['DDD', 'DDDD'], function (input, array, config) {
        config._dayOfYear = toInt(input);
    });

    // HELPERS

    // MOMENTS

    function getSetDayOfYear (input) {
        var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
        return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
    }

    // FORMATTING

    addFormatToken('m', ['mm', 2], 0, 'minute');

    // ALIASES

    addUnitAlias('minute', 'm');

    // PRIORITY

    addUnitPriority('minute', 14);

    // PARSING

    addRegexToken('m',  match1to2);
    addRegexToken('mm', match1to2, match2);
    addParseToken(['m', 'mm'], MINUTE);

    // MOMENTS

    var getSetMinute = makeGetSet('Minutes', false);

    // FORMATTING

    addFormatToken('s', ['ss', 2], 0, 'second');

    // ALIASES

    addUnitAlias('second', 's');

    // PRIORITY

    addUnitPriority('second', 15);

    // PARSING

    addRegexToken('s',  match1to2);
    addRegexToken('ss', match1to2, match2);
    addParseToken(['s', 'ss'], SECOND);

    // MOMENTS

    var getSetSecond = makeGetSet('Seconds', false);

    // FORMATTING

    addFormatToken('S', 0, 0, function () {
        return ~~(this.millisecond() / 100);
    });

    addFormatToken(0, ['SS', 2], 0, function () {
        return ~~(this.millisecond() / 10);
    });

    addFormatToken(0, ['SSS', 3], 0, 'millisecond');
    addFormatToken(0, ['SSSS', 4], 0, function () {
        return this.millisecond() * 10;
    });
    addFormatToken(0, ['SSSSS', 5], 0, function () {
        return this.millisecond() * 100;
    });
    addFormatToken(0, ['SSSSSS', 6], 0, function () {
        return this.millisecond() * 1000;
    });
    addFormatToken(0, ['SSSSSSS', 7], 0, function () {
        return this.millisecond() * 10000;
    });
    addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
        return this.millisecond() * 100000;
    });
    addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
        return this.millisecond() * 1000000;
    });


    // ALIASES

    addUnitAlias('millisecond', 'ms');

    // PRIORITY

    addUnitPriority('millisecond', 16);

    // PARSING

    addRegexToken('S',    match1to3, match1);
    addRegexToken('SS',   match1to3, match2);
    addRegexToken('SSS',  match1to3, match3);

    var token;
    for (token = 'SSSS'; token.length &lt;= 9; token += 'S') {
        addRegexToken(token, matchUnsigned);
    }

    function parseMs(input, array) {
        array[MILLISECOND] = toInt(('0.' + input) * 1000);
    }

    for (token = 'S'; token.length &lt;= 9; token += 'S') {
        addParseToken(token, parseMs);
    }
    // MOMENTS

    var getSetMillisecond = makeGetSet('Milliseconds', false);

    // FORMATTING

    addFormatToken('z',  0, 0, 'zoneAbbr');
    addFormatToken('zz', 0, 0, 'zoneName');

    // MOMENTS

    function getZoneAbbr () {
        return this._isUTC ? 'UTC' : '';
    }

    function getZoneName () {
        return this._isUTC ? 'Coordinated Universal Time' : '';
    }

    var proto = Moment.prototype;

    proto.add               = add;
    proto.calendar          = calendar$1;
    proto.clone             = clone;
    proto.diff              = diff;
    proto.endOf             = endOf;
    proto.format            = format;
    proto.from              = from;
    proto.fromNow           = fromNow;
    proto.to                = to;
    proto.toNow             = toNow;
    proto.get               = stringGet;
    proto.invalidAt         = invalidAt;
    proto.isAfter           = isAfter;
    proto.isBefore          = isBefore;
    proto.isBetween         = isBetween;
    proto.isSame            = isSame;
    proto.isSameOrAfter     = isSameOrAfter;
    proto.isSameOrBefore    = isSameOrBefore;
    proto.isValid           = isValid$2;
    proto.lang              = lang;
    proto.locale            = locale;
    proto.localeData        = localeData;
    proto.max               = prototypeMax;
    proto.min               = prototypeMin;
    proto.parsingFlags      = parsingFlags;
    proto.set               = stringSet;
    proto.startOf           = startOf;
    proto.subtract          = subtract;
    proto.toArray           = toArray;
    proto.toObject          = toObject;
    proto.toDate            = toDate;
    proto.toISOString       = toISOString;
    proto.inspect           = inspect;
    proto.toJSON            = toJSON;
    proto.toString          = toString;
    proto.unix              = unix;
    proto.valueOf           = valueOf;
    proto.creationData      = creationData;
    proto.year       = getSetYear;
    proto.isLeapYear = getIsLeapYear;
    proto.weekYear    = getSetWeekYear;
    proto.isoWeekYear = getSetISOWeekYear;
    proto.quarter = proto.quarters = getSetQuarter;
    proto.month       = getSetMonth;
    proto.daysInMonth = getDaysInMonth;
    proto.week           = proto.weeks        = getSetWeek;
    proto.isoWeek        = proto.isoWeeks     = getSetISOWeek;
    proto.weeksInYear    = getWeeksInYear;
    proto.isoWeeksInYear = getISOWeeksInYear;
    proto.date       = getSetDayOfMonth;
    proto.day        = proto.days             = getSetDayOfWeek;
    proto.weekday    = getSetLocaleDayOfWeek;
    proto.isoWeekday = getSetISODayOfWeek;
    proto.dayOfYear  = getSetDayOfYear;
    proto.hour = proto.hours = getSetHour;
    proto.minute = proto.minutes = getSetMinute;
    proto.second = proto.seconds = getSetSecond;
    proto.millisecond = proto.milliseconds = getSetMillisecond;
    proto.utcOffset            = getSetOffset;
    proto.utc                  = setOffsetToUTC;
    proto.local                = setOffsetToLocal;
    proto.parseZone            = setOffsetToParsedOffset;
    proto.hasAlignedHourOffset = hasAlignedHourOffset;
    proto.isDST                = isDaylightSavingTime;
    proto.isLocal              = isLocal;
    proto.isUtcOffset          = isUtcOffset;
    proto.isUtc                = isUtc;
    proto.isUTC                = isUtc;
    proto.zoneAbbr = getZoneAbbr;
    proto.zoneName = getZoneName;
    proto.dates  = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
    proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
    proto.years  = deprecate('years accessor is deprecated. Use year instead', getSetYear);
    proto.zone   = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
    proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);

    function createUnix (input) {
        return createLocal(input * 1000);
    }

    function createInZone () {
        return createLocal.apply(null, arguments).parseZone();
    }

    function preParsePostFormat (string) {
        return string;
    }

    var proto$1 = Locale.prototype;

    proto$1.calendar        = calendar;
    proto$1.longDateFormat  = longDateFormat;
    proto$1.invalidDate     = invalidDate;
    proto$1.ordinal         = ordinal;
    proto$1.preparse        = preParsePostFormat;
    proto$1.postformat      = preParsePostFormat;
    proto$1.relativeTime    = relativeTime;
    proto$1.pastFuture      = pastFuture;
    proto$1.set             = set;

    proto$1.months            =        localeMonths;
    proto$1.monthsShort       =        localeMonthsShort;
    proto$1.monthsParse       =        localeMonthsParse;
    proto$1.monthsRegex       = monthsRegex;
    proto$1.monthsShortRegex  = monthsShortRegex;
    proto$1.week = localeWeek;
    proto$1.firstDayOfYear = localeFirstDayOfYear;
    proto$1.firstDayOfWeek = localeFirstDayOfWeek;

    proto$1.weekdays       =        localeWeekdays;
    proto$1.weekdaysMin    =        localeWeekdaysMin;
    proto$1.weekdaysShort  =        localeWeekdaysShort;
    proto$1.weekdaysParse  =        localeWeekdaysParse;

    proto$1.weekdaysRegex       =        weekdaysRegex;
    proto$1.weekdaysShortRegex  =        weekdaysShortRegex;
    proto$1.weekdaysMinRegex    =        weekdaysMinRegex;

    proto$1.isPM = localeIsPM;
    proto$1.meridiem = localeMeridiem;

    function get$1 (format, index, field, setter) {
        var locale = getLocale();
        var utc = createUTC().set(setter, index);
        return locale[field](utc, format);
    }

    function listMonthsImpl (format, index, field) {
        if (isNumber(format)) {
            index = format;
            format = undefined;
        }

        format = format || '';

        if (index != null) {
            return get$1(format, index, field, 'month');
        }

        var i;
        var out = [];
        for (i = 0; i &lt; 12; i++) {
            out[i] = get$1(format, i, field, 'month');
        }
        return out;
    }

    // ()
    // (5)
    // (fmt, 5)
    // (fmt)
    // (true)
    // (true, 5)
    // (true, fmt, 5)
    // (true, fmt)
    function listWeekdaysImpl (localeSorted, format, index, field) {
        if (typeof localeSorted === 'boolean') {
            if (isNumber(format)) {
                index = format;
                format = undefined;
            }

            format = format || '';
        } else {
            format = localeSorted;
            index = format;
            localeSorted = false;

            if (isNumber(format)) {
                index = format;
                format = undefined;
            }

            format = format || '';
        }

        var locale = getLocale(),
            shift = localeSorted ? locale._week.dow : 0;

        if (index != null) {
            return get$1(format, (index + shift) % 7, field, 'day');
        }

        var i;
        var out = [];
        for (i = 0; i &lt; 7; i++) {
            out[i] = get$1(format, (i + shift) % 7, field, 'day');
        }
        return out;
    }

    function listMonths (format, index) {
        return listMonthsImpl(format, index, 'months');
    }

    function listMonthsShort (format, index) {
        return listMonthsImpl(format, index, 'monthsShort');
    }

    function listWeekdays (localeSorted, format, index) {
        return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
    }

    function listWeekdaysShort (localeSorted, format, index) {
        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
    }

    function listWeekdaysMin (localeSorted, format, index) {
        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
    }

    getSetGlobalLocale('en', {
        dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (toInt(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        }
    });

    // Side effect imports

    hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
    hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);

    var mathAbs = Math.abs;

    function abs () {
        var data           = this._data;

        this._milliseconds = mathAbs(this._milliseconds);
        this._days         = mathAbs(this._days);
        this._months       = mathAbs(this._months);

        data.milliseconds  = mathAbs(data.milliseconds);
        data.seconds       = mathAbs(data.seconds);
        data.minutes       = mathAbs(data.minutes);
        data.hours         = mathAbs(data.hours);
        data.months        = mathAbs(data.months);
        data.years         = mathAbs(data.years);

        return this;
    }

    function addSubtract$1 (duration, input, value, direction) {
        var other = createDuration(input, value);

        duration._milliseconds += direction * other._milliseconds;
        duration._days         += direction * other._days;
        duration._months       += direction * other._months;

        return duration._bubble();
    }

    // supports only 2.0-style add(1, 's') or add(duration)
    function add$1 (input, value) {
        return addSubtract$1(this, input, value, 1);
    }

    // supports only 2.0-style subtract(1, 's') or subtract(duration)
    function subtract$1 (input, value) {
        return addSubtract$1(this, input, value, -1);
    }

    function absCeil (number) {
        if (number &lt; 0) {
            return Math.floor(number);
        } else {
            return Math.ceil(number);
        }
    }

    function bubble () {
        var milliseconds = this._milliseconds;
        var days         = this._days;
        var months       = this._months;
        var data         = this._data;
        var seconds, minutes, hours, years, monthsFromDays;

        // if we have a mix of positive and negative values, bubble down first
        // check: https://github.com/moment/moment/issues/2166
        if (!((milliseconds &gt;= 0 &amp;&amp; days &gt;= 0 &amp;&amp; months &gt;= 0) ||
                (milliseconds &lt;= 0 &amp;&amp; days &lt;= 0 &amp;&amp; months &lt;= 0))) {
            milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
            days = 0;
            months = 0;
        }

        // The following code bubbles up values, see the tests for
        // examples of what that means.
        data.milliseconds = milliseconds % 1000;

        seconds           = absFloor(milliseconds / 1000);
        data.seconds      = seconds % 60;

        minutes           = absFloor(seconds / 60);
        data.minutes      = minutes % 60;

        hours             = absFloor(minutes / 60);
        data.hours        = hours % 24;

        days += absFloor(hours / 24);

        // convert days to months
        monthsFromDays = absFloor(daysToMonths(days));
        months += monthsFromDays;
        days -= absCeil(monthsToDays(monthsFromDays));

        // 12 months -&gt; 1 year
        years = absFloor(months / 12);
        months %= 12;

        data.days   = days;
        data.months = months;
        data.years  = years;

        return this;
    }

    function daysToMonths (days) {
        // 400 years have 146097 days (taking into account leap year rules)
        // 400 years have 12 months === 4800
        return days * 4800 / 146097;
    }

    function monthsToDays (months) {
        // the reverse of daysToMonths
        return months * 146097 / 4800;
    }

    function as (units) {
        if (!this.isValid()) {
            return NaN;
        }
        var days;
        var months;
        var milliseconds = this._milliseconds;

        units = normalizeUnits(units);

        if (units === 'month' || units === 'year') {
            days   = this._days   + milliseconds / 864e5;
            months = this._months + daysToMonths(days);
            return units === 'month' ? months : months / 12;
        } else {
            // handle milliseconds separately because of floating point math errors (issue #1867)
            days = this._days + Math.round(monthsToDays(this._months));
            switch (units) {
                case 'week'   : return days / 7     + milliseconds / 6048e5;
                case 'day'    : return days         + milliseconds / 864e5;
                case 'hour'   : return days * 24    + milliseconds / 36e5;
                case 'minute' : return days * 1440  + milliseconds / 6e4;
                case 'second' : return days * 86400 + milliseconds / 1000;
                // Math.floor prevents floating point math errors here
                case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
                default: throw new Error('Unknown unit ' + units);
            }
        }
    }

    // TODO: Use this.as('ms')?
    function valueOf$1 () {
        if (!this.isValid()) {
            return NaN;
        }
        return (
            this._milliseconds +
            this._days * 864e5 +
            (this._months % 12) * 2592e6 +
            toInt(this._months / 12) * 31536e6
        );
    }

    function makeAs (alias) {
        return function () {
            return this.as(alias);
        };
    }

    var asMilliseconds = makeAs('ms');
    var asSeconds      = makeAs('s');
    var asMinutes      = makeAs('m');
    var asHours        = makeAs('h');
    var asDays         = makeAs('d');
    var asWeeks        = makeAs('w');
    var asMonths       = makeAs('M');
    var asYears        = makeAs('y');

    function clone$1 () {
        return createDuration(this);
    }

    function get$2 (units) {
        units = normalizeUnits(units);
        return this.isValid() ? this[units + 's']() : NaN;
    }

    function makeGetter(name) {
        return function () {
            return this.isValid() ? this._data[name] : NaN;
        };
    }

    var milliseconds = makeGetter('milliseconds');
    var seconds      = makeGetter('seconds');
    var minutes      = makeGetter('minutes');
    var hours        = makeGetter('hours');
    var days         = makeGetter('days');
    var months       = makeGetter('months');
    var years        = makeGetter('years');

    function weeks () {
        return absFloor(this.days() / 7);
    }

    var round = Math.round;
    var thresholds = {
        ss: 44,         // a few seconds to seconds
        s : 45,         // seconds to minute
        m : 45,         // minutes to hour
        h : 22,         // hours to day
        d : 26,         // days to month
        M : 11          // months to year
    };

    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
    function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
        return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
    }

    function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
        var duration = createDuration(posNegDuration).abs();
        var seconds  = round(duration.as('s'));
        var minutes  = round(duration.as('m'));
        var hours    = round(duration.as('h'));
        var days     = round(duration.as('d'));
        var months   = round(duration.as('M'));
        var years    = round(duration.as('y'));

        var a = seconds &lt;= thresholds.ss &amp;&amp; ['s', seconds]  ||
                seconds &lt; thresholds.s   &amp;&amp; ['ss', seconds] ||
                minutes &lt;= 1             &amp;&amp; ['m']           ||
                minutes &lt; thresholds.m   &amp;&amp; ['mm', minutes] ||
                hours   &lt;= 1             &amp;&amp; ['h']           ||
                hours   &lt; thresholds.h   &amp;&amp; ['hh', hours]   ||
                days    &lt;= 1             &amp;&amp; ['d']           ||
                days    &lt; thresholds.d   &amp;&amp; ['dd', days]    ||
                months  &lt;= 1             &amp;&amp; ['M']           ||
                months  &lt; thresholds.M   &amp;&amp; ['MM', months]  ||
                years   &lt;= 1             &amp;&amp; ['y']           || ['yy', years];

        a[2] = withoutSuffix;
        a[3] = +posNegDuration &gt; 0;
        a[4] = locale;
        return substituteTimeAgo.apply(null, a);
    }

    // This function allows you to set the rounding function for relative time strings
    function getSetRelativeTimeRounding (roundingFunction) {
        if (roundingFunction === undefined) {
            return round;
        }
        if (typeof(roundingFunction) === 'function') {
            round = roundingFunction;
            return true;
        }
        return false;
    }

    // This function allows you to set a threshold for relative time strings
    function getSetRelativeTimeThreshold (threshold, limit) {
        if (thresholds[threshold] === undefined) {
            return false;
        }
        if (limit === undefined) {
            return thresholds[threshold];
        }
        thresholds[threshold] = limit;
        if (threshold === 's') {
            thresholds.ss = limit - 1;
        }
        return true;
    }

    function humanize (withSuffix) {
        if (!this.isValid()) {
            return this.localeData().invalidDate();
        }

        var locale = this.localeData();
        var output = relativeTime$1(this, !withSuffix, locale);

        if (withSuffix) {
            output = locale.pastFuture(+this, output);
        }

        return locale.postformat(output);
    }

    var abs$1 = Math.abs;

    function sign(x) {
        return ((x &gt; 0) - (x &lt; 0)) || +x;
    }

    function toISOString$1() {
        // for ISO strings we do not use the normal bubbling rules:
        //  * milliseconds bubble up until they become hours
        //  * days do not bubble at all
        //  * months bubble up until they become years
        // This is because there is no context-free conversion between hours and days
        // (think of clock changes)
        // and also not between days and months (28-31 days per month)
        if (!this.isValid()) {
            return this.localeData().invalidDate();
        }

        var seconds = abs$1(this._milliseconds) / 1000;
        var days         = abs$1(this._days);
        var months       = abs$1(this._months);
        var minutes, hours, years;

        // 3600 seconds -&gt; 60 minutes -&gt; 1 hour
        minutes           = absFloor(seconds / 60);
        hours             = absFloor(minutes / 60);
        seconds %= 60;
        minutes %= 60;

        // 12 months -&gt; 1 year
        years  = absFloor(months / 12);
        months %= 12;


        // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
        var Y = years;
        var M = months;
        var D = days;
        var h = hours;
        var m = minutes;
        var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
        var total = this.asSeconds();

        if (!total) {
            // this is the same as C#'s (Noda) and python (isodate)...
            // but not other JS (goog.date)
            return 'P0D';
        }

        var totalSign = total &lt; 0 ? '-' : '';
        var ymSign = sign(this._months) !== sign(total) ? '-' : '';
        var daysSign = sign(this._days) !== sign(total) ? '-' : '';
        var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';

        return totalSign + 'P' +
            (Y ? ymSign + Y + 'Y' : '') +
            (M ? ymSign + M + 'M' : '') +
            (D ? daysSign + D + 'D' : '') +
            ((h || m || s) ? 'T' : '') +
            (h ? hmsSign + h + 'H' : '') +
            (m ? hmsSign + m + 'M' : '') +
            (s ? hmsSign + s + 'S' : '');
    }

    var proto$2 = Duration.prototype;

    proto$2.isValid        = isValid$1;
    proto$2.abs            = abs;
    proto$2.add            = add$1;
    proto$2.subtract       = subtract$1;
    proto$2.as             = as;
    proto$2.asMilliseconds = asMilliseconds;
    proto$2.asSeconds      = asSeconds;
    proto$2.asMinutes      = asMinutes;
    proto$2.asHours        = asHours;
    proto$2.asDays         = asDays;
    proto$2.asWeeks        = asWeeks;
    proto$2.asMonths       = asMonths;
    proto$2.asYears        = asYears;
    proto$2.valueOf        = valueOf$1;
    proto$2._bubble        = bubble;
    proto$2.clone          = clone$1;
    proto$2.get            = get$2;
    proto$2.milliseconds   = milliseconds;
    proto$2.seconds        = seconds;
    proto$2.minutes        = minutes;
    proto$2.hours          = hours;
    proto$2.days           = days;
    proto$2.weeks          = weeks;
    proto$2.months         = months;
    proto$2.years          = years;
    proto$2.humanize       = humanize;
    proto$2.toISOString    = toISOString$1;
    proto$2.toString       = toISOString$1;
    proto$2.toJSON         = toISOString$1;
    proto$2.locale         = locale;
    proto$2.localeData     = localeData;

    proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
    proto$2.lang = lang;

    // Side effect imports

    // FORMATTING

    addFormatToken('X', 0, 0, 'unix');
    addFormatToken('x', 0, 0, 'valueOf');

    // PARSING

    addRegexToken('x', matchSigned);
    addRegexToken('X', matchTimestamp);
    addParseToken('X', function (input, array, config) {
        config._d = new Date(parseFloat(input, 10) * 1000);
    });
    addParseToken('x', function (input, array, config) {
        config._d = new Date(toInt(input));
    });

    // Side effect imports

    //! moment.js

    hooks.version = '2.22.2';

    setHookCallback(createLocal);

    hooks.fn                    = proto;
    hooks.min                   = min;
    hooks.max                   = max;
    hooks.now                   = now;
    hooks.utc                   = createUTC;
    hooks.unix                  = createUnix;
    hooks.months                = listMonths;
    hooks.isDate                = isDate;
    hooks.locale                = getSetGlobalLocale;
    hooks.invalid               = createInvalid;
    hooks.duration              = createDuration;
    hooks.isMoment              = isMoment;
    hooks.weekdays              = listWeekdays;
    hooks.parseZone             = createInZone;
    hooks.localeData            = getLocale;
    hooks.isDuration            = isDuration;
    hooks.monthsShort           = listMonthsShort;
    hooks.weekdaysMin           = listWeekdaysMin;
    hooks.defineLocale          = defineLocale;
    hooks.updateLocale          = updateLocale;
    hooks.locales               = listLocales;
    hooks.weekdaysShort         = listWeekdaysShort;
    hooks.normalizeUnits        = normalizeUnits;
    hooks.relativeTimeRounding  = getSetRelativeTimeRounding;
    hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
    hooks.calendarFormat        = getCalendarFormat;
    hooks.prototype             = proto;

    // currently HTML5 input type only supports 24-hour formats
    hooks.HTML5_FMT = {
        DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',             // &lt;input type="datetime-local" /&gt;
        DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',  // &lt;input type="datetime-local" step="1" /&gt;
        DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',   // &lt;input type="datetime-local" step="0.001" /&gt;
        DATE: 'YYYY-MM-DD',                             // &lt;input type="date" /&gt;
        TIME: 'HH:mm',                                  // &lt;input type="time" /&gt;
        TIME_SECONDS: 'HH:mm:ss',                       // &lt;input type="time" step="1" /&gt;
        TIME_MS: 'HH:mm:ss.SSS',                        // &lt;input type="time" step="0.001" /&gt;
        WEEK: 'YYYY-[W]WW',                             // &lt;input type="week" /&gt;
        MONTH: 'YYYY-MM'                                // &lt;input type="month" /&gt;
    };

    //! moment.js locale configuration

    hooks.defineLocale('af', {
        months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
        monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
        weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
        weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
        weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
        meridiemParse: /vm|nm/i,
        isPM : function (input) {
            return /^nm$/i.test(input);
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 12) {
                return isLower ? 'vm' : 'VM';
            } else {
                return isLower ? 'nm' : 'NM';
            }
        },
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Vandag om] LT',
            nextDay : '[Môre om] LT',
            nextWeek : 'dddd [om] LT',
            lastDay : '[Gister om] LT',
            lastWeek : '[Laas] dddd [om] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'oor %s',
            past : '%s gelede',
            s : '\'n paar sekondes',
            ss : '%d sekondes',
            m : '\'n minuut',
            mm : '%d minute',
            h : '\'n uur',
            hh : '%d ure',
            d : '\'n dag',
            dd : '%d dae',
            M : '\'n maand',
            MM : '%d maande',
            y : '\'n jaar',
            yy : '%d jaar'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
        ordinal : function (number) {
            return number + ((number === 1 || number === 8 || number &gt;= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
        },
        week : {
            dow : 1, // Maandag is die eerste dag van die week.
            doy : 4  // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ar-dz', {
        months : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
        monthsShort : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
        weekdaysShort : 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
        weekdaysMin : 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[اليوم على الساعة] LT',
            nextDay: '[غدا على الساعة] LT',
            nextWeek: 'dddd [على الساعة] LT',
            lastDay: '[أمس على الساعة] LT',
            lastWeek: 'dddd [على الساعة] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'في %s',
            past : 'منذ %s',
            s : 'ثوان',
            ss : '%d ثانية',
            m : 'دقيقة',
            mm : '%d دقائق',
            h : 'ساعة',
            hh : '%d ساعات',
            d : 'يوم',
            dd : '%d أيام',
            M : 'شهر',
            MM : '%d أشهر',
            y : 'سنة',
            yy : '%d سنوات'
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 4  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ar-kw', {
        months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
        monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
        weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
        weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[اليوم على الساعة] LT',
            nextDay: '[غدا على الساعة] LT',
            nextWeek: 'dddd [على الساعة] LT',
            lastDay: '[أمس على الساعة] LT',
            lastWeek: 'dddd [على الساعة] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'في %s',
            past : 'منذ %s',
            s : 'ثوان',
            ss : '%d ثانية',
            m : 'دقيقة',
            mm : '%d دقائق',
            h : 'ساعة',
            hh : '%d ساعات',
            d : 'يوم',
            dd : '%d أيام',
            M : 'شهر',
            MM : '%d أشهر',
            y : 'سنة',
            yy : '%d سنوات'
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 12  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap = {
        '1': '1',
        '2': '2',
        '3': '3',
        '4': '4',
        '5': '5',
        '6': '6',
        '7': '7',
        '8': '8',
        '9': '9',
        '0': '0'
    }, pluralForm = function (n) {
        return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 &gt;= 3 &amp;&amp; n % 100 &lt;= 10 ? 3 : n % 100 &gt;= 11 ? 4 : 5;
    }, plurals = {
        s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
        m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
        h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
        d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
        M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
        y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
    }, pluralize = function (u) {
        return function (number, withoutSuffix, string, isFuture) {
            var f = pluralForm(number),
                str = plurals[u][pluralForm(number)];
            if (f === 2) {
                str = str[withoutSuffix ? 0 : 1];
            }
            return str.replace(/%d/i, number);
        };
    }, months$1 = [
        'يناير',
        'فبراير',
        'مارس',
        'أبريل',
        'مايو',
        'يونيو',
        'يوليو',
        'أغسطس',
        'سبتمبر',
        'أكتوبر',
        'نوفمبر',
        'ديسمبر'
    ];

    hooks.defineLocale('ar-ly', {
        months : months$1,
        monthsShort : months$1,
        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'D/\u200FM/\u200FYYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        meridiemParse: /ص|م/,
        isPM : function (input) {
            return 'م' === input;
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'ص';
            } else {
                return 'م';
            }
        },
        calendar : {
            sameDay: '[اليوم عند الساعة] LT',
            nextDay: '[غدًا عند الساعة] LT',
            nextWeek: 'dddd [عند الساعة] LT',
            lastDay: '[أمس عند الساعة] LT',
            lastWeek: 'dddd [عند الساعة] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'بعد %s',
            past : 'منذ %s',
            s : pluralize('s'),
            ss : pluralize('s'),
            m : pluralize('m'),
            mm : pluralize('m'),
            h : pluralize('h'),
            hh : pluralize('h'),
            d : pluralize('d'),
            dd : pluralize('d'),
            M : pluralize('M'),
            MM : pluralize('M'),
            y : pluralize('y'),
            yy : pluralize('y')
        },
        preparse: function (string) {
            return string.replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap[match];
            }).replace(/,/g, '،');
        },
        week : {
            dow : 6, // Saturday is the first day of the week.
            doy : 12  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ar-ma', {
        months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
        monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
        weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
        weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[اليوم على الساعة] LT',
            nextDay: '[غدا على الساعة] LT',
            nextWeek: 'dddd [على الساعة] LT',
            lastDay: '[أمس على الساعة] LT',
            lastWeek: 'dddd [على الساعة] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'في %s',
            past : 'منذ %s',
            s : 'ثوان',
            ss : '%d ثانية',
            m : 'دقيقة',
            mm : '%d دقائق',
            h : 'ساعة',
            hh : '%d ساعات',
            d : 'يوم',
            dd : '%d أيام',
            M : 'شهر',
            MM : '%d أشهر',
            y : 'سنة',
            yy : '%d سنوات'
        },
        week : {
            dow : 6, // Saturday is the first day of the week.
            doy : 12  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$1 = {
        '1': '١',
        '2': '٢',
        '3': '٣',
        '4': '٤',
        '5': '٥',
        '6': '٦',
        '7': '٧',
        '8': '٨',
        '9': '٩',
        '0': '٠'
    }, numberMap = {
        '١': '1',
        '٢': '2',
        '٣': '3',
        '٤': '4',
        '٥': '5',
        '٦': '6',
        '٧': '7',
        '٨': '8',
        '٩': '9',
        '٠': '0'
    };

    hooks.defineLocale('ar-sa', {
        months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
        monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        meridiemParse: /ص|م/,
        isPM : function (input) {
            return 'م' === input;
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'ص';
            } else {
                return 'م';
            }
        },
        calendar : {
            sameDay: '[اليوم على الساعة] LT',
            nextDay: '[غدا على الساعة] LT',
            nextWeek: 'dddd [على الساعة] LT',
            lastDay: '[أمس على الساعة] LT',
            lastWeek: 'dddd [على الساعة] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'في %s',
            past : 'منذ %s',
            s : 'ثوان',
            ss : '%d ثانية',
            m : 'دقيقة',
            mm : '%d دقائق',
            h : 'ساعة',
            hh : '%d ساعات',
            d : 'يوم',
            dd : '%d أيام',
            M : 'شهر',
            MM : '%d أشهر',
            y : 'سنة',
            yy : '%d سنوات'
        },
        preparse: function (string) {
            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
                return numberMap[match];
            }).replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$1[match];
            }).replace(/,/g, '،');
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ar-tn', {
        months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
        monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
        weekdaysParseExact : true,
        longDateFormat: {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L: 'DD/MM/YYYY',
            LL: 'D MMMM YYYY',
            LLL: 'D MMMM YYYY HH:mm',
            LLLL: 'dddd D MMMM YYYY HH:mm'
        },
        calendar: {
            sameDay: '[اليوم على الساعة] LT',
            nextDay: '[غدا على الساعة] LT',
            nextWeek: 'dddd [على الساعة] LT',
            lastDay: '[أمس على الساعة] LT',
            lastWeek: 'dddd [على الساعة] LT',
            sameElse: 'L'
        },
        relativeTime: {
            future: 'في %s',
            past: 'منذ %s',
            s: 'ثوان',
            ss : '%d ثانية',
            m: 'دقيقة',
            mm: '%d دقائق',
            h: 'ساعة',
            hh: '%d ساعات',
            d: 'يوم',
            dd: '%d أيام',
            M: 'شهر',
            MM: '%d أشهر',
            y: 'سنة',
            yy: '%d سنوات'
        },
        week: {
            dow: 1, // Monday is the first day of the week.
            doy: 4 // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$2 = {
        '1': '١',
        '2': '٢',
        '3': '٣',
        '4': '٤',
        '5': '٥',
        '6': '٦',
        '7': '٧',
        '8': '٨',
        '9': '٩',
        '0': '٠'
    }, numberMap$1 = {
        '١': '1',
        '٢': '2',
        '٣': '3',
        '٤': '4',
        '٥': '5',
        '٦': '6',
        '٧': '7',
        '٨': '8',
        '٩': '9',
        '٠': '0'
    }, pluralForm$1 = function (n) {
        return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 &gt;= 3 &amp;&amp; n % 100 &lt;= 10 ? 3 : n % 100 &gt;= 11 ? 4 : 5;
    }, plurals$1 = {
        s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
        m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
        h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
        d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
        M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
        y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
    }, pluralize$1 = function (u) {
        return function (number, withoutSuffix, string, isFuture) {
            var f = pluralForm$1(number),
                str = plurals$1[u][pluralForm$1(number)];
            if (f === 2) {
                str = str[withoutSuffix ? 0 : 1];
            }
            return str.replace(/%d/i, number);
        };
    }, months$2 = [
        'يناير',
        'فبراير',
        'مارس',
        'أبريل',
        'مايو',
        'يونيو',
        'يوليو',
        'أغسطس',
        'سبتمبر',
        'أكتوبر',
        'نوفمبر',
        'ديسمبر'
    ];

    hooks.defineLocale('ar', {
        months : months$2,
        monthsShort : months$2,
        weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
        weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
        weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'D/\u200FM/\u200FYYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        meridiemParse: /ص|م/,
        isPM : function (input) {
            return 'م' === input;
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'ص';
            } else {
                return 'م';
            }
        },
        calendar : {
            sameDay: '[اليوم عند الساعة] LT',
            nextDay: '[غدًا عند الساعة] LT',
            nextWeek: 'dddd [عند الساعة] LT',
            lastDay: '[أمس عند الساعة] LT',
            lastWeek: 'dddd [عند الساعة] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'بعد %s',
            past : 'منذ %s',
            s : pluralize$1('s'),
            ss : pluralize$1('s'),
            m : pluralize$1('m'),
            mm : pluralize$1('m'),
            h : pluralize$1('h'),
            hh : pluralize$1('h'),
            d : pluralize$1('d'),
            dd : pluralize$1('d'),
            M : pluralize$1('M'),
            MM : pluralize$1('M'),
            y : pluralize$1('y'),
            yy : pluralize$1('y')
        },
        preparse: function (string) {
            return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
                return numberMap$1[match];
            }).replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$2[match];
            }).replace(/,/g, '،');
        },
        week : {
            dow : 6, // Saturday is the first day of the week.
            doy : 12  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var suffixes = {
        1: '-inci',
        5: '-inci',
        8: '-inci',
        70: '-inci',
        80: '-inci',
        2: '-nci',
        7: '-nci',
        20: '-nci',
        50: '-nci',
        3: '-üncü',
        4: '-üncü',
        100: '-üncü',
        6: '-ncı',
        9: '-uncu',
        10: '-uncu',
        30: '-uncu',
        60: '-ıncı',
        90: '-ıncı'
    };

    hooks.defineLocale('az', {
        months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
        monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
        weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
        weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
        weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[bugün saat] LT',
            nextDay : '[sabah saat] LT',
            nextWeek : '[gələn həftə] dddd [saat] LT',
            lastDay : '[dünən] LT',
            lastWeek : '[keçən həftə] dddd [saat] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s sonra',
            past : '%s əvvəl',
            s : 'birneçə saniyə',
            ss : '%d saniyə',
            m : 'bir dəqiqə',
            mm : '%d dəqiqə',
            h : 'bir saat',
            hh : '%d saat',
            d : 'bir gün',
            dd : '%d gün',
            M : 'bir ay',
            MM : '%d ay',
            y : 'bir il',
            yy : '%d il'
        },
        meridiemParse: /gecə|səhər|gündüz|axşam/,
        isPM : function (input) {
            return /^(gündüz|axşam)$/.test(input);
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'gecə';
            } else if (hour &lt; 12) {
                return 'səhər';
            } else if (hour &lt; 17) {
                return 'gündüz';
            } else {
                return 'axşam';
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
        ordinal : function (number) {
            if (number === 0) {  // special case for zero
                return number + '-ıncı';
            }
            var a = number % 10,
                b = number % 100 - a,
                c = number &gt;= 100 ? 100 : null;
            return number + (suffixes[a] || suffixes[b] || suffixes[c]);
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function plural(word, num) {
        var forms = word.split('_');
        return num % 10 === 1 &amp;&amp; num % 100 !== 11 ? forms[0] : (num % 10 &gt;= 2 &amp;&amp; num % 10 &lt;= 4 &amp;&amp; (num % 100 &lt; 10 || num % 100 &gt;= 20) ? forms[1] : forms[2]);
    }
    function relativeTimeWithPlural(number, withoutSuffix, key) {
        var format = {
            'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
            'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
            'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
            'dd': 'дзень_дні_дзён',
            'MM': 'месяц_месяцы_месяцаў',
            'yy': 'год_гады_гадоў'
        };
        if (key === 'm') {
            return withoutSuffix ? 'хвіліна' : 'хвіліну';
        }
        else if (key === 'h') {
            return withoutSuffix ? 'гадзіна' : 'гадзіну';
        }
        else {
            return number + ' ' + plural(format[key], +number);
        }
    }

    hooks.defineLocale('be', {
        months : {
            format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
            standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')
        },
        monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
        weekdays : {
            format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
            standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
            isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/
        },
        weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
        weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY г.',
            LLL : 'D MMMM YYYY г., HH:mm',
            LLLL : 'dddd, D MMMM YYYY г., HH:mm'
        },
        calendar : {
            sameDay: '[Сёння ў] LT',
            nextDay: '[Заўтра ў] LT',
            lastDay: '[Учора ў] LT',
            nextWeek: function () {
                return '[У] dddd [ў] LT';
            },
            lastWeek: function () {
                switch (this.day()) {
                    case 0:
                    case 3:
                    case 5:
                    case 6:
                        return '[У мінулую] dddd [ў] LT';
                    case 1:
                    case 2:
                    case 4:
                        return '[У мінулы] dddd [ў] LT';
                }
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'праз %s',
            past : '%s таму',
            s : 'некалькі секунд',
            m : relativeTimeWithPlural,
            mm : relativeTimeWithPlural,
            h : relativeTimeWithPlural,
            hh : relativeTimeWithPlural,
            d : 'дзень',
            dd : relativeTimeWithPlural,
            M : 'месяц',
            MM : relativeTimeWithPlural,
            y : 'год',
            yy : relativeTimeWithPlural
        },
        meridiemParse: /ночы|раніцы|дня|вечара/,
        isPM : function (input) {
            return /^(дня|вечара)$/.test(input);
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'ночы';
            } else if (hour &lt; 12) {
                return 'раніцы';
            } else if (hour &lt; 17) {
                return 'дня';
            } else {
                return 'вечара';
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
        ordinal: function (number, period) {
            switch (period) {
                case 'M':
                case 'd':
                case 'DDD':
                case 'w':
                case 'W':
                    return (number % 10 === 2 || number % 10 === 3) &amp;&amp; (number % 100 !== 12 &amp;&amp; number % 100 !== 13) ? number + '-і' : number + '-ы';
                case 'D':
                    return number + '-га';
                default:
                    return number;
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('bg', {
        months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
        monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
        weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
        weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'D.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY H:mm',
            LLLL : 'dddd, D MMMM YYYY H:mm'
        },
        calendar : {
            sameDay : '[Днес в] LT',
            nextDay : '[Утре в] LT',
            nextWeek : 'dddd [в] LT',
            lastDay : '[Вчера в] LT',
            lastWeek : function () {
                switch (this.day()) {
                    case 0:
                    case 3:
                    case 6:
                        return '[В изминалата] dddd [в] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[В изминалия] dddd [в] LT';
                }
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'след %s',
            past : 'преди %s',
            s : 'няколко секунди',
            ss : '%d секунди',
            m : 'минута',
            mm : '%d минути',
            h : 'час',
            hh : '%d часа',
            d : 'ден',
            dd : '%d дни',
            M : 'месец',
            MM : '%d месеца',
            y : 'година',
            yy : '%d години'
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
        ordinal : function (number) {
            var lastDigit = number % 10,
                last2Digits = number % 100;
            if (number === 0) {
                return number + '-ев';
            } else if (last2Digits === 0) {
                return number + '-ен';
            } else if (last2Digits &gt; 10 &amp;&amp; last2Digits &lt; 20) {
                return number + '-ти';
            } else if (lastDigit === 1) {
                return number + '-ви';
            } else if (lastDigit === 2) {
                return number + '-ри';
            } else if (lastDigit === 7 || lastDigit === 8) {
                return number + '-ми';
            } else {
                return number + '-ти';
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('bm', {
        months : 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'),
        monthsShort : 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
        weekdays : 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
        weekdaysShort : 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
        weekdaysMin : 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'MMMM [tile] D [san] YYYY',
            LLL : 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
            LLLL : 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm'
        },
        calendar : {
            sameDay : '[Bi lɛrɛ] LT',
            nextDay : '[Sini lɛrɛ] LT',
            nextWeek : 'dddd [don lɛrɛ] LT',
            lastDay : '[Kunu lɛrɛ] LT',
            lastWeek : 'dddd [tɛmɛnen lɛrɛ] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s kɔnɔ',
            past : 'a bɛ %s bɔ',
            s : 'sanga dama dama',
            ss : 'sekondi %d',
            m : 'miniti kelen',
            mm : 'miniti %d',
            h : 'lɛrɛ kelen',
            hh : 'lɛrɛ %d',
            d : 'tile kelen',
            dd : 'tile %d',
            M : 'kalo kelen',
            MM : 'kalo %d',
            y : 'san kelen',
            yy : 'san %d'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$3 = {
        '1': '১',
        '2': '২',
        '3': '৩',
        '4': '৪',
        '5': '৫',
        '6': '৬',
        '7': '৭',
        '8': '৮',
        '9': '৯',
        '0': '০'
    },
    numberMap$2 = {
        '১': '1',
        '২': '2',
        '৩': '3',
        '৪': '4',
        '৫': '5',
        '৬': '6',
        '৭': '7',
        '৮': '8',
        '৯': '9',
        '০': '0'
    };

    hooks.defineLocale('bn', {
        months : 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
        monthsShort : 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
        weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'),
        weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
        weekdaysMin : 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
        longDateFormat : {
            LT : 'A h:mm সময়',
            LTS : 'A h:mm:ss সময়',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm সময়',
            LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'
        },
        calendar : {
            sameDay : '[আজ] LT',
            nextDay : '[আগামীকাল] LT',
            nextWeek : 'dddd, LT',
            lastDay : '[গতকাল] LT',
            lastWeek : '[গত] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s পরে',
            past : '%s আগে',
            s : 'কয়েক সেকেন্ড',
            ss : '%d সেকেন্ড',
            m : 'এক মিনিট',
            mm : '%d মিনিট',
            h : 'এক ঘন্টা',
            hh : '%d ঘন্টা',
            d : 'এক দিন',
            dd : '%d দিন',
            M : 'এক মাস',
            MM : '%d মাস',
            y : 'এক বছর',
            yy : '%d বছর'
        },
        preparse: function (string) {
            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
                return numberMap$2[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$3[match];
            });
        },
        meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if ((meridiem === 'রাত' &amp;&amp; hour &gt;= 4) ||
                    (meridiem === 'দুপুর' &amp;&amp; hour &lt; 5) ||
                    meridiem === 'বিকাল') {
                return hour + 12;
            } else {
                return hour;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'রাত';
            } else if (hour &lt; 10) {
                return 'সকাল';
            } else if (hour &lt; 17) {
                return 'দুপুর';
            } else if (hour &lt; 20) {
                return 'বিকাল';
            } else {
                return 'রাত';
            }
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$4 = {
        '1': '༡',
        '2': '༢',
        '3': '༣',
        '4': '༤',
        '5': '༥',
        '6': '༦',
        '7': '༧',
        '8': '༨',
        '9': '༩',
        '0': '༠'
    },
    numberMap$3 = {
        '༡': '1',
        '༢': '2',
        '༣': '3',
        '༤': '4',
        '༥': '5',
        '༦': '6',
        '༧': '7',
        '༨': '8',
        '༩': '9',
        '༠': '0'
    };

    hooks.defineLocale('bo', {
        months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
        monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
        weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
        weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
        weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
        longDateFormat : {
            LT : 'A h:mm',
            LTS : 'A h:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm',
            LLLL : 'dddd, D MMMM YYYY, A h:mm'
        },
        calendar : {
            sameDay : '[དི་རིང] LT',
            nextDay : '[སང་ཉིན] LT',
            nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',
            lastDay : '[ཁ་སང] LT',
            lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s ལ་',
            past : '%s སྔན་ལ',
            s : 'ལམ་སང',
            ss : '%d སྐར་ཆ།',
            m : 'སྐར་མ་གཅིག',
            mm : '%d སྐར་མ',
            h : 'ཆུ་ཚོད་གཅིག',
            hh : '%d ཆུ་ཚོད',
            d : 'ཉིན་གཅིག',
            dd : '%d ཉིན་',
            M : 'ཟླ་བ་གཅིག',
            MM : '%d ཟླ་བ',
            y : 'ལོ་གཅིག',
            yy : '%d ལོ'
        },
        preparse: function (string) {
            return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
                return numberMap$3[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$4[match];
            });
        },
        meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if ((meridiem === 'མཚན་མོ' &amp;&amp; hour &gt;= 4) ||
                    (meridiem === 'ཉིན་གུང' &amp;&amp; hour &lt; 5) ||
                    meridiem === 'དགོང་དག') {
                return hour + 12;
            } else {
                return hour;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'མཚན་མོ';
            } else if (hour &lt; 10) {
                return 'ཞོགས་ཀས';
            } else if (hour &lt; 17) {
                return 'ཉིན་གུང';
            } else if (hour &lt; 20) {
                return 'དགོང་དག';
            } else {
                return 'མཚན་མོ';
            }
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function relativeTimeWithMutation(number, withoutSuffix, key) {
        var format = {
            'mm': 'munutenn',
            'MM': 'miz',
            'dd': 'devezh'
        };
        return number + ' ' + mutation(format[key], number);
    }
    function specialMutationForYears(number) {
        switch (lastNumber(number)) {
            case 1:
            case 3:
            case 4:
            case 5:
            case 9:
                return number + ' bloaz';
            default:
                return number + ' vloaz';
        }
    }
    function lastNumber(number) {
        if (number &gt; 9) {
            return lastNumber(number % 10);
        }
        return number;
    }
    function mutation(text, number) {
        if (number === 2) {
            return softMutation(text);
        }
        return text;
    }
    function softMutation(text) {
        var mutationTable = {
            'm': 'v',
            'b': 'v',
            'd': 'z'
        };
        if (mutationTable[text.charAt(0)] === undefined) {
            return text;
        }
        return mutationTable[text.charAt(0)] + text.substring(1);
    }

    hooks.defineLocale('br', {
        months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
        monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
        weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
        weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
        weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'h[e]mm A',
            LTS : 'h[e]mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D [a viz] MMMM YYYY',
            LLL : 'D [a viz] MMMM YYYY h[e]mm A',
            LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'
        },
        calendar : {
            sameDay : '[Hiziv da] LT',
            nextDay : '[Warc\'hoazh da] LT',
            nextWeek : 'dddd [da] LT',
            lastDay : '[Dec\'h da] LT',
            lastWeek : 'dddd [paset da] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'a-benn %s',
            past : '%s \'zo',
            s : 'un nebeud segondennoù',
            ss : '%d eilenn',
            m : 'ur vunutenn',
            mm : relativeTimeWithMutation,
            h : 'un eur',
            hh : '%d eur',
            d : 'un devezh',
            dd : relativeTimeWithMutation,
            M : 'ur miz',
            MM : relativeTimeWithMutation,
            y : 'ur bloaz',
            yy : specialMutationForYears
        },
        dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
        ordinal : function (number) {
            var output = (number === 1) ? 'añ' : 'vet';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function translate(number, withoutSuffix, key) {
        var result = number + ' ';
        switch (key) {
            case 'ss':
                if (number === 1) {
                    result += 'sekunda';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'sekunde';
                } else {
                    result += 'sekundi';
                }
                return result;
            case 'm':
                return withoutSuffix ? 'jedna minuta' : 'jedne minute';
            case 'mm':
                if (number === 1) {
                    result += 'minuta';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'minute';
                } else {
                    result += 'minuta';
                }
                return result;
            case 'h':
                return withoutSuffix ? 'jedan sat' : 'jednog sata';
            case 'hh':
                if (number === 1) {
                    result += 'sat';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'sata';
                } else {
                    result += 'sati';
                }
                return result;
            case 'dd':
                if (number === 1) {
                    result += 'dan';
                } else {
                    result += 'dana';
                }
                return result;
            case 'MM':
                if (number === 1) {
                    result += 'mjesec';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'mjeseca';
                } else {
                    result += 'mjeseci';
                }
                return result;
            case 'yy':
                if (number === 1) {
                    result += 'godina';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'godine';
                } else {
                    result += 'godina';
                }
                return result;
        }
    }

    hooks.defineLocale('bs', {
        months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
        monthsParseExact: true,
        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY H:mm',
            LLLL : 'dddd, D. MMMM YYYY H:mm'
        },
        calendar : {
            sameDay  : '[danas u] LT',
            nextDay  : '[sutra u] LT',
            nextWeek : function () {
                switch (this.day()) {
                    case 0:
                        return '[u] [nedjelju] [u] LT';
                    case 3:
                        return '[u] [srijedu] [u] LT';
                    case 6:
                        return '[u] [subotu] [u] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[u] dddd [u] LT';
                }
            },
            lastDay  : '[jučer u] LT',
            lastWeek : function () {
                switch (this.day()) {
                    case 0:
                    case 3:
                        return '[prošlu] dddd [u] LT';
                    case 6:
                        return '[prošle] [subote] [u] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[prošli] dddd [u] LT';
                }
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'za %s',
            past   : 'prije %s',
            s      : 'par sekundi',
            ss     : translate,
            m      : translate,
            mm     : translate,
            h      : translate,
            hh     : translate,
            d      : 'dan',
            dd     : translate,
            M      : 'mjesec',
            MM     : translate,
            y      : 'godinu',
            yy     : translate
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ca', {
        months : {
            standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
            format: 'de gener_de febrer_de març_d\'abril_de maig_de juny_de juliol_d\'agost_de setembre_d\'octubre_de novembre_de desembre'.split('_'),
            isFormat: /D[oD]?(\s)+MMMM/
        },
        monthsShort : 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split('_'),
        monthsParseExact : true,
        weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
        weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
        weekdaysMin : 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM [de] YYYY',
            ll : 'D MMM YYYY',
            LLL : 'D MMMM [de] YYYY [a les] H:mm',
            lll : 'D MMM YYYY, H:mm',
            LLLL : 'dddd D MMMM [de] YYYY [a les] H:mm',
            llll : 'ddd D MMM YYYY, H:mm'
        },
        calendar : {
            sameDay : function () {
                return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
            },
            nextDay : function () {
                return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
            },
            nextWeek : function () {
                return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
            },
            lastDay : function () {
                return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
            },
            lastWeek : function () {
                return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'd\'aquí %s',
            past : 'fa %s',
            s : 'uns segons',
            ss : '%d segons',
            m : 'un minut',
            mm : '%d minuts',
            h : 'una hora',
            hh : '%d hores',
            d : 'un dia',
            dd : '%d dies',
            M : 'un mes',
            MM : '%d mesos',
            y : 'un any',
            yy : '%d anys'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
        ordinal : function (number, period) {
            var output = (number === 1) ? 'r' :
                (number === 2) ? 'n' :
                (number === 3) ? 'r' :
                (number === 4) ? 't' : 'è';
            if (period === 'w' || period === 'W') {
                output = 'a';
            }
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var months$3 = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
        monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
    function plural$1(n) {
        return (n &gt; 1) &amp;&amp; (n &lt; 5) &amp;&amp; (~~(n / 10) !== 1);
    }
    function translate$1(number, withoutSuffix, key, isFuture) {
        var result = number + ' ';
        switch (key) {
            case 's':  // a few seconds / in a few seconds / a few seconds ago
                return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$1(number) ? 'sekundy' : 'sekund');
                } else {
                    return result + 'sekundami';
                }
                break;
            case 'm':  // a minute / in a minute / a minute ago
                return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$1(number) ? 'minuty' : 'minut');
                } else {
                    return result + 'minutami';
                }
                break;
            case 'h':  // an hour / in an hour / an hour ago
                return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
            case 'hh': // 9 hours / in 9 hours / 9 hours ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$1(number) ? 'hodiny' : 'hodin');
                } else {
                    return result + 'hodinami';
                }
                break;
            case 'd':  // a day / in a day / a day ago
                return (withoutSuffix || isFuture) ? 'den' : 'dnem';
            case 'dd': // 9 days / in 9 days / 9 days ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$1(number) ? 'dny' : 'dní');
                } else {
                    return result + 'dny';
                }
                break;
            case 'M':  // a month / in a month / a month ago
                return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
            case 'MM': // 9 months / in 9 months / 9 months ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$1(number) ? 'měsíce' : 'měsíců');
                } else {
                    return result + 'měsíci';
                }
                break;
            case 'y':  // a year / in a year / a year ago
                return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
            case 'yy': // 9 years / in 9 years / 9 years ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$1(number) ? 'roky' : 'let');
                } else {
                    return result + 'lety';
                }
                break;
        }
    }

    hooks.defineLocale('cs', {
        months : months$3,
        monthsShort : monthsShort,
        monthsParse : (function (months, monthsShort) {
            var i, _monthsParse = [];
            for (i = 0; i &lt; 12; i++) {
                // use custom parser to solve problem with July (červenec)
                _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
            }
            return _monthsParse;
        }(months$3, monthsShort)),
        shortMonthsParse : (function (monthsShort) {
            var i, _shortMonthsParse = [];
            for (i = 0; i &lt; 12; i++) {
                _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
            }
            return _shortMonthsParse;
        }(monthsShort)),
        longMonthsParse : (function (months) {
            var i, _longMonthsParse = [];
            for (i = 0; i &lt; 12; i++) {
                _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
            }
            return _longMonthsParse;
        }(months$3)),
        weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
        weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
        weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
        longDateFormat : {
            LT: 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY H:mm',
            LLLL : 'dddd D. MMMM YYYY H:mm',
            l : 'D. M. YYYY'
        },
        calendar : {
            sameDay: '[dnes v] LT',
            nextDay: '[zítra v] LT',
            nextWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[v neděli v] LT';
                    case 1:
                    case 2:
                        return '[v] dddd [v] LT';
                    case 3:
                        return '[ve středu v] LT';
                    case 4:
                        return '[ve čtvrtek v] LT';
                    case 5:
                        return '[v pátek v] LT';
                    case 6:
                        return '[v sobotu v] LT';
                }
            },
            lastDay: '[včera v] LT',
            lastWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[minulou neděli v] LT';
                    case 1:
                    case 2:
                        return '[minulé] dddd [v] LT';
                    case 3:
                        return '[minulou středu v] LT';
                    case 4:
                    case 5:
                        return '[minulý] dddd [v] LT';
                    case 6:
                        return '[minulou sobotu v] LT';
                }
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'za %s',
            past : 'před %s',
            s : translate$1,
            ss : translate$1,
            m : translate$1,
            mm : translate$1,
            h : translate$1,
            hh : translate$1,
            d : translate$1,
            dd : translate$1,
            M : translate$1,
            MM : translate$1,
            y : translate$1,
            yy : translate$1
        },
        dayOfMonthOrdinalParse : /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('cv', {
        months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
        monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
        weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
        weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
        weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD-MM-YYYY',
            LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
            LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
            LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
        },
        calendar : {
            sameDay: '[Паян] LT [сехетре]',
            nextDay: '[Ыран] LT [сехетре]',
            lastDay: '[Ӗнер] LT [сехетре]',
            nextWeek: '[Ҫитес] dddd LT [сехетре]',
            lastWeek: '[Иртнӗ] dddd LT [сехетре]',
            sameElse: 'L'
        },
        relativeTime : {
            future : function (output) {
                var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
                return output + affix;
            },
            past : '%s каялла',
            s : 'пӗр-ик ҫеккунт',
            ss : '%d ҫеккунт',
            m : 'пӗр минут',
            mm : '%d минут',
            h : 'пӗр сехет',
            hh : '%d сехет',
            d : 'пӗр кун',
            dd : '%d кун',
            M : 'пӗр уйӑх',
            MM : '%d уйӑх',
            y : 'пӗр ҫул',
            yy : '%d ҫул'
        },
        dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
        ordinal : '%d-мӗш',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('cy', {
        months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
        monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
        weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
        weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
        weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
        weekdaysParseExact : true,
        // time formats are the same as en-gb
        longDateFormat: {
            LT: 'HH:mm',
            LTS : 'HH:mm:ss',
            L: 'DD/MM/YYYY',
            LL: 'D MMMM YYYY',
            LLL: 'D MMMM YYYY HH:mm',
            LLLL: 'dddd, D MMMM YYYY HH:mm'
        },
        calendar: {
            sameDay: '[Heddiw am] LT',
            nextDay: '[Yfory am] LT',
            nextWeek: 'dddd [am] LT',
            lastDay: '[Ddoe am] LT',
            lastWeek: 'dddd [diwethaf am] LT',
            sameElse: 'L'
        },
        relativeTime: {
            future: 'mewn %s',
            past: '%s yn ôl',
            s: 'ychydig eiliadau',
            ss: '%d eiliad',
            m: 'munud',
            mm: '%d munud',
            h: 'awr',
            hh: '%d awr',
            d: 'diwrnod',
            dd: '%d diwrnod',
            M: 'mis',
            MM: '%d mis',
            y: 'blwyddyn',
            yy: '%d flynedd'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
        // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
        ordinal: function (number) {
            var b = number,
                output = '',
                lookup = [
                    '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
                    'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
                ];
            if (b &gt; 20) {
                if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
                    output = 'fed'; // not 30ain, 70ain or 90ain
                } else {
                    output = 'ain';
                }
            } else if (b &gt; 0) {
                output = lookup[b];
            }
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('da', {
        months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
        weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),
        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY HH:mm',
            LLLL : 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'
        },
        calendar : {
            sameDay : '[i dag kl.] LT',
            nextDay : '[i morgen kl.] LT',
            nextWeek : 'på dddd [kl.] LT',
            lastDay : '[i går kl.] LT',
            lastWeek : '[i] dddd[s kl.] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'om %s',
            past : '%s siden',
            s : 'få sekunder',
            ss : '%d sekunder',
            m : 'et minut',
            mm : '%d minutter',
            h : 'en time',
            hh : '%d timer',
            d : 'en dag',
            dd : '%d dage',
            M : 'en måned',
            MM : '%d måneder',
            y : 'et år',
            yy : '%d år'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function processRelativeTime(number, withoutSuffix, key, isFuture) {
        var format = {
            'm': ['eine Minute', 'einer Minute'],
            'h': ['eine Stunde', 'einer Stunde'],
            'd': ['ein Tag', 'einem Tag'],
            'dd': [number + ' Tage', number + ' Tagen'],
            'M': ['ein Monat', 'einem Monat'],
            'MM': [number + ' Monate', number + ' Monaten'],
            'y': ['ein Jahr', 'einem Jahr'],
            'yy': [number + ' Jahre', number + ' Jahren']
        };
        return withoutSuffix ? format[key][0] : format[key][1];
    }

    hooks.defineLocale('de-at', {
        months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
        monthsShort : 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
        monthsParseExact : true,
        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY HH:mm',
            LLLL : 'dddd, D. MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[heute um] LT [Uhr]',
            sameElse: 'L',
            nextDay: '[morgen um] LT [Uhr]',
            nextWeek: 'dddd [um] LT [Uhr]',
            lastDay: '[gestern um] LT [Uhr]',
            lastWeek: '[letzten] dddd [um] LT [Uhr]'
        },
        relativeTime : {
            future : 'in %s',
            past : 'vor %s',
            s : 'ein paar Sekunden',
            ss : '%d Sekunden',
            m : processRelativeTime,
            mm : '%d Minuten',
            h : processRelativeTime,
            hh : '%d Stunden',
            d : processRelativeTime,
            dd : processRelativeTime,
            M : processRelativeTime,
            MM : processRelativeTime,
            y : processRelativeTime,
            yy : processRelativeTime
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function processRelativeTime$1(number, withoutSuffix, key, isFuture) {
        var format = {
            'm': ['eine Minute', 'einer Minute'],
            'h': ['eine Stunde', 'einer Stunde'],
            'd': ['ein Tag', 'einem Tag'],
            'dd': [number + ' Tage', number + ' Tagen'],
            'M': ['ein Monat', 'einem Monat'],
            'MM': [number + ' Monate', number + ' Monaten'],
            'y': ['ein Jahr', 'einem Jahr'],
            'yy': [number + ' Jahre', number + ' Jahren']
        };
        return withoutSuffix ? format[key][0] : format[key][1];
    }

    hooks.defineLocale('de-ch', {
        months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
        monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
        monthsParseExact : true,
        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
        weekdaysShort : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY HH:mm',
            LLLL : 'dddd, D. MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[heute um] LT [Uhr]',
            sameElse: 'L',
            nextDay: '[morgen um] LT [Uhr]',
            nextWeek: 'dddd [um] LT [Uhr]',
            lastDay: '[gestern um] LT [Uhr]',
            lastWeek: '[letzten] dddd [um] LT [Uhr]'
        },
        relativeTime : {
            future : 'in %s',
            past : 'vor %s',
            s : 'ein paar Sekunden',
            ss : '%d Sekunden',
            m : processRelativeTime$1,
            mm : '%d Minuten',
            h : processRelativeTime$1,
            hh : '%d Stunden',
            d : processRelativeTime$1,
            dd : processRelativeTime$1,
            M : processRelativeTime$1,
            MM : processRelativeTime$1,
            y : processRelativeTime$1,
            yy : processRelativeTime$1
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function processRelativeTime$2(number, withoutSuffix, key, isFuture) {
        var format = {
            'm': ['eine Minute', 'einer Minute'],
            'h': ['eine Stunde', 'einer Stunde'],
            'd': ['ein Tag', 'einem Tag'],
            'dd': [number + ' Tage', number + ' Tagen'],
            'M': ['ein Monat', 'einem Monat'],
            'MM': [number + ' Monate', number + ' Monaten'],
            'y': ['ein Jahr', 'einem Jahr'],
            'yy': [number + ' Jahre', number + ' Jahren']
        };
        return withoutSuffix ? format[key][0] : format[key][1];
    }

    hooks.defineLocale('de', {
        months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
        monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
        monthsParseExact : true,
        weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
        weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
        weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY HH:mm',
            LLLL : 'dddd, D. MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[heute um] LT [Uhr]',
            sameElse: 'L',
            nextDay: '[morgen um] LT [Uhr]',
            nextWeek: 'dddd [um] LT [Uhr]',
            lastDay: '[gestern um] LT [Uhr]',
            lastWeek: '[letzten] dddd [um] LT [Uhr]'
        },
        relativeTime : {
            future : 'in %s',
            past : 'vor %s',
            s : 'ein paar Sekunden',
            ss : '%d Sekunden',
            m : processRelativeTime$2,
            mm : '%d Minuten',
            h : processRelativeTime$2,
            hh : '%d Stunden',
            d : processRelativeTime$2,
            dd : processRelativeTime$2,
            M : processRelativeTime$2,
            MM : processRelativeTime$2,
            y : processRelativeTime$2,
            yy : processRelativeTime$2
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var months$4 = [
        'ޖެނުއަރީ',
        'ފެބްރުއަރީ',
        'މާރިޗު',
        'އޭޕްރީލު',
        'މޭ',
        'ޖޫން',
        'ޖުލައި',
        'އޯގަސްޓު',
        'ސެޕްޓެމްބަރު',
        'އޮކްޓޯބަރު',
        'ނޮވެމްބަރު',
        'ޑިސެމްބަރު'
    ], weekdays = [
        'އާދިއްތަ',
        'ހޯމަ',
        'އަންގާރަ',
        'ބުދަ',
        'ބުރާސްފަތި',
        'ހުކުރު',
        'ހޮނިހިރު'
    ];

    hooks.defineLocale('dv', {
        months : months$4,
        monthsShort : months$4,
        weekdays : weekdays,
        weekdaysShort : weekdays,
        weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
        longDateFormat : {

            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'D/M/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        meridiemParse: /މކ|މފ/,
        isPM : function (input) {
            return 'މފ' === input;
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'މކ';
            } else {
                return 'މފ';
            }
        },
        calendar : {
            sameDay : '[މިއަދު] LT',
            nextDay : '[މާދަމާ] LT',
            nextWeek : 'dddd LT',
            lastDay : '[އިއްޔެ] LT',
            lastWeek : '[ފާއިތުވި] dddd LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'ތެރޭގައި %s',
            past : 'ކުރިން %s',
            s : 'ސިކުންތުކޮޅެއް',
            ss : 'd% ސިކުންތު',
            m : 'މިނިޓެއް',
            mm : 'މިނިޓު %d',
            h : 'ގަޑިއިރެއް',
            hh : 'ގަޑިއިރު %d',
            d : 'ދުވަހެއް',
            dd : 'ދުވަސް %d',
            M : 'މަހެއް',
            MM : 'މަސް %d',
            y : 'އަހަރެއް',
            yy : 'އަހަރު %d'
        },
        preparse: function (string) {
            return string.replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/,/g, '،');
        },
        week : {
            dow : 7,  // Sunday is the first day of the week.
            doy : 12  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('el', {
        monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
        monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
        months : function (momentToFormat, format) {
            if (!momentToFormat) {
                return this._monthsNominativeEl;
            } else if (typeof format === 'string' &amp;&amp; /D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
                return this._monthsGenitiveEl[momentToFormat.month()];
            } else {
                return this._monthsNominativeEl[momentToFormat.month()];
            }
        },
        monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
        weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
        weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
        weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
        meridiem : function (hours, minutes, isLower) {
            if (hours &gt; 11) {
                return isLower ? 'μμ' : 'ΜΜ';
            } else {
                return isLower ? 'πμ' : 'ΠΜ';
            }
        },
        isPM : function (input) {
            return ((input + '').toLowerCase()[0] === 'μ');
        },
        meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY h:mm A',
            LLLL : 'dddd, D MMMM YYYY h:mm A'
        },
        calendarEl : {
            sameDay : '[Σήμερα {}] LT',
            nextDay : '[Αύριο {}] LT',
            nextWeek : 'dddd [{}] LT',
            lastDay : '[Χθες {}] LT',
            lastWeek : function () {
                switch (this.day()) {
                    case 6:
                        return '[το προηγούμενο] dddd [{}] LT';
                    default:
                        return '[την προηγούμενη] dddd [{}] LT';
                }
            },
            sameElse : 'L'
        },
        calendar : function (key, mom) {
            var output = this._calendarEl[key],
                hours = mom &amp;&amp; mom.hours();
            if (isFunction(output)) {
                output = output.apply(mom);
            }
            return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
        },
        relativeTime : {
            future : 'σε %s',
            past : '%s πριν',
            s : 'λίγα δευτερόλεπτα',
            ss : '%d δευτερόλεπτα',
            m : 'ένα λεπτό',
            mm : '%d λεπτά',
            h : 'μία ώρα',
            hh : '%d ώρες',
            d : 'μία μέρα',
            dd : '%d μέρες',
            M : 'ένας μήνας',
            MM : '%d μήνες',
            y : 'ένας χρόνος',
            yy : '%d χρόνια'
        },
        dayOfMonthOrdinalParse: /\d{1,2}η/,
        ordinal: '%dη',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('en-au', {
        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY h:mm A',
            LLLL : 'dddd, D MMMM YYYY h:mm A'
        },
        calendar : {
            sameDay : '[Today at] LT',
            nextDay : '[Tomorrow at] LT',
            nextWeek : 'dddd [at] LT',
            lastDay : '[Yesterday at] LT',
            lastWeek : '[Last] dddd [at] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'in %s',
            past : '%s ago',
            s : 'a few seconds',
            ss : '%d seconds',
            m : 'a minute',
            mm : '%d minutes',
            h : 'an hour',
            hh : '%d hours',
            d : 'a day',
            dd : '%d days',
            M : 'a month',
            MM : '%d months',
            y : 'a year',
            yy : '%d years'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('en-ca', {
        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'YYYY-MM-DD',
            LL : 'MMMM D, YYYY',
            LLL : 'MMMM D, YYYY h:mm A',
            LLLL : 'dddd, MMMM D, YYYY h:mm A'
        },
        calendar : {
            sameDay : '[Today at] LT',
            nextDay : '[Tomorrow at] LT',
            nextWeek : 'dddd [at] LT',
            lastDay : '[Yesterday at] LT',
            lastWeek : '[Last] dddd [at] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'in %s',
            past : '%s ago',
            s : 'a few seconds',
            ss : '%d seconds',
            m : 'a minute',
            mm : '%d minutes',
            h : 'an hour',
            hh : '%d hours',
            d : 'a day',
            dd : '%d days',
            M : 'a month',
            MM : '%d months',
            y : 'a year',
            yy : '%d years'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('en-gb', {
        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Today at] LT',
            nextDay : '[Tomorrow at] LT',
            nextWeek : 'dddd [at] LT',
            lastDay : '[Yesterday at] LT',
            lastWeek : '[Last] dddd [at] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'in %s',
            past : '%s ago',
            s : 'a few seconds',
            ss : '%d seconds',
            m : 'a minute',
            mm : '%d minutes',
            h : 'an hour',
            hh : '%d hours',
            d : 'a day',
            dd : '%d days',
            M : 'a month',
            MM : '%d months',
            y : 'a year',
            yy : '%d years'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('en-ie', {
        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD-MM-YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Today at] LT',
            nextDay : '[Tomorrow at] LT',
            nextWeek : 'dddd [at] LT',
            lastDay : '[Yesterday at] LT',
            lastWeek : '[Last] dddd [at] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'in %s',
            past : '%s ago',
            s : 'a few seconds',
            ss : '%d seconds',
            m : 'a minute',
            mm : '%d minutes',
            h : 'an hour',
            hh : '%d hours',
            d : 'a day',
            dd : '%d days',
            M : 'a month',
            MM : '%d months',
            y : 'a year',
            yy : '%d years'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('en-il', {
        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Today at] LT',
            nextDay : '[Tomorrow at] LT',
            nextWeek : 'dddd [at] LT',
            lastDay : '[Yesterday at] LT',
            lastWeek : '[Last] dddd [at] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'in %s',
            past : '%s ago',
            s : 'a few seconds',
            m : 'a minute',
            mm : '%d minutes',
            h : 'an hour',
            hh : '%d hours',
            d : 'a day',
            dd : '%d days',
            M : 'a month',
            MM : '%d months',
            y : 'a year',
            yy : '%d years'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('en-nz', {
        months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
        weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
        weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
        weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY h:mm A',
            LLLL : 'dddd, D MMMM YYYY h:mm A'
        },
        calendar : {
            sameDay : '[Today at] LT',
            nextDay : '[Tomorrow at] LT',
            nextWeek : 'dddd [at] LT',
            lastDay : '[Yesterday at] LT',
            lastWeek : '[Last] dddd [at] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'in %s',
            past : '%s ago',
            s : 'a few seconds',
            ss : '%d seconds',
            m : 'a minute',
            mm : '%d minutes',
            h : 'an hour',
            hh : '%d hours',
            d : 'a day',
            dd : '%d days',
            M : 'a month',
            MM : '%d months',
            y : 'a year',
            yy : '%d years'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('eo', {
        months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
        weekdays : 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
        weekdaysShort : 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
        weekdaysMin : 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY-MM-DD',
            LL : 'D[-a de] MMMM, YYYY',
            LLL : 'D[-a de] MMMM, YYYY HH:mm',
            LLLL : 'dddd, [la] D[-a de] MMMM, YYYY HH:mm'
        },
        meridiemParse: /[ap]\.t\.m/i,
        isPM: function (input) {
            return input.charAt(0).toLowerCase() === 'p';
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &gt; 11) {
                return isLower ? 'p.t.m.' : 'P.T.M.';
            } else {
                return isLower ? 'a.t.m.' : 'A.T.M.';
            }
        },
        calendar : {
            sameDay : '[Hodiaŭ je] LT',
            nextDay : '[Morgaŭ je] LT',
            nextWeek : 'dddd [je] LT',
            lastDay : '[Hieraŭ je] LT',
            lastWeek : '[pasinta] dddd [je] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'post %s',
            past : 'antaŭ %s',
            s : 'sekundoj',
            ss : '%d sekundoj',
            m : 'minuto',
            mm : '%d minutoj',
            h : 'horo',
            hh : '%d horoj',
            d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo
            dd : '%d tagoj',
            M : 'monato',
            MM : '%d monatoj',
            y : 'jaro',
            yy : '%d jaroj'
        },
        dayOfMonthOrdinalParse: /\d{1,2}a/,
        ordinal : '%da',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
        monthsShort$1 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');

    var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
    var monthsRegex$1 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;

    hooks.defineLocale('es-do', {
        months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
        monthsShort : function (m, format) {
            if (!m) {
                return monthsShortDot;
            } else if (/-MMM-/.test(format)) {
                return monthsShort$1[m.month()];
            } else {
                return monthsShortDot[m.month()];
            }
        },
        monthsRegex: monthsRegex$1,
        monthsShortRegex: monthsRegex$1,
        monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
        monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
        monthsParse: monthsParse,
        longMonthsParse: monthsParse,
        shortMonthsParse: monthsParse,
        weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
        weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
        weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D [de] MMMM [de] YYYY',
            LLL : 'D [de] MMMM [de] YYYY h:mm A',
            LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A'
        },
        calendar : {
            sameDay : function () {
                return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            nextDay : function () {
                return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            nextWeek : function () {
                return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            lastDay : function () {
                return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            lastWeek : function () {
                return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'en %s',
            past : 'hace %s',
            s : 'unos segundos',
            ss : '%d segundos',
            m : 'un minuto',
            mm : '%d minutos',
            h : 'una hora',
            hh : '%d horas',
            d : 'un día',
            dd : '%d días',
            M : 'un mes',
            MM : '%d meses',
            y : 'un año',
            yy : '%d años'
        },
        dayOfMonthOrdinalParse : /\d{1,2}º/,
        ordinal : '%dº',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var monthsShortDot$1 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
        monthsShort$2 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');

    hooks.defineLocale('es-us', {
        months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
        monthsShort : function (m, format) {
            if (!m) {
                return monthsShortDot$1;
            } else if (/-MMM-/.test(format)) {
                return monthsShort$2[m.month()];
            } else {
                return monthsShortDot$1[m.month()];
            }
        },
        monthsParseExact : true,
        weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
        weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
        weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'MM/DD/YYYY',
            LL : 'MMMM [de] D [de] YYYY',
            LLL : 'MMMM [de] D [de] YYYY h:mm A',
            LLLL : 'dddd, MMMM [de] D [de] YYYY h:mm A'
        },
        calendar : {
            sameDay : function () {
                return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            nextDay : function () {
                return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            nextWeek : function () {
                return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            lastDay : function () {
                return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            lastWeek : function () {
                return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'en %s',
            past : 'hace %s',
            s : 'unos segundos',
            ss : '%d segundos',
            m : 'un minuto',
            mm : '%d minutos',
            h : 'una hora',
            hh : '%d horas',
            d : 'un día',
            dd : '%d días',
            M : 'un mes',
            MM : '%d meses',
            y : 'un año',
            yy : '%d años'
        },
        dayOfMonthOrdinalParse : /\d{1,2}º/,
        ordinal : '%dº',
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var monthsShortDot$2 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
        monthsShort$3 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');

    var monthsParse$1 = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
    var monthsRegex$2 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;

    hooks.defineLocale('es', {
        months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
        monthsShort : function (m, format) {
            if (!m) {
                return monthsShortDot$2;
            } else if (/-MMM-/.test(format)) {
                return monthsShort$3[m.month()];
            } else {
                return monthsShortDot$2[m.month()];
            }
        },
        monthsRegex : monthsRegex$2,
        monthsShortRegex : monthsRegex$2,
        monthsStrictRegex : /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
        monthsShortStrictRegex : /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
        monthsParse : monthsParse$1,
        longMonthsParse : monthsParse$1,
        shortMonthsParse : monthsParse$1,
        weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
        weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
        weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D [de] MMMM [de] YYYY',
            LLL : 'D [de] MMMM [de] YYYY H:mm',
            LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
        },
        calendar : {
            sameDay : function () {
                return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            nextDay : function () {
                return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            nextWeek : function () {
                return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            lastDay : function () {
                return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            lastWeek : function () {
                return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'en %s',
            past : 'hace %s',
            s : 'unos segundos',
            ss : '%d segundos',
            m : 'un minuto',
            mm : '%d minutos',
            h : 'una hora',
            hh : '%d horas',
            d : 'un día',
            dd : '%d días',
            M : 'un mes',
            MM : '%d meses',
            y : 'un año',
            yy : '%d años'
        },
        dayOfMonthOrdinalParse : /\d{1,2}º/,
        ordinal : '%dº',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function processRelativeTime$3(number, withoutSuffix, key, isFuture) {
        var format = {
            's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
            'ss': [number + 'sekundi', number + 'sekundit'],
            'm' : ['ühe minuti', 'üks minut'],
            'mm': [number + ' minuti', number + ' minutit'],
            'h' : ['ühe tunni', 'tund aega', 'üks tund'],
            'hh': [number + ' tunni', number + ' tundi'],
            'd' : ['ühe päeva', 'üks päev'],
            'M' : ['kuu aja', 'kuu aega', 'üks kuu'],
            'MM': [number + ' kuu', number + ' kuud'],
            'y' : ['ühe aasta', 'aasta', 'üks aasta'],
            'yy': [number + ' aasta', number + ' aastat']
        };
        if (withoutSuffix) {
            return format[key][2] ? format[key][2] : format[key][1];
        }
        return isFuture ? format[key][0] : format[key][1];
    }

    hooks.defineLocale('et', {
        months        : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
        monthsShort   : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
        weekdays      : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
        weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),
        weekdaysMin   : 'P_E_T_K_N_R_L'.split('_'),
        longDateFormat : {
            LT   : 'H:mm',
            LTS : 'H:mm:ss',
            L    : 'DD.MM.YYYY',
            LL   : 'D. MMMM YYYY',
            LLL  : 'D. MMMM YYYY H:mm',
            LLLL : 'dddd, D. MMMM YYYY H:mm'
        },
        calendar : {
            sameDay  : '[Täna,] LT',
            nextDay  : '[Homme,] LT',
            nextWeek : '[Järgmine] dddd LT',
            lastDay  : '[Eile,] LT',
            lastWeek : '[Eelmine] dddd LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s pärast',
            past   : '%s tagasi',
            s      : processRelativeTime$3,
            ss     : processRelativeTime$3,
            m      : processRelativeTime$3,
            mm     : processRelativeTime$3,
            h      : processRelativeTime$3,
            hh     : processRelativeTime$3,
            d      : processRelativeTime$3,
            dd     : '%d päeva',
            M      : processRelativeTime$3,
            MM     : processRelativeTime$3,
            y      : processRelativeTime$3,
            yy     : processRelativeTime$3
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('eu', {
        months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
        monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
        monthsParseExact : true,
        weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
        weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),
        weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY-MM-DD',
            LL : 'YYYY[ko] MMMM[ren] D[a]',
            LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',
            LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
            l : 'YYYY-M-D',
            ll : 'YYYY[ko] MMM D[a]',
            lll : 'YYYY[ko] MMM D[a] HH:mm',
            llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'
        },
        calendar : {
            sameDay : '[gaur] LT[etan]',
            nextDay : '[bihar] LT[etan]',
            nextWeek : 'dddd LT[etan]',
            lastDay : '[atzo] LT[etan]',
            lastWeek : '[aurreko] dddd LT[etan]',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s barru',
            past : 'duela %s',
            s : 'segundo batzuk',
            ss : '%d segundo',
            m : 'minutu bat',
            mm : '%d minutu',
            h : 'ordu bat',
            hh : '%d ordu',
            d : 'egun bat',
            dd : '%d egun',
            M : 'hilabete bat',
            MM : '%d hilabete',
            y : 'urte bat',
            yy : '%d urte'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$5 = {
        '1': '۱',
        '2': '۲',
        '3': '۳',
        '4': '۴',
        '5': '۵',
        '6': '۶',
        '7': '۷',
        '8': '۸',
        '9': '۹',
        '0': '۰'
    }, numberMap$4 = {
        '۱': '1',
        '۲': '2',
        '۳': '3',
        '۴': '4',
        '۵': '5',
        '۶': '6',
        '۷': '7',
        '۸': '8',
        '۹': '9',
        '۰': '0'
    };

    hooks.defineLocale('fa', {
        months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
        monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
        weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
        weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
        weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        meridiemParse: /قبل از ظهر|بعد از ظهر/,
        isPM: function (input) {
            return /بعد از ظهر/.test(input);
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'قبل از ظهر';
            } else {
                return 'بعد از ظهر';
            }
        },
        calendar : {
            sameDay : '[امروز ساعت] LT',
            nextDay : '[فردا ساعت] LT',
            nextWeek : 'dddd [ساعت] LT',
            lastDay : '[دیروز ساعت] LT',
            lastWeek : 'dddd [پیش] [ساعت] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'در %s',
            past : '%s پیش',
            s : 'چند ثانیه',
            ss : 'ثانیه d%',
            m : 'یک دقیقه',
            mm : '%d دقیقه',
            h : 'یک ساعت',
            hh : '%d ساعت',
            d : 'یک روز',
            dd : '%d روز',
            M : 'یک ماه',
            MM : '%d ماه',
            y : 'یک سال',
            yy : '%d سال'
        },
        preparse: function (string) {
            return string.replace(/[۰-۹]/g, function (match) {
                return numberMap$4[match];
            }).replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$5[match];
            }).replace(/,/g, '،');
        },
        dayOfMonthOrdinalParse: /\d{1,2}م/,
        ordinal : '%dم',
        week : {
            dow : 6, // Saturday is the first day of the week.
            doy : 12 // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),
        numbersFuture = [
            'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
            numbersPast[7], numbersPast[8], numbersPast[9]
        ];
    function translate$2(number, withoutSuffix, key, isFuture) {
        var result = '';
        switch (key) {
            case 's':
                return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
            case 'ss':
                return isFuture ? 'sekunnin' : 'sekuntia';
            case 'm':
                return isFuture ? 'minuutin' : 'minuutti';
            case 'mm':
                result = isFuture ? 'minuutin' : 'minuuttia';
                break;
            case 'h':
                return isFuture ? 'tunnin' : 'tunti';
            case 'hh':
                result = isFuture ? 'tunnin' : 'tuntia';
                break;
            case 'd':
                return isFuture ? 'päivän' : 'päivä';
            case 'dd':
                result = isFuture ? 'päivän' : 'päivää';
                break;
            case 'M':
                return isFuture ? 'kuukauden' : 'kuukausi';
            case 'MM':
                result = isFuture ? 'kuukauden' : 'kuukautta';
                break;
            case 'y':
                return isFuture ? 'vuoden' : 'vuosi';
            case 'yy':
                result = isFuture ? 'vuoden' : 'vuotta';
                break;
        }
        result = verbalNumber(number, isFuture) + ' ' + result;
        return result;
    }
    function verbalNumber(number, isFuture) {
        return number &lt; 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;
    }

    hooks.defineLocale('fi', {
        months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
        monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
        weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
        weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),
        weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),
        longDateFormat : {
            LT : 'HH.mm',
            LTS : 'HH.mm.ss',
            L : 'DD.MM.YYYY',
            LL : 'Do MMMM[ta] YYYY',
            LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm',
            LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
            l : 'D.M.YYYY',
            ll : 'Do MMM YYYY',
            lll : 'Do MMM YYYY, [klo] HH.mm',
            llll : 'ddd, Do MMM YYYY, [klo] HH.mm'
        },
        calendar : {
            sameDay : '[tänään] [klo] LT',
            nextDay : '[huomenna] [klo] LT',
            nextWeek : 'dddd [klo] LT',
            lastDay : '[eilen] [klo] LT',
            lastWeek : '[viime] dddd[na] [klo] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s päästä',
            past : '%s sitten',
            s : translate$2,
            ss : translate$2,
            m : translate$2,
            mm : translate$2,
            h : translate$2,
            hh : translate$2,
            d : translate$2,
            dd : translate$2,
            M : translate$2,
            MM : translate$2,
            y : translate$2,
            yy : translate$2
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('fo', {
        months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
        weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
        weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
        weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D. MMMM, YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Í dag kl.] LT',
            nextDay : '[Í morgin kl.] LT',
            nextWeek : 'dddd [kl.] LT',
            lastDay : '[Í gjár kl.] LT',
            lastWeek : '[síðstu] dddd [kl] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'um %s',
            past : '%s síðani',
            s : 'fá sekund',
            ss : '%d sekundir',
            m : 'ein minutt',
            mm : '%d minuttir',
            h : 'ein tími',
            hh : '%d tímar',
            d : 'ein dagur',
            dd : '%d dagar',
            M : 'ein mánaði',
            MM : '%d mánaðir',
            y : 'eitt ár',
            yy : '%d ár'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('fr-ca', {
        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
        monthsParseExact : true,
        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
        weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY-MM-DD',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Aujourd’hui à] LT',
            nextDay : '[Demain à] LT',
            nextWeek : 'dddd [à] LT',
            lastDay : '[Hier à] LT',
            lastWeek : 'dddd [dernier à] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'dans %s',
            past : 'il y a %s',
            s : 'quelques secondes',
            ss : '%d secondes',
            m : 'une minute',
            mm : '%d minutes',
            h : 'une heure',
            hh : '%d heures',
            d : 'un jour',
            dd : '%d jours',
            M : 'un mois',
            MM : '%d mois',
            y : 'un an',
            yy : '%d ans'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
        ordinal : function (number, period) {
            switch (period) {
                // Words with masculine grammatical gender: mois, trimestre, jour
                default:
                case 'M':
                case 'Q':
                case 'D':
                case 'DDD':
                case 'd':
                    return number + (number === 1 ? 'er' : 'e');

                // Words with feminine grammatical gender: semaine
                case 'w':
                case 'W':
                    return number + (number === 1 ? 're' : 'e');
            }
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('fr-ch', {
        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
        monthsParseExact : true,
        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
        weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Aujourd’hui à] LT',
            nextDay : '[Demain à] LT',
            nextWeek : 'dddd [à] LT',
            lastDay : '[Hier à] LT',
            lastWeek : 'dddd [dernier à] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'dans %s',
            past : 'il y a %s',
            s : 'quelques secondes',
            ss : '%d secondes',
            m : 'une minute',
            mm : '%d minutes',
            h : 'une heure',
            hh : '%d heures',
            d : 'un jour',
            dd : '%d jours',
            M : 'un mois',
            MM : '%d mois',
            y : 'un an',
            yy : '%d ans'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
        ordinal : function (number, period) {
            switch (period) {
                // Words with masculine grammatical gender: mois, trimestre, jour
                default:
                case 'M':
                case 'Q':
                case 'D':
                case 'DDD':
                case 'd':
                    return number + (number === 1 ? 'er' : 'e');

                // Words with feminine grammatical gender: semaine
                case 'w':
                case 'W':
                    return number + (number === 1 ? 're' : 'e');
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('fr', {
        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
        monthsParseExact : true,
        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
        weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Aujourd’hui à] LT',
            nextDay : '[Demain à] LT',
            nextWeek : 'dddd [à] LT',
            lastDay : '[Hier à] LT',
            lastWeek : 'dddd [dernier à] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'dans %s',
            past : 'il y a %s',
            s : 'quelques secondes',
            ss : '%d secondes',
            m : 'une minute',
            mm : '%d minutes',
            h : 'une heure',
            hh : '%d heures',
            d : 'un jour',
            dd : '%d jours',
            M : 'un mois',
            MM : '%d mois',
            y : 'un an',
            yy : '%d ans'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
        ordinal : function (number, period) {
            switch (period) {
                // TODO: Return 'e' when day of month &gt; 1. Move this case inside
                // block for masculine words below.
                // See https://github.com/moment/moment/issues/3375
                case 'D':
                    return number + (number === 1 ? 'er' : '');

                // Words with masculine grammatical gender: mois, trimestre, jour
                default:
                case 'M':
                case 'Q':
                case 'DDD':
                case 'd':
                    return number + (number === 1 ? 'er' : 'e');

                // Words with feminine grammatical gender: semaine
                case 'w':
                case 'W':
                    return number + (number === 1 ? 're' : 'e');
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),
        monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');

    hooks.defineLocale('fy', {
        months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
        monthsShort : function (m, format) {
            if (!m) {
                return monthsShortWithDots;
            } else if (/-MMM-/.test(format)) {
                return monthsShortWithoutDots[m.month()];
            } else {
                return monthsShortWithDots[m.month()];
            }
        },
        monthsParseExact : true,
        weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
        weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),
        weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD-MM-YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[hjoed om] LT',
            nextDay: '[moarn om] LT',
            nextWeek: 'dddd [om] LT',
            lastDay: '[juster om] LT',
            lastWeek: '[ôfrûne] dddd [om] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'oer %s',
            past : '%s lyn',
            s : 'in pear sekonden',
            ss : '%d sekonden',
            m : 'ien minút',
            mm : '%d minuten',
            h : 'ien oere',
            hh : '%d oeren',
            d : 'ien dei',
            dd : '%d dagen',
            M : 'ien moanne',
            MM : '%d moannen',
            y : 'ien jier',
            yy : '%d jierren'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
        ordinal : function (number) {
            return number + ((number === 1 || number === 8 || number &gt;= 20) ? 'ste' : 'de');
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var months$5 = [
        'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'
    ];

    var monthsShort$4 = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'];

    var weekdays$1 = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'];

    var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'];

    var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];

    hooks.defineLocale('gd', {
        months : months$5,
        monthsShort : monthsShort$4,
        monthsParseExact : true,
        weekdays : weekdays$1,
        weekdaysShort : weekdaysShort,
        weekdaysMin : weekdaysMin,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[An-diugh aig] LT',
            nextDay : '[A-màireach aig] LT',
            nextWeek : 'dddd [aig] LT',
            lastDay : '[An-dè aig] LT',
            lastWeek : 'dddd [seo chaidh] [aig] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'ann an %s',
            past : 'bho chionn %s',
            s : 'beagan diogan',
            ss : '%d diogan',
            m : 'mionaid',
            mm : '%d mionaidean',
            h : 'uair',
            hh : '%d uairean',
            d : 'latha',
            dd : '%d latha',
            M : 'mìos',
            MM : '%d mìosan',
            y : 'bliadhna',
            yy : '%d bliadhna'
        },
        dayOfMonthOrdinalParse : /\d{1,2}(d|na|mh)/,
        ordinal : function (number) {
            var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('gl', {
        months : 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
        monthsShort : 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
        monthsParseExact: true,
        weekdays : 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
        weekdaysShort : 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
        weekdaysMin : 'do_lu_ma_mé_xo_ve_sá'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D [de] MMMM [de] YYYY',
            LLL : 'D [de] MMMM [de] YYYY H:mm',
            LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
        },
        calendar : {
            sameDay : function () {
                return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
            },
            nextDay : function () {
                return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
            },
            nextWeek : function () {
                return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
            },
            lastDay : function () {
                return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
            },
            lastWeek : function () {
                return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : function (str) {
                if (str.indexOf('un') === 0) {
                    return 'n' + str;
                }
                return 'en ' + str;
            },
            past : 'hai %s',
            s : 'uns segundos',
            ss : '%d segundos',
            m : 'un minuto',
            mm : '%d minutos',
            h : 'unha hora',
            hh : '%d horas',
            d : 'un día',
            dd : '%d días',
            M : 'un mes',
            MM : '%d meses',
            y : 'un ano',
            yy : '%d anos'
        },
        dayOfMonthOrdinalParse : /\d{1,2}º/,
        ordinal : '%dº',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function processRelativeTime$4(number, withoutSuffix, key, isFuture) {
        var format = {
            's': ['thodde secondanim', 'thodde second'],
            'ss': [number + ' secondanim', number + ' second'],
            'm': ['eka mintan', 'ek minute'],
            'mm': [number + ' mintanim', number + ' mintam'],
            'h': ['eka horan', 'ek hor'],
            'hh': [number + ' horanim', number + ' horam'],
            'd': ['eka disan', 'ek dis'],
            'dd': [number + ' disanim', number + ' dis'],
            'M': ['eka mhoinean', 'ek mhoino'],
            'MM': [number + ' mhoineanim', number + ' mhoine'],
            'y': ['eka vorsan', 'ek voros'],
            'yy': [number + ' vorsanim', number + ' vorsam']
        };
        return withoutSuffix ? format[key][0] : format[key][1];
    }

    hooks.defineLocale('gom-latn', {
        months : 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'),
        monthsShort : 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
        monthsParseExact : true,
        weekdays : 'Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son\'var'.split('_'),
        weekdaysShort : 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
        weekdaysMin : 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'A h:mm [vazta]',
            LTS : 'A h:mm:ss [vazta]',
            L : 'DD-MM-YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY A h:mm [vazta]',
            LLLL : 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
            llll: 'ddd, D MMM YYYY, A h:mm [vazta]'
        },
        calendar : {
            sameDay: '[Aiz] LT',
            nextDay: '[Faleam] LT',
            nextWeek: '[Ieta to] dddd[,] LT',
            lastDay: '[Kal] LT',
            lastWeek: '[Fatlo] dddd[,] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : '%s',
            past : '%s adim',
            s : processRelativeTime$4,
            ss : processRelativeTime$4,
            m : processRelativeTime$4,
            mm : processRelativeTime$4,
            h : processRelativeTime$4,
            hh : processRelativeTime$4,
            d : processRelativeTime$4,
            dd : processRelativeTime$4,
            M : processRelativeTime$4,
            MM : processRelativeTime$4,
            y : processRelativeTime$4,
            yy : processRelativeTime$4
        },
        dayOfMonthOrdinalParse : /\d{1,2}(er)/,
        ordinal : function (number, period) {
            switch (period) {
                // the ordinal 'er' only applies to day of the month
                case 'D':
                    return number + 'er';
                default:
                case 'M':
                case 'Q':
                case 'DDD':
                case 'd':
                case 'w':
                case 'W':
                    return number;
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        },
        meridiemParse: /rati|sokalli|donparam|sanje/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'rati') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'sokalli') {
                return hour;
            } else if (meridiem === 'donparam') {
                return hour &gt; 12 ? hour : hour + 12;
            } else if (meridiem === 'sanje') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'rati';
            } else if (hour &lt; 12) {
                return 'sokalli';
            } else if (hour &lt; 16) {
                return 'donparam';
            } else if (hour &lt; 20) {
                return 'sanje';
            } else {
                return 'rati';
            }
        }
    });

    //! moment.js locale configuration

    var symbolMap$6 = {
            '1': '૧',
            '2': '૨',
            '3': '૩',
            '4': '૪',
            '5': '૫',
            '6': '૬',
            '7': '૭',
            '8': '૮',
            '9': '૯',
            '0': '૦'
        },
        numberMap$5 = {
            '૧': '1',
            '૨': '2',
            '૩': '3',
            '૪': '4',
            '૫': '5',
            '૬': '6',
            '૭': '7',
            '૮': '8',
            '૯': '9',
            '૦': '0'
        };

    hooks.defineLocale('gu', {
        months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split('_'),
        monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split('_'),
        monthsParseExact: true,
        weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split('_'),
        weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
        weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
        longDateFormat: {
            LT: 'A h:mm વાગ્યે',
            LTS: 'A h:mm:ss વાગ્યે',
            L: 'DD/MM/YYYY',
            LL: 'D MMMM YYYY',
            LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
            LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે'
        },
        calendar: {
            sameDay: '[આજ] LT',
            nextDay: '[કાલે] LT',
            nextWeek: 'dddd, LT',
            lastDay: '[ગઇકાલે] LT',
            lastWeek: '[પાછલા] dddd, LT',
            sameElse: 'L'
        },
        relativeTime: {
            future: '%s મા',
            past: '%s પેહલા',
            s: 'અમુક પળો',
            ss: '%d સેકંડ',
            m: 'એક મિનિટ',
            mm: '%d મિનિટ',
            h: 'એક કલાક',
            hh: '%d કલાક',
            d: 'એક દિવસ',
            dd: '%d દિવસ',
            M: 'એક મહિનો',
            MM: '%d મહિનો',
            y: 'એક વર્ષ',
            yy: '%d વર્ષ'
        },
        preparse: function (string) {
            return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
                return numberMap$5[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$6[match];
            });
        },
        // Gujarati notation for meridiems are quite fuzzy in practice. While there exists
        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
        meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
        meridiemHour: function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'રાત') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'સવાર') {
                return hour;
            } else if (meridiem === 'બપોર') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else if (meridiem === 'સાંજ') {
                return hour + 12;
            }
        },
        meridiem: function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'રાત';
            } else if (hour &lt; 10) {
                return 'સવાર';
            } else if (hour &lt; 17) {
                return 'બપોર';
            } else if (hour &lt; 20) {
                return 'સાંજ';
            } else {
                return 'રાત';
            }
        },
        week: {
            dow: 0, // Sunday is the first day of the week.
            doy: 6 // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('he', {
        months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
        monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
        weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
        weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
        weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D [ב]MMMM YYYY',
            LLL : 'D [ב]MMMM YYYY HH:mm',
            LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',
            l : 'D/M/YYYY',
            ll : 'D MMM YYYY',
            lll : 'D MMM YYYY HH:mm',
            llll : 'ddd, D MMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[היום ב־]LT',
            nextDay : '[מחר ב־]LT',
            nextWeek : 'dddd [בשעה] LT',
            lastDay : '[אתמול ב־]LT',
            lastWeek : '[ביום] dddd [האחרון בשעה] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'בעוד %s',
            past : 'לפני %s',
            s : 'מספר שניות',
            ss : '%d שניות',
            m : 'דקה',
            mm : '%d דקות',
            h : 'שעה',
            hh : function (number) {
                if (number === 2) {
                    return 'שעתיים';
                }
                return number + ' שעות';
            },
            d : 'יום',
            dd : function (number) {
                if (number === 2) {
                    return 'יומיים';
                }
                return number + ' ימים';
            },
            M : 'חודש',
            MM : function (number) {
                if (number === 2) {
                    return 'חודשיים';
                }
                return number + ' חודשים';
            },
            y : 'שנה',
            yy : function (number) {
                if (number === 2) {
                    return 'שנתיים';
                } else if (number % 10 === 0 &amp;&amp; number !== 10) {
                    return number + ' שנה';
                }
                return number + ' שנים';
            }
        },
        meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
        isPM : function (input) {
            return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 5) {
                return 'לפנות בוקר';
            } else if (hour &lt; 10) {
                return 'בבוקר';
            } else if (hour &lt; 12) {
                return isLower ? 'לפנה"צ' : 'לפני הצהריים';
            } else if (hour &lt; 18) {
                return isLower ? 'אחה"צ' : 'אחרי הצהריים';
            } else {
                return 'בערב';
            }
        }
    });

    //! moment.js locale configuration

    var symbolMap$7 = {
        '1': '१',
        '2': '२',
        '3': '३',
        '4': '४',
        '5': '५',
        '6': '६',
        '7': '७',
        '8': '८',
        '9': '९',
        '0': '०'
    },
    numberMap$6 = {
        '१': '1',
        '२': '2',
        '३': '3',
        '४': '4',
        '५': '5',
        '६': '6',
        '७': '7',
        '८': '8',
        '९': '9',
        '०': '0'
    };

    hooks.defineLocale('hi', {
        months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
        monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
        monthsParseExact: true,
        weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
        weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
        longDateFormat : {
            LT : 'A h:mm बजे',
            LTS : 'A h:mm:ss बजे',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm बजे',
            LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'
        },
        calendar : {
            sameDay : '[आज] LT',
            nextDay : '[कल] LT',
            nextWeek : 'dddd, LT',
            lastDay : '[कल] LT',
            lastWeek : '[पिछले] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s में',
            past : '%s पहले',
            s : 'कुछ ही क्षण',
            ss : '%d सेकंड',
            m : 'एक मिनट',
            mm : '%d मिनट',
            h : 'एक घंटा',
            hh : '%d घंटे',
            d : 'एक दिन',
            dd : '%d दिन',
            M : 'एक महीने',
            MM : '%d महीने',
            y : 'एक वर्ष',
            yy : '%d वर्ष'
        },
        preparse: function (string) {
            return string.replace(/[१२३४५६७८९०]/g, function (match) {
                return numberMap$6[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$7[match];
            });
        },
        // Hindi notation for meridiems are quite fuzzy in practice. While there exists
        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
        meridiemParse: /रात|सुबह|दोपहर|शाम/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'रात') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'सुबह') {
                return hour;
            } else if (meridiem === 'दोपहर') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else if (meridiem === 'शाम') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'रात';
            } else if (hour &lt; 10) {
                return 'सुबह';
            } else if (hour &lt; 17) {
                return 'दोपहर';
            } else if (hour &lt; 20) {
                return 'शाम';
            } else {
                return 'रात';
            }
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function translate$3(number, withoutSuffix, key) {
        var result = number + ' ';
        switch (key) {
            case 'ss':
                if (number === 1) {
                    result += 'sekunda';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'sekunde';
                } else {
                    result += 'sekundi';
                }
                return result;
            case 'm':
                return withoutSuffix ? 'jedna minuta' : 'jedne minute';
            case 'mm':
                if (number === 1) {
                    result += 'minuta';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'minute';
                } else {
                    result += 'minuta';
                }
                return result;
            case 'h':
                return withoutSuffix ? 'jedan sat' : 'jednog sata';
            case 'hh':
                if (number === 1) {
                    result += 'sat';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'sata';
                } else {
                    result += 'sati';
                }
                return result;
            case 'dd':
                if (number === 1) {
                    result += 'dan';
                } else {
                    result += 'dana';
                }
                return result;
            case 'MM':
                if (number === 1) {
                    result += 'mjesec';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'mjeseca';
                } else {
                    result += 'mjeseci';
                }
                return result;
            case 'yy':
                if (number === 1) {
                    result += 'godina';
                } else if (number === 2 || number === 3 || number === 4) {
                    result += 'godine';
                } else {
                    result += 'godina';
                }
                return result;
        }
    }

    hooks.defineLocale('hr', {
        months : {
            format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'),
            standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_')
        },
        monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
        monthsParseExact: true,
        weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
        weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
        weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY H:mm',
            LLLL : 'dddd, D. MMMM YYYY H:mm'
        },
        calendar : {
            sameDay  : '[danas u] LT',
            nextDay  : '[sutra u] LT',
            nextWeek : function () {
                switch (this.day()) {
                    case 0:
                        return '[u] [nedjelju] [u] LT';
                    case 3:
                        return '[u] [srijedu] [u] LT';
                    case 6:
                        return '[u] [subotu] [u] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[u] dddd [u] LT';
                }
            },
            lastDay  : '[jučer u] LT',
            lastWeek : function () {
                switch (this.day()) {
                    case 0:
                    case 3:
                        return '[prošlu] dddd [u] LT';
                    case 6:
                        return '[prošle] [subote] [u] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[prošli] dddd [u] LT';
                }
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'za %s',
            past   : 'prije %s',
            s      : 'par sekundi',
            ss     : translate$3,
            m      : translate$3,
            mm     : translate$3,
            h      : translate$3,
            hh     : translate$3,
            d      : 'dan',
            dd     : translate$3,
            M      : 'mjesec',
            MM     : translate$3,
            y      : 'godinu',
            yy     : translate$3
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
    function translate$4(number, withoutSuffix, key, isFuture) {
        var num = number;
        switch (key) {
            case 's':
                return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
            case 'ss':
                return num + (isFuture || withoutSuffix) ? ' másodperc' : ' másodperce';
            case 'm':
                return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
            case 'mm':
                return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
            case 'h':
                return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
            case 'hh':
                return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
            case 'd':
                return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
            case 'dd':
                return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
            case 'M':
                return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
            case 'MM':
                return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
            case 'y':
                return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
            case 'yy':
                return num + (isFuture || withoutSuffix ? ' év' : ' éve');
        }
        return '';
    }
    function week(isFuture) {
        return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
    }

    hooks.defineLocale('hu', {
        months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
        monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
        weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
        weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
        weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'YYYY.MM.DD.',
            LL : 'YYYY. MMMM D.',
            LLL : 'YYYY. MMMM D. H:mm',
            LLLL : 'YYYY. MMMM D., dddd H:mm'
        },
        meridiemParse: /de|du/i,
        isPM: function (input) {
            return input.charAt(1).toLowerCase() === 'u';
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 12) {
                return isLower === true ? 'de' : 'DE';
            } else {
                return isLower === true ? 'du' : 'DU';
            }
        },
        calendar : {
            sameDay : '[ma] LT[-kor]',
            nextDay : '[holnap] LT[-kor]',
            nextWeek : function () {
                return week.call(this, true);
            },
            lastDay : '[tegnap] LT[-kor]',
            lastWeek : function () {
                return week.call(this, false);
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s múlva',
            past : '%s',
            s : translate$4,
            ss : translate$4,
            m : translate$4,
            mm : translate$4,
            h : translate$4,
            hh : translate$4,
            d : translate$4,
            dd : translate$4,
            M : translate$4,
            MM : translate$4,
            y : translate$4,
            yy : translate$4
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('hy-am', {
        months : {
            format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),
            standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_')
        },
        monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
        weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),
        weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
        weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY թ.',
            LLL : 'D MMMM YYYY թ., HH:mm',
            LLLL : 'dddd, D MMMM YYYY թ., HH:mm'
        },
        calendar : {
            sameDay: '[այսօր] LT',
            nextDay: '[վաղը] LT',
            lastDay: '[երեկ] LT',
            nextWeek: function () {
                return 'dddd [օրը ժամը] LT';
            },
            lastWeek: function () {
                return '[անցած] dddd [օրը ժամը] LT';
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : '%s հետո',
            past : '%s առաջ',
            s : 'մի քանի վայրկյան',
            ss : '%d վայրկյան',
            m : 'րոպե',
            mm : '%d րոպե',
            h : 'ժամ',
            hh : '%d ժամ',
            d : 'օր',
            dd : '%d օր',
            M : 'ամիս',
            MM : '%d ամիս',
            y : 'տարի',
            yy : '%d տարի'
        },
        meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
        isPM: function (input) {
            return /^(ցերեկվա|երեկոյան)$/.test(input);
        },
        meridiem : function (hour) {
            if (hour &lt; 4) {
                return 'գիշերվա';
            } else if (hour &lt; 12) {
                return 'առավոտվա';
            } else if (hour &lt; 17) {
                return 'ցերեկվա';
            } else {
                return 'երեկոյան';
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
        ordinal: function (number, period) {
            switch (period) {
                case 'DDD':
                case 'w':
                case 'W':
                case 'DDDo':
                    if (number === 1) {
                        return number + '-ին';
                    }
                    return number + '-րդ';
                default:
                    return number;
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('id', {
        months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
        weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
        weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
        weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
        longDateFormat : {
            LT : 'HH.mm',
            LTS : 'HH.mm.ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY [pukul] HH.mm',
            LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
        },
        meridiemParse: /pagi|siang|sore|malam/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'pagi') {
                return hour;
            } else if (meridiem === 'siang') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === 'sore' || meridiem === 'malam') {
                return hour + 12;
            }
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 11) {
                return 'pagi';
            } else if (hours &lt; 15) {
                return 'siang';
            } else if (hours &lt; 19) {
                return 'sore';
            } else {
                return 'malam';
            }
        },
        calendar : {
            sameDay : '[Hari ini pukul] LT',
            nextDay : '[Besok pukul] LT',
            nextWeek : 'dddd [pukul] LT',
            lastDay : '[Kemarin pukul] LT',
            lastWeek : 'dddd [lalu pukul] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'dalam %s',
            past : '%s yang lalu',
            s : 'beberapa detik',
            ss : '%d detik',
            m : 'semenit',
            mm : '%d menit',
            h : 'sejam',
            hh : '%d jam',
            d : 'sehari',
            dd : '%d hari',
            M : 'sebulan',
            MM : '%d bulan',
            y : 'setahun',
            yy : '%d tahun'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function plural$2(n) {
        if (n % 100 === 11) {
            return true;
        } else if (n % 10 === 1) {
            return false;
        }
        return true;
    }
    function translate$5(number, withoutSuffix, key, isFuture) {
        var result = number + ' ';
        switch (key) {
            case 's':
                return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
            case 'ss':
                if (plural$2(number)) {
                    return result + (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum');
                }
                return result + 'sekúnda';
            case 'm':
                return withoutSuffix ? 'mínúta' : 'mínútu';
            case 'mm':
                if (plural$2(number)) {
                    return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
                } else if (withoutSuffix) {
                    return result + 'mínúta';
                }
                return result + 'mínútu';
            case 'hh':
                if (plural$2(number)) {
                    return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
                }
                return result + 'klukkustund';
            case 'd':
                if (withoutSuffix) {
                    return 'dagur';
                }
                return isFuture ? 'dag' : 'degi';
            case 'dd':
                if (plural$2(number)) {
                    if (withoutSuffix) {
                        return result + 'dagar';
                    }
                    return result + (isFuture ? 'daga' : 'dögum');
                } else if (withoutSuffix) {
                    return result + 'dagur';
                }
                return result + (isFuture ? 'dag' : 'degi');
            case 'M':
                if (withoutSuffix) {
                    return 'mánuður';
                }
                return isFuture ? 'mánuð' : 'mánuði';
            case 'MM':
                if (plural$2(number)) {
                    if (withoutSuffix) {
                        return result + 'mánuðir';
                    }
                    return result + (isFuture ? 'mánuði' : 'mánuðum');
                } else if (withoutSuffix) {
                    return result + 'mánuður';
                }
                return result + (isFuture ? 'mánuð' : 'mánuði');
            case 'y':
                return withoutSuffix || isFuture ? 'ár' : 'ári';
            case 'yy':
                if (plural$2(number)) {
                    return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
                }
                return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
        }
    }

    hooks.defineLocale('is', {
        months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
        monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
        weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
        weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
        weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY [kl.] H:mm',
            LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'
        },
        calendar : {
            sameDay : '[í dag kl.] LT',
            nextDay : '[á morgun kl.] LT',
            nextWeek : 'dddd [kl.] LT',
            lastDay : '[í gær kl.] LT',
            lastWeek : '[síðasta] dddd [kl.] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'eftir %s',
            past : 'fyrir %s síðan',
            s : translate$5,
            ss : translate$5,
            m : translate$5,
            mm : translate$5,
            h : 'klukkustund',
            hh : translate$5,
            d : translate$5,
            dd : translate$5,
            M : translate$5,
            MM : translate$5,
            y : translate$5,
            yy : translate$5
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('it', {
        months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
        monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
        weekdays : 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
        weekdaysShort : 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
        weekdaysMin : 'do_lu_ma_me_gi_ve_sa'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[Oggi alle] LT',
            nextDay: '[Domani alle] LT',
            nextWeek: 'dddd [alle] LT',
            lastDay: '[Ieri alle] LT',
            lastWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[la scorsa] dddd [alle] LT';
                    default:
                        return '[lo scorso] dddd [alle] LT';
                }
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : function (s) {
                return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;
            },
            past : '%s fa',
            s : 'alcuni secondi',
            ss : '%d secondi',
            m : 'un minuto',
            mm : '%d minuti',
            h : 'un\'ora',
            hh : '%d ore',
            d : 'un giorno',
            dd : '%d giorni',
            M : 'un mese',
            MM : '%d mesi',
            y : 'un anno',
            yy : '%d anni'
        },
        dayOfMonthOrdinalParse : /\d{1,2}º/,
        ordinal: '%dº',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ja', {
        months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
        weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
        weekdaysShort : '日_月_火_水_木_金_土'.split('_'),
        weekdaysMin : '日_月_火_水_木_金_土'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY/MM/DD',
            LL : 'YYYY年M月D日',
            LLL : 'YYYY年M月D日 HH:mm',
            LLLL : 'YYYY年M月D日 dddd HH:mm',
            l : 'YYYY/MM/DD',
            ll : 'YYYY年M月D日',
            lll : 'YYYY年M月D日 HH:mm',
            llll : 'YYYY年M月D日(ddd) HH:mm'
        },
        meridiemParse: /午前|午後/i,
        isPM : function (input) {
            return input === '午後';
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return '午前';
            } else {
                return '午後';
            }
        },
        calendar : {
            sameDay : '[今日] LT',
            nextDay : '[明日] LT',
            nextWeek : function (now) {
                if (now.week() &lt; this.week()) {
                    return '[来週]dddd LT';
                } else {
                    return 'dddd LT';
                }
            },
            lastDay : '[昨日] LT',
            lastWeek : function (now) {
                if (this.week() &lt; now.week()) {
                    return '[先週]dddd LT';
                } else {
                    return 'dddd LT';
                }
            },
            sameElse : 'L'
        },
        dayOfMonthOrdinalParse : /\d{1,2}日/,
        ordinal : function (number, period) {
            switch (period) {
                case 'd':
                case 'D':
                case 'DDD':
                    return number + '日';
                default:
                    return number;
            }
        },
        relativeTime : {
            future : '%s後',
            past : '%s前',
            s : '数秒',
            ss : '%d秒',
            m : '1分',
            mm : '%d分',
            h : '1時間',
            hh : '%d時間',
            d : '1日',
            dd : '%d日',
            M : '1ヶ月',
            MM : '%dヶ月',
            y : '1年',
            yy : '%d年'
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('jv', {
        months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
        monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
        weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
        weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
        weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
        longDateFormat : {
            LT : 'HH.mm',
            LTS : 'HH.mm.ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY [pukul] HH.mm',
            LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
        },
        meridiemParse: /enjing|siyang|sonten|ndalu/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'enjing') {
                return hour;
            } else if (meridiem === 'siyang') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
                return hour + 12;
            }
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 11) {
                return 'enjing';
            } else if (hours &lt; 15) {
                return 'siyang';
            } else if (hours &lt; 19) {
                return 'sonten';
            } else {
                return 'ndalu';
            }
        },
        calendar : {
            sameDay : '[Dinten puniko pukul] LT',
            nextDay : '[Mbenjang pukul] LT',
            nextWeek : 'dddd [pukul] LT',
            lastDay : '[Kala wingi pukul] LT',
            lastWeek : 'dddd [kepengker pukul] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'wonten ing %s',
            past : '%s ingkang kepengker',
            s : 'sawetawis detik',
            ss : '%d detik',
            m : 'setunggal menit',
            mm : '%d menit',
            h : 'setunggal jam',
            hh : '%d jam',
            d : 'sedinten',
            dd : '%d dinten',
            M : 'sewulan',
            MM : '%d wulan',
            y : 'setaun',
            yy : '%d taun'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ka', {
        months : {
            standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
            format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')
        },
        monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
        weekdays : {
            standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
            format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
            isFormat: /(წინა|შემდეგ)/
        },
        weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
        weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY h:mm A',
            LLLL : 'dddd, D MMMM YYYY h:mm A'
        },
        calendar : {
            sameDay : '[დღეს] LT[-ზე]',
            nextDay : '[ხვალ] LT[-ზე]',
            lastDay : '[გუშინ] LT[-ზე]',
            nextWeek : '[შემდეგ] dddd LT[-ზე]',
            lastWeek : '[წინა] dddd LT-ზე',
            sameElse : 'L'
        },
        relativeTime : {
            future : function (s) {
                return (/(წამი|წუთი|საათი|წელი)/).test(s) ?
                    s.replace(/ი$/, 'ში') :
                    s + 'ში';
            },
            past : function (s) {
                if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {
                    return s.replace(/(ი|ე)$/, 'ის წინ');
                }
                if ((/წელი/).test(s)) {
                    return s.replace(/წელი$/, 'წლის წინ');
                }
            },
            s : 'რამდენიმე წამი',
            ss : '%d წამი',
            m : 'წუთი',
            mm : '%d წუთი',
            h : 'საათი',
            hh : '%d საათი',
            d : 'დღე',
            dd : '%d დღე',
            M : 'თვე',
            MM : '%d თვე',
            y : 'წელი',
            yy : '%d წელი'
        },
        dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
        ordinal : function (number) {
            if (number === 0) {
                return number;
            }
            if (number === 1) {
                return number + '-ლი';
            }
            if ((number &lt; 20) || (number &lt;= 100 &amp;&amp; (number % 20 === 0)) || (number % 100 === 0)) {
                return 'მე-' + number;
            }
            return number + '-ე';
        },
        week : {
            dow : 1,
            doy : 7
        }
    });

    //! moment.js locale configuration

    var suffixes$1 = {
        0: '-ші',
        1: '-ші',
        2: '-ші',
        3: '-ші',
        4: '-ші',
        5: '-ші',
        6: '-шы',
        7: '-ші',
        8: '-ші',
        9: '-шы',
        10: '-шы',
        20: '-шы',
        30: '-шы',
        40: '-шы',
        50: '-ші',
        60: '-шы',
        70: '-ші',
        80: '-ші',
        90: '-шы',
        100: '-ші'
    };

    hooks.defineLocale('kk', {
        months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
        monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
        weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
        weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
        weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Бүгін сағат] LT',
            nextDay : '[Ертең сағат] LT',
            nextWeek : 'dddd [сағат] LT',
            lastDay : '[Кеше сағат] LT',
            lastWeek : '[Өткен аптаның] dddd [сағат] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s ішінде',
            past : '%s бұрын',
            s : 'бірнеше секунд',
            ss : '%d секунд',
            m : 'бір минут',
            mm : '%d минут',
            h : 'бір сағат',
            hh : '%d сағат',
            d : 'бір күн',
            dd : '%d күн',
            M : 'бір ай',
            MM : '%d ай',
            y : 'бір жыл',
            yy : '%d жыл'
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
        ordinal : function (number) {
            var a = number % 10,
                b = number &gt;= 100 ? 100 : null;
            return number + (suffixes$1[number] || suffixes$1[a] || suffixes$1[b]);
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$8 = {
        '1': '១',
        '2': '២',
        '3': '៣',
        '4': '៤',
        '5': '៥',
        '6': '៦',
        '7': '៧',
        '8': '៨',
        '9': '៩',
        '0': '០'
    }, numberMap$7 = {
        '១': '1',
        '២': '2',
        '៣': '3',
        '៤': '4',
        '៥': '5',
        '៦': '6',
        '៧': '7',
        '៨': '8',
        '៩': '9',
        '០': '0'
    };

    hooks.defineLocale('km', {
        months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
            '_'
        ),
        monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
            '_'
        ),
        weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
        weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
        weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
        weekdaysParseExact: true,
        longDateFormat: {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L: 'DD/MM/YYYY',
            LL: 'D MMMM YYYY',
            LLL: 'D MMMM YYYY HH:mm',
            LLLL: 'dddd, D MMMM YYYY HH:mm'
        },
        meridiemParse: /ព្រឹក|ល្ងាច/,
        isPM: function (input) {
            return input === 'ល្ងាច';
        },
        meridiem: function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'ព្រឹក';
            } else {
                return 'ល្ងាច';
            }
        },
        calendar: {
            sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
            nextDay: '[ស្អែក ម៉ោង] LT',
            nextWeek: 'dddd [ម៉ោង] LT',
            lastDay: '[ម្សិលមិញ ម៉ោង] LT',
            lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
            sameElse: 'L'
        },
        relativeTime: {
            future: '%sទៀត',
            past: '%sមុន',
            s: 'ប៉ុន្មានវិនាទី',
            ss: '%d វិនាទី',
            m: 'មួយនាទី',
            mm: '%d នាទី',
            h: 'មួយម៉ោង',
            hh: '%d ម៉ោង',
            d: 'មួយថ្ងៃ',
            dd: '%d ថ្ងៃ',
            M: 'មួយខែ',
            MM: '%d ខែ',
            y: 'មួយឆ្នាំ',
            yy: '%d ឆ្នាំ'
        },
        dayOfMonthOrdinalParse : /ទី\d{1,2}/,
        ordinal : 'ទី%d',
        preparse: function (string) {
            return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
                return numberMap$7[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$8[match];
            });
        },
        week: {
            dow: 1, // Monday is the first day of the week.
            doy: 4 // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$9 = {
        '1': '೧',
        '2': '೨',
        '3': '೩',
        '4': '೪',
        '5': '೫',
        '6': '೬',
        '7': '೭',
        '8': '೮',
        '9': '೯',
        '0': '೦'
    },
    numberMap$8 = {
        '೧': '1',
        '೨': '2',
        '೩': '3',
        '೪': '4',
        '೫': '5',
        '೬': '6',
        '೭': '7',
        '೮': '8',
        '೯': '9',
        '೦': '0'
    };

    hooks.defineLocale('kn', {
        months : 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split('_'),
        monthsShort : 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split('_'),
        monthsParseExact: true,
        weekdays : 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split('_'),
        weekdaysShort : 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
        weekdaysMin : 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
        longDateFormat : {
            LT : 'A h:mm',
            LTS : 'A h:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm',
            LLLL : 'dddd, D MMMM YYYY, A h:mm'
        },
        calendar : {
            sameDay : '[ಇಂದು] LT',
            nextDay : '[ನಾಳೆ] LT',
            nextWeek : 'dddd, LT',
            lastDay : '[ನಿನ್ನೆ] LT',
            lastWeek : '[ಕೊನೆಯ] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s ನಂತರ',
            past : '%s ಹಿಂದೆ',
            s : 'ಕೆಲವು ಕ್ಷಣಗಳು',
            ss : '%d ಸೆಕೆಂಡುಗಳು',
            m : 'ಒಂದು ನಿಮಿಷ',
            mm : '%d ನಿಮಿಷ',
            h : 'ಒಂದು ಗಂಟೆ',
            hh : '%d ಗಂಟೆ',
            d : 'ಒಂದು ದಿನ',
            dd : '%d ದಿನ',
            M : 'ಒಂದು ತಿಂಗಳು',
            MM : '%d ತಿಂಗಳು',
            y : 'ಒಂದು ವರ್ಷ',
            yy : '%d ವರ್ಷ'
        },
        preparse: function (string) {
            return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
                return numberMap$8[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$9[match];
            });
        },
        meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'ರಾತ್ರಿ') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
                return hour;
            } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else if (meridiem === 'ಸಂಜೆ') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'ರಾತ್ರಿ';
            } else if (hour &lt; 10) {
                return 'ಬೆಳಿಗ್ಗೆ';
            } else if (hour &lt; 17) {
                return 'ಮಧ್ಯಾಹ್ನ';
            } else if (hour &lt; 20) {
                return 'ಸಂಜೆ';
            } else {
                return 'ರಾತ್ರಿ';
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
        ordinal : function (number) {
            return number + 'ನೇ';
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ko', {
        months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
        monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
        weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
        weekdaysShort : '일_월_화_수_목_금_토'.split('_'),
        weekdaysMin : '일_월_화_수_목_금_토'.split('_'),
        longDateFormat : {
            LT : 'A h:mm',
            LTS : 'A h:mm:ss',
            L : 'YYYY.MM.DD.',
            LL : 'YYYY년 MMMM D일',
            LLL : 'YYYY년 MMMM D일 A h:mm',
            LLLL : 'YYYY년 MMMM D일 dddd A h:mm',
            l : 'YYYY.MM.DD.',
            ll : 'YYYY년 MMMM D일',
            lll : 'YYYY년 MMMM D일 A h:mm',
            llll : 'YYYY년 MMMM D일 dddd A h:mm'
        },
        calendar : {
            sameDay : '오늘 LT',
            nextDay : '내일 LT',
            nextWeek : 'dddd LT',
            lastDay : '어제 LT',
            lastWeek : '지난주 dddd LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s 후',
            past : '%s 전',
            s : '몇 초',
            ss : '%d초',
            m : '1분',
            mm : '%d분',
            h : '한 시간',
            hh : '%d시간',
            d : '하루',
            dd : '%d일',
            M : '한 달',
            MM : '%d달',
            y : '일 년',
            yy : '%d년'
        },
        dayOfMonthOrdinalParse : /\d{1,2}(일|월|주)/,
        ordinal : function (number, period) {
            switch (period) {
                case 'd':
                case 'D':
                case 'DDD':
                    return number + '일';
                case 'M':
                    return number + '월';
                case 'w':
                case 'W':
                    return number + '주';
                default:
                    return number;
            }
        },
        meridiemParse : /오전|오후/,
        isPM : function (token) {
            return token === '오후';
        },
        meridiem : function (hour, minute, isUpper) {
            return hour &lt; 12 ? '오전' : '오후';
        }
    });

    //! moment.js locale configuration

    var suffixes$2 = {
        0: '-чү',
        1: '-чи',
        2: '-чи',
        3: '-чү',
        4: '-чү',
        5: '-чи',
        6: '-чы',
        7: '-чи',
        8: '-чи',
        9: '-чу',
        10: '-чу',
        20: '-чы',
        30: '-чу',
        40: '-чы',
        50: '-чү',
        60: '-чы',
        70: '-чи',
        80: '-чи',
        90: '-чу',
        100: '-чү'
    };

    hooks.defineLocale('ky', {
        months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
        monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
        weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),
        weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
        weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Бүгүн саат] LT',
            nextDay : '[Эртең саат] LT',
            nextWeek : 'dddd [саат] LT',
            lastDay : '[Кече саат] LT',
            lastWeek : '[Өткен аптанын] dddd [күнү] [саат] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s ичинде',
            past : '%s мурун',
            s : 'бирнече секунд',
            ss : '%d секунд',
            m : 'бир мүнөт',
            mm : '%d мүнөт',
            h : 'бир саат',
            hh : '%d саат',
            d : 'бир күн',
            dd : '%d күн',
            M : 'бир ай',
            MM : '%d ай',
            y : 'бир жыл',
            yy : '%d жыл'
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
        ordinal : function (number) {
            var a = number % 10,
                b = number &gt;= 100 ? 100 : null;
            return number + (suffixes$2[number] || suffixes$2[a] || suffixes$2[b]);
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function processRelativeTime$5(number, withoutSuffix, key, isFuture) {
        var format = {
            'm': ['eng Minutt', 'enger Minutt'],
            'h': ['eng Stonn', 'enger Stonn'],
            'd': ['een Dag', 'engem Dag'],
            'M': ['ee Mount', 'engem Mount'],
            'y': ['ee Joer', 'engem Joer']
        };
        return withoutSuffix ? format[key][0] : format[key][1];
    }
    function processFutureTime(string) {
        var number = string.substr(0, string.indexOf(' '));
        if (eifelerRegelAppliesToNumber(number)) {
            return 'a ' + string;
        }
        return 'an ' + string;
    }
    function processPastTime(string) {
        var number = string.substr(0, string.indexOf(' '));
        if (eifelerRegelAppliesToNumber(number)) {
            return 'viru ' + string;
        }
        return 'virun ' + string;
    }
    /**
     * Returns true if the word before the given number loses the '-n' ending.
     * e.g. 'an 10 Deeg' but 'a 5 Deeg'
     *
     * @param number {integer}
     * @returns {boolean}
     */
    function eifelerRegelAppliesToNumber(number) {
        number = parseInt(number, 10);
        if (isNaN(number)) {
            return false;
        }
        if (number &lt; 0) {
            // Negative Number --&gt; always true
            return true;
        } else if (number &lt; 10) {
            // Only 1 digit
            if (4 &lt;= number &amp;&amp; number &lt;= 7) {
                return true;
            }
            return false;
        } else if (number &lt; 100) {
            // 2 digits
            var lastDigit = number % 10, firstDigit = number / 10;
            if (lastDigit === 0) {
                return eifelerRegelAppliesToNumber(firstDigit);
            }
            return eifelerRegelAppliesToNumber(lastDigit);
        } else if (number &lt; 10000) {
            // 3 or 4 digits --&gt; recursively check first digit
            while (number &gt;= 10) {
                number = number / 10;
            }
            return eifelerRegelAppliesToNumber(number);
        } else {
            // Anything larger than 4 digits: recursively check first n-3 digits
            number = number / 1000;
            return eifelerRegelAppliesToNumber(number);
        }
    }

    hooks.defineLocale('lb', {
        months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
        monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
        monthsParseExact : true,
        weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
        weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
        weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat: {
            LT: 'H:mm [Auer]',
            LTS: 'H:mm:ss [Auer]',
            L: 'DD.MM.YYYY',
            LL: 'D. MMMM YYYY',
            LLL: 'D. MMMM YYYY H:mm [Auer]',
            LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
        },
        calendar: {
            sameDay: '[Haut um] LT',
            sameElse: 'L',
            nextDay: '[Muer um] LT',
            nextWeek: 'dddd [um] LT',
            lastDay: '[Gëschter um] LT',
            lastWeek: function () {
                // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
                switch (this.day()) {
                    case 2:
                    case 4:
                        return '[Leschten] dddd [um] LT';
                    default:
                        return '[Leschte] dddd [um] LT';
                }
            }
        },
        relativeTime : {
            future : processFutureTime,
            past : processPastTime,
            s : 'e puer Sekonnen',
            ss : '%d Sekonnen',
            m : processRelativeTime$5,
            mm : '%d Minutten',
            h : processRelativeTime$5,
            hh : '%d Stonnen',
            d : processRelativeTime$5,
            dd : '%d Deeg',
            M : processRelativeTime$5,
            MM : '%d Méint',
            y : processRelativeTime$5,
            yy : '%d Joer'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal: '%d.',
        week: {
            dow: 1, // Monday is the first day of the week.
            doy: 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('lo', {
        months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
        monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
        weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
        weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
        weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'ວັນdddd D MMMM YYYY HH:mm'
        },
        meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
        isPM: function (input) {
            return input === 'ຕອນແລງ';
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'ຕອນເຊົ້າ';
            } else {
                return 'ຕອນແລງ';
            }
        },
        calendar : {
            sameDay : '[ມື້ນີ້ເວລາ] LT',
            nextDay : '[ມື້ອື່ນເວລາ] LT',
            nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT',
            lastDay : '[ມື້ວານນີ້ເວລາ] LT',
            lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'ອີກ %s',
            past : '%sຜ່ານມາ',
            s : 'ບໍ່ເທົ່າໃດວິນາທີ',
            ss : '%d ວິນາທີ' ,
            m : '1 ນາທີ',
            mm : '%d ນາທີ',
            h : '1 ຊົ່ວໂມງ',
            hh : '%d ຊົ່ວໂມງ',
            d : '1 ມື້',
            dd : '%d ມື້',
            M : '1 ເດືອນ',
            MM : '%d ເດືອນ',
            y : '1 ປີ',
            yy : '%d ປີ'
        },
        dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
        ordinal : function (number) {
            return 'ທີ່' + number;
        }
    });

    //! moment.js locale configuration

    var units = {
        'ss' : 'sekundė_sekundžių_sekundes',
        'm' : 'minutė_minutės_minutę',
        'mm': 'minutės_minučių_minutes',
        'h' : 'valanda_valandos_valandą',
        'hh': 'valandos_valandų_valandas',
        'd' : 'diena_dienos_dieną',
        'dd': 'dienos_dienų_dienas',
        'M' : 'mėnuo_mėnesio_mėnesį',
        'MM': 'mėnesiai_mėnesių_mėnesius',
        'y' : 'metai_metų_metus',
        'yy': 'metai_metų_metus'
    };
    function translateSeconds(number, withoutSuffix, key, isFuture) {
        if (withoutSuffix) {
            return 'kelios sekundės';
        } else {
            return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
        }
    }
    function translateSingular(number, withoutSuffix, key, isFuture) {
        return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
    }
    function special(number) {
        return number % 10 === 0 || (number &gt; 10 &amp;&amp; number &lt; 20);
    }
    function forms(key) {
        return units[key].split('_');
    }
    function translate$6(number, withoutSuffix, key, isFuture) {
        var result = number + ' ';
        if (number === 1) {
            return result + translateSingular(number, withoutSuffix, key[0], isFuture);
        } else if (withoutSuffix) {
            return result + (special(number) ? forms(key)[1] : forms(key)[0]);
        } else {
            if (isFuture) {
                return result + forms(key)[1];
            } else {
                return result + (special(number) ? forms(key)[1] : forms(key)[2]);
            }
        }
    }
    hooks.defineLocale('lt', {
        months : {
            format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
            standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
            isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/
        },
        monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
        weekdays : {
            format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
            standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
            isFormat: /dddd HH:mm/
        },
        weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
        weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY-MM-DD',
            LL : 'YYYY [m.] MMMM D [d.]',
            LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
            LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
            l : 'YYYY-MM-DD',
            ll : 'YYYY [m.] MMMM D [d.]',
            lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
            llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
        },
        calendar : {
            sameDay : '[Šiandien] LT',
            nextDay : '[Rytoj] LT',
            nextWeek : 'dddd LT',
            lastDay : '[Vakar] LT',
            lastWeek : '[Praėjusį] dddd LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'po %s',
            past : 'prieš %s',
            s : translateSeconds,
            ss : translate$6,
            m : translateSingular,
            mm : translate$6,
            h : translateSingular,
            hh : translate$6,
            d : translateSingular,
            dd : translate$6,
            M : translateSingular,
            MM : translate$6,
            y : translateSingular,
            yy : translate$6
        },
        dayOfMonthOrdinalParse: /\d{1,2}-oji/,
        ordinal : function (number) {
            return number + '-oji';
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var units$1 = {
        'ss': 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
        'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
        'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
        'h': 'stundas_stundām_stunda_stundas'.split('_'),
        'hh': 'stundas_stundām_stunda_stundas'.split('_'),
        'd': 'dienas_dienām_diena_dienas'.split('_'),
        'dd': 'dienas_dienām_diena_dienas'.split('_'),
        'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
        'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
        'y': 'gada_gadiem_gads_gadi'.split('_'),
        'yy': 'gada_gadiem_gads_gadi'.split('_')
    };
    /**
     * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
     */
    function format$1(forms, number, withoutSuffix) {
        if (withoutSuffix) {
            // E.g. "21 minūte", "3 minūtes".
            return number % 10 === 1 &amp;&amp; number % 100 !== 11 ? forms[2] : forms[3];
        } else {
            // E.g. "21 minūtes" as in "pēc 21 minūtes".
            // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
            return number % 10 === 1 &amp;&amp; number % 100 !== 11 ? forms[0] : forms[1];
        }
    }
    function relativeTimeWithPlural$1(number, withoutSuffix, key) {
        return number + ' ' + format$1(units$1[key], number, withoutSuffix);
    }
    function relativeTimeWithSingular(number, withoutSuffix, key) {
        return format$1(units$1[key], number, withoutSuffix);
    }
    function relativeSeconds(number, withoutSuffix) {
        return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
    }

    hooks.defineLocale('lv', {
        months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
        monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
        weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
        weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
        weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY.',
            LL : 'YYYY. [gada] D. MMMM',
            LLL : 'YYYY. [gada] D. MMMM, HH:mm',
            LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'
        },
        calendar : {
            sameDay : '[Šodien pulksten] LT',
            nextDay : '[Rīt pulksten] LT',
            nextWeek : 'dddd [pulksten] LT',
            lastDay : '[Vakar pulksten] LT',
            lastWeek : '[Pagājušā] dddd [pulksten] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'pēc %s',
            past : 'pirms %s',
            s : relativeSeconds,
            ss : relativeTimeWithPlural$1,
            m : relativeTimeWithSingular,
            mm : relativeTimeWithPlural$1,
            h : relativeTimeWithSingular,
            hh : relativeTimeWithPlural$1,
            d : relativeTimeWithSingular,
            dd : relativeTimeWithPlural$1,
            M : relativeTimeWithSingular,
            MM : relativeTimeWithPlural$1,
            y : relativeTimeWithSingular,
            yy : relativeTimeWithPlural$1
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var translator = {
        words: { //Different grammatical cases
            ss: ['sekund', 'sekunda', 'sekundi'],
            m: ['jedan minut', 'jednog minuta'],
            mm: ['minut', 'minuta', 'minuta'],
            h: ['jedan sat', 'jednog sata'],
            hh: ['sat', 'sata', 'sati'],
            dd: ['dan', 'dana', 'dana'],
            MM: ['mjesec', 'mjeseca', 'mjeseci'],
            yy: ['godina', 'godine', 'godina']
        },
        correctGrammaticalCase: function (number, wordKey) {
            return number === 1 ? wordKey[0] : (number &gt;= 2 &amp;&amp; number &lt;= 4 ? wordKey[1] : wordKey[2]);
        },
        translate: function (number, withoutSuffix, key) {
            var wordKey = translator.words[key];
            if (key.length === 1) {
                return withoutSuffix ? wordKey[0] : wordKey[1];
            } else {
                return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
            }
        }
    };

    hooks.defineLocale('me', {
        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
        monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
        monthsParseExact : true,
        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
        weekdaysParseExact : true,
        longDateFormat: {
            LT: 'H:mm',
            LTS : 'H:mm:ss',
            L: 'DD.MM.YYYY',
            LL: 'D. MMMM YYYY',
            LLL: 'D. MMMM YYYY H:mm',
            LLLL: 'dddd, D. MMMM YYYY H:mm'
        },
        calendar: {
            sameDay: '[danas u] LT',
            nextDay: '[sjutra u] LT',

            nextWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[u] [nedjelju] [u] LT';
                    case 3:
                        return '[u] [srijedu] [u] LT';
                    case 6:
                        return '[u] [subotu] [u] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[u] dddd [u] LT';
                }
            },
            lastDay  : '[juče u] LT',
            lastWeek : function () {
                var lastWeekDays = [
                    '[prošle] [nedjelje] [u] LT',
                    '[prošlog] [ponedjeljka] [u] LT',
                    '[prošlog] [utorka] [u] LT',
                    '[prošle] [srijede] [u] LT',
                    '[prošlog] [četvrtka] [u] LT',
                    '[prošlog] [petka] [u] LT',
                    '[prošle] [subote] [u] LT'
                ];
                return lastWeekDays[this.day()];
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'za %s',
            past   : 'prije %s',
            s      : 'nekoliko sekundi',
            ss     : translator.translate,
            m      : translator.translate,
            mm     : translator.translate,
            h      : translator.translate,
            hh     : translator.translate,
            d      : 'dan',
            dd     : translator.translate,
            M      : 'mjesec',
            MM     : translator.translate,
            y      : 'godinu',
            yy     : translator.translate
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('mi', {
        months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'),
        monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
        monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
        monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
        monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
        monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
        weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
        weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
        weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
        longDateFormat: {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L: 'DD/MM/YYYY',
            LL: 'D MMMM YYYY',
            LLL: 'D MMMM YYYY [i] HH:mm',
            LLLL: 'dddd, D MMMM YYYY [i] HH:mm'
        },
        calendar: {
            sameDay: '[i teie mahana, i] LT',
            nextDay: '[apopo i] LT',
            nextWeek: 'dddd [i] LT',
            lastDay: '[inanahi i] LT',
            lastWeek: 'dddd [whakamutunga i] LT',
            sameElse: 'L'
        },
        relativeTime: {
            future: 'i roto i %s',
            past: '%s i mua',
            s: 'te hēkona ruarua',
            ss: '%d hēkona',
            m: 'he meneti',
            mm: '%d meneti',
            h: 'te haora',
            hh: '%d haora',
            d: 'he ra',
            dd: '%d ra',
            M: 'he marama',
            MM: '%d marama',
            y: 'he tau',
            yy: '%d tau'
        },
        dayOfMonthOrdinalParse: /\d{1,2}º/,
        ordinal: '%dº',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('mk', {
        months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
        monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
        weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
        weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
        weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'D.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY H:mm',
            LLLL : 'dddd, D MMMM YYYY H:mm'
        },
        calendar : {
            sameDay : '[Денес во] LT',
            nextDay : '[Утре во] LT',
            nextWeek : '[Во] dddd [во] LT',
            lastDay : '[Вчера во] LT',
            lastWeek : function () {
                switch (this.day()) {
                    case 0:
                    case 3:
                    case 6:
                        return '[Изминатата] dddd [во] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[Изминатиот] dddd [во] LT';
                }
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'после %s',
            past : 'пред %s',
            s : 'неколку секунди',
            ss : '%d секунди',
            m : 'минута',
            mm : '%d минути',
            h : 'час',
            hh : '%d часа',
            d : 'ден',
            dd : '%d дена',
            M : 'месец',
            MM : '%d месеци',
            y : 'година',
            yy : '%d години'
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
        ordinal : function (number) {
            var lastDigit = number % 10,
                last2Digits = number % 100;
            if (number === 0) {
                return number + '-ев';
            } else if (last2Digits === 0) {
                return number + '-ен';
            } else if (last2Digits &gt; 10 &amp;&amp; last2Digits &lt; 20) {
                return number + '-ти';
            } else if (lastDigit === 1) {
                return number + '-ви';
            } else if (lastDigit === 2) {
                return number + '-ри';
            } else if (lastDigit === 7 || lastDigit === 8) {
                return number + '-ми';
            } else {
                return number + '-ти';
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ml', {
        months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
        monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
        monthsParseExact : true,
        weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
        weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
        weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
        longDateFormat : {
            LT : 'A h:mm -നു',
            LTS : 'A h:mm:ss -നു',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm -നു',
            LLLL : 'dddd, D MMMM YYYY, A h:mm -നു'
        },
        calendar : {
            sameDay : '[ഇന്ന്] LT',
            nextDay : '[നാളെ] LT',
            nextWeek : 'dddd, LT',
            lastDay : '[ഇന്നലെ] LT',
            lastWeek : '[കഴിഞ്ഞ] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s കഴിഞ്ഞ്',
            past : '%s മുൻപ്',
            s : 'അൽപ നിമിഷങ്ങൾ',
            ss : '%d സെക്കൻഡ്',
            m : 'ഒരു മിനിറ്റ്',
            mm : '%d മിനിറ്റ്',
            h : 'ഒരു മണിക്കൂർ',
            hh : '%d മണിക്കൂർ',
            d : 'ഒരു ദിവസം',
            dd : '%d ദിവസം',
            M : 'ഒരു മാസം',
            MM : '%d മാസം',
            y : 'ഒരു വർഷം',
            yy : '%d വർഷം'
        },
        meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if ((meridiem === 'രാത്രി' &amp;&amp; hour &gt;= 4) ||
                    meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
                    meridiem === 'വൈകുന്നേരം') {
                return hour + 12;
            } else {
                return hour;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'രാത്രി';
            } else if (hour &lt; 12) {
                return 'രാവിലെ';
            } else if (hour &lt; 17) {
                return 'ഉച്ച കഴിഞ്ഞ്';
            } else if (hour &lt; 20) {
                return 'വൈകുന്നേരം';
            } else {
                return 'രാത്രി';
            }
        }
    });

    //! moment.js locale configuration

    function translate$7(number, withoutSuffix, key, isFuture) {
        switch (key) {
            case 's':
                return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
            case 'ss':
                return number + (withoutSuffix ? ' секунд' : ' секундын');
            case 'm':
            case 'mm':
                return number + (withoutSuffix ? ' минут' : ' минутын');
            case 'h':
            case 'hh':
                return number + (withoutSuffix ? ' цаг' : ' цагийн');
            case 'd':
            case 'dd':
                return number + (withoutSuffix ? ' өдөр' : ' өдрийн');
            case 'M':
            case 'MM':
                return number + (withoutSuffix ? ' сар' : ' сарын');
            case 'y':
            case 'yy':
                return number + (withoutSuffix ? ' жил' : ' жилийн');
            default:
                return number;
        }
    }

    hooks.defineLocale('mn', {
        months : 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split('_'),
        monthsShort : '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'),
        monthsParseExact : true,
        weekdays : 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
        weekdaysShort : 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
        weekdaysMin : 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY-MM-DD',
            LL : 'YYYY оны MMMMын D',
            LLL : 'YYYY оны MMMMын D HH:mm',
            LLLL : 'dddd, YYYY оны MMMMын D HH:mm'
        },
        meridiemParse: /ҮӨ|ҮХ/i,
        isPM : function (input) {
            return input === 'ҮХ';
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'ҮӨ';
            } else {
                return 'ҮХ';
            }
        },
        calendar : {
            sameDay : '[Өнөөдөр] LT',
            nextDay : '[Маргааш] LT',
            nextWeek : '[Ирэх] dddd LT',
            lastDay : '[Өчигдөр] LT',
            lastWeek : '[Өнгөрсөн] dddd LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s дараа',
            past : '%s өмнө',
            s : translate$7,
            ss : translate$7,
            m : translate$7,
            mm : translate$7,
            h : translate$7,
            hh : translate$7,
            d : translate$7,
            dd : translate$7,
            M : translate$7,
            MM : translate$7,
            y : translate$7,
            yy : translate$7
        },
        dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
        ordinal : function (number, period) {
            switch (period) {
                case 'd':
                case 'D':
                case 'DDD':
                    return number + ' өдөр';
                default:
                    return number;
            }
        }
    });

    //! moment.js locale configuration

    var symbolMap$a = {
        '1': '१',
        '2': '२',
        '3': '३',
        '4': '४',
        '5': '५',
        '6': '६',
        '7': '७',
        '8': '८',
        '9': '९',
        '0': '०'
    },
    numberMap$9 = {
        '१': '1',
        '२': '2',
        '३': '3',
        '४': '4',
        '५': '5',
        '६': '6',
        '७': '7',
        '८': '8',
        '९': '9',
        '०': '0'
    };

    function relativeTimeMr(number, withoutSuffix, string, isFuture)
    {
        var output = '';
        if (withoutSuffix) {
            switch (string) {
                case 's': output = 'काही सेकंद'; break;
                case 'ss': output = '%d सेकंद'; break;
                case 'm': output = 'एक मिनिट'; break;
                case 'mm': output = '%d मिनिटे'; break;
                case 'h': output = 'एक तास'; break;
                case 'hh': output = '%d तास'; break;
                case 'd': output = 'एक दिवस'; break;
                case 'dd': output = '%d दिवस'; break;
                case 'M': output = 'एक महिना'; break;
                case 'MM': output = '%d महिने'; break;
                case 'y': output = 'एक वर्ष'; break;
                case 'yy': output = '%d वर्षे'; break;
            }
        }
        else {
            switch (string) {
                case 's': output = 'काही सेकंदां'; break;
                case 'ss': output = '%d सेकंदां'; break;
                case 'm': output = 'एका मिनिटा'; break;
                case 'mm': output = '%d मिनिटां'; break;
                case 'h': output = 'एका तासा'; break;
                case 'hh': output = '%d तासां'; break;
                case 'd': output = 'एका दिवसा'; break;
                case 'dd': output = '%d दिवसां'; break;
                case 'M': output = 'एका महिन्या'; break;
                case 'MM': output = '%d महिन्यां'; break;
                case 'y': output = 'एका वर्षा'; break;
                case 'yy': output = '%d वर्षां'; break;
            }
        }
        return output.replace(/%d/i, number);
    }

    hooks.defineLocale('mr', {
        months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
        monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
        monthsParseExact : true,
        weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
        weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
        weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
        longDateFormat : {
            LT : 'A h:mm वाजता',
            LTS : 'A h:mm:ss वाजता',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm वाजता',
            LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
        },
        calendar : {
            sameDay : '[आज] LT',
            nextDay : '[उद्या] LT',
            nextWeek : 'dddd, LT',
            lastDay : '[काल] LT',
            lastWeek: '[मागील] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future: '%sमध्ये',
            past: '%sपूर्वी',
            s: relativeTimeMr,
            ss: relativeTimeMr,
            m: relativeTimeMr,
            mm: relativeTimeMr,
            h: relativeTimeMr,
            hh: relativeTimeMr,
            d: relativeTimeMr,
            dd: relativeTimeMr,
            M: relativeTimeMr,
            MM: relativeTimeMr,
            y: relativeTimeMr,
            yy: relativeTimeMr
        },
        preparse: function (string) {
            return string.replace(/[१२३४५६७८९०]/g, function (match) {
                return numberMap$9[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$a[match];
            });
        },
        meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'रात्री') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'सकाळी') {
                return hour;
            } else if (meridiem === 'दुपारी') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else if (meridiem === 'सायंकाळी') {
                return hour + 12;
            }
        },
        meridiem: function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'रात्री';
            } else if (hour &lt; 10) {
                return 'सकाळी';
            } else if (hour &lt; 17) {
                return 'दुपारी';
            } else if (hour &lt; 20) {
                return 'सायंकाळी';
            } else {
                return 'रात्री';
            }
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ms-my', {
        months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
        monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
        weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
        weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
        weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
        longDateFormat : {
            LT : 'HH.mm',
            LTS : 'HH.mm.ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY [pukul] HH.mm',
            LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
        },
        meridiemParse: /pagi|tengahari|petang|malam/,
        meridiemHour: function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'pagi') {
                return hour;
            } else if (meridiem === 'tengahari') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === 'petang' || meridiem === 'malam') {
                return hour + 12;
            }
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 11) {
                return 'pagi';
            } else if (hours &lt; 15) {
                return 'tengahari';
            } else if (hours &lt; 19) {
                return 'petang';
            } else {
                return 'malam';
            }
        },
        calendar : {
            sameDay : '[Hari ini pukul] LT',
            nextDay : '[Esok pukul] LT',
            nextWeek : 'dddd [pukul] LT',
            lastDay : '[Kelmarin pukul] LT',
            lastWeek : 'dddd [lepas pukul] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'dalam %s',
            past : '%s yang lepas',
            s : 'beberapa saat',
            ss : '%d saat',
            m : 'seminit',
            mm : '%d minit',
            h : 'sejam',
            hh : '%d jam',
            d : 'sehari',
            dd : '%d hari',
            M : 'sebulan',
            MM : '%d bulan',
            y : 'setahun',
            yy : '%d tahun'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ms', {
        months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
        monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
        weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
        weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
        weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
        longDateFormat : {
            LT : 'HH.mm',
            LTS : 'HH.mm.ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY [pukul] HH.mm',
            LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
        },
        meridiemParse: /pagi|tengahari|petang|malam/,
        meridiemHour: function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'pagi') {
                return hour;
            } else if (meridiem === 'tengahari') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === 'petang' || meridiem === 'malam') {
                return hour + 12;
            }
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 11) {
                return 'pagi';
            } else if (hours &lt; 15) {
                return 'tengahari';
            } else if (hours &lt; 19) {
                return 'petang';
            } else {
                return 'malam';
            }
        },
        calendar : {
            sameDay : '[Hari ini pukul] LT',
            nextDay : '[Esok pukul] LT',
            nextWeek : 'dddd [pukul] LT',
            lastDay : '[Kelmarin pukul] LT',
            lastWeek : 'dddd [lepas pukul] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'dalam %s',
            past : '%s yang lepas',
            s : 'beberapa saat',
            ss : '%d saat',
            m : 'seminit',
            mm : '%d minit',
            h : 'sejam',
            hh : '%d jam',
            d : 'sehari',
            dd : '%d hari',
            M : 'sebulan',
            MM : '%d bulan',
            y : 'setahun',
            yy : '%d tahun'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('mt', {
        months : 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split('_'),
        monthsShort : 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
        weekdays : 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split('_'),
        weekdaysShort : 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
        weekdaysMin : 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Illum fil-]LT',
            nextDay : '[Għada fil-]LT',
            nextWeek : 'dddd [fil-]LT',
            lastDay : '[Il-bieraħ fil-]LT',
            lastWeek : 'dddd [li għadda] [fil-]LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'f’ %s',
            past : '%s ilu',
            s : 'ftit sekondi',
            ss : '%d sekondi',
            m : 'minuta',
            mm : '%d minuti',
            h : 'siegħa',
            hh : '%d siegħat',
            d : 'ġurnata',
            dd : '%d ġranet',
            M : 'xahar',
            MM : '%d xhur',
            y : 'sena',
            yy : '%d sni'
        },
        dayOfMonthOrdinalParse : /\d{1,2}º/,
        ordinal: '%dº',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$b = {
        '1': '၁',
        '2': '၂',
        '3': '၃',
        '4': '၄',
        '5': '၅',
        '6': '၆',
        '7': '၇',
        '8': '၈',
        '9': '၉',
        '0': '၀'
    }, numberMap$a = {
        '၁': '1',
        '၂': '2',
        '၃': '3',
        '၄': '4',
        '၅': '5',
        '၆': '6',
        '၇': '7',
        '၈': '8',
        '၉': '9',
        '၀': '0'
    };

    hooks.defineLocale('my', {
        months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
        monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
        weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
        weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
        weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),

        longDateFormat: {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L: 'DD/MM/YYYY',
            LL: 'D MMMM YYYY',
            LLL: 'D MMMM YYYY HH:mm',
            LLLL: 'dddd D MMMM YYYY HH:mm'
        },
        calendar: {
            sameDay: '[ယနေ.] LT [မှာ]',
            nextDay: '[မနက်ဖြန်] LT [မှာ]',
            nextWeek: 'dddd LT [မှာ]',
            lastDay: '[မနေ.က] LT [မှာ]',
            lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
            sameElse: 'L'
        },
        relativeTime: {
            future: 'လာမည့် %s မှာ',
            past: 'လွန်ခဲ့သော %s က',
            s: 'စက္ကန်.အနည်းငယ်',
            ss : '%d စက္ကန့်',
            m: 'တစ်မိနစ်',
            mm: '%d မိနစ်',
            h: 'တစ်နာရီ',
            hh: '%d နာရီ',
            d: 'တစ်ရက်',
            dd: '%d ရက်',
            M: 'တစ်လ',
            MM: '%d လ',
            y: 'တစ်နှစ်',
            yy: '%d နှစ်'
        },
        preparse: function (string) {
            return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
                return numberMap$a[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$b[match];
            });
        },
        week: {
            dow: 1, // Monday is the first day of the week.
            doy: 4 // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('nb', {
        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
        monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
        monthsParseExact : true,
        weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
        weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'),
        weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY [kl.] HH:mm',
            LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
        },
        calendar : {
            sameDay: '[i dag kl.] LT',
            nextDay: '[i morgen kl.] LT',
            nextWeek: 'dddd [kl.] LT',
            lastDay: '[i går kl.] LT',
            lastWeek: '[forrige] dddd [kl.] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'om %s',
            past : '%s siden',
            s : 'noen sekunder',
            ss : '%d sekunder',
            m : 'ett minutt',
            mm : '%d minutter',
            h : 'en time',
            hh : '%d timer',
            d : 'en dag',
            dd : '%d dager',
            M : 'en måned',
            MM : '%d måneder',
            y : 'ett år',
            yy : '%d år'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$c = {
        '1': '१',
        '2': '२',
        '3': '३',
        '4': '४',
        '5': '५',
        '6': '६',
        '7': '७',
        '8': '८',
        '9': '९',
        '0': '०'
    },
    numberMap$b = {
        '१': '1',
        '२': '2',
        '३': '3',
        '४': '4',
        '५': '5',
        '६': '6',
        '७': '7',
        '८': '8',
        '९': '9',
        '०': '0'
    };

    hooks.defineLocale('ne', {
        months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
        monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
        monthsParseExact : true,
        weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
        weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
        weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'Aको h:mm बजे',
            LTS : 'Aको h:mm:ss बजे',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, Aको h:mm बजे',
            LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे'
        },
        preparse: function (string) {
            return string.replace(/[१२३४५६७८९०]/g, function (match) {
                return numberMap$b[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$c[match];
            });
        },
        meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'राति') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'बिहान') {
                return hour;
            } else if (meridiem === 'दिउँसो') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else if (meridiem === 'साँझ') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 3) {
                return 'राति';
            } else if (hour &lt; 12) {
                return 'बिहान';
            } else if (hour &lt; 16) {
                return 'दिउँसो';
            } else if (hour &lt; 20) {
                return 'साँझ';
            } else {
                return 'राति';
            }
        },
        calendar : {
            sameDay : '[आज] LT',
            nextDay : '[भोलि] LT',
            nextWeek : '[आउँदो] dddd[,] LT',
            lastDay : '[हिजो] LT',
            lastWeek : '[गएको] dddd[,] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%sमा',
            past : '%s अगाडि',
            s : 'केही क्षण',
            ss : '%d सेकेण्ड',
            m : 'एक मिनेट',
            mm : '%d मिनेट',
            h : 'एक घण्टा',
            hh : '%d घण्टा',
            d : 'एक दिन',
            dd : '%d दिन',
            M : 'एक महिना',
            MM : '%d महिना',
            y : 'एक बर्ष',
            yy : '%d बर्ष'
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var monthsShortWithDots$1 = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
        monthsShortWithoutDots$1 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');

    var monthsParse$2 = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
    var monthsRegex$3 = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;

    hooks.defineLocale('nl-be', {
        months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
        monthsShort : function (m, format) {
            if (!m) {
                return monthsShortWithDots$1;
            } else if (/-MMM-/.test(format)) {
                return monthsShortWithoutDots$1[m.month()];
            } else {
                return monthsShortWithDots$1[m.month()];
            }
        },

        monthsRegex: monthsRegex$3,
        monthsShortRegex: monthsRegex$3,
        monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
        monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,

        monthsParse : monthsParse$2,
        longMonthsParse : monthsParse$2,
        shortMonthsParse : monthsParse$2,

        weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
        weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
        weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[vandaag om] LT',
            nextDay: '[morgen om] LT',
            nextWeek: 'dddd [om] LT',
            lastDay: '[gisteren om] LT',
            lastWeek: '[afgelopen] dddd [om] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'over %s',
            past : '%s geleden',
            s : 'een paar seconden',
            ss : '%d seconden',
            m : 'één minuut',
            mm : '%d minuten',
            h : 'één uur',
            hh : '%d uur',
            d : 'één dag',
            dd : '%d dagen',
            M : 'één maand',
            MM : '%d maanden',
            y : 'één jaar',
            yy : '%d jaar'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
        ordinal : function (number) {
            return number + ((number === 1 || number === 8 || number &gt;= 20) ? 'ste' : 'de');
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var monthsShortWithDots$2 = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
        monthsShortWithoutDots$2 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');

    var monthsParse$3 = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
    var monthsRegex$4 = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;

    hooks.defineLocale('nl', {
        months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
        monthsShort : function (m, format) {
            if (!m) {
                return monthsShortWithDots$2;
            } else if (/-MMM-/.test(format)) {
                return monthsShortWithoutDots$2[m.month()];
            } else {
                return monthsShortWithDots$2[m.month()];
            }
        },

        monthsRegex: monthsRegex$4,
        monthsShortRegex: monthsRegex$4,
        monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
        monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,

        monthsParse : monthsParse$3,
        longMonthsParse : monthsParse$3,
        shortMonthsParse : monthsParse$3,

        weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
        weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
        weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD-MM-YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[vandaag om] LT',
            nextDay: '[morgen om] LT',
            nextWeek: 'dddd [om] LT',
            lastDay: '[gisteren om] LT',
            lastWeek: '[afgelopen] dddd [om] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'over %s',
            past : '%s geleden',
            s : 'een paar seconden',
            ss : '%d seconden',
            m : 'één minuut',
            mm : '%d minuten',
            h : 'één uur',
            hh : '%d uur',
            d : 'één dag',
            dd : '%d dagen',
            M : 'één maand',
            MM : '%d maanden',
            y : 'één jaar',
            yy : '%d jaar'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
        ordinal : function (number) {
            return number + ((number === 1 || number === 8 || number &gt;= 20) ? 'ste' : 'de');
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('nn', {
        months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
        monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
        weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
        weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
        weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY [kl.] H:mm',
            LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
        },
        calendar : {
            sameDay: '[I dag klokka] LT',
            nextDay: '[I morgon klokka] LT',
            nextWeek: 'dddd [klokka] LT',
            lastDay: '[I går klokka] LT',
            lastWeek: '[Føregåande] dddd [klokka] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'om %s',
            past : '%s sidan',
            s : 'nokre sekund',
            ss : '%d sekund',
            m : 'eit minutt',
            mm : '%d minutt',
            h : 'ein time',
            hh : '%d timar',
            d : 'ein dag',
            dd : '%d dagar',
            M : 'ein månad',
            MM : '%d månader',
            y : 'eit år',
            yy : '%d år'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$d = {
        '1': '੧',
        '2': '੨',
        '3': '੩',
        '4': '੪',
        '5': '੫',
        '6': '੬',
        '7': '੭',
        '8': '੮',
        '9': '੯',
        '0': '੦'
    },
    numberMap$c = {
        '੧': '1',
        '੨': '2',
        '੩': '3',
        '੪': '4',
        '੫': '5',
        '੬': '6',
        '੭': '7',
        '੮': '8',
        '੯': '9',
        '੦': '0'
    };

    hooks.defineLocale('pa-in', {
        // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi.
        months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
        monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
        weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),
        weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
        weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
        longDateFormat : {
            LT : 'A h:mm ਵਜੇ',
            LTS : 'A h:mm:ss ਵਜੇ',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm ਵਜੇ',
            LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
        },
        calendar : {
            sameDay : '[ਅਜ] LT',
            nextDay : '[ਕਲ] LT',
            nextWeek : '[ਅਗਲਾ] dddd, LT',
            lastDay : '[ਕਲ] LT',
            lastWeek : '[ਪਿਛਲੇ] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s ਵਿੱਚ',
            past : '%s ਪਿਛਲੇ',
            s : 'ਕੁਝ ਸਕਿੰਟ',
            ss : '%d ਸਕਿੰਟ',
            m : 'ਇਕ ਮਿੰਟ',
            mm : '%d ਮਿੰਟ',
            h : 'ਇੱਕ ਘੰਟਾ',
            hh : '%d ਘੰਟੇ',
            d : 'ਇੱਕ ਦਿਨ',
            dd : '%d ਦਿਨ',
            M : 'ਇੱਕ ਮਹੀਨਾ',
            MM : '%d ਮਹੀਨੇ',
            y : 'ਇੱਕ ਸਾਲ',
            yy : '%d ਸਾਲ'
        },
        preparse: function (string) {
            return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
                return numberMap$c[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$d[match];
            });
        },
        // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
        meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'ਰਾਤ') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'ਸਵੇਰ') {
                return hour;
            } else if (meridiem === 'ਦੁਪਹਿਰ') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else if (meridiem === 'ਸ਼ਾਮ') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'ਰਾਤ';
            } else if (hour &lt; 10) {
                return 'ਸਵੇਰ';
            } else if (hour &lt; 17) {
                return 'ਦੁਪਹਿਰ';
            } else if (hour &lt; 20) {
                return 'ਸ਼ਾਮ';
            } else {
                return 'ਰਾਤ';
            }
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),
        monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
    function plural$3(n) {
        return (n % 10 &lt; 5) &amp;&amp; (n % 10 &gt; 1) &amp;&amp; ((~~(n / 10) % 10) !== 1);
    }
    function translate$8(number, withoutSuffix, key) {
        var result = number + ' ';
        switch (key) {
            case 'ss':
                return result + (plural$3(number) ? 'sekundy' : 'sekund');
            case 'm':
                return withoutSuffix ? 'minuta' : 'minutę';
            case 'mm':
                return result + (plural$3(number) ? 'minuty' : 'minut');
            case 'h':
                return withoutSuffix  ? 'godzina'  : 'godzinę';
            case 'hh':
                return result + (plural$3(number) ? 'godziny' : 'godzin');
            case 'MM':
                return result + (plural$3(number) ? 'miesiące' : 'miesięcy');
            case 'yy':
                return result + (plural$3(number) ? 'lata' : 'lat');
        }
    }

    hooks.defineLocale('pl', {
        months : function (momentToFormat, format) {
            if (!momentToFormat) {
                return monthsNominative;
            } else if (format === '') {
                // Hack: if format empty we know this is used to generate
                // RegExp by moment. Give then back both valid forms of months
                // in RegExp ready format.
                return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
            } else if (/D MMMM/.test(format)) {
                return monthsSubjective[momentToFormat.month()];
            } else {
                return monthsNominative[momentToFormat.month()];
            }
        },
        monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
        weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
        weekdaysShort : 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
        weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[Dziś o] LT',
            nextDay: '[Jutro o] LT',
            nextWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[W niedzielę o] LT';

                    case 2:
                        return '[We wtorek o] LT';

                    case 3:
                        return '[W środę o] LT';

                    case 6:
                        return '[W sobotę o] LT';

                    default:
                        return '[W] dddd [o] LT';
                }
            },
            lastDay: '[Wczoraj o] LT',
            lastWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[W zeszłą niedzielę o] LT';
                    case 3:
                        return '[W zeszłą środę o] LT';
                    case 6:
                        return '[W zeszłą sobotę o] LT';
                    default:
                        return '[W zeszły] dddd [o] LT';
                }
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'za %s',
            past : '%s temu',
            s : 'kilka sekund',
            ss : translate$8,
            m : translate$8,
            mm : translate$8,
            h : translate$8,
            hh : translate$8,
            d : '1 dzień',
            dd : '%d dni',
            M : 'miesiąc',
            MM : translate$8,
            y : 'rok',
            yy : translate$8
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('pt-br', {
        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
        weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
        weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
        weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D [de] MMMM [de] YYYY',
            LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',
            LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
        },
        calendar : {
            sameDay: '[Hoje às] LT',
            nextDay: '[Amanhã às] LT',
            nextWeek: 'dddd [às] LT',
            lastDay: '[Ontem às] LT',
            lastWeek: function () {
                return (this.day() === 0 || this.day() === 6) ?
                    '[Último] dddd [às] LT' : // Saturday + Sunday
                    '[Última] dddd [às] LT'; // Monday - Friday
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'em %s',
            past : 'há %s',
            s : 'poucos segundos',
            ss : '%d segundos',
            m : 'um minuto',
            mm : '%d minutos',
            h : 'uma hora',
            hh : '%d horas',
            d : 'um dia',
            dd : '%d dias',
            M : 'um mês',
            MM : '%d meses',
            y : 'um ano',
            yy : '%d anos'
        },
        dayOfMonthOrdinalParse: /\d{1,2}º/,
        ordinal : '%dº'
    });

    //! moment.js locale configuration

    hooks.defineLocale('pt', {
        months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
        monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
        weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
        weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
        weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D [de] MMMM [de] YYYY',
            LLL : 'D [de] MMMM [de] YYYY HH:mm',
            LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm'
        },
        calendar : {
            sameDay: '[Hoje às] LT',
            nextDay: '[Amanhã às] LT',
            nextWeek: 'dddd [às] LT',
            lastDay: '[Ontem às] LT',
            lastWeek: function () {
                return (this.day() === 0 || this.day() === 6) ?
                    '[Último] dddd [às] LT' : // Saturday + Sunday
                    '[Última] dddd [às] LT'; // Monday - Friday
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'em %s',
            past : 'há %s',
            s : 'segundos',
            ss : '%d segundos',
            m : 'um minuto',
            mm : '%d minutos',
            h : 'uma hora',
            hh : '%d horas',
            d : 'um dia',
            dd : '%d dias',
            M : 'um mês',
            MM : '%d meses',
            y : 'um ano',
            yy : '%d anos'
        },
        dayOfMonthOrdinalParse: /\d{1,2}º/,
        ordinal : '%dº',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function relativeTimeWithPlural$2(number, withoutSuffix, key) {
        var format = {
                'ss': 'secunde',
                'mm': 'minute',
                'hh': 'ore',
                'dd': 'zile',
                'MM': 'luni',
                'yy': 'ani'
            },
            separator = ' ';
        if (number % 100 &gt;= 20 || (number &gt;= 100 &amp;&amp; number % 100 === 0)) {
            separator = ' de ';
        }
        return number + separator + format[key];
    }

    hooks.defineLocale('ro', {
        months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
        monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
        monthsParseExact: true,
        weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
        weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
        weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY H:mm',
            LLLL : 'dddd, D MMMM YYYY H:mm'
        },
        calendar : {
            sameDay: '[azi la] LT',
            nextDay: '[mâine la] LT',
            nextWeek: 'dddd [la] LT',
            lastDay: '[ieri la] LT',
            lastWeek: '[fosta] dddd [la] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'peste %s',
            past : '%s în urmă',
            s : 'câteva secunde',
            ss : relativeTimeWithPlural$2,
            m : 'un minut',
            mm : relativeTimeWithPlural$2,
            h : 'o oră',
            hh : relativeTimeWithPlural$2,
            d : 'o zi',
            dd : relativeTimeWithPlural$2,
            M : 'o lună',
            MM : relativeTimeWithPlural$2,
            y : 'un an',
            yy : relativeTimeWithPlural$2
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function plural$4(word, num) {
        var forms = word.split('_');
        return num % 10 === 1 &amp;&amp; num % 100 !== 11 ? forms[0] : (num % 10 &gt;= 2 &amp;&amp; num % 10 &lt;= 4 &amp;&amp; (num % 100 &lt; 10 || num % 100 &gt;= 20) ? forms[1] : forms[2]);
    }
    function relativeTimeWithPlural$3(number, withoutSuffix, key) {
        var format = {
            'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
            'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
            'hh': 'час_часа_часов',
            'dd': 'день_дня_дней',
            'MM': 'месяц_месяца_месяцев',
            'yy': 'год_года_лет'
        };
        if (key === 'm') {
            return withoutSuffix ? 'минута' : 'минуту';
        }
        else {
            return number + ' ' + plural$4(format[key], +number);
        }
    }
    var monthsParse$4 = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];

    // http://new.gramota.ru/spravka/rules/139-prop : § 103
    // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
    // CLDR data:          http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
    hooks.defineLocale('ru', {
        months : {
            format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
            standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
        },
        monthsShort : {
            // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
            format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
            standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
        },
        weekdays : {
            standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
            format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
            isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
        },
        weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
        weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
        monthsParse : monthsParse$4,
        longMonthsParse : monthsParse$4,
        shortMonthsParse : monthsParse$4,

        // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
        monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,

        // копия предыдущего
        monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,

        // полные названия с падежами
        monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,

        // Выражение, которое соотвествует только сокращённым формам
        monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY г.',
            LLL : 'D MMMM YYYY г., H:mm',
            LLLL : 'dddd, D MMMM YYYY г., H:mm'
        },
        calendar : {
            sameDay: '[Сегодня, в] LT',
            nextDay: '[Завтра, в] LT',
            lastDay: '[Вчера, в] LT',
            nextWeek: function (now) {
                if (now.week() !== this.week()) {
                    switch (this.day()) {
                        case 0:
                            return '[В следующее] dddd, [в] LT';
                        case 1:
                        case 2:
                        case 4:
                            return '[В следующий] dddd, [в] LT';
                        case 3:
                        case 5:
                        case 6:
                            return '[В следующую] dddd, [в] LT';
                    }
                } else {
                    if (this.day() === 2) {
                        return '[Во] dddd, [в] LT';
                    } else {
                        return '[В] dddd, [в] LT';
                    }
                }
            },
            lastWeek: function (now) {
                if (now.week() !== this.week()) {
                    switch (this.day()) {
                        case 0:
                            return '[В прошлое] dddd, [в] LT';
                        case 1:
                        case 2:
                        case 4:
                            return '[В прошлый] dddd, [в] LT';
                        case 3:
                        case 5:
                        case 6:
                            return '[В прошлую] dddd, [в] LT';
                    }
                } else {
                    if (this.day() === 2) {
                        return '[Во] dddd, [в] LT';
                    } else {
                        return '[В] dddd, [в] LT';
                    }
                }
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'через %s',
            past : '%s назад',
            s : 'несколько секунд',
            ss : relativeTimeWithPlural$3,
            m : relativeTimeWithPlural$3,
            mm : relativeTimeWithPlural$3,
            h : 'час',
            hh : relativeTimeWithPlural$3,
            d : 'день',
            dd : relativeTimeWithPlural$3,
            M : 'месяц',
            MM : relativeTimeWithPlural$3,
            y : 'год',
            yy : relativeTimeWithPlural$3
        },
        meridiemParse: /ночи|утра|дня|вечера/i,
        isPM : function (input) {
            return /^(дня|вечера)$/.test(input);
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'ночи';
            } else if (hour &lt; 12) {
                return 'утра';
            } else if (hour &lt; 17) {
                return 'дня';
            } else {
                return 'вечера';
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
        ordinal: function (number, period) {
            switch (period) {
                case 'M':
                case 'd':
                case 'DDD':
                    return number + '-й';
                case 'D':
                    return number + '-го';
                case 'w':
                case 'W':
                    return number + '-я';
                default:
                    return number;
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var months$6 = [
        'جنوري',
        'فيبروري',
        'مارچ',
        'اپريل',
        'مئي',
        'جون',
        'جولاءِ',
        'آگسٽ',
        'سيپٽمبر',
        'آڪٽوبر',
        'نومبر',
        'ڊسمبر'
    ];
    var days$1 = [
        'آچر',
        'سومر',
        'اڱارو',
        'اربع',
        'خميس',
        'جمع',
        'ڇنڇر'
    ];

    hooks.defineLocale('sd', {
        months : months$6,
        monthsShort : months$6,
        weekdays : days$1,
        weekdaysShort : days$1,
        weekdaysMin : days$1,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd، D MMMM YYYY HH:mm'
        },
        meridiemParse: /صبح|شام/,
        isPM : function (input) {
            return 'شام' === input;
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'صبح';
            }
            return 'شام';
        },
        calendar : {
            sameDay : '[اڄ] LT',
            nextDay : '[سڀاڻي] LT',
            nextWeek : 'dddd [اڳين هفتي تي] LT',
            lastDay : '[ڪالهه] LT',
            lastWeek : '[گزريل هفتي] dddd [تي] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s پوء',
            past : '%s اڳ',
            s : 'چند سيڪنڊ',
            ss : '%d سيڪنڊ',
            m : 'هڪ منٽ',
            mm : '%d منٽ',
            h : 'هڪ ڪلاڪ',
            hh : '%d ڪلاڪ',
            d : 'هڪ ڏينهن',
            dd : '%d ڏينهن',
            M : 'هڪ مهينو',
            MM : '%d مهينا',
            y : 'هڪ سال',
            yy : '%d سال'
        },
        preparse: function (string) {
            return string.replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/,/g, '،');
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('se', {
        months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
        monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
        weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
        weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
        weekdaysMin : 's_v_m_g_d_b_L'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'MMMM D. [b.] YYYY',
            LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm',
            LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
        },
        calendar : {
            sameDay: '[otne ti] LT',
            nextDay: '[ihttin ti] LT',
            nextWeek: 'dddd [ti] LT',
            lastDay: '[ikte ti] LT',
            lastWeek: '[ovddit] dddd [ti] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : '%s geažes',
            past : 'maŋit %s',
            s : 'moadde sekunddat',
            ss: '%d sekunddat',
            m : 'okta minuhta',
            mm : '%d minuhtat',
            h : 'okta diimmu',
            hh : '%d diimmut',
            d : 'okta beaivi',
            dd : '%d beaivvit',
            M : 'okta mánnu',
            MM : '%d mánut',
            y : 'okta jahki',
            yy : '%d jagit'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    /*jshint -W100*/
    hooks.defineLocale('si', {
        months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
        monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
        weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
        weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
        weekdaysMin : 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'a h:mm',
            LTS : 'a h:mm:ss',
            L : 'YYYY/MM/DD',
            LL : 'YYYY MMMM D',
            LLL : 'YYYY MMMM D, a h:mm',
            LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
        },
        calendar : {
            sameDay : '[අද] LT[ට]',
            nextDay : '[හෙට] LT[ට]',
            nextWeek : 'dddd LT[ට]',
            lastDay : '[ඊයේ] LT[ට]',
            lastWeek : '[පසුගිය] dddd LT[ට]',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%sකින්',
            past : '%sකට පෙර',
            s : 'තත්පර කිහිපය',
            ss : 'තත්පර %d',
            m : 'මිනිත්තුව',
            mm : 'මිනිත්තු %d',
            h : 'පැය',
            hh : 'පැය %d',
            d : 'දිනය',
            dd : 'දින %d',
            M : 'මාසය',
            MM : 'මාස %d',
            y : 'වසර',
            yy : 'වසර %d'
        },
        dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
        ordinal : function (number) {
            return number + ' වැනි';
        },
        meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
        isPM : function (input) {
            return input === 'ප.ව.' || input === 'පස් වරු';
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &gt; 11) {
                return isLower ? 'ප.ව.' : 'පස් වරු';
            } else {
                return isLower ? 'පෙ.ව.' : 'පෙර වරු';
            }
        }
    });

    //! moment.js locale configuration

    var months$7 = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
        monthsShort$5 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
    function plural$5(n) {
        return (n &gt; 1) &amp;&amp; (n &lt; 5);
    }
    function translate$9(number, withoutSuffix, key, isFuture) {
        var result = number + ' ';
        switch (key) {
            case 's':  // a few seconds / in a few seconds / a few seconds ago
                return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$5(number) ? 'sekundy' : 'sekúnd');
                } else {
                    return result + 'sekundami';
                }
                break;
            case 'm':  // a minute / in a minute / a minute ago
                return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$5(number) ? 'minúty' : 'minút');
                } else {
                    return result + 'minútami';
                }
                break;
            case 'h':  // an hour / in an hour / an hour ago
                return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
            case 'hh': // 9 hours / in 9 hours / 9 hours ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$5(number) ? 'hodiny' : 'hodín');
                } else {
                    return result + 'hodinami';
                }
                break;
            case 'd':  // a day / in a day / a day ago
                return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
            case 'dd': // 9 days / in 9 days / 9 days ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$5(number) ? 'dni' : 'dní');
                } else {
                    return result + 'dňami';
                }
                break;
            case 'M':  // a month / in a month / a month ago
                return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
            case 'MM': // 9 months / in 9 months / 9 months ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$5(number) ? 'mesiace' : 'mesiacov');
                } else {
                    return result + 'mesiacmi';
                }
                break;
            case 'y':  // a year / in a year / a year ago
                return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
            case 'yy': // 9 years / in 9 years / 9 years ago
                if (withoutSuffix || isFuture) {
                    return result + (plural$5(number) ? 'roky' : 'rokov');
                } else {
                    return result + 'rokmi';
                }
                break;
        }
    }

    hooks.defineLocale('sk', {
        months : months$7,
        monthsShort : monthsShort$5,
        weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
        weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),
        weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),
        longDateFormat : {
            LT: 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY H:mm',
            LLLL : 'dddd D. MMMM YYYY H:mm'
        },
        calendar : {
            sameDay: '[dnes o] LT',
            nextDay: '[zajtra o] LT',
            nextWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[v nedeľu o] LT';
                    case 1:
                    case 2:
                        return '[v] dddd [o] LT';
                    case 3:
                        return '[v stredu o] LT';
                    case 4:
                        return '[vo štvrtok o] LT';
                    case 5:
                        return '[v piatok o] LT';
                    case 6:
                        return '[v sobotu o] LT';
                }
            },
            lastDay: '[včera o] LT',
            lastWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[minulú nedeľu o] LT';
                    case 1:
                    case 2:
                        return '[minulý] dddd [o] LT';
                    case 3:
                        return '[minulú stredu o] LT';
                    case 4:
                    case 5:
                        return '[minulý] dddd [o] LT';
                    case 6:
                        return '[minulú sobotu o] LT';
                }
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'za %s',
            past : 'pred %s',
            s : translate$9,
            ss : translate$9,
            m : translate$9,
            mm : translate$9,
            h : translate$9,
            hh : translate$9,
            d : translate$9,
            dd : translate$9,
            M : translate$9,
            MM : translate$9,
            y : translate$9,
            yy : translate$9
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function processRelativeTime$6(number, withoutSuffix, key, isFuture) {
        var result = number + ' ';
        switch (key) {
            case 's':
                return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
            case 'ss':
                if (number === 1) {
                    result += withoutSuffix ? 'sekundo' : 'sekundi';
                } else if (number === 2) {
                    result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
                } else if (number &lt; 5) {
                    result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
                } else {
                    result += withoutSuffix || isFuture ? 'sekund' : 'sekund';
                }
                return result;
            case 'm':
                return withoutSuffix ? 'ena minuta' : 'eno minuto';
            case 'mm':
                if (number === 1) {
                    result += withoutSuffix ? 'minuta' : 'minuto';
                } else if (number === 2) {
                    result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
                } else if (number &lt; 5) {
                    result += withoutSuffix || isFuture ? 'minute' : 'minutami';
                } else {
                    result += withoutSuffix || isFuture ? 'minut' : 'minutami';
                }
                return result;
            case 'h':
                return withoutSuffix ? 'ena ura' : 'eno uro';
            case 'hh':
                if (number === 1) {
                    result += withoutSuffix ? 'ura' : 'uro';
                } else if (number === 2) {
                    result += withoutSuffix || isFuture ? 'uri' : 'urama';
                } else if (number &lt; 5) {
                    result += withoutSuffix || isFuture ? 'ure' : 'urami';
                } else {
                    result += withoutSuffix || isFuture ? 'ur' : 'urami';
                }
                return result;
            case 'd':
                return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
            case 'dd':
                if (number === 1) {
                    result += withoutSuffix || isFuture ? 'dan' : 'dnem';
                } else if (number === 2) {
                    result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
                } else {
                    result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
                }
                return result;
            case 'M':
                return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
            case 'MM':
                if (number === 1) {
                    result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
                } else if (number === 2) {
                    result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
                } else if (number &lt; 5) {
                    result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
                } else {
                    result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
                }
                return result;
            case 'y':
                return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
            case 'yy':
                if (number === 1) {
                    result += withoutSuffix || isFuture ? 'leto' : 'letom';
                } else if (number === 2) {
                    result += withoutSuffix || isFuture ? 'leti' : 'letoma';
                } else if (number &lt; 5) {
                    result += withoutSuffix || isFuture ? 'leta' : 'leti';
                } else {
                    result += withoutSuffix || isFuture ? 'let' : 'leti';
                }
                return result;
        }
    }

    hooks.defineLocale('sl', {
        months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
        monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
        monthsParseExact: true,
        weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
        weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
        weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM YYYY',
            LLL : 'D. MMMM YYYY H:mm',
            LLLL : 'dddd, D. MMMM YYYY H:mm'
        },
        calendar : {
            sameDay  : '[danes ob] LT',
            nextDay  : '[jutri ob] LT',

            nextWeek : function () {
                switch (this.day()) {
                    case 0:
                        return '[v] [nedeljo] [ob] LT';
                    case 3:
                        return '[v] [sredo] [ob] LT';
                    case 6:
                        return '[v] [soboto] [ob] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[v] dddd [ob] LT';
                }
            },
            lastDay  : '[včeraj ob] LT',
            lastWeek : function () {
                switch (this.day()) {
                    case 0:
                        return '[prejšnjo] [nedeljo] [ob] LT';
                    case 3:
                        return '[prejšnjo] [sredo] [ob] LT';
                    case 6:
                        return '[prejšnjo] [soboto] [ob] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[prejšnji] dddd [ob] LT';
                }
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'čez %s',
            past   : 'pred %s',
            s      : processRelativeTime$6,
            ss     : processRelativeTime$6,
            m      : processRelativeTime$6,
            mm     : processRelativeTime$6,
            h      : processRelativeTime$6,
            hh     : processRelativeTime$6,
            d      : processRelativeTime$6,
            dd     : processRelativeTime$6,
            M      : processRelativeTime$6,
            MM     : processRelativeTime$6,
            y      : processRelativeTime$6,
            yy     : processRelativeTime$6
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('sq', {
        months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
        monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
        weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
        weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
        weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),
        weekdaysParseExact : true,
        meridiemParse: /PD|MD/,
        isPM: function (input) {
            return input.charAt(0) === 'M';
        },
        meridiem : function (hours, minutes, isLower) {
            return hours &lt; 12 ? 'PD' : 'MD';
        },
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Sot në] LT',
            nextDay : '[Nesër në] LT',
            nextWeek : 'dddd [në] LT',
            lastDay : '[Dje në] LT',
            lastWeek : 'dddd [e kaluar në] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'në %s',
            past : '%s më parë',
            s : 'disa sekonda',
            ss : '%d sekonda',
            m : 'një minutë',
            mm : '%d minuta',
            h : 'një orë',
            hh : '%d orë',
            d : 'një ditë',
            dd : '%d ditë',
            M : 'një muaj',
            MM : '%d muaj',
            y : 'një vit',
            yy : '%d vite'
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var translator$1 = {
        words: { //Different grammatical cases
            ss: ['секунда', 'секунде', 'секунди'],
            m: ['један минут', 'једне минуте'],
            mm: ['минут', 'минуте', 'минута'],
            h: ['један сат', 'једног сата'],
            hh: ['сат', 'сата', 'сати'],
            dd: ['дан', 'дана', 'дана'],
            MM: ['месец', 'месеца', 'месеци'],
            yy: ['година', 'године', 'година']
        },
        correctGrammaticalCase: function (number, wordKey) {
            return number === 1 ? wordKey[0] : (number &gt;= 2 &amp;&amp; number &lt;= 4 ? wordKey[1] : wordKey[2]);
        },
        translate: function (number, withoutSuffix, key) {
            var wordKey = translator$1.words[key];
            if (key.length === 1) {
                return withoutSuffix ? wordKey[0] : wordKey[1];
            } else {
                return number + ' ' + translator$1.correctGrammaticalCase(number, wordKey);
            }
        }
    };

    hooks.defineLocale('sr-cyrl', {
        months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),
        monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
        monthsParseExact: true,
        weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
        weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
        weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
        weekdaysParseExact : true,
        longDateFormat: {
            LT: 'H:mm',
            LTS : 'H:mm:ss',
            L: 'DD.MM.YYYY',
            LL: 'D. MMMM YYYY',
            LLL: 'D. MMMM YYYY H:mm',
            LLLL: 'dddd, D. MMMM YYYY H:mm'
        },
        calendar: {
            sameDay: '[данас у] LT',
            nextDay: '[сутра у] LT',
            nextWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[у] [недељу] [у] LT';
                    case 3:
                        return '[у] [среду] [у] LT';
                    case 6:
                        return '[у] [суботу] [у] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[у] dddd [у] LT';
                }
            },
            lastDay  : '[јуче у] LT',
            lastWeek : function () {
                var lastWeekDays = [
                    '[прошле] [недеље] [у] LT',
                    '[прошлог] [понедељка] [у] LT',
                    '[прошлог] [уторка] [у] LT',
                    '[прошле] [среде] [у] LT',
                    '[прошлог] [четвртка] [у] LT',
                    '[прошлог] [петка] [у] LT',
                    '[прошле] [суботе] [у] LT'
                ];
                return lastWeekDays[this.day()];
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'за %s',
            past   : 'пре %s',
            s      : 'неколико секунди',
            ss     : translator$1.translate,
            m      : translator$1.translate,
            mm     : translator$1.translate,
            h      : translator$1.translate,
            hh     : translator$1.translate,
            d      : 'дан',
            dd     : translator$1.translate,
            M      : 'месец',
            MM     : translator$1.translate,
            y      : 'годину',
            yy     : translator$1.translate
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var translator$2 = {
        words: { //Different grammatical cases
            ss: ['sekunda', 'sekunde', 'sekundi'],
            m: ['jedan minut', 'jedne minute'],
            mm: ['minut', 'minute', 'minuta'],
            h: ['jedan sat', 'jednog sata'],
            hh: ['sat', 'sata', 'sati'],
            dd: ['dan', 'dana', 'dana'],
            MM: ['mesec', 'meseca', 'meseci'],
            yy: ['godina', 'godine', 'godina']
        },
        correctGrammaticalCase: function (number, wordKey) {
            return number === 1 ? wordKey[0] : (number &gt;= 2 &amp;&amp; number &lt;= 4 ? wordKey[1] : wordKey[2]);
        },
        translate: function (number, withoutSuffix, key) {
            var wordKey = translator$2.words[key];
            if (key.length === 1) {
                return withoutSuffix ? wordKey[0] : wordKey[1];
            } else {
                return number + ' ' + translator$2.correctGrammaticalCase(number, wordKey);
            }
        }
    };

    hooks.defineLocale('sr', {
        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
        monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
        monthsParseExact: true,
        weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),
        weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
        weekdaysParseExact : true,
        longDateFormat: {
            LT: 'H:mm',
            LTS : 'H:mm:ss',
            L: 'DD.MM.YYYY',
            LL: 'D. MMMM YYYY',
            LLL: 'D. MMMM YYYY H:mm',
            LLLL: 'dddd, D. MMMM YYYY H:mm'
        },
        calendar: {
            sameDay: '[danas u] LT',
            nextDay: '[sutra u] LT',
            nextWeek: function () {
                switch (this.day()) {
                    case 0:
                        return '[u] [nedelju] [u] LT';
                    case 3:
                        return '[u] [sredu] [u] LT';
                    case 6:
                        return '[u] [subotu] [u] LT';
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                        return '[u] dddd [u] LT';
                }
            },
            lastDay  : '[juče u] LT',
            lastWeek : function () {
                var lastWeekDays = [
                    '[prošle] [nedelje] [u] LT',
                    '[prošlog] [ponedeljka] [u] LT',
                    '[prošlog] [utorka] [u] LT',
                    '[prošle] [srede] [u] LT',
                    '[prošlog] [četvrtka] [u] LT',
                    '[prošlog] [petka] [u] LT',
                    '[prošle] [subote] [u] LT'
                ];
                return lastWeekDays[this.day()];
            },
            sameElse : 'L'
        },
        relativeTime : {
            future : 'za %s',
            past   : 'pre %s',
            s      : 'nekoliko sekundi',
            ss     : translator$2.translate,
            m      : translator$2.translate,
            mm     : translator$2.translate,
            h      : translator$2.translate,
            hh     : translator$2.translate,
            d      : 'dan',
            dd     : translator$2.translate,
            M      : 'mesec',
            MM     : translator$2.translate,
            y      : 'godinu',
            yy     : translator$2.translate
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('ss', {
        months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
        monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
        weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
        weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
        weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY h:mm A',
            LLLL : 'dddd, D MMMM YYYY h:mm A'
        },
        calendar : {
            sameDay : '[Namuhla nga] LT',
            nextDay : '[Kusasa nga] LT',
            nextWeek : 'dddd [nga] LT',
            lastDay : '[Itolo nga] LT',
            lastWeek : 'dddd [leliphelile] [nga] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'nga %s',
            past : 'wenteka nga %s',
            s : 'emizuzwana lomcane',
            ss : '%d mzuzwana',
            m : 'umzuzu',
            mm : '%d emizuzu',
            h : 'lihora',
            hh : '%d emahora',
            d : 'lilanga',
            dd : '%d emalanga',
            M : 'inyanga',
            MM : '%d tinyanga',
            y : 'umnyaka',
            yy : '%d iminyaka'
        },
        meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 11) {
                return 'ekuseni';
            } else if (hours &lt; 15) {
                return 'emini';
            } else if (hours &lt; 19) {
                return 'entsambama';
            } else {
                return 'ebusuku';
            }
        },
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'ekuseni') {
                return hour;
            } else if (meridiem === 'emini') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
                if (hour === 0) {
                    return 0;
                }
                return hour + 12;
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}/,
        ordinal : '%d',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('sv', {
        months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
        monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
        weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
        weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
        weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY-MM-DD',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY [kl.] HH:mm',
            LLLL : 'dddd D MMMM YYYY [kl.] HH:mm',
            lll : 'D MMM YYYY HH:mm',
            llll : 'ddd D MMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[Idag] LT',
            nextDay: '[Imorgon] LT',
            lastDay: '[Igår] LT',
            nextWeek: '[På] dddd LT',
            lastWeek: '[I] dddd[s] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'om %s',
            past : 'för %s sedan',
            s : 'några sekunder',
            ss : '%d sekunder',
            m : 'en minut',
            mm : '%d minuter',
            h : 'en timme',
            hh : '%d timmar',
            d : 'en dag',
            dd : '%d dagar',
            M : 'en månad',
            MM : '%d månader',
            y : 'ett år',
            yy : '%d år'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(e|a)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'e' :
                (b === 1) ? 'a' :
                (b === 2) ? 'a' :
                (b === 3) ? 'e' : 'e';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('sw', {
        months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),
        monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
        weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),
        weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
        weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[leo saa] LT',
            nextDay : '[kesho saa] LT',
            nextWeek : '[wiki ijayo] dddd [saat] LT',
            lastDay : '[jana] LT',
            lastWeek : '[wiki iliyopita] dddd [saat] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s baadaye',
            past : 'tokea %s',
            s : 'hivi punde',
            ss : 'sekunde %d',
            m : 'dakika moja',
            mm : 'dakika %d',
            h : 'saa limoja',
            hh : 'masaa %d',
            d : 'siku moja',
            dd : 'masiku %d',
            M : 'mwezi mmoja',
            MM : 'miezi %d',
            y : 'mwaka mmoja',
            yy : 'miaka %d'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var symbolMap$e = {
        '1': '௧',
        '2': '௨',
        '3': '௩',
        '4': '௪',
        '5': '௫',
        '6': '௬',
        '7': '௭',
        '8': '௮',
        '9': '௯',
        '0': '௦'
    }, numberMap$d = {
        '௧': '1',
        '௨': '2',
        '௩': '3',
        '௪': '4',
        '௫': '5',
        '௬': '6',
        '௭': '7',
        '௮': '8',
        '௯': '9',
        '௦': '0'
    };

    hooks.defineLocale('ta', {
        months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
        monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
        weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
        weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
        weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, HH:mm',
            LLLL : 'dddd, D MMMM YYYY, HH:mm'
        },
        calendar : {
            sameDay : '[இன்று] LT',
            nextDay : '[நாளை] LT',
            nextWeek : 'dddd, LT',
            lastDay : '[நேற்று] LT',
            lastWeek : '[கடந்த வாரம்] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s இல்',
            past : '%s முன்',
            s : 'ஒரு சில விநாடிகள்',
            ss : '%d விநாடிகள்',
            m : 'ஒரு நிமிடம்',
            mm : '%d நிமிடங்கள்',
            h : 'ஒரு மணி நேரம்',
            hh : '%d மணி நேரம்',
            d : 'ஒரு நாள்',
            dd : '%d நாட்கள்',
            M : 'ஒரு மாதம்',
            MM : '%d மாதங்கள்',
            y : 'ஒரு வருடம்',
            yy : '%d ஆண்டுகள்'
        },
        dayOfMonthOrdinalParse: /\d{1,2}வது/,
        ordinal : function (number) {
            return number + 'வது';
        },
        preparse: function (string) {
            return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
                return numberMap$d[match];
            });
        },
        postformat: function (string) {
            return string.replace(/\d/g, function (match) {
                return symbolMap$e[match];
            });
        },
        // refer http://ta.wikipedia.org/s/1er1
        meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 2) {
                return ' யாமம்';
            } else if (hour &lt; 6) {
                return ' வைகறை';  // வைகறை
            } else if (hour &lt; 10) {
                return ' காலை'; // காலை
            } else if (hour &lt; 14) {
                return ' நண்பகல்'; // நண்பகல்
            } else if (hour &lt; 18) {
                return ' எற்பாடு'; // எற்பாடு
            } else if (hour &lt; 22) {
                return ' மாலை'; // மாலை
            } else {
                return ' யாமம்';
            }
        },
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'யாமம்') {
                return hour &lt; 2 ? hour : hour + 12;
            } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
                return hour;
            } else if (meridiem === 'நண்பகல்') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else {
                return hour + 12;
            }
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('te', {
        months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),
        monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
        monthsParseExact : true,
        weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),
        weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
        weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
        longDateFormat : {
            LT : 'A h:mm',
            LTS : 'A h:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY, A h:mm',
            LLLL : 'dddd, D MMMM YYYY, A h:mm'
        },
        calendar : {
            sameDay : '[నేడు] LT',
            nextDay : '[రేపు] LT',
            nextWeek : 'dddd, LT',
            lastDay : '[నిన్న] LT',
            lastWeek : '[గత] dddd, LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s లో',
            past : '%s క్రితం',
            s : 'కొన్ని క్షణాలు',
            ss : '%d సెకన్లు',
            m : 'ఒక నిమిషం',
            mm : '%d నిమిషాలు',
            h : 'ఒక గంట',
            hh : '%d గంటలు',
            d : 'ఒక రోజు',
            dd : '%d రోజులు',
            M : 'ఒక నెల',
            MM : '%d నెలలు',
            y : 'ఒక సంవత్సరం',
            yy : '%d సంవత్సరాలు'
        },
        dayOfMonthOrdinalParse : /\d{1,2}వ/,
        ordinal : '%dవ',
        meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'రాత్రి') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'ఉదయం') {
                return hour;
            } else if (meridiem === 'మధ్యాహ్నం') {
                return hour &gt;= 10 ? hour : hour + 12;
            } else if (meridiem === 'సాయంత్రం') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'రాత్రి';
            } else if (hour &lt; 10) {
                return 'ఉదయం';
            } else if (hour &lt; 17) {
                return 'మధ్యాహ్నం';
            } else if (hour &lt; 20) {
                return 'సాయంత్రం';
            } else {
                return 'రాత్రి';
            }
        },
        week : {
            dow : 0, // Sunday is the first day of the week.
            doy : 6  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('tet', {
        months : 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split('_'),
        monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
        weekdays : 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
        weekdaysShort : 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
        weekdaysMin : 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[Ohin iha] LT',
            nextDay: '[Aban iha] LT',
            nextWeek: 'dddd [iha] LT',
            lastDay: '[Horiseik iha] LT',
            lastWeek: 'dddd [semana kotuk] [iha] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'iha %s',
            past : '%s liuba',
            s : 'minutu balun',
            ss : 'minutu %d',
            m : 'minutu ida',
            mm : 'minutu %d',
            h : 'oras ida',
            hh : 'oras %d',
            d : 'loron ida',
            dd : 'loron %d',
            M : 'fulan ida',
            MM : 'fulan %d',
            y : 'tinan ida',
            yy : 'tinan %d'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var suffixes$3 = {
        0: '-ум',
        1: '-ум',
        2: '-юм',
        3: '-юм',
        4: '-ум',
        5: '-ум',
        6: '-ум',
        7: '-ум',
        8: '-ум',
        9: '-ум',
        10: '-ум',
        12: '-ум',
        13: '-ум',
        20: '-ум',
        30: '-юм',
        40: '-ум',
        50: '-ум',
        60: '-ум',
        70: '-ум',
        80: '-ум',
        90: '-ум',
        100: '-ум'
    };

    hooks.defineLocale('tg', {
        months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
        monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
        weekdays : 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split('_'),
        weekdaysShort : 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
        weekdaysMin : 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Имрӯз соати] LT',
            nextDay : '[Пагоҳ соати] LT',
            lastDay : '[Дирӯз соати] LT',
            nextWeek : 'dddd[и] [ҳафтаи оянда соати] LT',
            lastWeek : 'dddd[и] [ҳафтаи гузашта соати] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'баъди %s',
            past : '%s пеш',
            s : 'якчанд сония',
            m : 'як дақиқа',
            mm : '%d дақиқа',
            h : 'як соат',
            hh : '%d соат',
            d : 'як рӯз',
            dd : '%d рӯз',
            M : 'як моҳ',
            MM : '%d моҳ',
            y : 'як сол',
            yy : '%d сол'
        },
        meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,
        meridiemHour: function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'шаб') {
                return hour &lt; 4 ? hour : hour + 12;
            } else if (meridiem === 'субҳ') {
                return hour;
            } else if (meridiem === 'рӯз') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === 'бегоҳ') {
                return hour + 12;
            }
        },
        meridiem: function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'шаб';
            } else if (hour &lt; 11) {
                return 'субҳ';
            } else if (hour &lt; 16) {
                return 'рӯз';
            } else if (hour &lt; 19) {
                return 'бегоҳ';
            } else {
                return 'шаб';
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/,
        ordinal: function (number) {
            var a = number % 10,
                b = number &gt;= 100 ? 100 : null;
            return number + (suffixes$3[number] || suffixes$3[a] || suffixes$3[b]);
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('th', {
        months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
        monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
        monthsParseExact: true,
        weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
        weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
        weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'H:mm',
            LTS : 'H:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY เวลา H:mm',
            LLLL : 'วันddddที่ D MMMM YYYY เวลา H:mm'
        },
        meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
        isPM: function (input) {
            return input === 'หลังเที่ยง';
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'ก่อนเที่ยง';
            } else {
                return 'หลังเที่ยง';
            }
        },
        calendar : {
            sameDay : '[วันนี้ เวลา] LT',
            nextDay : '[พรุ่งนี้ เวลา] LT',
            nextWeek : 'dddd[หน้า เวลา] LT',
            lastDay : '[เมื่อวานนี้ เวลา] LT',
            lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'อีก %s',
            past : '%sที่แล้ว',
            s : 'ไม่กี่วินาที',
            ss : '%d วินาที',
            m : '1 นาที',
            mm : '%d นาที',
            h : '1 ชั่วโมง',
            hh : '%d ชั่วโมง',
            d : '1 วัน',
            dd : '%d วัน',
            M : '1 เดือน',
            MM : '%d เดือน',
            y : '1 ปี',
            yy : '%d ปี'
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('tl-ph', {
        months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
        monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
        weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
        weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
        weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'MM/D/YYYY',
            LL : 'MMMM D, YYYY',
            LLL : 'MMMM D, YYYY HH:mm',
            LLLL : 'dddd, MMMM DD, YYYY HH:mm'
        },
        calendar : {
            sameDay: 'LT [ngayong araw]',
            nextDay: '[Bukas ng] LT',
            nextWeek: 'LT [sa susunod na] dddd',
            lastDay: 'LT [kahapon]',
            lastWeek: 'LT [noong nakaraang] dddd',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'sa loob ng %s',
            past : '%s ang nakalipas',
            s : 'ilang segundo',
            ss : '%d segundo',
            m : 'isang minuto',
            mm : '%d minuto',
            h : 'isang oras',
            hh : '%d oras',
            d : 'isang araw',
            dd : '%d araw',
            M : 'isang buwan',
            MM : '%d buwan',
            y : 'isang taon',
            yy : '%d taon'
        },
        dayOfMonthOrdinalParse: /\d{1,2}/,
        ordinal : function (number) {
            return number;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');

    function translateFuture(output) {
        var time = output;
        time = (output.indexOf('jaj') !== -1) ?
        time.slice(0, -3) + 'leS' :
        (output.indexOf('jar') !== -1) ?
        time.slice(0, -3) + 'waQ' :
        (output.indexOf('DIS') !== -1) ?
        time.slice(0, -3) + 'nem' :
        time + ' pIq';
        return time;
    }

    function translatePast(output) {
        var time = output;
        time = (output.indexOf('jaj') !== -1) ?
        time.slice(0, -3) + 'Hu’' :
        (output.indexOf('jar') !== -1) ?
        time.slice(0, -3) + 'wen' :
        (output.indexOf('DIS') !== -1) ?
        time.slice(0, -3) + 'ben' :
        time + ' ret';
        return time;
    }

    function translate$a(number, withoutSuffix, string, isFuture) {
        var numberNoun = numberAsNoun(number);
        switch (string) {
            case 'ss':
                return numberNoun + ' lup';
            case 'mm':
                return numberNoun + ' tup';
            case 'hh':
                return numberNoun + ' rep';
            case 'dd':
                return numberNoun + ' jaj';
            case 'MM':
                return numberNoun + ' jar';
            case 'yy':
                return numberNoun + ' DIS';
        }
    }

    function numberAsNoun(number) {
        var hundred = Math.floor((number % 1000) / 100),
        ten = Math.floor((number % 100) / 10),
        one = number % 10,
        word = '';
        if (hundred &gt; 0) {
            word += numbersNouns[hundred] + 'vatlh';
        }
        if (ten &gt; 0) {
            word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH';
        }
        if (one &gt; 0) {
            word += ((word !== '') ? ' ' : '') + numbersNouns[one];
        }
        return (word === '') ? 'pagh' : word;
    }

    hooks.defineLocale('tlh', {
        months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
        monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
        monthsParseExact : true,
        weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
        weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
        weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[DaHjaj] LT',
            nextDay: '[wa’leS] LT',
            nextWeek: 'LLL',
            lastDay: '[wa’Hu’] LT',
            lastWeek: 'LLL',
            sameElse: 'L'
        },
        relativeTime : {
            future : translateFuture,
            past : translatePast,
            s : 'puS lup',
            ss : translate$a,
            m : 'wa’ tup',
            mm : translate$a,
            h : 'wa’ rep',
            hh : translate$a,
            d : 'wa’ jaj',
            dd : translate$a,
            M : 'wa’ jar',
            MM : translate$a,
            y : 'wa’ DIS',
            yy : translate$a
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    var suffixes$4 = {
        1: '\'inci',
        5: '\'inci',
        8: '\'inci',
        70: '\'inci',
        80: '\'inci',
        2: '\'nci',
        7: '\'nci',
        20: '\'nci',
        50: '\'nci',
        3: '\'üncü',
        4: '\'üncü',
        100: '\'üncü',
        6: '\'ncı',
        9: '\'uncu',
        10: '\'uncu',
        30: '\'uncu',
        60: '\'ıncı',
        90: '\'ıncı'
    };

    hooks.defineLocale('tr', {
        months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
        monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
        weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
        weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
        weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[bugün saat] LT',
            nextDay : '[yarın saat] LT',
            nextWeek : '[gelecek] dddd [saat] LT',
            lastDay : '[dün] LT',
            lastWeek : '[geçen] dddd [saat] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s sonra',
            past : '%s önce',
            s : 'birkaç saniye',
            ss : '%d saniye',
            m : 'bir dakika',
            mm : '%d dakika',
            h : 'bir saat',
            hh : '%d saat',
            d : 'bir gün',
            dd : '%d gün',
            M : 'bir ay',
            MM : '%d ay',
            y : 'bir yıl',
            yy : '%d yıl'
        },
        ordinal: function (number, period) {
            switch (period) {
                case 'd':
                case 'D':
                case 'Do':
                case 'DD':
                    return number;
                default:
                    if (number === 0) {  // special case for zero
                        return number + '\'ıncı';
                    }
                    var a = number % 10,
                        b = number % 100 - a,
                        c = number &gt;= 100 ? 100 : null;
                    return number + (suffixes$4[a] || suffixes$4[b] || suffixes$4[c]);
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
    // This is currently too difficult (maybe even impossible) to add.
    hooks.defineLocale('tzl', {
        months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
        monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
        weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
        weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
        weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
        longDateFormat : {
            LT : 'HH.mm',
            LTS : 'HH.mm.ss',
            L : 'DD.MM.YYYY',
            LL : 'D. MMMM [dallas] YYYY',
            LLL : 'D. MMMM [dallas] YYYY HH.mm',
            LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
        },
        meridiemParse: /d\'o|d\'a/i,
        isPM : function (input) {
            return 'd\'o' === input.toLowerCase();
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &gt; 11) {
                return isLower ? 'd\'o' : 'D\'O';
            } else {
                return isLower ? 'd\'a' : 'D\'A';
            }
        },
        calendar : {
            sameDay : '[oxhi à] LT',
            nextDay : '[demà à] LT',
            nextWeek : 'dddd [à] LT',
            lastDay : '[ieiri à] LT',
            lastWeek : '[sür el] dddd [lasteu à] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'osprei %s',
            past : 'ja%s',
            s : processRelativeTime$7,
            ss : processRelativeTime$7,
            m : processRelativeTime$7,
            mm : processRelativeTime$7,
            h : processRelativeTime$7,
            hh : processRelativeTime$7,
            d : processRelativeTime$7,
            dd : processRelativeTime$7,
            M : processRelativeTime$7,
            MM : processRelativeTime$7,
            y : processRelativeTime$7,
            yy : processRelativeTime$7
        },
        dayOfMonthOrdinalParse: /\d{1,2}\./,
        ordinal : '%d.',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    function processRelativeTime$7(number, withoutSuffix, key, isFuture) {
        var format = {
            's': ['viensas secunds', '\'iensas secunds'],
            'ss': [number + ' secunds', '' + number + ' secunds'],
            'm': ['\'n míut', '\'iens míut'],
            'mm': [number + ' míuts', '' + number + ' míuts'],
            'h': ['\'n þora', '\'iensa þora'],
            'hh': [number + ' þoras', '' + number + ' þoras'],
            'd': ['\'n ziua', '\'iensa ziua'],
            'dd': [number + ' ziuas', '' + number + ' ziuas'],
            'M': ['\'n mes', '\'iens mes'],
            'MM': [number + ' mesen', '' + number + ' mesen'],
            'y': ['\'n ar', '\'iens ar'],
            'yy': [number + ' ars', '' + number + ' ars']
        };
        return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]);
    }

    //! moment.js locale configuration

    hooks.defineLocale('tzm-latn', {
        months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
        monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
        weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
        weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
        weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[asdkh g] LT',
            nextDay: '[aska g] LT',
            nextWeek: 'dddd [g] LT',
            lastDay: '[assant g] LT',
            lastWeek: 'dddd [g] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'dadkh s yan %s',
            past : 'yan %s',
            s : 'imik',
            ss : '%d imik',
            m : 'minuḍ',
            mm : '%d minuḍ',
            h : 'saɛa',
            hh : '%d tassaɛin',
            d : 'ass',
            dd : '%d ossan',
            M : 'ayowr',
            MM : '%d iyyirn',
            y : 'asgas',
            yy : '%d isgasn'
        },
        week : {
            dow : 6, // Saturday is the first day of the week.
            doy : 12  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('tzm', {
        months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
        monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
        weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
        weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
        weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS: 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
            nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
            nextWeek: 'dddd [ⴴ] LT',
            lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
            lastWeek: 'dddd [ⴴ] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
            past : 'ⵢⴰⵏ %s',
            s : 'ⵉⵎⵉⴽ',
            ss : '%d ⵉⵎⵉⴽ',
            m : 'ⵎⵉⵏⵓⴺ',
            mm : '%d ⵎⵉⵏⵓⴺ',
            h : 'ⵙⴰⵄⴰ',
            hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
            d : 'ⴰⵙⵙ',
            dd : '%d oⵙⵙⴰⵏ',
            M : 'ⴰⵢoⵓⵔ',
            MM : '%d ⵉⵢⵢⵉⵔⵏ',
            y : 'ⴰⵙⴳⴰⵙ',
            yy : '%d ⵉⵙⴳⴰⵙⵏ'
        },
        week : {
            dow : 6, // Saturday is the first day of the week.
            doy : 12  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js language configuration

    hooks.defineLocale('ug-cn', {
        months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
            '_'
        ),
        monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
            '_'
        ),
        weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(
            '_'
        ),
        weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
        weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
        longDateFormat: {
            LT: 'HH:mm',
            LTS: 'HH:mm:ss',
            L: 'YYYY-MM-DD',
            LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
            LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
            LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm'
        },
        meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,
        meridiemHour: function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (
                meridiem === 'يېرىم كېچە' ||
                meridiem === 'سەھەر' ||
                meridiem === 'چۈشتىن بۇرۇن'
            ) {
                return hour;
            } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {
                return hour + 12;
            } else {
                return hour &gt;= 11 ? hour : hour + 12;
            }
        },
        meridiem: function (hour, minute, isLower) {
            var hm = hour * 100 + minute;
            if (hm &lt; 600) {
                return 'يېرىم كېچە';
            } else if (hm &lt; 900) {
                return 'سەھەر';
            } else if (hm &lt; 1130) {
                return 'چۈشتىن بۇرۇن';
            } else if (hm &lt; 1230) {
                return 'چۈش';
            } else if (hm &lt; 1800) {
                return 'چۈشتىن كېيىن';
            } else {
                return 'كەچ';
            }
        },
        calendar: {
            sameDay: '[بۈگۈن سائەت] LT',
            nextDay: '[ئەتە سائەت] LT',
            nextWeek: '[كېلەركى] dddd [سائەت] LT',
            lastDay: '[تۆنۈگۈن] LT',
            lastWeek: '[ئالدىنقى] dddd [سائەت] LT',
            sameElse: 'L'
        },
        relativeTime: {
            future: '%s كېيىن',
            past: '%s بۇرۇن',
            s: 'نەچچە سېكونت',
            ss: '%d سېكونت',
            m: 'بىر مىنۇت',
            mm: '%d مىنۇت',
            h: 'بىر سائەت',
            hh: '%d سائەت',
            d: 'بىر كۈن',
            dd: '%d كۈن',
            M: 'بىر ئاي',
            MM: '%d ئاي',
            y: 'بىر يىل',
            yy: '%d يىل'
        },

        dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,
        ordinal: function (number, period) {
            switch (period) {
                case 'd':
                case 'D':
                case 'DDD':
                    return number + '-كۈنى';
                case 'w':
                case 'W':
                    return number + '-ھەپتە';
                default:
                    return number;
            }
        },
        preparse: function (string) {
            return string.replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/,/g, '،');
        },
        week: {
            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
            dow: 1, // Monday is the first day of the week.
            doy: 7 // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    function plural$6(word, num) {
        var forms = word.split('_');
        return num % 10 === 1 &amp;&amp; num % 100 !== 11 ? forms[0] : (num % 10 &gt;= 2 &amp;&amp; num % 10 &lt;= 4 &amp;&amp; (num % 100 &lt; 10 || num % 100 &gt;= 20) ? forms[1] : forms[2]);
    }
    function relativeTimeWithPlural$4(number, withoutSuffix, key) {
        var format = {
            'ss': withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
            'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
            'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
            'dd': 'день_дні_днів',
            'MM': 'місяць_місяці_місяців',
            'yy': 'рік_роки_років'
        };
        if (key === 'm') {
            return withoutSuffix ? 'хвилина' : 'хвилину';
        }
        else if (key === 'h') {
            return withoutSuffix ? 'година' : 'годину';
        }
        else {
            return number + ' ' + plural$6(format[key], +number);
        }
    }
    function weekdaysCaseReplace(m, format) {
        var weekdays = {
            'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
            'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
            'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
        };

        if (!m) {
            return weekdays['nominative'];
        }

        var nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
            'accusative' :
            ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
                'genitive' :
                'nominative');
        return weekdays[nounCase][m.day()];
    }
    function processHoursFunction(str) {
        return function () {
            return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
        };
    }

    hooks.defineLocale('uk', {
        months : {
            'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
            'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
        },
        monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
        weekdays : weekdaysCaseReplace,
        weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
        weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD.MM.YYYY',
            LL : 'D MMMM YYYY р.',
            LLL : 'D MMMM YYYY р., HH:mm',
            LLLL : 'dddd, D MMMM YYYY р., HH:mm'
        },
        calendar : {
            sameDay: processHoursFunction('[Сьогодні '),
            nextDay: processHoursFunction('[Завтра '),
            lastDay: processHoursFunction('[Вчора '),
            nextWeek: processHoursFunction('[У] dddd ['),
            lastWeek: function () {
                switch (this.day()) {
                    case 0:
                    case 3:
                    case 5:
                    case 6:
                        return processHoursFunction('[Минулої] dddd [').call(this);
                    case 1:
                    case 2:
                    case 4:
                        return processHoursFunction('[Минулого] dddd [').call(this);
                }
            },
            sameElse: 'L'
        },
        relativeTime : {
            future : 'за %s',
            past : '%s тому',
            s : 'декілька секунд',
            ss : relativeTimeWithPlural$4,
            m : relativeTimeWithPlural$4,
            mm : relativeTimeWithPlural$4,
            h : 'годину',
            hh : relativeTimeWithPlural$4,
            d : 'день',
            dd : relativeTimeWithPlural$4,
            M : 'місяць',
            MM : relativeTimeWithPlural$4,
            y : 'рік',
            yy : relativeTimeWithPlural$4
        },
        // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
        meridiemParse: /ночі|ранку|дня|вечора/,
        isPM: function (input) {
            return /^(дня|вечора)$/.test(input);
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 4) {
                return 'ночі';
            } else if (hour &lt; 12) {
                return 'ранку';
            } else if (hour &lt; 17) {
                return 'дня';
            } else {
                return 'вечора';
            }
        },
        dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
        ordinal: function (number, period) {
            switch (period) {
                case 'M':
                case 'd':
                case 'DDD':
                case 'w':
                case 'W':
                    return number + '-й';
                case 'D':
                    return number + '-го';
                default:
                    return number;
            }
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    var months$8 = [
        'جنوری',
        'فروری',
        'مارچ',
        'اپریل',
        'مئی',
        'جون',
        'جولائی',
        'اگست',
        'ستمبر',
        'اکتوبر',
        'نومبر',
        'دسمبر'
    ];
    var days$2 = [
        'اتوار',
        'پیر',
        'منگل',
        'بدھ',
        'جمعرات',
        'جمعہ',
        'ہفتہ'
    ];

    hooks.defineLocale('ur', {
        months : months$8,
        monthsShort : months$8,
        weekdays : days$2,
        weekdaysShort : days$2,
        weekdaysMin : days$2,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd، D MMMM YYYY HH:mm'
        },
        meridiemParse: /صبح|شام/,
        isPM : function (input) {
            return 'شام' === input;
        },
        meridiem : function (hour, minute, isLower) {
            if (hour &lt; 12) {
                return 'صبح';
            }
            return 'شام';
        },
        calendar : {
            sameDay : '[آج بوقت] LT',
            nextDay : '[کل بوقت] LT',
            nextWeek : 'dddd [بوقت] LT',
            lastDay : '[گذشتہ روز بوقت] LT',
            lastWeek : '[گذشتہ] dddd [بوقت] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : '%s بعد',
            past : '%s قبل',
            s : 'چند سیکنڈ',
            ss : '%d سیکنڈ',
            m : 'ایک منٹ',
            mm : '%d منٹ',
            h : 'ایک گھنٹہ',
            hh : '%d گھنٹے',
            d : 'ایک دن',
            dd : '%d دن',
            M : 'ایک ماہ',
            MM : '%d ماہ',
            y : 'ایک سال',
            yy : '%d سال'
        },
        preparse: function (string) {
            return string.replace(/،/g, ',');
        },
        postformat: function (string) {
            return string.replace(/,/g, '،');
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('uz-latn', {
        months : 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split('_'),
        monthsShort : 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
        weekdays : 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split('_'),
        weekdaysShort : 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
        weekdaysMin : 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'D MMMM YYYY, dddd HH:mm'
        },
        calendar : {
            sameDay : '[Bugun soat] LT [da]',
            nextDay : '[Ertaga] LT [da]',
            nextWeek : 'dddd [kuni soat] LT [da]',
            lastDay : '[Kecha soat] LT [da]',
            lastWeek : '[O\'tgan] dddd [kuni soat] LT [da]',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'Yaqin %s ichida',
            past : 'Bir necha %s oldin',
            s : 'soniya',
            ss : '%d soniya',
            m : 'bir daqiqa',
            mm : '%d daqiqa',
            h : 'bir soat',
            hh : '%d soat',
            d : 'bir kun',
            dd : '%d kun',
            M : 'bir oy',
            MM : '%d oy',
            y : 'bir yil',
            yy : '%d yil'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 1st is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('uz', {
        months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
        monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
        weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
        weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
        weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'D MMMM YYYY, dddd HH:mm'
        },
        calendar : {
            sameDay : '[Бугун соат] LT [да]',
            nextDay : '[Эртага] LT [да]',
            nextWeek : 'dddd [куни соат] LT [да]',
            lastDay : '[Кеча соат] LT [да]',
            lastWeek : '[Утган] dddd [куни соат] LT [да]',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'Якин %s ичида',
            past : 'Бир неча %s олдин',
            s : 'фурсат',
            ss : '%d фурсат',
            m : 'бир дакика',
            mm : '%d дакика',
            h : 'бир соат',
            hh : '%d соат',
            d : 'бир кун',
            dd : '%d кун',
            M : 'бир ой',
            MM : '%d ой',
            y : 'бир йил',
            yy : '%d йил'
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 7  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('vi', {
        months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
        monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
        monthsParseExact : true,
        weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
        weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
        weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
        weekdaysParseExact : true,
        meridiemParse: /sa|ch/i,
        isPM : function (input) {
            return /^ch$/i.test(input);
        },
        meridiem : function (hours, minutes, isLower) {
            if (hours &lt; 12) {
                return isLower ? 'sa' : 'SA';
            } else {
                return isLower ? 'ch' : 'CH';
            }
        },
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM [năm] YYYY',
            LLL : 'D MMMM [năm] YYYY HH:mm',
            LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',
            l : 'DD/M/YYYY',
            ll : 'D MMM YYYY',
            lll : 'D MMM YYYY HH:mm',
            llll : 'ddd, D MMM YYYY HH:mm'
        },
        calendar : {
            sameDay: '[Hôm nay lúc] LT',
            nextDay: '[Ngày mai lúc] LT',
            nextWeek: 'dddd [tuần tới lúc] LT',
            lastDay: '[Hôm qua lúc] LT',
            lastWeek: 'dddd [tuần rồi lúc] LT',
            sameElse: 'L'
        },
        relativeTime : {
            future : '%s tới',
            past : '%s trước',
            s : 'vài giây',
            ss : '%d giây' ,
            m : 'một phút',
            mm : '%d phút',
            h : 'một giờ',
            hh : '%d giờ',
            d : 'một ngày',
            dd : '%d ngày',
            M : 'một tháng',
            MM : '%d tháng',
            y : 'một năm',
            yy : '%d năm'
        },
        dayOfMonthOrdinalParse: /\d{1,2}/,
        ordinal : function (number) {
            return number;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('x-pseudo', {
        months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),
        monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
        monthsParseExact : true,
        weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),
        weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
        weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd, D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[T~ódá~ý át] LT',
            nextDay : '[T~ómó~rró~w át] LT',
            nextWeek : 'dddd [át] LT',
            lastDay : '[Ý~ést~érdá~ý át] LT',
            lastWeek : '[L~ást] dddd [át] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'í~ñ %s',
            past : '%s á~gó',
            s : 'á ~féw ~sécó~ñds',
            ss : '%d s~écóñ~ds',
            m : 'á ~míñ~úté',
            mm : '%d m~íñú~tés',
            h : 'á~ñ hó~úr',
            hh : '%d h~óúrs',
            d : 'á ~dáý',
            dd : '%d d~áýs',
            M : 'á ~móñ~th',
            MM : '%d m~óñt~hs',
            y : 'á ~ýéár',
            yy : '%d ý~éárs'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
        ordinal : function (number) {
            var b = number % 10,
                output = (~~(number % 100 / 10) === 1) ? 'th' :
                (b === 1) ? 'st' :
                (b === 2) ? 'nd' :
                (b === 3) ? 'rd' : 'th';
            return number + output;
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('yo', {
        months : 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'),
        monthsShort : 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
        weekdays : 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
        weekdaysShort : 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
        weekdaysMin : 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
        longDateFormat : {
            LT : 'h:mm A',
            LTS : 'h:mm:ss A',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY h:mm A',
            LLLL : 'dddd, D MMMM YYYY h:mm A'
        },
        calendar : {
            sameDay : '[Ònì ni] LT',
            nextDay : '[Ọ̀la ni] LT',
            nextWeek : 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT',
            lastDay : '[Àna ni] LT',
            lastWeek : 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'ní %s',
            past : '%s kọjá',
            s : 'ìsẹjú aayá die',
            ss :'aayá %d',
            m : 'ìsẹjú kan',
            mm : 'ìsẹjú %d',
            h : 'wákati kan',
            hh : 'wákati %d',
            d : 'ọjọ́ kan',
            dd : 'ọjọ́ %d',
            M : 'osù kan',
            MM : 'osù %d',
            y : 'ọdún kan',
            yy : 'ọdún %d'
        },
        dayOfMonthOrdinalParse : /ọjọ́\s\d{1,2}/,
        ordinal : 'ọjọ́ %d',
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4 // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('zh-cn', {
        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
        weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY/MM/DD',
            LL : 'YYYY年M月D日',
            LLL : 'YYYY年M月D日Ah点mm分',
            LLLL : 'YYYY年M月D日ddddAh点mm分',
            l : 'YYYY/M/D',
            ll : 'YYYY年M月D日',
            lll : 'YYYY年M月D日 HH:mm',
            llll : 'YYYY年M月D日dddd HH:mm'
        },
        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
        meridiemHour: function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === '凌晨' || meridiem === '早上' ||
                    meridiem === '上午') {
                return hour;
            } else if (meridiem === '下午' || meridiem === '晚上') {
                return hour + 12;
            } else {
                // '中午'
                return hour &gt;= 11 ? hour : hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            var hm = hour * 100 + minute;
            if (hm &lt; 600) {
                return '凌晨';
            } else if (hm &lt; 900) {
                return '早上';
            } else if (hm &lt; 1130) {
                return '上午';
            } else if (hm &lt; 1230) {
                return '中午';
            } else if (hm &lt; 1800) {
                return '下午';
            } else {
                return '晚上';
            }
        },
        calendar : {
            sameDay : '[今天]LT',
            nextDay : '[明天]LT',
            nextWeek : '[下]ddddLT',
            lastDay : '[昨天]LT',
            lastWeek : '[上]ddddLT',
            sameElse : 'L'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
        ordinal : function (number, period) {
            switch (period) {
                case 'd':
                case 'D':
                case 'DDD':
                    return number + '日';
                case 'M':
                    return number + '月';
                case 'w':
                case 'W':
                    return number + '周';
                default:
                    return number;
            }
        },
        relativeTime : {
            future : '%s内',
            past : '%s前',
            s : '几秒',
            ss : '%d 秒',
            m : '1 分钟',
            mm : '%d 分钟',
            h : '1 小时',
            hh : '%d 小时',
            d : '1 天',
            dd : '%d 天',
            M : '1 个月',
            MM : '%d 个月',
            y : '1 年',
            yy : '%d 年'
        },
        week : {
            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
            dow : 1, // Monday is the first day of the week.
            doy : 4  // The week that contains Jan 4th is the first week of the year.
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('zh-hk', {
        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
        weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY/MM/DD',
            LL : 'YYYY年M月D日',
            LLL : 'YYYY年M月D日 HH:mm',
            LLLL : 'YYYY年M月D日dddd HH:mm',
            l : 'YYYY/M/D',
            ll : 'YYYY年M月D日',
            lll : 'YYYY年M月D日 HH:mm',
            llll : 'YYYY年M月D日dddd HH:mm'
        },
        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
                return hour;
            } else if (meridiem === '中午') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === '下午' || meridiem === '晚上') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            var hm = hour * 100 + minute;
            if (hm &lt; 600) {
                return '凌晨';
            } else if (hm &lt; 900) {
                return '早上';
            } else if (hm &lt; 1130) {
                return '上午';
            } else if (hm &lt; 1230) {
                return '中午';
            } else if (hm &lt; 1800) {
                return '下午';
            } else {
                return '晚上';
            }
        },
        calendar : {
            sameDay : '[今天]LT',
            nextDay : '[明天]LT',
            nextWeek : '[下]ddddLT',
            lastDay : '[昨天]LT',
            lastWeek : '[上]ddddLT',
            sameElse : 'L'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
        ordinal : function (number, period) {
            switch (period) {
                case 'd' :
                case 'D' :
                case 'DDD' :
                    return number + '日';
                case 'M' :
                    return number + '月';
                case 'w' :
                case 'W' :
                    return number + '週';
                default :
                    return number;
            }
        },
        relativeTime : {
            future : '%s內',
            past : '%s前',
            s : '幾秒',
            ss : '%d 秒',
            m : '1 分鐘',
            mm : '%d 分鐘',
            h : '1 小時',
            hh : '%d 小時',
            d : '1 天',
            dd : '%d 天',
            M : '1 個月',
            MM : '%d 個月',
            y : '1 年',
            yy : '%d 年'
        }
    });

    //! moment.js locale configuration

    hooks.defineLocale('zh-tw', {
        months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
        monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
        weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
        weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
        weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'YYYY/MM/DD',
            LL : 'YYYY年M月D日',
            LLL : 'YYYY年M月D日 HH:mm',
            LLLL : 'YYYY年M月D日dddd HH:mm',
            l : 'YYYY/M/D',
            ll : 'YYYY年M月D日',
            lll : 'YYYY年M月D日 HH:mm',
            llll : 'YYYY年M月D日dddd HH:mm'
        },
        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
                return hour;
            } else if (meridiem === '中午') {
                return hour &gt;= 11 ? hour : hour + 12;
            } else if (meridiem === '下午' || meridiem === '晚上') {
                return hour + 12;
            }
        },
        meridiem : function (hour, minute, isLower) {
            var hm = hour * 100 + minute;
            if (hm &lt; 600) {
                return '凌晨';
            } else if (hm &lt; 900) {
                return '早上';
            } else if (hm &lt; 1130) {
                return '上午';
            } else if (hm &lt; 1230) {
                return '中午';
            } else if (hm &lt; 1800) {
                return '下午';
            } else {
                return '晚上';
            }
        },
        calendar : {
            sameDay : '[今天] LT',
            nextDay : '[明天] LT',
            nextWeek : '[下]dddd LT',
            lastDay : '[昨天] LT',
            lastWeek : '[上]dddd LT',
            sameElse : 'L'
        },
        dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
        ordinal : function (number, period) {
            switch (period) {
                case 'd' :
                case 'D' :
                case 'DDD' :
                    return number + '日';
                case 'M' :
                    return number + '月';
                case 'w' :
                case 'W' :
                    return number + '週';
                default :
                    return number;
            }
        },
        relativeTime : {
            future : '%s內',
            past : '%s前',
            s : '幾秒',
            ss : '%d 秒',
            m : '1 分鐘',
            mm : '%d 分鐘',
            h : '1 小時',
            hh : '%d 小時',
            d : '1 天',
            dd : '%d 天',
            M : '1 個月',
            MM : '%d 個月',
            y : '1 年',
            yy : '%d 年'
        }
    });

    hooks.locale('en');

    return hooks;

})));

"use strict";

/**
 * Copyright Marc J. Schmidt. See the LICENSE file at the top-level
 * directory of this distribution and at
 * https://github.com/marcj/css-element-queries/blob/master/LICENSE.
 */
(function(root, factory) {
  if (typeof define === "function" &amp;&amp; define.amd) {
    define(factory);
  } else if (typeof exports === "object") {
    module.exports = factory();
  } else {
    root.ResizeSensor = factory();
  }
})(typeof window !== "undefined" ? window : this, function() {
  // Make sure it does not throw in a SSR (Server Side Rendering) situation
  if (typeof window === "undefined") {
    return null;
  }
  // Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor.
  // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
  // would generate too many unnecessary events.
  var requestAnimationFrame =
    window.requestAnimationFrame ||
    window.mozRequestAnimationFrame ||
    window.webkitRequestAnimationFrame ||
    function(fn) {
      return window.setTimeout(fn, 20);
    };

  /**
   * Iterate over each of the provided element(s).
   *
   * @param {HTMLElement|HTMLElement[]} elements
   * @param {Function}                  callback
   */
  function forEachElement(elements, callback) {
    var elementsType = Object.prototype.toString.call(elements);
    var isCollectionTyped =
      elementsType === "[object Array]" ||
      elementsType === "[object NodeList]" ||
      elementsType === "[object HTMLCollection]" ||
      elementsType === "[object Object]" ||
      (typeof jQuery !== "undefined" &amp;&amp; elements instanceof jQuery) || // jquery
      (typeof Elements !== "undefined" &amp;&amp; elements instanceof Elements); // mootools
    var i = 0;
    var j = elements.length;
    if (isCollectionTyped) {
      for (; i &lt; j; i++) {
        callback(elements[i]);
      }
    } else {
      callback(elements);
    }
  }

  /**
   * Get element size
   * @param {HTMLElement} element
   * @returns {Object} {width, height}
   */
  function getElementSize(element) {
    if (!element.getBoundingClientRect) {
      return {
        width: element.offsetWidth,
        height: element.offsetHeight
      };
    }

    var rect = element.getBoundingClientRect();
    return {
      width: Math.round(rect.width),
      height: Math.round(rect.height)
    };
  }

  /**
   * Class for dimension change detection.
   *
   * @param {Element|Element[]|Elements|jQuery} element
   * @param {Function} callback
   *
   * @constructor
   */
  var ResizeSensor = function(element, callback) {
    /**
     *
     * @constructor
     */
    function EventQueue() {
      var q = [];
      this.add = function(ev) {
        q.push(ev);
      };

      var i;
      var j;
      this.call = function() {
        for (i = 0, j = q.length; i &lt; j; i++) {
          q[i].call();
        }
      };

      this.remove = function(ev) {
        var newQueue = [];
        for (i = 0, j = q.length; i &lt; j; i++) {
          if (q[i] !== ev) newQueue.push(q[i]);
        }
        q = newQueue;
      };

      this.length = function() {
        return q.length;
      };
    }

    /**
     *
     * @param {HTMLElement} element
     * @param {Function}    resized
     */
    function attachResizeEvent(element, resized) {
      if (!element) return;
      if (element.resizedAttached) {
        element.resizedAttached.add(resized);
        return;
      }

      element.resizedAttached = new EventQueue();
      element.resizedAttached.add(resized);

      element.resizeSensor = document.createElement("div");
      element.resizeSensor.dir = "ltr";
      element.resizeSensor.className = "resize-sensor";
      var style =
        "position: absolute; left: -10px; top: -10px; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";
      var styleChild = "position: absolute; left: 0; top: 0; transition: 0s;";

      element.resizeSensor.style.cssText = style;
      element.resizeSensor.innerHTML =
        '&lt;div class="resize-sensor-expand" style="' +
        style +
        '"&gt;' +
        '&lt;div style="' +
        styleChild +
        '"&gt;&lt;/div&gt;' +
        "&lt;/div&gt;" +
        '&lt;div class="resize-sensor-shrink" style="' +
        style +
        '"&gt;' +
        '&lt;div style="' +
        styleChild +
        ' width: 200%; height: 200%"&gt;&lt;/div&gt;' +
        "&lt;/div&gt;";
      element.appendChild(element.resizeSensor);

      var position = window
        .getComputedStyle(element)
        .getPropertyPriority("position");
      if (
        position !== "absolute" &amp;&amp;
        position !== "relative" &amp;&amp;
        position !== "fixed"
      ) {
        element.style.position = "relative";
      }

      var expand = element.resizeSensor.childNodes[0];
      var expandChild = expand.childNodes[0];
      var shrink = element.resizeSensor.childNodes[1];
      var dirty;
      var rafId;
      var newWidth;
      var newHeight;
      var size = getElementSize(element);
      var lastWidth = size.width;
      var lastHeight = size.height;

      var reset = function() {
        // set display to block, necessary otherwise hidden elements won't ever work
        var invisible = element.offsetWidth === 0 &amp;&amp; element.offsetHeight === 0;

        if (invisible) {
          var saveDisplay = element.style.display;
          element.style.display = "block";
        }

        expandChild.style.width = "100000px";
        expandChild.style.height = "100000px";

        expand.scrollLeft = 100000;
        expand.scrollTop = 100000;

        shrink.scrollLeft = 100000;
        shrink.scrollTop = 100000;

        if (invisible) {
          element.style.display = saveDisplay;
        }
      };
      element.resizeSensor.resetSensor = reset;

      var onResized = function() {
        rafId = 0;

        if (!dirty) return;

        lastWidth = newWidth;
        lastHeight = newHeight;

        if (element.resizedAttached) {
          element.resizedAttached.call();
        }
      };

      var onScroll = function() {
        var size = getElementSize(element);
        var newWidth = size.width;
        var newHeight = size.height;
        dirty = newWidth != lastWidth || newHeight != lastHeight;

        if (dirty &amp;&amp; !rafId) {
          rafId = requestAnimationFrame(onResized);
        }

        reset();
      };

      var addEvent = function(el, name, cb) {
        if (el.attachEvent) {
          el.attachEvent("on" + name, cb);
        } else {
          el.addEventListener(name, cb);
        }
      };

      addEvent(expand, "scroll", onScroll);
      addEvent(shrink, "scroll", onScroll);

      // Fix for custom Elements
      requestAnimationFrame(reset);
    }

    forEachElement(element, function(elem) {
      attachResizeEvent(elem, callback);
    });

    this.detach = function(ev) {
      ResizeSensor.detach(element, ev);
    };

    this.reset = function() {
      element.resizeSensor.resetSensor();
    };
  };

  ResizeSensor.reset = function(element, ev) {
    forEachElement(element, function(elem) {
      elem.resizeSensor.resetSensor();
    });
  };

  ResizeSensor.detach = function(element, ev) {
    forEachElement(element, function(elem) {
      if (!elem) return;
      if (elem.resizedAttached &amp;&amp; typeof ev === "function") {
        elem.resizedAttached.remove(ev);
        if (elem.resizedAttached.length()) return;
      }
      if (elem.resizeSensor) {
        if (elem.contains(elem.resizeSensor)) {
          elem.removeChild(elem.resizeSensor);
        }
        delete elem.resizeSensor;
        delete elem.resizedAttached;
      }
    });
  };

  return ResizeSensor;
});

"use strict";

/**
 * Copyright Marc J. Schmidt. See the LICENSE file at the top-level
 * directory of this distribution and at
 * https://github.com/marcj/css-element-queries/blob/master/LICENSE.
 */
(function(root, factory) {
  if (typeof define === "function" &amp;&amp; define.amd) {
    define([
      "../../../../../../../../../../../../Downloads/css-element-queries-1.0.0/src/ResizeSensor.d.ts"
    ], factory);
  } else if (typeof exports === "object") {
    module.exports = factory(
      require("../../../../../../../../../../../../Downloads/css-element-queries-1.0.0/src/ResizeSensor.d.ts")
    );
  } else {
    root.ElementQueries = factory(root.ResizeSensor);
    root.ElementQueries.listen();
  }
})(typeof window !== "undefined" ? window : this, function(ResizeSensor) {
  /**
   *
   * @type {Function}
   * @constructor
   */
  var ElementQueries = function() {
    // &lt;style&gt; element with our dynamically created styles
    var cssStyleElement;

    // all rules found for element queries
    var allQueries = {};

    // association map to identify which selector belongs to a element from the animationstart event.
    var idToSelectorMapping = [];

    /**
     *
     * @param element
     * @returns {Number}
     */
    function getEmSize(element) {
      if (!element) {
        element = document.documentElement;
      }
      var fontSize = window.getComputedStyle(element, null).fontSize;
      return parseFloat(fontSize) || 16;
    }

    /**
     * Get element size
     * @param {HTMLElement} element
     * @returns {Object} {width, height}
     */
    function getElementSize(element) {
      if (!element.getBoundingClientRect) {
        return {
          width: element.offsetWidth,
          height: element.offsetHeight
        };
      }

      var rect = element.getBoundingClientRect();
      return {
        width: Math.round(rect.width),
        height: Math.round(rect.height)
      };
    }

    /**
     *
     * @copyright https://github.com/Mr0grog/element-query/blob/master/LICENSE
     *
     * @param {HTMLElement} element
     * @param {*} value
     * @returns {*}
     */
    function convertToPx(element, value) {
      var numbers = value.split(/\d/);
      var units = numbers[numbers.length - 1];
      value = parseFloat(value);
      switch (units) {
        case "px":
          return value;
        case "em":
          return value * getEmSize(element);
        case "rem":
          return value * getEmSize();
        // Viewport units!
        // According to http://quirksmode.org/mobile/tableViewport.html
        // documentElement.clientWidth/Height gets us the most reliable info
        case "vw":
          return (value * document.documentElement.clientWidth) / 100;
        case "vh":
          return (value * document.documentElement.clientHeight) / 100;
        case "vmin":
        case "vmax":
          var vw = document.documentElement.clientWidth / 100;
          var vh = document.documentElement.clientHeight / 100;
          var chooser = Math[units === "vmin" ? "min" : "max"];
          return value * chooser(vw, vh);
        default:
          return value;
        // for now, not supporting physical units (since they are just a set number of px)
        // or ex/ch (getting accurate measurements is hard)
      }
    }

    /**
     *
     * @param {HTMLElement} element
     * @param {String} id
     * @constructor
     */
    function SetupInformation(element, id) {
      this.element = element;
      var key;
      var option;
      var elementSize;
      var value;
      var actualValue;
      var attrValues;
      var attrValue;
      var attrName;

      var attributes = ["min-width", "min-height", "max-width", "max-height"];

      /**
       * Extracts the computed width/height and sets to min/max- attribute.
       */
      this.call = function() {
        // extract current dimensions
        elementSize = getElementSize(this.element);

        attrValues = {};

        for (key in allQueries[id]) {
          if (!allQueries[id].hasOwnProperty(key)) {
            continue;
          }
          option = allQueries[id][key];

          value = convertToPx(this.element, option.value);

          actualValue =
            option.property === "width"
              ? elementSize.width
              : elementSize.height;
          attrName = option.mode + "-" + option.property;
          attrValue = "";

          if (option.mode === "min" &amp;&amp; actualValue &gt;= value) {
            attrValue += option.value;
          }

          if (option.mode === "max" &amp;&amp; actualValue &lt;= value) {
            attrValue += option.value;
          }

          if (!attrValues[attrName]) attrValues[attrName] = "";
          if (
            attrValue &amp;&amp;
            (" " + attrValues[attrName] + " ").indexOf(
              " " + attrValue + " "
            ) === -1
          ) {
            attrValues[attrName] += " " + attrValue;
          }
        }

        for (var k in attributes) {
          if (!attributes.hasOwnProperty(k)) continue;

          if (attrValues[attributes[k]]) {
            this.element.setAttribute(
              attributes[k],
              attrValues[attributes[k]].substr(1)
            );
          } else {
            this.element.removeAttribute(attributes[k]);
          }
        }
      };
    }

    /**
     * @param {HTMLElement} element
     * @param {Object}      id
     */
    function setupElement(element, id) {
      if (!element.elementQueriesSetupInformation) {
        element.elementQueriesSetupInformation = new SetupInformation(
          element,
          id
        );
      }
      if (!element.elementQueriesSensor) {
        element.elementQueriesSensor = new ResizeSensor(element, function() {
          element.elementQueriesSetupInformation.call();
        });
      }

      element.elementQueriesSetupInformation.call();
    }

    /**
     * Stores rules to the selector that should be applied once resized.
     *
     * @param {String} selector
     * @param {String} mode min|max
     * @param {String} property width|height
     * @param {String} value
     */
    function queueQuery(selector, mode, property, value) {
      if (typeof allQueries[selector] === "undefined") {
        allQueries[selector] = [];
        // add animation to trigger animationstart event, so we know exactly when a element appears in the DOM

        var id = idToSelectorMapping.length;
        cssStyleElement.innerHTML +=
          "\n" + selector + " {animation: 0.1s element-queries;}";
        cssStyleElement.innerHTML +=
          "\n" + selector + " &gt; .resize-sensor {min-width: " + id + "px;}";
        idToSelectorMapping.push(selector);
      }

      allQueries[selector].push({
        mode: mode,
        property: property,
        value: value
      });
    }

    function getQuery(container) {
      var query;
      if (document.querySelectorAll)
        query = container
          ? container.querySelectorAll.bind(container)
          : document.querySelectorAll.bind(document);
      if (!query &amp;&amp; typeof $$ !== "undefined") query = $$;
      if (!query &amp;&amp; typeof jQuery !== "undefined") query = jQuery;

      if (!query) {
        throw "No document.querySelectorAll, jQuery or Mootools's $$ found.";
      }

      return query;
    }

    /**
     * If animationStart didn't catch a new element in the DOM, we can manually search for it
     */
    function findElementQueriesElements(container) {
      var query = getQuery(container);

      for (var selector in allQueries)
        if (allQueries.hasOwnProperty(mode)) {
          // find all elements based on the extract query selector from the element query rule
          var elements = query(selector, container);

          for (var i = 0, j = elements.length; i &lt; j; i++) {
            setupElement(elements[i], selector);
          }
        }
    }

    /**
     *
     * @param {HTMLElement} element
     */
    function attachResponsiveImage(element) {
      var children = [];
      var rules = [];
      var sources = [];
      var defaultImageId = 0;
      var lastActiveImage = -1;
      var loadedImages = [];

      for (var i in element.children) {
        if (!element.children.hasOwnProperty(i)) continue;

        if (
          element.children[i].tagName &amp;&amp;
          element.children[i].tagName.toLowerCase() === "img"
        ) {
          children.push(element.children[i]);

          var minWidth =
            element.children[i].getAttribute("min-width") ||
            element.children[i].getAttribute("data-min-width");
          // var minHeight = element.children[i].getAttribute('min-height') || element.children[i].getAttribute('data-min-height');
          var src =
            element.children[i].getAttribute("data-src") ||
            element.children[i].getAttribute("url");

          sources.push(src);

          var rule = {
            minWidth: minWidth
          };

          rules.push(rule);

          if (!minWidth) {
            defaultImageId = children.length - 1;
            element.children[i].style.display = "block";
          } else {
            element.children[i].style.display = "none";
          }
        }
      }

      lastActiveImage = defaultImageId;

      function check() {
        var imageToDisplay = false;
        var i;

        for (i in children) {
          if (!children.hasOwnProperty(i)) continue;

          if (rules[i].minWidth) {
            if (element.offsetWidth &gt; rules[i].minWidth) {
              imageToDisplay = i;
            }
          }
        }

        if (!imageToDisplay) {
          // no rule matched, show default
          imageToDisplay = defaultImageId;
        }

        if (lastActiveImage !== imageToDisplay) {
          // image change

          if (!loadedImages[imageToDisplay]) {
            // image has not been loaded yet, we need to load the image first in memory to prevent flash of
            // no content

            var image = new Image();
            image.onload = function() {
              children[imageToDisplay].src = sources[imageToDisplay];

              children[lastActiveImage].style.display = "none";
              children[imageToDisplay].style.display = "block";

              loadedImages[imageToDisplay] = true;

              lastActiveImage = imageToDisplay;
            };

            image.src = sources[imageToDisplay];
          } else {
            children[lastActiveImage].style.display = "none";
            children[imageToDisplay].style.display = "block";
            lastActiveImage = imageToDisplay;
          }
        } else {
          // make sure for initial check call the .src is set correctly
          children[imageToDisplay].src = sources[imageToDisplay];
        }
      }

      element.resizeSensor = new ResizeSensor(element, check);
      check();
    }

    function findResponsiveImages() {
      var query = getQuery();

      var elements = query("[data-responsive-image],[responsive-image]");
      for (var i = 0, j = elements.length; i &lt; j; i++) {
        attachResponsiveImage(elements[i]);
      }
    }

    var regex = /,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim;
    var attrRegex = /\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;

    /**
     * @param {String} css
     */
    function extractQuery(css) {
      var match;
      var smatch;
      var attrs;
      var attrMatch;

      css = css.replace(/'/g, '"');
      while ((match = regex.exec(css)) !== null) {
        smatch = match[1] + match[3];
        attrs = match[2];

        while ((attrMatch = attrRegex.exec(attrs)) !== null) {
          queueQuery(smatch, attrMatch[1], attrMatch[2], attrMatch[3]);
        }
      }
    }

    /**
     * @param {CssRule[]|String} rules
     */
    function readRules(rules) {
      var selector = "";

      if (!rules) {
        return;
      }

      if (typeof rules === "string") {
        rules = rules.toLowerCase();
        if (
          rules.indexOf("min-width") !== -1 ||
          rules.indexOf("max-width") !== -1
        ) {
          extractQuery(rules);
        }
      } else {
        for (var i = 0, j = rules.length; i &lt; j; i++) {
          if (rules[i].type === 1) {
            selector = rules[i].selectorText || rules[i].cssText;
            if (
              selector.indexOf("min-height") !== -1 ||
              selector.indexOf("max-height") !== -1
            ) {
              extractQuery(selector);
            } else if (
              selector.indexOf("min-width") !== -1 ||
              selector.indexOf("max-width") !== -1
            ) {
              extractQuery(selector);
            }
          } else if (rules[i].type === 4) {
            readRules(rules[i].cssRules || rules[i].rules);
          } else if (rules[i].type === 3) {
            readRules(rules[i].styleSheet.cssRules);
          }
        }
      }
    }

    var defaultCssInjected = false;

    /**
     * Searches all css rules and setups the event listener to all elements with element query rules..
     */
    this.init = function() {
      var animationStart = "animationstart";
      if (
        typeof document.documentElement.style.webkitAnimationName !==
        "undefined"
      ) {
        animationStart = "webkitAnimationStart";
      } else if (
        typeof document.documentElement.style.MozAnimationName !== "undefined"
      ) {
        animationStart = "mozanimationstart";
      } else if (
        typeof document.documentElement.style.OAnimationName !== "undefined"
      ) {
        animationStart = "oanimationstart";
      }

      document.body.addEventListener(animationStart, function(e) {
        var element = e.target;
        var styles = window.getComputedStyle(element, null);

        if (
          styles
            .getPropertyValue("animation-name")
            .indexOf("element-queries") !== -1
        ) {
          element.elementQueriesSensor = new ResizeSensor(element, function() {
            if (element.elementQueriesSetupInformation) {
              element.elementQueriesSetupInformation.call();
            }
          });

          var sensorStyles = window.getComputedStyle(
            element.resizeSensor,
            null
          );
          var id = sensorStyles.getPropertyValue("min-width");
          id = parseInt(id.replace("px", ""));
          setupElement(e.target, idToSelectorMapping[id]);
        }
      });

      if (!defaultCssInjected) {
        cssStyleElement = document.createElement("style");
        cssStyleElement.type = "text/css";
        cssStyleElement.innerHTML =
          "[responsive-image] &gt; img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] &gt; img, [data-responsive-image] &gt; img {width: 100%;}";

        // safari wants at least one rule in keyframes to start working
        cssStyleElement.innerHTML +=
          "\n@keyframes element-queries { 0% { visibility: inherit; } }";
        document.getElementsByTagName("head")[0].appendChild(cssStyleElement);
        defaultCssInjected = true;
      }

      for (var i = 0, j = document.styleSheets.length; i &lt; j; i++) {
        try {
          if (
            document.styleSheets[i].href &amp;&amp;
            document.styleSheets[i].href.indexOf("file://") === 0
          ) {
            console.log(
              "CssElementQueries: unable to parse local css files, " +
                document.styleSheets[i].href
            );
          }

          readRules(
            document.styleSheets[i].cssRules ||
              document.styleSheets[i].rules ||
              document.styleSheets[i].cssText
          );
        } catch (e) {}
      }

      // findElementQueriesElements();
      findResponsiveImages();
    };

    /**
     * Go through all collected rules (readRules()) and attach the resize-listener.
     * Not necessary to call it manually, since we detect automatically when new elements
     * are available in the DOM. However, sometimes handy for dirty DOM modifications.
     *
     * @param {HTMLElement} container only elements of the container are considered (document.body if not set)
     */
    this.findElementQueriesElements = function(container) {
      findElementQueriesElements(container);
    };

    this.update = function() {
      this.init();
    };
  };

  ElementQueries.update = function() {
    ElementQueries.instance.update();
  };

  /**
   * Removes all sensor and elementquery information from the element.
   *
   * @param {HTMLElement} element
   */
  ElementQueries.detach = function(element) {
    if (element.elementQueriesSetupInformation) {
      // element queries
      element.elementQueriesSensor.detach();
      delete element.elementQueriesSetupInformation;
      delete element.elementQueriesSensor;
    } else if (element.resizeSensor) {
      // responsive image

      element.resizeSensor.detach();
      delete element.resizeSensor;
    }
  };

  ElementQueries.init = function() {
    if (!ElementQueries.instance) {
      ElementQueries.instance = new ElementQueries();
    }

    ElementQueries.instance.init();
  };

  var domLoaded = function(callback) {
    /* Mozilla, Chrome, Opera */
    if (document.addEventListener) {
      document.addEventListener("DOMContentLoaded", callback, false);
    } else if (/KHTML|WebKit|iCab/i.test(navigator.userAgent)) {
      /* Safari, iCab, Konqueror */
      var DOMLoadTimer = setInterval(function() {
        if (/loaded|complete/i.test(document.readyState)) {
          callback();
          clearInterval(DOMLoadTimer);
        }
      }, 10);
    } else window.onload = callback;
    /* Other web browsers */
  };

  ElementQueries.findElementQueriesElements = function(container) {
    ElementQueries.instance.findElementQueriesElements(container);
  };

  ElementQueries.listen = function() {
    domLoaded(ElementQueries.init);
  };

  return ElementQueries;
});

(function($) {
  /**
   * Copyright 2012, Digital Fusion
   * Licensed under the MIT license.
   * http://teamdf.com/jquery-plugins/license/
   *
   * @author Sam Sehnert
   * @desc A small plugin that checks whether elements are within
   *       the user visible viewport of a web browser.
   *       can accounts for vertical position, horizontal, or both
   */
  var $w = $(window);
  $.fn.visible = function(partial, hidden, direction, container) {
    if (this.length &lt; 1) return;

    // Set direction default to 'both'.
    direction = direction || "both";

    var $t = this.length &gt; 1 ? this.eq(0) : this;
    var isContained = typeof container !== "undefined" &amp;&amp; container !== null;
    var $c = isContained ? $(container) : $w;
    var wPosition = isContained ? $c.position() : 0;
    var t = $t.get(0);
    var vpWidth = $c.outerWidth();
    var vpHeight = $c.outerHeight();
    var clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true;

    if (typeof t.getBoundingClientRect === "function") {
      // Use this native browser method, if available.
      var rec = t.getBoundingClientRect();
      var tViz = isContained
        ? rec.top - wPosition.top &gt;= 0 &amp;&amp; rec.top &lt; vpHeight + wPosition.top
        : rec.top &gt;= 0 &amp;&amp; rec.top &lt; vpHeight;
      var bViz = isContained
        ? rec.bottom - wPosition.top &gt; 0 &amp;&amp;
          rec.bottom &lt;= vpHeight + wPosition.top
        : rec.bottom &gt; 0 &amp;&amp; rec.bottom &lt;= vpHeight;
      var lViz = isContained
        ? rec.left - wPosition.left &gt;= 0 &amp;&amp; rec.left &lt; vpWidth + wPosition.left
        : rec.left &gt;= 0 &amp;&amp; rec.left &lt; vpWidth;
      var rViz = isContained
        ? rec.right - wPosition.left &gt; 0 &amp;&amp; rec.right &lt; vpWidth + wPosition.left
        : rec.right &gt; 0 &amp;&amp; rec.right &lt;= vpWidth;
      var vVisible = partial ? tViz || bViz : tViz &amp;&amp; bViz;
      var hVisible = partial ? lViz || rViz : lViz &amp;&amp; rViz;
      var vVisible = rec.top &lt; 0 &amp;&amp; rec.bottom &gt; vpHeight ? true : vVisible;
      var hVisible = rec.left &lt; 0 &amp;&amp; rec.right &gt; vpWidth ? true : hVisible;

      if (direction === "both") return clientSize &amp;&amp; vVisible &amp;&amp; hVisible;
      if (direction === "vertical") return clientSize &amp;&amp; vVisible;
      if (direction === "horizontal") return clientSize &amp;&amp; hVisible;
    } else {
      var viewTop = isContained ? 0 : wPosition;
      var viewBottom = viewTop + vpHeight;
      var viewLeft = $c.scrollLeft();
      var viewRight = viewLeft + vpWidth;
      var position = $t.position();
      var _top = position.top;
      var _bottom = _top + $t.height();
      var _left = position.left;
      var _right = _left + $t.width();
      var compareTop = partial === true ? _bottom : _top;
      var compareBottom = partial === true ? _top : _bottom;
      var compareLeft = partial === true ? _right : _left;
      var compareRight = partial === true ? _left : _right;

      if (direction === "both")
        return (
          !!clientSize &amp;&amp;
          (compareBottom &lt;= viewBottom &amp;&amp; compareTop &gt;= viewTop) &amp;&amp;
          (compareRight &lt;= viewRight &amp;&amp; compareLeft &gt;= viewLeft)
        );
      if (direction === "vertical")
        return (
          !!clientSize &amp;&amp; (compareBottom &lt;= viewBottom &amp;&amp; compareTop &gt;= viewTop)
        );
      if (direction === "horizontal")
        return (
          !!clientSize &amp;&amp; (compareRight &lt;= viewRight &amp;&amp; compareLeft &gt;= viewLeft)
        );
    }
  };
})(jQuery);

/**!

 @license
 handlebars v4.0.10

Copyright (C) 2011-2016 by Yehuda Katz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' &amp;&amp; typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' &amp;&amp; define.amd)
		define([], factory);
	else if(typeof exports === 'object')
		exports["Handlebars"] = factory();
	else
		root["Handlebars"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;

	var _handlebarsRuntime = __webpack_require__(2);

	var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);

	// Compiler imports

	var _handlebarsCompilerAst = __webpack_require__(35);

	var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);

	var _handlebarsCompilerBase = __webpack_require__(36);

	var _handlebarsCompilerCompiler = __webpack_require__(41);

	var _handlebarsCompilerJavascriptCompiler = __webpack_require__(42);

	var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);

	var _handlebarsCompilerVisitor = __webpack_require__(39);

	var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);

	var _handlebarsNoConflict = __webpack_require__(34);

	var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);

	var _create = _handlebarsRuntime2['default'].create;
	function create() {
	  var hb = _create();

	  hb.compile = function (input, options) {
	    return _handlebarsCompilerCompiler.compile(input, options, hb);
	  };
	  hb.precompile = function (input, options) {
	    return _handlebarsCompilerCompiler.precompile(input, options, hb);
	  };

	  hb.AST = _handlebarsCompilerAst2['default'];
	  hb.Compiler = _handlebarsCompilerCompiler.Compiler;
	  hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
	  hb.Parser = _handlebarsCompilerBase.parser;
	  hb.parse = _handlebarsCompilerBase.parse;

	  return hb;
	}

	var inst = create();
	inst.create = create;

	_handlebarsNoConflict2['default'](inst);

	inst.Visitor = _handlebarsCompilerVisitor2['default'];

	inst['default'] = inst;

	exports['default'] = inst;
	module.exports = exports['default'];

/***/ }),
/* 1 */
/***/ (function(module, exports) {

	"use strict";

	exports["default"] = function (obj) {
	  return obj &amp;&amp; obj.__esModule ? obj : {
	    "default": obj
	  };
	};

	exports.__esModule = true;

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireWildcard = __webpack_require__(3)['default'];

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;

	var _handlebarsBase = __webpack_require__(4);

	var base = _interopRequireWildcard(_handlebarsBase);

	// Each of these augment the Handlebars object. No need to setup here.
	// (This is done to easily share code between commonjs and browse envs)

	var _handlebarsSafeString = __webpack_require__(21);

	var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);

	var _handlebarsException = __webpack_require__(6);

	var _handlebarsException2 = _interopRequireDefault(_handlebarsException);

	var _handlebarsUtils = __webpack_require__(5);

	var Utils = _interopRequireWildcard(_handlebarsUtils);

	var _handlebarsRuntime = __webpack_require__(22);

	var runtime = _interopRequireWildcard(_handlebarsRuntime);

	var _handlebarsNoConflict = __webpack_require__(34);

	var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);

	// For compatibility and usage outside of module systems, make the Handlebars object a namespace
	function create() {
	  var hb = new base.HandlebarsEnvironment();

	  Utils.extend(hb, base);
	  hb.SafeString = _handlebarsSafeString2['default'];
	  hb.Exception = _handlebarsException2['default'];
	  hb.Utils = Utils;
	  hb.escapeExpression = Utils.escapeExpression;

	  hb.VM = runtime;
	  hb.template = function (spec) {
	    return runtime.template(spec, hb);
	  };

	  return hb;
	}

	var inst = create();
	inst.create = create;

	_handlebarsNoConflict2['default'](inst);

	inst['default'] = inst;

	exports['default'] = inst;
	module.exports = exports['default'];

/***/ }),
/* 3 */
/***/ (function(module, exports) {

	"use strict";

	exports["default"] = function (obj) {
	  if (obj &amp;&amp; obj.__esModule) {
	    return obj;
	  } else {
	    var newObj = {};

	    if (obj != null) {
	      for (var key in obj) {
	        if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
	      }
	    }

	    newObj["default"] = obj;
	    return newObj;
	  }
	};

	exports.__esModule = true;

/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;
	exports.HandlebarsEnvironment = HandlebarsEnvironment;

	var _utils = __webpack_require__(5);

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	var _helpers = __webpack_require__(10);

	var _decorators = __webpack_require__(18);

	var _logger = __webpack_require__(20);

	var _logger2 = _interopRequireDefault(_logger);

	var VERSION = '4.0.10';
	exports.VERSION = VERSION;
	var COMPILER_REVISION = 7;

	exports.COMPILER_REVISION = COMPILER_REVISION;
	var REVISION_CHANGES = {
	  1: '&lt;= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
	  2: '== 1.0.0-rc.3',
	  3: '== 1.0.0-rc.4',
	  4: '== 1.x.x',
	  5: '== 2.0.0-alpha.x',
	  6: '&gt;= 2.0.0-beta.1',
	  7: '&gt;= 4.0.0'
	};

	exports.REVISION_CHANGES = REVISION_CHANGES;
	var objectType = '[object Object]';

	function HandlebarsEnvironment(helpers, partials, decorators) {
	  this.helpers = helpers || {};
	  this.partials = partials || {};
	  this.decorators = decorators || {};

	  _helpers.registerDefaultHelpers(this);
	  _decorators.registerDefaultDecorators(this);
	}

	HandlebarsEnvironment.prototype = {
	  constructor: HandlebarsEnvironment,

	  logger: _logger2['default'],
	  log: _logger2['default'].log,

	  registerHelper: function registerHelper(name, fn) {
	    if (_utils.toString.call(name) === objectType) {
	      if (fn) {
	        throw new _exception2['default']('Arg not supported with multiple helpers');
	      }
	      _utils.extend(this.helpers, name);
	    } else {
	      this.helpers[name] = fn;
	    }
	  },
	  unregisterHelper: function unregisterHelper(name) {
	    delete this.helpers[name];
	  },

	  registerPartial: function registerPartial(name, partial) {
	    if (_utils.toString.call(name) === objectType) {
	      _utils.extend(this.partials, name);
	    } else {
	      if (typeof partial === 'undefined') {
	        throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
	      }
	      this.partials[name] = partial;
	    }
	  },
	  unregisterPartial: function unregisterPartial(name) {
	    delete this.partials[name];
	  },

	  registerDecorator: function registerDecorator(name, fn) {
	    if (_utils.toString.call(name) === objectType) {
	      if (fn) {
	        throw new _exception2['default']('Arg not supported with multiple decorators');
	      }
	      _utils.extend(this.decorators, name);
	    } else {
	      this.decorators[name] = fn;
	    }
	  },
	  unregisterDecorator: function unregisterDecorator(name) {
	    delete this.decorators[name];
	  }
	};

	var log = _logger2['default'].log;

	exports.log = log;
	exports.createFrame = _utils.createFrame;
	exports.logger = _logger2['default'];

/***/ }),
/* 5 */
/***/ (function(module, exports) {

	'use strict';

	exports.__esModule = true;
	exports.extend = extend;
	exports.indexOf = indexOf;
	exports.escapeExpression = escapeExpression;
	exports.isEmpty = isEmpty;
	exports.createFrame = createFrame;
	exports.blockParams = blockParams;
	exports.appendContextPath = appendContextPath;
	var escape = {
	  '&amp;': '&amp;amp;',
	  '&lt;': '&amp;lt;',
	  '&gt;': '&amp;gt;',
	  '"': '&amp;quot;',
	  "'": '&amp;#x27;',
	  '`': '&amp;#x60;',
	  '=': '&amp;#x3D;'
	};

	var badChars = /[&amp;&lt;&gt;"'`=]/g,
	    possible = /[&amp;&lt;&gt;"'`=]/;

	function escapeChar(chr) {
	  return escape[chr];
	}

	function extend(obj /* , ...source */) {
	  for (var i = 1; i &lt; arguments.length; i++) {
	    for (var key in arguments[i]) {
	      if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
	        obj[key] = arguments[i][key];
	      }
	    }
	  }

	  return obj;
	}

	var toString = Object.prototype.toString;

	exports.toString = toString;
	// Sourced from lodash
	// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
	/* eslint-disable func-style */
	var isFunction = function isFunction(value) {
	  return typeof value === 'function';
	};
	// fallback for older versions of Chrome and Safari
	/* istanbul ignore next */
	if (isFunction(/x/)) {
	  exports.isFunction = isFunction = function (value) {
	    return typeof value === 'function' &amp;&amp; toString.call(value) === '[object Function]';
	  };
	}
	exports.isFunction = isFunction;

	/* eslint-enable func-style */

	/* istanbul ignore next */
	var isArray = Array.isArray || function (value) {
	  return value &amp;&amp; typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
	};

	exports.isArray = isArray;
	// Older IE versions do not directly support indexOf so we must implement our own, sadly.

	function indexOf(array, value) {
	  for (var i = 0, len = array.length; i &lt; len; i++) {
	    if (array[i] === value) {
	      return i;
	    }
	  }
	  return -1;
	}

	function escapeExpression(string) {
	  if (typeof string !== 'string') {
	    // don't escape SafeStrings, since they're already safe
	    if (string &amp;&amp; string.toHTML) {
	      return string.toHTML();
	    } else if (string == null) {
	      return '';
	    } else if (!string) {
	      return string + '';
	    }

	    // Force a string conversion as this will be done by the append regardless and
	    // the regex test will do this transparently behind the scenes, causing issues if
	    // an object's to string has escaped characters in it.
	    string = '' + string;
	  }

	  if (!possible.test(string)) {
	    return string;
	  }
	  return string.replace(badChars, escapeChar);
	}

	function isEmpty(value) {
	  if (!value &amp;&amp; value !== 0) {
	    return true;
	  } else if (isArray(value) &amp;&amp; value.length === 0) {
	    return true;
	  } else {
	    return false;
	  }
	}

	function createFrame(object) {
	  var frame = extend({}, object);
	  frame._parent = object;
	  return frame;
	}

	function blockParams(params, ids) {
	  params.path = ids;
	  return params;
	}

	function appendContextPath(contextPath, id) {
	  return (contextPath ? contextPath + '.' : '') + id;
	}

/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _Object$defineProperty = __webpack_require__(7)['default'];

	exports.__esModule = true;

	var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];

	function Exception(message, node) {
	  var loc = node &amp;&amp; node.loc,
	      line = undefined,
	      column = undefined;
	  if (loc) {
	    line = loc.start.line;
	    column = loc.start.column;

	    message += ' - ' + line + ':' + column;
	  }

	  var tmp = Error.prototype.constructor.call(this, message);

	  // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
	  for (var idx = 0; idx &lt; errorProps.length; idx++) {
	    this[errorProps[idx]] = tmp[errorProps[idx]];
	  }

	  /* istanbul ignore else */
	  if (Error.captureStackTrace) {
	    Error.captureStackTrace(this, Exception);
	  }

	  try {
	    if (loc) {
	      this.lineNumber = line;

	      // Work around issue under safari where we can't directly set the column value
	      /* istanbul ignore next */
	      if (_Object$defineProperty) {
	        Object.defineProperty(this, 'column', {
	          value: column,
	          enumerable: true
	        });
	      } else {
	        this.column = column;
	      }
	    }
	  } catch (nop) {
	    /* Ignore if the browser is very particular */
	  }
	}

	Exception.prototype = new Error();

	exports['default'] = Exception;
	module.exports = exports['default'];

/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

	module.exports = { "default": __webpack_require__(8), __esModule: true };

/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

	var $ = __webpack_require__(9);
	module.exports = function defineProperty(it, key, desc){
	  return $.setDesc(it, key, desc);
	};

/***/ }),
/* 9 */
/***/ (function(module, exports) {

	var $Object = Object;
	module.exports = {
	  create:     $Object.create,
	  getProto:   $Object.getPrototypeOf,
	  isEnum:     {}.propertyIsEnumerable,
	  getDesc:    $Object.getOwnPropertyDescriptor,
	  setDesc:    $Object.defineProperty,
	  setDescs:   $Object.defineProperties,
	  getKeys:    $Object.keys,
	  getNames:   $Object.getOwnPropertyNames,
	  getSymbols: $Object.getOwnPropertySymbols,
	  each:       [].forEach
	};

/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;
	exports.registerDefaultHelpers = registerDefaultHelpers;

	var _helpersBlockHelperMissing = __webpack_require__(11);

	var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);

	var _helpersEach = __webpack_require__(12);

	var _helpersEach2 = _interopRequireDefault(_helpersEach);

	var _helpersHelperMissing = __webpack_require__(13);

	var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);

	var _helpersIf = __webpack_require__(14);

	var _helpersIf2 = _interopRequireDefault(_helpersIf);

	var _helpersLog = __webpack_require__(15);

	var _helpersLog2 = _interopRequireDefault(_helpersLog);

	var _helpersLookup = __webpack_require__(16);

	var _helpersLookup2 = _interopRequireDefault(_helpersLookup);

	var _helpersWith = __webpack_require__(17);

	var _helpersWith2 = _interopRequireDefault(_helpersWith);

	function registerDefaultHelpers(instance) {
	  _helpersBlockHelperMissing2['default'](instance);
	  _helpersEach2['default'](instance);
	  _helpersHelperMissing2['default'](instance);
	  _helpersIf2['default'](instance);
	  _helpersLog2['default'](instance);
	  _helpersLookup2['default'](instance);
	  _helpersWith2['default'](instance);
	}

/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	exports.__esModule = true;

	var _utils = __webpack_require__(5);

	exports['default'] = function (instance) {
	  instance.registerHelper('blockHelperMissing', function (context, options) {
	    var inverse = options.inverse,
	        fn = options.fn;

	    if (context === true) {
	      return fn(this);
	    } else if (context === false || context == null) {
	      return inverse(this);
	    } else if (_utils.isArray(context)) {
	      if (context.length &gt; 0) {
	        if (options.ids) {
	          options.ids = [options.name];
	        }

	        return instance.helpers.each(context, options);
	      } else {
	        return inverse(this);
	      }
	    } else {
	      if (options.data &amp;&amp; options.ids) {
	        var data = _utils.createFrame(options.data);
	        data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
	        options = { data: data };
	      }

	      return fn(context, options);
	    }
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;

	var _utils = __webpack_require__(5);

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	exports['default'] = function (instance) {
	  instance.registerHelper('each', function (context, options) {
	    if (!options) {
	      throw new _exception2['default']('Must pass iterator to #each');
	    }

	    var fn = options.fn,
	        inverse = options.inverse,
	        i = 0,
	        ret = '',
	        data = undefined,
	        contextPath = undefined;

	    if (options.data &amp;&amp; options.ids) {
	      contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
	    }

	    if (_utils.isFunction(context)) {
	      context = context.call(this);
	    }

	    if (options.data) {
	      data = _utils.createFrame(options.data);
	    }

	    function execIteration(field, index, last) {
	      if (data) {
	        data.key = field;
	        data.index = index;
	        data.first = index === 0;
	        data.last = !!last;

	        if (contextPath) {
	          data.contextPath = contextPath + field;
	        }
	      }

	      ret = ret + fn(context[field], {
	        data: data,
	        blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
	      });
	    }

	    if (context &amp;&amp; typeof context === 'object') {
	      if (_utils.isArray(context)) {
	        for (var j = context.length; i &lt; j; i++) {
	          if (i in context) {
	            execIteration(i, i, i === context.length - 1);
	          }
	        }
	      } else {
	        var priorKey = undefined;

	        for (var key in context) {
	          if (context.hasOwnProperty(key)) {
	            // We're running the iterations one step out of sync so we can detect
	            // the last iteration without have to scan the object twice and create
	            // an itermediate keys array.
	            if (priorKey !== undefined) {
	              execIteration(priorKey, i - 1);
	            }
	            priorKey = key;
	            i++;
	          }
	        }
	        if (priorKey !== undefined) {
	          execIteration(priorKey, i - 1, true);
	        }
	      }
	    }

	    if (i === 0) {
	      ret = inverse(this);
	    }

	    return ret;
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	exports['default'] = function (instance) {
	  instance.registerHelper('helperMissing', function () /* [args, ]options */{
	    if (arguments.length === 1) {
	      // A missing field in a {{foo}} construct.
	      return undefined;
	    } else {
	      // Someone is actually trying to call something, blow up.
	      throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
	    }
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	exports.__esModule = true;

	var _utils = __webpack_require__(5);

	exports['default'] = function (instance) {
	  instance.registerHelper('if', function (conditional, options) {
	    if (_utils.isFunction(conditional)) {
	      conditional = conditional.call(this);
	    }

	    // Default behavior is to render the positive path if the value is truthy and not empty.
	    // The `includeZero` option may be set to treat the condtional as purely not empty based on the
	    // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
	    if (!options.hash.includeZero &amp;&amp; !conditional || _utils.isEmpty(conditional)) {
	      return options.inverse(this);
	    } else {
	      return options.fn(this);
	    }
	  });

	  instance.registerHelper('unless', function (conditional, options) {
	    return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 15 */
/***/ (function(module, exports) {

	'use strict';

	exports.__esModule = true;

	exports['default'] = function (instance) {
	  instance.registerHelper('log', function () /* message, options */{
	    var args = [undefined],
	        options = arguments[arguments.length - 1];
	    for (var i = 0; i &lt; arguments.length - 1; i++) {
	      args.push(arguments[i]);
	    }

	    var level = 1;
	    if (options.hash.level != null) {
	      level = options.hash.level;
	    } else if (options.data &amp;&amp; options.data.level != null) {
	      level = options.data.level;
	    }
	    args[0] = level;

	    instance.log.apply(instance, args);
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 16 */
/***/ (function(module, exports) {

	'use strict';

	exports.__esModule = true;

	exports['default'] = function (instance) {
	  instance.registerHelper('lookup', function (obj, field) {
	    return obj &amp;&amp; obj[field];
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	exports.__esModule = true;

	var _utils = __webpack_require__(5);

	exports['default'] = function (instance) {
	  instance.registerHelper('with', function (context, options) {
	    if (_utils.isFunction(context)) {
	      context = context.call(this);
	    }

	    var fn = options.fn;

	    if (!_utils.isEmpty(context)) {
	      var data = options.data;
	      if (options.data &amp;&amp; options.ids) {
	        data = _utils.createFrame(options.data);
	        data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
	      }

	      return fn(context, {
	        data: data,
	        blockParams: _utils.blockParams([context], [data &amp;&amp; data.contextPath])
	      });
	    } else {
	      return options.inverse(this);
	    }
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;
	exports.registerDefaultDecorators = registerDefaultDecorators;

	var _decoratorsInline = __webpack_require__(19);

	var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);

	function registerDefaultDecorators(instance) {
	  _decoratorsInline2['default'](instance);
	}

/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	exports.__esModule = true;

	var _utils = __webpack_require__(5);

	exports['default'] = function (instance) {
	  instance.registerDecorator('inline', function (fn, props, container, options) {
	    var ret = fn;
	    if (!props.partials) {
	      props.partials = {};
	      ret = function (context, options) {
	        // Create a new partials stack frame prior to exec.
	        var original = container.partials;
	        container.partials = _utils.extend({}, original, props.partials);
	        var ret = fn(context, options);
	        container.partials = original;
	        return ret;
	      };
	    }

	    props.partials[options.args[0]] = options.fn;

	    return ret;
	  });
	};

	module.exports = exports['default'];

/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	exports.__esModule = true;

	var _utils = __webpack_require__(5);

	var logger = {
	  methodMap: ['debug', 'info', 'warn', 'error'],
	  level: 'info',

	  // Maps a given level value to the `methodMap` indexes above.
	  lookupLevel: function lookupLevel(level) {
	    if (typeof level === 'string') {
	      var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
	      if (levelMap &gt;= 0) {
	        level = levelMap;
	      } else {
	        level = parseInt(level, 10);
	      }
	    }

	    return level;
	  },

	  // Can be overridden in the host environment
	  log: function log(level) {
	    level = logger.lookupLevel(level);

	    if (typeof console !== 'undefined' &amp;&amp; logger.lookupLevel(logger.level) &lt;= level) {
	      var method = logger.methodMap[level];
	      if (!console[method]) {
	        // eslint-disable-line no-console
	        method = 'log';
	      }

	      for (var _len = arguments.length, message = Array(_len &gt; 1 ? _len - 1 : 0), _key = 1; _key &lt; _len; _key++) {
	        message[_key - 1] = arguments[_key];
	      }

	      console[method].apply(console, message); // eslint-disable-line no-console
	    }
	  }
	};

	exports['default'] = logger;
	module.exports = exports['default'];

/***/ }),
/* 21 */
/***/ (function(module, exports) {

	// Build out our basic SafeString type
	'use strict';

	exports.__esModule = true;
	function SafeString(string) {
	  this.string = string;
	}

	SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
	  return '' + this.string;
	};

	exports['default'] = SafeString;
	module.exports = exports['default'];

/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _Object$seal = __webpack_require__(23)['default'];

	var _interopRequireWildcard = __webpack_require__(3)['default'];

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;
	exports.checkRevision = checkRevision;
	exports.template = template;
	exports.wrapProgram = wrapProgram;
	exports.resolvePartial = resolvePartial;
	exports.invokePartial = invokePartial;
	exports.noop = noop;

	var _utils = __webpack_require__(5);

	var Utils = _interopRequireWildcard(_utils);

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	var _base = __webpack_require__(4);

	function checkRevision(compilerInfo) {
	  var compilerRevision = compilerInfo &amp;&amp; compilerInfo[0] || 1,
	      currentRevision = _base.COMPILER_REVISION;

	  if (compilerRevision !== currentRevision) {
	    if (compilerRevision &lt; currentRevision) {
	      var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
	          compilerVersions = _base.REVISION_CHANGES[compilerRevision];
	      throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
	    } else {
	      // Use the embedded version info since the runtime doesn't know about this revision yet
	      throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
	    }
	  }
	}

	function template(templateSpec, env) {
	  /* istanbul ignore next */
	  if (!env) {
	    throw new _exception2['default']('No environment passed to template');
	  }
	  if (!templateSpec || !templateSpec.main) {
	    throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
	  }

	  templateSpec.main.decorator = templateSpec.main_d;

	  // Note: Using env.VM references rather than local var references throughout this section to allow
	  // for external users to override these as psuedo-supported APIs.
	  env.VM.checkRevision(templateSpec.compiler);

	  function invokePartialWrapper(partial, context, options) {
	    if (options.hash) {
	      context = Utils.extend({}, context, options.hash);
	      if (options.ids) {
	        options.ids[0] = true;
	      }
	    }

	    partial = env.VM.resolvePartial.call(this, partial, context, options);
	    var result = env.VM.invokePartial.call(this, partial, context, options);

	    if (result == null &amp;&amp; env.compile) {
	      options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
	      result = options.partials[options.name](context, options);
	    }
	    if (result != null) {
	      if (options.indent) {
	        var lines = result.split('\n');
	        for (var i = 0, l = lines.length; i &lt; l; i++) {
	          if (!lines[i] &amp;&amp; i + 1 === l) {
	            break;
	          }

	          lines[i] = options.indent + lines[i];
	        }
	        result = lines.join('\n');
	      }
	      return result;
	    } else {
	      throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
	    }
	  }

	  // Just add water
	  var container = {
	    strict: function strict(obj, name) {
	      if (!(name in obj)) {
	        throw new _exception2['default']('"' + name + '" not defined in ' + obj);
	      }
	      return obj[name];
	    },
	    lookup: function lookup(depths, name) {
	      var len = depths.length;
	      for (var i = 0; i &lt; len; i++) {
	        if (depths[i] &amp;&amp; depths[i][name] != null) {
	          return depths[i][name];
	        }
	      }
	    },
	    lambda: function lambda(current, context) {
	      return typeof current === 'function' ? current.call(context) : current;
	    },

	    escapeExpression: Utils.escapeExpression,
	    invokePartial: invokePartialWrapper,

	    fn: function fn(i) {
	      var ret = templateSpec[i];
	      ret.decorator = templateSpec[i + '_d'];
	      return ret;
	    },

	    programs: [],
	    program: function program(i, data, declaredBlockParams, blockParams, depths) {
	      var programWrapper = this.programs[i],
	          fn = this.fn(i);
	      if (data || depths || blockParams || declaredBlockParams) {
	        programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
	      } else if (!programWrapper) {
	        programWrapper = this.programs[i] = wrapProgram(this, i, fn);
	      }
	      return programWrapper;
	    },

	    data: function data(value, depth) {
	      while (value &amp;&amp; depth--) {
	        value = value._parent;
	      }
	      return value;
	    },
	    merge: function merge(param, common) {
	      var obj = param || common;

	      if (param &amp;&amp; common &amp;&amp; param !== common) {
	        obj = Utils.extend({}, common, param);
	      }

	      return obj;
	    },
	    // An empty object to use as replacement for null-contexts
	    nullContext: _Object$seal({}),

	    noop: env.VM.noop,
	    compilerInfo: templateSpec.compiler
	  };

	  function ret(context) {
	    var options = arguments.length &lt;= 1 || arguments[1] === undefined ? {} : arguments[1];

	    var data = options.data;

	    ret._setup(options);
	    if (!options.partial &amp;&amp; templateSpec.useData) {
	      data = initData(context, data);
	    }
	    var depths = undefined,
	        blockParams = templateSpec.useBlockParams ? [] : undefined;
	    if (templateSpec.useDepths) {
	      if (options.depths) {
	        depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
	      } else {
	        depths = [context];
	      }
	    }

	    function main(context /*, options*/) {
	      return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
	    }
	    main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
	    return main(context, options);
	  }
	  ret.isTop = true;

	  ret._setup = function (options) {
	    if (!options.partial) {
	      container.helpers = container.merge(options.helpers, env.helpers);

	      if (templateSpec.usePartial) {
	        container.partials = container.merge(options.partials, env.partials);
	      }
	      if (templateSpec.usePartial || templateSpec.useDecorators) {
	        container.decorators = container.merge(options.decorators, env.decorators);
	      }
	    } else {
	      container.helpers = options.helpers;
	      container.partials = options.partials;
	      container.decorators = options.decorators;
	    }
	  };

	  ret._child = function (i, data, blockParams, depths) {
	    if (templateSpec.useBlockParams &amp;&amp; !blockParams) {
	      throw new _exception2['default']('must pass block params');
	    }
	    if (templateSpec.useDepths &amp;&amp; !depths) {
	      throw new _exception2['default']('must pass parent depths');
	    }

	    return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
	  };
	  return ret;
	}

	function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
	  function prog(context) {
	    var options = arguments.length &lt;= 1 || arguments[1] === undefined ? {} : arguments[1];

	    var currentDepths = depths;
	    if (depths &amp;&amp; context != depths[0] &amp;&amp; !(context === container.nullContext &amp;&amp; depths[0] === null)) {
	      currentDepths = [context].concat(depths);
	    }

	    return fn(container, context, container.helpers, container.partials, options.data || data, blockParams &amp;&amp; [options.blockParams].concat(blockParams), currentDepths);
	  }

	  prog = executeDecorators(fn, prog, container, depths, data, blockParams);

	  prog.program = i;
	  prog.depth = depths ? depths.length : 0;
	  prog.blockParams = declaredBlockParams || 0;
	  return prog;
	}

	function resolvePartial(partial, context, options) {
	  if (!partial) {
	    if (options.name === '@partial-block') {
	      partial = options.data['partial-block'];
	    } else {
	      partial = options.partials[options.name];
	    }
	  } else if (!partial.call &amp;&amp; !options.name) {
	    // This is a dynamic partial that returned a string
	    options.name = partial;
	    partial = options.partials[partial];
	  }
	  return partial;
	}

	function invokePartial(partial, context, options) {
	  // Use the current closure context to save the partial-block if this partial
	  var currentPartialBlock = options.data &amp;&amp; options.data['partial-block'];
	  options.partial = true;
	  if (options.ids) {
	    options.data.contextPath = options.ids[0] || options.data.contextPath;
	  }

	  var partialBlock = undefined;
	  if (options.fn &amp;&amp; options.fn !== noop) {
	    (function () {
	      options.data = _base.createFrame(options.data);
	      // Wrapper function to get access to currentPartialBlock from the closure
	      var fn = options.fn;
	      partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
	        var options = arguments.length &lt;= 1 || arguments[1] === undefined ? {} : arguments[1];

	        // Restore the partial-block from the closure for the execution of the block
	        // i.e. the part inside the block of the partial call.
	        options.data = _base.createFrame(options.data);
	        options.data['partial-block'] = currentPartialBlock;
	        return fn(context, options);
	      };
	      if (fn.partials) {
	        options.partials = Utils.extend({}, options.partials, fn.partials);
	      }
	    })();
	  }

	  if (partial === undefined &amp;&amp; partialBlock) {
	    partial = partialBlock;
	  }

	  if (partial === undefined) {
	    throw new _exception2['default']('The partial ' + options.name + ' could not be found');
	  } else if (partial instanceof Function) {
	    return partial(context, options);
	  }
	}

	function noop() {
	  return '';
	}

	function initData(context, data) {
	  if (!data || !('root' in data)) {
	    data = data ? _base.createFrame(data) : {};
	    data.root = context;
	  }
	  return data;
	}

	function executeDecorators(fn, prog, container, depths, data, blockParams) {
	  if (fn.decorator) {
	    var props = {};
	    prog = fn.decorator(prog, props, container, depths &amp;&amp; depths[0], data, blockParams, depths);
	    Utils.extend(prog, props);
	  }
	  return prog;
	}

/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {

	module.exports = { "default": __webpack_require__(24), __esModule: true };

/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {

	__webpack_require__(25);
	module.exports = __webpack_require__(30).Object.seal;

/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {

	// 19.1.2.17 Object.seal(O)
	var isObject = __webpack_require__(26);

	__webpack_require__(27)('seal', function($seal){
	  return function seal(it){
	    return $seal &amp;&amp; isObject(it) ? $seal(it) : it;
	  };
	});

/***/ }),
/* 26 */
/***/ (function(module, exports) {

	module.exports = function(it){
	  return typeof it === 'object' ? it !== null : typeof it === 'function';
	};

/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {

	// most Object methods by ES6 should accept primitives
	var $export = __webpack_require__(28)
	  , core    = __webpack_require__(30)
	  , fails   = __webpack_require__(33);
	module.exports = function(KEY, exec){
	  var fn  = (core.Object || {})[KEY] || Object[KEY]
	    , exp = {};
	  exp[KEY] = exec(fn);
	  $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
	};

/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {

	var global    = __webpack_require__(29)
	  , core      = __webpack_require__(30)
	  , ctx       = __webpack_require__(31)
	  , PROTOTYPE = 'prototype';

	var $export = function(type, name, source){
	  var IS_FORCED = type &amp; $export.F
	    , IS_GLOBAL = type &amp; $export.G
	    , IS_STATIC = type &amp; $export.S
	    , IS_PROTO  = type &amp; $export.P
	    , IS_BIND   = type &amp; $export.B
	    , IS_WRAP   = type &amp; $export.W
	    , exports   = IS_GLOBAL ? core : core[name] || (core[name] = {})
	    , target    = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
	    , key, own, out;
	  if(IS_GLOBAL)source = name;
	  for(key in source){
	    // contains in native
	    own = !IS_FORCED &amp;&amp; target &amp;&amp; key in target;
	    if(own &amp;&amp; key in exports)continue;
	    // export native or passed
	    out = own ? target[key] : source[key];
	    // prevent global pollution for namespaces
	    exports[key] = IS_GLOBAL &amp;&amp; typeof target[key] != 'function' ? source[key]
	    // bind timers to global for call from export context
	    : IS_BIND &amp;&amp; own ? ctx(out, global)
	    // wrap global constructors for prevent change them in library
	    : IS_WRAP &amp;&amp; target[key] == out ? (function(C){
	      var F = function(param){
	        return this instanceof C ? new C(param) : C(param);
	      };
	      F[PROTOTYPE] = C[PROTOTYPE];
	      return F;
	    // make static versions for prototype methods
	    })(out) : IS_PROTO &amp;&amp; typeof out == 'function' ? ctx(Function.call, out) : out;
	    if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
	  }
	};
	// type bitmap
	$export.F = 1;  // forced
	$export.G = 2;  // global
	$export.S = 4;  // static
	$export.P = 8;  // proto
	$export.B = 16; // bind
	$export.W = 32; // wrap
	module.exports = $export;

/***/ }),
/* 29 */
/***/ (function(module, exports) {

	// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
	var global = module.exports = typeof window != 'undefined' &amp;&amp; window.Math == Math
	  ? window : typeof self != 'undefined' &amp;&amp; self.Math == Math ? self : Function('return this')();
	if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef

/***/ }),
/* 30 */
/***/ (function(module, exports) {

	var core = module.exports = {version: '1.2.6'};
	if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef

/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {

	// optional / simple context binding
	var aFunction = __webpack_require__(32);
	module.exports = function(fn, that, length){
	  aFunction(fn);
	  if(that === undefined)return fn;
	  switch(length){
	    case 1: return function(a){
	      return fn.call(that, a);
	    };
	    case 2: return function(a, b){
	      return fn.call(that, a, b);
	    };
	    case 3: return function(a, b, c){
	      return fn.call(that, a, b, c);
	    };
	  }
	  return function(/* ...args */){
	    return fn.apply(that, arguments);
	  };
	};

/***/ }),
/* 32 */
/***/ (function(module, exports) {

	module.exports = function(it){
	  if(typeof it != 'function')throw TypeError(it + ' is not a function!');
	  return it;
	};

/***/ }),
/* 33 */
/***/ (function(module, exports) {

	module.exports = function(exec){
	  try {
	    return !!exec();
	  } catch(e){
	    return true;
	  }
	};

/***/ }),
/* 34 */
/***/ (function(module, exports) {

	/* WEBPACK VAR INJECTION */(function(global) {/* global window */
	'use strict';

	exports.__esModule = true;

	exports['default'] = function (Handlebars) {
	  /* istanbul ignore next */
	  var root = typeof global !== 'undefined' ? global : window,
	      $Handlebars = root.Handlebars;
	  /* istanbul ignore next */
	  Handlebars.noConflict = function () {
	    if (root.Handlebars === Handlebars) {
	      root.Handlebars = $Handlebars;
	    }
	    return Handlebars;
	  };
	};

	module.exports = exports['default'];
	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))

/***/ }),
/* 35 */
/***/ (function(module, exports) {

	'use strict';

	exports.__esModule = true;
	var AST = {
	  // Public API used to evaluate derived attributes regarding AST nodes
	  helpers: {
	    // a mustache is definitely a helper if:
	    // * it is an eligible helper, and
	    // * it has at least one parameter or hash segment
	    helperExpression: function helperExpression(node) {
	      return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') &amp;&amp; !!(node.params &amp;&amp; node.params.length || node.hash);
	    },

	    scopedId: function scopedId(path) {
	      return (/^\.|this\b/.test(path.original)
	      );
	    },

	    // an ID is simple if it only has one part, and that part is not
	    // `..` or `this`.
	    simpleId: function simpleId(path) {
	      return path.parts.length === 1 &amp;&amp; !AST.helpers.scopedId(path) &amp;&amp; !path.depth;
	    }
	  }
	};

	// Must be exported as an object rather than the root of the module as the jison lexer
	// must modify the object to operate properly.
	exports['default'] = AST;
	module.exports = exports['default'];

/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	var _interopRequireWildcard = __webpack_require__(3)['default'];

	exports.__esModule = true;
	exports.parse = parse;

	var _parser = __webpack_require__(37);

	var _parser2 = _interopRequireDefault(_parser);

	var _whitespaceControl = __webpack_require__(38);

	var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);

	var _helpers = __webpack_require__(40);

	var Helpers = _interopRequireWildcard(_helpers);

	var _utils = __webpack_require__(5);

	exports.parser = _parser2['default'];

	var yy = {};
	_utils.extend(yy, Helpers);

	function parse(input, options) {
	  // Just return if an already-compiled AST was passed in.
	  if (input.type === 'Program') {
	    return input;
	  }

	  _parser2['default'].yy = yy;

	  // Altering the shared object here, but this is ok as parser is a sync operation
	  yy.locInfo = function (locInfo) {
	    return new yy.SourceLocation(options &amp;&amp; options.srcName, locInfo);
	  };

	  var strip = new _whitespaceControl2['default'](options);
	  return strip.accept(_parser2['default'].parse(input));
	}

/***/ }),
/* 37 */
/***/ (function(module, exports) {

	// File ignored in coverage tests via setting in .istanbul.yml
	/* Jison generated parser */
	"use strict";

	exports.__esModule = true;
	var handlebars = (function () {
	    var parser = { trace: function trace() {},
	        yy: {},
	        symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
	        terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
	        productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
	        performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
	        /**/) {

	            var $0 = $$.length - 1;
	            switch (yystate) {
	                case 1:
	                    return $$[$0 - 1];
	                    break;
	                case 2:
	                    this.$ = yy.prepareProgram($$[$0]);
	                    break;
	                case 3:
	                    this.$ = $$[$0];
	                    break;
	                case 4:
	                    this.$ = $$[$0];
	                    break;
	                case 5:
	                    this.$ = $$[$0];
	                    break;
	                case 6:
	                    this.$ = $$[$0];
	                    break;
	                case 7:
	                    this.$ = $$[$0];
	                    break;
	                case 8:
	                    this.$ = $$[$0];
	                    break;
	                case 9:
	                    this.$ = {
	                        type: 'CommentStatement',
	                        value: yy.stripComment($$[$0]),
	                        strip: yy.stripFlags($$[$0], $$[$0]),
	                        loc: yy.locInfo(this._$)
	                    };

	                    break;
	                case 10:
	                    this.$ = {
	                        type: 'ContentStatement',
	                        original: $$[$0],
	                        value: $$[$0],
	                        loc: yy.locInfo(this._$)
	                    };

	                    break;
	                case 11:
	                    this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
	                    break;
	                case 12:
	                    this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
	                    break;
	                case 13:
	                    this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
	                    break;
	                case 14:
	                    this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
	                    break;
	                case 15:
	                    this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
	                    break;
	                case 16:
	                    this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
	                    break;
	                case 17:
	                    this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
	                    break;
	                case 18:
	                    this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
	                    break;
	                case 19:
	                    var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
	                        program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
	                    program.chained = true;

	                    this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };

	                    break;
	                case 20:
	                    this.$ = $$[$0];
	                    break;
	                case 21:
	                    this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
	                    break;
	                case 22:
	                    this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
	                    break;
	                case 23:
	                    this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
	                    break;
	                case 24:
	                    this.$ = {
	                        type: 'PartialStatement',
	                        name: $$[$0 - 3],
	                        params: $$[$0 - 2],
	                        hash: $$[$0 - 1],
	                        indent: '',
	                        strip: yy.stripFlags($$[$0 - 4], $$[$0]),
	                        loc: yy.locInfo(this._$)
	                    };

	                    break;
	                case 25:
	                    this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
	                    break;
	                case 26:
	                    this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
	                    break;
	                case 27:
	                    this.$ = $$[$0];
	                    break;
	                case 28:
	                    this.$ = $$[$0];
	                    break;
	                case 29:
	                    this.$ = {
	                        type: 'SubExpression',
	                        path: $$[$0 - 3],
	                        params: $$[$0 - 2],
	                        hash: $$[$0 - 1],
	                        loc: yy.locInfo(this._$)
	                    };

	                    break;
	                case 30:
	                    this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
	                    break;
	                case 31:
	                    this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
	                    break;
	                case 32:
	                    this.$ = yy.id($$[$0 - 1]);
	                    break;
	                case 33:
	                    this.$ = $$[$0];
	                    break;
	                case 34:
	                    this.$ = $$[$0];
	                    break;
	                case 35:
	                    this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
	                    break;
	                case 36:
	                    this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
	                    break;
	                case 37:
	                    this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
	                    break;
	                case 38:
	                    this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
	                    break;
	                case 39:
	                    this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
	                    break;
	                case 40:
	                    this.$ = $$[$0];
	                    break;
	                case 41:
	                    this.$ = $$[$0];
	                    break;
	                case 42:
	                    this.$ = yy.preparePath(true, $$[$0], this._$);
	                    break;
	                case 43:
	                    this.$ = yy.preparePath(false, $$[$0], this._$);
	                    break;
	                case 44:
	                    $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
	                    break;
	                case 45:
	                    this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
	                    break;
	                case 46:
	                    this.$ = [];
	                    break;
	                case 47:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 48:
	                    this.$ = [$$[$0]];
	                    break;
	                case 49:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 50:
	                    this.$ = [];
	                    break;
	                case 51:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 58:
	                    this.$ = [];
	                    break;
	                case 59:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 64:
	                    this.$ = [];
	                    break;
	                case 65:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 70:
	                    this.$ = [];
	                    break;
	                case 71:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 78:
	                    this.$ = [];
	                    break;
	                case 79:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 82:
	                    this.$ = [];
	                    break;
	                case 83:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 86:
	                    this.$ = [];
	                    break;
	                case 87:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 90:
	                    this.$ = [];
	                    break;
	                case 91:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 94:
	                    this.$ = [];
	                    break;
	                case 95:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 98:
	                    this.$ = [$$[$0]];
	                    break;
	                case 99:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	                case 100:
	                    this.$ = [$$[$0]];
	                    break;
	                case 101:
	                    $$[$0 - 1].push($$[$0]);
	                    break;
	            }
	        },
	        table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
	        defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
	        parseError: function parseError(str, hash) {
	            throw new Error(str);
	        },
	        parse: function parse(input) {
	            var self = this,
	                stack = [0],
	                vstack = [null],
	                lstack = [],
	                table = this.table,
	                yytext = "",
	                yylineno = 0,
	                yyleng = 0,
	                recovering = 0,
	                TERROR = 2,
	                EOF = 1;
	            this.lexer.setInput(input);
	            this.lexer.yy = this.yy;
	            this.yy.lexer = this.lexer;
	            this.yy.parser = this;
	            if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
	            var yyloc = this.lexer.yylloc;
	            lstack.push(yyloc);
	            var ranges = this.lexer.options &amp;&amp; this.lexer.options.ranges;
	            if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
	            function popStack(n) {
	                stack.length = stack.length - 2 * n;
	                vstack.length = vstack.length - n;
	                lstack.length = lstack.length - n;
	            }
	            function lex() {
	                var token;
	                token = self.lexer.lex() || 1;
	                if (typeof token !== "number") {
	                    token = self.symbols_[token] || token;
	                }
	                return token;
	            }
	            var symbol,
	                preErrorSymbol,
	                state,
	                action,
	                a,
	                r,
	                yyval = {},
	                p,
	                len,
	                newState,
	                expected;
	            while (true) {
	                state = stack[stack.length - 1];
	                if (this.defaultActions[state]) {
	                    action = this.defaultActions[state];
	                } else {
	                    if (symbol === null || typeof symbol == "undefined") {
	                        symbol = lex();
	                    }
	                    action = table[state] &amp;&amp; table[state][symbol];
	                }
	                if (typeof action === "undefined" || !action.length || !action[0]) {
	                    var errStr = "";
	                    if (!recovering) {
	                        expected = [];
	                        for (p in table[state]) if (this.terminals_[p] &amp;&amp; p &gt; 2) {
	                            expected.push("'" + this.terminals_[p] + "'");
	                        }
	                        if (this.lexer.showPosition) {
	                            errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
	                        } else {
	                            errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
	                        }
	                        this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
	                    }
	                }
	                if (action[0] instanceof Array &amp;&amp; action.length &gt; 1) {
	                    throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
	                }
	                switch (action[0]) {
	                    case 1:
	                        stack.push(symbol);
	                        vstack.push(this.lexer.yytext);
	                        lstack.push(this.lexer.yylloc);
	                        stack.push(action[1]);
	                        symbol = null;
	                        if (!preErrorSymbol) {
	                            yyleng = this.lexer.yyleng;
	                            yytext = this.lexer.yytext;
	                            yylineno = this.lexer.yylineno;
	                            yyloc = this.lexer.yylloc;
	                            if (recovering &gt; 0) recovering--;
	                        } else {
	                            symbol = preErrorSymbol;
	                            preErrorSymbol = null;
	                        }
	                        break;
	                    case 2:
	                        len = this.productions_[action[1]][1];
	                        yyval.$ = vstack[vstack.length - len];
	                        yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
	                        if (ranges) {
	                            yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
	                        }
	                        r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
	                        if (typeof r !== "undefined") {
	                            return r;
	                        }
	                        if (len) {
	                            stack = stack.slice(0, -1 * len * 2);
	                            vstack = vstack.slice(0, -1 * len);
	                            lstack = lstack.slice(0, -1 * len);
	                        }
	                        stack.push(this.productions_[action[1]][0]);
	                        vstack.push(yyval.$);
	                        lstack.push(yyval._$);
	                        newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
	                        stack.push(newState);
	                        break;
	                    case 3:
	                        return true;
	                }
	            }
	            return true;
	        }
	    };
	    /* Jison generated lexer */
	    var lexer = (function () {
	        var lexer = { EOF: 1,
	            parseError: function parseError(str, hash) {
	                if (this.yy.parser) {
	                    this.yy.parser.parseError(str, hash);
	                } else {
	                    throw new Error(str);
	                }
	            },
	            setInput: function setInput(input) {
	                this._input = input;
	                this._more = this._less = this.done = false;
	                this.yylineno = this.yyleng = 0;
	                this.yytext = this.matched = this.match = '';
	                this.conditionStack = ['INITIAL'];
	                this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
	                if (this.options.ranges) this.yylloc.range = [0, 0];
	                this.offset = 0;
	                return this;
	            },
	            input: function input() {
	                var ch = this._input[0];
	                this.yytext += ch;
	                this.yyleng++;
	                this.offset++;
	                this.match += ch;
	                this.matched += ch;
	                var lines = ch.match(/(?:\r\n?|\n).*/g);
	                if (lines) {
	                    this.yylineno++;
	                    this.yylloc.last_line++;
	                } else {
	                    this.yylloc.last_column++;
	                }
	                if (this.options.ranges) this.yylloc.range[1]++;

	                this._input = this._input.slice(1);
	                return ch;
	            },
	            unput: function unput(ch) {
	                var len = ch.length;
	                var lines = ch.split(/(?:\r\n?|\n)/g);

	                this._input = ch + this._input;
	                this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
	                //this.yyleng -= len;
	                this.offset -= len;
	                var oldLines = this.match.split(/(?:\r\n?|\n)/g);
	                this.match = this.match.substr(0, this.match.length - 1);
	                this.matched = this.matched.substr(0, this.matched.length - 1);

	                if (lines.length - 1) this.yylineno -= lines.length - 1;
	                var r = this.yylloc.range;

	                this.yylloc = { first_line: this.yylloc.first_line,
	                    last_line: this.yylineno + 1,
	                    first_column: this.yylloc.first_column,
	                    last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
	                };

	                if (this.options.ranges) {
	                    this.yylloc.range = [r[0], r[0] + this.yyleng - len];
	                }
	                return this;
	            },
	            more: function more() {
	                this._more = true;
	                return this;
	            },
	            less: function less(n) {
	                this.unput(this.match.slice(n));
	            },
	            pastInput: function pastInput() {
	                var past = this.matched.substr(0, this.matched.length - this.match.length);
	                return (past.length &gt; 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
	            },
	            upcomingInput: function upcomingInput() {
	                var next = this.match;
	                if (next.length &lt; 20) {
	                    next += this._input.substr(0, 20 - next.length);
	                }
	                return (next.substr(0, 20) + (next.length &gt; 20 ? '...' : '')).replace(/\n/g, "");
	            },
	            showPosition: function showPosition() {
	                var pre = this.pastInput();
	                var c = new Array(pre.length + 1).join("-");
	                return pre + this.upcomingInput() + "\n" + c + "^";
	            },
	            next: function next() {
	                if (this.done) {
	                    return this.EOF;
	                }
	                if (!this._input) this.done = true;

	                var token, match, tempMatch, index, col, lines;
	                if (!this._more) {
	                    this.yytext = '';
	                    this.match = '';
	                }
	                var rules = this._currentRules();
	                for (var i = 0; i &lt; rules.length; i++) {
	                    tempMatch = this._input.match(this.rules[rules[i]]);
	                    if (tempMatch &amp;&amp; (!match || tempMatch[0].length &gt; match[0].length)) {
	                        match = tempMatch;
	                        index = i;
	                        if (!this.options.flex) break;
	                    }
	                }
	                if (match) {
	                    lines = match[0].match(/(?:\r\n?|\n).*/g);
	                    if (lines) this.yylineno += lines.length;
	                    this.yylloc = { first_line: this.yylloc.last_line,
	                        last_line: this.yylineno + 1,
	                        first_column: this.yylloc.last_column,
	                        last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
	                    this.yytext += match[0];
	                    this.match += match[0];
	                    this.matches = match;
	                    this.yyleng = this.yytext.length;
	                    if (this.options.ranges) {
	                        this.yylloc.range = [this.offset, this.offset += this.yyleng];
	                    }
	                    this._more = false;
	                    this._input = this._input.slice(match[0].length);
	                    this.matched += match[0];
	                    token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
	                    if (this.done &amp;&amp; this._input) this.done = false;
	                    if (token) return token;else return;
	                }
	                if (this._input === "") {
	                    return this.EOF;
	                } else {
	                    return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
	                }
	            },
	            lex: function lex() {
	                var r = this.next();
	                if (typeof r !== 'undefined') {
	                    return r;
	                } else {
	                    return this.lex();
	                }
	            },
	            begin: function begin(condition) {
	                this.conditionStack.push(condition);
	            },
	            popState: function popState() {
	                return this.conditionStack.pop();
	            },
	            _currentRules: function _currentRules() {
	                return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
	            },
	            topState: function topState() {
	                return this.conditionStack[this.conditionStack.length - 2];
	            },
	            pushState: function begin(condition) {
	                this.begin(condition);
	            } };
	        lexer.options = {};
	        lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
	        /**/) {

	            function strip(start, end) {
	                return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
	            }

	            var YYSTATE = YY_START;
	            switch ($avoiding_name_collisions) {
	                case 0:
	                    if (yy_.yytext.slice(-2) === "\\\\") {
	                        strip(0, 1);
	                        this.begin("mu");
	                    } else if (yy_.yytext.slice(-1) === "\\") {
	                        strip(0, 1);
	                        this.begin("emu");
	                    } else {
	                        this.begin("mu");
	                    }
	                    if (yy_.yytext) return 15;

	                    break;
	                case 1:
	                    return 15;
	                    break;
	                case 2:
	                    this.popState();
	                    return 15;

	                    break;
	                case 3:
	                    this.begin('raw');return 15;
	                    break;
	                case 4:
	                    this.popState();
	                    // Should be using `this.topState()` below, but it currently
	                    // returns the second top instead of the first top. Opened an
	                    // issue about it at https://github.com/zaach/jison/issues/291
	                    if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
	                        return 15;
	                    } else {
	                        yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
	                        return 'END_RAW_BLOCK';
	                    }

	                    break;
	                case 5:
	                    return 15;
	                    break;
	                case 6:
	                    this.popState();
	                    return 14;

	                    break;
	                case 7:
	                    return 65;
	                    break;
	                case 8:
	                    return 68;
	                    break;
	                case 9:
	                    return 19;
	                    break;
	                case 10:
	                    this.popState();
	                    this.begin('raw');
	                    return 23;

	                    break;
	                case 11:
	                    return 55;
	                    break;
	                case 12:
	                    return 60;
	                    break;
	                case 13:
	                    return 29;
	                    break;
	                case 14:
	                    return 47;
	                    break;
	                case 15:
	                    this.popState();return 44;
	                    break;
	                case 16:
	                    this.popState();return 44;
	                    break;
	                case 17:
	                    return 34;
	                    break;
	                case 18:
	                    return 39;
	                    break;
	                case 19:
	                    return 51;
	                    break;
	                case 20:
	                    return 48;
	                    break;
	                case 21:
	                    this.unput(yy_.yytext);
	                    this.popState();
	                    this.begin('com');

	                    break;
	                case 22:
	                    this.popState();
	                    return 14;

	                    break;
	                case 23:
	                    return 48;
	                    break;
	                case 24:
	                    return 73;
	                    break;
	                case 25:
	                    return 72;
	                    break;
	                case 26:
	                    return 72;
	                    break;
	                case 27:
	                    return 87;
	                    break;
	                case 28:
	                    // ignore whitespace
	                    break;
	                case 29:
	                    this.popState();return 54;
	                    break;
	                case 30:
	                    this.popState();return 33;
	                    break;
	                case 31:
	                    yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
	                    break;
	                case 32:
	                    yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
	                    break;
	                case 33:
	                    return 85;
	                    break;
	                case 34:
	                    return 82;
	                    break;
	                case 35:
	                    return 82;
	                    break;
	                case 36:
	                    return 83;
	                    break;
	                case 37:
	                    return 84;
	                    break;
	                case 38:
	                    return 81;
	                    break;
	                case 39:
	                    return 75;
	                    break;
	                case 40:
	                    return 77;
	                    break;
	                case 41:
	                    return 72;
	                    break;
	                case 42:
	                    yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
	                    break;
	                case 43:
	                    return 'INVALID';
	                    break;
	                case 44:
	                    return 5;
	                    break;
	            }
	        };
	        lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;-&gt;@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?&gt;)/, /^(?:\{\{(~)?#&gt;)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&amp;)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;-&gt;@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
	        lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
	        return lexer;
	    })();
	    parser.lexer = lexer;
	    function Parser() {
	        this.yy = {};
	    }Parser.prototype = parser;parser.Parser = Parser;
	    return new Parser();
	})();exports["default"] = handlebars;
	module.exports = exports["default"];

/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;

	var _visitor = __webpack_require__(39);

	var _visitor2 = _interopRequireDefault(_visitor);

	function WhitespaceControl() {
	  var options = arguments.length &lt;= 0 || arguments[0] === undefined ? {} : arguments[0];

	  this.options = options;
	}
	WhitespaceControl.prototype = new _visitor2['default']();

	WhitespaceControl.prototype.Program = function (program) {
	  var doStandalone = !this.options.ignoreStandalone;

	  var isRoot = !this.isRootSeen;
	  this.isRootSeen = true;

	  var body = program.body;
	  for (var i = 0, l = body.length; i &lt; l; i++) {
	    var current = body[i],
	        strip = this.accept(current);

	    if (!strip) {
	      continue;
	    }

	    var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
	        _isNextWhitespace = isNextWhitespace(body, i, isRoot),
	        openStandalone = strip.openStandalone &amp;&amp; _isPrevWhitespace,
	        closeStandalone = strip.closeStandalone &amp;&amp; _isNextWhitespace,
	        inlineStandalone = strip.inlineStandalone &amp;&amp; _isPrevWhitespace &amp;&amp; _isNextWhitespace;

	    if (strip.close) {
	      omitRight(body, i, true);
	    }
	    if (strip.open) {
	      omitLeft(body, i, true);
	    }

	    if (doStandalone &amp;&amp; inlineStandalone) {
	      omitRight(body, i);

	      if (omitLeft(body, i)) {
	        // If we are on a standalone node, save the indent info for partials
	        if (current.type === 'PartialStatement') {
	          // Pull out the whitespace from the final line
	          current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
	        }
	      }
	    }
	    if (doStandalone &amp;&amp; openStandalone) {
	      omitRight((current.program || current.inverse).body);

	      // Strip out the previous content node if it's whitespace only
	      omitLeft(body, i);
	    }
	    if (doStandalone &amp;&amp; closeStandalone) {
	      // Always strip the next node
	      omitRight(body, i);

	      omitLeft((current.inverse || current.program).body);
	    }
	  }

	  return program;
	};

	WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
	  this.accept(block.program);
	  this.accept(block.inverse);

	  // Find the inverse program that is involed with whitespace stripping.
	  var program = block.program || block.inverse,
	      inverse = block.program &amp;&amp; block.inverse,
	      firstInverse = inverse,
	      lastInverse = inverse;

	  if (inverse &amp;&amp; inverse.chained) {
	    firstInverse = inverse.body[0].program;

	    // Walk the inverse chain to find the last inverse that is actually in the chain.
	    while (lastInverse.chained) {
	      lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
	    }
	  }

	  var strip = {
	    open: block.openStrip.open,
	    close: block.closeStrip.close,

	    // Determine the standalone candiacy. Basically flag our content as being possibly standalone
	    // so our parent can determine if we actually are standalone
	    openStandalone: isNextWhitespace(program.body),
	    closeStandalone: isPrevWhitespace((firstInverse || program).body)
	  };

	  if (block.openStrip.close) {
	    omitRight(program.body, null, true);
	  }

	  if (inverse) {
	    var inverseStrip = block.inverseStrip;

	    if (inverseStrip.open) {
	      omitLeft(program.body, null, true);
	    }

	    if (inverseStrip.close) {
	      omitRight(firstInverse.body, null, true);
	    }
	    if (block.closeStrip.open) {
	      omitLeft(lastInverse.body, null, true);
	    }

	    // Find standalone else statments
	    if (!this.options.ignoreStandalone &amp;&amp; isPrevWhitespace(program.body) &amp;&amp; isNextWhitespace(firstInverse.body)) {
	      omitLeft(program.body);
	      omitRight(firstInverse.body);
	    }
	  } else if (block.closeStrip.open) {
	    omitLeft(program.body, null, true);
	  }

	  return strip;
	};

	WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
	  return mustache.strip;
	};

	WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
	  /* istanbul ignore next */
	  var strip = node.strip || {};
	  return {
	    inlineStandalone: true,
	    open: strip.open,
	    close: strip.close
	  };
	};

	function isPrevWhitespace(body, i, isRoot) {
	  if (i === undefined) {
	    i = body.length;
	  }

	  // Nodes that end with newlines are considered whitespace (but are special
	  // cased for strip operations)
	  var prev = body[i - 1],
	      sibling = body[i - 2];
	  if (!prev) {
	    return isRoot;
	  }

	  if (prev.type === 'ContentStatement') {
	    return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
	  }
	}
	function isNextWhitespace(body, i, isRoot) {
	  if (i === undefined) {
	    i = -1;
	  }

	  var next = body[i + 1],
	      sibling = body[i + 2];
	  if (!next) {
	    return isRoot;
	  }

	  if (next.type === 'ContentStatement') {
	    return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
	  }
	}

	// Marks the node to the right of the position as omitted.
	// I.e. {{foo}}' ' will mark the ' ' node as omitted.
	//
	// If i is undefined, then the first child will be marked as such.
	//
	// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
	// content is met.
	function omitRight(body, i, multiple) {
	  var current = body[i == null ? 0 : i + 1];
	  if (!current || current.type !== 'ContentStatement' || !multiple &amp;&amp; current.rightStripped) {
	    return;
	  }

	  var original = current.value;
	  current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
	  current.rightStripped = current.value !== original;
	}

	// Marks the node to the left of the position as omitted.
	// I.e. ' '{{foo}} will mark the ' ' node as omitted.
	//
	// If i is undefined then the last child will be marked as such.
	//
	// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
	// content is met.
	function omitLeft(body, i, multiple) {
	  var current = body[i == null ? body.length - 1 : i - 1];
	  if (!current || current.type !== 'ContentStatement' || !multiple &amp;&amp; current.leftStripped) {
	    return;
	  }

	  // We omit the last node if it's whitespace only and not preceeded by a non-content node.
	  var original = current.value;
	  current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
	  current.leftStripped = current.value !== original;
	  return current.leftStripped;
	}

	exports['default'] = WhitespaceControl;
	module.exports = exports['default'];

/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	function Visitor() {
	  this.parents = [];
	}

	Visitor.prototype = {
	  constructor: Visitor,
	  mutating: false,

	  // Visits a given value. If mutating, will replace the value if necessary.
	  acceptKey: function acceptKey(node, name) {
	    var value = this.accept(node[name]);
	    if (this.mutating) {
	      // Hacky sanity check: This may have a few false positives for type for the helper
	      // methods but will generally do the right thing without a lot of overhead.
	      if (value &amp;&amp; !Visitor.prototype[value.type]) {
	        throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
	      }
	      node[name] = value;
	    }
	  },

	  // Performs an accept operation with added sanity check to ensure
	  // required keys are not removed.
	  acceptRequired: function acceptRequired(node, name) {
	    this.acceptKey(node, name);

	    if (!node[name]) {
	      throw new _exception2['default'](node.type + ' requires ' + name);
	    }
	  },

	  // Traverses a given array. If mutating, empty respnses will be removed
	  // for child elements.
	  acceptArray: function acceptArray(array) {
	    for (var i = 0, l = array.length; i &lt; l; i++) {
	      this.acceptKey(array, i);

	      if (!array[i]) {
	        array.splice(i, 1);
	        i--;
	        l--;
	      }
	    }
	  },

	  accept: function accept(object) {
	    if (!object) {
	      return;
	    }

	    /* istanbul ignore next: Sanity code */
	    if (!this[object.type]) {
	      throw new _exception2['default']('Unknown type: ' + object.type, object);
	    }

	    if (this.current) {
	      this.parents.unshift(this.current);
	    }
	    this.current = object;

	    var ret = this[object.type](object);

	    this.current = this.parents.shift();

	    if (!this.mutating || ret) {
	      return ret;
	    } else if (ret !== false) {
	      return object;
	    }
	  },

	  Program: function Program(program) {
	    this.acceptArray(program.body);
	  },

	  MustacheStatement: visitSubExpression,
	  Decorator: visitSubExpression,

	  BlockStatement: visitBlock,
	  DecoratorBlock: visitBlock,

	  PartialStatement: visitPartial,
	  PartialBlockStatement: function PartialBlockStatement(partial) {
	    visitPartial.call(this, partial);

	    this.acceptKey(partial, 'program');
	  },

	  ContentStatement: function ContentStatement() /* content */{},
	  CommentStatement: function CommentStatement() /* comment */{},

	  SubExpression: visitSubExpression,

	  PathExpression: function PathExpression() /* path */{},

	  StringLiteral: function StringLiteral() /* string */{},
	  NumberLiteral: function NumberLiteral() /* number */{},
	  BooleanLiteral: function BooleanLiteral() /* bool */{},
	  UndefinedLiteral: function UndefinedLiteral() /* literal */{},
	  NullLiteral: function NullLiteral() /* literal */{},

	  Hash: function Hash(hash) {
	    this.acceptArray(hash.pairs);
	  },
	  HashPair: function HashPair(pair) {
	    this.acceptRequired(pair, 'value');
	  }
	};

	function visitSubExpression(mustache) {
	  this.acceptRequired(mustache, 'path');
	  this.acceptArray(mustache.params);
	  this.acceptKey(mustache, 'hash');
	}
	function visitBlock(block) {
	  visitSubExpression.call(this, block);

	  this.acceptKey(block, 'program');
	  this.acceptKey(block, 'inverse');
	}
	function visitPartial(partial) {
	  this.acceptRequired(partial, 'name');
	  this.acceptArray(partial.params);
	  this.acceptKey(partial, 'hash');
	}

	exports['default'] = Visitor;
	module.exports = exports['default'];

/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;
	exports.SourceLocation = SourceLocation;
	exports.id = id;
	exports.stripFlags = stripFlags;
	exports.stripComment = stripComment;
	exports.preparePath = preparePath;
	exports.prepareMustache = prepareMustache;
	exports.prepareRawBlock = prepareRawBlock;
	exports.prepareBlock = prepareBlock;
	exports.prepareProgram = prepareProgram;
	exports.preparePartialBlock = preparePartialBlock;

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	function validateClose(open, close) {
	  close = close.path ? close.path.original : close;

	  if (open.path.original !== close) {
	    var errorNode = { loc: open.path.loc };

	    throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
	  }
	}

	function SourceLocation(source, locInfo) {
	  this.source = source;
	  this.start = {
	    line: locInfo.first_line,
	    column: locInfo.first_column
	  };
	  this.end = {
	    line: locInfo.last_line,
	    column: locInfo.last_column
	  };
	}

	function id(token) {
	  if (/^\[.*\]$/.test(token)) {
	    return token.substr(1, token.length - 2);
	  } else {
	    return token;
	  }
	}

	function stripFlags(open, close) {
	  return {
	    open: open.charAt(2) === '~',
	    close: close.charAt(close.length - 3) === '~'
	  };
	}

	function stripComment(comment) {
	  return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, '');
	}

	function preparePath(data, parts, loc) {
	  loc = this.locInfo(loc);

	  var original = data ? '@' : '',
	      dig = [],
	      depth = 0,
	      depthString = '';

	  for (var i = 0, l = parts.length; i &lt; l; i++) {
	    var part = parts[i].part,

	    // If we have [] syntax then we do not treat path references as operators,
	    // i.e. foo.[this] resolves to approximately context.foo['this']
	    isLiteral = parts[i].original !== part;
	    original += (parts[i].separator || '') + part;

	    if (!isLiteral &amp;&amp; (part === '..' || part === '.' || part === 'this')) {
	      if (dig.length &gt; 0) {
	        throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
	      } else if (part === '..') {
	        depth++;
	        depthString += '../';
	      }
	    } else {
	      dig.push(part);
	    }
	  }

	  return {
	    type: 'PathExpression',
	    data: data,
	    depth: depth,
	    parts: dig,
	    original: original,
	    loc: loc
	  };
	}

	function prepareMustache(path, params, hash, open, strip, locInfo) {
	  // Must use charAt to support IE pre-10
	  var escapeFlag = open.charAt(3) || open.charAt(2),
	      escaped = escapeFlag !== '{' &amp;&amp; escapeFlag !== '&amp;';

	  var decorator = /\*/.test(open);
	  return {
	    type: decorator ? 'Decorator' : 'MustacheStatement',
	    path: path,
	    params: params,
	    hash: hash,
	    escaped: escaped,
	    strip: strip,
	    loc: this.locInfo(locInfo)
	  };
	}

	function prepareRawBlock(openRawBlock, contents, close, locInfo) {
	  validateClose(openRawBlock, close);

	  locInfo = this.locInfo(locInfo);
	  var program = {
	    type: 'Program',
	    body: contents,
	    strip: {},
	    loc: locInfo
	  };

	  return {
	    type: 'BlockStatement',
	    path: openRawBlock.path,
	    params: openRawBlock.params,
	    hash: openRawBlock.hash,
	    program: program,
	    openStrip: {},
	    inverseStrip: {},
	    closeStrip: {},
	    loc: locInfo
	  };
	}

	function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
	  if (close &amp;&amp; close.path) {
	    validateClose(openBlock, close);
	  }

	  var decorator = /\*/.test(openBlock.open);

	  program.blockParams = openBlock.blockParams;

	  var inverse = undefined,
	      inverseStrip = undefined;

	  if (inverseAndProgram) {
	    if (decorator) {
	      throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
	    }

	    if (inverseAndProgram.chain) {
	      inverseAndProgram.program.body[0].closeStrip = close.strip;
	    }

	    inverseStrip = inverseAndProgram.strip;
	    inverse = inverseAndProgram.program;
	  }

	  if (inverted) {
	    inverted = inverse;
	    inverse = program;
	    program = inverted;
	  }

	  return {
	    type: decorator ? 'DecoratorBlock' : 'BlockStatement',
	    path: openBlock.path,
	    params: openBlock.params,
	    hash: openBlock.hash,
	    program: program,
	    inverse: inverse,
	    openStrip: openBlock.strip,
	    inverseStrip: inverseStrip,
	    closeStrip: close &amp;&amp; close.strip,
	    loc: this.locInfo(locInfo)
	  };
	}

	function prepareProgram(statements, loc) {
	  if (!loc &amp;&amp; statements.length) {
	    var firstLoc = statements[0].loc,
	        lastLoc = statements[statements.length - 1].loc;

	    /* istanbul ignore else */
	    if (firstLoc &amp;&amp; lastLoc) {
	      loc = {
	        source: firstLoc.source,
	        start: {
	          line: firstLoc.start.line,
	          column: firstLoc.start.column
	        },
	        end: {
	          line: lastLoc.end.line,
	          column: lastLoc.end.column
	        }
	      };
	    }
	  }

	  return {
	    type: 'Program',
	    body: statements,
	    strip: {},
	    loc: loc
	  };
	}

	function preparePartialBlock(open, program, close, locInfo) {
	  validateClose(open, close);

	  return {
	    type: 'PartialBlockStatement',
	    name: open.path,
	    params: open.params,
	    hash: open.hash,
	    program: program,
	    openStrip: open.strip,
	    closeStrip: close &amp;&amp; close.strip,
	    loc: this.locInfo(locInfo)
	  };
	}

/***/ }),
/* 41 */
/***/ (function(module, exports, __webpack_require__) {

	/* eslint-disable new-cap */

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;
	exports.Compiler = Compiler;
	exports.precompile = precompile;
	exports.compile = compile;

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	var _utils = __webpack_require__(5);

	var _ast = __webpack_require__(35);

	var _ast2 = _interopRequireDefault(_ast);

	var slice = [].slice;

	function Compiler() {}

	// the foundHelper register will disambiguate helper lookup from finding a
	// function in a context. This is necessary for mustache compatibility, which
	// requires that context functions in blocks are evaluated by blockHelperMissing,
	// and then proceed as if the resulting value was provided to blockHelperMissing.

	Compiler.prototype = {
	  compiler: Compiler,

	  equals: function equals(other) {
	    var len = this.opcodes.length;
	    if (other.opcodes.length !== len) {
	      return false;
	    }

	    for (var i = 0; i &lt; len; i++) {
	      var opcode = this.opcodes[i],
	          otherOpcode = other.opcodes[i];
	      if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
	        return false;
	      }
	    }

	    // We know that length is the same between the two arrays because they are directly tied
	    // to the opcode behavior above.
	    len = this.children.length;
	    for (var i = 0; i &lt; len; i++) {
	      if (!this.children[i].equals(other.children[i])) {
	        return false;
	      }
	    }

	    return true;
	  },

	  guid: 0,

	  compile: function compile(program, options) {
	    this.sourceNode = [];
	    this.opcodes = [];
	    this.children = [];
	    this.options = options;
	    this.stringParams = options.stringParams;
	    this.trackIds = options.trackIds;

	    options.blockParams = options.blockParams || [];

	    // These changes will propagate to the other compiler components
	    var knownHelpers = options.knownHelpers;
	    options.knownHelpers = {
	      'helperMissing': true,
	      'blockHelperMissing': true,
	      'each': true,
	      'if': true,
	      'unless': true,
	      'with': true,
	      'log': true,
	      'lookup': true
	    };
	    if (knownHelpers) {
	      for (var _name in knownHelpers) {
	        /* istanbul ignore else */
	        if (_name in knownHelpers) {
	          this.options.knownHelpers[_name] = knownHelpers[_name];
	        }
	      }
	    }

	    return this.accept(program);
	  },

	  compileProgram: function compileProgram(program) {
	    var childCompiler = new this.compiler(),
	        // eslint-disable-line new-cap
	    result = childCompiler.compile(program, this.options),
	        guid = this.guid++;

	    this.usePartial = this.usePartial || result.usePartial;

	    this.children[guid] = result;
	    this.useDepths = this.useDepths || result.useDepths;

	    return guid;
	  },

	  accept: function accept(node) {
	    /* istanbul ignore next: Sanity code */
	    if (!this[node.type]) {
	      throw new _exception2['default']('Unknown type: ' + node.type, node);
	    }

	    this.sourceNode.unshift(node);
	    var ret = this[node.type](node);
	    this.sourceNode.shift();
	    return ret;
	  },

	  Program: function Program(program) {
	    this.options.blockParams.unshift(program.blockParams);

	    var body = program.body,
	        bodyLength = body.length;
	    for (var i = 0; i &lt; bodyLength; i++) {
	      this.accept(body[i]);
	    }

	    this.options.blockParams.shift();

	    this.isSimple = bodyLength === 1;
	    this.blockParams = program.blockParams ? program.blockParams.length : 0;

	    return this;
	  },

	  BlockStatement: function BlockStatement(block) {
	    transformLiteralToPath(block);

	    var program = block.program,
	        inverse = block.inverse;

	    program = program &amp;&amp; this.compileProgram(program);
	    inverse = inverse &amp;&amp; this.compileProgram(inverse);

	    var type = this.classifySexpr(block);

	    if (type === 'helper') {
	      this.helperSexpr(block, program, inverse);
	    } else if (type === 'simple') {
	      this.simpleSexpr(block);

	      // now that the simple mustache is resolved, we need to
	      // evaluate it by executing `blockHelperMissing`
	      this.opcode('pushProgram', program);
	      this.opcode('pushProgram', inverse);
	      this.opcode('emptyHash');
	      this.opcode('blockValue', block.path.original);
	    } else {
	      this.ambiguousSexpr(block, program, inverse);

	      // now that the simple mustache is resolved, we need to
	      // evaluate it by executing `blockHelperMissing`
	      this.opcode('pushProgram', program);
	      this.opcode('pushProgram', inverse);
	      this.opcode('emptyHash');
	      this.opcode('ambiguousBlockValue');
	    }

	    this.opcode('append');
	  },

	  DecoratorBlock: function DecoratorBlock(decorator) {
	    var program = decorator.program &amp;&amp; this.compileProgram(decorator.program);
	    var params = this.setupFullMustacheParams(decorator, program, undefined),
	        path = decorator.path;

	    this.useDecorators = true;
	    this.opcode('registerDecorator', params.length, path.original);
	  },

	  PartialStatement: function PartialStatement(partial) {
	    this.usePartial = true;

	    var program = partial.program;
	    if (program) {
	      program = this.compileProgram(partial.program);
	    }

	    var params = partial.params;
	    if (params.length &gt; 1) {
	      throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
	    } else if (!params.length) {
	      if (this.options.explicitPartialContext) {
	        this.opcode('pushLiteral', 'undefined');
	      } else {
	        params.push({ type: 'PathExpression', parts: [], depth: 0 });
	      }
	    }

	    var partialName = partial.name.original,
	        isDynamic = partial.name.type === 'SubExpression';
	    if (isDynamic) {
	      this.accept(partial.name);
	    }

	    this.setupFullMustacheParams(partial, program, undefined, true);

	    var indent = partial.indent || '';
	    if (this.options.preventIndent &amp;&amp; indent) {
	      this.opcode('appendContent', indent);
	      indent = '';
	    }

	    this.opcode('invokePartial', isDynamic, partialName, indent);
	    this.opcode('append');
	  },
	  PartialBlockStatement: function PartialBlockStatement(partialBlock) {
	    this.PartialStatement(partialBlock);
	  },

	  MustacheStatement: function MustacheStatement(mustache) {
	    this.SubExpression(mustache);

	    if (mustache.escaped &amp;&amp; !this.options.noEscape) {
	      this.opcode('appendEscaped');
	    } else {
	      this.opcode('append');
	    }
	  },
	  Decorator: function Decorator(decorator) {
	    this.DecoratorBlock(decorator);
	  },

	  ContentStatement: function ContentStatement(content) {
	    if (content.value) {
	      this.opcode('appendContent', content.value);
	    }
	  },

	  CommentStatement: function CommentStatement() {},

	  SubExpression: function SubExpression(sexpr) {
	    transformLiteralToPath(sexpr);
	    var type = this.classifySexpr(sexpr);

	    if (type === 'simple') {
	      this.simpleSexpr(sexpr);
	    } else if (type === 'helper') {
	      this.helperSexpr(sexpr);
	    } else {
	      this.ambiguousSexpr(sexpr);
	    }
	  },
	  ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
	    var path = sexpr.path,
	        name = path.parts[0],
	        isBlock = program != null || inverse != null;

	    this.opcode('getContext', path.depth);

	    this.opcode('pushProgram', program);
	    this.opcode('pushProgram', inverse);

	    path.strict = true;
	    this.accept(path);

	    this.opcode('invokeAmbiguous', name, isBlock);
	  },

	  simpleSexpr: function simpleSexpr(sexpr) {
	    var path = sexpr.path;
	    path.strict = true;
	    this.accept(path);
	    this.opcode('resolvePossibleLambda');
	  },

	  helperSexpr: function helperSexpr(sexpr, program, inverse) {
	    var params = this.setupFullMustacheParams(sexpr, program, inverse),
	        path = sexpr.path,
	        name = path.parts[0];

	    if (this.options.knownHelpers[name]) {
	      this.opcode('invokeKnownHelper', params.length, name);
	    } else if (this.options.knownHelpersOnly) {
	      throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
	    } else {
	      path.strict = true;
	      path.falsy = true;

	      this.accept(path);
	      this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
	    }
	  },

	  PathExpression: function PathExpression(path) {
	    this.addDepth(path.depth);
	    this.opcode('getContext', path.depth);

	    var name = path.parts[0],
	        scoped = _ast2['default'].helpers.scopedId(path),
	        blockParamId = !path.depth &amp;&amp; !scoped &amp;&amp; this.blockParamIndex(name);

	    if (blockParamId) {
	      this.opcode('lookupBlockParam', blockParamId, path.parts);
	    } else if (!name) {
	      // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
	      this.opcode('pushContext');
	    } else if (path.data) {
	      this.options.data = true;
	      this.opcode('lookupData', path.depth, path.parts, path.strict);
	    } else {
	      this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
	    }
	  },

	  StringLiteral: function StringLiteral(string) {
	    this.opcode('pushString', string.value);
	  },

	  NumberLiteral: function NumberLiteral(number) {
	    this.opcode('pushLiteral', number.value);
	  },

	  BooleanLiteral: function BooleanLiteral(bool) {
	    this.opcode('pushLiteral', bool.value);
	  },

	  UndefinedLiteral: function UndefinedLiteral() {
	    this.opcode('pushLiteral', 'undefined');
	  },

	  NullLiteral: function NullLiteral() {
	    this.opcode('pushLiteral', 'null');
	  },

	  Hash: function Hash(hash) {
	    var pairs = hash.pairs,
	        i = 0,
	        l = pairs.length;

	    this.opcode('pushHash');

	    for (; i &lt; l; i++) {
	      this.pushParam(pairs[i].value);
	    }
	    while (i--) {
	      this.opcode('assignToHash', pairs[i].key);
	    }
	    this.opcode('popHash');
	  },

	  // HELPERS
	  opcode: function opcode(name) {
	    this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc });
	  },

	  addDepth: function addDepth(depth) {
	    if (!depth) {
	      return;
	    }

	    this.useDepths = true;
	  },

	  classifySexpr: function classifySexpr(sexpr) {
	    var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);

	    var isBlockParam = isSimple &amp;&amp; !!this.blockParamIndex(sexpr.path.parts[0]);

	    // a mustache is an eligible helper if:
	    // * its id is simple (a single part, not `this` or `..`)
	    var isHelper = !isBlockParam &amp;&amp; _ast2['default'].helpers.helperExpression(sexpr);

	    // if a mustache is an eligible helper but not a definite
	    // helper, it is ambiguous, and will be resolved in a later
	    // pass or at runtime.
	    var isEligible = !isBlockParam &amp;&amp; (isHelper || isSimple);

	    // if ambiguous, we can possibly resolve the ambiguity now
	    // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
	    if (isEligible &amp;&amp; !isHelper) {
	      var _name2 = sexpr.path.parts[0],
	          options = this.options;

	      if (options.knownHelpers[_name2]) {
	        isHelper = true;
	      } else if (options.knownHelpersOnly) {
	        isEligible = false;
	      }
	    }

	    if (isHelper) {
	      return 'helper';
	    } else if (isEligible) {
	      return 'ambiguous';
	    } else {
	      return 'simple';
	    }
	  },

	  pushParams: function pushParams(params) {
	    for (var i = 0, l = params.length; i &lt; l; i++) {
	      this.pushParam(params[i]);
	    }
	  },

	  pushParam: function pushParam(val) {
	    var value = val.value != null ? val.value : val.original || '';

	    if (this.stringParams) {
	      if (value.replace) {
	        value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
	      }

	      if (val.depth) {
	        this.addDepth(val.depth);
	      }
	      this.opcode('getContext', val.depth || 0);
	      this.opcode('pushStringParam', value, val.type);

	      if (val.type === 'SubExpression') {
	        // SubExpressions get evaluated and passed in
	        // in string params mode.
	        this.accept(val);
	      }
	    } else {
	      if (this.trackIds) {
	        var blockParamIndex = undefined;
	        if (val.parts &amp;&amp; !_ast2['default'].helpers.scopedId(val) &amp;&amp; !val.depth) {
	          blockParamIndex = this.blockParamIndex(val.parts[0]);
	        }
	        if (blockParamIndex) {
	          var blockParamChild = val.parts.slice(1).join('.');
	          this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
	        } else {
	          value = val.original || value;
	          if (value.replace) {
	            value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
	          }

	          this.opcode('pushId', val.type, value);
	        }
	      }
	      this.accept(val);
	    }
	  },

	  setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
	    var params = sexpr.params;
	    this.pushParams(params);

	    this.opcode('pushProgram', program);
	    this.opcode('pushProgram', inverse);

	    if (sexpr.hash) {
	      this.accept(sexpr.hash);
	    } else {
	      this.opcode('emptyHash', omitEmpty);
	    }

	    return params;
	  },

	  blockParamIndex: function blockParamIndex(name) {
	    for (var depth = 0, len = this.options.blockParams.length; depth &lt; len; depth++) {
	      var blockParams = this.options.blockParams[depth],
	          param = blockParams &amp;&amp; _utils.indexOf(blockParams, name);
	      if (blockParams &amp;&amp; param &gt;= 0) {
	        return [depth, param];
	      }
	    }
	  }
	};

	function precompile(input, options, env) {
	  if (input == null || typeof input !== 'string' &amp;&amp; input.type !== 'Program') {
	    throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
	  }

	  options = options || {};
	  if (!('data' in options)) {
	    options.data = true;
	  }
	  if (options.compat) {
	    options.useDepths = true;
	  }

	  var ast = env.parse(input, options),
	      environment = new env.Compiler().compile(ast, options);
	  return new env.JavaScriptCompiler().compile(environment, options);
	}

	function compile(input, options, env) {
	  if (options === undefined) options = {};

	  if (input == null || typeof input !== 'string' &amp;&amp; input.type !== 'Program') {
	    throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
	  }

	  options = _utils.extend({}, options);
	  if (!('data' in options)) {
	    options.data = true;
	  }
	  if (options.compat) {
	    options.useDepths = true;
	  }

	  var compiled = undefined;

	  function compileInput() {
	    var ast = env.parse(input, options),
	        environment = new env.Compiler().compile(ast, options),
	        templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
	    return env.template(templateSpec);
	  }

	  // Template is only compiled on first use and cached after that point.
	  function ret(context, execOptions) {
	    if (!compiled) {
	      compiled = compileInput();
	    }
	    return compiled.call(this, context, execOptions);
	  }
	  ret._setup = function (setupOptions) {
	    if (!compiled) {
	      compiled = compileInput();
	    }
	    return compiled._setup(setupOptions);
	  };
	  ret._child = function (i, data, blockParams, depths) {
	    if (!compiled) {
	      compiled = compileInput();
	    }
	    return compiled._child(i, data, blockParams, depths);
	  };
	  return ret;
	}

	function argEquals(a, b) {
	  if (a === b) {
	    return true;
	  }

	  if (_utils.isArray(a) &amp;&amp; _utils.isArray(b) &amp;&amp; a.length === b.length) {
	    for (var i = 0; i &lt; a.length; i++) {
	      if (!argEquals(a[i], b[i])) {
	        return false;
	      }
	    }
	    return true;
	  }
	}

	function transformLiteralToPath(sexpr) {
	  if (!sexpr.path.parts) {
	    var literal = sexpr.path;
	    // Casting to string here to make false and 0 literal values play nicely with the rest
	    // of the system.
	    sexpr.path = {
	      type: 'PathExpression',
	      data: false,
	      depth: 0,
	      parts: [literal.original + ''],
	      original: literal.original + '',
	      loc: literal.loc
	    };
	  }
	}

/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	var _interopRequireDefault = __webpack_require__(1)['default'];

	exports.__esModule = true;

	var _base = __webpack_require__(4);

	var _exception = __webpack_require__(6);

	var _exception2 = _interopRequireDefault(_exception);

	var _utils = __webpack_require__(5);

	var _codeGen = __webpack_require__(43);

	var _codeGen2 = _interopRequireDefault(_codeGen);

	function Literal(value) {
	  this.value = value;
	}

	function JavaScriptCompiler() {}

	JavaScriptCompiler.prototype = {
	  // PUBLIC API: You can override these methods in a subclass to provide
	  // alternative compiled forms for name lookup and buffering semantics
	  nameLookup: function nameLookup(parent, name /* , type*/) {
	    if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
	      return [parent, '.', name];
	    } else {
	      return [parent, '[', JSON.stringify(name), ']'];
	    }
	  },
	  depthedLookup: function depthedLookup(name) {
	    return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
	  },

	  compilerInfo: function compilerInfo() {
	    var revision = _base.COMPILER_REVISION,
	        versions = _base.REVISION_CHANGES[revision];
	    return [revision, versions];
	  },

	  appendToBuffer: function appendToBuffer(source, location, explicit) {
	    // Force a source as this simplifies the merge logic.
	    if (!_utils.isArray(source)) {
	      source = [source];
	    }
	    source = this.source.wrap(source, location);

	    if (this.environment.isSimple) {
	      return ['return ', source, ';'];
	    } else if (explicit) {
	      // This is a case where the buffer operation occurs as a child of another
	      // construct, generally braces. We have to explicitly output these buffer
	      // operations to ensure that the emitted code goes in the correct location.
	      return ['buffer += ', source, ';'];
	    } else {
	      source.appendToBuffer = true;
	      return source;
	    }
	  },

	  initializeBuffer: function initializeBuffer() {
	    return this.quotedString('');
	  },
	  // END PUBLIC API

	  compile: function compile(environment, options, context, asObject) {
	    this.environment = environment;
	    this.options = options;
	    this.stringParams = this.options.stringParams;
	    this.trackIds = this.options.trackIds;
	    this.precompile = !asObject;

	    this.name = this.environment.name;
	    this.isChild = !!context;
	    this.context = context || {
	      decorators: [],
	      programs: [],
	      environments: []
	    };

	    this.preamble();

	    this.stackSlot = 0;
	    this.stackVars = [];
	    this.aliases = {};
	    this.registers = { list: [] };
	    this.hashes = [];
	    this.compileStack = [];
	    this.inlineStack = [];
	    this.blockParams = [];

	    this.compileChildren(environment, options);

	    this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
	    this.useBlockParams = this.useBlockParams || environment.useBlockParams;

	    var opcodes = environment.opcodes,
	        opcode = undefined,
	        firstLoc = undefined,
	        i = undefined,
	        l = undefined;

	    for (i = 0, l = opcodes.length; i &lt; l; i++) {
	      opcode = opcodes[i];

	      this.source.currentLocation = opcode.loc;
	      firstLoc = firstLoc || opcode.loc;
	      this[opcode.opcode].apply(this, opcode.args);
	    }

	    // Flush any trailing content that might be pending.
	    this.source.currentLocation = firstLoc;
	    this.pushSource('');

	    /* istanbul ignore next */
	    if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
	      throw new _exception2['default']('Compile completed with content left on stack');
	    }

	    if (!this.decorators.isEmpty()) {
	      this.useDecorators = true;

	      this.decorators.prepend('var decorators = container.decorators;\n');
	      this.decorators.push('return fn;');

	      if (asObject) {
	        this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
	      } else {
	        this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
	        this.decorators.push('}\n');
	        this.decorators = this.decorators.merge();
	      }
	    } else {
	      this.decorators = undefined;
	    }

	    var fn = this.createFunctionContext(asObject);
	    if (!this.isChild) {
	      var ret = {
	        compiler: this.compilerInfo(),
	        main: fn
	      };

	      if (this.decorators) {
	        ret.main_d = this.decorators; // eslint-disable-line camelcase
	        ret.useDecorators = true;
	      }

	      var _context = this.context;
	      var programs = _context.programs;
	      var decorators = _context.decorators;

	      for (i = 0, l = programs.length; i &lt; l; i++) {
	        if (programs[i]) {
	          ret[i] = programs[i];
	          if (decorators[i]) {
	            ret[i + '_d'] = decorators[i];
	            ret.useDecorators = true;
	          }
	        }
	      }

	      if (this.environment.usePartial) {
	        ret.usePartial = true;
	      }
	      if (this.options.data) {
	        ret.useData = true;
	      }
	      if (this.useDepths) {
	        ret.useDepths = true;
	      }
	      if (this.useBlockParams) {
	        ret.useBlockParams = true;
	      }
	      if (this.options.compat) {
	        ret.compat = true;
	      }

	      if (!asObject) {
	        ret.compiler = JSON.stringify(ret.compiler);

	        this.source.currentLocation = { start: { line: 1, column: 0 } };
	        ret = this.objectLiteral(ret);

	        if (options.srcName) {
	          ret = ret.toStringWithSourceMap({ file: options.destName });
	          ret.map = ret.map &amp;&amp; ret.map.toString();
	        } else {
	          ret = ret.toString();
	        }
	      } else {
	        ret.compilerOptions = this.options;
	      }

	      return ret;
	    } else {
	      return fn;
	    }
	  },

	  preamble: function preamble() {
	    // track the last context pushed into place to allow skipping the
	    // getContext opcode when it would be a noop
	    this.lastContext = 0;
	    this.source = new _codeGen2['default'](this.options.srcName);
	    this.decorators = new _codeGen2['default'](this.options.srcName);
	  },

	  createFunctionContext: function createFunctionContext(asObject) {
	    var varDeclarations = '';

	    var locals = this.stackVars.concat(this.registers.list);
	    if (locals.length &gt; 0) {
	      varDeclarations += ', ' + locals.join(', ');
	    }

	    // Generate minimizer alias mappings
	    //
	    // When using true SourceNodes, this will update all references to the given alias
	    // as the source nodes are reused in situ. For the non-source node compilation mode,
	    // aliases will not be used, but this case is already being run on the client and
	    // we aren't concern about minimizing the template size.
	    var aliasCount = 0;
	    for (var alias in this.aliases) {
	      // eslint-disable-line guard-for-in
	      var node = this.aliases[alias];

	      if (this.aliases.hasOwnProperty(alias) &amp;&amp; node.children &amp;&amp; node.referenceCount &gt; 1) {
	        varDeclarations += ', alias' + ++aliasCount + '=' + alias;
	        node.children[0] = 'alias' + aliasCount;
	      }
	    }

	    var params = ['container', 'depth0', 'helpers', 'partials', 'data'];

	    if (this.useBlockParams || this.useDepths) {
	      params.push('blockParams');
	    }
	    if (this.useDepths) {
	      params.push('depths');
	    }

	    // Perform a second pass over the output to merge content when possible
	    var source = this.mergeSource(varDeclarations);

	    if (asObject) {
	      params.push(source);

	      return Function.apply(this, params);
	    } else {
	      return this.source.wrap(['function(', params.join(','), ') {\n  ', source, '}']);
	    }
	  },
	  mergeSource: function mergeSource(varDeclarations) {
	    var isSimple = this.environment.isSimple,
	        appendOnly = !this.forceBuffer,
	        appendFirst = undefined,
	        sourceSeen = undefined,
	        bufferStart = undefined,
	        bufferEnd = undefined;
	    this.source.each(function (line) {
	      if (line.appendToBuffer) {
	        if (bufferStart) {
	          line.prepend('  + ');
	        } else {
	          bufferStart = line;
	        }
	        bufferEnd = line;
	      } else {
	        if (bufferStart) {
	          if (!sourceSeen) {
	            appendFirst = true;
	          } else {
	            bufferStart.prepend('buffer += ');
	          }
	          bufferEnd.add(';');
	          bufferStart = bufferEnd = undefined;
	        }

	        sourceSeen = true;
	        if (!isSimple) {
	          appendOnly = false;
	        }
	      }
	    });

	    if (appendOnly) {
	      if (bufferStart) {
	        bufferStart.prepend('return ');
	        bufferEnd.add(';');
	      } else if (!sourceSeen) {
	        this.source.push('return "";');
	      }
	    } else {
	      varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());

	      if (bufferStart) {
	        bufferStart.prepend('return buffer + ');
	        bufferEnd.add(';');
	      } else {
	        this.source.push('return buffer;');
	      }
	    }

	    if (varDeclarations) {
	      this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
	    }

	    return this.source.merge();
	  },

	  // [blockValue]
	  //
	  // On stack, before: hash, inverse, program, value
	  // On stack, after: return value of blockHelperMissing
	  //
	  // The purpose of this opcode is to take a block of the form
	  // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
	  // replace it on the stack with the result of properly
	  // invoking blockHelperMissing.
	  blockValue: function blockValue(name) {
	    var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
	        params = [this.contextName(0)];
	    this.setupHelperArgs(name, 0, params);

	    var blockName = this.popStack();
	    params.splice(1, 0, blockName);

	    this.push(this.source.functionCall(blockHelperMissing, 'call', params));
	  },

	  // [ambiguousBlockValue]
	  //
	  // On stack, before: hash, inverse, program, value
	  // Compiler value, before: lastHelper=value of last found helper, if any
	  // On stack, after, if no lastHelper: same as [blockValue]
	  // On stack, after, if lastHelper: value
	  ambiguousBlockValue: function ambiguousBlockValue() {
	    // We're being a bit cheeky and reusing the options value from the prior exec
	    var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
	        params = [this.contextName(0)];
	    this.setupHelperArgs('', 0, params, true);

	    this.flushInline();

	    var current = this.topStack();
	    params.splice(1, 0, current);

	    this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
	  },

	  // [appendContent]
	  //
	  // On stack, before: ...
	  // On stack, after: ...
	  //
	  // Appends the string value of `content` to the current buffer
	  appendContent: function appendContent(content) {
	    if (this.pendingContent) {
	      content = this.pendingContent + content;
	    } else {
	      this.pendingLocation = this.source.currentLocation;
	    }

	    this.pendingContent = content;
	  },

	  // [append]
	  //
	  // On stack, before: value, ...
	  // On stack, after: ...
	  //
	  // Coerces `value` to a String and appends it to the current buffer.
	  //
	  // If `value` is truthy, or 0, it is coerced into a string and appended
	  // Otherwise, the empty string is appended
	  append: function append() {
	    if (this.isInline()) {
	      this.replaceStack(function (current) {
	        return [' != null ? ', current, ' : ""'];
	      });

	      this.pushSource(this.appendToBuffer(this.popStack()));
	    } else {
	      var local = this.popStack();
	      this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
	      if (this.environment.isSimple) {
	        this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
	      }
	    }
	  },

	  // [appendEscaped]
	  //
	  // On stack, before: value, ...
	  // On stack, after: ...
	  //
	  // Escape `value` and append it to the buffer
	  appendEscaped: function appendEscaped() {
	    this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
	  },

	  // [getContext]
	  //
	  // On stack, before: ...
	  // On stack, after: ...
	  // Compiler value, after: lastContext=depth
	  //
	  // Set the value of the `lastContext` compiler value to the depth
	  getContext: function getContext(depth) {
	    this.lastContext = depth;
	  },

	  // [pushContext]
	  //
	  // On stack, before: ...
	  // On stack, after: currentContext, ...
	  //
	  // Pushes the value of the current context onto the stack.
	  pushContext: function pushContext() {
	    this.pushStackLiteral(this.contextName(this.lastContext));
	  },

	  // [lookupOnContext]
	  //
	  // On stack, before: ...
	  // On stack, after: currentContext[name], ...
	  //
	  // Looks up the value of `name` on the current context and pushes
	  // it onto the stack.
	  lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
	    var i = 0;

	    if (!scoped &amp;&amp; this.options.compat &amp;&amp; !this.lastContext) {
	      // The depthed query is expected to handle the undefined logic for the root level that
	      // is implemented below, so we evaluate that directly in compat mode
	      this.push(this.depthedLookup(parts[i++]));
	    } else {
	      this.pushContext();
	    }

	    this.resolvePath('context', parts, i, falsy, strict);
	  },

	  // [lookupBlockParam]
	  //
	  // On stack, before: ...
	  // On stack, after: blockParam[name], ...
	  //
	  // Looks up the value of `parts` on the given block param and pushes
	  // it onto the stack.
	  lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
	    this.useBlockParams = true;

	    this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
	    this.resolvePath('context', parts, 1);
	  },

	  // [lookupData]
	  //
	  // On stack, before: ...
	  // On stack, after: data, ...
	  //
	  // Push the data lookup operator
	  lookupData: function lookupData(depth, parts, strict) {
	    if (!depth) {
	      this.pushStackLiteral('data');
	    } else {
	      this.pushStackLiteral('container.data(data, ' + depth + ')');
	    }

	    this.resolvePath('data', parts, 0, true, strict);
	  },

	  resolvePath: function resolvePath(type, parts, i, falsy, strict) {
	    // istanbul ignore next

	    var _this = this;

	    if (this.options.strict || this.options.assumeObjects) {
	      this.push(strictLookup(this.options.strict &amp;&amp; strict, this, parts, type));
	      return;
	    }

	    var len = parts.length;
	    for (; i &lt; len; i++) {
	      /* eslint-disable no-loop-func */
	      this.replaceStack(function (current) {
	        var lookup = _this.nameLookup(current, parts[i], type);
	        // We want to ensure that zero and false are handled properly if the context (falsy flag)
	        // needs to have the special handling for these values.
	        if (!falsy) {
	          return [' != null ? ', lookup, ' : ', current];
	        } else {
	          // Otherwise we can use generic falsy handling
	          return [' &amp;&amp; ', lookup];
	        }
	      });
	      /* eslint-enable no-loop-func */
	    }
	  },

	  // [resolvePossibleLambda]
	  //
	  // On stack, before: value, ...
	  // On stack, after: resolved value, ...
	  //
	  // If the `value` is a lambda, replace it on the stack by
	  // the return value of the lambda
	  resolvePossibleLambda: function resolvePossibleLambda() {
	    this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
	  },

	  // [pushStringParam]
	  //
	  // On stack, before: ...
	  // On stack, after: string, currentContext, ...
	  //
	  // This opcode is designed for use in string mode, which
	  // provides the string value of a parameter along with its
	  // depth rather than resolving it immediately.
	  pushStringParam: function pushStringParam(string, type) {
	    this.pushContext();
	    this.pushString(type);

	    // If it's a subexpression, the string result
	    // will be pushed after this opcode.
	    if (type !== 'SubExpression') {
	      if (typeof string === 'string') {
	        this.pushString(string);
	      } else {
	        this.pushStackLiteral(string);
	      }
	    }
	  },

	  emptyHash: function emptyHash(omitEmpty) {
	    if (this.trackIds) {
	      this.push('{}'); // hashIds
	    }
	    if (this.stringParams) {
	      this.push('{}'); // hashContexts
	      this.push('{}'); // hashTypes
	    }
	    this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
	  },
	  pushHash: function pushHash() {
	    if (this.hash) {
	      this.hashes.push(this.hash);
	    }
	    this.hash = { values: [], types: [], contexts: [], ids: [] };
	  },
	  popHash: function popHash() {
	    var hash = this.hash;
	    this.hash = this.hashes.pop();

	    if (this.trackIds) {
	      this.push(this.objectLiteral(hash.ids));
	    }
	    if (this.stringParams) {
	      this.push(this.objectLiteral(hash.contexts));
	      this.push(this.objectLiteral(hash.types));
	    }

	    this.push(this.objectLiteral(hash.values));
	  },

	  // [pushString]
	  //
	  // On stack, before: ...
	  // On stack, after: quotedString(string), ...
	  //
	  // Push a quoted version of `string` onto the stack
	  pushString: function pushString(string) {
	    this.pushStackLiteral(this.quotedString(string));
	  },

	  // [pushLiteral]
	  //
	  // On stack, before: ...
	  // On stack, after: value, ...
	  //
	  // Pushes a value onto the stack. This operation prevents
	  // the compiler from creating a temporary variable to hold
	  // it.
	  pushLiteral: function pushLiteral(value) {
	    this.pushStackLiteral(value);
	  },

	  // [pushProgram]
	  //
	  // On stack, before: ...
	  // On stack, after: program(guid), ...
	  //
	  // Push a program expression onto the stack. This takes
	  // a compile-time guid and converts it into a runtime-accessible
	  // expression.
	  pushProgram: function pushProgram(guid) {
	    if (guid != null) {
	      this.pushStackLiteral(this.programExpression(guid));
	    } else {
	      this.pushStackLiteral(null);
	    }
	  },

	  // [registerDecorator]
	  //
	  // On stack, before: hash, program, params..., ...
	  // On stack, after: ...
	  //
	  // Pops off the decorator's parameters, invokes the decorator,
	  // and inserts the decorator into the decorators list.
	  registerDecorator: function registerDecorator(paramSize, name) {
	    var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
	        options = this.setupHelperArgs(name, paramSize);

	    this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
	  },

	  // [invokeHelper]
	  //
	  // On stack, before: hash, inverse, program, params..., ...
	  // On stack, after: result of helper invocation
	  //
	  // Pops off the helper's parameters, invokes the helper,
	  // and pushes the helper's return value onto the stack.
	  //
	  // If the helper is not found, `helperMissing` is called.
	  invokeHelper: function invokeHelper(paramSize, name, isSimple) {
	    var nonHelper = this.popStack(),
	        helper = this.setupHelper(paramSize, name),
	        simple = isSimple ? [helper.name, ' || '] : '';

	    var lookup = ['('].concat(simple, nonHelper);
	    if (!this.options.strict) {
	      lookup.push(' || ', this.aliasable('helpers.helperMissing'));
	    }
	    lookup.push(')');

	    this.push(this.source.functionCall(lookup, 'call', helper.callParams));
	  },

	  // [invokeKnownHelper]
	  //
	  // On stack, before: hash, inverse, program, params..., ...
	  // On stack, after: result of helper invocation
	  //
	  // This operation is used when the helper is known to exist,
	  // so a `helperMissing` fallback is not required.
	  invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
	    var helper = this.setupHelper(paramSize, name);
	    this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
	  },

	  // [invokeAmbiguous]
	  //
	  // On stack, before: hash, inverse, program, params..., ...
	  // On stack, after: result of disambiguation
	  //
	  // This operation is used when an expression like `{{foo}}`
	  // is provided, but we don't know at compile-time whether it
	  // is a helper or a path.
	  //
	  // This operation emits more code than the other options,
	  // and can be avoided by passing the `knownHelpers` and
	  // `knownHelpersOnly` flags at compile-time.
	  invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
	    this.useRegister('helper');

	    var nonHelper = this.popStack();

	    this.emptyHash();
	    var helper = this.setupHelper(0, name, helperCall);

	    var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');

	    var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
	    if (!this.options.strict) {
	      lookup[0] = '(helper = ';
	      lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing'));
	    }

	    this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
	  },

	  // [invokePartial]
	  //
	  // On stack, before: context, ...
	  // On stack after: result of partial invocation
	  //
	  // This operation pops off a context, invokes a partial with that context,
	  // and pushes the result of the invocation back.
	  invokePartial: function invokePartial(isDynamic, name, indent) {
	    var params = [],
	        options = this.setupParams(name, 1, params);

	    if (isDynamic) {
	      name = this.popStack();
	      delete options.name;
	    }

	    if (indent) {
	      options.indent = JSON.stringify(indent);
	    }
	    options.helpers = 'helpers';
	    options.partials = 'partials';
	    options.decorators = 'container.decorators';

	    if (!isDynamic) {
	      params.unshift(this.nameLookup('partials', name, 'partial'));
	    } else {
	      params.unshift(name);
	    }

	    if (this.options.compat) {
	      options.depths = 'depths';
	    }
	    options = this.objectLiteral(options);
	    params.push(options);

	    this.push(this.source.functionCall('container.invokePartial', '', params));
	  },

	  // [assignToHash]
	  //
	  // On stack, before: value, ..., hash, ...
	  // On stack, after: ..., hash, ...
	  //
	  // Pops a value off the stack and assigns it to the current hash
	  assignToHash: function assignToHash(key) {
	    var value = this.popStack(),
	        context = undefined,
	        type = undefined,
	        id = undefined;

	    if (this.trackIds) {
	      id = this.popStack();
	    }
	    if (this.stringParams) {
	      type = this.popStack();
	      context = this.popStack();
	    }

	    var hash = this.hash;
	    if (context) {
	      hash.contexts[key] = context;
	    }
	    if (type) {
	      hash.types[key] = type;
	    }
	    if (id) {
	      hash.ids[key] = id;
	    }
	    hash.values[key] = value;
	  },

	  pushId: function pushId(type, name, child) {
	    if (type === 'BlockParam') {
	      this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
	    } else if (type === 'PathExpression') {
	      this.pushString(name);
	    } else if (type === 'SubExpression') {
	      this.pushStackLiteral('true');
	    } else {
	      this.pushStackLiteral('null');
	    }
	  },

	  // HELPERS

	  compiler: JavaScriptCompiler,

	  compileChildren: function compileChildren(environment, options) {
	    var children = environment.children,
	        child = undefined,
	        compiler = undefined;

	    for (var i = 0, l = children.length; i &lt; l; i++) {
	      child = children[i];
	      compiler = new this.compiler(); // eslint-disable-line new-cap

	      var existing = this.matchExistingProgram(child);

	      if (existing == null) {
	        this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
	        var index = this.context.programs.length;
	        child.index = index;
	        child.name = 'program' + index;
	        this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
	        this.context.decorators[index] = compiler.decorators;
	        this.context.environments[index] = child;

	        this.useDepths = this.useDepths || compiler.useDepths;
	        this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
	        child.useDepths = this.useDepths;
	        child.useBlockParams = this.useBlockParams;
	      } else {
	        child.index = existing.index;
	        child.name = 'program' + existing.index;

	        this.useDepths = this.useDepths || existing.useDepths;
	        this.useBlockParams = this.useBlockParams || existing.useBlockParams;
	      }
	    }
	  },
	  matchExistingProgram: function matchExistingProgram(child) {
	    for (var i = 0, len = this.context.environments.length; i &lt; len; i++) {
	      var environment = this.context.environments[i];
	      if (environment &amp;&amp; environment.equals(child)) {
	        return environment;
	      }
	    }
	  },

	  programExpression: function programExpression(guid) {
	    var child = this.environment.children[guid],
	        programParams = [child.index, 'data', child.blockParams];

	    if (this.useBlockParams || this.useDepths) {
	      programParams.push('blockParams');
	    }
	    if (this.useDepths) {
	      programParams.push('depths');
	    }

	    return 'container.program(' + programParams.join(', ') + ')';
	  },

	  useRegister: function useRegister(name) {
	    if (!this.registers[name]) {
	      this.registers[name] = true;
	      this.registers.list.push(name);
	    }
	  },

	  push: function push(expr) {
	    if (!(expr instanceof Literal)) {
	      expr = this.source.wrap(expr);
	    }

	    this.inlineStack.push(expr);
	    return expr;
	  },

	  pushStackLiteral: function pushStackLiteral(item) {
	    this.push(new Literal(item));
	  },

	  pushSource: function pushSource(source) {
	    if (this.pendingContent) {
	      this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
	      this.pendingContent = undefined;
	    }

	    if (source) {
	      this.source.push(source);
	    }
	  },

	  replaceStack: function replaceStack(callback) {
	    var prefix = ['('],
	        stack = undefined,
	        createdStack = undefined,
	        usedLiteral = undefined;

	    /* istanbul ignore next */
	    if (!this.isInline()) {
	      throw new _exception2['default']('replaceStack on non-inline');
	    }

	    // We want to merge the inline statement into the replacement statement via ','
	    var top = this.popStack(true);

	    if (top instanceof Literal) {
	      // Literals do not need to be inlined
	      stack = [top.value];
	      prefix = ['(', stack];
	      usedLiteral = true;
	    } else {
	      // Get or create the current stack name for use by the inline
	      createdStack = true;
	      var _name = this.incrStack();

	      prefix = ['((', this.push(_name), ' = ', top, ')'];
	      stack = this.topStack();
	    }

	    var item = callback.call(this, stack);

	    if (!usedLiteral) {
	      this.popStack();
	    }
	    if (createdStack) {
	      this.stackSlot--;
	    }
	    this.push(prefix.concat(item, ')'));
	  },

	  incrStack: function incrStack() {
	    this.stackSlot++;
	    if (this.stackSlot &gt; this.stackVars.length) {
	      this.stackVars.push('stack' + this.stackSlot);
	    }
	    return this.topStackName();
	  },
	  topStackName: function topStackName() {
	    return 'stack' + this.stackSlot;
	  },
	  flushInline: function flushInline() {
	    var inlineStack = this.inlineStack;
	    this.inlineStack = [];
	    for (var i = 0, len = inlineStack.length; i &lt; len; i++) {
	      var entry = inlineStack[i];
	      /* istanbul ignore if */
	      if (entry instanceof Literal) {
	        this.compileStack.push(entry);
	      } else {
	        var stack = this.incrStack();
	        this.pushSource([stack, ' = ', entry, ';']);
	        this.compileStack.push(stack);
	      }
	    }
	  },
	  isInline: function isInline() {
	    return this.inlineStack.length;
	  },

	  popStack: function popStack(wrapped) {
	    var inline = this.isInline(),
	        item = (inline ? this.inlineStack : this.compileStack).pop();

	    if (!wrapped &amp;&amp; item instanceof Literal) {
	      return item.value;
	    } else {
	      if (!inline) {
	        /* istanbul ignore next */
	        if (!this.stackSlot) {
	          throw new _exception2['default']('Invalid stack pop');
	        }
	        this.stackSlot--;
	      }
	      return item;
	    }
	  },

	  topStack: function topStack() {
	    var stack = this.isInline() ? this.inlineStack : this.compileStack,
	        item = stack[stack.length - 1];

	    /* istanbul ignore if */
	    if (item instanceof Literal) {
	      return item.value;
	    } else {
	      return item;
	    }
	  },

	  contextName: function contextName(context) {
	    if (this.useDepths &amp;&amp; context) {
	      return 'depths[' + context + ']';
	    } else {
	      return 'depth' + context;
	    }
	  },

	  quotedString: function quotedString(str) {
	    return this.source.quotedString(str);
	  },

	  objectLiteral: function objectLiteral(obj) {
	    return this.source.objectLiteral(obj);
	  },

	  aliasable: function aliasable(name) {
	    var ret = this.aliases[name];
	    if (ret) {
	      ret.referenceCount++;
	      return ret;
	    }

	    ret = this.aliases[name] = this.source.wrap(name);
	    ret.aliasable = true;
	    ret.referenceCount = 1;

	    return ret;
	  },

	  setupHelper: function setupHelper(paramSize, name, blockHelper) {
	    var params = [],
	        paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
	    var foundHelper = this.nameLookup('helpers', name, 'helper'),
	        callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})');

	    return {
	      params: params,
	      paramsInit: paramsInit,
	      name: foundHelper,
	      callParams: [callContext].concat(params)
	    };
	  },

	  setupParams: function setupParams(helper, paramSize, params) {
	    var options = {},
	        contexts = [],
	        types = [],
	        ids = [],
	        objectArgs = !params,
	        param = undefined;

	    if (objectArgs) {
	      params = [];
	    }

	    options.name = this.quotedString(helper);
	    options.hash = this.popStack();

	    if (this.trackIds) {
	      options.hashIds = this.popStack();
	    }
	    if (this.stringParams) {
	      options.hashTypes = this.popStack();
	      options.hashContexts = this.popStack();
	    }

	    var inverse = this.popStack(),
	        program = this.popStack();

	    // Avoid setting fn and inverse if neither are set. This allows
	    // helpers to do a check for `if (options.fn)`
	    if (program || inverse) {
	      options.fn = program || 'container.noop';
	      options.inverse = inverse || 'container.noop';
	    }

	    // The parameters go on to the stack in order (making sure that they are evaluated in order)
	    // so we need to pop them off the stack in reverse order
	    var i = paramSize;
	    while (i--) {
	      param = this.popStack();
	      params[i] = param;

	      if (this.trackIds) {
	        ids[i] = this.popStack();
	      }
	      if (this.stringParams) {
	        types[i] = this.popStack();
	        contexts[i] = this.popStack();
	      }
	    }

	    if (objectArgs) {
	      options.args = this.source.generateArray(params);
	    }

	    if (this.trackIds) {
	      options.ids = this.source.generateArray(ids);
	    }
	    if (this.stringParams) {
	      options.types = this.source.generateArray(types);
	      options.contexts = this.source.generateArray(contexts);
	    }

	    if (this.options.data) {
	      options.data = 'data';
	    }
	    if (this.useBlockParams) {
	      options.blockParams = 'blockParams';
	    }
	    return options;
	  },

	  setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
	    var options = this.setupParams(helper, paramSize, params);
	    options = this.objectLiteral(options);
	    if (useRegister) {
	      this.useRegister('options');
	      params.push('options');
	      return ['options=', options];
	    } else if (params) {
	      params.push(options);
	      return '';
	    } else {
	      return options;
	    }
	  }
	};

	(function () {
	  var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');

	  var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};

	  for (var i = 0, l = reservedWords.length; i &lt; l; i++) {
	    compilerWords[reservedWords[i]] = true;
	  }
	})();

	JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
	  return !JavaScriptCompiler.RESERVED_WORDS[name] &amp;&amp; /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
	};

	function strictLookup(requireTerminal, compiler, parts, type) {
	  var stack = compiler.popStack(),
	      i = 0,
	      len = parts.length;
	  if (requireTerminal) {
	    len--;
	  }

	  for (; i &lt; len; i++) {
	    stack = compiler.nameLookup(stack, parts[i], type);
	  }

	  if (requireTerminal) {
	    return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
	  } else {
	    return stack;
	  }
	}

	exports['default'] = JavaScriptCompiler;
	module.exports = exports['default'];

/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {

	/* global define */
	'use strict';

	exports.__esModule = true;

	var _utils = __webpack_require__(5);

	var SourceNode = undefined;

	try {
	  /* istanbul ignore next */
	  if (false) {
	    // We don't support this in AMD environments. For these environments, we asusme that
	    // they are running on the browser and thus have no need for the source-map library.
	    var SourceMap = require('source-map');
	    SourceNode = SourceMap.SourceNode;
	  }
	} catch (err) {}
	/* NOP */

	/* istanbul ignore if: tested but not covered in istanbul due to dist build  */
	if (!SourceNode) {
	  SourceNode = function (line, column, srcFile, chunks) {
	    this.src = '';
	    if (chunks) {
	      this.add(chunks);
	    }
	  };
	  /* istanbul ignore next */
	  SourceNode.prototype = {
	    add: function add(chunks) {
	      if (_utils.isArray(chunks)) {
	        chunks = chunks.join('');
	      }
	      this.src += chunks;
	    },
	    prepend: function prepend(chunks) {
	      if (_utils.isArray(chunks)) {
	        chunks = chunks.join('');
	      }
	      this.src = chunks + this.src;
	    },
	    toStringWithSourceMap: function toStringWithSourceMap() {
	      return { code: this.toString() };
	    },
	    toString: function toString() {
	      return this.src;
	    }
	  };
	}

	function castChunk(chunk, codeGen, loc) {
	  if (_utils.isArray(chunk)) {
	    var ret = [];

	    for (var i = 0, len = chunk.length; i &lt; len; i++) {
	      ret.push(codeGen.wrap(chunk[i], loc));
	    }
	    return ret;
	  } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
	    // Handle primitives that the SourceNode will throw up on
	    return chunk + '';
	  }
	  return chunk;
	}

	function CodeGen(srcFile) {
	  this.srcFile = srcFile;
	  this.source = [];
	}

	CodeGen.prototype = {
	  isEmpty: function isEmpty() {
	    return !this.source.length;
	  },
	  prepend: function prepend(source, loc) {
	    this.source.unshift(this.wrap(source, loc));
	  },
	  push: function push(source, loc) {
	    this.source.push(this.wrap(source, loc));
	  },

	  merge: function merge() {
	    var source = this.empty();
	    this.each(function (line) {
	      source.add(['  ', line, '\n']);
	    });
	    return source;
	  },

	  each: function each(iter) {
	    for (var i = 0, len = this.source.length; i &lt; len; i++) {
	      iter(this.source[i]);
	    }
	  },

	  empty: function empty() {
	    var loc = this.currentLocation || { start: {} };
	    return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
	  },
	  wrap: function wrap(chunk) {
	    var loc = arguments.length &lt;= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];

	    if (chunk instanceof SourceNode) {
	      return chunk;
	    }

	    chunk = castChunk(chunk, this, loc);

	    return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
	  },

	  functionCall: function functionCall(fn, type, params) {
	    params = this.generateList(params);
	    return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
	  },

	  quotedString: function quotedString(str) {
	    return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
	    .replace(/\u2029/g, '\\u2029') + '"';
	  },

	  objectLiteral: function objectLiteral(obj) {
	    var pairs = [];

	    for (var key in obj) {
	      if (obj.hasOwnProperty(key)) {
	        var value = castChunk(obj[key], this);
	        if (value !== 'undefined') {
	          pairs.push([this.quotedString(key), ':', value]);
	        }
	      }
	    }

	    var ret = this.generateList(pairs);
	    ret.prepend('{');
	    ret.add('}');
	    return ret;
	  },

	  generateList: function generateList(entries) {
	    var ret = this.empty();

	    for (var i = 0, len = entries.length; i &lt; len; i++) {
	      if (i) {
	        ret.add(',');
	      }

	      ret.add(castChunk(entries[i], this));
	    }

	    return ret;
	  },

	  generateArray: function generateArray(entries) {
	    var ret = this.generateList(entries);
	    ret.prepend('[');
	    ret.add(']');

	    return ret;
	  }
	};

	exports['default'] = CodeGen;
	module.exports = exports['default'];

/***/ })
/******/ ])
});
;
!(function(t) {
  var e = /^\s+/;
  var r = /\s+$/;
  var n = t.round;
  var a = t.min;
  var i = t.max;
  var s = t.random;
  function o(s, f) {
    if (((f = f || {}), (s = s || "") instanceof o)) return s;
    if (!(this instanceof o)) return new o(s, f);
    var h = (function(n) {
      var s = { r: 0, g: 0, b: 0 };
      var o = 1;
      var f = null;
      var h = null;
      var u = null;
      var l = !1;
      var c = !1;
      typeof n === "string" &amp;&amp;
        (n = (function(t) {
          t = t
            .replace(e, "")
            .replace(r, "")
            .toLowerCase();
          var n;
          var a = !1;
          if (S[t]) (t = S[t]), (a = !0);
          else if (t == "transparent")
            return { r: 0, g: 0, b: 0, a: 0, format: "name" };
          if ((n = j.rgb.exec(t))) return { r: n[1], g: n[2], b: n[3] };
          if ((n = j.rgba.exec(t)))
            return { r: n[1], g: n[2], b: n[3], a: n[4] };
          if ((n = j.hsl.exec(t))) return { h: n[1], s: n[2], l: n[3] };
          if ((n = j.hsla.exec(t)))
            return { h: n[1], s: n[2], l: n[3], a: n[4] };
          if ((n = j.hsv.exec(t))) return { h: n[1], s: n[2], v: n[3] };
          if ((n = j.hsva.exec(t)))
            return { h: n[1], s: n[2], v: n[3], a: n[4] };
          if ((n = j.hex8.exec(t)))
            return {
              r: q(n[1]),
              g: q(n[2]),
              b: q(n[3]),
              a: N(n[4]),
              format: a ? "name" : "hex8"
            };
          if ((n = j.hex6.exec(t)))
            return {
              r: q(n[1]),
              g: q(n[2]),
              b: q(n[3]),
              format: a ? "name" : "hex"
            };
          if ((n = j.hex4.exec(t)))
            return {
              r: q(n[1] + "" + n[1]),
              g: q(n[2] + "" + n[2]),
              b: q(n[3] + "" + n[3]),
              a: N(n[4] + "" + n[4]),
              format: a ? "name" : "hex8"
            };
          if ((n = j.hex3.exec(t)))
            return {
              r: q(n[1] + "" + n[1]),
              g: q(n[2] + "" + n[2]),
              b: q(n[3] + "" + n[3]),
              format: a ? "name" : "hex"
            };
          return !1;
        })(n));
      typeof n === "object" &amp;&amp;
        (O(n.r) &amp;&amp; O(n.g) &amp;&amp; O(n.b)
          ? ((g = n.r),
            (b = n.g),
            (d = n.b),
            (s = {
              r: 255 * F(g, 255),
              g: 255 * F(b, 255),
              b: 255 * F(d, 255)
            }),
            (l = !0),
            (c = String(n.r).substr(-1) === "%" ? "prgb" : "rgb"))
          : O(n.h) &amp;&amp; O(n.s) &amp;&amp; O(n.v)
          ? ((f = I(n.s)),
            (h = I(n.v)),
            (s = (function(e, r, n) {
              (e = 6 * F(e, 360)), (r = F(r, 100)), (n = F(n, 100));
              var a = t.floor(e);
              var i = e - a;
              var s = n * (1 - r);
              var o = n * (1 - i * r);
              var f = n * (1 - (1 - i) * r);
              var h = a % 6;
              return {
                r: 255 * [n, o, s, s, f, n][h],
                g: 255 * [f, n, n, o, s, s][h],
                b: 255 * [s, s, f, n, n, o][h]
              };
            })(n.h, f, h)),
            (l = !0),
            (c = "hsv"))
          : O(n.h) &amp;&amp;
            O(n.s) &amp;&amp;
            O(n.l) &amp;&amp;
            ((f = I(n.s)),
            (u = I(n.l)),
            (s = (function(t, e, r) {
              var n;
              var a;
              var i;
              function s(t, e, r) {
                return (
                  r &lt; 0 &amp;&amp; (r += 1),
                  r &gt; 1 &amp;&amp; (r -= 1),
                  r &lt; 1 / 6
                    ? t + 6 * (e - t) * r
                    : r &lt; 0.5
                    ? e
                    : r &lt; 2 / 3
                    ? t + (e - t) * (2 / 3 - r) * 6
                    : t
                );
              }
              if (((t = F(t, 360)), (e = F(e, 100)), (r = F(r, 100)), e === 0))
                n = a = i = r;
              else {
                var o = r &lt; 0.5 ? r * (1 + e) : r + e - r * e;
                var f = 2 * r - o;
                (n = s(f, o, t + 1 / 3)),
                  (a = s(f, o, t)),
                  (i = s(f, o, t - 1 / 3));
              }
              return { r: 255 * n, g: 255 * a, b: 255 * i };
            })(n.h, f, u)),
            (l = !0),
            (c = "hsl")),
        n.hasOwnProperty("a") &amp;&amp; (o = n.a));
      var g;
      var b;
      var d;
      return (
        (o = R(o)),
        {
          ok: l,
          format: n.format || c,
          r: a(255, i(s.r, 0)),
          g: a(255, i(s.g, 0)),
          b: a(255, i(s.b, 0)),
          a: o
        }
      );
    })(s);
    (this._originalInput = s),
      (this._r = h.r),
      (this._g = h.g),
      (this._b = h.b),
      (this._a = h.a),
      (this._roundA = n(100 * this._a) / 100),
      (this._format = f.format || h.format),
      (this._gradientType = f.gradientType),
      this._r &lt; 1 &amp;&amp; (this._r = n(this._r)),
      this._g &lt; 1 &amp;&amp; (this._g = n(this._g)),
      this._b &lt; 1 &amp;&amp; (this._b = n(this._b)),
      (this._ok = h.ok);
  }
  function f(t, e, r) {
    (t = F(t, 255)), (e = F(e, 255)), (r = F(r, 255));
    var n;
    var s;
    var o = i(t, e, r);
    var f = a(t, e, r);
    var h = (o + f) / 2;
    if (o == f) n = s = 0;
    else {
      var u = o - f;
      switch (((s = h &gt; 0.5 ? u / (2 - o - f) : u / (o + f)), o)) {
        case t:
          n = (e - r) / u + (e &lt; r ? 6 : 0);
          break;
        case e:
          n = (r - t) / u + 2;
          break;
        case r:
          n = (t - e) / u + 4;
      }
      n /= 6;
    }
    return { h: n, s: s, l: h };
  }
  function h(t, e, r) {
    (t = F(t, 255)), (e = F(e, 255)), (r = F(r, 255));
    var n;
    var s;
    var o = i(t, e, r);
    var f = a(t, e, r);
    var h = o;
    var u = o - f;
    if (((s = o === 0 ? 0 : u / o), o == f)) n = 0;
    else {
      switch (o) {
        case t:
          n = (e - r) / u + (e &lt; r ? 6 : 0);
          break;
        case e:
          n = (r - t) / u + 2;
          break;
        case r:
          n = (t - e) / u + 4;
      }
      n /= 6;
    }
    return { h: n, s: s, v: h };
  }
  function u(t, e, r, a) {
    var i = [M(n(t).toString(16)), M(n(e).toString(16)), M(n(r).toString(16))];
    return a &amp;&amp;
      i[0].charAt(0) == i[0].charAt(1) &amp;&amp;
      i[1].charAt(0) == i[1].charAt(1) &amp;&amp;
      i[2].charAt(0) == i[2].charAt(1)
      ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0)
      : i.join("");
  }
  function l(t, e, r, a) {
    return [
      M(L(a)),
      M(n(t).toString(16)),
      M(n(e).toString(16)),
      M(n(r).toString(16))
    ].join("");
  }
  function c(t, e) {
    e = e === 0 ? 0 : e || 10;
    var r = o(t).toHsl();
    return (r.s -= e / 100), (r.s = C(r.s)), o(r);
  }
  function g(t, e) {
    e = e === 0 ? 0 : e || 10;
    var r = o(t).toHsl();
    return (r.s += e / 100), (r.s = C(r.s)), o(r);
  }
  function b(t) {
    return o(t).desaturate(100);
  }
  function d(t, e) {
    e = e === 0 ? 0 : e || 10;
    var r = o(t).toHsl();
    return (r.l += e / 100), (r.l = C(r.l)), o(r);
  }
  function _(t, e) {
    e = e === 0 ? 0 : e || 10;
    var r = o(t).toRgb();
    return (
      (r.r = i(0, a(255, r.r - n((-e / 100) * 255)))),
      (r.g = i(0, a(255, r.g - n((-e / 100) * 255)))),
      (r.b = i(0, a(255, r.b - n((-e / 100) * 255)))),
      o(r)
    );
  }
  function p(t, e) {
    e = e === 0 ? 0 : e || 10;
    var r = o(t).toHsl();
    return (r.l -= e / 100), (r.l = C(r.l)), o(r);
  }
  function m(t, e) {
    var r = o(t).toHsl();
    var n = (r.h + e) % 360;
    return (r.h = n &lt; 0 ? 360 + n : n), o(r);
  }
  function v(t) {
    var e = o(t).toHsl();
    return (e.h = (e.h + 180) % 360), o(e);
  }
  function y(t) {
    var e = o(t).toHsl();
    var r = e.h;
    return [
      o(t),
      o({ h: (r + 120) % 360, s: e.s, l: e.l }),
      o({ h: (r + 240) % 360, s: e.s, l: e.l })
    ];
  }
  function A(t) {
    var e = o(t).toHsl();
    var r = e.h;
    return [
      o(t),
      o({ h: (r + 90) % 360, s: e.s, l: e.l }),
      o({ h: (r + 180) % 360, s: e.s, l: e.l }),
      o({ h: (r + 270) % 360, s: e.s, l: e.l })
    ];
  }
  function x(t) {
    var e = o(t).toHsl();
    var r = e.h;
    return [
      o(t),
      o({ h: (r + 72) % 360, s: e.s, l: e.l }),
      o({ h: (r + 216) % 360, s: e.s, l: e.l })
    ];
  }
  function k(t, e, r) {
    (e = e || 6), (r = r || 30);
    var n = o(t).toHsl();
    var a = 360 / r;
    var i = [o(t)];
    for (n.h = (n.h - ((a * e) &gt;&gt; 1) + 720) % 360; --e; )
      (n.h = (n.h + a) % 360), i.push(o(n));
    return i;
  }
  function w(t, e) {
    e = e || 6;
    for (
      var r = o(t).toHsv(), n = r.h, a = r.s, i = r.v, s = [], f = 1 / e;
      e--;

    )
      s.push(o({ h: n, s: a, v: i })), (i = (i + f) % 1);
    return s;
  }
  (o.prototype = {
    isDark: function() {
      return this.getBrightness() &lt; 128;
    },
    isLight: function() {
      return !this.isDark();
    },
    isValid: function() {
      return this._ok;
    },
    getOriginalInput: function() {
      return this._originalInput;
    },
    getFormat: function() {
      return this._format;
    },
    getAlpha: function() {
      return this._a;
    },
    getBrightness: function() {
      var t = this.toRgb();
      return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3;
    },
    getLuminance: function() {
      var e;
      var r;
      var n;
      var a = this.toRgb();
      return (
        (e = a.r / 255),
        (r = a.g / 255),
        (n = a.b / 255),
        0.2126 * (e &lt;= 0.03928 ? e / 12.92 : t.pow((e + 0.055) / 1.055, 2.4)) +
          0.7152 *
            (r &lt;= 0.03928 ? r / 12.92 : t.pow((r + 0.055) / 1.055, 2.4)) +
          0.0722 * (n &lt;= 0.03928 ? n / 12.92 : t.pow((n + 0.055) / 1.055, 2.4))
      );
    },
    setAlpha: function(t) {
      return (this._a = R(t)), (this._roundA = n(100 * this._a) / 100), this;
    },
    toHsv: function() {
      var t = h(this._r, this._g, this._b);
      return { h: 360 * t.h, s: t.s, v: t.v, a: this._a };
    },
    toHsvString: function() {
      var t = h(this._r, this._g, this._b);
      var e = n(360 * t.h);
      var r = n(100 * t.s);
      var a = n(100 * t.v);
      return this._a == 1
        ? "hsv(" + e + ", " + r + "%, " + a + "%)"
        : "hsva(" + e + ", " + r + "%, " + a + "%, " + this._roundA + ")";
    },
    toHsl: function() {
      var t = f(this._r, this._g, this._b);
      return { h: 360 * t.h, s: t.s, l: t.l, a: this._a };
    },
    toHslString: function() {
      var t = f(this._r, this._g, this._b);
      var e = n(360 * t.h);
      var r = n(100 * t.s);
      var a = n(100 * t.l);
      return this._a == 1
        ? "hsl(" + e + ", " + r + "%, " + a + "%)"
        : "hsla(" + e + ", " + r + "%, " + a + "%, " + this._roundA + ")";
    },
    toHex: function(t) {
      return u(this._r, this._g, this._b, t);
    },
    toHexString: function(t) {
      return "#" + this.toHex(t);
    },
    toHex8: function(t) {
      return (function(t, e, r, a, i) {
        var s = [
          M(n(t).toString(16)),
          M(n(e).toString(16)),
          M(n(r).toString(16)),
          M(L(a))
        ];
        if (
          i &amp;&amp;
          s[0].charAt(0) == s[0].charAt(1) &amp;&amp;
          s[1].charAt(0) == s[1].charAt(1) &amp;&amp;
          s[2].charAt(0) == s[2].charAt(1) &amp;&amp;
          s[3].charAt(0) == s[3].charAt(1)
        )
          return (
            s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) + s[3].charAt(0)
          );
        return s.join("");
      })(this._r, this._g, this._b, this._a, t);
    },
    toHex8String: function(t) {
      return "#" + this.toHex8(t);
    },
    toRgb: function() {
      return { r: n(this._r), g: n(this._g), b: n(this._b), a: this._a };
    },
    toRgbString: function() {
      return this._a == 1
        ? "rgb(" + n(this._r) + ", " + n(this._g) + ", " + n(this._b) + ")"
        : "rgba(" +
            n(this._r) +
            ", " +
            n(this._g) +
            ", " +
            n(this._b) +
            ", " +
            this._roundA +
            ")";
    },
    toPercentageRgb: function() {
      return {
        r: n(100 * F(this._r, 255)) + "%",
        g: n(100 * F(this._g, 255)) + "%",
        b: n(100 * F(this._b, 255)) + "%",
        a: this._a
      };
    },
    toPercentageRgbString: function() {
      return this._a == 1
        ? "rgb(" +
            n(100 * F(this._r, 255)) +
            "%, " +
            n(100 * F(this._g, 255)) +
            "%, " +
            n(100 * F(this._b, 255)) +
            "%)"
        : "rgba(" +
            n(100 * F(this._r, 255)) +
            "%, " +
            n(100 * F(this._g, 255)) +
            "%, " +
            n(100 * F(this._b, 255)) +
            "%, " +
            this._roundA +
            ")";
    },
    toName: function() {
      return this._a === 0
        ? "transparent"
        : !(this._a &lt; 1) &amp;&amp; (H[u(this._r, this._g, this._b, !0)] || !1);
    },
    toFilter: function(t) {
      var e = "#" + l(this._r, this._g, this._b, this._a);
      var r = e;
      var n = this._gradientType ? "GradientType = 1, " : "";
      if (t) {
        var a = o(t);
        r = "#" + l(a._r, a._g, a._b, a._a);
      }
      return (
        "progid:DXImageTransform.Microsoft.gradient(" +
        n +
        "startColorstr=" +
        e +
        ",endColorstr=" +
        r +
        ")"
      );
    },
    toString: function(t) {
      var e = !!t;
      t = t || this._format;
      var r = !1;
      var n = this._a &lt; 1 &amp;&amp; this._a &gt;= 0;
      return e ||
        !n ||
        (t !== "hex" &amp;&amp;
          t !== "hex6" &amp;&amp;
          t !== "hex3" &amp;&amp;
          t !== "hex4" &amp;&amp;
          t !== "hex8" &amp;&amp;
          t !== "name")
        ? (t === "rgb" &amp;&amp; (r = this.toRgbString()),
          t === "prgb" &amp;&amp; (r = this.toPercentageRgbString()),
          (t !== "hex" &amp;&amp; t !== "hex6") || (r = this.toHexString()),
          t === "hex3" &amp;&amp; (r = this.toHexString(!0)),
          t === "hex4" &amp;&amp; (r = this.toHex8String(!0)),
          t === "hex8" &amp;&amp; (r = this.toHex8String()),
          t === "name" &amp;&amp; (r = this.toName()),
          t === "hsl" &amp;&amp; (r = this.toHslString()),
          t === "hsv" &amp;&amp; (r = this.toHsvString()),
          r || this.toHexString())
        : t === "name" &amp;&amp; this._a === 0
        ? this.toName()
        : this.toRgbString();
    },
    clone: function() {
      return o(this.toString());
    },
    _applyModification: function(t, e) {
      var r = t.apply(null, [this].concat([].slice.call(e)));
      return (
        (this._r = r._r),
        (this._g = r._g),
        (this._b = r._b),
        this.setAlpha(r._a),
        this
      );
    },
    lighten: function() {
      return this._applyModification(d, arguments);
    },
    brighten: function() {
      return this._applyModification(_, arguments);
    },
    darken: function() {
      return this._applyModification(p, arguments);
    },
    desaturate: function() {
      return this._applyModification(c, arguments);
    },
    saturate: function() {
      return this._applyModification(g, arguments);
    },
    greyscale: function() {
      return this._applyModification(b, arguments);
    },
    spin: function() {
      return this._applyModification(m, arguments);
    },
    _applyCombination: function(t, e) {
      return t.apply(null, [this].concat([].slice.call(e)));
    },
    analogous: function() {
      return this._applyCombination(k, arguments);
    },
    complement: function() {
      return this._applyCombination(v, arguments);
    },
    monochromatic: function() {
      return this._applyCombination(w, arguments);
    },
    splitcomplement: function() {
      return this._applyCombination(x, arguments);
    },
    triad: function() {
      return this._applyCombination(y, arguments);
    },
    tetrad: function() {
      return this._applyCombination(A, arguments);
    }
  }),
    (o.fromRatio = function(t, e) {
      if (typeof t === "object") {
        var r = {};
        for (var n in t)
          t.hasOwnProperty(n) &amp;&amp; (r[n] = n === "a" ? t[n] : I(t[n]));
        t = r;
      }
      return o(t, e);
    }),
    (o.equals = function(t, e) {
      return !(!t || !e) &amp;&amp; o(t).toRgbString() == o(e).toRgbString();
    }),
    (o.random = function() {
      return o.fromRatio({ r: s(), g: s(), b: s() });
    }),
    (o.mix = function(t, e, r) {
      r = r === 0 ? 0 : r || 50;
      var n = o(t).toRgb();
      var a = o(e).toRgb();
      var i = r / 100;
      return o({
        r: (a.r - n.r) * i + n.r,
        g: (a.g - n.g) * i + n.g,
        b: (a.b - n.b) * i + n.b,
        a: (a.a - n.a) * i + n.a
      });
    }),
    (o.readability = function(e, r) {
      var n = o(e);
      var a = o(r);
      return (
        (t.max(n.getLuminance(), a.getLuminance()) + 0.05) /
        (t.min(n.getLuminance(), a.getLuminance()) + 0.05)
      );
    }),
    (o.isReadable = function(t, e, r) {
      var n;
      var a;
      var i = o.readability(t, e);
      switch (
        ((a = !1),
        (n = (function(t) {
          var e;
          var r;
          (e = (
            (t = t || { level: "AA", size: "small" }).level || "AA"
          ).toUpperCase()),
            (r = (t.size || "small").toLowerCase()),
            e !== "AA" &amp;&amp; e !== "AAA" &amp;&amp; (e = "AA");
          r !== "small" &amp;&amp; r !== "large" &amp;&amp; (r = "small");
          return { level: e, size: r };
        })(r)).level + n.size)
      ) {
        case "AAsmall":
        case "AAAlarge":
          a = i &gt;= 4.5;
          break;
        case "AAlarge":
          a = i &gt;= 3;
          break;
        case "AAAsmall":
          a = i &gt;= 7;
      }
      return a;
    }),
    (o.mostReadable = function(t, e, r) {
      var n;
      var a;
      var i;
      var s;
      var f = null;
      var h = 0;
      (a = (r = r || {}).includeFallbackColors), (i = r.level), (s = r.size);
      for (var u = 0; u &lt; e.length; u++)
        (n = o.readability(t, e[u])) &gt; h &amp;&amp; ((h = n), (f = o(e[u])));
      return o.isReadable(t, f, { level: i, size: s }) || !a
        ? f
        : ((r.includeFallbackColors = !1),
          o.mostReadable(t, ["#fff", "#000"], r));
    });
  var S = (o.names = {
    aliceblue: "f0f8ff",
    antiquewhite: "faebd7",
    aqua: "0ff",
    aquamarine: "7fffd4",
    azure: "f0ffff",
    beige: "f5f5dc",
    bisque: "ffe4c4",
    black: "000",
    blanchedalmond: "ffebcd",
    blue: "00f",
    blueviolet: "8a2be2",
    brown: "a52a2a",
    burlywood: "deb887",
    burntsienna: "ea7e5d",
    cadetblue: "5f9ea0",
    chartreuse: "7fff00",
    chocolate: "d2691e",
    coral: "ff7f50",
    cornflowerblue: "6495ed",
    cornsilk: "fff8dc",
    crimson: "dc143c",
    cyan: "0ff",
    darkblue: "00008b",
    darkcyan: "008b8b",
    darkgoldenrod: "b8860b",
    darkgray: "a9a9a9",
    darkgreen: "006400",
    darkgrey: "a9a9a9",
    darkkhaki: "bdb76b",
    darkmagenta: "8b008b",
    darkolivegreen: "556b2f",
    darkorange: "ff8c00",
    darkorchid: "9932cc",
    darkred: "8b0000",
    darksalmon: "e9967a",
    darkseagreen: "8fbc8f",
    darkslateblue: "483d8b",
    darkslategray: "2f4f4f",
    darkslategrey: "2f4f4f",
    darkturquoise: "00ced1",
    darkviolet: "9400d3",
    deeppink: "ff1493",
    deepskyblue: "00bfff",
    dimgray: "696969",
    dimgrey: "696969",
    dodgerblue: "1e90ff",
    firebrick: "b22222",
    floralwhite: "fffaf0",
    forestgreen: "228b22",
    fuchsia: "f0f",
    gainsboro: "dcdcdc",
    ghostwhite: "f8f8ff",
    gold: "ffd700",
    goldenrod: "daa520",
    gray: "808080",
    green: "008000",
    greenyellow: "adff2f",
    grey: "808080",
    honeydew: "f0fff0",
    hotpink: "ff69b4",
    indianred: "cd5c5c",
    indigo: "4b0082",
    ivory: "fffff0",
    khaki: "f0e68c",
    lavender: "e6e6fa",
    lavenderblush: "fff0f5",
    lawngreen: "7cfc00",
    lemonchiffon: "fffacd",
    lightblue: "add8e6",
    lightcoral: "f08080",
    lightcyan: "e0ffff",
    lightgoldenrodyellow: "fafad2",
    lightgray: "d3d3d3",
    lightgreen: "90ee90",
    lightgrey: "d3d3d3",
    lightpink: "ffb6c1",
    lightsalmon: "ffa07a",
    lightseagreen: "20b2aa",
    lightskyblue: "87cefa",
    lightslategray: "789",
    lightslategrey: "789",
    lightsteelblue: "b0c4de",
    lightyellow: "ffffe0",
    lime: "0f0",
    limegreen: "32cd32",
    linen: "faf0e6",
    magenta: "f0f",
    maroon: "800000",
    mediumaquamarine: "66cdaa",
    mediumblue: "0000cd",
    mediumorchid: "ba55d3",
    mediumpurple: "9370db",
    mediumseagreen: "3cb371",
    mediumslateblue: "7b68ee",
    mediumspringgreen: "00fa9a",
    mediumturquoise: "48d1cc",
    mediumvioletred: "c71585",
    midnightblue: "191970",
    mintcream: "f5fffa",
    mistyrose: "ffe4e1",
    moccasin: "ffe4b5",
    navajowhite: "ffdead",
    navy: "000080",
    oldlace: "fdf5e6",
    olive: "808000",
    olivedrab: "6b8e23",
    orange: "ffa500",
    orangered: "ff4500",
    orchid: "da70d6",
    palegoldenrod: "eee8aa",
    palegreen: "98fb98",
    paleturquoise: "afeeee",
    palevioletred: "db7093",
    papayawhip: "ffefd5",
    peachpuff: "ffdab9",
    peru: "cd853f",
    pink: "ffc0cb",
    plum: "dda0dd",
    powderblue: "b0e0e6",
    purple: "800080",
    rebeccapurple: "663399",
    red: "f00",
    rosybrown: "bc8f8f",
    royalblue: "4169e1",
    saddlebrown: "8b4513",
    salmon: "fa8072",
    sandybrown: "f4a460",
    seagreen: "2e8b57",
    seashell: "fff5ee",
    sienna: "a0522d",
    silver: "c0c0c0",
    skyblue: "87ceeb",
    slateblue: "6a5acd",
    slategray: "708090",
    slategrey: "708090",
    snow: "fffafa",
    springgreen: "00ff7f",
    steelblue: "4682b4",
    tan: "d2b48c",
    teal: "008080",
    thistle: "d8bfd8",
    tomato: "ff6347",
    turquoise: "40e0d0",
    violet: "ee82ee",
    wheat: "f5deb3",
    white: "fff",
    whitesmoke: "f5f5f5",
    yellow: "ff0",
    yellowgreen: "9acd32"
  });
  var H = (o.hexNames = (function(t) {
    var e = {};
    for (var r in t) t.hasOwnProperty(r) &amp;&amp; (e[t[r]] = r);
    return e;
  })(S));
  function R(t) {
    return (t = parseFloat(t)), (isNaN(t) || t &lt; 0 || t &gt; 1) &amp;&amp; (t = 1), t;
  }
  function F(e, r) {
    (function(t) {
      return (
        typeof t === "string" &amp;&amp; t.indexOf(".") != -1 &amp;&amp; parseFloat(t) === 1
      );
    })(e) &amp;&amp; (e = "100%");
    var n = (function(t) {
      return typeof t === "string" &amp;&amp; t.indexOf("%") != -1;
    })(e);
    return (
      (e = a(r, i(0, parseFloat(e)))),
      n &amp;&amp; (e = parseInt(e * r, 10) / 100),
      t.abs(e - r) &lt; 1e-6 ? 1 : (e % r) / parseFloat(r)
    );
  }
  function C(t) {
    return a(1, i(0, t));
  }
  function q(t) {
    return parseInt(t, 16);
  }
  function M(t) {
    return t.length == 1 ? "0" + t : "" + t;
  }
  function I(t) {
    return t &lt;= 1 &amp;&amp; (t = 100 * t + "%"), t;
  }
  function L(e) {
    return t.round(255 * parseFloat(e)).toString(16);
  }
  function N(t) {
    return q(t) / 255;
  }
  var z;
  var E;
  var T;
  var j =
    ((E =
      "[\\s|\\(]+(" +
      (z = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)") +
      ")[,|\\s]+(" +
      z +
      ")[,|\\s]+(" +
      z +
      ")\\s*\\)?"),
    (T =
      "[\\s|\\(]+(" +
      z +
      ")[,|\\s]+(" +
      z +
      ")[,|\\s]+(" +
      z +
      ")[,|\\s]+(" +
      z +
      ")\\s*\\)?"),
    {
      CSS_UNIT: new RegExp(z),
      rgb: new RegExp("rgb" + E),
      rgba: new RegExp("rgba" + T),
      hsl: new RegExp("hsl" + E),
      hsla: new RegExp("hsla" + T),
      hsv: new RegExp("hsv" + E),
      hsva: new RegExp("hsva" + T),
      hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
      hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
      hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
      hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
    });
  function O(t) {
    return !!j.CSS_UNIT.exec(t);
  }
  typeof module !== "undefined" &amp;&amp; module.exports
    ? (module.exports = o)
    : typeof define === "function" &amp;&amp; define.amd
    ? define(function() {
        return o;
      })
    : (window.tinycolor = o);
})(Math);

/*!
 * Datepicker for Bootstrap v1.8.0 (https://github.com/uxsolutions/bootstrap-datepicker)
 *
 * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
 */

!function(a){"function"==typeof define&amp;&amp;define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a,b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function d(){var a=new Date;return c(a.getFullYear(),a.getMonth(),a.getDate())}function e(a,b){return a.getUTCFullYear()===b.getUTCFullYear()&amp;&amp;a.getUTCMonth()===b.getUTCMonth()&amp;&amp;a.getUTCDate()===b.getUTCDate()}function f(c,d){return function(){return d!==b&amp;&amp;a.fn.datepicker.deprecated(d),this[c].apply(this,arguments)}}function g(a){return a&amp;&amp;!isNaN(a.getTime())}function h(b,c){function d(a,b){return b.toLowerCase()}var e,f=a(b).data(),g={},h=new RegExp("^"+c.toLowerCase()+"([A-Z])");c=new RegExp("^"+c.toLowerCase());for(var i in f)c.test(i)&amp;&amp;(e=i.replace(h,d),g[e]=f[i]);return g}function i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,function(a,b){b in d&amp;&amp;(c[b]=d[b])}),c}}var j=function(){var b={get:function(a){return this.slice(a)[0]},contains:function(a){for(var b=a&amp;&amp;a.valueOf(),c=0,d=this.length;c&lt;d;c++)if(0&lt;=this[c].valueOf()-b&amp;&amp;this[c].valueOf()-b&lt;864e5)return c;return-1},remove:function(a){this.splice(a,1)},replace:function(b){b&amp;&amp;(a.isArray(b)||(b=[b]),this.clear(),this.push.apply(this,b))},clear:function(){this.length=0},copy:function(){var a=new j;return a.replace(this),a}};return function(){var c=[];return c.push.apply(c,arguments),a.extend(c,b),c}}(),k=function(b,c){a.data(b,"datepicker",this),this._process_options(c),this.dates=new j,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=a(b),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&amp;&amp;this.element.find(".add-on, .input-group-addon, .btn"),this.component&amp;&amp;0===this.component.length&amp;&amp;(this.component=!1),this.isInline=!this.component&amp;&amp;this.element.is("div"),this.picker=a(r.template),this._check_template(this.o.templates.leftArrow)&amp;&amp;this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&amp;&amp;this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&amp;&amp;this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&amp;&amp;this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(a,b){return Number(b)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&amp;&amp;this.show()};k.prototype={constructor:k,_resolveViewName:function(b){return a.each(r.viewModes,function(c,d){if(b===c||a.inArray(b,d.names)!==-1)return b=c,!1}),b},_resolveDaysOfWeek:function(b){return a.isArray(b)||(b=b.split(/[,\s]*/)),a.map(b,Number)},_check_template:function(c){try{if(c===b||""===c)return!1;if((c.match(/[&lt;&gt;]/g)||[]).length&lt;=0)return!0;var d=a(c);return d.length&gt;0}catch(a){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView),e.minViewMode=this._resolveViewName(e.minViewMode),e.maxViewMode=this._resolveViewName(e.maxViewMode),e.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,e.startView)),e.multidate!==!0&amp;&amp;(e.multidate=Number(e.multidate)||!1,e.multidate!==!1&amp;&amp;(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-(1/0)&amp;&amp;(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-(1/0)),e.endDate!==1/0&amp;&amp;(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=this._resolveDaysOfWeek(e.daysOfWeekDisabled||[]),e.daysOfWeekHighlighted=this._resolveDaysOfWeek(e.daysOfWeekHighlighted||[]),e.datesDisabled=e.datesDisabled||[],a.isArray(e.datesDisabled)||(e.datesDisabled=e.datesDisabled.split(",")),e.datesDisabled=a.map(e.datesDisabled,function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)});var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,function(a){return/^auto|left|right|top|bottom$/.test(a)}),e.orientation={x:"auto",y:"auto"},i&amp;&amp;"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,function(a){return/^left|right$/.test(a)}),e.orientation.x=i[0]||"auto",i=a.grep(h,function(a){return/^top|bottom$/.test(a)}),e.orientation.y=i[0]||"auto";else;if(e.defaultViewDate instanceof Date||"string"==typeof e.defaultViewDate)e.defaultViewDate=r.parseDate(e.defaultViewDate,g,e.language,e.assumeNearbyYear);else if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_events:[],_secondaryEvents:[],_applyEvents:function(a){for(var c,d,e,f=0;f&lt;a.length;f++)c=a[f][0],2===a[f].length?(d=b,e=a[f][1]):3===a[f].length&amp;&amp;(d=a[f][1],e=a[f][2]),c.on(e,d)},_unapplyEvents:function(a){for(var c,d,e,f=0;f&lt;a.length;f++)c=a[f][0],2===a[f].length?(e=b,d=a[f][1]):3===a[f].length&amp;&amp;(e=a[f][1],d=a[f][2]),c.off(d,e)},_buildEvents:function(){var b={keyup:a.proxy(function(b){a.inArray(b.keyCode,[27,37,39,38,40,32,13,9])===-1&amp;&amp;this.update()},this),keydown:a.proxy(this.keydown,this),paste:a.proxy(this.paste,this)};this.o.showOnFocus===!0&amp;&amp;(b.focus=a.proxy(this.show,this)),this.isInput?this._events=[[this.element,b]]:this.component&amp;&amp;this.inputField.length?this._events=[[this.inputField,b],[this.component,{click:a.proxy(this.show,this)}]]:this._events=[[this.element,{click:a.proxy(this.show,this),keydown:a.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:a.proxy(function(a){this._focused_from=a.target},this)}],[this.element,{blur:a.proxy(function(a){this._focused_from=a.target},this)}]),this.o.immediateUpdates&amp;&amp;this._events.push([this.element,{"changeYear changeMonth":a.proxy(function(a){this.update(a.date)},this)}]),this._secondaryEvents=[[this.picker,{click:a.proxy(this.click,this)}],[this.picker,".prev, .next",{click:a.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:a.proxy(this.dayCellClick,this)}],[a(window),{resize:a.proxy(this.place,this)}],[a(document),{"mousedown touchstart":a.proxy(function(a){this.element.is(a.target)||this.element.find(a.target).length||this.picker.is(a.target)||this.picker.find(a.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(b,c){var d=c||this.dates.get(-1),e=this._utc_to_local(d);this.element.trigger({type:b,date:e,viewMode:this.viewMode,dates:a.map(this.dates,this._utc_to_local),format:a.proxy(function(a,b){0===arguments.length?(a=this.dates.length-1,b=this.o.format):"string"==typeof a&amp;&amp;(b=a,a=this.dates.length-1),b=b||this.o.format;var c=this.dates.get(a);return r.formatDate(c,b,this.o.language)},this)})},show:function(){if(!(this.inputField.prop("disabled")||this.inputField.prop("readonly")&amp;&amp;this.o.enableOnReadonly===!1))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&amp;&amp;this.o.disableTouchKeyboard&amp;&amp;a(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&amp;&amp;this.inputField.val()&amp;&amp;this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(b){var c;if(b.originalEvent.clipboardData&amp;&amp;b.originalEvent.clipboardData.types&amp;&amp;a.inArray("text/plain",b.originalEvent.clipboardData.types)!==-1)c=b.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;c=window.clipboardData.getData("Text")}this.setDate(c),this.update(),b.preventDefault()},_utc_to_local:function(a){if(!a)return a;var b=new Date(a.getTime()+6e4*a.getTimezoneOffset());return b.getTimezoneOffset()!==a.getTimezoneOffset()&amp;&amp;(b=new Date(a.getTime()+6e4*b.getTimezoneOffset())),b},_local_to_utc:function(a){return a&amp;&amp;new Date(a.getTime()-6e4*a.getTimezoneOffset())},_zero_time:function(a){return a&amp;&amp;new Date(a.getFullYear(),a.getMonth(),a.getDate())},_zero_utc_time:function(a){return a&amp;&amp;c(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())},getDates:function(){return a.map(this.dates,this._utc_to_local)},getUTCDates:function(){return a.map(this.dates,function(a){return new Date(a)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var a=this.dates.get(-1);return a!==b?new Date(a):null},clearDates:function(){this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&amp;&amp;this.hide()},setDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,b),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,a.map(b,this._utc_to_local)),this},setDate:f("setDates"),setUTCDate:f("setUTCDates"),remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var a=this.getFormattedDate();return this.inputField.val(a),this},getFormattedDate:function(c){c===b&amp;&amp;(c=this.o.format);var d=this.o.language;return a.map(this.dates,function(a){return r.formatDate(a,c,d)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(a){return this._process_options({startDate:a}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(a){return this._process_options({endDate:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(a){return this._process_options({daysOfWeekDisabled:a}),this.update(),this},setDaysOfWeekHighlighted:function(a){return this._process_options({daysOfWeekHighlighted:a}),this.update(),this},setDatesDisabled:function(a){return this._process_options({datesDisabled:a}),this.update(),this},place:function(){if(this.isInline)return this;var b=this.picker.outerWidth(),c=this.picker.outerHeight(),d=10,e=a(this.o.container),f=e.width(),g="body"===this.o.container?a(document).scrollTop():e.scrollTop(),h=e.offset(),i=[0];this.element.parents().each(function(){var b=a(this).css("z-index");"auto"!==b&amp;&amp;0!==Number(b)&amp;&amp;i.push(Number(b))});var j=Math.max.apply(Math,i)+this.o.zIndexOffset,k=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),m=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),n=k.left-h.left,o=k.top-h.top;"body"!==this.o.container&amp;&amp;(o+=g),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&amp;&amp;(n-=b-m)):k.left&lt;0?(this.picker.addClass("datepicker-orient-left"),n-=k.left-d):n+b&gt;f?(this.picker.addClass("datepicker-orient-right"),n+=m-b):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var p,q=this.o.orientation.y;if("auto"===q&amp;&amp;(p=-g+o-c,q=p&lt;0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+q),"top"===q?o-=c+parseInt(this.picker.css("padding-top")):o+=l,this.o.rtl){var r=f-(n+m);this.picker.css({top:o,right:r,zIndex:j})}else this.picker.css({top:o,left:n,zIndex:j});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return arguments.length?(a.each(arguments,a.proxy(function(a,b){b instanceof Date&amp;&amp;(b=this._local_to_utc(b)),c.push(b)},this)),d=!0):(c=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),c=c&amp;&amp;this.o.multidate?c.split(this.o.multidateSeparator):[c],delete this.element.data().date),c=a.map(c,a.proxy(function(a){return r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),c=a.grep(c,a.proxy(function(a){return!this.dateWithinRange(a)||!a},this),!0),this.dates.replace(c),this.o.updateViewDate&amp;&amp;(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate&lt;this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate&gt;this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),d?(this.setValue(),this.element.change()):this.dates.length&amp;&amp;String(b)!==String(this.dates)&amp;&amp;d&amp;&amp;(this._trigger("changeDate"),this.element.change()),!this.dates.length&amp;&amp;b.length&amp;&amp;(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var b=this.o.weekStart,c="&lt;tr&gt;";for(this.o.calendarWeeks&amp;&amp;(c+='&lt;th class="cw"&gt;&amp;#160;&lt;/th&gt;');b&lt;this.o.weekStart+7;)c+='&lt;th class="dow',a.inArray(b,this.o.daysOfWeekDisabled)!==-1&amp;&amp;(c+=" disabled"),c+='"&gt;'+q[this.o.language].daysMin[b++%7]+"&lt;/th&gt;";c+="&lt;/tr&gt;",this.picker.find(".datepicker-days thead").append(c)}},fillMonths:function(){for(var a,b=this._utc_to_local(this.viewDate),c="",d=0;d&lt;12;d++)a=b&amp;&amp;b.getMonth()===d?" focused":"",c+='&lt;span class="month'+a+'"&gt;'+q[this.o.language].monthsShort[d]+"&lt;/span&gt;";this.picker.find(".datepicker-months td").html(c)},setRange:function(b){b&amp;&amp;b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},getClassNames:function(b){var c=[],f=this.viewDate.getUTCFullYear(),g=this.viewDate.getUTCMonth(),h=d();return b.getUTCFullYear()&lt;f||b.getUTCFullYear()===f&amp;&amp;b.getUTCMonth()&lt;g?c.push("old"):(b.getUTCFullYear()&gt;f||b.getUTCFullYear()===f&amp;&amp;b.getUTCMonth()&gt;g)&amp;&amp;c.push("new"),this.focusDate&amp;&amp;b.valueOf()===this.focusDate.valueOf()&amp;&amp;c.push("focused"),this.o.todayHighlight&amp;&amp;e(b,h)&amp;&amp;c.push("today"),this.dates.contains(b)!==-1&amp;&amp;c.push("active"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&amp;&amp;c.push("disabled","disabled-date"),a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)!==-1&amp;&amp;c.push("highlighted"),this.range&amp;&amp;(b&gt;this.range[0]&amp;&amp;b&lt;this.range[this.range.length-1]&amp;&amp;c.push("range"),a.inArray(b.valueOf(),this.range)!==-1&amp;&amp;c.push("selected"),b.valueOf()===this.range[0]&amp;&amp;c.push("range-start"),b.valueOf()===this.range[this.range.length-1]&amp;&amp;c.push("range-end")),c},_fill_yearsView:function(c,d,e,f,g,h,i){for(var j,k,l,m="",n=e/10,o=this.picker.find(c),p=Math.floor(f/e)*e,q=p+9*n,r=Math.floor(this.viewDate.getFullYear()/n)*n,s=a.map(this.dates,function(a){return Math.floor(a.getUTCFullYear()/n)*n}),t=p-n;t&lt;=q+n;t+=n)j=[d],k=null,t===p-n?j.push("old"):t===q+n&amp;&amp;j.push("new"),a.inArray(t,s)!==-1&amp;&amp;j.push("active"),(t&lt;g||t&gt;h)&amp;&amp;j.push("disabled"),t===r&amp;&amp;j.push("focused"),i!==a.noop&amp;&amp;(l=i(new Date(t,0,1)),l===b?l={}:"boolean"==typeof l?l={enabled:l}:"string"==typeof l&amp;&amp;(l={classes:l}),l.enabled===!1&amp;&amp;j.push("disabled"),l.classes&amp;&amp;(j=j.concat(l.classes.split(/\s+/))),l.tooltip&amp;&amp;(k=l.tooltip)),m+='&lt;span class="'+j.join(" ")+'"'+(k?' title="'+k+'"':"")+"&gt;"+t+"&lt;/span&gt;";o.find(".datepicker-switch").text(p+"-"+q),o.find("td").html(m)},fill:function(){var d,e,f=new Date(this.viewDate),g=f.getUTCFullYear(),h=f.getUTCMonth(),i=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),j=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),k=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,m=q[this.o.language].today||q.en.today||"",n=q[this.o.language].clear||q.en.clear||"",o=q[this.o.language].titleFormat||q.en.titleFormat;if(!isNaN(g)&amp;&amp;!isNaN(h)){this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(f,o,this.o.language)),this.picker.find("tfoot .today").text(m).css("display",this.o.todayBtn===!0||"linked"===this.o.todayBtn?"table-cell":"none"),this.picker.find("tfoot .clear").text(n).css("display",this.o.clearBtn===!0?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&amp;&amp;""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var p=c(g,h,0),s=p.getUTCDate();p.setUTCDate(s-(p.getUTCDay()-this.o.weekStart+7)%7);var t=new Date(p);p.getUTCFullYear()&lt;100&amp;&amp;t.setUTCFullYear(p.getUTCFullYear()),t.setUTCDate(t.getUTCDate()+42),t=t.valueOf();for(var u,v,w=[];p.valueOf()&lt;t;){if(u=p.getUTCDay(),u===this.o.weekStart&amp;&amp;(w.push("&lt;tr&gt;"),this.o.calendarWeeks)){var x=new Date(+p+(this.o.weekStart-u-7)%7*864e5),y=new Date(Number(x)+(11-x.getUTCDay())%7*864e5),z=new Date(Number(z=c(y.getUTCFullYear(),0,1))+(11-z.getUTCDay())%7*864e5),A=(y-z)/864e5/7+1;w.push('&lt;td class="cw"&gt;'+A+"&lt;/td&gt;")}v=this.getClassNames(p),v.push("day");var B=p.getUTCDate();this.o.beforeShowDay!==a.noop&amp;&amp;(e=this.o.beforeShowDay(this._utc_to_local(p)),e===b?e={}:"boolean"==typeof e?e={enabled:e}:"string"==typeof e&amp;&amp;(e={classes:e}),e.enabled===!1&amp;&amp;v.push("disabled"),e.classes&amp;&amp;(v=v.concat(e.classes.split(/\s+/))),e.tooltip&amp;&amp;(d=e.tooltip),e.content&amp;&amp;(B=e.content)),v=a.isFunction(a.uniqueSort)?a.uniqueSort(v):a.unique(v),w.push('&lt;td class="'+v.join(" ")+'"'+(d?' title="'+d+'"':"")+' data-date="'+p.getTime().toString()+'"&gt;'+B+"&lt;/td&gt;"),d=null,u===this.o.weekEnd&amp;&amp;w.push("&lt;/tr&gt;"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(w.join(""));var C=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",D=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode&lt;2?C:g).end().find("tbody span").removeClass("active");if(a.each(this.dates,function(a,b){b.getUTCFullYear()===g&amp;&amp;D.eq(b.getUTCMonth()).addClass("active")}),(g&lt;i||g&gt;k)&amp;&amp;D.addClass("disabled"),g===i&amp;&amp;D.slice(0,j).addClass("disabled"),g===k&amp;&amp;D.slice(l+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var E=this;a.each(D,function(c,d){var e=new Date(g,c,1),f=E.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&amp;&amp;(f={classes:f}),f.enabled!==!1||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&amp;&amp;a(d).addClass(f.classes),f.tooltip&amp;&amp;a(d).prop("title",f.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,g,i,k,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,g,i,k,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,g,i,k,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a,b,c=new Date(this.viewDate),d=c.getUTCFullYear(),e=c.getUTCMonth(),f=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),g=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),h=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,i=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,j=1;switch(this.viewMode){case 4:j*=10;case 3:j*=10;case 2:j*=10;case 1:a=Math.floor(d/j)*j&lt;f,b=Math.floor(d/j)*j+j&gt;h;break;case 0:a=d&lt;=f&amp;&amp;e&lt;g,b=d&gt;=h&amp;&amp;e&gt;i}this.picker.find(".prev").toggleClass("disabled",a),this.picker.find(".next").toggleClass("disabled",b)}},click:function(b){b.preventDefault(),b.stopPropagation();var e,f,g,h;e=a(b.target),e.hasClass("datepicker-switch")&amp;&amp;this.viewMode!==this.o.maxViewMode&amp;&amp;this.setViewMode(this.viewMode+1),e.hasClass("today")&amp;&amp;!e.hasClass("day")&amp;&amp;(this.setViewMode(0),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&amp;&amp;this.clearDates(),e.hasClass("disabled")||(e.hasClass("month")||e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&amp;&amp;(this.viewDate.setUTCDate(1),f=1,1===this.viewMode?(h=e.parent().find("span").index(e),g=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(h)):(h=0,g=Number(e.text()),this.viewDate.setUTCFullYear(g)),this._trigger(r.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(c(g,h,f)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&amp;&amp;this._focused_from&amp;&amp;this._focused_from.focus(),delete this._focused_from},dayCellClick:function(b){var c=a(b.currentTarget),d=c.data("date"),e=new Date(d);this.o.updateViewDate&amp;&amp;(e.getUTCFullYear()!==this.viewDate.getUTCFullYear()&amp;&amp;this._trigger("changeYear",this.viewDate),e.getUTCMonth()!==this.viewDate.getUTCMonth()&amp;&amp;this._trigger("changeMonth",this.viewDate)),this._setDate(e)},navArrowsClick:function(b){var c=a(b.currentTarget),d=c.hasClass("prev")?-1:1;0!==this.viewMode&amp;&amp;(d*=12*r.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,d),this._trigger(r.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(a){var b=this.dates.contains(a);if(a||this.dates.clear(),b!==-1?(this.o.multidate===!0||this.o.multidate&gt;1||this.o.toggleActive)&amp;&amp;this.dates.remove(b):this.o.multidate===!1?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"number"==typeof this.o.multidate)for(;this.dates.length&gt;this.o.multidate;)this.dates.remove(0)},_setDate:function(a,b){b&amp;&amp;"date"!==b||this._toggle_multidate(a&amp;&amp;new Date(a)),(!b&amp;&amp;this.o.updateViewDate||"view"===b)&amp;&amp;(this.viewDate=a&amp;&amp;new Date(a)),this.fill(),this.setValue(),b&amp;&amp;"view"===b||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||b&amp;&amp;"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b&gt;0?1:-1,1===i)d=b===-1?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),c=(c+12)%12;else{for(var j=0;j&lt;i;j++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!==e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},moveYear:function(a,b){return this.moveMonth(a,12*b)},moveAvailableDate:function(a,b,c){do{if(a=this[c](a,b),!this.dateWithinRange(a))return!1;c="moveDay"}while(this.dateIsDisabled(a));return a},weekOfDateIsDisabled:function(b){return a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled)!==-1},dateIsDisabled:function(b){return this.weekOfDateIsDisabled(b)||a.grep(this.o.datesDisabled,function(a){return e(b,a)}).length&gt;0},dateWithinRange:function(a){return a&gt;=this.o.startDate&amp;&amp;a&lt;=this.o.endDate},keydown:function(a){if(!this.picker.is(":visible"))return void(40!==a.keyCode&amp;&amp;27!==a.keyCode||(this.show(),a.stopPropagation()));var b,c,d=!1,e=this.focusDate||this.viewDate;switch(a.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),a.preventDefault(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"),c&amp;&amp;this._trigger("changeYear",this.viewDate)):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"),c&amp;&amp;this._trigger("changeMonth",this.viewDate)):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?(38!==a.keyCode&amp;&amp;40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&amp;&amp;(38!==a.keyCode&amp;&amp;40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveYear")),c&amp;&amp;(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&amp;&amp;(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&amp;&amp;(a.preventDefault(),a.stopPropagation(),this.o.autoclose&amp;&amp;this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&amp;&amp;(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))},setViewMode:function(a){this.viewMode=a,this.picker.children("div").hide().filter(".datepicker-"+r.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var l=function(b,c){a.data(b,"datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,this.keepEmptyValues=c.keepEmptyValues,delete c.keepEmptyValues,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a.data(b,"datepicker")}),this.updateDates()};l.prototype={updateDates:function(){this.dates=a.map(this.pickers,function(a){return a.getUTCDate()}),this.updateRanges()},updateRanges:function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},clearDates:function(){a.each(this.pickers,function(a,b){b.clearDates()})},dateUpdated:function(c){if(!this.updating){this.updating=!0;var d=a.data(c.target,"datepicker");if(d!==b){var e=d.getUTCDate(),f=this.keepEmptyValues,g=a.inArray(c.target,this.inputs),h=g-1,i=g+1,j=this.inputs.length;if(g!==-1){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b!==d&amp;&amp;f||b.setUTCDate(e)}),e&lt;this.dates[h])for(;h&gt;=0&amp;&amp;e&lt;this.dates[h];)this.pickers[h--].setUTCDate(e);else if(e&gt;this.dates[i])for(;i&lt;j&amp;&amp;e&gt;this.dates[i];)this.pickers[i++].setUTCDate(e);this.updateDates(),delete this.updating}}}},destroy:function(){a.map(this.pickers,function(a){a.destroy()}),a(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments);d.shift();var e;if(this.each(function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&amp;&amp;c;if(!f){var j=h(this,"date"),m=a.extend({},o,j,g),n=i(m.language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&amp;&amp;"function"==typeof f[c]&amp;&amp;(e=f[c].apply(f,d))}),e===b||e instanceof k||e instanceof l)return this;if(this.length&gt;1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-(1/0),startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&amp;#x00AB;",rightArrow:"&amp;#x00BB;"},showWeekDays:!0},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},r={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&amp;&amp;"function"==typeof a.toDisplay)return a;var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,e,f,g){function h(a,b){return b===!0&amp;&amp;(b=10),a&lt;100&amp;&amp;(a+=2e3,a&gt;(new Date).getFullYear()+b&amp;&amp;(a-=100)),a}function i(){var a=this.slice(0,j[n].length),b=j[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!c)return b;if(c instanceof Date)return c;if("string"==typeof e&amp;&amp;(e=r.parseFormat(e)),e.toValue)return e.toValue(c,e,f);var j,l,m,n,o,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},s={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(c in s&amp;&amp;(c=s[c]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(c)){for(j=c.match(/([\-+]\d+)([dmwy])/gi),c=new Date,n=0;n&lt;j.length;n++)l=j[n].match(/([\-+]\d+)([dmwy])/i),m=Number(l[1]),o=p[l[2].toLowerCase()],c=k.prototype[o](c,m);return k.prototype._zero_utc_time(c)}j=c&amp;&amp;c.match(this.nonpunctuation)||[];var t,u,v={},w=["yyyy","yy","M","MM","m","mm","d","dd"],x={yyyy:function(a,b){return a.setUTCFullYear(g?h(b,g):b)},m:function(a,b){if(isNaN(a))return a;for(b-=1;b&lt;0;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!==b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};x.yy=x.yyyy,x.M=x.MM=x.mm=x.m,x.dd=x.d,c=d();var y=e.parts.slice();if(j.length!==y.length&amp;&amp;(y=a(y).filter(function(b,c){return a.inArray(c,w)!==-1}).toArray()),j.length===y.length){var z;for(n=0,z=y.length;n&lt;z;n++){if(t=parseInt(j[n],10),l=y[n],isNaN(t))switch(l){case"MM":u=a(q[f].months).filter(i),t=a.inArray(u[0],q[f].months)+1;break;case"M":u=a(q[f].monthsShort).filter(i),t=a.inArray(u[0],q[f].monthsShort)+1}v[l]=t}var A,B;for(n=0;n&lt;w.length;n++)B=w[n],B in v&amp;&amp;!isNaN(v[B])&amp;&amp;(A=new Date(c),x[B](A,v[B]),isNaN(A)||(c=A))}return c},formatDate:function(b,c,d){if(!b)return"";if("string"==typeof c&amp;&amp;(c=r.parseFormat(c)),c.toDisplay)return c.toDisplay(b,c,d);var e={d:b.getUTCDate(),D:q[d].daysShort[b.getUTCDay()],DD:q[d].days[b.getUTCDay()],m:b.getUTCMonth()+1,M:q[d].monthsShort[b.getUTCMonth()],MM:q[d].months[b.getUTCMonth()],yy:b.getUTCFullYear().toString().substring(2),yyyy:b.getUTCFullYear()};e.dd=(e.d&lt;10?"0":"")+e.d,e.mm=(e.m&lt;10?"0":"")+e.m,b=[];for(var f=a.extend([],c.separators),g=0,h=c.parts.length;g&lt;=h;g++)f.length&amp;&amp;b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},headTemplate:'&lt;thead&gt;&lt;tr&gt;&lt;th colspan="7" class="datepicker-title"&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th class="prev"&gt;'+o.templates.leftArrow+'&lt;/th&gt;&lt;th colspan="5" class="datepicker-switch"&gt;&lt;/th&gt;&lt;th class="next"&gt;'+o.templates.rightArrow+"&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;",
    contTemplate:'&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="7"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;',footTemplate:'&lt;tfoot&gt;&lt;tr&gt;&lt;th colspan="7" class="today"&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th colspan="7" class="clear"&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/tfoot&gt;'};r.template='&lt;div class="datepicker"&gt;&lt;div class="datepicker-days"&gt;&lt;table class="table-condensed"&gt;'+r.headTemplate+"&lt;tbody&gt;&lt;/tbody&gt;"+r.footTemplate+'&lt;/table&gt;&lt;/div&gt;&lt;div class="datepicker-months"&gt;&lt;table class="table-condensed"&gt;'+r.headTemplate+r.contTemplate+r.footTemplate+'&lt;/table&gt;&lt;/div&gt;&lt;div class="datepicker-years"&gt;&lt;table class="table-condensed"&gt;'+r.headTemplate+r.contTemplate+r.footTemplate+'&lt;/table&gt;&lt;/div&gt;&lt;div class="datepicker-decades"&gt;&lt;table class="table-condensed"&gt;'+r.headTemplate+r.contTemplate+r.footTemplate+'&lt;/table&gt;&lt;/div&gt;&lt;div class="datepicker-centuries"&gt;&lt;table class="table-condensed"&gt;'+r.headTemplate+r.contTemplate+r.footTemplate+"&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.8.0",a.fn.datepicker.deprecated=function(a){var b=window.console;b&amp;&amp;b.warn&amp;&amp;b.warn("DEPRECATED: "+a)},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),n.call(c,"show"))}),a(function(){n.call(a('[data-provide="datepicker-inline"]'))})});
// https://d3js.org v5.16.0 Copyright 2020 Mike Bostock
!(function(t, n) {
  typeof exports === "object" &amp;&amp; typeof module !== "undefined"
    ? n(exports)
    : typeof define === "function" &amp;&amp; define.amd
    ? define(["exports"], n)
    : n(((t = t || self).d3 = t.d3 || {}));
})(this, function(t) {
  "use strict";

  function n(t, n) {
    return t &lt; n ? -1 : t &gt; n ? 1 : t &gt;= n ? 0 : NaN;
  }
  function e(t) {
    var e;
    return (
      t.length === 1 &amp;&amp;
        ((e = t),
        (t = function(t, r) {
          return n(e(t), r);
        })),
      {
        left: function(n, e, r, i) {
          for (r == null &amp;&amp; (r = 0), i == null &amp;&amp; (i = n.length); r &lt; i; ) {
            var o = (r + i) &gt;&gt;&gt; 1;
            t(n[o], e) &lt; 0 ? (r = o + 1) : (i = o);
          }
          return r;
        },
        right: function(n, e, r, i) {
          for (r == null &amp;&amp; (r = 0), i == null &amp;&amp; (i = n.length); r &lt; i; ) {
            var o = (r + i) &gt;&gt;&gt; 1;
            t(n[o], e) &gt; 0 ? (i = o) : (r = o + 1);
          }
          return r;
        }
      }
    );
  }
  var r = e(n);
  var i = r.right;
  var o = r.left;
  function a(t, n) {
    return [t, n];
  }
  function u(t) {
    return t === null ? NaN : +t;
  }
  function c(t, n) {
    var e;
    var r;
    var i = t.length;
    var o = 0;
    var a = -1;
    var c = 0;
    var f = 0;
    if (n == null)
      for (; ++a &lt; i; )
        isNaN((e = u(t[a]))) || (f += (r = e - c) * (e - (c += r / ++o)));
    else
      for (; ++a &lt; i; )
        isNaN((e = u(n(t[a], a, t)))) ||
          (f += (r = e - c) * (e - (c += r / ++o)));
    if (o &gt; 1) return f / (o - 1);
  }
  function f(t, n) {
    var e = c(t, n);
    return e ? Math.sqrt(e) : e;
  }
  function s(t, n) {
    var e;
    var r;
    var i;
    var o = t.length;
    var a = -1;
    if (n == null) {
      for (; ++a &lt; o; )
        if ((e = t[a]) != null &amp;&amp; e &gt;= e)
          for (r = i = e; ++a &lt; o; )
            (e = t[a]) != null &amp;&amp; (r &gt; e &amp;&amp; (r = e), i &lt; e &amp;&amp; (i = e));
    } else for (; ++a &lt; o; ) if ((e = n(t[a], a, t)) != null &amp;&amp; e &gt;= e) for (r = i = e; ++a &lt; o; ) (e = n(t[a], a, t)) != null &amp;&amp; (r &gt; e &amp;&amp; (r = e), i &lt; e &amp;&amp; (i = e));
    return [r, i];
  }
  var l = Array.prototype;
  var h = l.slice;
  var d = l.map;
  function p(t) {
    return function() {
      return t;
    };
  }
  function v(t) {
    return t;
  }
  function g(t, n, e) {
    (t = +t),
      (n = +n),
      (e = (i = arguments.length) &lt; 2 ? ((n = t), (t = 0), 1) : i &lt; 3 ? 1 : +e);
    for (
      var r = -1, i = 0 | Math.max(0, Math.ceil((n - t) / e)), o = new Array(i);
      ++r &lt; i;

    )
      o[r] = t + r * e;
    return o;
  }
  var y = Math.sqrt(50);
  var _ = Math.sqrt(10);
  var b = Math.sqrt(2);
  function m(t, n, e) {
    var r;
    var i;
    var o;
    var a;
    var u = -1;
    if (((e = +e), (t = +t) === (n = +n) &amp;&amp; e &gt; 0)) return [t];
    if (
      ((r = n &lt; t) &amp;&amp; ((i = t), (t = n), (n = i)),
      (a = x(t, n, e)) === 0 || !isFinite(a))
    )
      return [];
    if (a &gt; 0)
      for (
        t = Math.ceil(t / a),
          n = Math.floor(n / a),
          o = new Array((i = Math.ceil(n - t + 1)));
        ++u &lt; i;

      )
        o[u] = (t + u) * a;
    else
      for (
        t = Math.floor(t * a),
          n = Math.ceil(n * a),
          o = new Array((i = Math.ceil(t - n + 1)));
        ++u &lt; i;

      )
        o[u] = (t - u) / a;
    return r &amp;&amp; o.reverse(), o;
  }
  function x(t, n, e) {
    var r = (n - t) / Math.max(0, e);
    var i = Math.floor(Math.log(r) / Math.LN10);
    var o = r / Math.pow(10, i);
    return i &gt;= 0
      ? (o &gt;= y ? 10 : o &gt;= _ ? 5 : o &gt;= b ? 2 : 1) * Math.pow(10, i)
      : -Math.pow(10, -i) / (o &gt;= y ? 10 : o &gt;= _ ? 5 : o &gt;= b ? 2 : 1);
  }
  function w(t, n, e) {
    var r = Math.abs(n - t) / Math.max(0, e);
    var i = Math.pow(10, Math.floor(Math.log(r) / Math.LN10));
    var o = r / i;
    return (
      o &gt;= y ? (i *= 10) : o &gt;= _ ? (i *= 5) : o &gt;= b &amp;&amp; (i *= 2),
      n &lt; t ? -i : i
    );
  }
  function M(t) {
    return Math.ceil(Math.log(t.length) / Math.LN2) + 1;
  }
  function N(t, n, e) {
    if ((e == null &amp;&amp; (e = u), (r = t.length))) {
      if ((n = +n) &lt;= 0 || r &lt; 2) return +e(t[0], 0, t);
      if (n &gt;= 1) return +e(t[r - 1], r - 1, t);
      var r;
      var i = (r - 1) * n;
      var o = Math.floor(i);
      var a = +e(t[o], o, t);
      return a + (+e(t[o + 1], o + 1, t) - a) * (i - o);
    }
  }
  function T(t, n) {
    var e;
    var r;
    var i = t.length;
    var o = -1;
    if (n == null) {
      for (; ++o &lt; i; )
        if ((e = t[o]) != null &amp;&amp; e &gt;= e)
          for (r = e; ++o &lt; i; ) (e = t[o]) != null &amp;&amp; e &gt; r &amp;&amp; (r = e);
    } else for (; ++o &lt; i; ) if ((e = n(t[o], o, t)) != null &amp;&amp; e &gt;= e) for (r = e; ++o &lt; i; ) (e = n(t[o], o, t)) != null &amp;&amp; e &gt; r &amp;&amp; (r = e);
    return r;
  }
  function A(t) {
    for (var n, e, r, i = t.length, o = -1, a = 0; ++o &lt; i; ) a += t[o].length;
    for (e = new Array(a); --i &gt;= 0; )
      for (n = (r = t[i]).length; --n &gt;= 0; ) e[--a] = r[n];
    return e;
  }
  function S(t, n) {
    var e;
    var r;
    var i = t.length;
    var o = -1;
    if (n == null) {
      for (; ++o &lt; i; )
        if ((e = t[o]) != null &amp;&amp; e &gt;= e)
          for (r = e; ++o &lt; i; ) (e = t[o]) != null &amp;&amp; r &gt; e &amp;&amp; (r = e);
    } else for (; ++o &lt; i; ) if ((e = n(t[o], o, t)) != null &amp;&amp; e &gt;= e) for (r = e; ++o &lt; i; ) (e = n(t[o], o, t)) != null &amp;&amp; r &gt; e &amp;&amp; (r = e);
    return r;
  }
  function k(t) {
    if (!(i = t.length)) return [];
    for (var n = -1, e = S(t, E), r = new Array(e); ++n &lt; e; )
      for (var i, o = -1, a = (r[n] = new Array(i)); ++o &lt; i; ) a[o] = t[o][n];
    return r;
  }
  function E(t) {
    return t.length;
  }
  var C = Array.prototype.slice;
  function P(t) {
    return t;
  }
  var z = 1;
  var R = 2;
  var D = 3;
  var q = 4;
  var L = 1e-6;
  function U(t) {
    return "translate(" + (t + 0.5) + ",0)";
  }
  function O(t) {
    return "translate(0," + (t + 0.5) + ")";
  }
  function B() {
    return !this.__axis;
  }
  function F(t, n) {
    var e = [];
    var r = null;
    var i = null;
    var o = 6;
    var a = 6;
    var u = 3;
    var c = t === z || t === q ? -1 : 1;
    var f = t === q || t === R ? "x" : "y";
    var s = t === z || t === D ? U : O;
    function l(l) {
      var h = r == null ? (n.ticks ? n.ticks.apply(n, e) : n.domain()) : r;
      var d = i == null ? (n.tickFormat ? n.tickFormat.apply(n, e) : P) : i;
      var p = Math.max(o, 0) + u;
      var v = n.range();
      var g = +v[0] + 0.5;
      var y = +v[v.length - 1] + 0.5;
      var _ = (n.bandwidth
        ? function(t) {
            var n = Math.max(0, t.bandwidth() - 1) / 2;
            return (
              t.round() &amp;&amp; (n = Math.round(n)),
              function(e) {
                return +t(e) + n;
              }
            );
          }
        : function(t) {
            return function(n) {
              return +t(n);
            };
          })(n.copy());
      var b = l.selection ? l.selection() : l;
      var m = b.selectAll(".domain").data([null]);
      var x = b
        .selectAll(".tick")
        .data(h, n)
        .order();
      var w = x.exit();
      var M = x
        .enter()
        .append("g")
        .attr("class", "tick");
      var N = x.select("line");
      var T = x.select("text");
      (m = m.merge(
        m
          .enter()
          .insert("path", ".tick")
          .attr("class", "domain")
          .attr("stroke", "currentColor")
      )),
        (x = x.merge(M)),
        (N = N.merge(
          M.append("line")
            .attr("stroke", "currentColor")
            .attr(f + "2", c * o)
        )),
        (T = T.merge(
          M.append("text")
            .attr("fill", "currentColor")
            .attr(f, c * p)
            .attr("dy", t === z ? "0em" : t === D ? "0.71em" : "0.32em")
        )),
        l !== b &amp;&amp;
          ((m = m.transition(l)),
          (x = x.transition(l)),
          (N = N.transition(l)),
          (T = T.transition(l)),
          (w = w
            .transition(l)
            .attr("opacity", L)
            .attr("transform", function(t) {
              return isFinite((t = _(t)))
                ? s(t)
                : this.getAttribute("transform");
            })),
          M.attr("opacity", L).attr("transform", function(t) {
            var n = this.parentNode.__axis;
            return s(n &amp;&amp; isFinite((n = n(t))) ? n : _(t));
          })),
        w.remove(),
        m.attr(
          "d",
          t === q || t == R
            ? a
              ? "M" + c * a + "," + g + "H0.5V" + y + "H" + c * a
              : "M0.5," + g + "V" + y
            : a
            ? "M" + g + "," + c * a + "V0.5H" + y + "V" + c * a
            : "M" + g + ",0.5H" + y
        ),
        x.attr("opacity", 1).attr("transform", function(t) {
          return s(_(t));
        }),
        N.attr(f + "2", c * o),
        T.attr(f, c * p).text(d),
        b
          .filter(B)
          .attr("fill", "none")
          .attr("font-size", 10)
          .attr("font-family", "sans-serif")
          .attr("text-anchor", t === R ? "start" : t === q ? "end" : "middle"),
        b.each(function() {
          this.__axis = _;
        });
    }
    return (
      (l.scale = function(t) {
        return arguments.length ? ((n = t), l) : n;
      }),
      (l.ticks = function() {
        return (e = C.call(arguments)), l;
      }),
      (l.tickArguments = function(t) {
        return arguments.length
          ? ((e = t == null ? [] : C.call(t)), l)
          : e.slice();
      }),
      (l.tickValues = function(t) {
        return arguments.length
          ? ((r = t == null ? null : C.call(t)), l)
          : r &amp;&amp; r.slice();
      }),
      (l.tickFormat = function(t) {
        return arguments.length ? ((i = t), l) : i;
      }),
      (l.tickSize = function(t) {
        return arguments.length ? ((o = a = +t), l) : o;
      }),
      (l.tickSizeInner = function(t) {
        return arguments.length ? ((o = +t), l) : o;
      }),
      (l.tickSizeOuter = function(t) {
        return arguments.length ? ((a = +t), l) : a;
      }),
      (l.tickPadding = function(t) {
        return arguments.length ? ((u = +t), l) : u;
      }),
      l
    );
  }
  var Y = { value: function() {} };
  function I() {
    for (var t, n = 0, e = arguments.length, r = {}; n &lt; e; ++n) {
      if (!(t = arguments[n] + "") || t in r || /[\s.]/.test(t))
        throw new Error("illegal type: " + t);
      r[t] = [];
    }
    return new H(r);
  }
  function H(t) {
    this._ = t;
  }
  function j(t, n) {
    return t
      .trim()
      .split(/^|\s+/)
      .map(function(t) {
        var e = "";
        var r = t.indexOf(".");
        if (
          (r &gt;= 0 &amp;&amp; ((e = t.slice(r + 1)), (t = t.slice(0, r))),
          t &amp;&amp; !n.hasOwnProperty(t))
        )
          throw new Error("unknown type: " + t);
        return { type: t, name: e };
      });
  }
  function X(t, n) {
    for (var e, r = 0, i = t.length; r &lt; i; ++r)
      if ((e = t[r]).name === n) return e.value;
  }
  function V(t, n, e) {
    for (var r = 0, i = t.length; r &lt; i; ++r)
      if (t[r].name === n) {
        (t[r] = Y), (t = t.slice(0, r).concat(t.slice(r + 1)));
        break;
      }
    return e != null &amp;&amp; t.push({ name: n, value: e }), t;
  }
  H.prototype = I.prototype = {
    constructor: H,
    on: function(t, n) {
      var e;
      var r = this._;
      var i = j(t + "", r);
      var o = -1;
      var a = i.length;
      if (!(arguments.length &lt; 2)) {
        if (n != null &amp;&amp; typeof n !== "function")
          throw new Error("invalid callback: " + n);
        for (; ++o &lt; a; )
          if ((e = (t = i[o]).type)) r[e] = V(r[e], t.name, n);
          else if (n == null) for (e in r) r[e] = V(r[e], t.name, null);
        return this;
      }
      for (; ++o &lt; a; )
        if ((e = (t = i[o]).type) &amp;&amp; (e = X(r[e], t.name))) return e;
    },
    copy: function() {
      var t = {};
      var n = this._;
      for (var e in n) t[e] = n[e].slice();
      return new H(t);
    },
    call: function(t, n) {
      if ((e = arguments.length - 2) &gt; 0)
        for (var e, r, i = new Array(e), o = 0; o &lt; e; ++o)
          i[o] = arguments[o + 2];
      if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
      for (o = 0, e = (r = this._[t]).length; o &lt; e; ++o)
        r[o].value.apply(n, i);
    },
    apply: function(t, n, e) {
      if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
      for (var r = this._[t], i = 0, o = r.length; i &lt; o; ++i)
        r[i].value.apply(n, e);
    }
  };
  var G = "http://www.w3.org/1999/xhtml";
  var $ = {
    svg: "http://www.w3.org/2000/svg",
    xhtml: G,
    xlink: "http://www.w3.org/1999/xlink",
    xml: "http://www.w3.org/XML/1998/namespace",
    xmlns: "http://www.w3.org/2000/xmlns/"
  };
  function W(t) {
    var n = (t += "");
    var e = n.indexOf(":");
    return (
      e &gt;= 0 &amp;&amp; (n = t.slice(0, e)) !== "xmlns" &amp;&amp; (t = t.slice(e + 1)),
      $.hasOwnProperty(n) ? { space: $[n], local: t } : t
    );
  }
  function Z(t) {
    var n = W(t);
    return (n.local
      ? function(t) {
          return function() {
            return this.ownerDocument.createElementNS(t.space, t.local);
          };
        }
      : function(t) {
          return function() {
            var n = this.ownerDocument;
            var e = this.namespaceURI;
            return e === G &amp;&amp; n.documentElement.namespaceURI === G
              ? n.createElement(t)
              : n.createElementNS(e, t);
          };
        })(n);
  }
  function Q() {}
  function K(t) {
    return t == null
      ? Q
      : function() {
          return this.querySelector(t);
        };
  }
  function J() {
    return [];
  }
  function tt(t) {
    return t == null
      ? J
      : function() {
          return this.querySelectorAll(t);
        };
  }
  function nt(t) {
    return function() {
      return this.matches(t);
    };
  }
  function et(t) {
    return new Array(t.length);
  }
  function rt(t, n) {
    (this.ownerDocument = t.ownerDocument),
      (this.namespaceURI = t.namespaceURI),
      (this._next = null),
      (this._parent = t),
      (this.__data__ = n);
  }
  rt.prototype = {
    constructor: rt,
    appendChild: function(t) {
      return this._parent.insertBefore(t, this._next);
    },
    insertBefore: function(t, n) {
      return this._parent.insertBefore(t, n);
    },
    querySelector: function(t) {
      return this._parent.querySelector(t);
    },
    querySelectorAll: function(t) {
      return this._parent.querySelectorAll(t);
    }
  };
  var it = "$";
  function ot(t, n, e, r, i, o) {
    for (var a, u = 0, c = n.length, f = o.length; u &lt; f; ++u)
      (a = n[u]) ? ((a.__data__ = o[u]), (r[u] = a)) : (e[u] = new rt(t, o[u]));
    for (; u &lt; c; ++u) (a = n[u]) &amp;&amp; (i[u] = a);
  }
  function at(t, n, e, r, i, o, a) {
    var u;
    var c;
    var f;
    var s = {};
    var l = n.length;
    var h = o.length;
    var d = new Array(l);
    for (u = 0; u &lt; l; ++u)
      (c = n[u]) &amp;&amp;
        ((d[u] = f = it + a.call(c, c.__data__, u, n)),
        f in s ? (i[u] = c) : (s[f] = c));
    for (u = 0; u &lt; h; ++u)
      (c = s[(f = it + a.call(t, o[u], u, o))])
        ? ((r[u] = c), (c.__data__ = o[u]), (s[f] = null))
        : (e[u] = new rt(t, o[u]));
    for (u = 0; u &lt; l; ++u) (c = n[u]) &amp;&amp; s[d[u]] === c &amp;&amp; (i[u] = c);
  }
  function ut(t, n) {
    return t &lt; n ? -1 : t &gt; n ? 1 : t &gt;= n ? 0 : NaN;
  }
  function ct(t) {
    return (
      (t.ownerDocument &amp;&amp; t.ownerDocument.defaultView) ||
      (t.document &amp;&amp; t) ||
      t.defaultView
    );
  }
  function ft(t, n) {
    return (
      t.style.getPropertyValue(n) ||
      ct(t)
        .getComputedStyle(t, null)
        .getPropertyValue(n)
    );
  }
  function st(t) {
    return t.trim().split(/^|\s+/);
  }
  function lt(t) {
    return t.classList || new ht(t);
  }
  function ht(t) {
    (this._node = t), (this._names = st(t.getAttribute("class") || ""));
  }
  function dt(t, n) {
    for (var e = lt(t), r = -1, i = n.length; ++r &lt; i; ) e.add(n[r]);
  }
  function pt(t, n) {
    for (var e = lt(t), r = -1, i = n.length; ++r &lt; i; ) e.remove(n[r]);
  }
  function vt() {
    this.textContent = "";
  }
  function gt() {
    this.innerHTML = "";
  }
  function yt() {
    this.nextSibling &amp;&amp; this.parentNode.appendChild(this);
  }
  function _t() {
    this.previousSibling &amp;&amp;
      this.parentNode.insertBefore(this, this.parentNode.firstChild);
  }
  function bt() {
    return null;
  }
  function mt() {
    var t = this.parentNode;
    t &amp;&amp; t.removeChild(this);
  }
  function xt() {
    var t = this.cloneNode(!1);
    var n = this.parentNode;
    return n ? n.insertBefore(t, this.nextSibling) : t;
  }
  function wt() {
    var t = this.cloneNode(!0);
    var n = this.parentNode;
    return n ? n.insertBefore(t, this.nextSibling) : t;
  }
  ht.prototype = {
    add: function(t) {
      this._names.indexOf(t) &lt; 0 &amp;&amp;
        (this._names.push(t),
        this._node.setAttribute("class", this._names.join(" ")));
    },
    remove: function(t) {
      var n = this._names.indexOf(t);
      n &gt;= 0 &amp;&amp;
        (this._names.splice(n, 1),
        this._node.setAttribute("class", this._names.join(" ")));
    },
    contains: function(t) {
      return this._names.indexOf(t) &gt;= 0;
    }
  };
  var Mt = {};
  ((t.event = null), typeof document !== "undefined") &amp;&amp;
    ("onmouseenter" in document.documentElement ||
      (Mt = { mouseenter: "mouseover", mouseleave: "mouseout" }));
  function Nt(t, n, e) {
    return (
      (t = Tt(t, n, e)),
      function(n) {
        var e = n.relatedTarget;
        (e &amp;&amp; (e === this || 8 &amp; e.compareDocumentPosition(this))) ||
          t.call(this, n);
      }
    );
  }
  function Tt(n, e, r) {
    return function(i) {
      var o = t.event;
      t.event = i;
      try {
        n.call(this, this.__data__, e, r);
      } finally {
        t.event = o;
      }
    };
  }
  function At(t) {
    return function() {
      var n = this.__on;
      if (n) {
        for (var e, r = 0, i = -1, o = n.length; r &lt; o; ++r)
          (e = n[r]),
            (t.type &amp;&amp; e.type !== t.type) || e.name !== t.name
              ? (n[++i] = e)
              : this.removeEventListener(e.type, e.listener, e.capture);
        ++i ? (n.length = i) : delete this.__on;
      }
    };
  }
  function St(t, n, e) {
    var r = Mt.hasOwnProperty(t.type) ? Nt : Tt;
    return function(i, o, a) {
      var u;
      var c = this.__on;
      var f = r(n, o, a);
      if (c)
        for (var s = 0, l = c.length; s &lt; l; ++s)
          if ((u = c[s]).type === t.type &amp;&amp; u.name === t.name)
            return (
              this.removeEventListener(u.type, u.listener, u.capture),
              this.addEventListener(u.type, (u.listener = f), (u.capture = e)),
              void (u.value = n)
            );
      this.addEventListener(t.type, f, e),
        (u = { type: t.type, name: t.name, value: n, listener: f, capture: e }),
        c ? c.push(u) : (this.__on = [u]);
    };
  }
  function kt(n, e, r, i) {
    var o = t.event;
    (n.sourceEvent = t.event), (t.event = n);
    try {
      return e.apply(r, i);
    } finally {
      t.event = o;
    }
  }
  function Et(t, n, e) {
    var r = ct(t);
    var i = r.CustomEvent;
    typeof i === "function"
      ? (i = new i(n, e))
      : ((i = r.document.createEvent("Event")),
        e
          ? (i.initEvent(n, e.bubbles, e.cancelable), (i.detail = e.detail))
          : i.initEvent(n, !1, !1)),
      t.dispatchEvent(i);
  }
  var Ct = [null];
  function Pt(t, n) {
    (this._groups = t), (this._parents = n);
  }
  function zt() {
    return new Pt([[document.documentElement]], Ct);
  }
  function Rt(t) {
    return typeof t === "string"
      ? new Pt([[document.querySelector(t)]], [document.documentElement])
      : new Pt([[t]], Ct);
  }
  Pt.prototype = zt.prototype = {
    constructor: Pt,
    select: function(t) {
      typeof t !== "function" &amp;&amp; (t = K(t));
      for (
        var n = this._groups, e = n.length, r = new Array(e), i = 0;
        i &lt; e;
        ++i
      )
        for (
          var o, a, u = n[i], c = u.length, f = (r[i] = new Array(c)), s = 0;
          s &lt; c;
          ++s
        )
          (o = u[s]) &amp;&amp;
            (a = t.call(o, o.__data__, s, u)) &amp;&amp;
            ("__data__" in o &amp;&amp; (a.__data__ = o.__data__), (f[s] = a));
      return new Pt(r, this._parents);
    },
    selectAll: function(t) {
      typeof t !== "function" &amp;&amp; (t = tt(t));
      for (
        var n = this._groups, e = n.length, r = [], i = [], o = 0;
        o &lt; e;
        ++o
      )
        for (var a, u = n[o], c = u.length, f = 0; f &lt; c; ++f)
          (a = u[f]) &amp;&amp; (r.push(t.call(a, a.__data__, f, u)), i.push(a));
      return new Pt(r, i);
    },
    filter: function(t) {
      typeof t !== "function" &amp;&amp; (t = nt(t));
      for (
        var n = this._groups, e = n.length, r = new Array(e), i = 0;
        i &lt; e;
        ++i
      )
        for (var o, a = n[i], u = a.length, c = (r[i] = []), f = 0; f &lt; u; ++f)
          (o = a[f]) &amp;&amp; t.call(o, o.__data__, f, a) &amp;&amp; c.push(o);
      return new Pt(r, this._parents);
    },
    data: function(t, n) {
      if (!t)
        return (
          (d = new Array(this.size())),
          (f = -1),
          this.each(function(t) {
            d[++f] = t;
          }),
          d
        );
      var e = n ? at : ot;
      var r = this._parents;
      var i = this._groups;
      typeof t !== "function" &amp;&amp;
        (t = (function(t) {
          return function() {
            return t;
          };
        })(t));
      for (
        var o = i.length,
          a = new Array(o),
          u = new Array(o),
          c = new Array(o),
          f = 0;
        f &lt; o;
        ++f
      ) {
        var s = r[f];
        var l = i[f];
        var h = l.length;
        var d = t.call(s, s &amp;&amp; s.__data__, f, r);
        var p = d.length;
        var v = (u[f] = new Array(p));
        var g = (a[f] = new Array(p));
        e(s, l, v, g, (c[f] = new Array(h)), d, n);
        for (var y, _, b = 0, m = 0; b &lt; p; ++b)
          if ((y = v[b])) {
            for (b &gt;= m &amp;&amp; (m = b + 1); !(_ = g[m]) &amp;&amp; ++m &lt; p; );
            y._next = _ || null;
          }
      }
      return ((a = new Pt(a, r))._enter = u), (a._exit = c), a;
    },
    enter: function() {
      return new Pt(this._enter || this._groups.map(et), this._parents);
    },
    exit: function() {
      return new Pt(this._exit || this._groups.map(et), this._parents);
    },
    join: function(t, n, e) {
      var r = this.enter();
      var i = this;
      var o = this.exit();
      return (
        (r = typeof t === "function" ? t(r) : r.append(t + "")),
        n != null &amp;&amp; (i = n(i)),
        e == null ? o.remove() : e(o),
        r &amp;&amp; i ? r.merge(i).order() : i
      );
    },
    merge: function(t) {
      for (
        var n = this._groups,
          e = t._groups,
          r = n.length,
          i = e.length,
          o = Math.min(r, i),
          a = new Array(r),
          u = 0;
        u &lt; o;
        ++u
      )
        for (
          var c,
            f = n[u],
            s = e[u],
            l = f.length,
            h = (a[u] = new Array(l)),
            d = 0;
          d &lt; l;
          ++d
        )
          (c = f[d] || s[d]) &amp;&amp; (h[d] = c);
      for (; u &lt; r; ++u) a[u] = n[u];
      return new Pt(a, this._parents);
    },
    order: function() {
      for (var t = this._groups, n = -1, e = t.length; ++n &lt; e; )
        for (var r, i = t[n], o = i.length - 1, a = i[o]; --o &gt;= 0; )
          (r = i[o]) &amp;&amp;
            (a &amp;&amp;
              4 ^ r.compareDocumentPosition(a) &amp;&amp;
              a.parentNode.insertBefore(r, a),
            (a = r));
      return this;
    },
    sort: function(t) {
      function n(n, e) {
        return n &amp;&amp; e ? t(n.__data__, e.__data__) : !n - !e;
      }
      t || (t = ut);
      for (
        var e = this._groups, r = e.length, i = new Array(r), o = 0;
        o &lt; r;
        ++o
      ) {
        for (
          var a, u = e[o], c = u.length, f = (i[o] = new Array(c)), s = 0;
          s &lt; c;
          ++s
        )
          (a = u[s]) &amp;&amp; (f[s] = a);
        f.sort(n);
      }
      return new Pt(i, this._parents).order();
    },
    call: function() {
      var t = arguments[0];
      return (arguments[0] = this), t.apply(null, arguments), this;
    },
    nodes: function() {
      var t = new Array(this.size());
      var n = -1;
      return (
        this.each(function() {
          t[++n] = this;
        }),
        t
      );
    },
    node: function() {
      for (var t = this._groups, n = 0, e = t.length; n &lt; e; ++n)
        for (var r = t[n], i = 0, o = r.length; i &lt; o; ++i) {
          var a = r[i];
          if (a) return a;
        }
      return null;
    },
    size: function() {
      var t = 0;
      return (
        this.each(function() {
          ++t;
        }),
        t
      );
    },
    empty: function() {
      return !this.node();
    },
    each: function(t) {
      for (var n = this._groups, e = 0, r = n.length; e &lt; r; ++e)
        for (var i, o = n[e], a = 0, u = o.length; a &lt; u; ++a)
          (i = o[a]) &amp;&amp; t.call(i, i.__data__, a, o);
      return this;
    },
    attr: function(t, n) {
      var e = W(t);
      if (arguments.length &lt; 2) {
        var r = this.node();
        return e.local ? r.getAttributeNS(e.space, e.local) : r.getAttribute(e);
      }
      return this.each(
        (n == null
          ? e.local
            ? function(t) {
                return function() {
                  this.removeAttributeNS(t.space, t.local);
                };
              }
            : function(t) {
                return function() {
                  this.removeAttribute(t);
                };
              }
          : typeof n === "function"
          ? e.local
            ? function(t, n) {
                return function() {
                  var e = n.apply(this, arguments);
                  e == null
                    ? this.removeAttributeNS(t.space, t.local)
                    : this.setAttributeNS(t.space, t.local, e);
                };
              }
            : function(t, n) {
                return function() {
                  var e = n.apply(this, arguments);
                  e == null ? this.removeAttribute(t) : this.setAttribute(t, e);
                };
              }
          : e.local
          ? function(t, n) {
              return function() {
                this.setAttributeNS(t.space, t.local, n);
              };
            }
          : function(t, n) {
              return function() {
                this.setAttribute(t, n);
              };
            })(e, n)
      );
    },
    style: function(t, n, e) {
      return arguments.length &gt; 1
        ? this.each(
            (n == null
              ? function(t) {
                  return function() {
                    this.style.removeProperty(t);
                  };
                }
              : typeof n === "function"
              ? function(t, n, e) {
                  return function() {
                    var r = n.apply(this, arguments);
                    r == null
                      ? this.style.removeProperty(t)
                      : this.style.setProperty(t, r, e);
                  };
                }
              : function(t, n, e) {
                  return function() {
                    this.style.setProperty(t, n, e);
                  };
                })(t, n, e == null ? "" : e)
          )
        : ft(this.node(), t);
    },
    property: function(t, n) {
      return arguments.length &gt; 1
        ? this.each(
            (n == null
              ? function(t) {
                  return function() {
                    delete this[t];
                  };
                }
              : typeof n === "function"
              ? function(t, n) {
                  return function() {
                    var e = n.apply(this, arguments);
                    e == null ? delete this[t] : (this[t] = e);
                  };
                }
              : function(t, n) {
                  return function() {
                    this[t] = n;
                  };
                })(t, n)
          )
        : this.node()[t];
    },
    classed: function(t, n) {
      var e = st(t + "");
      if (arguments.length &lt; 2) {
        for (var r = lt(this.node()), i = -1, o = e.length; ++i &lt; o; )
          if (!r.contains(e[i])) return !1;
        return !0;
      }
      return this.each(
        (typeof n === "function"
          ? function(t, n) {
              return function() {
                (n.apply(this, arguments) ? dt : pt)(this, t);
              };
            }
          : n
          ? function(t) {
              return function() {
                dt(this, t);
              };
            }
          : function(t) {
              return function() {
                pt(this, t);
              };
            })(e, n)
      );
    },
    text: function(t) {
      return arguments.length
        ? this.each(
            t == null
              ? vt
              : (typeof t === "function"
                  ? function(t) {
                      return function() {
                        var n = t.apply(this, arguments);
                        this.textContent = n == null ? "" : n;
                      };
                    }
                  : function(t) {
                      return function() {
                        this.textContent = t;
                      };
                    })(t)
          )
        : this.node().textContent;
    },
    html: function(t) {
      return arguments.length
        ? this.each(
            t == null
              ? gt
              : (typeof t === "function"
                  ? function(t) {
                      return function() {
                        var n = t.apply(this, arguments);
                        this.innerHTML = n == null ? "" : n;
                      };
                    }
                  : function(t) {
                      return function() {
                        this.innerHTML = t;
                      };
                    })(t)
          )
        : this.node().innerHTML;
    },
    raise: function() {
      return this.each(yt);
    },
    lower: function() {
      return this.each(_t);
    },
    append: function(t) {
      var n = typeof t === "function" ? t : Z(t);
      return this.select(function() {
        return this.appendChild(n.apply(this, arguments));
      });
    },
    insert: function(t, n) {
      var e = typeof t === "function" ? t : Z(t);
      var r = n == null ? bt : typeof n === "function" ? n : K(n);
      return this.select(function() {
        return this.insertBefore(
          e.apply(this, arguments),
          r.apply(this, arguments) || null
        );
      });
    },
    remove: function() {
      return this.each(mt);
    },
    clone: function(t) {
      return this.select(t ? wt : xt);
    },
    datum: function(t) {
      return arguments.length
        ? this.property("__data__", t)
        : this.node().__data__;
    },
    on: function(t, n, e) {
      var r;
      var i;
      var o = (function(t) {
        return t
          .trim()
          .split(/^|\s+/)
          .map(function(t) {
            var n = "";
            var e = t.indexOf(".");
            return (
              e &gt;= 0 &amp;&amp; ((n = t.slice(e + 1)), (t = t.slice(0, e))),
              { type: t, name: n }
            );
          });
      })(t + "");
      var a = o.length;
      if (!(arguments.length &lt; 2)) {
        for (u = n ? St : At, e == null &amp;&amp; (e = !1), r = 0; r &lt; a; ++r)
          this.each(u(o[r], n, e));
        return this;
      }
      var u = this.node().__on;
      if (u)
        for (var c, f = 0, s = u.length; f &lt; s; ++f)
          for (r = 0, c = u[f]; r &lt; a; ++r)
            if ((i = o[r]).type === c.type &amp;&amp; i.name === c.name) return c.value;
    },
    dispatch: function(t, n) {
      return this.each(
        (typeof n === "function"
          ? function(t, n) {
              return function() {
                return Et(this, t, n.apply(this, arguments));
              };
            }
          : function(t, n) {
              return function() {
                return Et(this, t, n);
              };
            })(t, n)
      );
    }
  };
  var Dt = 0;
  function qt() {
    return new Lt();
  }
  function Lt() {
    this._ = "@" + (++Dt).toString(36);
  }
  function Ut() {
    for (var n, e = t.event; (n = e.sourceEvent); ) e = n;
    return e;
  }
  function Ot(t, n) {
    var e = t.ownerSVGElement || t;
    if (e.createSVGPoint) {
      var r = e.createSVGPoint();
      return (
        (r.x = n.clientX),
        (r.y = n.clientY),
        [(r = r.matrixTransform(t.getScreenCTM().inverse())).x, r.y]
      );
    }
    var i = t.getBoundingClientRect();
    return [n.clientX - i.left - t.clientLeft, n.clientY - i.top - t.clientTop];
  }
  function Bt(t) {
    var n = Ut();
    return n.changedTouches &amp;&amp; (n = n.changedTouches[0]), Ot(t, n);
  }
  function Ft(t, n, e) {
    arguments.length &lt; 3 &amp;&amp; ((e = n), (n = Ut().changedTouches));
    for (var r, i = 0, o = n ? n.length : 0; i &lt; o; ++i)
      if ((r = n[i]).identifier === e) return Ot(t, r);
    return null;
  }
  function Yt() {
    t.event.stopImmediatePropagation();
  }
  function It() {
    t.event.preventDefault(), t.event.stopImmediatePropagation();
  }
  function Ht(t) {
    var n = t.document.documentElement;
    var e = Rt(t).on("dragstart.drag", It, !0);
    "onselectstart" in n
      ? e.on("selectstart.drag", It, !0)
      : ((n.__noselect = n.style.MozUserSelect),
        (n.style.MozUserSelect = "none"));
  }
  function jt(t, n) {
    var e = t.document.documentElement;
    var r = Rt(t).on("dragstart.drag", null);
    n &amp;&amp;
      (r.on("click.drag", It, !0),
      setTimeout(function() {
        r.on("click.drag", null);
      }, 0)),
      "onselectstart" in e
        ? r.on("selectstart.drag", null)
        : ((e.style.MozUserSelect = e.__noselect), delete e.__noselect);
  }
  function Xt(t) {
    return function() {
      return t;
    };
  }
  function Vt(t, n, e, r, i, o, a, u, c, f) {
    (this.target = t),
      (this.type = n),
      (this.subject = e),
      (this.identifier = r),
      (this.active = i),
      (this.x = o),
      (this.y = a),
      (this.dx = u),
      (this.dy = c),
      (this._ = f);
  }
  function Gt() {
    return !t.event.ctrlKey &amp;&amp; !t.event.button;
  }
  function $t() {
    return this.parentNode;
  }
  function Wt(n) {
    return n == null ? { x: t.event.x, y: t.event.y } : n;
  }
  function Zt() {
    return navigator.maxTouchPoints || "ontouchstart" in this;
  }
  function Qt(t, n, e) {
    (t.prototype = n.prototype = e), (e.constructor = t);
  }
  function Kt(t, n) {
    var e = Object.create(t.prototype);
    for (var r in n) e[r] = n[r];
    return e;
  }
  function Jt() {}
  (Lt.prototype = qt.prototype = {
    constructor: Lt,
    get: function(t) {
      for (var n = this._; !(n in t); ) if (!(t = t.parentNode)) return;
      return t[n];
    },
    set: function(t, n) {
      return (t[this._] = n);
    },
    remove: function(t) {
      return this._ in t &amp;&amp; delete t[this._];
    },
    toString: function() {
      return this._;
    }
  }),
    (Vt.prototype.on = function() {
      var t = this._.on.apply(this._, arguments);
      return t === this._ ? this : t;
    });
  var tn = "\\s*([+-]?\\d+)\\s*";
  var nn = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*";
  var en = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
  var rn = /^#([0-9a-f]{3,8})$/;
  var on = new RegExp("^rgb\\(" + [tn, tn, tn] + "\\)$");
  var an = new RegExp("^rgb\\(" + [en, en, en] + "\\)$");
  var un = new RegExp("^rgba\\(" + [tn, tn, tn, nn] + "\\)$");
  var cn = new RegExp("^rgba\\(" + [en, en, en, nn] + "\\)$");
  var fn = new RegExp("^hsl\\(" + [nn, en, en] + "\\)$");
  var sn = new RegExp("^hsla\\(" + [nn, en, en, nn] + "\\)$");
  var ln = {
    aliceblue: 15792383,
    antiquewhite: 16444375,
    aqua: 65535,
    aquamarine: 8388564,
    azure: 15794175,
    beige: 16119260,
    bisque: 16770244,
    black: 0,
    blanchedalmond: 16772045,
    blue: 255,
    blueviolet: 9055202,
    brown: 10824234,
    burlywood: 14596231,
    cadetblue: 6266528,
    chartreuse: 8388352,
    chocolate: 13789470,
    coral: 16744272,
    cornflowerblue: 6591981,
    cornsilk: 16775388,
    crimson: 14423100,
    cyan: 65535,
    darkblue: 139,
    darkcyan: 35723,
    darkgoldenrod: 12092939,
    darkgray: 11119017,
    darkgreen: 25600,
    darkgrey: 11119017,
    darkkhaki: 12433259,
    darkmagenta: 9109643,
    darkolivegreen: 5597999,
    darkorange: 16747520,
    darkorchid: 10040012,
    darkred: 9109504,
    darksalmon: 15308410,
    darkseagreen: 9419919,
    darkslateblue: 4734347,
    darkslategray: 3100495,
    darkslategrey: 3100495,
    darkturquoise: 52945,
    darkviolet: 9699539,
    deeppink: 16716947,
    deepskyblue: 49151,
    dimgray: 6908265,
    dimgrey: 6908265,
    dodgerblue: 2003199,
    firebrick: 11674146,
    floralwhite: 16775920,
    forestgreen: 2263842,
    fuchsia: 16711935,
    gainsboro: 14474460,
    ghostwhite: 16316671,
    gold: 16766720,
    goldenrod: 14329120,
    gray: 8421504,
    green: 32768,
    greenyellow: 11403055,
    grey: 8421504,
    honeydew: 15794160,
    hotpink: 16738740,
    indianred: 13458524,
    indigo: 4915330,
    ivory: 16777200,
    khaki: 15787660,
    lavender: 15132410,
    lavenderblush: 16773365,
    lawngreen: 8190976,
    lemonchiffon: 16775885,
    lightblue: 11393254,
    lightcoral: 15761536,
    lightcyan: 14745599,
    lightgoldenrodyellow: 16448210,
    lightgray: 13882323,
    lightgreen: 9498256,
    lightgrey: 13882323,
    lightpink: 16758465,
    lightsalmon: 16752762,
    lightseagreen: 2142890,
    lightskyblue: 8900346,
    lightslategray: 7833753,
    lightslategrey: 7833753,
    lightsteelblue: 11584734,
    lightyellow: 16777184,
    lime: 65280,
    limegreen: 3329330,
    linen: 16445670,
    magenta: 16711935,
    maroon: 8388608,
    mediumaquamarine: 6737322,
    mediumblue: 205,
    mediumorchid: 12211667,
    mediumpurple: 9662683,
    mediumseagreen: 3978097,
    mediumslateblue: 8087790,
    mediumspringgreen: 64154,
    mediumturquoise: 4772300,
    mediumvioletred: 13047173,
    midnightblue: 1644912,
    mintcream: 16121850,
    mistyrose: 16770273,
    moccasin: 16770229,
    navajowhite: 16768685,
    navy: 128,
    oldlace: 16643558,
    olive: 8421376,
    olivedrab: 7048739,
    orange: 16753920,
    orangered: 16729344,
    orchid: 14315734,
    palegoldenrod: 15657130,
    palegreen: 10025880,
    paleturquoise: 11529966,
    palevioletred: 14381203,
    papayawhip: 16773077,
    peachpuff: 16767673,
    peru: 13468991,
    pink: 16761035,
    plum: 14524637,
    powderblue: 11591910,
    purple: 8388736,
    rebeccapurple: 6697881,
    red: 16711680,
    rosybrown: 12357519,
    royalblue: 4286945,
    saddlebrown: 9127187,
    salmon: 16416882,
    sandybrown: 16032864,
    seagreen: 3050327,
    seashell: 16774638,
    sienna: 10506797,
    silver: 12632256,
    skyblue: 8900331,
    slateblue: 6970061,
    slategray: 7372944,
    slategrey: 7372944,
    snow: 16775930,
    springgreen: 65407,
    steelblue: 4620980,
    tan: 13808780,
    teal: 32896,
    thistle: 14204888,
    tomato: 16737095,
    turquoise: 4251856,
    violet: 15631086,
    wheat: 16113331,
    white: 16777215,
    whitesmoke: 16119285,
    yellow: 16776960,
    yellowgreen: 10145074
  };
  function hn() {
    return this.rgb().formatHex();
  }
  function dn() {
    return this.rgb().formatRgb();
  }
  function pn(t) {
    var n;
    var e;
    return (
      (t = (t + "").trim().toLowerCase()),
      (n = rn.exec(t))
        ? ((e = n[1].length),
          (n = parseInt(n[1], 16)),
          e === 6
            ? vn(n)
            : e === 3
            ? new bn(
                ((n &gt;&gt; 8) &amp; 15) | ((n &gt;&gt; 4) &amp; 240),
                ((n &gt;&gt; 4) &amp; 15) | (240 &amp; n),
                ((15 &amp; n) &lt;&lt; 4) | (15 &amp; n),
                1
              )
            : e === 8
            ? gn(
                (n &gt;&gt; 24) &amp; 255,
                (n &gt;&gt; 16) &amp; 255,
                (n &gt;&gt; 8) &amp; 255,
                (255 &amp; n) / 255
              )
            : e === 4
            ? gn(
                ((n &gt;&gt; 12) &amp; 15) | ((n &gt;&gt; 8) &amp; 240),
                ((n &gt;&gt; 8) &amp; 15) | ((n &gt;&gt; 4) &amp; 240),
                ((n &gt;&gt; 4) &amp; 15) | (240 &amp; n),
                (((15 &amp; n) &lt;&lt; 4) | (15 &amp; n)) / 255
              )
            : null)
        : (n = on.exec(t))
        ? new bn(n[1], n[2], n[3], 1)
        : (n = an.exec(t))
        ? new bn((255 * n[1]) / 100, (255 * n[2]) / 100, (255 * n[3]) / 100, 1)
        : (n = un.exec(t))
        ? gn(n[1], n[2], n[3], n[4])
        : (n = cn.exec(t))
        ? gn((255 * n[1]) / 100, (255 * n[2]) / 100, (255 * n[3]) / 100, n[4])
        : (n = fn.exec(t))
        ? Mn(n[1], n[2] / 100, n[3] / 100, 1)
        : (n = sn.exec(t))
        ? Mn(n[1], n[2] / 100, n[3] / 100, n[4])
        : ln.hasOwnProperty(t)
        ? vn(ln[t])
        : t === "transparent"
        ? new bn(NaN, NaN, NaN, 0)
        : null
    );
  }
  function vn(t) {
    return new bn((t &gt;&gt; 16) &amp; 255, (t &gt;&gt; 8) &amp; 255, 255 &amp; t, 1);
  }
  function gn(t, n, e, r) {
    return r &lt;= 0 &amp;&amp; (t = n = e = NaN), new bn(t, n, e, r);
  }
  function yn(t) {
    return (
      t instanceof Jt || (t = pn(t)),
      t ? new bn((t = t.rgb()).r, t.g, t.b, t.opacity) : new bn()
    );
  }
  function _n(t, n, e, r) {
    return arguments.length === 1 ? yn(t) : new bn(t, n, e, r == null ? 1 : r);
  }
  function bn(t, n, e, r) {
    (this.r = +t), (this.g = +n), (this.b = +e), (this.opacity = +r);
  }
  function mn() {
    return "#" + wn(this.r) + wn(this.g) + wn(this.b);
  }
  function xn() {
    var t = this.opacity;
    return (
      ((t = isNaN(t) ? 1 : Math.max(0, Math.min(1, t))) === 1
        ? "rgb("
        : "rgba(") +
      Math.max(0, Math.min(255, Math.round(this.r) || 0)) +
      ", " +
      Math.max(0, Math.min(255, Math.round(this.g) || 0)) +
      ", " +
      Math.max(0, Math.min(255, Math.round(this.b) || 0)) +
      (t === 1 ? ")" : ", " + t + ")")
    );
  }
  function wn(t) {
    return (
      ((t = Math.max(0, Math.min(255, Math.round(t) || 0))) &lt; 16 ? "0" : "") +
      t.toString(16)
    );
  }
  function Mn(t, n, e, r) {
    return (
      r &lt;= 0
        ? (t = n = e = NaN)
        : e &lt;= 0 || e &gt;= 1
        ? (t = n = NaN)
        : n &lt;= 0 &amp;&amp; (t = NaN),
      new An(t, n, e, r)
    );
  }
  function Nn(t) {
    if (t instanceof An) return new An(t.h, t.s, t.l, t.opacity);
    if ((t instanceof Jt || (t = pn(t)), !t)) return new An();
    if (t instanceof An) return t;
    var n = (t = t.rgb()).r / 255;
    var e = t.g / 255;
    var r = t.b / 255;
    var i = Math.min(n, e, r);
    var o = Math.max(n, e, r);
    var a = NaN;
    var u = o - i;
    var c = (o + i) / 2;
    return (
      u
        ? ((a =
            n === o
              ? (e - r) / u + 6 * (e &lt; r)
              : e === o
              ? (r - n) / u + 2
              : (n - e) / u + 4),
          (u /= c &lt; 0.5 ? o + i : 2 - o - i),
          (a *= 60))
        : (u = c &gt; 0 &amp;&amp; c &lt; 1 ? 0 : a),
      new An(a, u, c, t.opacity)
    );
  }
  function Tn(t, n, e, r) {
    return arguments.length === 1 ? Nn(t) : new An(t, n, e, r == null ? 1 : r);
  }
  function An(t, n, e, r) {
    (this.h = +t), (this.s = +n), (this.l = +e), (this.opacity = +r);
  }
  function Sn(t, n, e) {
    return (
      255 *
      (t &lt; 60
        ? n + ((e - n) * t) / 60
        : t &lt; 180
        ? e
        : t &lt; 240
        ? n + ((e - n) * (240 - t)) / 60
        : n)
    );
  }
  Qt(Jt, pn, {
    copy: function(t) {
      return Object.assign(new this.constructor(), this, t);
    },
    displayable: function() {
      return this.rgb().displayable();
    },
    hex: hn,
    formatHex: hn,
    formatHsl: function() {
      return Nn(this).formatHsl();
    },
    formatRgb: dn,
    toString: dn
  }),
    Qt(
      bn,
      _n,
      Kt(Jt, {
        brighter: function(t) {
          return (
            (t = t == null ? 1 / 0.7 : Math.pow(1 / 0.7, t)),
            new bn(this.r * t, this.g * t, this.b * t, this.opacity)
          );
        },
        darker: function(t) {
          return (
            (t = t == null ? 0.7 : Math.pow(0.7, t)),
            new bn(this.r * t, this.g * t, this.b * t, this.opacity)
          );
        },
        rgb: function() {
          return this;
        },
        displayable: function() {
          return (
            this.r &gt;= -0.5 &amp;&amp;
            this.r &lt; 255.5 &amp;&amp;
            this.g &gt;= -0.5 &amp;&amp;
            this.g &lt; 255.5 &amp;&amp;
            this.b &gt;= -0.5 &amp;&amp;
            this.b &lt; 255.5 &amp;&amp;
            this.opacity &gt;= 0 &amp;&amp;
            this.opacity &lt;= 1
          );
        },
        hex: mn,
        formatHex: mn,
        formatRgb: xn,
        toString: xn
      })
    ),
    Qt(
      An,
      Tn,
      Kt(Jt, {
        brighter: function(t) {
          return (
            (t = t == null ? 1 / 0.7 : Math.pow(1 / 0.7, t)),
            new An(this.h, this.s, this.l * t, this.opacity)
          );
        },
        darker: function(t) {
          return (
            (t = t == null ? 0.7 : Math.pow(0.7, t)),
            new An(this.h, this.s, this.l * t, this.opacity)
          );
        },
        rgb: function() {
          var t = (this.h % 360) + 360 * (this.h &lt; 0);
          var n = isNaN(t) || isNaN(this.s) ? 0 : this.s;
          var e = this.l;
          var r = e + (e &lt; 0.5 ? e : 1 - e) * n;
          var i = 2 * e - r;
          return new bn(
            Sn(t &gt;= 240 ? t - 240 : t + 120, i, r),
            Sn(t, i, r),
            Sn(t &lt; 120 ? t + 240 : t - 120, i, r),
            this.opacity
          );
        },
        displayable: function() {
          return (
            ((this.s &gt;= 0 &amp;&amp; this.s &lt;= 1) || isNaN(this.s)) &amp;&amp;
            this.l &gt;= 0 &amp;&amp;
            this.l &lt;= 1 &amp;&amp;
            this.opacity &gt;= 0 &amp;&amp;
            this.opacity &lt;= 1
          );
        },
        formatHsl: function() {
          var t = this.opacity;
          return (
            ((t = isNaN(t) ? 1 : Math.max(0, Math.min(1, t))) === 1
              ? "hsl("
              : "hsla(") +
            (this.h || 0) +
            ", " +
            100 * (this.s || 0) +
            "%, " +
            100 * (this.l || 0) +
            "%" +
            (t === 1 ? ")" : ", " + t + ")")
          );
        }
      })
    );
  var kn = Math.PI / 180;
  var En = 180 / Math.PI;
  var Cn = 0.96422;
  var Pn = 1;
  var zn = 0.82521;
  var Rn = 4 / 29;
  var Dn = 6 / 29;
  var qn = 3 * Dn * Dn;
  var Ln = Dn * Dn * Dn;
  function Un(t) {
    if (t instanceof Bn) return new Bn(t.l, t.a, t.b, t.opacity);
    if (t instanceof Vn) return Gn(t);
    t instanceof bn || (t = yn(t));
    var n;
    var e;
    var r = Hn(t.r);
    var i = Hn(t.g);
    var o = Hn(t.b);
    var a = Fn((0.2225045 * r + 0.7168786 * i + 0.0606169 * o) / Pn);
    return (
      r === i &amp;&amp; i === o
        ? (n = e = a)
        : ((n = Fn((0.4360747 * r + 0.3850649 * i + 0.1430804 * o) / Cn)),
          (e = Fn((0.0139322 * r + 0.0971045 * i + 0.7141733 * o) / zn))),
      new Bn(116 * a - 16, 500 * (n - a), 200 * (a - e), t.opacity)
    );
  }
  function On(t, n, e, r) {
    return arguments.length === 1 ? Un(t) : new Bn(t, n, e, r == null ? 1 : r);
  }
  function Bn(t, n, e, r) {
    (this.l = +t), (this.a = +n), (this.b = +e), (this.opacity = +r);
  }
  function Fn(t) {
    return t &gt; Ln ? Math.pow(t, 1 / 3) : t / qn + Rn;
  }
  function Yn(t) {
    return t &gt; Dn ? t * t * t : qn * (t - Rn);
  }
  function In(t) {
    return (
      255 * (t &lt;= 0.0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055)
    );
  }
  function Hn(t) {
    return (t /= 255) &lt;= 0.04045
      ? t / 12.92
      : Math.pow((t + 0.055) / 1.055, 2.4);
  }
  function jn(t) {
    if (t instanceof Vn) return new Vn(t.h, t.c, t.l, t.opacity);
    if ((t instanceof Bn || (t = Un(t)), t.a === 0 &amp;&amp; t.b === 0))
      return new Vn(NaN, t.l &gt; 0 &amp;&amp; t.l &lt; 100 ? 0 : NaN, t.l, t.opacity);
    var n = Math.atan2(t.b, t.a) * En;
    return new Vn(
      n &lt; 0 ? n + 360 : n,
      Math.sqrt(t.a * t.a + t.b * t.b),
      t.l,
      t.opacity
    );
  }
  function Xn(t, n, e, r) {
    return arguments.length === 1 ? jn(t) : new Vn(t, n, e, r == null ? 1 : r);
  }
  function Vn(t, n, e, r) {
    (this.h = +t), (this.c = +n), (this.l = +e), (this.opacity = +r);
  }
  function Gn(t) {
    if (isNaN(t.h)) return new Bn(t.l, 0, 0, t.opacity);
    var n = t.h * kn;
    return new Bn(t.l, Math.cos(n) * t.c, Math.sin(n) * t.c, t.opacity);
  }
  Qt(
    Bn,
    On,
    Kt(Jt, {
      brighter: function(t) {
        return new Bn(
          this.l + 18 * (t == null ? 1 : t),
          this.a,
          this.b,
          this.opacity
        );
      },
      darker: function(t) {
        return new Bn(
          this.l - 18 * (t == null ? 1 : t),
          this.a,
          this.b,
          this.opacity
        );
      },
      rgb: function() {
        var t = (this.l + 16) / 116;
        var n = isNaN(this.a) ? t : t + this.a / 500;
        var e = isNaN(this.b) ? t : t - this.b / 200;
        return new bn(
          In(
            3.1338561 * (n = Cn * Yn(n)) -
              1.6168667 * (t = Pn * Yn(t)) -
              0.4906146 * (e = zn * Yn(e))
          ),
          In(-0.9787684 * n + 1.9161415 * t + 0.033454 * e),
          In(0.0719453 * n - 0.2289914 * t + 1.4052427 * e),
          this.opacity
        );
      }
    })
  ),
    Qt(
      Vn,
      Xn,
      Kt(Jt, {
        brighter: function(t) {
          return new Vn(
            this.h,
            this.c,
            this.l + 18 * (t == null ? 1 : t),
            this.opacity
          );
        },
        darker: function(t) {
          return new Vn(
            this.h,
            this.c,
            this.l - 18 * (t == null ? 1 : t),
            this.opacity
          );
        },
        rgb: function() {
          return Gn(this).rgb();
        }
      })
    );
  var $n = -0.14861;
  var Wn = 1.78277;
  var Zn = -0.29227;
  var Qn = -0.90649;
  var Kn = 1.97294;
  var Jn = Kn * Qn;
  var te = Kn * Wn;
  var ne = Wn * Zn - Qn * $n;
  function ee(t, n, e, r) {
    return arguments.length === 1
      ? (function(t) {
          if (t instanceof re) return new re(t.h, t.s, t.l, t.opacity);
          t instanceof bn || (t = yn(t));
          var n = t.r / 255;
          var e = t.g / 255;
          var r = t.b / 255;
          var i = (ne * r + Jn * n - te * e) / (ne + Jn - te);
          var o = r - i;
          var a = (Kn * (e - i) - Zn * o) / Qn;
          var u = Math.sqrt(a * a + o * o) / (Kn * i * (1 - i));
          var c = u ? Math.atan2(a, o) * En - 120 : NaN;
          return new re(c &lt; 0 ? c + 360 : c, u, i, t.opacity);
        })(t)
      : new re(t, n, e, r == null ? 1 : r);
  }
  function re(t, n, e, r) {
    (this.h = +t), (this.s = +n), (this.l = +e), (this.opacity = +r);
  }
  function ie(t, n, e, r, i) {
    var o = t * t;
    var a = o * t;
    return (
      ((1 - 3 * t + 3 * o - a) * n +
        (4 - 6 * o + 3 * a) * e +
        (1 + 3 * t + 3 * o - 3 * a) * r +
        a * i) /
      6
    );
  }
  function oe(t) {
    var n = t.length - 1;
    return function(e) {
      var r = e &lt;= 0 ? (e = 0) : e &gt;= 1 ? ((e = 1), n - 1) : Math.floor(e * n);
      var i = t[r];
      var o = t[r + 1];
      var a = r &gt; 0 ? t[r - 1] : 2 * i - o;
      var u = r &lt; n - 1 ? t[r + 2] : 2 * o - i;
      return ie((e - r / n) * n, a, i, o, u);
    };
  }
  function ae(t) {
    var n = t.length;
    return function(e) {
      var r = Math.floor(((e %= 1) &lt; 0 ? ++e : e) * n);
      var i = t[(r + n - 1) % n];
      var o = t[r % n];
      var a = t[(r + 1) % n];
      var u = t[(r + 2) % n];
      return ie((e - r / n) * n, i, o, a, u);
    };
  }
  function ue(t) {
    return function() {
      return t;
    };
  }
  function ce(t, n) {
    return function(e) {
      return t + e * n;
    };
  }
  function fe(t, n) {
    var e = n - t;
    return e
      ? ce(t, e &gt; 180 || e &lt; -180 ? e - 360 * Math.round(e / 360) : e)
      : ue(isNaN(t) ? n : t);
  }
  function se(t) {
    return (t = +t) == 1
      ? le
      : function(n, e) {
          return e - n
            ? (function(t, n, e) {
                return (
                  (t = Math.pow(t, e)),
                  (n = Math.pow(n, e) - t),
                  (e = 1 / e),
                  function(r) {
                    return Math.pow(t + r * n, e);
                  }
                );
              })(n, e, t)
            : ue(isNaN(n) ? e : n);
        };
  }
  function le(t, n) {
    var e = n - t;
    return e ? ce(t, e) : ue(isNaN(t) ? n : t);
  }
  Qt(
    re,
    ee,
    Kt(Jt, {
      brighter: function(t) {
        return (
          (t = t == null ? 1 / 0.7 : Math.pow(1 / 0.7, t)),
          new re(this.h, this.s, this.l * t, this.opacity)
        );
      },
      darker: function(t) {
        return (
          (t = t == null ? 0.7 : Math.pow(0.7, t)),
          new re(this.h, this.s, this.l * t, this.opacity)
        );
      },
      rgb: function() {
        var t = isNaN(this.h) ? 0 : (this.h + 120) * kn;
        var n = +this.l;
        var e = isNaN(this.s) ? 0 : this.s * n * (1 - n);
        var r = Math.cos(t);
        var i = Math.sin(t);
        return new bn(
          255 * (n + e * ($n * r + Wn * i)),
          255 * (n + e * (Zn * r + Qn * i)),
          255 * (n + e * (Kn * r)),
          this.opacity
        );
      }
    })
  );
  var he = (function t(n) {
    var e = se(n);
    function r(t, n) {
      var r = e((t = _n(t)).r, (n = _n(n)).r);
      var i = e(t.g, n.g);
      var o = e(t.b, n.b);
      var a = le(t.opacity, n.opacity);
      return function(n) {
        return (
          (t.r = r(n)), (t.g = i(n)), (t.b = o(n)), (t.opacity = a(n)), t + ""
        );
      };
    }
    return (r.gamma = t), r;
  })(1);
  function de(t) {
    return function(n) {
      var e;
      var r;
      var i = n.length;
      var o = new Array(i);
      var a = new Array(i);
      var u = new Array(i);
      for (e = 0; e &lt; i; ++e)
        (r = _n(n[e])), (o[e] = r.r || 0), (a[e] = r.g || 0), (u[e] = r.b || 0);
      return (
        (o = t(o)),
        (a = t(a)),
        (u = t(u)),
        (r.opacity = 1),
        function(t) {
          return (r.r = o(t)), (r.g = a(t)), (r.b = u(t)), r + "";
        }
      );
    };
  }
  var pe = de(oe);
  var ve = de(ae);
  function ge(t, n) {
    n || (n = []);
    var e;
    var r = t ? Math.min(n.length, t.length) : 0;
    var i = n.slice();
    return function(o) {
      for (e = 0; e &lt; r; ++e) i[e] = t[e] * (1 - o) + n[e] * o;
      return i;
    };
  }
  function ye(t) {
    return ArrayBuffer.isView(t) &amp;&amp; !(t instanceof DataView);
  }
  function _e(t, n) {
    var e;
    var r = n ? n.length : 0;
    var i = t ? Math.min(r, t.length) : 0;
    var o = new Array(i);
    var a = new Array(r);
    for (e = 0; e &lt; i; ++e) o[e] = Te(t[e], n[e]);
    for (; e &lt; r; ++e) a[e] = n[e];
    return function(t) {
      for (e = 0; e &lt; i; ++e) a[e] = o[e](t);
      return a;
    };
  }
  function be(t, n) {
    var e = new Date();
    return (
      (t = +t),
      (n = +n),
      function(r) {
        return e.setTime(t * (1 - r) + n * r), e;
      }
    );
  }
  function me(t, n) {
    return (
      (t = +t),
      (n = +n),
      function(e) {
        return t * (1 - e) + n * e;
      }
    );
  }
  function xe(t, n) {
    var e;
    var r = {};
    var i = {};
    for (e in ((t !== null &amp;&amp; typeof t === "object") || (t = {}),
    (n !== null &amp;&amp; typeof n === "object") || (n = {}),
    n))
      e in t ? (r[e] = Te(t[e], n[e])) : (i[e] = n[e]);
    return function(t) {
      for (e in r) i[e] = r[e](t);
      return i;
    };
  }
  var we = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
  var Me = new RegExp(we.source, "g");
  function Ne(t, n) {
    var e;
    var r;
    var i;
    var o = (we.lastIndex = Me.lastIndex = 0);
    var a = -1;
    var u = [];
    var c = [];
    for (t += "", n += ""; (e = we.exec(t)) &amp;&amp; (r = Me.exec(n)); )
      (i = r.index) &gt; o &amp;&amp;
        ((i = n.slice(o, i)), u[a] ? (u[a] += i) : (u[++a] = i)),
        (e = e[0]) === (r = r[0])
          ? u[a]
            ? (u[a] += r)
            : (u[++a] = r)
          : ((u[++a] = null), c.push({ i: a, x: me(e, r) })),
        (o = Me.lastIndex);
    return (
      o &lt; n.length &amp;&amp; ((i = n.slice(o)), u[a] ? (u[a] += i) : (u[++a] = i)),
      u.length &lt; 2
        ? c[0]
          ? (function(t) {
              return function(n) {
                return t(n) + "";
              };
            })(c[0].x)
          : (function(t) {
              return function() {
                return t;
              };
            })(n)
        : ((n = c.length),
          function(t) {
            for (var e, r = 0; r &lt; n; ++r) u[(e = c[r]).i] = e.x(t);
            return u.join("");
          })
    );
  }
  function Te(t, n) {
    var e;
    var r = typeof n;
    return n == null || r === "boolean"
      ? ue(n)
      : (r === "number"
          ? me
          : r === "string"
          ? (e = pn(n))
            ? ((n = e), he)
            : Ne
          : n instanceof pn
          ? he
          : n instanceof Date
          ? be
          : ye(n)
          ? ge
          : Array.isArray(n)
          ? _e
          : (typeof n.valueOf !== "function" &amp;&amp;
              typeof n.toString !== "function") ||
            isNaN(n)
          ? xe
          : me)(t, n);
  }
  function Ae(t, n) {
    return (
      (t = +t),
      (n = +n),
      function(e) {
        return Math.round(t * (1 - e) + n * e);
      }
    );
  }
  var Se;
  var ke;
  var Ee;
  var Ce;
  var Pe = 180 / Math.PI;
  var ze = {
    translateX: 0,
    translateY: 0,
    rotate: 0,
    skewX: 0,
    scaleX: 1,
    scaleY: 1
  };
  function Re(t, n, e, r, i, o) {
    var a;
    var u;
    var c;
    return (
      (a = Math.sqrt(t * t + n * n)) &amp;&amp; ((t /= a), (n /= a)),
      (c = t * e + n * r) &amp;&amp; ((e -= t * c), (r -= n * c)),
      (u = Math.sqrt(e * e + r * r)) &amp;&amp; ((e /= u), (r /= u), (c /= u)),
      t * r &lt; n * e &amp;&amp; ((t = -t), (n = -n), (c = -c), (a = -a)),
      {
        translateX: i,
        translateY: o,
        rotate: Math.atan2(n, t) * Pe,
        skewX: Math.atan(c) * Pe,
        scaleX: a,
        scaleY: u
      }
    );
  }
  function De(t, n, e, r) {
    function i(t) {
      return t.length ? t.pop() + " " : "";
    }
    return function(o, a) {
      var u = [];
      var c = [];
      return (
        (o = t(o)),
        (a = t(a)),
        (function(t, r, i, o, a, u) {
          if (t !== i || r !== o) {
            var c = a.push("translate(", null, n, null, e);
            u.push({ i: c - 4, x: me(t, i) }, { i: c - 2, x: me(r, o) });
          } else (i || o) &amp;&amp; a.push("translate(" + i + n + o + e);
        })(o.translateX, o.translateY, a.translateX, a.translateY, u, c),
        (function(t, n, e, o) {
          t !== n
            ? (t - n &gt; 180 ? (n += 360) : n - t &gt; 180 &amp;&amp; (t += 360),
              o.push({ i: e.push(i(e) + "rotate(", null, r) - 2, x: me(t, n) }))
            : n &amp;&amp; e.push(i(e) + "rotate(" + n + r);
        })(o.rotate, a.rotate, u, c),
        (function(t, n, e, o) {
          t !== n
            ? o.push({ i: e.push(i(e) + "skewX(", null, r) - 2, x: me(t, n) })
            : n &amp;&amp; e.push(i(e) + "skewX(" + n + r);
        })(o.skewX, a.skewX, u, c),
        (function(t, n, e, r, o, a) {
          if (t !== e || n !== r) {
            var u = o.push(i(o) + "scale(", null, ",", null, ")");
            a.push({ i: u - 4, x: me(t, e) }, { i: u - 2, x: me(n, r) });
          } else
            (e === 1 &amp;&amp; r === 1) || o.push(i(o) + "scale(" + e + "," + r + ")");
        })(o.scaleX, o.scaleY, a.scaleX, a.scaleY, u, c),
        (o = a = null),
        function(t) {
          for (var n, e = -1, r = c.length; ++e &lt; r; ) u[(n = c[e]).i] = n.x(t);
          return u.join("");
        }
      );
    };
  }
  var qe = De(
    function(t) {
      return t === "none"
        ? ze
        : (Se ||
            ((Se = document.createElement("DIV")),
            (ke = document.documentElement),
            (Ee = document.defaultView)),
          (Se.style.transform = t),
          (t = Ee.getComputedStyle(ke.appendChild(Se), null).getPropertyValue(
            "transform"
          )),
          ke.removeChild(Se),
          Re(
            +(t = t.slice(7, -1).split(","))[0],
            +t[1],
            +t[2],
            +t[3],
            +t[4],
            +t[5]
          ));
    },
    "px, ",
    "px)",
    "deg)"
  );
  var Le = De(
    function(t) {
      return t == null
        ? ze
        : (Ce ||
            (Ce = document.createElementNS("http://www.w3.org/2000/svg", "g")),
          Ce.setAttribute("transform", t),
          (t = Ce.transform.baseVal.consolidate())
            ? Re((t = t.matrix).a, t.b, t.c, t.d, t.e, t.f)
            : ze);
    },
    ", ",
    ")",
    ")"
  );
  var Ue = Math.SQRT2;
  var Oe = 2;
  var Be = 4;
  var Fe = 1e-12;
  function Ye(t) {
    return ((t = Math.exp(t)) + 1 / t) / 2;
  }
  function Ie(t, n) {
    var e;
    var r;
    var i = t[0];
    var o = t[1];
    var a = t[2];
    var u = n[0];
    var c = n[1];
    var f = n[2];
    var s = u - i;
    var l = c - o;
    var h = s * s + l * l;
    if (h &lt; Fe)
      (r = Math.log(f / a) / Ue),
        (e = function(t) {
          return [i + t * s, o + t * l, a * Math.exp(Ue * t * r)];
        });
    else {
      var d = Math.sqrt(h);
      var p = (f * f - a * a + Be * h) / (2 * a * Oe * d);
      var v = (f * f - a * a - Be * h) / (2 * f * Oe * d);
      var g = Math.log(Math.sqrt(p * p + 1) - p);
      var y = Math.log(Math.sqrt(v * v + 1) - v);
      (r = (y - g) / Ue),
        (e = function(t) {
          var n = t * r;
          var e = Ye(g);
          var u =
            (a / (Oe * d)) *
            (e *
              (function(t) {
                return ((t = Math.exp(2 * t)) - 1) / (t + 1);
              })(Ue * n + g) -
              (function(t) {
                return ((t = Math.exp(t)) - 1 / t) / 2;
              })(g));
          return [i + u * s, o + u * l, (a * e) / Ye(Ue * n + g)];
        });
    }
    return (e.duration = 1e3 * r), e;
  }
  function He(t) {
    return function(n, e) {
      var r = t((n = Tn(n)).h, (e = Tn(e)).h);
      var i = le(n.s, e.s);
      var o = le(n.l, e.l);
      var a = le(n.opacity, e.opacity);
      return function(t) {
        return (
          (n.h = r(t)), (n.s = i(t)), (n.l = o(t)), (n.opacity = a(t)), n + ""
        );
      };
    };
  }
  var je = He(fe);
  var Xe = He(le);
  function Ve(t) {
    return function(n, e) {
      var r = t((n = Xn(n)).h, (e = Xn(e)).h);
      var i = le(n.c, e.c);
      var o = le(n.l, e.l);
      var a = le(n.opacity, e.opacity);
      return function(t) {
        return (
          (n.h = r(t)), (n.c = i(t)), (n.l = o(t)), (n.opacity = a(t)), n + ""
        );
      };
    };
  }
  var Ge = Ve(fe);
  var $e = Ve(le);
  function We(t) {
    return (function n(e) {
      function r(n, r) {
        var i = t((n = ee(n)).h, (r = ee(r)).h);
        var o = le(n.s, r.s);
        var a = le(n.l, r.l);
        var u = le(n.opacity, r.opacity);
        return function(t) {
          return (
            (n.h = i(t)),
            (n.s = o(t)),
            (n.l = a(Math.pow(t, e))),
            (n.opacity = u(t)),
            n + ""
          );
        };
      }
      return (e = +e), (r.gamma = n), r;
    })(1);
  }
  var Ze = We(fe);
  var Qe = We(le);
  var Ke;
  var Je;
  var tr = 0;
  var nr = 0;
  var er = 0;
  var rr = 1e3;
  var ir = 0;
  var or = 0;
  var ar = 0;
  var ur =
    typeof performance === "object" &amp;&amp; performance.now ? performance : Date;
  var cr =
    typeof window === "object" &amp;&amp; window.requestAnimationFrame
      ? window.requestAnimationFrame.bind(window)
      : function(t) {
          setTimeout(t, 17);
        };
  function fr() {
    return or || (cr(sr), (or = ur.now() + ar));
  }
  function sr() {
    or = 0;
  }
  function lr() {
    this._call = this._time = this._next = null;
  }
  function hr(t, n, e) {
    var r = new lr();
    return r.restart(t, n, e), r;
  }
  function dr() {
    fr(), ++tr;
    for (var t, n = Ke; n; )
      (t = or - n._time) &gt;= 0 &amp;&amp; n._call.call(null, t), (n = n._next);
    --tr;
  }
  function pr() {
    (or = (ir = ur.now()) + ar), (tr = nr = 0);
    try {
      dr();
    } finally {
      (tr = 0),
        (function() {
          var t;
          var n;
          var e = Ke;
          var r = 1 / 0;
          for (; e; )
            e._call
              ? (r &gt; e._time &amp;&amp; (r = e._time), (t = e), (e = e._next))
              : ((n = e._next),
                (e._next = null),
                (e = t ? (t._next = n) : (Ke = n)));
          (Je = t), gr(r);
        })(),
        (or = 0);
    }
  }
  function vr() {
    var t = ur.now();
    var n = t - ir;
    n &gt; rr &amp;&amp; ((ar -= n), (ir = t));
  }
  function gr(t) {
    tr ||
      (nr &amp;&amp; (nr = clearTimeout(nr)),
      t - or &gt; 24
        ? (t &lt; 1 / 0 &amp;&amp; (nr = setTimeout(pr, t - ur.now() - ar)),
          er &amp;&amp; (er = clearInterval(er)))
        : (er || ((ir = ur.now()), (er = setInterval(vr, rr))),
          (tr = 1),
          cr(pr)));
  }
  function yr(t, n, e) {
    var r = new lr();
    return (
      (n = n == null ? 0 : +n),
      r.restart(
        function(e) {
          r.stop(), t(e + n);
        },
        n,
        e
      ),
      r
    );
  }
  lr.prototype = hr.prototype = {
    constructor: lr,
    restart: function(t, n, e) {
      if (typeof t !== "function")
        throw new TypeError("callback is not a function");
      (e = (e == null ? fr() : +e) + (n == null ? 0 : +n)),
        this._next ||
          Je === this ||
          (Je ? (Je._next = this) : (Ke = this), (Je = this)),
        (this._call = t),
        (this._time = e),
        gr();
    },
    stop: function() {
      this._call &amp;&amp; ((this._call = null), (this._time = 1 / 0), gr());
    }
  };
  var _r = I("start", "end", "cancel", "interrupt");
  var br = [];
  var mr = 0;
  var xr = 1;
  var wr = 2;
  var Mr = 3;
  var Nr = 4;
  var Tr = 5;
  var Ar = 6;
  function Sr(t, n, e, r, i, o) {
    var a = t.__transition;
    if (a) {
      if (e in a) return;
    } else t.__transition = {};
    !(function(t, n, e) {
      var r;
      var i = t.__transition;
      function o(c) {
        var f;
        var s;
        var l;
        var h;
        if (e.state !== xr) return u();
        for (f in i)
          if ((h = i[f]).name === e.name) {
            if (h.state === Mr) return yr(o);
            h.state === Nr
              ? ((h.state = Ar),
                h.timer.stop(),
                h.on.call("interrupt", t, t.__data__, h.index, h.group),
                delete i[f])
              : +f &lt; n &amp;&amp;
                ((h.state = Ar),
                h.timer.stop(),
                h.on.call("cancel", t, t.__data__, h.index, h.group),
                delete i[f]);
          }
        if (
          (yr(function() {
            e.state === Mr &amp;&amp;
              ((e.state = Nr), e.timer.restart(a, e.delay, e.time), a(c));
          }),
          (e.state = wr),
          e.on.call("start", t, t.__data__, e.index, e.group),
          e.state === wr)
        ) {
          for (
            e.state = Mr, r = new Array((l = e.tween.length)), f = 0, s = -1;
            f &lt; l;
            ++f
          )
            (h = e.tween[f].value.call(t, t.__data__, e.index, e.group)) &amp;&amp;
              (r[++s] = h);
          r.length = s + 1;
        }
      }
      function a(n) {
        for (
          var i =
              n &lt; e.duration
                ? e.ease.call(null, n / e.duration)
                : (e.timer.restart(u), (e.state = Tr), 1),
            o = -1,
            a = r.length;
          ++o &lt; a;

        )
          r[o].call(t, i);
        e.state === Tr &amp;&amp;
          (e.on.call("end", t, t.__data__, e.index, e.group), u());
      }
      function u() {
        for (var r in ((e.state = Ar), e.timer.stop(), delete i[n], i)) return;
        delete t.__transition;
      }
      (i[n] = e),
        (e.timer = hr(
          function(t) {
            (e.state = xr),
              e.timer.restart(o, e.delay, e.time),
              e.delay &lt;= t &amp;&amp; o(t - e.delay);
          },
          0,
          e.time
        ));
    })(t, e, {
      name: n,
      index: r,
      group: i,
      on: _r,
      tween: br,
      time: o.time,
      delay: o.delay,
      duration: o.duration,
      ease: o.ease,
      timer: null,
      state: mr
    });
  }
  function kr(t, n) {
    var e = Cr(t, n);
    if (e.state &gt; mr) throw new Error("too late; already scheduled");
    return e;
  }
  function Er(t, n) {
    var e = Cr(t, n);
    if (e.state &gt; Mr) throw new Error("too late; already running");
    return e;
  }
  function Cr(t, n) {
    var e = t.__transition;
    if (!e || !(e = e[n])) throw new Error("transition not found");
    return e;
  }
  function Pr(t, n) {
    var e;
    var r;
    var i;
    var o = t.__transition;
    var a = !0;
    if (o) {
      for (i in ((n = n == null ? null : n + ""), o))
        (e = o[i]).name === n
          ? ((r = e.state &gt; wr &amp;&amp; e.state &lt; Tr),
            (e.state = Ar),
            e.timer.stop(),
            e.on.call(
              r ? "interrupt" : "cancel",
              t,
              t.__data__,
              e.index,
              e.group
            ),
            delete o[i])
          : (a = !1);
      a &amp;&amp; delete t.__transition;
    }
  }
  function zr(t, n, e) {
    var r = t._id;
    return (
      t.each(function() {
        var t = Er(this, r);
        (t.value || (t.value = {}))[n] = e.apply(this, arguments);
      }),
      function(t) {
        return Cr(t, r).value[n];
      }
    );
  }
  function Rr(t, n) {
    var e;
    return (typeof n === "number"
      ? me
      : n instanceof pn
      ? he
      : (e = pn(n))
      ? ((n = e), he)
      : Ne)(t, n);
  }
  var Dr = zt.prototype.constructor;
  function qr(t) {
    return function() {
      this.style.removeProperty(t);
    };
  }
  var Lr = 0;
  function Ur(t, n, e, r) {
    (this._groups = t), (this._parents = n), (this._name = e), (this._id = r);
  }
  function Or(t) {
    return zt().transition(t);
  }
  function Br() {
    return ++Lr;
  }
  var Fr = zt.prototype;
  function Yr(t) {
    return ((t *= 2) &lt;= 1 ? t * t : --t * (2 - t) + 1) / 2;
  }
  function Ir(t) {
    return ((t *= 2) &lt;= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
  }
  Ur.prototype = Or.prototype = {
    constructor: Ur,
    select: function(t) {
      var n = this._name;
      var e = this._id;
      typeof t !== "function" &amp;&amp; (t = K(t));
      for (
        var r = this._groups, i = r.length, o = new Array(i), a = 0;
        a &lt; i;
        ++a
      )
        for (
          var u, c, f = r[a], s = f.length, l = (o[a] = new Array(s)), h = 0;
          h &lt; s;
          ++h
        )
          (u = f[h]) &amp;&amp;
            (c = t.call(u, u.__data__, h, f)) &amp;&amp;
            ("__data__" in u &amp;&amp; (c.__data__ = u.__data__),
            (l[h] = c),
            Sr(l[h], n, e, h, l, Cr(u, e)));
      return new Ur(o, this._parents, n, e);
    },
    selectAll: function(t) {
      var n = this._name;
      var e = this._id;
      typeof t !== "function" &amp;&amp; (t = tt(t));
      for (
        var r = this._groups, i = r.length, o = [], a = [], u = 0;
        u &lt; i;
        ++u
      )
        for (var c, f = r[u], s = f.length, l = 0; l &lt; s; ++l)
          if ((c = f[l])) {
            for (
              var h,
                d = t.call(c, c.__data__, l, f),
                p = Cr(c, e),
                v = 0,
                g = d.length;
              v &lt; g;
              ++v
            )
              (h = d[v]) &amp;&amp; Sr(h, n, e, v, d, p);
            o.push(d), a.push(c);
          }
      return new Ur(o, a, n, e);
    },
    filter: function(t) {
      typeof t !== "function" &amp;&amp; (t = nt(t));
      for (
        var n = this._groups, e = n.length, r = new Array(e), i = 0;
        i &lt; e;
        ++i
      )
        for (var o, a = n[i], u = a.length, c = (r[i] = []), f = 0; f &lt; u; ++f)
          (o = a[f]) &amp;&amp; t.call(o, o.__data__, f, a) &amp;&amp; c.push(o);
      return new Ur(r, this._parents, this._name, this._id);
    },
    merge: function(t) {
      if (t._id !== this._id) throw new Error();
      for (
        var n = this._groups,
          e = t._groups,
          r = n.length,
          i = e.length,
          o = Math.min(r, i),
          a = new Array(r),
          u = 0;
        u &lt; o;
        ++u
      )
        for (
          var c,
            f = n[u],
            s = e[u],
            l = f.length,
            h = (a[u] = new Array(l)),
            d = 0;
          d &lt; l;
          ++d
        )
          (c = f[d] || s[d]) &amp;&amp; (h[d] = c);
      for (; u &lt; r; ++u) a[u] = n[u];
      return new Ur(a, this._parents, this._name, this._id);
    },
    selection: function() {
      return new Dr(this._groups, this._parents);
    },
    transition: function() {
      for (
        var t = this._name,
          n = this._id,
          e = Br(),
          r = this._groups,
          i = r.length,
          o = 0;
        o &lt; i;
        ++o
      )
        for (var a, u = r[o], c = u.length, f = 0; f &lt; c; ++f)
          if ((a = u[f])) {
            var s = Cr(a, n);
            Sr(a, t, e, f, u, {
              time: s.time + s.delay + s.duration,
              delay: 0,
              duration: s.duration,
              ease: s.ease
            });
          }
      return new Ur(r, this._parents, t, e);
    },
    call: Fr.call,
    nodes: Fr.nodes,
    node: Fr.node,
    size: Fr.size,
    empty: Fr.empty,
    each: Fr.each,
    on: function(t, n) {
      var e = this._id;
      return arguments.length &lt; 2
        ? Cr(this.node(), e).on.on(t)
        : this.each(
            (function(t, n, e) {
              var r;
              var i;
              var o = (function(t) {
                return (t + "")
                  .trim()
                  .split(/^|\s+/)
                  .every(function(t) {
                    var n = t.indexOf(".");
                    return n &gt;= 0 &amp;&amp; (t = t.slice(0, n)), !t || t === "start";
                  });
              })(n)
                ? kr
                : Er;
              return function() {
                var a = o(this, t);
                var u = a.on;
                u !== r &amp;&amp; (i = (r = u).copy()).on(n, e), (a.on = i);
              };
            })(e, t, n)
          );
    },
    attr: function(t, n) {
      var e = W(t);
      var r = e === "transform" ? Le : Rr;
      return this.attrTween(
        t,
        typeof n === "function"
          ? (e.local
              ? function(t, n, e) {
                  var r;
                  var i;
                  var o;
                  return function() {
                    var a;
                    var u;
                    var c = e(this);
                    if (c != null)
                      return (a = this.getAttributeNS(t.space, t.local)) ===
                        (u = c + "")
                        ? null
                        : a === r &amp;&amp; u === i
                        ? o
                        : ((i = u), (o = n((r = a), c)));
                    this.removeAttributeNS(t.space, t.local);
                  };
                }
              : function(t, n, e) {
                  var r;
                  var i;
                  var o;
                  return function() {
                    var a;
                    var u;
                    var c = e(this);
                    if (c != null)
                      return (a = this.getAttribute(t)) === (u = c + "")
                        ? null
                        : a === r &amp;&amp; u === i
                        ? o
                        : ((i = u), (o = n((r = a), c)));
                    this.removeAttribute(t);
                  };
                })(e, r, zr(this, "attr." + t, n))
          : n == null
          ? (e.local
              ? function(t) {
                  return function() {
                    this.removeAttributeNS(t.space, t.local);
                  };
                }
              : function(t) {
                  return function() {
                    this.removeAttribute(t);
                  };
                })(e)
          : (e.local
              ? function(t, n, e) {
                  var r;
                  var i;
                  var o = e + "";
                  return function() {
                    var a = this.getAttributeNS(t.space, t.local);
                    return a === o ? null : a === r ? i : (i = n((r = a), e));
                  };
                }
              : function(t, n, e) {
                  var r;
                  var i;
                  var o = e + "";
                  return function() {
                    var a = this.getAttribute(t);
                    return a === o ? null : a === r ? i : (i = n((r = a), e));
                  };
                })(e, r, n)
      );
    },
    attrTween: function(t, n) {
      var e = "attr." + t;
      if (arguments.length &lt; 2) return (e = this.tween(e)) &amp;&amp; e._value;
      if (n == null) return this.tween(e, null);
      if (typeof n !== "function") throw new Error();
      var r = W(t);
      return this.tween(
        e,
        (r.local
          ? function(t, n) {
              var e;
              var r;
              function i() {
                var i = n.apply(this, arguments);
                return (
                  i !== r &amp;&amp;
                    (e =
                      (r = i) &amp;&amp;
                      (function(t, n) {
                        return function(e) {
                          this.setAttributeNS(
                            t.space,
                            t.local,
                            n.call(this, e)
                          );
                        };
                      })(t, i)),
                  e
                );
              }
              return (i._value = n), i;
            }
          : function(t, n) {
              var e;
              var r;
              function i() {
                var i = n.apply(this, arguments);
                return (
                  i !== r &amp;&amp;
                    (e =
                      (r = i) &amp;&amp;
                      (function(t, n) {
                        return function(e) {
                          this.setAttribute(t, n.call(this, e));
                        };
                      })(t, i)),
                  e
                );
              }
              return (i._value = n), i;
            })(r, n)
      );
    },
    style: function(t, n, e) {
      var r = (t += "") == "transform" ? qe : Rr;
      return n == null
        ? this.styleTween(
            t,
            (function(t, n) {
              var e;
              var r;
              var i;
              return function() {
                var o = ft(this, t);
                var a = (this.style.removeProperty(t), ft(this, t));
                return o === a
                  ? null
                  : o === e &amp;&amp; a === r
                  ? i
                  : (i = n((e = o), (r = a)));
              };
            })(t, r)
          ).on("end.style." + t, qr(t))
        : typeof n === "function"
        ? this.styleTween(
            t,
            (function(t, n, e) {
              var r;
              var i;
              var o;
              return function() {
                var a = ft(this, t);
                var u = e(this);
                var c = u + "";
                return (
                  u == null &amp;&amp;
                    (this.style.removeProperty(t), (c = u = ft(this, t))),
                  a === c
                    ? null
                    : a === r &amp;&amp; c === i
                    ? o
                    : ((i = c), (o = n((r = a), u)))
                );
              };
            })(t, r, zr(this, "style." + t, n))
          ).each(
            (function(t, n) {
              var e;
              var r;
              var i;
              var o;
              var a = "style." + n;
              var u = "end." + a;
              return function() {
                var c = Er(this, t);
                var f = c.on;
                var s = c.value[a] == null ? o || (o = qr(n)) : void 0;
                (f === e &amp;&amp; i === s) || (r = (e = f).copy()).on(u, (i = s)),
                  (c.on = r);
              };
            })(this._id, t)
          )
        : this.styleTween(
            t,
            (function(t, n, e) {
              var r;
              var i;
              var o = e + "";
              return function() {
                var a = ft(this, t);
                return a === o ? null : a === r ? i : (i = n((r = a), e));
              };
            })(t, r, n),
            e
          ).on("end.style." + t, null);
    },
    styleTween: function(t, n, e) {
      var r = "style." + (t += "");
      if (arguments.length &lt; 2) return (r = this.tween(r)) &amp;&amp; r._value;
      if (n == null) return this.tween(r, null);
      if (typeof n !== "function") throw new Error();
      return this.tween(
        r,
        (function(t, n, e) {
          var r;
          var i;
          function o() {
            var o = n.apply(this, arguments);
            return (
              o !== i &amp;&amp;
                (r =
                  (i = o) &amp;&amp;
                  (function(t, n, e) {
                    return function(r) {
                      this.style.setProperty(t, n.call(this, r), e);
                    };
                  })(t, o, e)),
              r
            );
          }
          return (o._value = n), o;
        })(t, n, e == null ? "" : e)
      );
    },
    text: function(t) {
      return this.tween(
        "text",
        typeof t === "function"
          ? (function(t) {
              return function() {
                var n = t(this);
                this.textContent = n == null ? "" : n;
              };
            })(zr(this, "text", t))
          : (function(t) {
              return function() {
                this.textContent = t;
              };
            })(t == null ? "" : t + "")
      );
    },
    textTween: function(t) {
      var n = "text";
      if (arguments.length &lt; 1) return (n = this.tween(n)) &amp;&amp; n._value;
      if (t == null) return this.tween(n, null);
      if (typeof t !== "function") throw new Error();
      return this.tween(
        n,
        (function(t) {
          var n;
          var e;
          function r() {
            var r = t.apply(this, arguments);
            return (
              r !== e &amp;&amp;
                (n =
                  (e = r) &amp;&amp;
                  (function(t) {
                    return function(n) {
                      this.textContent = t.call(this, n);
                    };
                  })(r)),
              n
            );
          }
          return (r._value = t), r;
        })(t)
      );
    },
    remove: function() {
      return this.on(
        "end.remove",
        (function(t) {
          return function() {
            var n = this.parentNode;
            for (var e in this.__transition) if (+e !== t) return;
            n &amp;&amp; n.removeChild(this);
          };
        })(this._id)
      );
    },
    tween: function(t, n) {
      var e = this._id;
      if (((t += ""), arguments.length &lt; 2)) {
        for (
          var r, i = Cr(this.node(), e).tween, o = 0, a = i.length;
          o &lt; a;
          ++o
        )
          if ((r = i[o]).name === t) return r.value;
        return null;
      }
      return this.each(
        (n == null
          ? function(t, n) {
              var e;
              var r;
              return function() {
                var i = Er(this, t);
                var o = i.tween;
                if (o !== e)
                  for (var a = 0, u = (r = e = o).length; a &lt; u; ++a)
                    if (r[a].name === n) {
                      (r = r.slice()).splice(a, 1);
                      break;
                    }
                i.tween = r;
              };
            }
          : function(t, n, e) {
              var r;
              var i;
              if (typeof e !== "function") throw new Error();
              return function() {
                var o = Er(this, t);
                var a = o.tween;
                if (a !== r) {
                  i = (r = a).slice();
                  for (
                    var u = { name: n, value: e }, c = 0, f = i.length;
                    c &lt; f;
                    ++c
                  )
                    if (i[c].name === n) {
                      i[c] = u;
                      break;
                    }
                  c === f &amp;&amp; i.push(u);
                }
                o.tween = i;
              };
            })(e, t, n)
      );
    },
    delay: function(t) {
      var n = this._id;
      return arguments.length
        ? this.each(
            (typeof t === "function"
              ? function(t, n) {
                  return function() {
                    kr(this, t).delay = +n.apply(this, arguments);
                  };
                }
              : function(t, n) {
                  return (
                    (n = +n),
                    function() {
                      kr(this, t).delay = n;
                    }
                  );
                })(n, t)
          )
        : Cr(this.node(), n).delay;
    },
    duration: function(t) {
      var n = this._id;
      return arguments.length
        ? this.each(
            (typeof t === "function"
              ? function(t, n) {
                  return function() {
                    Er(this, t).duration = +n.apply(this, arguments);
                  };
                }
              : function(t, n) {
                  return (
                    (n = +n),
                    function() {
                      Er(this, t).duration = n;
                    }
                  );
                })(n, t)
          )
        : Cr(this.node(), n).duration;
    },
    ease: function(t) {
      var n = this._id;
      return arguments.length
        ? this.each(
            (function(t, n) {
              if (typeof n !== "function") throw new Error();
              return function() {
                Er(this, t).ease = n;
              };
            })(n, t)
          )
        : Cr(this.node(), n).ease;
    },
    end: function() {
      var t;
      var n;
      var e = this;
      var r = e._id;
      var i = e.size();
      return new Promise(function(o, a) {
        var u = { value: a };
        var c = {
          value: function() {
            --i == 0 &amp;&amp; o();
          }
        };
        e.each(function() {
          var e = Er(this, r);
          var i = e.on;
          i !== t &amp;&amp;
            ((n = (t = i).copy())._.cancel.push(u),
            n._.interrupt.push(u),
            n._.end.push(c)),
            (e.on = n);
        });
      });
    }
  };
  var Hr = (function t(n) {
    function e(t) {
      return Math.pow(t, n);
    }
    return (n = +n), (e.exponent = t), e;
  })(3);
  var jr = (function t(n) {
    function e(t) {
      return 1 - Math.pow(1 - t, n);
    }
    return (n = +n), (e.exponent = t), e;
  })(3);
  var Xr = (function t(n) {
    function e(t) {
      return ((t *= 2) &lt;= 1 ? Math.pow(t, n) : 2 - Math.pow(2 - t, n)) / 2;
    }
    return (n = +n), (e.exponent = t), e;
  })(3);
  var Vr = Math.PI;
  var Gr = Vr / 2;
  function $r(t) {
    return (1 - Math.cos(Vr * t)) / 2;
  }
  function Wr(t) {
    return (
      ((t *= 2) &lt;= 1
        ? Math.pow(2, 10 * t - 10)
        : 2 - Math.pow(2, 10 - 10 * t)) / 2
    );
  }
  function Zr(t) {
    return (
      ((t *= 2) &lt;= 1
        ? 1 - Math.sqrt(1 - t * t)
        : Math.sqrt(1 - (t -= 2) * t) + 1) / 2
    );
  }
  var Qr = 4 / 11;
  var Kr = 6 / 11;
  var Jr = 8 / 11;
  var ti = 0.75;
  var ni = 9 / 11;
  var ei = 10 / 11;
  var ri = 0.9375;
  var ii = 21 / 22;
  var oi = 63 / 64;
  var ai = 1 / Qr / Qr;
  function ui(t) {
    return (t = +t) &lt; Qr
      ? ai * t * t
      : t &lt; Jr
      ? ai * (t -= Kr) * t + ti
      : t &lt; ei
      ? ai * (t -= ni) * t + ri
      : ai * (t -= ii) * t + oi;
  }
  var ci = (function t(n) {
    function e(t) {
      return t * t * ((n + 1) * t - n);
    }
    return (n = +n), (e.overshoot = t), e;
  })(1.70158);
  var fi = (function t(n) {
    function e(t) {
      return --t * t * ((n + 1) * t + n) + 1;
    }
    return (n = +n), (e.overshoot = t), e;
  })(1.70158);
  var si = (function t(n) {
    function e(t) {
      return (
        ((t *= 2) &lt; 1
          ? t * t * ((n + 1) * t - n)
          : (t -= 2) * t * ((n + 1) * t + n) + 2) / 2
      );
    }
    return (n = +n), (e.overshoot = t), e;
  })(1.70158);
  var li = 2 * Math.PI;
  var hi = (function t(n, e) {
    var r = Math.asin(1 / (n = Math.max(1, n))) * (e /= li);
    function i(t) {
      return n * Math.pow(2, 10 * --t) * Math.sin((r - t) / e);
    }
    return (
      (i.amplitude = function(n) {
        return t(n, e * li);
      }),
      (i.period = function(e) {
        return t(n, e);
      }),
      i
    );
  })(1, 0.3);
  var di = (function t(n, e) {
    var r = Math.asin(1 / (n = Math.max(1, n))) * (e /= li);
    function i(t) {
      return 1 - n * Math.pow(2, -10 * (t = +t)) * Math.sin((t + r) / e);
    }
    return (
      (i.amplitude = function(n) {
        return t(n, e * li);
      }),
      (i.period = function(e) {
        return t(n, e);
      }),
      i
    );
  })(1, 0.3);
  var pi = (function t(n, e) {
    var r = Math.asin(1 / (n = Math.max(1, n))) * (e /= li);
    function i(t) {
      return (
        ((t = 2 * t - 1) &lt; 0
          ? n * Math.pow(2, 10 * t) * Math.sin((r - t) / e)
          : 2 - n * Math.pow(2, -10 * t) * Math.sin((r + t) / e)) / 2
      );
    }
    return (
      (i.amplitude = function(n) {
        return t(n, e * li);
      }),
      (i.period = function(e) {
        return t(n, e);
      }),
      i
    );
  })(1, 0.3);
  var vi = { time: null, delay: 0, duration: 250, ease: Ir };
  function gi(t, n) {
    for (var e; !(e = t.__transition) || !(e = e[n]); )
      if (!(t = t.parentNode)) return (vi.time = fr()), vi;
    return e;
  }
  (zt.prototype.interrupt = function(t) {
    return this.each(function() {
      Pr(this, t);
    });
  }),
    (zt.prototype.transition = function(t) {
      var n;
      var e;
      t instanceof Ur
        ? ((n = t._id), (t = t._name))
        : ((n = Br()), ((e = vi).time = fr()), (t = t == null ? null : t + ""));
      for (var r = this._groups, i = r.length, o = 0; o &lt; i; ++o)
        for (var a, u = r[o], c = u.length, f = 0; f &lt; c; ++f)
          (a = u[f]) &amp;&amp; Sr(a, t, n, f, u, e || gi(a, n));
      return new Ur(r, this._parents, t, n);
    });
  var yi = [null];
  function _i(t) {
    return function() {
      return t;
    };
  }
  function bi(t, n, e) {
    (this.target = t), (this.type = n), (this.selection = e);
  }
  function mi() {
    t.event.stopImmediatePropagation();
  }
  function xi() {
    t.event.preventDefault(), t.event.stopImmediatePropagation();
  }
  var wi = { name: "drag" };
  var Mi = { name: "space" };
  var Ni = { name: "handle" };
  var Ti = { name: "center" };
  function Ai(t) {
    return [+t[0], +t[1]];
  }
  function Si(t) {
    return [Ai(t[0]), Ai(t[1])];
  }
  var ki = {
    name: "x",
    handles: ["w", "e"].map(Li),
    input: function(t, n) {
      return t == null ? null : [[+t[0], n[0][1]], [+t[1], n[1][1]]];
    },
    output: function(t) {
      return t &amp;&amp; [t[0][0], t[1][0]];
    }
  };
  var Ei = {
    name: "y",
    handles: ["n", "s"].map(Li),
    input: function(t, n) {
      return t == null ? null : [[n[0][0], +t[0]], [n[1][0], +t[1]]];
    },
    output: function(t) {
      return t &amp;&amp; [t[0][1], t[1][1]];
    }
  };
  var Ci = {
    name: "xy",
    handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(Li),
    input: function(t) {
      return t == null ? null : Si(t);
    },
    output: function(t) {
      return t;
    }
  };
  var Pi = {
    overlay: "crosshair",
    selection: "move",
    n: "ns-resize",
    e: "ew-resize",
    s: "ns-resize",
    w: "ew-resize",
    nw: "nwse-resize",
    ne: "nesw-resize",
    se: "nwse-resize",
    sw: "nesw-resize"
  };
  var zi = { e: "w", w: "e", nw: "ne", ne: "nw", se: "sw", sw: "se" };
  var Ri = { n: "s", s: "n", nw: "sw", ne: "se", se: "ne", sw: "nw" };
  var Di = {
    overlay: 1,
    selection: 1,
    n: null,
    e: 1,
    s: null,
    w: -1,
    nw: -1,
    ne: 1,
    se: 1,
    sw: -1
  };
  var qi = {
    overlay: 1,
    selection: 1,
    n: -1,
    e: null,
    s: 1,
    w: null,
    nw: -1,
    ne: -1,
    se: 1,
    sw: 1
  };
  function Li(t) {
    return { type: t };
  }
  function Ui() {
    return !t.event.ctrlKey &amp;&amp; !t.event.button;
  }
  function Oi() {
    var t = this.ownerSVGElement || this;
    return t.hasAttribute("viewBox")
      ? [[(t = t.viewBox.baseVal).x, t.y], [t.x + t.width, t.y + t.height]]
      : [[0, 0], [t.width.baseVal.value, t.height.baseVal.value]];
  }
  function Bi() {
    return navigator.maxTouchPoints || "ontouchstart" in this;
  }
  function Fi(t) {
    for (; !t.__brush; ) if (!(t = t.parentNode)) return;
    return t.__brush;
  }
  function Yi(n) {
    var e;
    var r = Oi;
    var i = Ui;
    var o = Bi;
    var a = !0;
    var u = I("start", "brush", "end");
    var c = 6;
    function f(t) {
      var e = t
        .property("__brush", g)
        .selectAll(".overlay")
        .data([Li("overlay")]);
      e
        .enter()
        .append("rect")
        .attr("class", "overlay")
        .attr("pointer-events", "all")
        .attr("cursor", Pi.overlay)
        .merge(e)
        .each(function() {
          var t = Fi(this).extent;
          Rt(this)
            .attr("x", t[0][0])
            .attr("y", t[0][1])
            .attr("width", t[1][0] - t[0][0])
            .attr("height", t[1][1] - t[0][1]);
        }),
        t
          .selectAll(".selection")
          .data([Li("selection")])
          .enter()
          .append("rect")
          .attr("class", "selection")
          .attr("cursor", Pi.selection)
          .attr("fill", "#777")
          .attr("fill-opacity", 0.3)
          .attr("stroke", "#fff")
          .attr("shape-rendering", "crispEdges");
      var r = t.selectAll(".handle").data(n.handles, function(t) {
        return t.type;
      });
      r.exit().remove(),
        r
          .enter()
          .append("rect")
          .attr("class", function(t) {
            return "handle handle--" + t.type;
          })
          .attr("cursor", function(t) {
            return Pi[t.type];
          }),
        t
          .each(s)
          .attr("fill", "none")
          .attr("pointer-events", "all")
          .on("mousedown.brush", d)
          .filter(o)
          .on("touchstart.brush", d)
          .on("touchmove.brush", p)
          .on("touchend.brush touchcancel.brush", v)
          .style("touch-action", "none")
          .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
    }
    function s() {
      var t = Rt(this);
      var n = Fi(this).selection;
      n
        ? (t
            .selectAll(".selection")
            .style("display", null)
            .attr("x", n[0][0])
            .attr("y", n[0][1])
            .attr("width", n[1][0] - n[0][0])
            .attr("height", n[1][1] - n[0][1]),
          t
            .selectAll(".handle")
            .style("display", null)
            .attr("x", function(t) {
              return t.type[t.type.length - 1] === "e"
                ? n[1][0] - c / 2
                : n[0][0] - c / 2;
            })
            .attr("y", function(t) {
              return t.type[0] === "s" ? n[1][1] - c / 2 : n[0][1] - c / 2;
            })
            .attr("width", function(t) {
              return t.type === "n" || t.type === "s"
                ? n[1][0] - n[0][0] + c
                : c;
            })
            .attr("height", function(t) {
              return t.type === "e" || t.type === "w"
                ? n[1][1] - n[0][1] + c
                : c;
            }))
        : t
            .selectAll(".selection,.handle")
            .style("display", "none")
            .attr("x", null)
            .attr("y", null)
            .attr("width", null)
            .attr("height", null);
    }
    function l(t, n, e) {
      return (!e &amp;&amp; t.__brush.emitter) || new h(t, n);
    }
    function h(t, n) {
      (this.that = t),
        (this.args = n),
        (this.state = t.__brush),
        (this.active = 0);
    }
    function d() {
      if ((!e || t.event.touches) &amp;&amp; i.apply(this, arguments)) {
        var r;
        var o;
        var u;
        var c;
        var f;
        var h;
        var d;
        var p;
        var v;
        var g;
        var y;
        var _;
        var b = this;
        var m = t.event.target.__data__.type;
        var x =
          (a &amp;&amp; t.event.metaKey ? (m = "overlay") : m) === "selection"
            ? wi
            : a &amp;&amp; t.event.altKey
            ? Ti
            : Ni;
        var w = n === Ei ? null : Di[m];
        var M = n === ki ? null : qi[m];
        var N = Fi(b);
        var T = N.extent;
        var A = N.selection;
        var S = T[0][0];
        var k = T[0][1];
        var E = T[1][0];
        var C = T[1][1];
        var P = 0;
        var z = 0;
        var R = w &amp;&amp; M &amp;&amp; a &amp;&amp; t.event.shiftKey;
        var D = t.event.touches
          ? ((_ = t.event.changedTouches[0].identifier),
            function(n) {
              return Ft(n, t.event.touches, _);
            })
          : Bt;
        var q = D(b);
        var L = q;
        var U = l(b, arguments, !0).beforestart();
        m === "overlay"
          ? (A &amp;&amp; (v = !0),
            (N.selection = A = [
              [(r = n === Ei ? S : q[0]), (u = n === ki ? k : q[1])],
              [(f = n === Ei ? E : r), (d = n === ki ? C : u)]
            ]))
          : ((r = A[0][0]), (u = A[0][1]), (f = A[1][0]), (d = A[1][1])),
          (o = r),
          (c = u),
          (h = f),
          (p = d);
        var O = Rt(b).attr("pointer-events", "none");
        var B = O.selectAll(".overlay").attr("cursor", Pi[m]);
        if (t.event.touches) (U.moved = Y), (U.ended = H);
        else {
          var F = Rt(t.event.view)
            .on("mousemove.brush", Y, !0)
            .on("mouseup.brush", H, !0);
          a &amp;&amp;
            F.on(
              "keydown.brush",
              function() {
                switch (t.event.keyCode) {
                  case 16:
                    R = w &amp;&amp; M;
                    break;
                  case 18:
                    x === Ni &amp;&amp;
                      (w &amp;&amp; ((f = h - P * w), (r = o + P * w)),
                      M &amp;&amp; ((d = p - z * M), (u = c + z * M)),
                      (x = Ti),
                      I());
                    break;
                  case 32:
                    (x !== Ni &amp;&amp; x !== Ti) ||
                      (w &lt; 0 ? (f = h - P) : w &gt; 0 &amp;&amp; (r = o - P),
                      M &lt; 0 ? (d = p - z) : M &gt; 0 &amp;&amp; (u = c - z),
                      (x = Mi),
                      B.attr("cursor", Pi.selection),
                      I());
                    break;
                  default:
                    return;
                }
                xi();
              },
              !0
            ).on(
              "keyup.brush",
              function() {
                switch (t.event.keyCode) {
                  case 16:
                    R &amp;&amp; ((g = y = R = !1), I());
                    break;
                  case 18:
                    x === Ti &amp;&amp;
                      (w &lt; 0 ? (f = h) : w &gt; 0 &amp;&amp; (r = o),
                      M &lt; 0 ? (d = p) : M &gt; 0 &amp;&amp; (u = c),
                      (x = Ni),
                      I());
                    break;
                  case 32:
                    x === Mi &amp;&amp;
                      (t.event.altKey
                        ? (w &amp;&amp; ((f = h - P * w), (r = o + P * w)),
                          M &amp;&amp; ((d = p - z * M), (u = c + z * M)),
                          (x = Ti))
                        : (w &lt; 0 ? (f = h) : w &gt; 0 &amp;&amp; (r = o),
                          M &lt; 0 ? (d = p) : M &gt; 0 &amp;&amp; (u = c),
                          (x = Ni)),
                      B.attr("cursor", Pi[m]),
                      I());
                    break;
                  default:
                    return;
                }
                xi();
              },
              !0
            ),
            Ht(t.event.view);
        }
        mi(), Pr(b), s.call(b), U.start();
      }
      function Y() {
        var t = D(b);
        !R ||
          g ||
          y ||
          (Math.abs(t[0] - L[0]) &gt; Math.abs(t[1] - L[1]) ? (y = !0) : (g = !0)),
          (L = t),
          (v = !0),
          xi(),
          I();
      }
      function I() {
        var t;
        switch (((P = L[0] - q[0]), (z = L[1] - q[1]), x)) {
          case Mi:
          case wi:
            w &amp;&amp;
              ((P = Math.max(S - r, Math.min(E - f, P))),
              (o = r + P),
              (h = f + P)),
              M &amp;&amp;
                ((z = Math.max(k - u, Math.min(C - d, z))),
                (c = u + z),
                (p = d + z));
            break;
          case Ni:
            w &lt; 0
              ? ((P = Math.max(S - r, Math.min(E - r, P))),
                (o = r + P),
                (h = f))
              : w &gt; 0 &amp;&amp;
                ((P = Math.max(S - f, Math.min(E - f, P))),
                (o = r),
                (h = f + P)),
              M &lt; 0
                ? ((z = Math.max(k - u, Math.min(C - u, z))),
                  (c = u + z),
                  (p = d))
                : M &gt; 0 &amp;&amp;
                  ((z = Math.max(k - d, Math.min(C - d, z))),
                  (c = u),
                  (p = d + z));
            break;
          case Ti:
            w &amp;&amp;
              ((o = Math.max(S, Math.min(E, r - P * w))),
              (h = Math.max(S, Math.min(E, f + P * w)))),
              M &amp;&amp;
                ((c = Math.max(k, Math.min(C, u - z * M))),
                (p = Math.max(k, Math.min(C, d + z * M))));
        }
        h &lt; o &amp;&amp;
          ((w *= -1),
          (t = r),
          (r = f),
          (f = t),
          (t = o),
          (o = h),
          (h = t),
          m in zi &amp;&amp; B.attr("cursor", Pi[(m = zi[m])])),
          p &lt; c &amp;&amp;
            ((M *= -1),
            (t = u),
            (u = d),
            (d = t),
            (t = c),
            (c = p),
            (p = t),
            m in Ri &amp;&amp; B.attr("cursor", Pi[(m = Ri[m])])),
          N.selection &amp;&amp; (A = N.selection),
          g &amp;&amp; ((o = A[0][0]), (h = A[1][0])),
          y &amp;&amp; ((c = A[0][1]), (p = A[1][1])),
          (A[0][0] === o &amp;&amp; A[0][1] === c &amp;&amp; A[1][0] === h &amp;&amp; A[1][1] === p) ||
            ((N.selection = [[o, c], [h, p]]), s.call(b), U.brush());
      }
      function H() {
        if ((mi(), t.event.touches)) {
          if (t.event.touches.length) return;
          e &amp;&amp; clearTimeout(e),
            (e = setTimeout(function() {
              e = null;
            }, 500));
        } else
          jt(t.event.view, v),
            F.on(
              "keydown.brush keyup.brush mousemove.brush mouseup.brush",
              null
            );
        O.attr("pointer-events", "all"),
          B.attr("cursor", Pi.overlay),
          N.selection &amp;&amp; (A = N.selection),
          (function(t) {
            return t[0][0] === t[1][0] || t[0][1] === t[1][1];
          })(A) &amp;&amp; ((N.selection = null), s.call(b)),
          U.end();
      }
    }
    function p() {
      l(this, arguments).moved();
    }
    function v() {
      l(this, arguments).ended();
    }
    function g() {
      var t = this.__brush || { selection: null };
      return (t.extent = Si(r.apply(this, arguments))), (t.dim = n), t;
    }
    return (
      (f.move = function(t, e) {
        t.selection
          ? t
              .on("start.brush", function() {
                l(this, arguments)
                  .beforestart()
                  .start();
              })
              .on("interrupt.brush end.brush", function() {
                l(this, arguments).end();
              })
              .tween("brush", function() {
                var t = this;
                var r = t.__brush;
                var i = l(t, arguments);
                var o = r.selection;
                var a = n.input(
                  typeof e === "function" ? e.apply(this, arguments) : e,
                  r.extent
                );
                var u = Te(o, a);
                function c(n) {
                  (r.selection = n === 1 &amp;&amp; a === null ? null : u(n)),
                    s.call(t),
                    i.brush();
                }
                return o !== null &amp;&amp; a !== null ? c : c(1);
              })
          : t.each(function() {
              var t = this;
              var r = arguments;
              var i = t.__brush;
              var o = n.input(
                typeof e === "function" ? e.apply(t, r) : e,
                i.extent
              );
              var a = l(t, r).beforestart();
              Pr(t),
                (i.selection = o === null ? null : o),
                s.call(t),
                a
                  .start()
                  .brush()
                  .end();
            });
      }),
      (f.clear = function(t) {
        f.move(t, null);
      }),
      (h.prototype = {
        beforestart: function() {
          return (
            ++this.active == 1 &amp;&amp;
              ((this.state.emitter = this), (this.starting = !0)),
            this
          );
        },
        start: function() {
          return (
            this.starting
              ? ((this.starting = !1), this.emit("start"))
              : this.emit("brush"),
            this
          );
        },
        brush: function() {
          return this.emit("brush"), this;
        },
        end: function() {
          return (
            --this.active == 0 &amp;&amp; (delete this.state.emitter, this.emit("end")),
            this
          );
        },
        emit: function(t) {
          kt(new bi(f, t, n.output(this.state.selection)), u.apply, u, [
            t,
            this.that,
            this.args
          ]);
        }
      }),
      (f.extent = function(t) {
        return arguments.length
          ? ((r = typeof t === "function" ? t : _i(Si(t))), f)
          : r;
      }),
      (f.filter = function(t) {
        return arguments.length
          ? ((i = typeof t === "function" ? t : _i(!!t)), f)
          : i;
      }),
      (f.touchable = function(t) {
        return arguments.length
          ? ((o = typeof t === "function" ? t : _i(!!t)), f)
          : o;
      }),
      (f.handleSize = function(t) {
        return arguments.length ? ((c = +t), f) : c;
      }),
      (f.keyModifiers = function(t) {
        return arguments.length ? ((a = !!t), f) : a;
      }),
      (f.on = function() {
        var t = u.on.apply(u, arguments);
        return t === u ? f : t;
      }),
      f
    );
  }
  var Ii = Math.cos;
  var Hi = Math.sin;
  var ji = Math.PI;
  var Xi = ji / 2;
  var Vi = 2 * ji;
  var Gi = Math.max;
  function $i(t) {
    return function(n, e) {
      return t(
        n.source.value + n.target.value,
        e.source.value + e.target.value
      );
    };
  }
  var Wi = Array.prototype.slice;
  function Zi(t) {
    return function() {
      return t;
    };
  }
  var Qi = Math.PI;
  var Ki = 2 * Qi;
  var Ji = Ki - 1e-6;
  function to() {
    (this._x0 = this._y0 = this._x1 = this._y1 = null), (this._ = "");
  }
  function no() {
    return new to();
  }
  function eo(t) {
    return t.source;
  }
  function ro(t) {
    return t.target;
  }
  function io(t) {
    return t.radius;
  }
  function oo(t) {
    return t.startAngle;
  }
  function ao(t) {
    return t.endAngle;
  }
  to.prototype = no.prototype = {
    constructor: to,
    moveTo: function(t, n) {
      this._ +=
        "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
    },
    closePath: function() {
      this._x1 !== null &amp;&amp;
        ((this._x1 = this._x0), (this._y1 = this._y0), (this._ += "Z"));
    },
    lineTo: function(t, n) {
      this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
    },
    quadraticCurveTo: function(t, n, e, r) {
      this._ +=
        "Q" + +t + "," + +n + "," + (this._x1 = +e) + "," + (this._y1 = +r);
    },
    bezierCurveTo: function(t, n, e, r, i, o) {
      this._ +=
        "C" +
        +t +
        "," +
        +n +
        "," +
        +e +
        "," +
        +r +
        "," +
        (this._x1 = +i) +
        "," +
        (this._y1 = +o);
    },
    arcTo: function(t, n, e, r, i) {
      (t = +t), (n = +n), (e = +e), (r = +r), (i = +i);
      var o = this._x1;
      var a = this._y1;
      var u = e - t;
      var c = r - n;
      var f = o - t;
      var s = a - n;
      var l = f * f + s * s;
      if (i &lt; 0) throw new Error("negative radius: " + i);
      if (this._x1 === null)
        this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
      else if (l &gt; 1e-6)
        if (Math.abs(s * u - c * f) &gt; 1e-6 &amp;&amp; i) {
          var h = e - o;
          var d = r - a;
          var p = u * u + c * c;
          var v = h * h + d * d;
          var g = Math.sqrt(p);
          var y = Math.sqrt(l);
          var _ = i * Math.tan((Qi - Math.acos((p + l - v) / (2 * g * y))) / 2);
          var b = _ / y;
          var m = _ / g;
          Math.abs(b - 1) &gt; 1e-6 &amp;&amp;
            (this._ += "L" + (t + b * f) + "," + (n + b * s)),
            (this._ +=
              "A" +
              i +
              "," +
              i +
              ",0,0," +
              +(s * h &gt; f * d) +
              "," +
              (this._x1 = t + m * u) +
              "," +
              (this._y1 = n + m * c));
        } else this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
      else;
    },
    arc: function(t, n, e, r, i, o) {
      (t = +t), (n = +n), (o = !!o);
      var a = (e = +e) * Math.cos(r);
      var u = e * Math.sin(r);
      var c = t + a;
      var f = n + u;
      var s = 1 ^ o;
      var l = o ? r - i : i - r;
      if (e &lt; 0) throw new Error("negative radius: " + e);
      this._x1 === null
        ? (this._ += "M" + c + "," + f)
        : (Math.abs(this._x1 - c) &gt; 1e-6 || Math.abs(this._y1 - f) &gt; 1e-6) &amp;&amp;
          (this._ += "L" + c + "," + f),
        e &amp;&amp;
          (l &lt; 0 &amp;&amp; (l = (l % Ki) + Ki),
          l &gt; Ji
            ? (this._ +=
                "A" +
                e +
                "," +
                e +
                ",0,1," +
                s +
                "," +
                (t - a) +
                "," +
                (n - u) +
                "A" +
                e +
                "," +
                e +
                ",0,1," +
                s +
                "," +
                (this._x1 = c) +
                "," +
                (this._y1 = f))
            : l &gt; 1e-6 &amp;&amp;
              (this._ +=
                "A" +
                e +
                "," +
                e +
                ",0," +
                +(l &gt;= Qi) +
                "," +
                s +
                "," +
                (this._x1 = t + e * Math.cos(i)) +
                "," +
                (this._y1 = n + e * Math.sin(i))));
    },
    rect: function(t, n, e, r) {
      this._ +=
        "M" +
        (this._x0 = this._x1 = +t) +
        "," +
        (this._y0 = this._y1 = +n) +
        "h" +
        +e +
        "v" +
        +r +
        "h" +
        -e +
        "Z";
    },
    toString: function() {
      return this._;
    }
  };
  function uo() {}
  function co(t, n) {
    var e = new uo();
    if (t instanceof uo)
      t.each(function(t, n) {
        e.set(n, t);
      });
    else if (Array.isArray(t)) {
      var r;
      var i = -1;
      var o = t.length;
      if (n == null) for (; ++i &lt; o; ) e.set(i, t[i]);
      else for (; ++i &lt; o; ) e.set(n((r = t[i]), i, t), r);
    } else if (t) for (var a in t) e.set(a, t[a]);
    return e;
  }
  function fo() {
    return {};
  }
  function so(t, n, e) {
    t[n] = e;
  }
  function lo() {
    return co();
  }
  function ho(t, n, e) {
    t.set(n, e);
  }
  function po() {}
  uo.prototype = co.prototype = {
    constructor: uo,
    has: function(t) {
      return "$" + t in this;
    },
    get: function(t) {
      return this["$" + t];
    },
    set: function(t, n) {
      return (this["$" + t] = n), this;
    },
    remove: function(t) {
      var n = "$" + t;
      return n in this &amp;&amp; delete this[n];
    },
    clear: function() {
      for (var t in this) t[0] === "$" &amp;&amp; delete this[t];
    },
    keys: function() {
      var t = [];
      for (var n in this) n[0] === "$" &amp;&amp; t.push(n.slice(1));
      return t;
    },
    values: function() {
      var t = [];
      for (var n in this) n[0] === "$" &amp;&amp; t.push(this[n]);
      return t;
    },
    entries: function() {
      var t = [];
      for (var n in this)
        n[0] === "$" &amp;&amp; t.push({ key: n.slice(1), value: this[n] });
      return t;
    },
    size: function() {
      var t = 0;
      for (var n in this) n[0] === "$" &amp;&amp; ++t;
      return t;
    },
    empty: function() {
      for (var t in this) if (t[0] === "$") return !1;
      return !0;
    },
    each: function(t) {
      for (var n in this) n[0] === "$" &amp;&amp; t(this[n], n.slice(1), this);
    }
  };
  var vo = co.prototype;
  function go(t, n) {
    var e = new po();
    if (t instanceof po)
      t.each(function(t) {
        e.add(t);
      });
    else if (t) {
      var r = -1;
      var i = t.length;
      if (n == null) for (; ++r &lt; i; ) e.add(t[r]);
      else for (; ++r &lt; i; ) e.add(n(t[r], r, t));
    }
    return e;
  }
  po.prototype = go.prototype = {
    constructor: po,
    has: vo.has,
    add: function(t) {
      return (this["$" + (t += "")] = t), this;
    },
    remove: vo.remove,
    clear: vo.clear,
    values: vo.keys,
    size: vo.size,
    empty: vo.empty,
    each: vo.each
  };
  var yo = Array.prototype.slice;
  function _o(t, n) {
    return t - n;
  }
  function bo(t) {
    return function() {
      return t;
    };
  }
  function mo(t, n) {
    for (var e, r = -1, i = n.length; ++r &lt; i; )
      if ((e = xo(t, n[r]))) return e;
    return 0;
  }
  function xo(t, n) {
    for (
      var e = n[0], r = n[1], i = -1, o = 0, a = t.length, u = a - 1;
      o &lt; a;
      u = o++
    ) {
      var c = t[o];
      var f = c[0];
      var s = c[1];
      var l = t[u];
      var h = l[0];
      var d = l[1];
      if (wo(c, l, n)) return 0;
      s &gt; r != d &gt; r &amp;&amp; e &lt; ((h - f) * (r - s)) / (d - s) + f &amp;&amp; (i = -i);
    }
    return i;
  }
  function wo(t, n, e) {
    var r;
    var i;
    var o;
    var a;
    return (
      (function(t, n, e) {
        return (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]);
      })(t, n, e) &amp;&amp;
      ((i = t[(r = +(t[0] === n[0]))]),
      (o = e[r]),
      (a = n[r]),
      (i &lt;= o &amp;&amp; o &lt;= a) || (a &lt;= o &amp;&amp; o &lt;= i))
    );
  }
  function Mo() {}
  var No = [
    [],
    [[[1, 1.5], [0.5, 1]]],
    [[[1.5, 1], [1, 1.5]]],
    [[[1.5, 1], [0.5, 1]]],
    [[[1, 0.5], [1.5, 1]]],
    [[[1, 1.5], [0.5, 1]], [[1, 0.5], [1.5, 1]]],
    [[[1, 0.5], [1, 1.5]]],
    [[[1, 0.5], [0.5, 1]]],
    [[[0.5, 1], [1, 0.5]]],
    [[[1, 1.5], [1, 0.5]]],
    [[[0.5, 1], [1, 0.5]], [[1.5, 1], [1, 1.5]]],
    [[[1.5, 1], [1, 0.5]]],
    [[[0.5, 1], [1.5, 1]]],
    [[[1, 1.5], [1.5, 1]]],
    [[[0.5, 1], [1, 1.5]]],
    []
  ];
  function To() {
    var t = 1;
    var n = 1;
    var e = M;
    var r = u;
    function i(t) {
      var n = e(t);
      if (Array.isArray(n)) n = n.slice().sort(_o);
      else {
        var r = s(t);
        var i = r[0];
        var a = r[1];
        (n = w(i, a, n)),
          (n = g(Math.floor(i / n) * n, Math.floor(a / n) * n, n));
      }
      return n.map(function(n) {
        return o(t, n);
      });
    }
    function o(e, i) {
      var o = [];
      var u = [];
      return (
        (function(e, r, i) {
          var o;
          var u;
          var c;
          var f;
          var s;
          var l;
          var h = new Array();
          var d = new Array();
          (o = u = -1), (f = e[0] &gt;= r), No[f &lt;&lt; 1].forEach(p);
          for (; ++o &lt; t - 1; )
            (c = f), (f = e[o + 1] &gt;= r), No[c | (f &lt;&lt; 1)].forEach(p);
          No[f &lt;&lt; 0].forEach(p);
          for (; ++u &lt; n - 1; ) {
            for (
              o = -1,
                f = e[u * t + t] &gt;= r,
                s = e[u * t] &gt;= r,
                No[(f &lt;&lt; 1) | (s &lt;&lt; 2)].forEach(p);
              ++o &lt; t - 1;

            )
              (c = f),
                (f = e[u * t + t + o + 1] &gt;= r),
                (l = s),
                (s = e[u * t + o + 1] &gt;= r),
                No[c | (f &lt;&lt; 1) | (s &lt;&lt; 2) | (l &lt;&lt; 3)].forEach(p);
            No[f | (s &lt;&lt; 3)].forEach(p);
          }
          (o = -1), (s = e[u * t] &gt;= r), No[s &lt;&lt; 2].forEach(p);
          for (; ++o &lt; t - 1; )
            (l = s),
              (s = e[u * t + o + 1] &gt;= r),
              No[(s &lt;&lt; 2) | (l &lt;&lt; 3)].forEach(p);
          function p(t) {
            var n;
            var e;
            var r = [t[0][0] + o, t[0][1] + u];
            var c = [t[1][0] + o, t[1][1] + u];
            var f = a(r);
            var s = a(c);
            (n = d[f])
              ? (e = h[s])
                ? (delete d[n.end],
                  delete h[e.start],
                  n === e
                    ? (n.ring.push(c), i(n.ring))
                    : (h[n.start] = d[e.end] = {
                        start: n.start,
                        end: e.end,
                        ring: n.ring.concat(e.ring)
                      }))
                : (delete d[n.end], n.ring.push(c), (d[(n.end = s)] = n))
              : (n = h[s])
              ? (e = d[f])
                ? (delete h[n.start],
                  delete d[e.end],
                  n === e
                    ? (n.ring.push(c), i(n.ring))
                    : (h[e.start] = d[n.end] = {
                        start: e.start,
                        end: n.end,
                        ring: e.ring.concat(n.ring)
                      }))
                : (delete h[n.start], n.ring.unshift(r), (h[(n.start = f)] = n))
              : (h[f] = d[s] = { start: f, end: s, ring: [r, c] });
          }
          No[s &lt;&lt; 3].forEach(p);
        })(e, i, function(t) {
          r(t, e, i),
            (function(t) {
              for (
                var n = 0,
                  e = t.length,
                  r = t[e - 1][1] * t[0][0] - t[e - 1][0] * t[0][1];
                ++n &lt; e;

              )
                r += t[n - 1][1] * t[n][0] - t[n - 1][0] * t[n][1];
              return r;
            })(t) &gt; 0
              ? o.push([t])
              : u.push(t);
        }),
        u.forEach(function(t) {
          for (var n, e = 0, r = o.length; e &lt; r; ++e)
            if (mo((n = o[e])[0], t) !== -1) return void n.push(t);
        }),
        { type: "MultiPolygon", value: i, coordinates: o }
      );
    }
    function a(n) {
      return 2 * n[0] + n[1] * (t + 1) * 4;
    }
    function u(e, r, i) {
      e.forEach(function(e) {
        var o;
        var a = e[0];
        var u = e[1];
        var c = 0 | a;
        var f = 0 | u;
        var s = r[f * t + c];
        a &gt; 0 &amp;&amp;
          a &lt; t &amp;&amp;
          c === a &amp;&amp;
          ((o = r[f * t + c - 1]), (e[0] = a + (i - o) / (s - o) - 0.5)),
          u &gt; 0 &amp;&amp;
            u &lt; n &amp;&amp;
            f === u &amp;&amp;
            ((o = r[(f - 1) * t + c]), (e[1] = u + (i - o) / (s - o) - 0.5));
      });
    }
    return (
      (i.contour = o),
      (i.size = function(e) {
        if (!arguments.length) return [t, n];
        var r = Math.ceil(e[0]);
        var o = Math.ceil(e[1]);
        if (!(r &gt; 0 &amp;&amp; o &gt; 0)) throw new Error("invalid size");
        return (t = r), (n = o), i;
      }),
      (i.thresholds = function(t) {
        return arguments.length
          ? ((e =
              typeof t === "function"
                ? t
                : Array.isArray(t)
                ? bo(yo.call(t))
                : bo(t)),
            i)
          : e;
      }),
      (i.smooth = function(t) {
        return arguments.length ? ((r = t ? u : Mo), i) : r === u;
      }),
      i
    );
  }
  function Ao(t, n, e) {
    for (var r = t.width, i = t.height, o = 1 + (e &lt;&lt; 1), a = 0; a &lt; i; ++a)
      for (var u = 0, c = 0; u &lt; r + e; ++u)
        u &lt; r &amp;&amp; (c += t.data[u + a * r]),
          u &gt;= e &amp;&amp;
            (u &gt;= o &amp;&amp; (c -= t.data[u - o + a * r]),
            (n.data[u - e + a * r] = c / Math.min(u + 1, r - 1 + o - u, o)));
  }
  function So(t, n, e) {
    for (var r = t.width, i = t.height, o = 1 + (e &lt;&lt; 1), a = 0; a &lt; r; ++a)
      for (var u = 0, c = 0; u &lt; i + e; ++u)
        u &lt; i &amp;&amp; (c += t.data[a + u * r]),
          u &gt;= e &amp;&amp;
            (u &gt;= o &amp;&amp; (c -= t.data[a + (u - o) * r]),
            (n.data[a + (u - e) * r] = c / Math.min(u + 1, i - 1 + o - u, o)));
  }
  function ko(t) {
    return t[0];
  }
  function Eo(t) {
    return t[1];
  }
  function Co() {
    return 1;
  }
  var Po = {};
  var zo = {};
  var Ro = 34;
  var Do = 10;
  var qo = 13;
  function Lo(t) {
    return new Function(
      "d",
      "return {" +
        t
          .map(function(t, n) {
            return JSON.stringify(t) + ": d[" + n + '] || ""';
          })
          .join(",") +
        "}"
    );
  }
  function Uo(t) {
    var n = Object.create(null);
    var e = [];
    return (
      t.forEach(function(t) {
        for (var r in t) r in n || e.push((n[r] = r));
      }),
      e
    );
  }
  function Oo(t, n) {
    var e = t + "";
    var r = e.length;
    return r &lt; n ? new Array(n - r + 1).join(0) + e : e;
  }
  function Bo(t) {
    var n = t.getUTCHours();
    var e = t.getUTCMinutes();
    var r = t.getUTCSeconds();
    var i = t.getUTCMilliseconds();
    return isNaN(t)
      ? "Invalid Date"
      : (function(t) {
          return t &lt; 0 ? "-" + Oo(-t, 6) : t &gt; 9999 ? "+" + Oo(t, 6) : Oo(t, 4);
        })(t.getUTCFullYear()) +
          "-" +
          Oo(t.getUTCMonth() + 1, 2) +
          "-" +
          Oo(t.getUTCDate(), 2) +
          (i
            ? "T" +
              Oo(n, 2) +
              ":" +
              Oo(e, 2) +
              ":" +
              Oo(r, 2) +
              "." +
              Oo(i, 3) +
              "Z"
            : r
            ? "T" + Oo(n, 2) + ":" + Oo(e, 2) + ":" + Oo(r, 2) + "Z"
            : e || n
            ? "T" + Oo(n, 2) + ":" + Oo(e, 2) + "Z"
            : "");
  }
  function Fo(t) {
    var n = new RegExp('["' + t + "\n\r]");
    var e = t.charCodeAt(0);
    function r(t, n) {
      var r;
      var i = [];
      var o = t.length;
      var a = 0;
      var u = 0;
      var c = o &lt;= 0;
      var f = !1;
      function s() {
        if (c) return zo;
        if (f) return (f = !1), Po;
        var n;
        var r;
        var i = a;
        if (t.charCodeAt(i) === Ro) {
          for (
            ;
            (a++ &lt; o &amp;&amp; t.charCodeAt(a) !== Ro) || t.charCodeAt(++a) === Ro;

          );
          return (
            (n = a) &gt;= o
              ? (c = !0)
              : (r = t.charCodeAt(a++)) === Do
              ? (f = !0)
              : r === qo &amp;&amp; ((f = !0), t.charCodeAt(a) === Do &amp;&amp; ++a),
            t.slice(i + 1, n - 1).replace(/""/g, '"')
          );
        }
        for (; a &lt; o; ) {
          if ((r = t.charCodeAt((n = a++))) === Do) f = !0;
          else if (r === qo) (f = !0), t.charCodeAt(a) === Do &amp;&amp; ++a;
          else if (r !== e) continue;
          return t.slice(i, n);
        }
        return (c = !0), t.slice(i, o);
      }
      for (
        t.charCodeAt(o - 1) === Do &amp;&amp; --o, t.charCodeAt(o - 1) === qo &amp;&amp; --o;
        (r = s()) !== zo;

      ) {
        for (var l = []; r !== Po &amp;&amp; r !== zo; ) l.push(r), (r = s());
        (n &amp;&amp; (l = n(l, u++)) == null) || i.push(l);
      }
      return i;
    }
    function i(n, e) {
      return n.map(function(n) {
        return e
          .map(function(t) {
            return a(n[t]);
          })
          .join(t);
      });
    }
    function o(n) {
      return n.map(a).join(t);
    }
    function a(t) {
      return t == null
        ? ""
        : t instanceof Date
        ? Bo(t)
        : n.test((t += ""))
        ? '"' + t.replace(/"/g, '""') + '"'
        : t;
    }
    return {
      parse: function(t, n) {
        var e;
        var i;
        var o = r(t, function(t, r) {
          if (e) return e(t, r - 1);
          (i = t),
            (e = n
              ? (function(t, n) {
                  var e = Lo(t);
                  return function(r, i) {
                    return n(e(r), i, t);
                  };
                })(t, n)
              : Lo(t));
        });
        return (o.columns = i || []), o;
      },
      parseRows: r,
      format: function(n, e) {
        return (
          e == null &amp;&amp; (e = Uo(n)),
          [e.map(a).join(t)].concat(i(n, e)).join("\n")
        );
      },
      formatBody: function(t, n) {
        return n == null &amp;&amp; (n = Uo(t)), i(t, n).join("\n");
      },
      formatRows: function(t) {
        return t.map(o).join("\n");
      },
      formatRow: o,
      formatValue: a
    };
  }
  var Yo = Fo(",");
  var Io = Yo.parse;
  var Ho = Yo.parseRows;
  var jo = Yo.format;
  var Xo = Yo.formatBody;
  var Vo = Yo.formatRows;
  var Go = Yo.formatRow;
  var $o = Yo.formatValue;
  var Wo = Fo("\t");
  var Zo = Wo.parse;
  var Qo = Wo.parseRows;
  var Ko = Wo.format;
  var Jo = Wo.formatBody;
  var ta = Wo.formatRows;
  var na = Wo.formatRow;
  var ea = Wo.formatValue;
  var ra =
    new Date("2019-01-01T00:00").getHours() ||
    new Date("2019-07-01T00:00").getHours();
  function ia(t) {
    if (!t.ok) throw new Error(t.status + " " + t.statusText);
    return t.blob();
  }
  function oa(t) {
    if (!t.ok) throw new Error(t.status + " " + t.statusText);
    return t.arrayBuffer();
  }
  function aa(t) {
    if (!t.ok) throw new Error(t.status + " " + t.statusText);
    return t.text();
  }
  function ua(t, n) {
    return fetch(t, n).then(aa);
  }
  function ca(t) {
    return function(n, e, r) {
      return (
        arguments.length === 2 &amp;&amp;
          typeof e === "function" &amp;&amp;
          ((r = e), (e = void 0)),
        ua(n, e).then(function(n) {
          return t(n, r);
        })
      );
    };
  }
  var fa = ca(Io);
  var sa = ca(Zo);
  function la(t) {
    if (!t.ok) throw new Error(t.status + " " + t.statusText);
    return t.json();
  }
  function ha(t) {
    return function(n, e) {
      return ua(n, e).then(function(n) {
        return new DOMParser().parseFromString(n, t);
      });
    };
  }
  var da = ha("application/xml");
  var pa = ha("text/html");
  var va = ha("image/svg+xml");
  function ga(t) {
    return function() {
      return t;
    };
  }
  function ya() {
    return 1e-6 * (Math.random() - 0.5);
  }
  function _a(t, n, e, r) {
    if (isNaN(n) || isNaN(e)) return t;
    var i;
    var o;
    var a;
    var u;
    var c;
    var f;
    var s;
    var l;
    var h;
    var d = t._root;
    var p = { data: r };
    var v = t._x0;
    var g = t._y0;
    var y = t._x1;
    var _ = t._y1;
    if (!d) return (t._root = p), t;
    for (; d.length; )
      if (
        ((f = n &gt;= (o = (v + y) / 2)) ? (v = o) : (y = o),
        (s = e &gt;= (a = (g + _) / 2)) ? (g = a) : (_ = a),
        (i = d),
        !(d = d[(l = (s &lt;&lt; 1) | f)]))
      )
        return (i[l] = p), t;
    if (
      ((u = +t._x.call(null, d.data)),
      (c = +t._y.call(null, d.data)),
      n === u &amp;&amp; e === c)
    )
      return (p.next = d), i ? (i[l] = p) : (t._root = p), t;
    do {
      (i = i ? (i[l] = new Array(4)) : (t._root = new Array(4))),
        (f = n &gt;= (o = (v + y) / 2)) ? (v = o) : (y = o),
        (s = e &gt;= (a = (g + _) / 2)) ? (g = a) : (_ = a);
    } while ((l = (s &lt;&lt; 1) | f) == (h = ((c &gt;= a) &lt;&lt; 1) | (u &gt;= o)));
    return (i[h] = d), (i[l] = p), t;
  }
  function ba(t, n, e, r, i) {
    (this.node = t), (this.x0 = n), (this.y0 = e), (this.x1 = r), (this.y1 = i);
  }
  function ma(t) {
    return t[0];
  }
  function xa(t) {
    return t[1];
  }
  function wa(t, n, e) {
    var r = new Ma(n == null ? ma : n, e == null ? xa : e, NaN, NaN, NaN, NaN);
    return t == null ? r : r.addAll(t);
  }
  function Ma(t, n, e, r, i, o) {
    (this._x = t),
      (this._y = n),
      (this._x0 = e),
      (this._y0 = r),
      (this._x1 = i),
      (this._y1 = o),
      (this._root = void 0);
  }
  function Na(t) {
    for (var n = { data: t.data }, e = n; (t = t.next); )
      e = e.next = { data: t.data };
    return n;
  }
  var Ta = (wa.prototype = Ma.prototype);
  function Aa(t) {
    return t.x + t.vx;
  }
  function Sa(t) {
    return t.y + t.vy;
  }
  function ka(t) {
    return t.index;
  }
  function Ea(t, n) {
    var e = t.get(n);
    if (!e) throw new Error("missing: " + n);
    return e;
  }
  function Ca(t) {
    return t.x;
  }
  function Pa(t) {
    return t.y;
  }
  (Ta.copy = function() {
    var t;
    var n;
    var e = new Ma(this._x, this._y, this._x0, this._y0, this._x1, this._y1);
    var r = this._root;
    if (!r) return e;
    if (!r.length) return (e._root = Na(r)), e;
    for (t = [{ source: r, target: (e._root = new Array(4)) }]; (r = t.pop()); )
      for (var i = 0; i &lt; 4; ++i)
        (n = r.source[i]) &amp;&amp;
          (n.length
            ? t.push({ source: n, target: (r.target[i] = new Array(4)) })
            : (r.target[i] = Na(n)));
    return e;
  }),
    (Ta.add = function(t) {
      var n = +this._x.call(null, t);
      var e = +this._y.call(null, t);
      return _a(this.cover(n, e), n, e, t);
    }),
    (Ta.addAll = function(t) {
      var n;
      var e;
      var r;
      var i;
      var o = t.length;
      var a = new Array(o);
      var u = new Array(o);
      var c = 1 / 0;
      var f = 1 / 0;
      var s = -1 / 0;
      var l = -1 / 0;
      for (e = 0; e &lt; o; ++e)
        isNaN((r = +this._x.call(null, (n = t[e])))) ||
          isNaN((i = +this._y.call(null, n))) ||
          ((a[e] = r),
          (u[e] = i),
          r &lt; c &amp;&amp; (c = r),
          r &gt; s &amp;&amp; (s = r),
          i &lt; f &amp;&amp; (f = i),
          i &gt; l &amp;&amp; (l = i));
      if (c &gt; s || f &gt; l) return this;
      for (this.cover(c, f).cover(s, l), e = 0; e &lt; o; ++e)
        _a(this, a[e], u[e], t[e]);
      return this;
    }),
    (Ta.cover = function(t, n) {
      if (isNaN((t = +t)) || isNaN((n = +n))) return this;
      var e = this._x0;
      var r = this._y0;
      var i = this._x1;
      var o = this._y1;
      if (isNaN(e))
        (i = (e = Math.floor(t)) + 1), (o = (r = Math.floor(n)) + 1);
      else {
        for (
          var a, u, c = i - e, f = this._root;
          e &gt; t || t &gt;= i || r &gt; n || n &gt;= o;

        )
          switch (
            ((u = ((n &lt; r) &lt;&lt; 1) | (t &lt; e)),
            ((a = new Array(4))[u] = f),
            (f = a),
            (c *= 2),
            u)
          ) {
            case 0:
              (i = e + c), (o = r + c);
              break;
            case 1:
              (e = i - c), (o = r + c);
              break;
            case 2:
              (i = e + c), (r = o - c);
              break;
            case 3:
              (e = i - c), (r = o - c);
          }
        this._root &amp;&amp; this._root.length &amp;&amp; (this._root = f);
      }
      return (
        (this._x0 = e), (this._y0 = r), (this._x1 = i), (this._y1 = o), this
      );
    }),
    (Ta.data = function() {
      var t = [];
      return (
        this.visit(function(n) {
          if (!n.length)
            do {
              t.push(n.data);
            } while ((n = n.next));
        }),
        t
      );
    }),
    (Ta.extent = function(t) {
      return arguments.length
        ? this.cover(+t[0][0], +t[0][1]).cover(+t[1][0], +t[1][1])
        : isNaN(this._x0)
        ? void 0
        : [[this._x0, this._y0], [this._x1, this._y1]];
    }),
    (Ta.find = function(t, n, e) {
      var r;
      var i;
      var o;
      var a;
      var u;
      var c;
      var f;
      var s = this._x0;
      var l = this._y0;
      var h = this._x1;
      var d = this._y1;
      var p = [];
      var v = this._root;
      for (
        v &amp;&amp; p.push(new ba(v, s, l, h, d)),
          e == null
            ? (e = 1 / 0)
            : ((s = t - e), (l = n - e), (h = t + e), (d = n + e), (e *= e));
        (c = p.pop());

      )
        if (
          !(
            !(v = c.node) ||
            (i = c.x0) &gt; h ||
            (o = c.y0) &gt; d ||
            (a = c.x1) &lt; s ||
            (u = c.y1) &lt; l
          )
        )
          if (v.length) {
            var g = (i + a) / 2;
            var y = (o + u) / 2;
            p.push(
              new ba(v[3], g, y, a, u),
              new ba(v[2], i, y, g, u),
              new ba(v[1], g, o, a, y),
              new ba(v[0], i, o, g, y)
            ),
              (f = ((n &gt;= y) &lt;&lt; 1) | (t &gt;= g)) &amp;&amp;
                ((c = p[p.length - 1]),
                (p[p.length - 1] = p[p.length - 1 - f]),
                (p[p.length - 1 - f] = c));
          } else {
            var _ = t - +this._x.call(null, v.data);
            var b = n - +this._y.call(null, v.data);
            var m = _ * _ + b * b;
            if (m &lt; e) {
              var x = Math.sqrt((e = m));
              (s = t - x), (l = n - x), (h = t + x), (d = n + x), (r = v.data);
            }
          }
      return r;
    }),
    (Ta.remove = function(t) {
      if (
        isNaN((o = +this._x.call(null, t))) ||
        isNaN((a = +this._y.call(null, t)))
      )
        return this;
      var n;
      var e;
      var r;
      var i;
      var o;
      var a;
      var u;
      var c;
      var f;
      var s;
      var l;
      var h;
      var d = this._root;
      var p = this._x0;
      var v = this._y0;
      var g = this._x1;
      var y = this._y1;
      if (!d) return this;
      if (d.length)
        for (;;) {
          if (
            ((f = o &gt;= (u = (p + g) / 2)) ? (p = u) : (g = u),
            (s = a &gt;= (c = (v + y) / 2)) ? (v = c) : (y = c),
            (n = d),
            !(d = d[(l = (s &lt;&lt; 1) | f)]))
          )
            return this;
          if (!d.length) break;
          (n[(l + 1) &amp; 3] || n[(l + 2) &amp; 3] || n[(l + 3) &amp; 3]) &amp;&amp;
            ((e = n), (h = l));
        }
      for (; d.data !== t; ) if (((r = d), !(d = d.next))) return this;
      return (
        (i = d.next) &amp;&amp; delete d.next,
        r
          ? (i ? (r.next = i) : delete r.next, this)
          : n
          ? (i ? (n[l] = i) : delete n[l],
            (d = n[0] || n[1] || n[2] || n[3]) &amp;&amp;
              d === (n[3] || n[2] || n[1] || n[0]) &amp;&amp;
              !d.length &amp;&amp;
              (e ? (e[h] = d) : (this._root = d)),
            this)
          : ((this._root = i), this)
      );
    }),
    (Ta.removeAll = function(t) {
      for (var n = 0, e = t.length; n &lt; e; ++n) this.remove(t[n]);
      return this;
    }),
    (Ta.root = function() {
      return this._root;
    }),
    (Ta.size = function() {
      var t = 0;
      return (
        this.visit(function(n) {
          if (!n.length)
            do {
              ++t;
            } while ((n = n.next));
        }),
        t
      );
    }),
    (Ta.visit = function(t) {
      var n;
      var e;
      var r;
      var i;
      var o;
      var a;
      var u = [];
      var c = this._root;
      for (
        c &amp;&amp; u.push(new ba(c, this._x0, this._y0, this._x1, this._y1));
        (n = u.pop());

      )
        if (
          !t((c = n.node), (r = n.x0), (i = n.y0), (o = n.x1), (a = n.y1)) &amp;&amp;
          c.length
        ) {
          var f = (r + o) / 2;
          var s = (i + a) / 2;
          (e = c[3]) &amp;&amp; u.push(new ba(e, f, s, o, a)),
            (e = c[2]) &amp;&amp; u.push(new ba(e, r, s, f, a)),
            (e = c[1]) &amp;&amp; u.push(new ba(e, f, i, o, s)),
            (e = c[0]) &amp;&amp; u.push(new ba(e, r, i, f, s));
        }
      return this;
    }),
    (Ta.visitAfter = function(t) {
      var n;
      var e = [];
      var r = [];
      for (
        this._root &amp;&amp;
        e.push(new ba(this._root, this._x0, this._y0, this._x1, this._y1));
        (n = e.pop());

      ) {
        var i = n.node;
        if (i.length) {
          var o;
          var a = n.x0;
          var u = n.y0;
          var c = n.x1;
          var f = n.y1;
          var s = (a + c) / 2;
          var l = (u + f) / 2;
          (o = i[0]) &amp;&amp; e.push(new ba(o, a, u, s, l)),
            (o = i[1]) &amp;&amp; e.push(new ba(o, s, u, c, l)),
            (o = i[2]) &amp;&amp; e.push(new ba(o, a, l, s, f)),
            (o = i[3]) &amp;&amp; e.push(new ba(o, s, l, c, f));
        }
        r.push(n);
      }
      for (; (n = r.pop()); ) t(n.node, n.x0, n.y0, n.x1, n.y1);
      return this;
    }),
    (Ta.x = function(t) {
      return arguments.length ? ((this._x = t), this) : this._x;
    }),
    (Ta.y = function(t) {
      return arguments.length ? ((this._y = t), this) : this._y;
    });
  var za = 10;
  var Ra = Math.PI * (3 - Math.sqrt(5));
  function Da(t, n) {
    if (
      (e = (t = n ? t.toExponential(n - 1) : t.toExponential()).indexOf("e")) &lt;
      0
    )
      return null;
    var e;
    var r = t.slice(0, e);
    return [r.length &gt; 1 ? r[0] + r.slice(2) : r, +t.slice(e + 1)];
  }
  function qa(t) {
    return (t = Da(Math.abs(t))) ? t[1] : NaN;
  }
  var La;
  var Ua = /^(?:(.)?([&lt;&gt;=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
  function Oa(t) {
    if (!(n = Ua.exec(t))) throw new Error("invalid format: " + t);
    var n;
    return new Ba({
      fill: n[1],
      align: n[2],
      sign: n[3],
      symbol: n[4],
      zero: n[5],
      width: n[6],
      comma: n[7],
      precision: n[8] &amp;&amp; n[8].slice(1),
      trim: n[9],
      type: n[10]
    });
  }
  function Ba(t) {
    (this.fill = void 0 === t.fill ? " " : t.fill + ""),
      (this.align = void 0 === t.align ? "&gt;" : t.align + ""),
      (this.sign = void 0 === t.sign ? "-" : t.sign + ""),
      (this.symbol = void 0 === t.symbol ? "" : t.symbol + ""),
      (this.zero = !!t.zero),
      (this.width = void 0 === t.width ? void 0 : +t.width),
      (this.comma = !!t.comma),
      (this.precision = void 0 === t.precision ? void 0 : +t.precision),
      (this.trim = !!t.trim),
      (this.type = void 0 === t.type ? "" : t.type + "");
  }
  function Fa(t, n) {
    var e = Da(t, n);
    if (!e) return t + "";
    var r = e[0];
    var i = e[1];
    return i &lt; 0
      ? "0." + new Array(-i).join("0") + r
      : r.length &gt; i + 1
      ? r.slice(0, i + 1) + "." + r.slice(i + 1)
      : r + new Array(i - r.length + 2).join("0");
  }
  (Oa.prototype = Ba.prototype),
    (Ba.prototype.toString = function() {
      return (
        this.fill +
        this.align +
        this.sign +
        this.symbol +
        (this.zero ? "0" : "") +
        (void 0 === this.width ? "" : Math.max(1, 0 | this.width)) +
        (this.comma ? "," : "") +
        (void 0 === this.precision
          ? ""
          : "." + Math.max(0, 0 | this.precision)) +
        (this.trim ? "~" : "") +
        this.type
      );
    });
  var Ya = {
    "%": function(t, n) {
      return (100 * t).toFixed(n);
    },
    b: function(t) {
      return Math.round(t).toString(2);
    },
    c: function(t) {
      return t + "";
    },
    d: function(t) {
      return Math.round(t).toString(10);
    },
    e: function(t, n) {
      return t.toExponential(n);
    },
    f: function(t, n) {
      return t.toFixed(n);
    },
    g: function(t, n) {
      return t.toPrecision(n);
    },
    o: function(t) {
      return Math.round(t).toString(8);
    },
    p: function(t, n) {
      return Fa(100 * t, n);
    },
    r: Fa,
    s: function(t, n) {
      var e = Da(t, n);
      if (!e) return t + "";
      var r = e[0];
      var i = e[1];
      var o = i - (La = 3 * Math.max(-8, Math.min(8, Math.floor(i / 3)))) + 1;
      var a = r.length;
      return o === a
        ? r
        : o &gt; a
        ? r + new Array(o - a + 1).join("0")
        : o &gt; 0
        ? r.slice(0, o) + "." + r.slice(o)
        : "0." + new Array(1 - o).join("0") + Da(t, Math.max(0, n + o - 1))[0];
    },
    X: function(t) {
      return Math.round(t)
        .toString(16)
        .toUpperCase();
    },
    x: function(t) {
      return Math.round(t).toString(16);
    }
  };
  function Ia(t) {
    return t;
  }
  var Ha;
  var ja = Array.prototype.map;
  var Xa = [
    "y",
    "z",
    "a",
    "f",
    "p",
    "n",
    "µ",
    "m",
    "",
    "k",
    "M",
    "G",
    "T",
    "P",
    "E",
    "Z",
    "Y"
  ];
  function Va(t) {
    var n;
    var e;
    var r =
      void 0 === t.grouping || void 0 === t.thousands
        ? Ia
        : ((n = ja.call(t.grouping, Number)),
          (e = t.thousands + ""),
          function(t, r) {
            for (
              var i = t.length, o = [], a = 0, u = n[0], c = 0;
              i &gt; 0 &amp;&amp;
              u &gt; 0 &amp;&amp;
              (c + u + 1 &gt; r &amp;&amp; (u = Math.max(1, r - c)),
              o.push(t.substring((i -= u), i + u)),
              !((c += u + 1) &gt; r));

            )
              u = n[(a = (a + 1) % n.length)];
            return o.reverse().join(e);
          });
    var i = void 0 === t.currency ? "" : t.currency[0] + "";
    var o = void 0 === t.currency ? "" : t.currency[1] + "";
    var a = void 0 === t.decimal ? "." : t.decimal + "";
    var u =
      void 0 === t.numerals
        ? Ia
        : (function(t) {
            return function(n) {
              return n.replace(/[0-9]/g, function(n) {
                return t[+n];
              });
            };
          })(ja.call(t.numerals, String));
    var c = void 0 === t.percent ? "%" : t.percent + "";
    var f = void 0 === t.minus ? "-" : t.minus + "";
    var s = void 0 === t.nan ? "NaN" : t.nan + "";
    function l(t) {
      var n = (t = Oa(t)).fill;
      var e = t.align;
      var l = t.sign;
      var h = t.symbol;
      var d = t.zero;
      var p = t.width;
      var v = t.comma;
      var g = t.precision;
      var y = t.trim;
      var _ = t.type;
      _ === "n"
        ? ((v = !0), (_ = "g"))
        : Ya[_] || (void 0 === g &amp;&amp; (g = 12), (y = !0), (_ = "g")),
        (d || (n === "0" &amp;&amp; e === "=")) &amp;&amp; ((d = !0), (n = "0"), (e = "="));
      var b =
        h === "$"
          ? i
          : h === "#" &amp;&amp; /[boxX]/.test(_)
          ? "0" + _.toLowerCase()
          : "";
      var m = h === "$" ? o : /[%p]/.test(_) ? c : "";
      var x = Ya[_];
      var w = /[defgprs%]/.test(_);
      function M(t) {
        var i;
        var o;
        var c;
        var h = b;
        var M = m;
        if (_ === "c") (M = x(t) + M), (t = "");
        else {
          var N = (t = +t) &lt; 0 || 1 / t &lt; 0;
          if (
            ((t = isNaN(t) ? s : x(Math.abs(t), g)),
            y &amp;&amp;
              (t = (function(t) {
                t: for (var n, e = t.length, r = 1, i = -1; r &lt; e; ++r)
                  switch (t[r]) {
                    case ".":
                      i = n = r;
                      break;
                    case "0":
                      i === 0 &amp;&amp; (i = r), (n = r);
                      break;
                    default:
                      if (!+t[r]) break t;
                      i &gt; 0 &amp;&amp; (i = 0);
                  }
                return i &gt; 0 ? t.slice(0, i) + t.slice(n + 1) : t;
              })(t)),
            N &amp;&amp; +t == 0 &amp;&amp; l !== "+" &amp;&amp; (N = !1),
            (h =
              (N ? (l === "(" ? l : f) : l === "-" || l === "(" ? "" : l) + h),
            (M =
              (_ === "s" ? Xa[8 + La / 3] : "") +
              M +
              (N &amp;&amp; l === "(" ? ")" : "")),
            w)
          )
            for (i = -1, o = t.length; ++i &lt; o; )
              if ((c = t.charCodeAt(i)) &lt; 48 || c &gt; 57) {
                (M = (c === 46 ? a + t.slice(i + 1) : t.slice(i)) + M),
                  (t = t.slice(0, i));
                break;
              }
        }
        v &amp;&amp; !d &amp;&amp; (t = r(t, 1 / 0));
        var T = h.length + t.length + M.length;
        var A = T &lt; p ? new Array(p - T + 1).join(n) : "";
        switch (
          (v &amp;&amp;
            d &amp;&amp;
            ((t = r(A + t, A.length ? p - M.length : 1 / 0)), (A = "")),
          e)
        ) {
          case "&lt;":
            t = h + t + M + A;
            break;
          case "=":
            t = h + A + t + M;
            break;
          case "^":
            t = A.slice(0, (T = A.length &gt;&gt; 1)) + h + t + M + A.slice(T);
            break;
          default:
            t = A + h + t + M;
        }
        return u(t);
      }
      return (
        (g =
          void 0 === g
            ? 6
            : /[gprs]/.test(_)
            ? Math.max(1, Math.min(21, g))
            : Math.max(0, Math.min(20, g))),
        (M.toString = function() {
          return t + "";
        }),
        M
      );
    }
    return {
      format: l,
      formatPrefix: function(t, n) {
        var e = l((((t = Oa(t)).type = "f"), t));
        var r = 3 * Math.max(-8, Math.min(8, Math.floor(qa(n) / 3)));
        var i = Math.pow(10, -r);
        var o = Xa[8 + r / 3];
        return function(t) {
          return e(i * t) + o;
        };
      }
    };
  }
  function Ga(n) {
    return (
      (Ha = Va(n)),
      (t.format = Ha.format),
      (t.formatPrefix = Ha.formatPrefix),
      Ha
    );
  }
  function $a(t) {
    return Math.max(0, -qa(Math.abs(t)));
  }
  function Wa(t, n) {
    return Math.max(
      0,
      3 * Math.max(-8, Math.min(8, Math.floor(qa(n) / 3))) - qa(Math.abs(t))
    );
  }
  function Za(t, n) {
    return (
      (t = Math.abs(t)), (n = Math.abs(n) - t), Math.max(0, qa(n) - qa(t)) + 1
    );
  }
  function Qa() {
    return new Ka();
  }
  function Ka() {
    this.reset();
  }
  Ga({
    decimal: ".",
    thousands: ",",
    grouping: [3],
    currency: ["$", ""],
    minus: "-"
  }),
    (Ka.prototype = {
      constructor: Ka,
      reset: function() {
        this.s = this.t = 0;
      },
      add: function(t) {
        tu(Ja, t, this.t),
          tu(this, Ja.s, this.s),
          this.s ? (this.t += Ja.t) : (this.s = Ja.t);
      },
      valueOf: function() {
        return this.s;
      }
    });
  var Ja = new Ka();
  function tu(t, n, e) {
    var r = (t.s = n + e);
    var i = r - n;
    var o = r - i;
    t.t = n - o + (e - i);
  }
  var nu = 1e-6;
  var eu = 1e-12;
  var ru = Math.PI;
  var iu = ru / 2;
  var ou = ru / 4;
  var au = 2 * ru;
  var uu = 180 / ru;
  var cu = ru / 180;
  var fu = Math.abs;
  var su = Math.atan;
  var lu = Math.atan2;
  var hu = Math.cos;
  var du = Math.ceil;
  var pu = Math.exp;
  var vu = Math.log;
  var gu = Math.pow;
  var yu = Math.sin;
  var _u =
    Math.sign ||
    function(t) {
      return t &gt; 0 ? 1 : t &lt; 0 ? -1 : 0;
    };
  var bu = Math.sqrt;
  var mu = Math.tan;
  function xu(t) {
    return t &gt; 1 ? 0 : t &lt; -1 ? ru : Math.acos(t);
  }
  function wu(t) {
    return t &gt; 1 ? iu : t &lt; -1 ? -iu : Math.asin(t);
  }
  function Mu(t) {
    return (t = yu(t / 2)) * t;
  }
  function Nu() {}
  function Tu(t, n) {
    t &amp;&amp; Su.hasOwnProperty(t.type) &amp;&amp; Su[t.type](t, n);
  }
  var Au = {
    Feature: function(t, n) {
      Tu(t.geometry, n);
    },
    FeatureCollection: function(t, n) {
      for (var e = t.features, r = -1, i = e.length; ++r &lt; i; )
        Tu(e[r].geometry, n);
    }
  };
  var Su = {
    Sphere: function(t, n) {
      n.sphere();
    },
    Point: function(t, n) {
      (t = t.coordinates), n.point(t[0], t[1], t[2]);
    },
    MultiPoint: function(t, n) {
      for (var e = t.coordinates, r = -1, i = e.length; ++r &lt; i; )
        (t = e[r]), n.point(t[0], t[1], t[2]);
    },
    LineString: function(t, n) {
      ku(t.coordinates, n, 0);
    },
    MultiLineString: function(t, n) {
      for (var e = t.coordinates, r = -1, i = e.length; ++r &lt; i; )
        ku(e[r], n, 0);
    },
    Polygon: function(t, n) {
      Eu(t.coordinates, n);
    },
    MultiPolygon: function(t, n) {
      for (var e = t.coordinates, r = -1, i = e.length; ++r &lt; i; ) Eu(e[r], n);
    },
    GeometryCollection: function(t, n) {
      for (var e = t.geometries, r = -1, i = e.length; ++r &lt; i; ) Tu(e[r], n);
    }
  };
  function ku(t, n, e) {
    var r;
    var i = -1;
    var o = t.length - e;
    for (n.lineStart(); ++i &lt; o; ) (r = t[i]), n.point(r[0], r[1], r[2]);
    n.lineEnd();
  }
  function Eu(t, n) {
    var e = -1;
    var r = t.length;
    for (n.polygonStart(); ++e &lt; r; ) ku(t[e], n, 1);
    n.polygonEnd();
  }
  function Cu(t, n) {
    t &amp;&amp; Au.hasOwnProperty(t.type) ? Au[t.type](t, n) : Tu(t, n);
  }
  var Pu;
  var zu;
  var Ru;
  var Du;
  var qu;
  var Lu = Qa();
  var Uu = Qa();
  var Ou = {
    point: Nu,
    lineStart: Nu,
    lineEnd: Nu,
    polygonStart: function() {
      Lu.reset(), (Ou.lineStart = Bu), (Ou.lineEnd = Fu);
    },
    polygonEnd: function() {
      var t = +Lu;
      Uu.add(t &lt; 0 ? au + t : t),
        (this.lineStart = this.lineEnd = this.point = Nu);
    },
    sphere: function() {
      Uu.add(au);
    }
  };
  function Bu() {
    Ou.point = Yu;
  }
  function Fu() {
    Iu(Pu, zu);
  }
  function Yu(t, n) {
    (Ou.point = Iu),
      (Pu = t),
      (zu = n),
      (Ru = t *= cu),
      (Du = hu((n = (n *= cu) / 2 + ou))),
      (qu = yu(n));
  }
  function Iu(t, n) {
    var e = (t *= cu) - Ru;
    var r = e &gt;= 0 ? 1 : -1;
    var i = r * e;
    var o = hu((n = (n *= cu) / 2 + ou));
    var a = yu(n);
    var u = qu * a;
    var c = Du * o + u * hu(i);
    var f = u * r * yu(i);
    Lu.add(lu(f, c)), (Ru = t), (Du = o), (qu = a);
  }
  function Hu(t) {
    return [lu(t[1], t[0]), wu(t[2])];
  }
  function ju(t) {
    var n = t[0];
    var e = t[1];
    var r = hu(e);
    return [r * hu(n), r * yu(n), yu(e)];
  }
  function Xu(t, n) {
    return t[0] * n[0] + t[1] * n[1] + t[2] * n[2];
  }
  function Vu(t, n) {
    return [
      t[1] * n[2] - t[2] * n[1],
      t[2] * n[0] - t[0] * n[2],
      t[0] * n[1] - t[1] * n[0]
    ];
  }
  function Gu(t, n) {
    (t[0] += n[0]), (t[1] += n[1]), (t[2] += n[2]);
  }
  function $u(t, n) {
    return [t[0] * n, t[1] * n, t[2] * n];
  }
  function Wu(t) {
    var n = bu(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]);
    (t[0] /= n), (t[1] /= n), (t[2] /= n);
  }
  var Zu;
  var Qu;
  var Ku;
  var Ju;
  var tc;
  var nc;
  var ec;
  var rc;
  var ic;
  var oc;
  var ac;
  var uc;
  var cc;
  var fc;
  var sc;
  var lc;
  var hc;
  var dc;
  var pc;
  var vc;
  var gc;
  var yc;
  var _c;
  var bc;
  var mc;
  var xc;
  var wc = Qa();
  var Mc = {
    point: Nc,
    lineStart: Ac,
    lineEnd: Sc,
    polygonStart: function() {
      (Mc.point = kc),
        (Mc.lineStart = Ec),
        (Mc.lineEnd = Cc),
        wc.reset(),
        Ou.polygonStart();
    },
    polygonEnd: function() {
      Ou.polygonEnd(),
        (Mc.point = Nc),
        (Mc.lineStart = Ac),
        (Mc.lineEnd = Sc),
        Lu &lt; 0
          ? ((Zu = -(Ku = 180)), (Qu = -(Ju = 90)))
          : wc &gt; nu
          ? (Ju = 90)
          : wc &lt; -nu &amp;&amp; (Qu = -90),
        (oc[0] = Zu),
        (oc[1] = Ku);
    },
    sphere: function() {
      (Zu = -(Ku = 180)), (Qu = -(Ju = 90));
    }
  };
  function Nc(t, n) {
    ic.push((oc = [(Zu = t), (Ku = t)])),
      n &lt; Qu &amp;&amp; (Qu = n),
      n &gt; Ju &amp;&amp; (Ju = n);
  }
  function Tc(t, n) {
    var e = ju([t * cu, n * cu]);
    if (rc) {
      var r = Vu(rc, e);
      var i = Vu([r[1], -r[0], 0], r);
      Wu(i), (i = Hu(i));
      var o;
      var a = t - tc;
      var u = a &gt; 0 ? 1 : -1;
      var c = i[0] * uu * u;
      var f = fu(a) &gt; 180;
      f ^ (u * tc &lt; c &amp;&amp; c &lt; u * t)
        ? (o = i[1] * uu) &gt; Ju &amp;&amp; (Ju = o)
        : f ^ (u * tc &lt; (c = ((c + 360) % 360) - 180) &amp;&amp; c &lt; u * t)
        ? (o = -i[1] * uu) &lt; Qu &amp;&amp; (Qu = o)
        : (n &lt; Qu &amp;&amp; (Qu = n), n &gt; Ju &amp;&amp; (Ju = n)),
        f
          ? t &lt; tc
            ? Pc(Zu, t) &gt; Pc(Zu, Ku) &amp;&amp; (Ku = t)
            : Pc(t, Ku) &gt; Pc(Zu, Ku) &amp;&amp; (Zu = t)
          : Ku &gt;= Zu
          ? (t &lt; Zu &amp;&amp; (Zu = t), t &gt; Ku &amp;&amp; (Ku = t))
          : t &gt; tc
          ? Pc(Zu, t) &gt; Pc(Zu, Ku) &amp;&amp; (Ku = t)
          : Pc(t, Ku) &gt; Pc(Zu, Ku) &amp;&amp; (Zu = t);
    } else ic.push((oc = [(Zu = t), (Ku = t)]));
    n &lt; Qu &amp;&amp; (Qu = n), n &gt; Ju &amp;&amp; (Ju = n), (rc = e), (tc = t);
  }
  function Ac() {
    Mc.point = Tc;
  }
  function Sc() {
    (oc[0] = Zu), (oc[1] = Ku), (Mc.point = Nc), (rc = null);
  }
  function kc(t, n) {
    if (rc) {
      var e = t - tc;
      wc.add(fu(e) &gt; 180 ? e + (e &gt; 0 ? 360 : -360) : e);
    } else (nc = t), (ec = n);
    Ou.point(t, n), Tc(t, n);
  }
  function Ec() {
    Ou.lineStart();
  }
  function Cc() {
    kc(nc, ec),
      Ou.lineEnd(),
      fu(wc) &gt; nu &amp;&amp; (Zu = -(Ku = 180)),
      (oc[0] = Zu),
      (oc[1] = Ku),
      (rc = null);
  }
  function Pc(t, n) {
    return (n -= t) &lt; 0 ? n + 360 : n;
  }
  function zc(t, n) {
    return t[0] - n[0];
  }
  function Rc(t, n) {
    return t[0] &lt;= t[1] ? t[0] &lt;= n &amp;&amp; n &lt;= t[1] : n &lt; t[0] || t[1] &lt; n;
  }
  var Dc = {
    sphere: Nu,
    point: qc,
    lineStart: Uc,
    lineEnd: Fc,
    polygonStart: function() {
      (Dc.lineStart = Yc), (Dc.lineEnd = Ic);
    },
    polygonEnd: function() {
      (Dc.lineStart = Uc), (Dc.lineEnd = Fc);
    }
  };
  function qc(t, n) {
    t *= cu;
    var e = hu((n *= cu));
    Lc(e * hu(t), e * yu(t), yu(n));
  }
  function Lc(t, n, e) {
    (cc += (t - cc) / ++ac), (fc += (n - fc) / ac), (sc += (e - sc) / ac);
  }
  function Uc() {
    Dc.point = Oc;
  }
  function Oc(t, n) {
    t *= cu;
    var e = hu((n *= cu));
    (bc = e * hu(t)),
      (mc = e * yu(t)),
      (xc = yu(n)),
      (Dc.point = Bc),
      Lc(bc, mc, xc);
  }
  function Bc(t, n) {
    t *= cu;
    var e = hu((n *= cu));
    var r = e * hu(t);
    var i = e * yu(t);
    var o = yu(n);
    var a = lu(
      bu(
        (a = mc * o - xc * i) * a +
          (a = xc * r - bc * o) * a +
          (a = bc * i - mc * r) * a
      ),
      bc * r + mc * i + xc * o
    );
    (uc += a),
      (lc += a * (bc + (bc = r))),
      (hc += a * (mc + (mc = i))),
      (dc += a * (xc + (xc = o))),
      Lc(bc, mc, xc);
  }
  function Fc() {
    Dc.point = qc;
  }
  function Yc() {
    Dc.point = Hc;
  }
  function Ic() {
    jc(yc, _c), (Dc.point = qc);
  }
  function Hc(t, n) {
    (yc = t), (_c = n), (t *= cu), (n *= cu), (Dc.point = jc);
    var e = hu(n);
    (bc = e * hu(t)), (mc = e * yu(t)), (xc = yu(n)), Lc(bc, mc, xc);
  }
  function jc(t, n) {
    t *= cu;
    var e = hu((n *= cu));
    var r = e * hu(t);
    var i = e * yu(t);
    var o = yu(n);
    var a = mc * o - xc * i;
    var u = xc * r - bc * o;
    var c = bc * i - mc * r;
    var f = bu(a * a + u * u + c * c);
    var s = wu(f);
    var l = f &amp;&amp; -s / f;
    (pc += l * a),
      (vc += l * u),
      (gc += l * c),
      (uc += s),
      (lc += s * (bc + (bc = r))),
      (hc += s * (mc + (mc = i))),
      (dc += s * (xc + (xc = o))),
      Lc(bc, mc, xc);
  }
  function Xc(t) {
    return function() {
      return t;
    };
  }
  function Vc(t, n) {
    function e(e, r) {
      return (e = t(e, r)), n(e[0], e[1]);
    }
    return (
      t.invert &amp;&amp;
        n.invert &amp;&amp;
        (e.invert = function(e, r) {
          return (e = n.invert(e, r)) &amp;&amp; t.invert(e[0], e[1]);
        }),
      e
    );
  }
  function Gc(t, n) {
    return [fu(t) &gt; ru ? t + Math.round(-t / au) * au : t, n];
  }
  function $c(t, n, e) {
    return (t %= au)
      ? n || e
        ? Vc(Zc(t), Qc(n, e))
        : Zc(t)
      : n || e
      ? Qc(n, e)
      : Gc;
  }
  function Wc(t) {
    return function(n, e) {
      return [(n += t) &gt; ru ? n - au : n &lt; -ru ? n + au : n, e];
    };
  }
  function Zc(t) {
    var n = Wc(t);
    return (n.invert = Wc(-t)), n;
  }
  function Qc(t, n) {
    var e = hu(t);
    var r = yu(t);
    var i = hu(n);
    var o = yu(n);
    function a(t, n) {
      var a = hu(n);
      var u = hu(t) * a;
      var c = yu(t) * a;
      var f = yu(n);
      var s = f * e + u * r;
      return [lu(c * i - s * o, u * e - f * r), wu(s * i + c * o)];
    }
    return (
      (a.invert = function(t, n) {
        var a = hu(n);
        var u = hu(t) * a;
        var c = yu(t) * a;
        var f = yu(n);
        var s = f * i - c * o;
        return [lu(c * i + f * o, u * e + s * r), wu(s * e - u * r)];
      }),
      a
    );
  }
  function Kc(t) {
    function n(n) {
      return ((n = t(n[0] * cu, n[1] * cu))[0] *= uu), (n[1] *= uu), n;
    }
    return (
      (t = $c(t[0] * cu, t[1] * cu, t.length &gt; 2 ? t[2] * cu : 0)),
      (n.invert = function(n) {
        return ((n = t.invert(n[0] * cu, n[1] * cu))[0] *= uu), (n[1] *= uu), n;
      }),
      n
    );
  }
  function Jc(t, n, e, r, i, o) {
    if (e) {
      var a = hu(n);
      var u = yu(n);
      var c = r * e;
      i == null
        ? ((i = n + r * au), (o = n - c / 2))
        : ((i = tf(a, i)),
          (o = tf(a, o)),
          (r &gt; 0 ? i &lt; o : i &gt; o) &amp;&amp; (i += r * au));
      for (var f, s = i; r &gt; 0 ? s &gt; o : s &lt; o; s -= c)
        (f = Hu([a, -u * hu(s), -u * yu(s)])), t.point(f[0], f[1]);
    }
  }
  function tf(t, n) {
    ((n = ju(n))[0] -= t), Wu(n);
    var e = xu(-n[1]);
    return ((-n[2] &lt; 0 ? -e : e) + au - nu) % au;
  }
  function nf() {
    var t;
    var n = [];
    return {
      point: function(n, e) {
        t.push([n, e]);
      },
      lineStart: function() {
        n.push((t = []));
      },
      lineEnd: Nu,
      rejoin: function() {
        n.length &gt; 1 &amp;&amp; n.push(n.pop().concat(n.shift()));
      },
      result: function() {
        var e = n;
        return (n = []), (t = null), e;
      }
    };
  }
  function ef(t, n) {
    return fu(t[0] - n[0]) &lt; nu &amp;&amp; fu(t[1] - n[1]) &lt; nu;
  }
  function rf(t, n, e, r) {
    (this.x = t),
      (this.z = n),
      (this.o = e),
      (this.e = r),
      (this.v = !1),
      (this.n = this.p = null);
  }
  function of(t, n, e, r, i) {
    var o;
    var a;
    var u = [];
    var c = [];
    if (
      (t.forEach(function(t) {
        if (!((n = t.length - 1) &lt;= 0)) {
          var n;
          var e;
          var r = t[0];
          var a = t[n];
          if (ef(r, a)) {
            for (i.lineStart(), o = 0; o &lt; n; ++o) i.point((r = t[o])[0], r[1]);
            i.lineEnd();
          } else
            u.push((e = new rf(r, t, null, !0))),
              c.push((e.o = new rf(r, null, e, !1))),
              u.push((e = new rf(a, t, null, !1))),
              c.push((e.o = new rf(a, null, e, !0)));
        }
      }),
      u.length)
    ) {
      for (c.sort(n), af(u), af(c), o = 0, a = c.length; o &lt; a; ++o)
        c[o].e = e = !e;
      for (var f, s, l = u[0]; ; ) {
        for (var h = l, d = !0; h.v; ) if ((h = h.n) === l) return;
        (f = h.z), i.lineStart();
        do {
          if (((h.v = h.o.v = !0), h.e)) {
            if (d)
              for (o = 0, a = f.length; o &lt; a; ++o)
                i.point((s = f[o])[0], s[1]);
            else r(h.x, h.n.x, 1, i);
            h = h.n;
          } else {
            if (d)
              for (f = h.p.z, o = f.length - 1; o &gt;= 0; --o)
                i.point((s = f[o])[0], s[1]);
            else r(h.x, h.p.x, -1, i);
            h = h.p;
          }
          (f = (h = h.o).z), (d = !d);
        } while (!h.v);
        i.lineEnd();
      }
    }
  }
  function af(t) {
    if ((n = t.length)) {
      for (var n, e, r = 0, i = t[0]; ++r &lt; n; )
        (i.n = e = t[r]), (e.p = i), (i = e);
      (i.n = e = t[0]), (e.p = i);
    }
  }
  Gc.invert = Gc;
  var uf = Qa();
  function cf(t) {
    return fu(t[0]) &lt;= ru ? t[0] : _u(t[0]) * (((fu(t[0]) + ru) % au) - ru);
  }
  function ff(t, n) {
    var e = cf(n);
    var r = n[1];
    var i = yu(r);
    var o = [yu(e), -hu(e), 0];
    var a = 0;
    var u = 0;
    uf.reset(), i === 1 ? (r = iu + nu) : i === -1 &amp;&amp; (r = -iu - nu);
    for (var c = 0, f = t.length; c &lt; f; ++c)
      if ((l = (s = t[c]).length))
        for (
          var s,
            l,
            h = s[l - 1],
            d = cf(h),
            p = h[1] / 2 + ou,
            v = yu(p),
            g = hu(p),
            y = 0;
          y &lt; l;
          ++y, d = b, v = x, g = w, h = _
        ) {
          var _ = s[y];
          var b = cf(_);
          var m = _[1] / 2 + ou;
          var x = yu(m);
          var w = hu(m);
          var M = b - d;
          var N = M &gt;= 0 ? 1 : -1;
          var T = N * M;
          var A = T &gt; ru;
          var S = v * x;
          if (
            (uf.add(lu(S * N * yu(T), g * w + S * hu(T))),
            (a += A ? M + N * au : M),
            A ^ (d &gt;= e) ^ (b &gt;= e))
          ) {
            var k = Vu(ju(h), ju(_));
            Wu(k);
            var E = Vu(o, k);
            Wu(E);
            var C = (A ^ (M &gt;= 0) ? -1 : 1) * wu(E[2]);
            (r &gt; C || (r === C &amp;&amp; (k[0] || k[1]))) &amp;&amp;
              (u += A ^ (M &gt;= 0) ? 1 : -1);
          }
        }
    return (a &lt; -nu || (a &lt; nu &amp;&amp; uf &lt; -nu)) ^ (1 &amp; u);
  }
  function sf(t, n, e, r) {
    return function(i) {
      var o;
      var a;
      var u;
      var c = n(i);
      var f = nf();
      var s = n(f);
      var l = !1;
      var h = {
        point: d,
        lineStart: v,
        lineEnd: g,
        polygonStart: function() {
          (h.point = y), (h.lineStart = _), (h.lineEnd = b), (a = []), (o = []);
        },
        polygonEnd: function() {
          (h.point = d), (h.lineStart = v), (h.lineEnd = g), (a = A(a));
          var t = ff(o, r);
          a.length
            ? (l || (i.polygonStart(), (l = !0)), of(a, hf, t, e, i))
            : t &amp;&amp;
              (l || (i.polygonStart(), (l = !0)),
              i.lineStart(),
              e(null, null, 1, i),
              i.lineEnd()),
            l &amp;&amp; (i.polygonEnd(), (l = !1)),
            (a = o = null);
        },
        sphere: function() {
          i.polygonStart(),
            i.lineStart(),
            e(null, null, 1, i),
            i.lineEnd(),
            i.polygonEnd();
        }
      };
      function d(n, e) {
        t(n, e) &amp;&amp; i.point(n, e);
      }
      function p(t, n) {
        c.point(t, n);
      }
      function v() {
        (h.point = p), c.lineStart();
      }
      function g() {
        (h.point = d), c.lineEnd();
      }
      function y(t, n) {
        u.push([t, n]), s.point(t, n);
      }
      function _() {
        s.lineStart(), (u = []);
      }
      function b() {
        y(u[0][0], u[0][1]), s.lineEnd();
        var t;
        var n;
        var e;
        var r;
        var c = s.clean();
        var h = f.result();
        var d = h.length;
        if ((u.pop(), o.push(u), (u = null), d))
          if (1 &amp; c) {
            if ((n = (e = h[0]).length - 1) &gt; 0) {
              for (
                l || (i.polygonStart(), (l = !0)), i.lineStart(), t = 0;
                t &lt; n;
                ++t
              )
                i.point((r = e[t])[0], r[1]);
              i.lineEnd();
            }
          } else
            d &gt; 1 &amp;&amp; 2 &amp; c &amp;&amp; h.push(h.pop().concat(h.shift())),
              a.push(h.filter(lf));
      }
      return h;
    };
  }
  function lf(t) {
    return t.length &gt; 1;
  }
  function hf(t, n) {
    return (
      ((t = t.x)[0] &lt; 0 ? t[1] - iu - nu : iu - t[1]) -
      ((n = n.x)[0] &lt; 0 ? n[1] - iu - nu : iu - n[1])
    );
  }
  var df = sf(
    function() {
      return !0;
    },
    function(t) {
      var n;
      var e = NaN;
      var r = NaN;
      var i = NaN;
      return {
        lineStart: function() {
          t.lineStart(), (n = 1);
        },
        point: function(o, a) {
          var u = o &gt; 0 ? ru : -ru;
          var c = fu(o - e);
          fu(c - ru) &lt; nu
            ? (t.point(e, (r = (r + a) / 2 &gt; 0 ? iu : -iu)),
              t.point(i, r),
              t.lineEnd(),
              t.lineStart(),
              t.point(u, r),
              t.point(o, r),
              (n = 0))
            : i !== u &amp;&amp;
              c &gt;= ru &amp;&amp;
              (fu(e - i) &lt; nu &amp;&amp; (e -= i * nu),
              fu(o - u) &lt; nu &amp;&amp; (o -= u * nu),
              (r = (function(t, n, e, r) {
                var i;
                var o;
                var a = yu(t - e);
                return fu(a) &gt; nu
                  ? su(
                      (yu(n) * (o = hu(r)) * yu(e) -
                        yu(r) * (i = hu(n)) * yu(t)) /
                        (i * o * a)
                    )
                  : (n + r) / 2;
              })(e, r, o, a)),
              t.point(i, r),
              t.lineEnd(),
              t.lineStart(),
              t.point(u, r),
              (n = 0)),
            t.point((e = o), (r = a)),
            (i = u);
        },
        lineEnd: function() {
          t.lineEnd(), (e = r = NaN);
        },
        clean: function() {
          return 2 - n;
        }
      };
    },
    function(t, n, e, r) {
      var i;
      if (t == null)
        (i = e * iu),
          r.point(-ru, i),
          r.point(0, i),
          r.point(ru, i),
          r.point(ru, 0),
          r.point(ru, -i),
          r.point(0, -i),
          r.point(-ru, -i),
          r.point(-ru, 0),
          r.point(-ru, i);
      else if (fu(t[0] - n[0]) &gt; nu) {
        var o = t[0] &lt; n[0] ? ru : -ru;
        (i = (e * o) / 2), r.point(-o, i), r.point(0, i), r.point(o, i);
      } else r.point(n[0], n[1]);
    },
    [-ru, -iu]
  );
  function pf(t) {
    var n = hu(t);
    var e = 6 * cu;
    var r = n &gt; 0;
    var i = fu(n) &gt; nu;
    function o(t, e) {
      return hu(t) * hu(e) &gt; n;
    }
    function a(t, e, r) {
      var i = [1, 0, 0];
      var o = Vu(ju(t), ju(e));
      var a = Xu(o, o);
      var u = o[0];
      var c = a - u * u;
      if (!c) return !r &amp;&amp; t;
      var f = (n * a) / c;
      var s = (-n * u) / c;
      var l = Vu(i, o);
      var h = $u(i, f);
      Gu(h, $u(o, s));
      var d = l;
      var p = Xu(h, d);
      var v = Xu(d, d);
      var g = p * p - v * (Xu(h, h) - 1);
      if (!(g &lt; 0)) {
        var y = bu(g);
        var _ = $u(d, (-p - y) / v);
        if ((Gu(_, h), (_ = Hu(_)), !r)) return _;
        var b;
        var m = t[0];
        var x = e[0];
        var w = t[1];
        var M = e[1];
        x &lt; m &amp;&amp; ((b = m), (m = x), (x = b));
        var N = x - m;
        var T = fu(N - ru) &lt; nu;
        if (
          (!T &amp;&amp; M &lt; w &amp;&amp; ((b = w), (w = M), (M = b)),
          T || N &lt; nu
            ? T
              ? (w + M &gt; 0) ^ (_[1] &lt; (fu(_[0] - m) &lt; nu ? w : M))
              : w &lt;= _[1] &amp;&amp; _[1] &lt;= M
            : (N &gt; ru) ^ (m &lt;= _[0] &amp;&amp; _[0] &lt;= x))
        ) {
          var A = $u(d, (-p + y) / v);
          return Gu(A, h), [_, Hu(A)];
        }
      }
    }
    function u(n, e) {
      var i = r ? t : ru - t;
      var o = 0;
      return (
        n &lt; -i ? (o |= 1) : n &gt; i &amp;&amp; (o |= 2),
        e &lt; -i ? (o |= 4) : e &gt; i &amp;&amp; (o |= 8),
        o
      );
    }
    return sf(
      o,
      function(t) {
        var n;
        var e;
        var c;
        var f;
        var s;
        return {
          lineStart: function() {
            (f = c = !1), (s = 1);
          },
          point: function(l, h) {
            var d;
            var p = [l, h];
            var v = o(l, h);
            var g = r
              ? v
                ? 0
                : u(l, h)
              : v
              ? u(l + (l &lt; 0 ? ru : -ru), h)
              : 0;
            if (
              (!n &amp;&amp; (f = c = v) &amp;&amp; t.lineStart(),
              v !== c &amp;&amp;
                (!(d = a(n, p)) || ef(n, d) || ef(p, d)) &amp;&amp;
                ((p[0] += nu), (p[1] += nu), (v = o(p[0], p[1]))),
              v !== c)
            )
              (s = 0),
                v
                  ? (t.lineStart(), (d = a(p, n)), t.point(d[0], d[1]))
                  : ((d = a(n, p)), t.point(d[0], d[1]), t.lineEnd()),
                (n = d);
            else if (i &amp;&amp; n &amp;&amp; r ^ v) {
              var y;
              g &amp; e ||
                !(y = a(p, n, !0)) ||
                ((s = 0),
                r
                  ? (t.lineStart(),
                    t.point(y[0][0], y[0][1]),
                    t.point(y[1][0], y[1][1]),
                    t.lineEnd())
                  : (t.point(y[1][0], y[1][1]),
                    t.lineEnd(),
                    t.lineStart(),
                    t.point(y[0][0], y[0][1])));
            }
            !v || (n &amp;&amp; ef(n, p)) || t.point(p[0], p[1]),
              (n = p),
              (c = v),
              (e = g);
          },
          lineEnd: function() {
            c &amp;&amp; t.lineEnd(), (n = null);
          },
          clean: function() {
            return s | ((f &amp;&amp; c) &lt;&lt; 1);
          }
        };
      },
      function(n, r, i, o) {
        Jc(o, t, e, i, n, r);
      },
      r ? [0, -t] : [-ru, t - ru]
    );
  }
  var vf = 1e9;
  var gf = -vf;
  function yf(t, n, e, r) {
    function i(i, o) {
      return t &lt;= i &amp;&amp; i &lt;= e &amp;&amp; n &lt;= o &amp;&amp; o &lt;= r;
    }
    function o(i, o, u, f) {
      var s = 0;
      var l = 0;
      if (
        i == null ||
        (s = a(i, u)) !== (l = a(o, u)) ||
        (c(i, o) &lt; 0) ^ (u &gt; 0)
      )
        do {
          f.point(s === 0 || s === 3 ? t : e, s &gt; 1 ? r : n);
        } while ((s = (s + u + 4) % 4) !== l);
      else f.point(o[0], o[1]);
    }
    function a(r, i) {
      return fu(r[0] - t) &lt; nu
        ? i &gt; 0
          ? 0
          : 3
        : fu(r[0] - e) &lt; nu
        ? i &gt; 0
          ? 2
          : 1
        : fu(r[1] - n) &lt; nu
        ? i &gt; 0
          ? 1
          : 0
        : i &gt; 0
        ? 3
        : 2;
    }
    function u(t, n) {
      return c(t.x, n.x);
    }
    function c(t, n) {
      var e = a(t, 1);
      var r = a(n, 1);
      return e !== r
        ? e - r
        : e === 0
        ? n[1] - t[1]
        : e === 1
        ? t[0] - n[0]
        : e === 2
        ? t[1] - n[1]
        : n[0] - t[0];
    }
    return function(a) {
      var c;
      var f;
      var s;
      var l;
      var h;
      var d;
      var p;
      var v;
      var g;
      var y;
      var _;
      var b = a;
      var m = nf();
      var x = {
        point: w,
        lineStart: function() {
          (x.point = M), f &amp;&amp; f.push((s = []));
          (y = !0), (g = !1), (p = v = NaN);
        },
        lineEnd: function() {
          c &amp;&amp; (M(l, h), d &amp;&amp; g &amp;&amp; m.rejoin(), c.push(m.result()));
          (x.point = w), g &amp;&amp; b.lineEnd();
        },
        polygonStart: function() {
          (b = m), (c = []), (f = []), (_ = !0);
        },
        polygonEnd: function() {
          var n = (function() {
            for (var n = 0, e = 0, i = f.length; e &lt; i; ++e)
              for (
                var o,
                  a,
                  u = f[e],
                  c = 1,
                  s = u.length,
                  l = u[0],
                  h = l[0],
                  d = l[1];
                c &lt; s;
                ++c
              )
                (o = h),
                  (a = d),
                  (l = u[c]),
                  (h = l[0]),
                  (d = l[1]),
                  a &lt;= r
                    ? d &gt; r &amp;&amp; (h - o) * (r - a) &gt; (d - a) * (t - o) &amp;&amp; ++n
                    : d &lt;= r &amp;&amp; (h - o) * (r - a) &lt; (d - a) * (t - o) &amp;&amp; --n;
            return n;
          })();
          var e = _ &amp;&amp; n;
          var i = (c = A(c)).length;
          (e || i) &amp;&amp;
            (a.polygonStart(),
            e &amp;&amp; (a.lineStart(), o(null, null, 1, a), a.lineEnd()),
            i &amp;&amp; of(c, u, n, o, a),
            a.polygonEnd());
          (b = a), (c = f = s = null);
        }
      };
      function w(t, n) {
        i(t, n) &amp;&amp; b.point(t, n);
      }
      function M(o, a) {
        var u = i(o, a);
        if ((f &amp;&amp; s.push([o, a]), y))
          (l = o),
            (h = a),
            (d = u),
            (y = !1),
            u &amp;&amp; (b.lineStart(), b.point(o, a));
        else if (u &amp;&amp; g) b.point(o, a);
        else {
          var c = [
            (p = Math.max(gf, Math.min(vf, p))),
            (v = Math.max(gf, Math.min(vf, v)))
          ];
          var m = [
            (o = Math.max(gf, Math.min(vf, o))),
            (a = Math.max(gf, Math.min(vf, a)))
          ];
          !(function(t, n, e, r, i, o) {
            var a;
            var u = t[0];
            var c = t[1];
            var f = 0;
            var s = 1;
            var l = n[0] - u;
            var h = n[1] - c;
            if (((a = e - u), l || !(a &gt; 0))) {
              if (((a /= l), l &lt; 0)) {
                if (a &lt; f) return;
                a &lt; s &amp;&amp; (s = a);
              } else if (l &gt; 0) {
                if (a &gt; s) return;
                a &gt; f &amp;&amp; (f = a);
              }
              if (((a = i - u), l || !(a &lt; 0))) {
                if (((a /= l), l &lt; 0)) {
                  if (a &gt; s) return;
                  a &gt; f &amp;&amp; (f = a);
                } else if (l &gt; 0) {
                  if (a &lt; f) return;
                  a &lt; s &amp;&amp; (s = a);
                }
                if (((a = r - c), h || !(a &gt; 0))) {
                  if (((a /= h), h &lt; 0)) {
                    if (a &lt; f) return;
                    a &lt; s &amp;&amp; (s = a);
                  } else if (h &gt; 0) {
                    if (a &gt; s) return;
                    a &gt; f &amp;&amp; (f = a);
                  }
                  if (((a = o - c), h || !(a &lt; 0))) {
                    if (((a /= h), h &lt; 0)) {
                      if (a &gt; s) return;
                      a &gt; f &amp;&amp; (f = a);
                    } else if (h &gt; 0) {
                      if (a &lt; f) return;
                      a &lt; s &amp;&amp; (s = a);
                    }
                    return (
                      f &gt; 0 &amp;&amp; ((t[0] = u + f * l), (t[1] = c + f * h)),
                      s &lt; 1 &amp;&amp; ((n[0] = u + s * l), (n[1] = c + s * h)),
                      !0
                    );
                  }
                }
              }
            }
          })(c, m, t, n, e, r)
            ? u &amp;&amp; (b.lineStart(), b.point(o, a), (_ = !1))
            : (g || (b.lineStart(), b.point(c[0], c[1])),
              b.point(m[0], m[1]),
              u || b.lineEnd(),
              (_ = !1));
        }
        (p = o), (v = a), (g = u);
      }
      return x;
    };
  }
  var _f;
  var bf;
  var mf;
  var xf = Qa();
  var wf = {
    sphere: Nu,
    point: Nu,
    lineStart: function() {
      (wf.point = Nf), (wf.lineEnd = Mf);
    },
    lineEnd: Nu,
    polygonStart: Nu,
    polygonEnd: Nu
  };
  function Mf() {
    wf.point = wf.lineEnd = Nu;
  }
  function Nf(t, n) {
    (_f = t *= cu), (bf = yu((n *= cu))), (mf = hu(n)), (wf.point = Tf);
  }
  function Tf(t, n) {
    t *= cu;
    var e = yu((n *= cu));
    var r = hu(n);
    var i = fu(t - _f);
    var o = hu(i);
    var a = r * yu(i);
    var u = mf * e - bf * r * o;
    var c = bf * e + mf * r * o;
    xf.add(lu(bu(a * a + u * u), c)), (_f = t), (bf = e), (mf = r);
  }
  function Af(t) {
    return xf.reset(), Cu(t, wf), +xf;
  }
  var Sf = [null, null];
  var kf = { type: "LineString", coordinates: Sf };
  function Ef(t, n) {
    return (Sf[0] = t), (Sf[1] = n), Af(kf);
  }
  var Cf = {
    Feature: function(t, n) {
      return zf(t.geometry, n);
    },
    FeatureCollection: function(t, n) {
      for (var e = t.features, r = -1, i = e.length; ++r &lt; i; )
        if (zf(e[r].geometry, n)) return !0;
      return !1;
    }
  };
  var Pf = {
    Sphere: function() {
      return !0;
    },
    Point: function(t, n) {
      return Rf(t.coordinates, n);
    },
    MultiPoint: function(t, n) {
      for (var e = t.coordinates, r = -1, i = e.length; ++r &lt; i; )
        if (Rf(e[r], n)) return !0;
      return !1;
    },
    LineString: function(t, n) {
      return Df(t.coordinates, n);
    },
    MultiLineString: function(t, n) {
      for (var e = t.coordinates, r = -1, i = e.length; ++r &lt; i; )
        if (Df(e[r], n)) return !0;
      return !1;
    },
    Polygon: function(t, n) {
      return qf(t.coordinates, n);
    },
    MultiPolygon: function(t, n) {
      for (var e = t.coordinates, r = -1, i = e.length; ++r &lt; i; )
        if (qf(e[r], n)) return !0;
      return !1;
    },
    GeometryCollection: function(t, n) {
      for (var e = t.geometries, r = -1, i = e.length; ++r &lt; i; )
        if (zf(e[r], n)) return !0;
      return !1;
    }
  };
  function zf(t, n) {
    return !(!t || !Pf.hasOwnProperty(t.type)) &amp;&amp; Pf[t.type](t, n);
  }
  function Rf(t, n) {
    return Ef(t, n) === 0;
  }
  function Df(t, n) {
    for (var e, r, i, o = 0, a = t.length; o &lt; a; o++) {
      if ((r = Ef(t[o], n)) === 0) return !0;
      if (
        o &gt; 0 &amp;&amp;
        (i = Ef(t[o], t[o - 1])) &gt; 0 &amp;&amp;
        e &lt;= i &amp;&amp;
        r &lt;= i &amp;&amp;
        (e + r - i) * (1 - Math.pow((e - r) / i, 2)) &lt; eu * i
      )
        return !0;
      e = r;
    }
    return !1;
  }
  function qf(t, n) {
    return !!ff(t.map(Lf), Uf(n));
  }
  function Lf(t) {
    return (t = t.map(Uf)).pop(), t;
  }
  function Uf(t) {
    return [t[0] * cu, t[1] * cu];
  }
  function Of(t, n, e) {
    var r = g(t, n - nu, e).concat(n);
    return function(t) {
      return r.map(function(n) {
        return [t, n];
      });
    };
  }
  function Bf(t, n, e) {
    var r = g(t, n - nu, e).concat(n);
    return function(t) {
      return r.map(function(n) {
        return [n, t];
      });
    };
  }
  function Ff() {
    var t;
    var n;
    var e;
    var r;
    var i;
    var o;
    var a;
    var u;
    var c;
    var f;
    var s;
    var l;
    var h = 10;
    var d = h;
    var p = 90;
    var v = 360;
    var y = 2.5;
    function _() {
      return { type: "MultiLineString", coordinates: b() };
    }
    function b() {
      return g(du(r / p) * p, e, p)
        .map(s)
        .concat(g(du(u / v) * v, a, v).map(l))
        .concat(
          g(du(n / h) * h, t, h)
            .filter(function(t) {
              return fu(t % p) &gt; nu;
            })
            .map(c)
        )
        .concat(
          g(du(o / d) * d, i, d)
            .filter(function(t) {
              return fu(t % v) &gt; nu;
            })
            .map(f)
        );
    }
    return (
      (_.lines = function() {
        return b().map(function(t) {
          return { type: "LineString", coordinates: t };
        });
      }),
      (_.outline = function() {
        return {
          type: "Polygon",
          coordinates: [
            s(r).concat(
              l(a).slice(1),
              s(e)
                .reverse()
                .slice(1),
              l(u)
                .reverse()
                .slice(1)
            )
          ]
        };
      }),
      (_.extent = function(t) {
        return arguments.length
          ? _.extentMajor(t).extentMinor(t)
          : _.extentMinor();
      }),
      (_.extentMajor = function(t) {
        return arguments.length
          ? ((r = +t[0][0]),
            (e = +t[1][0]),
            (u = +t[0][1]),
            (a = +t[1][1]),
            r &gt; e &amp;&amp; ((t = r), (r = e), (e = t)),
            u &gt; a &amp;&amp; ((t = u), (u = a), (a = t)),
            _.precision(y))
          : [[r, u], [e, a]];
      }),
      (_.extentMinor = function(e) {
        return arguments.length
          ? ((n = +e[0][0]),
            (t = +e[1][0]),
            (o = +e[0][1]),
            (i = +e[1][1]),
            n &gt; t &amp;&amp; ((e = n), (n = t), (t = e)),
            o &gt; i &amp;&amp; ((e = o), (o = i), (i = e)),
            _.precision(y))
          : [[n, o], [t, i]];
      }),
      (_.step = function(t) {
        return arguments.length ? _.stepMajor(t).stepMinor(t) : _.stepMinor();
      }),
      (_.stepMajor = function(t) {
        return arguments.length ? ((p = +t[0]), (v = +t[1]), _) : [p, v];
      }),
      (_.stepMinor = function(t) {
        return arguments.length ? ((h = +t[0]), (d = +t[1]), _) : [h, d];
      }),
      (_.precision = function(h) {
        return arguments.length
          ? ((y = +h),
            (c = Of(o, i, 90)),
            (f = Bf(n, t, y)),
            (s = Of(u, a, 90)),
            (l = Bf(r, e, y)),
            _)
          : y;
      }),
      _.extentMajor([[-180, -90 + nu], [180, 90 - nu]]).extentMinor([
        [-180, -80 - nu],
        [180, 80 + nu]
      ])
    );
  }
  function Yf(t) {
    return t;
  }
  var If;
  var Hf;
  var jf;
  var Xf;
  var Vf = Qa();
  var Gf = Qa();
  var $f = {
    point: Nu,
    lineStart: Nu,
    lineEnd: Nu,
    polygonStart: function() {
      ($f.lineStart = Wf), ($f.lineEnd = Kf);
    },
    polygonEnd: function() {
      ($f.lineStart = $f.lineEnd = $f.point = Nu), Vf.add(fu(Gf)), Gf.reset();
    },
    result: function() {
      var t = Vf / 2;
      return Vf.reset(), t;
    }
  };
  function Wf() {
    $f.point = Zf;
  }
  function Zf(t, n) {
    ($f.point = Qf), (If = jf = t), (Hf = Xf = n);
  }
  function Qf(t, n) {
    Gf.add(Xf * t - jf * n), (jf = t), (Xf = n);
  }
  function Kf() {
    Qf(If, Hf);
  }
  var Jf = 1 / 0;
  var ts = Jf;
  var ns = -Jf;
  var es = ns;
  var rs = {
    point: function(t, n) {
      t &lt; Jf &amp;&amp; (Jf = t);
      t &gt; ns &amp;&amp; (ns = t);
      n &lt; ts &amp;&amp; (ts = n);
      n &gt; es &amp;&amp; (es = n);
    },
    lineStart: Nu,
    lineEnd: Nu,
    polygonStart: Nu,
    polygonEnd: Nu,
    result: function() {
      var t = [[Jf, ts], [ns, es]];
      return (ns = es = -(ts = Jf = 1 / 0)), t;
    }
  };
  var is;
  var os;
  var as;
  var us;
  var cs = 0;
  var fs = 0;
  var ss = 0;
  var ls = 0;
  var hs = 0;
  var ds = 0;
  var ps = 0;
  var vs = 0;
  var gs = 0;
  var ys = {
    point: _s,
    lineStart: bs,
    lineEnd: ws,
    polygonStart: function() {
      (ys.lineStart = Ms), (ys.lineEnd = Ns);
    },
    polygonEnd: function() {
      (ys.point = _s), (ys.lineStart = bs), (ys.lineEnd = ws);
    },
    result: function() {
      var t = gs
        ? [ps / gs, vs / gs]
        : ds
        ? [ls / ds, hs / ds]
        : ss
        ? [cs / ss, fs / ss]
        : [NaN, NaN];
      return (cs = fs = ss = ls = hs = ds = ps = vs = gs = 0), t;
    }
  };
  function _s(t, n) {
    (cs += t), (fs += n), ++ss;
  }
  function bs() {
    ys.point = ms;
  }
  function ms(t, n) {
    (ys.point = xs), _s((as = t), (us = n));
  }
  function xs(t, n) {
    var e = t - as;
    var r = n - us;
    var i = bu(e * e + r * r);
    (ls += (i * (as + t)) / 2),
      (hs += (i * (us + n)) / 2),
      (ds += i),
      _s((as = t), (us = n));
  }
  function ws() {
    ys.point = _s;
  }
  function Ms() {
    ys.point = Ts;
  }
  function Ns() {
    As(is, os);
  }
  function Ts(t, n) {
    (ys.point = As), _s((is = as = t), (os = us = n));
  }
  function As(t, n) {
    var e = t - as;
    var r = n - us;
    var i = bu(e * e + r * r);
    (ls += (i * (as + t)) / 2),
      (hs += (i * (us + n)) / 2),
      (ds += i),
      (ps += (i = us * t - as * n) * (as + t)),
      (vs += i * (us + n)),
      (gs += 3 * i),
      _s((as = t), (us = n));
  }
  function Ss(t) {
    this._context = t;
  }
  Ss.prototype = {
    _radius: 4.5,
    pointRadius: function(t) {
      return (this._radius = t), this;
    },
    polygonStart: function() {
      this._line = 0;
    },
    polygonEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      this._line === 0 &amp;&amp; this._context.closePath(), (this._point = NaN);
    },
    point: function(t, n) {
      switch (this._point) {
        case 0:
          this._context.moveTo(t, n), (this._point = 1);
          break;
        case 1:
          this._context.lineTo(t, n);
          break;
        default:
          this._context.moveTo(t + this._radius, n),
            this._context.arc(t, n, this._radius, 0, au);
      }
    },
    result: Nu
  };
  var ks;
  var Es;
  var Cs;
  var Ps;
  var zs;
  var Rs = Qa();
  var Ds = {
    point: Nu,
    lineStart: function() {
      Ds.point = qs;
    },
    lineEnd: function() {
      ks &amp;&amp; Ls(Es, Cs), (Ds.point = Nu);
    },
    polygonStart: function() {
      ks = !0;
    },
    polygonEnd: function() {
      ks = null;
    },
    result: function() {
      var t = +Rs;
      return Rs.reset(), t;
    }
  };
  function qs(t, n) {
    (Ds.point = Ls), (Es = Ps = t), (Cs = zs = n);
  }
  function Ls(t, n) {
    (Ps -= t), (zs -= n), Rs.add(bu(Ps * Ps + zs * zs)), (Ps = t), (zs = n);
  }
  function Us() {
    this._string = [];
  }
  function Os(t) {
    return (
      "m0," +
      t +
      "a" +
      t +
      "," +
      t +
      " 0 1,1 0," +
      -2 * t +
      "a" +
      t +
      "," +
      t +
      " 0 1,1 0," +
      2 * t +
      "z"
    );
  }
  function Bs(t) {
    return function(n) {
      var e = new Fs();
      for (var r in t) e[r] = t[r];
      return (e.stream = n), e;
    };
  }
  function Fs() {}
  function Ys(t, n, e) {
    var r = t.clipExtent &amp;&amp; t.clipExtent();
    return (
      t.scale(150).translate([0, 0]),
      r != null &amp;&amp; t.clipExtent(null),
      Cu(e, t.stream(rs)),
      n(rs.result()),
      r != null &amp;&amp; t.clipExtent(r),
      t
    );
  }
  function Is(t, n, e) {
    return Ys(
      t,
      function(e) {
        var r = n[1][0] - n[0][0];
        var i = n[1][1] - n[0][1];
        var o = Math.min(r / (e[1][0] - e[0][0]), i / (e[1][1] - e[0][1]));
        var a = +n[0][0] + (r - o * (e[1][0] + e[0][0])) / 2;
        var u = +n[0][1] + (i - o * (e[1][1] + e[0][1])) / 2;
        t.scale(150 * o).translate([a, u]);
      },
      e
    );
  }
  function Hs(t, n, e) {
    return Is(t, [[0, 0], n], e);
  }
  function js(t, n, e) {
    return Ys(
      t,
      function(e) {
        var r = +n;
        var i = r / (e[1][0] - e[0][0]);
        var o = (r - i * (e[1][0] + e[0][0])) / 2;
        var a = -i * e[0][1];
        t.scale(150 * i).translate([o, a]);
      },
      e
    );
  }
  function Xs(t, n, e) {
    return Ys(
      t,
      function(e) {
        var r = +n;
        var i = r / (e[1][1] - e[0][1]);
        var o = -i * e[0][0];
        var a = (r - i * (e[1][1] + e[0][1])) / 2;
        t.scale(150 * i).translate([o, a]);
      },
      e
    );
  }
  (Us.prototype = {
    _radius: 4.5,
    _circle: Os(4.5),
    pointRadius: function(t) {
      return (
        (t = +t) !== this._radius &amp;&amp;
          ((this._radius = t), (this._circle = null)),
        this
      );
    },
    polygonStart: function() {
      this._line = 0;
    },
    polygonEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      this._line === 0 &amp;&amp; this._string.push("Z"), (this._point = NaN);
    },
    point: function(t, n) {
      switch (this._point) {
        case 0:
          this._string.push("M", t, ",", n), (this._point = 1);
          break;
        case 1:
          this._string.push("L", t, ",", n);
          break;
        default:
          this._circle == null &amp;&amp; (this._circle = Os(this._radius)),
            this._string.push("M", t, ",", n, this._circle);
      }
    },
    result: function() {
      if (this._string.length) {
        var t = this._string.join("");
        return (this._string = []), t;
      }
      return null;
    }
  }),
    (Fs.prototype = {
      constructor: Fs,
      point: function(t, n) {
        this.stream.point(t, n);
      },
      sphere: function() {
        this.stream.sphere();
      },
      lineStart: function() {
        this.stream.lineStart();
      },
      lineEnd: function() {
        this.stream.lineEnd();
      },
      polygonStart: function() {
        this.stream.polygonStart();
      },
      polygonEnd: function() {
        this.stream.polygonEnd();
      }
    });
  var Vs = 16;
  var Gs = hu(30 * cu);
  function $s(t, n) {
    return +n
      ? (function(t, n) {
          function e(r, i, o, a, u, c, f, s, l, h, d, p, v, g) {
            var y = f - r;
            var _ = s - i;
            var b = y * y + _ * _;
            if (b &gt; 4 * n &amp;&amp; v--) {
              var m = a + h;
              var x = u + d;
              var w = c + p;
              var M = bu(m * m + x * x + w * w);
              var N = wu((w /= M));
              var T =
                fu(fu(w) - 1) &lt; nu || fu(o - l) &lt; nu ? (o + l) / 2 : lu(x, m);
              var A = t(T, N);
              var S = A[0];
              var k = A[1];
              var E = S - r;
              var C = k - i;
              var P = _ * E - y * C;
              ((P * P) / b &gt; n ||
                fu((y * E + _ * C) / b - 0.5) &gt; 0.3 ||
                a * h + u * d + c * p &lt; Gs) &amp;&amp;
                (e(r, i, o, a, u, c, S, k, T, (m /= M), (x /= M), w, v, g),
                g.point(S, k),
                e(S, k, T, m, x, w, f, s, l, h, d, p, v, g));
            }
          }
          return function(n) {
            var r;
            var i;
            var o;
            var a;
            var u;
            var c;
            var f;
            var s;
            var l;
            var h;
            var d;
            var p;
            var v = {
              point: g,
              lineStart: y,
              lineEnd: b,
              polygonStart: function() {
                n.polygonStart(), (v.lineStart = m);
              },
              polygonEnd: function() {
                n.polygonEnd(), (v.lineStart = y);
              }
            };
            function g(e, r) {
              (e = t(e, r)), n.point(e[0], e[1]);
            }
            function y() {
              (s = NaN), (v.point = _), n.lineStart();
            }
            function _(r, i) {
              var o = ju([r, i]);
              var a = t(r, i);
              e(
                s,
                l,
                f,
                h,
                d,
                p,
                (s = a[0]),
                (l = a[1]),
                (f = r),
                (h = o[0]),
                (d = o[1]),
                (p = o[2]),
                Vs,
                n
              ),
                n.point(s, l);
            }
            function b() {
              (v.point = g), n.lineEnd();
            }
            function m() {
              y(), (v.point = x), (v.lineEnd = w);
            }
            function x(t, n) {
              _((r = t), n),
                (i = s),
                (o = l),
                (a = h),
                (u = d),
                (c = p),
                (v.point = _);
            }
            function w() {
              e(s, l, f, h, d, p, i, o, r, a, u, c, Vs, n),
                (v.lineEnd = b),
                b();
            }
            return v;
          };
        })(t, n)
      : (function(t) {
          return Bs({
            point: function(n, e) {
              (n = t(n, e)), this.stream.point(n[0], n[1]);
            }
          });
        })(t);
  }
  var Ws = Bs({
    point: function(t, n) {
      this.stream.point(t * cu, n * cu);
    }
  });
  function Zs(t, n, e, r, i, o) {
    var a = hu(o);
    var u = yu(o);
    var c = a * t;
    var f = u * t;
    var s = a / t;
    var l = u / t;
    var h = (u * e - a * n) / t;
    var d = (u * n + a * e) / t;
    function p(t, o) {
      return [c * (t *= r) - f * (o *= i) + n, e - f * t - c * o];
    }
    return (
      (p.invert = function(t, n) {
        return [r * (s * t - l * n + h), i * (d - l * t - s * n)];
      }),
      p
    );
  }
  function Qs(t) {
    return Ks(function() {
      return t;
    })();
  }
  function Ks(t) {
    var n;
    var e;
    var r;
    var i;
    var o;
    var a;
    var u;
    var c;
    var f;
    var s;
    var l = 150;
    var h = 480;
    var d = 250;
    var p = 0;
    var v = 0;
    var g = 0;
    var y = 0;
    var _ = 0;
    var b = 0;
    var m = 1;
    var x = 1;
    var w = null;
    var M = df;
    var N = null;
    var T = Yf;
    var A = 0.5;
    function S(t) {
      return c(t[0] * cu, t[1] * cu);
    }
    function k(t) {
      return (t = c.invert(t[0], t[1])) &amp;&amp; [t[0] * uu, t[1] * uu];
    }
    function E() {
      var t = Zs(l, 0, 0, m, x, b).apply(null, n(p, v));
      var r = (b
        ? Zs
        : function(t, n, e, r, i) {
            function o(o, a) {
              return [n + t * (o *= r), e - t * (a *= i)];
            }
            return (
              (o.invert = function(o, a) {
                return [((o - n) / t) * r, ((e - a) / t) * i];
              }),
              o
            );
          })(l, h - t[0], d - t[1], m, x, b);
      return (
        (e = $c(g, y, _)), (u = Vc(n, r)), (c = Vc(e, u)), (a = $s(u, A)), C()
      );
    }
    function C() {
      return (f = s = null), S;
    }
    return (
      (S.stream = function(t) {
        return f &amp;&amp; s === t
          ? f
          : (f = Ws(
              (function(t) {
                return Bs({
                  point: function(n, e) {
                    var r = t(n, e);
                    return this.stream.point(r[0], r[1]);
                  }
                });
              })(e)(M(a(T((s = t)))))
            ));
      }),
      (S.preclip = function(t) {
        return arguments.length ? ((M = t), (w = void 0), C()) : M;
      }),
      (S.postclip = function(t) {
        return arguments.length ? ((T = t), (N = r = i = o = null), C()) : T;
      }),
      (S.clipAngle = function(t) {
        return arguments.length
          ? ((M = +t ? pf((w = t * cu)) : ((w = null), df)), C())
          : w * uu;
      }),
      (S.clipExtent = function(t) {
        return arguments.length
          ? ((T =
              t == null
                ? ((N = r = i = o = null), Yf)
                : yf(
                    (N = +t[0][0]),
                    (r = +t[0][1]),
                    (i = +t[1][0]),
                    (o = +t[1][1])
                  )),
            C())
          : N == null
          ? null
          : [[N, r], [i, o]];
      }),
      (S.scale = function(t) {
        return arguments.length ? ((l = +t), E()) : l;
      }),
      (S.translate = function(t) {
        return arguments.length ? ((h = +t[0]), (d = +t[1]), E()) : [h, d];
      }),
      (S.center = function(t) {
        return arguments.length
          ? ((p = (t[0] % 360) * cu), (v = (t[1] % 360) * cu), E())
          : [p * uu, v * uu];
      }),
      (S.rotate = function(t) {
        return arguments.length
          ? ((g = (t[0] % 360) * cu),
            (y = (t[1] % 360) * cu),
            (_ = t.length &gt; 2 ? (t[2] % 360) * cu : 0),
            E())
          : [g * uu, y * uu, _ * uu];
      }),
      (S.angle = function(t) {
        return arguments.length ? ((b = (t % 360) * cu), E()) : b * uu;
      }),
      (S.reflectX = function(t) {
        return arguments.length ? ((m = t ? -1 : 1), E()) : m &lt; 0;
      }),
      (S.reflectY = function(t) {
        return arguments.length ? ((x = t ? -1 : 1), E()) : x &lt; 0;
      }),
      (S.precision = function(t) {
        return arguments.length ? ((a = $s(u, (A = t * t))), C()) : bu(A);
      }),
      (S.fitExtent = function(t, n) {
        return Is(S, t, n);
      }),
      (S.fitSize = function(t, n) {
        return Hs(S, t, n);
      }),
      (S.fitWidth = function(t, n) {
        return js(S, t, n);
      }),
      (S.fitHeight = function(t, n) {
        return Xs(S, t, n);
      }),
      function() {
        return (n = t.apply(this, arguments)), (S.invert = n.invert &amp;&amp; k), E();
      }
    );
  }
  function Js(t) {
    var n = 0;
    var e = ru / 3;
    var r = Ks(t);
    var i = r(n, e);
    return (
      (i.parallels = function(t) {
        return arguments.length
          ? r((n = t[0] * cu), (e = t[1] * cu))
          : [n * uu, e * uu];
      }),
      i
    );
  }
  function tl(t, n) {
    var e = yu(t);
    var r = (e + yu(n)) / 2;
    if (fu(r) &lt; nu)
      return (function(t) {
        var n = hu(t);
        function e(t, e) {
          return [t * n, yu(e) / n];
        }
        return (
          (e.invert = function(t, e) {
            return [t / n, wu(e * n)];
          }),
          e
        );
      })(t);
    var i = 1 + e * (2 * r - e);
    var o = bu(i) / r;
    function a(t, n) {
      var e = bu(i - 2 * r * yu(n)) / r;
      return [e * yu((t *= r)), o - e * hu(t)];
    }
    return (
      (a.invert = function(t, n) {
        var e = o - n;
        var a = lu(t, fu(e)) * _u(e);
        return (
          e * r &lt; 0 &amp;&amp; (a -= ru * _u(t) * _u(e)),
          [a / r, wu((i - (t * t + e * e) * r * r) / (2 * r))]
        );
      }),
      a
    );
  }
  function nl() {
    return Js(tl)
      .scale(155.424)
      .center([0, 33.6442]);
  }
  function el() {
    return nl()
      .parallels([29.5, 45.5])
      .scale(1070)
      .translate([480, 250])
      .rotate([96, 0])
      .center([-0.6, 38.7]);
  }
  function rl(t) {
    return function(n, e) {
      var r = hu(n);
      var i = hu(e);
      var o = t(r * i);
      return [o * i * yu(n), o * yu(e)];
    };
  }
  function il(t) {
    return function(n, e) {
      var r = bu(n * n + e * e);
      var i = t(r);
      var o = yu(i);
      var a = hu(i);
      return [lu(n * o, r * a), wu(r &amp;&amp; (e * o) / r)];
    };
  }
  var ol = rl(function(t) {
    return bu(2 / (1 + t));
  });
  ol.invert = il(function(t) {
    return 2 * wu(t / 2);
  });
  var al = rl(function(t) {
    return (t = xu(t)) &amp;&amp; t / yu(t);
  });
  function ul(t, n) {
    return [t, vu(mu((iu + n) / 2))];
  }
  function cl(t) {
    var n;
    var e;
    var r;
    var i = Qs(t);
    var o = i.center;
    var a = i.scale;
    var u = i.translate;
    var c = i.clipExtent;
    var f = null;
    function s() {
      var o = ru * a();
      var u = i(Kc(i.rotate()).invert([0, 0]));
      return c(
        f == null
          ? [[u[0] - o, u[1] - o], [u[0] + o, u[1] + o]]
          : t === ul
          ? [[Math.max(u[0] - o, f), n], [Math.min(u[0] + o, e), r]]
          : [[f, Math.max(u[1] - o, n)], [e, Math.min(u[1] + o, r)]]
      );
    }
    return (
      (i.scale = function(t) {
        return arguments.length ? (a(t), s()) : a();
      }),
      (i.translate = function(t) {
        return arguments.length ? (u(t), s()) : u();
      }),
      (i.center = function(t) {
        return arguments.length ? (o(t), s()) : o();
      }),
      (i.clipExtent = function(t) {
        return arguments.length
          ? (t == null
              ? (f = n = e = r = null)
              : ((f = +t[0][0]),
                (n = +t[0][1]),
                (e = +t[1][0]),
                (r = +t[1][1])),
            s())
          : f == null
          ? null
          : [[f, n], [e, r]];
      }),
      s()
    );
  }
  function fl(t) {
    return mu((iu + t) / 2);
  }
  function sl(t, n) {
    var e = hu(t);
    var r = t === n ? yu(t) : vu(e / hu(n)) / vu(fl(n) / fl(t));
    var i = (e * gu(fl(t), r)) / r;
    if (!r) return ul;
    function o(t, n) {
      i &gt; 0 ? n &lt; -iu + nu &amp;&amp; (n = -iu + nu) : n &gt; iu - nu &amp;&amp; (n = iu - nu);
      var e = i / gu(fl(n), r);
      return [e * yu(r * t), i - e * hu(r * t)];
    }
    return (
      (o.invert = function(t, n) {
        var e = i - n;
        var o = _u(r) * bu(t * t + e * e);
        var a = lu(t, fu(e)) * _u(e);
        return (
          e * r &lt; 0 &amp;&amp; (a -= ru * _u(t) * _u(e)),
          [a / r, 2 * su(gu(i / o, 1 / r)) - iu]
        );
      }),
      o
    );
  }
  function ll(t, n) {
    return [t, n];
  }
  function hl(t, n) {
    var e = hu(t);
    var r = t === n ? yu(t) : (e - hu(n)) / (n - t);
    var i = e / r + t;
    if (fu(r) &lt; nu) return ll;
    function o(t, n) {
      var e = i - n;
      var o = r * t;
      return [e * yu(o), i - e * hu(o)];
    }
    return (
      (o.invert = function(t, n) {
        var e = i - n;
        var o = lu(t, fu(e)) * _u(e);
        return (
          e * r &lt; 0 &amp;&amp; (o -= ru * _u(t) * _u(e)),
          [o / r, i - _u(r) * bu(t * t + e * e)]
        );
      }),
      o
    );
  }
  (al.invert = il(function(t) {
    return t;
  })),
    (ul.invert = function(t, n) {
      return [t, 2 * su(pu(n)) - iu];
    }),
    (ll.invert = ll);
  var dl = 1.340264;
  var pl = -0.081106;
  var vl = 893e-6;
  var gl = 0.003796;
  var yl = bu(3) / 2;
  function _l(t, n) {
    var e = wu(yl * yu(n));
    var r = e * e;
    var i = r * r * r;
    return [
      (t * hu(e)) / (yl * (dl + 3 * pl * r + i * (7 * vl + 9 * gl * r))),
      e * (dl + pl * r + i * (vl + gl * r))
    ];
  }
  function bl(t, n) {
    var e = hu(n);
    var r = hu(t) * e;
    return [(e * yu(t)) / r, yu(n) / r];
  }
  function ml(t, n) {
    var e = n * n;
    var r = e * e;
    return [
      t *
        (0.8707 -
          0.131979 * e +
          r * (r * (0.003971 * e - 0.001529 * r) - 0.013791)),
      n *
        (1.007226 +
          e * (0.015085 + r * (0.028874 * e - 0.044475 - 0.005916 * r)))
    ];
  }
  function xl(t, n) {
    return [hu(n) * yu(t), yu(n)];
  }
  function wl(t, n) {
    var e = hu(n);
    var r = 1 + hu(t) * e;
    return [(e * yu(t)) / r, yu(n) / r];
  }
  function Ml(t, n) {
    return [vu(mu((iu + n) / 2)), -t];
  }
  function Nl(t, n) {
    return t.parent === n.parent ? 1 : 2;
  }
  function Tl(t, n) {
    return t + n.x;
  }
  function Al(t, n) {
    return Math.max(t, n.y);
  }
  function Sl(t) {
    var n = 0;
    var e = t.children;
    var r = e &amp;&amp; e.length;
    if (r) for (; --r &gt;= 0; ) n += e[r].value;
    else n = 1;
    t.value = n;
  }
  function kl(t, n) {
    var e;
    var r;
    var i;
    var o;
    var a;
    var u = new zl(t);
    var c = +t.value &amp;&amp; (u.value = t.value);
    var f = [u];
    for (n == null &amp;&amp; (n = El); (e = f.pop()); )
      if ((c &amp;&amp; (e.value = +e.data.value), (i = n(e.data)) &amp;&amp; (a = i.length)))
        for (e.children = new Array(a), o = a - 1; o &gt;= 0; --o)
          f.push((r = e.children[o] = new zl(i[o]))),
            (r.parent = e),
            (r.depth = e.depth + 1);
    return u.eachBefore(Pl);
  }
  function El(t) {
    return t.children;
  }
  function Cl(t) {
    t.data = t.data.data;
  }
  function Pl(t) {
    var n = 0;
    do {
      t.height = n;
    } while ((t = t.parent) &amp;&amp; t.height &lt; ++n);
  }
  function zl(t) {
    (this.data = t), (this.depth = this.height = 0), (this.parent = null);
  }
  (_l.invert = function(t, n) {
    for (
      var e, r = n, i = r * r, o = i * i * i, a = 0;
      a &lt; 12 &amp;&amp;
      ((o =
        (i =
          (r -= e =
            (r * (dl + pl * i + o * (vl + gl * i)) - n) /
            (dl + 3 * pl * i + o * (7 * vl + 9 * gl * i))) * r) *
        i *
        i),
      !(fu(e) &lt; eu));
      ++a
    );
    return [
      (yl * t * (dl + 3 * pl * i + o * (7 * vl + 9 * gl * i))) / hu(r),
      wu(yu(r) / yl)
    ];
  }),
    (bl.invert = il(su)),
    (ml.invert = function(t, n) {
      var e;
      var r = n;
      var i = 25;
      do {
        var o = r * r;
        var a = o * o;
        r -= e =
          (r *
            (1.007226 +
              o * (0.015085 + a * (0.028874 * o - 0.044475 - 0.005916 * a))) -
            n) /
          (1.007226 +
            o * (0.045255 + a * (0.259866 * o - 0.311325 - 0.005916 * 11 * a)));
      } while (fu(e) &gt; nu &amp;&amp; --i &gt; 0);
      return [
        t /
          (0.8707 +
            (o = r * r) *
              (o * (o * o * o * (0.003971 - 0.001529 * o) - 0.013791) -
                0.131979)),
        r
      ];
    }),
    (xl.invert = il(wu)),
    (wl.invert = il(function(t) {
      return 2 * su(t);
    })),
    (Ml.invert = function(t, n) {
      return [-n, 2 * su(pu(t)) - iu];
    }),
    (zl.prototype = kl.prototype = {
      constructor: zl,
      count: function() {
        return this.eachAfter(Sl);
      },
      each: function(t) {
        var n;
        var e;
        var r;
        var i;
        var o = this;
        var a = [o];
        do {
          for (n = a.reverse(), a = []; (o = n.pop()); )
            if ((t(o), (e = o.children)))
              for (r = 0, i = e.length; r &lt; i; ++r) a.push(e[r]);
        } while (a.length);
        return this;
      },
      eachAfter: function(t) {
        for (var n, e, r, i = this, o = [i], a = []; (i = o.pop()); )
          if ((a.push(i), (n = i.children)))
            for (e = 0, r = n.length; e &lt; r; ++e) o.push(n[e]);
        for (; (i = a.pop()); ) t(i);
        return this;
      },
      eachBefore: function(t) {
        for (var n, e, r = this, i = [r]; (r = i.pop()); )
          if ((t(r), (n = r.children)))
            for (e = n.length - 1; e &gt;= 0; --e) i.push(n[e]);
        return this;
      },
      sum: function(t) {
        return this.eachAfter(function(n) {
          for (
            var e = +t(n.data) || 0, r = n.children, i = r &amp;&amp; r.length;
            --i &gt;= 0;

          )
            e += r[i].value;
          n.value = e;
        });
      },
      sort: function(t) {
        return this.eachBefore(function(n) {
          n.children &amp;&amp; n.children.sort(t);
        });
      },
      path: function(t) {
        for (
          var n = this,
            e = (function(t, n) {
              if (t === n) return t;
              var e = t.ancestors();
              var r = n.ancestors();
              var i = null;
              for (t = e.pop(), n = r.pop(); t === n; )
                (i = t), (t = e.pop()), (n = r.pop());
              return i;
            })(n, t),
            r = [n];
          n !== e;

        )
          (n = n.parent), r.push(n);
        for (var i = r.length; t !== e; ) r.splice(i, 0, t), (t = t.parent);
        return r;
      },
      ancestors: function() {
        for (var t = this, n = [t]; (t = t.parent); ) n.push(t);
        return n;
      },
      descendants: function() {
        var t = [];
        return (
          this.each(function(n) {
            t.push(n);
          }),
          t
        );
      },
      leaves: function() {
        var t = [];
        return (
          this.eachBefore(function(n) {
            n.children || t.push(n);
          }),
          t
        );
      },
      links: function() {
        var t = this;
        var n = [];
        return (
          t.each(function(e) {
            e !== t &amp;&amp; n.push({ source: e.parent, target: e });
          }),
          n
        );
      },
      copy: function() {
        return kl(this).eachBefore(Cl);
      }
    });
  var Rl = Array.prototype.slice;
  function Dl(t) {
    for (
      var n,
        e,
        r = 0,
        i = (t = (function(t) {
          for (var n, e, r = t.length; r; )
            (e = (Math.random() * r--) | 0),
              (n = t[r]),
              (t[r] = t[e]),
              (t[e] = n);
          return t;
        })(Rl.call(t))).length,
        o = [];
      r &lt; i;

    )
      (n = t[r]), e &amp;&amp; Ul(e, n) ? ++r : ((e = Bl((o = ql(o, n)))), (r = 0));
    return e;
  }
  function ql(t, n) {
    var e;
    var r;
    if (Ol(n, t)) return [n];
    for (e = 0; e &lt; t.length; ++e)
      if (Ll(n, t[e]) &amp;&amp; Ol(Fl(t[e], n), t)) return [t[e], n];
    for (e = 0; e &lt; t.length - 1; ++e)
      for (r = e + 1; r &lt; t.length; ++r)
        if (
          Ll(Fl(t[e], t[r]), n) &amp;&amp;
          Ll(Fl(t[e], n), t[r]) &amp;&amp;
          Ll(Fl(t[r], n), t[e]) &amp;&amp;
          Ol(Yl(t[e], t[r], n), t)
        )
          return [t[e], t[r], n];
    throw new Error();
  }
  function Ll(t, n) {
    var e = t.r - n.r;
    var r = n.x - t.x;
    var i = n.y - t.y;
    return e &lt; 0 || e * e &lt; r * r + i * i;
  }
  function Ul(t, n) {
    var e = t.r - n.r + 1e-6;
    var r = n.x - t.x;
    var i = n.y - t.y;
    return e &gt; 0 &amp;&amp; e * e &gt; r * r + i * i;
  }
  function Ol(t, n) {
    for (var e = 0; e &lt; n.length; ++e) if (!Ul(t, n[e])) return !1;
    return !0;
  }
  function Bl(t) {
    switch (t.length) {
      case 1:
        return (function(t) {
          return { x: t.x, y: t.y, r: t.r };
        })(t[0]);
      case 2:
        return Fl(t[0], t[1]);
      case 3:
        return Yl(t[0], t[1], t[2]);
    }
  }
  function Fl(t, n) {
    var e = t.x;
    var r = t.y;
    var i = t.r;
    var o = n.x;
    var a = n.y;
    var u = n.r;
    var c = o - e;
    var f = a - r;
    var s = u - i;
    var l = Math.sqrt(c * c + f * f);
    return {
      x: (e + o + (c / l) * s) / 2,
      y: (r + a + (f / l) * s) / 2,
      r: (l + i + u) / 2
    };
  }
  function Yl(t, n, e) {
    var r = t.x;
    var i = t.y;
    var o = t.r;
    var a = n.x;
    var u = n.y;
    var c = n.r;
    var f = e.x;
    var s = e.y;
    var l = e.r;
    var h = r - a;
    var d = r - f;
    var p = i - u;
    var v = i - s;
    var g = c - o;
    var y = l - o;
    var _ = r * r + i * i - o * o;
    var b = _ - a * a - u * u + c * c;
    var m = _ - f * f - s * s + l * l;
    var x = d * p - h * v;
    var w = (p * m - v * b) / (2 * x) - r;
    var M = (v * g - p * y) / x;
    var N = (d * b - h * m) / (2 * x) - i;
    var T = (h * y - d * g) / x;
    var A = M * M + T * T - 1;
    var S = 2 * (o + w * M + N * T);
    var k = w * w + N * N - o * o;
    var E = -(A ? (S + Math.sqrt(S * S - 4 * A * k)) / (2 * A) : k / S);
    return { x: r + w + M * E, y: i + N + T * E, r: E };
  }
  function Il(t, n, e) {
    var r;
    var i;
    var o;
    var a;
    var u = t.x - n.x;
    var c = t.y - n.y;
    var f = u * u + c * c;
    f
      ? ((i = n.r + e.r),
        (i *= i),
        (a = t.r + e.r),
        i &gt; (a *= a)
          ? ((r = (f + a - i) / (2 * f)),
            (o = Math.sqrt(Math.max(0, a / f - r * r))),
            (e.x = t.x - r * u - o * c),
            (e.y = t.y - r * c + o * u))
          : ((r = (f + i - a) / (2 * f)),
            (o = Math.sqrt(Math.max(0, i / f - r * r))),
            (e.x = n.x + r * u - o * c),
            (e.y = n.y + r * c + o * u)))
      : ((e.x = n.x + e.r), (e.y = n.y));
  }
  function Hl(t, n) {
    var e = t.r + n.r - 1e-6;
    var r = n.x - t.x;
    var i = n.y - t.y;
    return e &gt; 0 &amp;&amp; e * e &gt; r * r + i * i;
  }
  function jl(t) {
    var n = t._;
    var e = t.next._;
    var r = n.r + e.r;
    var i = (n.x * e.r + e.x * n.r) / r;
    var o = (n.y * e.r + e.y * n.r) / r;
    return i * i + o * o;
  }
  function Xl(t) {
    (this._ = t), (this.next = null), (this.previous = null);
  }
  function Vl(t) {
    if (!(i = t.length)) return 0;
    var n;
    var e;
    var r;
    var i;
    var o;
    var a;
    var u;
    var c;
    var f;
    var s;
    var l;
    if ((((n = t[0]).x = 0), (n.y = 0), !(i &gt; 1))) return n.r;
    if (((e = t[1]), (n.x = -e.r), (e.x = n.r), (e.y = 0), !(i &gt; 2)))
      return n.r + e.r;
    Il(e, n, (r = t[2])),
      (n = new Xl(n)),
      (e = new Xl(e)),
      (r = new Xl(r)),
      (n.next = r.previous = e),
      (e.next = n.previous = r),
      (r.next = e.previous = n);
    t: for (u = 3; u &lt; i; ++u) {
      Il(n._, e._, (r = t[u])),
        (r = new Xl(r)),
        (c = e.next),
        (f = n.previous),
        (s = e._.r),
        (l = n._.r);
      do {
        if (s &lt;= l) {
          if (Hl(c._, r._)) {
            (e = c), (n.next = e), (e.previous = n), --u;
            continue t;
          }
          (s += c._.r), (c = c.next);
        } else {
          if (Hl(f._, r._)) {
            ((n = f).next = e), (e.previous = n), --u;
            continue t;
          }
          (l += f._.r), (f = f.previous);
        }
      } while (c !== f.next);
      for (
        r.previous = n, r.next = e, n.next = e.previous = e = r, o = jl(n);
        (r = r.next) !== e;

      )
        (a = jl(r)) &lt; o &amp;&amp; ((n = r), (o = a));
      e = n.next;
    }
    for (n = [e._], r = e; (r = r.next) !== e; ) n.push(r._);
    for (r = Dl(n), u = 0; u &lt; i; ++u) ((n = t[u]).x -= r.x), (n.y -= r.y);
    return r.r;
  }
  function Gl(t) {
    return t == null ? null : $l(t);
  }
  function $l(t) {
    if (typeof t !== "function") throw new Error();
    return t;
  }
  function Wl() {
    return 0;
  }
  function Zl(t) {
    return function() {
      return t;
    };
  }
  function Ql(t) {
    return Math.sqrt(t.value);
  }
  function Kl(t) {
    return function(n) {
      n.children || (n.r = Math.max(0, +t(n) || 0));
    };
  }
  function Jl(t, n) {
    return function(e) {
      if ((r = e.children)) {
        var r;
        var i;
        var o;
        var a = r.length;
        var u = t(e) * n || 0;
        if (u) for (i = 0; i &lt; a; ++i) r[i].r += u;
        if (((o = Vl(r)), u)) for (i = 0; i &lt; a; ++i) r[i].r -= u;
        e.r = o + u;
      }
    };
  }
  function th(t) {
    return function(n) {
      var e = n.parent;
      (n.r *= t), e &amp;&amp; ((n.x = e.x + t * n.x), (n.y = e.y + t * n.y));
    };
  }
  function nh(t) {
    (t.x0 = Math.round(t.x0)),
      (t.y0 = Math.round(t.y0)),
      (t.x1 = Math.round(t.x1)),
      (t.y1 = Math.round(t.y1));
  }
  function eh(t, n, e, r, i) {
    for (
      var o,
        a = t.children,
        u = -1,
        c = a.length,
        f = t.value &amp;&amp; (r - n) / t.value;
      ++u &lt; c;

    )
      ((o = a[u]).y0 = e), (o.y1 = i), (o.x0 = n), (o.x1 = n += o.value * f);
  }
  var rh = "$";
  var ih = { depth: -1 };
  var oh = {};
  function ah(t) {
    return t.id;
  }
  function uh(t) {
    return t.parentId;
  }
  function ch(t, n) {
    return t.parent === n.parent ? 1 : 2;
  }
  function fh(t) {
    var n = t.children;
    return n ? n[0] : t.t;
  }
  function sh(t) {
    var n = t.children;
    return n ? n[n.length - 1] : t.t;
  }
  function lh(t, n, e) {
    var r = e / (n.i - t.i);
    (n.c -= r), (n.s += e), (t.c += r), (n.z += e), (n.m += e);
  }
  function hh(t, n, e) {
    return t.a.parent === n.parent ? t.a : e;
  }
  function dh(t, n) {
    (this._ = t),
      (this.parent = null),
      (this.children = null),
      (this.A = null),
      (this.a = this),
      (this.z = 0),
      (this.m = 0),
      (this.c = 0),
      (this.s = 0),
      (this.t = null),
      (this.i = n);
  }
  function ph(t, n, e, r, i) {
    for (
      var o,
        a = t.children,
        u = -1,
        c = a.length,
        f = t.value &amp;&amp; (i - e) / t.value;
      ++u &lt; c;

    )
      ((o = a[u]).x0 = n), (o.x1 = r), (o.y0 = e), (o.y1 = e += o.value * f);
  }
  dh.prototype = Object.create(zl.prototype);
  var vh = (1 + Math.sqrt(5)) / 2;
  function gh(t, n, e, r, i, o) {
    for (
      var a,
        u,
        c,
        f,
        s,
        l,
        h,
        d,
        p,
        v,
        g,
        y = [],
        _ = n.children,
        b = 0,
        m = 0,
        x = _.length,
        w = n.value;
      b &lt; x;

    ) {
      (c = i - e), (f = o - r);
      do {
        s = _[m++].value;
      } while (!s &amp;&amp; m &lt; x);
      for (
        l = h = s,
          g = s * s * (v = Math.max(f / c, c / f) / (w * t)),
          p = Math.max(h / g, g / l);
        m &lt; x;
        ++m
      ) {
        if (
          ((s += u = _[m].value),
          u &lt; l &amp;&amp; (l = u),
          u &gt; h &amp;&amp; (h = u),
          (g = s * s * v),
          (d = Math.max(h / g, g / l)) &gt; p)
        ) {
          s -= u;
          break;
        }
        p = d;
      }
      y.push((a = { value: s, dice: c &lt; f, children: _.slice(b, m) })),
        a.dice
          ? eh(a, e, r, i, w ? (r += (f * s) / w) : o)
          : ph(a, e, r, w ? (e += (c * s) / w) : i, o),
        (w -= s),
        (b = m);
    }
    return y;
  }
  var yh = (function t(n) {
    function e(t, e, r, i, o) {
      gh(n, t, e, r, i, o);
    }
    return (
      (e.ratio = function(n) {
        return t((n = +n) &gt; 1 ? n : 1);
      }),
      e
    );
  })(vh);
  var _h = (function t(n) {
    function e(t, e, r, i, o) {
      if ((a = t._squarify) &amp;&amp; a.ratio === n)
        for (var a, u, c, f, s, l = -1, h = a.length, d = t.value; ++l &lt; h; ) {
          for (
            c = (u = a[l]).children, f = u.value = 0, s = c.length;
            f &lt; s;
            ++f
          )
            u.value += c[f].value;
          u.dice
            ? eh(u, e, r, i, (r += ((o - r) * u.value) / d))
            : ph(u, e, r, (e += ((i - e) * u.value) / d), o),
            (d -= u.value);
        }
      else (t._squarify = a = gh(n, t, e, r, i, o)), (a.ratio = n);
    }
    return (
      (e.ratio = function(n) {
        return t((n = +n) &gt; 1 ? n : 1);
      }),
      e
    );
  })(vh);
  function bh(t, n, e) {
    return (n[0] - t[0]) * (e[1] - t[1]) - (n[1] - t[1]) * (e[0] - t[0]);
  }
  function mh(t, n) {
    return t[0] - n[0] || t[1] - n[1];
  }
  function xh(t) {
    for (var n = t.length, e = [0, 1], r = 2, i = 2; i &lt; n; ++i) {
      for (; r &gt; 1 &amp;&amp; bh(t[e[r - 2]], t[e[r - 1]], t[i]) &lt;= 0; ) --r;
      e[r++] = i;
    }
    return e.slice(0, r);
  }
  function wh() {
    return Math.random();
  }
  var Mh = (function t(n) {
    function e(t, e) {
      return (
        (t = t == null ? 0 : +t),
        (e = e == null ? 1 : +e),
        arguments.length === 1 ? ((e = t), (t = 0)) : (e -= t),
        function() {
          return n() * e + t;
        }
      );
    }
    return (e.source = t), e;
  })(wh);
  var Nh = (function t(n) {
    function e(t, e) {
      var r;
      var i;
      return (
        (t = t == null ? 0 : +t),
        (e = e == null ? 1 : +e),
        function() {
          var o;
          if (r != null) (o = r), (r = null);
          else
            do {
              (r = 2 * n() - 1), (o = 2 * n() - 1), (i = r * r + o * o);
            } while (!i || i &gt; 1);
          return t + e * o * Math.sqrt((-2 * Math.log(i)) / i);
        }
      );
    }
    return (e.source = t), e;
  })(wh);
  var Th = (function t(n) {
    function e() {
      var t = Nh.source(n).apply(this, arguments);
      return function() {
        return Math.exp(t());
      };
    }
    return (e.source = t), e;
  })(wh);
  var Ah = (function t(n) {
    function e(t) {
      return function() {
        for (var e = 0, r = 0; r &lt; t; ++r) e += n();
        return e;
      };
    }
    return (e.source = t), e;
  })(wh);
  var Sh = (function t(n) {
    function e(t) {
      var e = Ah.source(n)(t);
      return function() {
        return e() / t;
      };
    }
    return (e.source = t), e;
  })(wh);
  var kh = (function t(n) {
    function e(t) {
      return function() {
        return -Math.log(1 - n()) / t;
      };
    }
    return (e.source = t), e;
  })(wh);
  function Eh(t, n) {
    switch (arguments.length) {
      case 0:
        break;
      case 1:
        this.range(t);
        break;
      default:
        this.range(n).domain(t);
    }
    return this;
  }
  function Ch(t, n) {
    switch (arguments.length) {
      case 0:
        break;
      case 1:
        this.interpolator(t);
        break;
      default:
        this.interpolator(n).domain(t);
    }
    return this;
  }
  var Ph = Array.prototype;
  var zh = Ph.map;
  var Rh = Ph.slice;
  var Dh = { name: "implicit" };
  function qh() {
    var t = co();
    var n = [];
    var e = [];
    var r = Dh;
    function i(i) {
      var o = i + "";
      var a = t.get(o);
      if (!a) {
        if (r !== Dh) return r;
        t.set(o, (a = n.push(i)));
      }
      return e[(a - 1) % e.length];
    }
    return (
      (i.domain = function(e) {
        if (!arguments.length) return n.slice();
        (n = []), (t = co());
        for (var r, o, a = -1, u = e.length; ++a &lt; u; )
          t.has((o = (r = e[a]) + "")) || t.set(o, n.push(r));
        return i;
      }),
      (i.range = function(t) {
        return arguments.length ? ((e = Rh.call(t)), i) : e.slice();
      }),
      (i.unknown = function(t) {
        return arguments.length ? ((r = t), i) : r;
      }),
      (i.copy = function() {
        return qh(n, e).unknown(r);
      }),
      Eh.apply(i, arguments),
      i
    );
  }
  function Lh() {
    var t;
    var n;
    var e = qh().unknown(void 0);
    var r = e.domain;
    var i = e.range;
    var o = [0, 1];
    var a = !1;
    var u = 0;
    var c = 0;
    var f = 0.5;
    function s() {
      var e = r().length;
      var s = o[1] &lt; o[0];
      var l = o[s - 0];
      var h = o[1 - s];
      (t = (h - l) / Math.max(1, e - u + 2 * c)),
        a &amp;&amp; (t = Math.floor(t)),
        (l += (h - l - t * (e - u)) * f),
        (n = t * (1 - u)),
        a &amp;&amp; ((l = Math.round(l)), (n = Math.round(n)));
      var d = g(e).map(function(n) {
        return l + t * n;
      });
      return i(s ? d.reverse() : d);
    }
    return (
      delete e.unknown,
      (e.domain = function(t) {
        return arguments.length ? (r(t), s()) : r();
      }),
      (e.range = function(t) {
        return arguments.length ? ((o = [+t[0], +t[1]]), s()) : o.slice();
      }),
      (e.rangeRound = function(t) {
        return (o = [+t[0], +t[1]]), (a = !0), s();
      }),
      (e.bandwidth = function() {
        return n;
      }),
      (e.step = function() {
        return t;
      }),
      (e.round = function(t) {
        return arguments.length ? ((a = !!t), s()) : a;
      }),
      (e.padding = function(t) {
        return arguments.length ? ((u = Math.min(1, (c = +t))), s()) : u;
      }),
      (e.paddingInner = function(t) {
        return arguments.length ? ((u = Math.min(1, t)), s()) : u;
      }),
      (e.paddingOuter = function(t) {
        return arguments.length ? ((c = +t), s()) : c;
      }),
      (e.align = function(t) {
        return arguments.length ? ((f = Math.max(0, Math.min(1, t))), s()) : f;
      }),
      (e.copy = function() {
        return Lh(r(), o)
          .round(a)
          .paddingInner(u)
          .paddingOuter(c)
          .align(f);
      }),
      Eh.apply(s(), arguments)
    );
  }
  function Uh(t) {
    return +t;
  }
  var Oh = [0, 1];
  function Bh(t) {
    return t;
  }
  function Fh(t, n) {
    return (n -= t = +t)
      ? function(e) {
          return (e - t) / n;
        }
      : (function(t) {
          return function() {
            return t;
          };
        })(isNaN(n) ? NaN : 0.5);
  }
  function Yh(t) {
    var n;
    var e = t[0];
    var r = t[t.length - 1];
    return (
      e &gt; r &amp;&amp; ((n = e), (e = r), (r = n)),
      function(t) {
        return Math.max(e, Math.min(r, t));
      }
    );
  }
  function Ih(t, n, e) {
    var r = t[0];
    var i = t[1];
    var o = n[0];
    var a = n[1];
    return (
      i &lt; r ? ((r = Fh(i, r)), (o = e(a, o))) : ((r = Fh(r, i)), (o = e(o, a))),
      function(t) {
        return o(r(t));
      }
    );
  }
  function Hh(t, n, e) {
    var r = Math.min(t.length, n.length) - 1;
    var o = new Array(r);
    var a = new Array(r);
    var u = -1;
    for (
      t[r] &lt; t[0] &amp;&amp; ((t = t.slice().reverse()), (n = n.slice().reverse()));
      ++u &lt; r;

    )
      (o[u] = Fh(t[u], t[u + 1])), (a[u] = e(n[u], n[u + 1]));
    return function(n) {
      var e = i(t, n, 1, r) - 1;
      return a[e](o[e](n));
    };
  }
  function jh(t, n) {
    return n
      .domain(t.domain())
      .range(t.range())
      .interpolate(t.interpolate())
      .clamp(t.clamp())
      .unknown(t.unknown());
  }
  function Xh() {
    var t;
    var n;
    var e;
    var r;
    var i;
    var o;
    var a = Oh;
    var u = Oh;
    var c = Te;
    var f = Bh;
    function s() {
      return (
        (r = Math.min(a.length, u.length) &gt; 2 ? Hh : Ih), (i = o = null), l
      );
    }
    function l(n) {
      return isNaN((n = +n)) ? e : (i || (i = r(a.map(t), u, c)))(t(f(n)));
    }
    return (
      (l.invert = function(e) {
        return f(n((o || (o = r(u, a.map(t), me)))(e)));
      }),
      (l.domain = function(t) {
        return arguments.length
          ? ((a = zh.call(t, Uh)), f === Bh || (f = Yh(a)), s())
          : a.slice();
      }),
      (l.range = function(t) {
        return arguments.length ? ((u = Rh.call(t)), s()) : u.slice();
      }),
      (l.rangeRound = function(t) {
        return (u = Rh.call(t)), (c = Ae), s();
      }),
      (l.clamp = function(t) {
        return arguments.length ? ((f = t ? Yh(a) : Bh), l) : f !== Bh;
      }),
      (l.interpolate = function(t) {
        return arguments.length ? ((c = t), s()) : c;
      }),
      (l.unknown = function(t) {
        return arguments.length ? ((e = t), l) : e;
      }),
      function(e, r) {
        return (t = e), (n = r), s();
      }
    );
  }
  function Vh(t, n) {
    return Xh()(t, n);
  }
  function Gh(n, e, r, i) {
    var o;
    var a = w(n, e, r);
    switch ((i = Oa(i == null ? ",f" : i)).type) {
      case "s":
        var u = Math.max(Math.abs(n), Math.abs(e));
        return (
          i.precision != null || isNaN((o = Wa(a, u))) || (i.precision = o),
          t.formatPrefix(i, u)
        );
      case "":
      case "e":
      case "g":
      case "p":
      case "r":
        i.precision != null ||
          isNaN((o = Za(a, Math.max(Math.abs(n), Math.abs(e))))) ||
          (i.precision = o - (i.type === "e"));
        break;
      case "f":
      case "%":
        i.precision != null ||
          isNaN((o = $a(a))) ||
          (i.precision = o - 2 * (i.type === "%"));
    }
    return t.format(i);
  }
  function $h(t) {
    var n = t.domain;
    return (
      (t.ticks = function(t) {
        var e = n();
        return m(e[0], e[e.length - 1], t == null ? 10 : t);
      }),
      (t.tickFormat = function(t, e) {
        var r = n();
        return Gh(r[0], r[r.length - 1], t == null ? 10 : t, e);
      }),
      (t.nice = function(e) {
        e == null &amp;&amp; (e = 10);
        var r;
        var i = n();
        var o = 0;
        var a = i.length - 1;
        var u = i[o];
        var c = i[a];
        return (
          c &lt; u &amp;&amp; ((r = u), (u = c), (c = r), (r = o), (o = a), (a = r)),
          (r = x(u, c, e)) &gt; 0
            ? (r = x(
                (u = Math.floor(u / r) * r),
                (c = Math.ceil(c / r) * r),
                e
              ))
            : r &lt; 0 &amp;&amp;
              (r = x(
                (u = Math.ceil(u * r) / r),
                (c = Math.floor(c * r) / r),
                e
              )),
          r &gt; 0
            ? ((i[o] = Math.floor(u / r) * r),
              (i[a] = Math.ceil(c / r) * r),
              n(i))
            : r &lt; 0 &amp;&amp;
              ((i[o] = Math.ceil(u * r) / r),
              (i[a] = Math.floor(c * r) / r),
              n(i)),
          t
        );
      }),
      t
    );
  }
  function Wh(t, n) {
    var e;
    var r = 0;
    var i = (t = t.slice()).length - 1;
    var o = t[r];
    var a = t[i];
    return (
      a &lt; o &amp;&amp; ((e = r), (r = i), (i = e), (e = o), (o = a), (a = e)),
      (t[r] = n.floor(o)),
      (t[i] = n.ceil(a)),
      t
    );
  }
  function Zh(t) {
    return Math.log(t);
  }
  function Qh(t) {
    return Math.exp(t);
  }
  function Kh(t) {
    return -Math.log(-t);
  }
  function Jh(t) {
    return -Math.exp(-t);
  }
  function td(t) {
    return isFinite(t) ? +("1e" + t) : t &lt; 0 ? 0 : t;
  }
  function nd(t) {
    return function(n) {
      return -t(-n);
    };
  }
  function ed(n) {
    var e;
    var r;
    var i = n(Zh, Qh);
    var o = i.domain;
    var a = 10;
    function u() {
      return (
        (e = (function(t) {
          return t === Math.E
            ? Math.log
            : (t === 10 &amp;&amp; Math.log10) ||
                (t === 2 &amp;&amp; Math.log2) ||
                ((t = Math.log(t)),
                function(n) {
                  return Math.log(n) / t;
                });
        })(a)),
        (r = (function(t) {
          return t === 10
            ? td
            : t === Math.E
            ? Math.exp
            : function(n) {
                return Math.pow(t, n);
              };
        })(a)),
        o()[0] &lt; 0 ? ((e = nd(e)), (r = nd(r)), n(Kh, Jh)) : n(Zh, Qh),
        i
      );
    }
    return (
      (i.base = function(t) {
        return arguments.length ? ((a = +t), u()) : a;
      }),
      (i.domain = function(t) {
        return arguments.length ? (o(t), u()) : o();
      }),
      (i.ticks = function(t) {
        var n;
        var i = o();
        var u = i[0];
        var c = i[i.length - 1];
        (n = c &lt; u) &amp;&amp; ((h = u), (u = c), (c = h));
        var f;
        var s;
        var l;
        var h = e(u);
        var d = e(c);
        var p = t == null ? 10 : +t;
        var v = [];
        if (!(a % 1) &amp;&amp; d - h &lt; p) {
          if (((h = Math.round(h) - 1), (d = Math.round(d) + 1), u &gt; 0)) {
            for (; h &lt; d; ++h)
              for (s = 1, f = r(h); s &lt; a; ++s)
                if (!((l = f * s) &lt; u)) {
                  if (l &gt; c) break;
                  v.push(l);
                }
          } else
            for (; h &lt; d; ++h)
              for (s = a - 1, f = r(h); s &gt;= 1; --s)
                if (!((l = f * s) &lt; u)) {
                  if (l &gt; c) break;
                  v.push(l);
                }
        } else v = m(h, d, Math.min(d - h, p)).map(r);
        return n ? v.reverse() : v;
      }),
      (i.tickFormat = function(n, o) {
        if (
          (o == null &amp;&amp; (o = a === 10 ? ".0e" : ","),
          typeof o !== "function" &amp;&amp; (o = t.format(o)),
          n === 1 / 0)
        )
          return o;
        n == null &amp;&amp; (n = 10);
        var u = Math.max(1, (a * n) / i.ticks().length);
        return function(t) {
          var n = t / r(Math.round(e(t)));
          return n * a &lt; a - 0.5 &amp;&amp; (n *= a), n &lt;= u ? o(t) : "";
        };
      }),
      (i.nice = function() {
        return o(
          Wh(o(), {
            floor: function(t) {
              return r(Math.floor(e(t)));
            },
            ceil: function(t) {
              return r(Math.ceil(e(t)));
            }
          })
        );
      }),
      i
    );
  }
  function rd(t) {
    return function(n) {
      return Math.sign(n) * Math.log1p(Math.abs(n / t));
    };
  }
  function id(t) {
    return function(n) {
      return Math.sign(n) * Math.expm1(Math.abs(n)) * t;
    };
  }
  function od(t) {
    var n = 1;
    var e = t(rd(n), id(n));
    return (
      (e.constant = function(e) {
        return arguments.length ? t(rd((n = +e)), id(n)) : n;
      }),
      $h(e)
    );
  }
  function ad(t) {
    return function(n) {
      return n &lt; 0 ? -Math.pow(-n, t) : Math.pow(n, t);
    };
  }
  function ud(t) {
    return t &lt; 0 ? -Math.sqrt(-t) : Math.sqrt(t);
  }
  function cd(t) {
    return t &lt; 0 ? -t * t : t * t;
  }
  function fd(t) {
    var n = t(Bh, Bh);
    var e = 1;
    function r() {
      return e === 1 ? t(Bh, Bh) : e === 0.5 ? t(ud, cd) : t(ad(e), ad(1 / e));
    }
    return (
      (n.exponent = function(t) {
        return arguments.length ? ((e = +t), r()) : e;
      }),
      $h(n)
    );
  }
  function sd() {
    var t = fd(Xh());
    return (
      (t.copy = function() {
        return jh(t, sd()).exponent(t.exponent());
      }),
      Eh.apply(t, arguments),
      t
    );
  }
  var ld = new Date();
  var hd = new Date();
  function dd(t, n, e, r) {
    function i(n) {
      return t((n = arguments.length === 0 ? new Date() : new Date(+n))), n;
    }
    return (
      (i.floor = function(n) {
        return t((n = new Date(+n))), n;
      }),
      (i.ceil = function(e) {
        return t((e = new Date(e - 1))), n(e, 1), t(e), e;
      }),
      (i.round = function(t) {
        var n = i(t);
        var e = i.ceil(t);
        return t - n &lt; e - t ? n : e;
      }),
      (i.offset = function(t, e) {
        return n((t = new Date(+t)), e == null ? 1 : Math.floor(e)), t;
      }),
      (i.range = function(e, r, o) {
        var a;
        var u = [];
        if (
          ((e = i.ceil(e)),
          (o = o == null ? 1 : Math.floor(o)),
          !(e &lt; r &amp;&amp; o &gt; 0))
        )
          return u;
        do {
          u.push((a = new Date(+e))), n(e, o), t(e);
        } while (a &lt; e &amp;&amp; e &lt; r);
        return u;
      }),
      (i.filter = function(e) {
        return dd(
          function(n) {
            if (n &gt;= n) for (; t(n), !e(n); ) n.setTime(n - 1);
          },
          function(t, r) {
            if (t &gt;= t)
              if (r &lt; 0) for (; ++r &lt;= 0; ) for (; n(t, -1), !e(t); );
              else for (; --r &gt;= 0; ) for (; n(t, 1), !e(t); );
          }
        );
      }),
      e &amp;&amp;
        ((i.count = function(n, r) {
          return (
            ld.setTime(+n), hd.setTime(+r), t(ld), t(hd), Math.floor(e(ld, hd))
          );
        }),
        (i.every = function(t) {
          return (
            (t = Math.floor(t)),
            isFinite(t) &amp;&amp; t &gt; 0
              ? t &gt; 1
                ? i.filter(
                    r
                      ? function(n) {
                          return r(n) % t == 0;
                        }
                      : function(n) {
                          return i.count(0, n) % t == 0;
                        }
                  )
                : i
              : null
          );
        })),
      i
    );
  }
  var pd = dd(
    function() {},
    function(t, n) {
      t.setTime(+t + n);
    },
    function(t, n) {
      return n - t;
    }
  );
  pd.every = function(t) {
    return (
      (t = Math.floor(t)),
      isFinite(t) &amp;&amp; t &gt; 0
        ? t &gt; 1
          ? dd(
              function(n) {
                n.setTime(Math.floor(n / t) * t);
              },
              function(n, e) {
                n.setTime(+n + e * t);
              },
              function(n, e) {
                return (e - n) / t;
              }
            )
          : pd
        : null
    );
  };
  var vd = pd.range;
  var gd = 6e4;
  var yd = 6048e5;
  var _d = dd(
    function(t) {
      t.setTime(t - t.getMilliseconds());
    },
    function(t, n) {
      t.setTime(+t + 1e3 * n);
    },
    function(t, n) {
      return (n - t) / 1e3;
    },
    function(t) {
      return t.getUTCSeconds();
    }
  );
  var bd = _d.range;
  var md = dd(
    function(t) {
      t.setTime(t - t.getMilliseconds() - 1e3 * t.getSeconds());
    },
    function(t, n) {
      t.setTime(+t + n * gd);
    },
    function(t, n) {
      return (n - t) / gd;
    },
    function(t) {
      return t.getMinutes();
    }
  );
  var xd = md.range;
  var wd = dd(
    function(t) {
      t.setTime(
        t - t.getMilliseconds() - 1e3 * t.getSeconds() - t.getMinutes() * gd
      );
    },
    function(t, n) {
      t.setTime(+t + 36e5 * n);
    },
    function(t, n) {
      return (n - t) / 36e5;
    },
    function(t) {
      return t.getHours();
    }
  );
  var Md = wd.range;
  var Nd = dd(
    function(t) {
      t.setHours(0, 0, 0, 0);
    },
    function(t, n) {
      t.setDate(t.getDate() + n);
    },
    function(t, n) {
      return (
        (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * gd) / 864e5
      );
    },
    function(t) {
      return t.getDate() - 1;
    }
  );
  var Td = Nd.range;
  function Ad(t) {
    return dd(
      function(n) {
        n.setDate(n.getDate() - ((n.getDay() + 7 - t) % 7)),
          n.setHours(0, 0, 0, 0);
      },
      function(t, n) {
        t.setDate(t.getDate() + 7 * n);
      },
      function(t, n) {
        return (
          (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * gd) / yd
        );
      }
    );
  }
  var Sd = Ad(0);
  var kd = Ad(1);
  var Ed = Ad(2);
  var Cd = Ad(3);
  var Pd = Ad(4);
  var zd = Ad(5);
  var Rd = Ad(6);
  var Dd = Sd.range;
  var qd = kd.range;
  var Ld = Ed.range;
  var Ud = Cd.range;
  var Od = Pd.range;
  var Bd = zd.range;
  var Fd = Rd.range;
  var Yd = dd(
    function(t) {
      t.setDate(1), t.setHours(0, 0, 0, 0);
    },
    function(t, n) {
      t.setMonth(t.getMonth() + n);
    },
    function(t, n) {
      return (
        n.getMonth() - t.getMonth() + 12 * (n.getFullYear() - t.getFullYear())
      );
    },
    function(t) {
      return t.getMonth();
    }
  );
  var Id = Yd.range;
  var Hd = dd(
    function(t) {
      t.setMonth(0, 1), t.setHours(0, 0, 0, 0);
    },
    function(t, n) {
      t.setFullYear(t.getFullYear() + n);
    },
    function(t, n) {
      return n.getFullYear() - t.getFullYear();
    },
    function(t) {
      return t.getFullYear();
    }
  );
  Hd.every = function(t) {
    return isFinite((t = Math.floor(t))) &amp;&amp; t &gt; 0
      ? dd(
          function(n) {
            n.setFullYear(Math.floor(n.getFullYear() / t) * t),
              n.setMonth(0, 1),
              n.setHours(0, 0, 0, 0);
          },
          function(n, e) {
            n.setFullYear(n.getFullYear() + e * t);
          }
        )
      : null;
  };
  var jd = Hd.range;
  var Xd = dd(
    function(t) {
      t.setUTCSeconds(0, 0);
    },
    function(t, n) {
      t.setTime(+t + n * gd);
    },
    function(t, n) {
      return (n - t) / gd;
    },
    function(t) {
      return t.getUTCMinutes();
    }
  );
  var Vd = Xd.range;
  var Gd = dd(
    function(t) {
      t.setUTCMinutes(0, 0, 0);
    },
    function(t, n) {
      t.setTime(+t + 36e5 * n);
    },
    function(t, n) {
      return (n - t) / 36e5;
    },
    function(t) {
      return t.getUTCHours();
    }
  );
  var $d = Gd.range;
  var Wd = dd(
    function(t) {
      t.setUTCHours(0, 0, 0, 0);
    },
    function(t, n) {
      t.setUTCDate(t.getUTCDate() + n);
    },
    function(t, n) {
      return (n - t) / 864e5;
    },
    function(t) {
      return t.getUTCDate() - 1;
    }
  );
  var Zd = Wd.range;
  function Qd(t) {
    return dd(
      function(n) {
        n.setUTCDate(n.getUTCDate() - ((n.getUTCDay() + 7 - t) % 7)),
          n.setUTCHours(0, 0, 0, 0);
      },
      function(t, n) {
        t.setUTCDate(t.getUTCDate() + 7 * n);
      },
      function(t, n) {
        return (n - t) / yd;
      }
    );
  }
  var Kd = Qd(0);
  var Jd = Qd(1);
  var tp = Qd(2);
  var np = Qd(3);
  var ep = Qd(4);
  var rp = Qd(5);
  var ip = Qd(6);
  var op = Kd.range;
  var ap = Jd.range;
  var up = tp.range;
  var cp = np.range;
  var fp = ep.range;
  var sp = rp.range;
  var lp = ip.range;
  var hp = dd(
    function(t) {
      t.setUTCDate(1), t.setUTCHours(0, 0, 0, 0);
    },
    function(t, n) {
      t.setUTCMonth(t.getUTCMonth() + n);
    },
    function(t, n) {
      return (
        n.getUTCMonth() -
        t.getUTCMonth() +
        12 * (n.getUTCFullYear() - t.getUTCFullYear())
      );
    },
    function(t) {
      return t.getUTCMonth();
    }
  );
  var dp = hp.range;
  var pp = dd(
    function(t) {
      t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0);
    },
    function(t, n) {
      t.setUTCFullYear(t.getUTCFullYear() + n);
    },
    function(t, n) {
      return n.getUTCFullYear() - t.getUTCFullYear();
    },
    function(t) {
      return t.getUTCFullYear();
    }
  );
  pp.every = function(t) {
    return isFinite((t = Math.floor(t))) &amp;&amp; t &gt; 0
      ? dd(
          function(n) {
            n.setUTCFullYear(Math.floor(n.getUTCFullYear() / t) * t),
              n.setUTCMonth(0, 1),
              n.setUTCHours(0, 0, 0, 0);
          },
          function(n, e) {
            n.setUTCFullYear(n.getUTCFullYear() + e * t);
          }
        )
      : null;
  };
  var vp = pp.range;
  function gp(t) {
    if (t.y &gt;= 0 &amp;&amp; t.y &lt; 100) {
      var n = new Date(-1, t.m, t.d, t.H, t.M, t.S, t.L);
      return n.setFullYear(t.y), n;
    }
    return new Date(t.y, t.m, t.d, t.H, t.M, t.S, t.L);
  }
  function yp(t) {
    if (t.y &gt;= 0 &amp;&amp; t.y &lt; 100) {
      var n = new Date(Date.UTC(-1, t.m, t.d, t.H, t.M, t.S, t.L));
      return n.setUTCFullYear(t.y), n;
    }
    return new Date(Date.UTC(t.y, t.m, t.d, t.H, t.M, t.S, t.L));
  }
  function _p(t, n, e) {
    return { y: t, m: n, d: e, H: 0, M: 0, S: 0, L: 0 };
  }
  function bp(t) {
    var n = t.dateTime;
    var e = t.date;
    var r = t.time;
    var i = t.periods;
    var o = t.days;
    var a = t.shortDays;
    var u = t.months;
    var c = t.shortMonths;
    var f = Sp(i);
    var s = kp(i);
    var l = Sp(o);
    var h = kp(o);
    var d = Sp(a);
    var p = kp(a);
    var v = Sp(u);
    var g = kp(u);
    var y = Sp(c);
    var _ = kp(c);
    var b = {
      a: function(t) {
        return a[t.getDay()];
      },
      A: function(t) {
        return o[t.getDay()];
      },
      b: function(t) {
        return c[t.getMonth()];
      },
      B: function(t) {
        return u[t.getMonth()];
      },
      c: null,
      d: Wp,
      e: Wp,
      f: tv,
      H: Zp,
      I: Qp,
      j: Kp,
      L: Jp,
      m: nv,
      M: ev,
      p: function(t) {
        return i[+(t.getHours() &gt;= 12)];
      },
      q: function(t) {
        return 1 + ~~(t.getMonth() / 3);
      },
      Q: Cv,
      s: Pv,
      S: rv,
      u: iv,
      U: ov,
      V: av,
      w: uv,
      W: cv,
      x: null,
      X: null,
      y: fv,
      Y: sv,
      Z: lv,
      "%": Ev
    };
    var m = {
      a: function(t) {
        return a[t.getUTCDay()];
      },
      A: function(t) {
        return o[t.getUTCDay()];
      },
      b: function(t) {
        return c[t.getUTCMonth()];
      },
      B: function(t) {
        return u[t.getUTCMonth()];
      },
      c: null,
      d: hv,
      e: hv,
      f: yv,
      H: dv,
      I: pv,
      j: vv,
      L: gv,
      m: _v,
      M: bv,
      p: function(t) {
        return i[+(t.getUTCHours() &gt;= 12)];
      },
      q: function(t) {
        return 1 + ~~(t.getUTCMonth() / 3);
      },
      Q: Cv,
      s: Pv,
      S: mv,
      u: xv,
      U: wv,
      V: Mv,
      w: Nv,
      W: Tv,
      x: null,
      X: null,
      y: Av,
      Y: Sv,
      Z: kv,
      "%": Ev
    };
    var x = {
      a: function(t, n, e) {
        var r = d.exec(n.slice(e));
        return r ? ((t.w = p[r[0].toLowerCase()]), e + r[0].length) : -1;
      },
      A: function(t, n, e) {
        var r = l.exec(n.slice(e));
        return r ? ((t.w = h[r[0].toLowerCase()]), e + r[0].length) : -1;
      },
      b: function(t, n, e) {
        var r = y.exec(n.slice(e));
        return r ? ((t.m = _[r[0].toLowerCase()]), e + r[0].length) : -1;
      },
      B: function(t, n, e) {
        var r = v.exec(n.slice(e));
        return r ? ((t.m = g[r[0].toLowerCase()]), e + r[0].length) : -1;
      },
      c: function(t, e, r) {
        return N(t, n, e, r);
      },
      d: Bp,
      e: Bp,
      f: Xp,
      H: Yp,
      I: Yp,
      j: Fp,
      L: jp,
      m: Op,
      M: Ip,
      p: function(t, n, e) {
        var r = f.exec(n.slice(e));
        return r ? ((t.p = s[r[0].toLowerCase()]), e + r[0].length) : -1;
      },
      q: Up,
      Q: Gp,
      s: $p,
      S: Hp,
      u: Cp,
      U: Pp,
      V: zp,
      w: Ep,
      W: Rp,
      x: function(t, n, r) {
        return N(t, e, n, r);
      },
      X: function(t, n, e) {
        return N(t, r, n, e);
      },
      y: qp,
      Y: Dp,
      Z: Lp,
      "%": Vp
    };
    function w(t, n) {
      return function(e) {
        var r;
        var i;
        var o;
        var a = [];
        var u = -1;
        var c = 0;
        var f = t.length;
        for (e instanceof Date || (e = new Date(+e)); ++u &lt; f; )
          t.charCodeAt(u) === 37 &amp;&amp;
            (a.push(t.slice(c, u)),
            (i = xp[(r = t.charAt(++u))]) != null
              ? (r = t.charAt(++u))
              : (i = r === "e" ? " " : "0"),
            (o = n[r]) &amp;&amp; (r = o(e, i)),
            a.push(r),
            (c = u + 1));
        return a.push(t.slice(c, u)), a.join("");
      };
    }
    function M(t, n) {
      return function(e) {
        var r;
        var i;
        var o = _p(1900, void 0, 1);
        if (N(o, t, (e += ""), 0) != e.length) return null;
        if ("Q" in o) return new Date(o.Q);
        if ("s" in o) return new Date(1e3 * o.s + ("L" in o ? o.L : 0));
        if (
          (!n || "Z" in o || (o.Z = 0),
          "p" in o &amp;&amp; (o.H = (o.H % 12) + 12 * o.p),
          void 0 === o.m &amp;&amp; (o.m = "q" in o ? o.q : 0),
          "V" in o)
        ) {
          if (o.V &lt; 1 || o.V &gt; 53) return null;
          "w" in o || (o.w = 1),
            "Z" in o
              ? ((i = (r = yp(_p(o.y, 0, 1))).getUTCDay()),
                (r = i &gt; 4 || i === 0 ? Jd.ceil(r) : Jd(r)),
                (r = Wd.offset(r, 7 * (o.V - 1))),
                (o.y = r.getUTCFullYear()),
                (o.m = r.getUTCMonth()),
                (o.d = r.getUTCDate() + ((o.w + 6) % 7)))
              : ((i = (r = gp(_p(o.y, 0, 1))).getDay()),
                (r = i &gt; 4 || i === 0 ? kd.ceil(r) : kd(r)),
                (r = Nd.offset(r, 7 * (o.V - 1))),
                (o.y = r.getFullYear()),
                (o.m = r.getMonth()),
                (o.d = r.getDate() + ((o.w + 6) % 7)));
        } else ("W" in o || "U" in o) &amp;&amp; ("w" in o || (o.w = "u" in o ? o.u % 7 : "W" in o ? 1 : 0), (i = "Z" in o ? yp(_p(o.y, 0, 1)).getUTCDay() : gp(_p(o.y, 0, 1)).getDay()), (o.m = 0), (o.d = "W" in o ? ((o.w + 6) % 7) + 7 * o.W - ((i + 5) % 7) : o.w + 7 * o.U - ((i + 6) % 7)));
        return "Z" in o
          ? ((o.H += (o.Z / 100) | 0), (o.M += o.Z % 100), yp(o))
          : gp(o);
      };
    }
    function N(t, n, e, r) {
      for (var i, o, a = 0, u = n.length, c = e.length; a &lt; u; ) {
        if (r &gt;= c) return -1;
        if ((i = n.charCodeAt(a++)) === 37) {
          if (
            ((i = n.charAt(a++)),
            !(o = x[i in xp ? n.charAt(a++) : i]) || (r = o(t, e, r)) &lt; 0)
          )
            return -1;
        } else if (i != e.charCodeAt(r++)) return -1;
      }
      return r;
    }
    return (
      (b.x = w(e, b)),
      (b.X = w(r, b)),
      (b.c = w(n, b)),
      (m.x = w(e, m)),
      (m.X = w(r, m)),
      (m.c = w(n, m)),
      {
        format: function(t) {
          var n = w((t += ""), b);
          return (
            (n.toString = function() {
              return t;
            }),
            n
          );
        },
        parse: function(t) {
          var n = M((t += ""), !1);
          return (
            (n.toString = function() {
              return t;
            }),
            n
          );
        },
        utcFormat: function(t) {
          var n = w((t += ""), m);
          return (
            (n.toString = function() {
              return t;
            }),
            n
          );
        },
        utcParse: function(t) {
          var n = M((t += ""), !0);
          return (
            (n.toString = function() {
              return t;
            }),
            n
          );
        }
      }
    );
  }
  var mp;
  var xp = { "-": "", _: " ", 0: "0" };
  var wp = /^\s*\d+/;
  var Mp = /^%/;
  var Np = /[\\^$*+?|[\]().{}]/g;
  function Tp(t, n, e) {
    var r = t &lt; 0 ? "-" : "";
    var i = (r ? -t : t) + "";
    var o = i.length;
    return r + (o &lt; e ? new Array(e - o + 1).join(n) + i : i);
  }
  function Ap(t) {
    return t.replace(Np, "\\$&amp;");
  }
  function Sp(t) {
    return new RegExp("^(?:" + t.map(Ap).join("|") + ")", "i");
  }
  function kp(t) {
    for (var n = {}, e = -1, r = t.length; ++e &lt; r; ) n[t[e].toLowerCase()] = e;
    return n;
  }
  function Ep(t, n, e) {
    var r = wp.exec(n.slice(e, e + 1));
    return r ? ((t.w = +r[0]), e + r[0].length) : -1;
  }
  function Cp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 1));
    return r ? ((t.u = +r[0]), e + r[0].length) : -1;
  }
  function Pp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.U = +r[0]), e + r[0].length) : -1;
  }
  function zp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.V = +r[0]), e + r[0].length) : -1;
  }
  function Rp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.W = +r[0]), e + r[0].length) : -1;
  }
  function Dp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 4));
    return r ? ((t.y = +r[0]), e + r[0].length) : -1;
  }
  function qp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r
      ? ((t.y = +r[0] + (+r[0] &gt; 68 ? 1900 : 2e3)), e + r[0].length)
      : -1;
  }
  function Lp(t, n, e) {
    var r = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e, e + 6));
    return r
      ? ((t.Z = r[1] ? 0 : -(r[2] + (r[3] || "00"))), e + r[0].length)
      : -1;
  }
  function Up(t, n, e) {
    var r = wp.exec(n.slice(e, e + 1));
    return r ? ((t.q = 3 * r[0] - 3), e + r[0].length) : -1;
  }
  function Op(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.m = r[0] - 1), e + r[0].length) : -1;
  }
  function Bp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.d = +r[0]), e + r[0].length) : -1;
  }
  function Fp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 3));
    return r ? ((t.m = 0), (t.d = +r[0]), e + r[0].length) : -1;
  }
  function Yp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.H = +r[0]), e + r[0].length) : -1;
  }
  function Ip(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.M = +r[0]), e + r[0].length) : -1;
  }
  function Hp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 2));
    return r ? ((t.S = +r[0]), e + r[0].length) : -1;
  }
  function jp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 3));
    return r ? ((t.L = +r[0]), e + r[0].length) : -1;
  }
  function Xp(t, n, e) {
    var r = wp.exec(n.slice(e, e + 6));
    return r ? ((t.L = Math.floor(r[0] / 1e3)), e + r[0].length) : -1;
  }
  function Vp(t, n, e) {
    var r = Mp.exec(n.slice(e, e + 1));
    return r ? e + r[0].length : -1;
  }
  function Gp(t, n, e) {
    var r = wp.exec(n.slice(e));
    return r ? ((t.Q = +r[0]), e + r[0].length) : -1;
  }
  function $p(t, n, e) {
    var r = wp.exec(n.slice(e));
    return r ? ((t.s = +r[0]), e + r[0].length) : -1;
  }
  function Wp(t, n) {
    return Tp(t.getDate(), n, 2);
  }
  function Zp(t, n) {
    return Tp(t.getHours(), n, 2);
  }
  function Qp(t, n) {
    return Tp(t.getHours() % 12 || 12, n, 2);
  }
  function Kp(t, n) {
    return Tp(1 + Nd.count(Hd(t), t), n, 3);
  }
  function Jp(t, n) {
    return Tp(t.getMilliseconds(), n, 3);
  }
  function tv(t, n) {
    return Jp(t, n) + "000";
  }
  function nv(t, n) {
    return Tp(t.getMonth() + 1, n, 2);
  }
  function ev(t, n) {
    return Tp(t.getMinutes(), n, 2);
  }
  function rv(t, n) {
    return Tp(t.getSeconds(), n, 2);
  }
  function iv(t) {
    var n = t.getDay();
    return n === 0 ? 7 : n;
  }
  function ov(t, n) {
    return Tp(Sd.count(Hd(t) - 1, t), n, 2);
  }
  function av(t, n) {
    var e = t.getDay();
    return (
      (t = e &gt;= 4 || e === 0 ? Pd(t) : Pd.ceil(t)),
      Tp(Pd.count(Hd(t), t) + (Hd(t).getDay() === 4), n, 2)
    );
  }
  function uv(t) {
    return t.getDay();
  }
  function cv(t, n) {
    return Tp(kd.count(Hd(t) - 1, t), n, 2);
  }
  function fv(t, n) {
    return Tp(t.getFullYear() % 100, n, 2);
  }
  function sv(t, n) {
    return Tp(t.getFullYear() % 1e4, n, 4);
  }
  function lv(t) {
    var n = t.getTimezoneOffset();
    return (
      (n &gt; 0 ? "-" : ((n *= -1), "+")) +
      Tp((n / 60) | 0, "0", 2) +
      Tp(n % 60, "0", 2)
    );
  }
  function hv(t, n) {
    return Tp(t.getUTCDate(), n, 2);
  }
  function dv(t, n) {
    return Tp(t.getUTCHours(), n, 2);
  }
  function pv(t, n) {
    return Tp(t.getUTCHours() % 12 || 12, n, 2);
  }
  function vv(t, n) {
    return Tp(1 + Wd.count(pp(t), t), n, 3);
  }
  function gv(t, n) {
    return Tp(t.getUTCMilliseconds(), n, 3);
  }
  function yv(t, n) {
    return gv(t, n) + "000";
  }
  function _v(t, n) {
    return Tp(t.getUTCMonth() + 1, n, 2);
  }
  function bv(t, n) {
    return Tp(t.getUTCMinutes(), n, 2);
  }
  function mv(t, n) {
    return Tp(t.getUTCSeconds(), n, 2);
  }
  function xv(t) {
    var n = t.getUTCDay();
    return n === 0 ? 7 : n;
  }
  function wv(t, n) {
    return Tp(Kd.count(pp(t) - 1, t), n, 2);
  }
  function Mv(t, n) {
    var e = t.getUTCDay();
    return (
      (t = e &gt;= 4 || e === 0 ? ep(t) : ep.ceil(t)),
      Tp(ep.count(pp(t), t) + (pp(t).getUTCDay() === 4), n, 2)
    );
  }
  function Nv(t) {
    return t.getUTCDay();
  }
  function Tv(t, n) {
    return Tp(Jd.count(pp(t) - 1, t), n, 2);
  }
  function Av(t, n) {
    return Tp(t.getUTCFullYear() % 100, n, 2);
  }
  function Sv(t, n) {
    return Tp(t.getUTCFullYear() % 1e4, n, 4);
  }
  function kv() {
    return "+0000";
  }
  function Ev() {
    return "%";
  }
  function Cv(t) {
    return +t;
  }
  function Pv(t) {
    return Math.floor(+t / 1e3);
  }
  function zv(n) {
    return (
      (mp = bp(n)),
      (t.timeFormat = mp.format),
      (t.timeParse = mp.parse),
      (t.utcFormat = mp.utcFormat),
      (t.utcParse = mp.utcParse),
      mp
    );
  }
  zv({
    dateTime: "%x, %X",
    date: "%-m/%-d/%Y",
    time: "%-I:%M:%S %p",
    periods: ["AM", "PM"],
    days: [
      "Sunday",
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday",
      "Saturday"
    ],
    shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    months: [
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December"
    ],
    shortMonths: [
      "Jan",
      "Feb",
      "Mar",
      "Apr",
      "May",
      "Jun",
      "Jul",
      "Aug",
      "Sep",
      "Oct",
      "Nov",
      "Dec"
    ]
  });
  var Rv = Date.prototype.toISOString
    ? function(t) {
        return t.toISOString();
      }
    : t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");
  var Dv = +new Date("2000-01-01T00:00:00.000Z")
    ? function(t) {
        var n = new Date(t);
        return isNaN(n) ? null : n;
      }
    : t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");
  var qv = 1e3;
  var Lv = 60 * qv;
  var Uv = 60 * Lv;
  var Ov = 24 * Uv;
  var Bv = 7 * Ov;
  var Fv = 30 * Ov;
  var Yv = 365 * Ov;
  function Iv(t) {
    return new Date(t);
  }
  function Hv(t) {
    return t instanceof Date ? +t : +new Date(+t);
  }
  function jv(t, n, r, i, o, a, u, c, f) {
    var s = Vh(Bh, Bh);
    var l = s.invert;
    var h = s.domain;
    var d = f(".%L");
    var p = f(":%S");
    var v = f("%I:%M");
    var g = f("%I %p");
    var y = f("%a %d");
    var _ = f("%b %d");
    var b = f("%B");
    var m = f("%Y");
    var x = [
      [u, 1, qv],
      [u, 5, 5 * qv],
      [u, 15, 15 * qv],
      [u, 30, 30 * qv],
      [a, 1, Lv],
      [a, 5, 5 * Lv],
      [a, 15, 15 * Lv],
      [a, 30, 30 * Lv],
      [o, 1, Uv],
      [o, 3, 3 * Uv],
      [o, 6, 6 * Uv],
      [o, 12, 12 * Uv],
      [i, 1, Ov],
      [i, 2, 2 * Ov],
      [r, 1, Bv],
      [n, 1, Fv],
      [n, 3, 3 * Fv],
      [t, 1, Yv]
    ];
    function M(e) {
      return (u(e) &lt; e
        ? d
        : a(e) &lt; e
        ? p
        : o(e) &lt; e
        ? v
        : i(e) &lt; e
        ? g
        : n(e) &lt; e
        ? r(e) &lt; e
          ? y
          : _
        : t(e) &lt; e
        ? b
        : m)(e);
    }
    function N(n, r, i, o) {
      if ((n == null &amp;&amp; (n = 10), typeof n === "number")) {
        var a = Math.abs(i - r) / n;
        var u = e(function(t) {
          return t[2];
        }).right(x, a);
        u === x.length
          ? ((o = w(r / Yv, i / Yv, n)), (n = t))
          : u
          ? ((o = (u = x[a / x[u - 1][2] &lt; x[u][2] / a ? u - 1 : u])[1]),
            (n = u[0]))
          : ((o = Math.max(w(r, i, n), 1)), (n = c));
      }
      return o == null ? n : n.every(o);
    }
    return (
      (s.invert = function(t) {
        return new Date(l(t));
      }),
      (s.domain = function(t) {
        return arguments.length ? h(zh.call(t, Hv)) : h().map(Iv);
      }),
      (s.ticks = function(t, n) {
        var e;
        var r = h();
        var i = r[0];
        var o = r[r.length - 1];
        var a = o &lt; i;
        return (
          a &amp;&amp; ((e = i), (i = o), (o = e)),
          (e = (e = N(t, i, o, n)) ? e.range(i, o + 1) : []),
          a ? e.reverse() : e
        );
      }),
      (s.tickFormat = function(t, n) {
        return n == null ? M : f(n);
      }),
      (s.nice = function(t, n) {
        var e = h();
        return (t = N(t, e[0], e[e.length - 1], n)) ? h(Wh(e, t)) : s;
      }),
      (s.copy = function() {
        return jh(s, jv(t, n, r, i, o, a, u, c, f));
      }),
      s
    );
  }
  function Xv() {
    var t;
    var n;
    var e;
    var r;
    var i;
    var o = 0;
    var a = 1;
    var u = Bh;
    var c = !1;
    function f(n) {
      return isNaN((n = +n))
        ? i
        : u(
            e === 0
              ? 0.5
              : ((n = (r(n) - t) * e), c ? Math.max(0, Math.min(1, n)) : n)
          );
    }
    return (
      (f.domain = function(i) {
        return arguments.length
          ? ((t = r((o = +i[0]))),
            (n = r((a = +i[1]))),
            (e = t === n ? 0 : 1 / (n - t)),
            f)
          : [o, a];
      }),
      (f.clamp = function(t) {
        return arguments.length ? ((c = !!t), f) : c;
      }),
      (f.interpolator = function(t) {
        return arguments.length ? ((u = t), f) : u;
      }),
      (f.unknown = function(t) {
        return arguments.length ? ((i = t), f) : i;
      }),
      function(i) {
        return (
          (r = i), (t = i(o)), (n = i(a)), (e = t === n ? 0 : 1 / (n - t)), f
        );
      }
    );
  }
  function Vv(t, n) {
    return n
      .domain(t.domain())
      .interpolator(t.interpolator())
      .clamp(t.clamp())
      .unknown(t.unknown());
  }
  function Gv() {
    var t = fd(Xv());
    return (
      (t.copy = function() {
        return Vv(t, Gv()).exponent(t.exponent());
      }),
      Ch.apply(t, arguments)
    );
  }
  function $v() {
    var t;
    var n;
    var e;
    var r;
    var i;
    var o;
    var a;
    var u = 0;
    var c = 0.5;
    var f = 1;
    var s = Bh;
    var l = !1;
    function h(t) {
      return isNaN((t = +t))
        ? a
        : ((t = 0.5 + ((t = +o(t)) - n) * (t &lt; n ? r : i)),
          s(l ? Math.max(0, Math.min(1, t)) : t));
    }
    return (
      (h.domain = function(a) {
        return arguments.length
          ? ((t = o((u = +a[0]))),
            (n = o((c = +a[1]))),
            (e = o((f = +a[2]))),
            (r = t === n ? 0 : 0.5 / (n - t)),
            (i = n === e ? 0 : 0.5 / (e - n)),
            h)
          : [u, c, f];
      }),
      (h.clamp = function(t) {
        return arguments.length ? ((l = !!t), h) : l;
      }),
      (h.interpolator = function(t) {
        return arguments.length ? ((s = t), h) : s;
      }),
      (h.unknown = function(t) {
        return arguments.length ? ((a = t), h) : a;
      }),
      function(a) {
        return (
          (o = a),
          (t = a(u)),
          (n = a(c)),
          (e = a(f)),
          (r = t === n ? 0 : 0.5 / (n - t)),
          (i = n === e ? 0 : 0.5 / (e - n)),
          h
        );
      }
    );
  }
  function Wv() {
    var t = fd($v());
    return (
      (t.copy = function() {
        return Vv(t, Wv()).exponent(t.exponent());
      }),
      Ch.apply(t, arguments)
    );
  }
  function Zv(t) {
    for (var n = (t.length / 6) | 0, e = new Array(n), r = 0; r &lt; n; )
      e[r] = "#" + t.slice(6 * r, 6 * ++r);
    return e;
  }
  var Qv = Zv("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
  var Kv = Zv("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");
  var Jv = Zv("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");
  var tg = Zv(
    "a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"
  );
  var ng = Zv("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");
  var eg = Zv("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");
  var rg = Zv("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");
  var ig = Zv("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");
  var og = Zv(
    "8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"
  );
  var ag = Zv("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
  function ug(t) {
    return pe(t[t.length - 1]);
  }
  var cg = new Array(3)
    .concat(
      "d8b365f5f5f55ab4ac",
      "a6611adfc27d80cdc1018571",
      "a6611adfc27df5f5f580cdc1018571",
      "8c510ad8b365f6e8c3c7eae55ab4ac01665e",
      "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e",
      "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e",
      "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e",
      "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30",
      "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30"
    )
    .map(Zv);
  var fg = ug(cg);
  var sg = new Array(3)
    .concat(
      "af8dc3f7f7f77fbf7b",
      "7b3294c2a5cfa6dba0008837",
      "7b3294c2a5cff7f7f7a6dba0008837",
      "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837",
      "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837",
      "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837",
      "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837",
      "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b",
      "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b"
    )
    .map(Zv);
  var lg = ug(sg);
  var hg = new Array(3)
    .concat(
      "e9a3c9f7f7f7a1d76a",
      "d01c8bf1b6dab8e1864dac26",
      "d01c8bf1b6daf7f7f7b8e1864dac26",
      "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221",
      "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221",
      "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221",
      "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221",
      "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419",
      "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419"
    )
    .map(Zv);
  var dg = ug(hg);
  var pg = new Array(3)
    .concat(
      "998ec3f7f7f7f1a340",
      "5e3c99b2abd2fdb863e66101",
      "5e3c99b2abd2f7f7f7fdb863e66101",
      "542788998ec3d8daebfee0b6f1a340b35806",
      "542788998ec3d8daebf7f7f7fee0b6f1a340b35806",
      "5427888073acb2abd2d8daebfee0b6fdb863e08214b35806",
      "5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806",
      "2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08",
      "2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08"
    )
    .map(Zv);
  var vg = ug(pg);
  var gg = new Array(3)
    .concat(
      "ef8a62f7f7f767a9cf",
      "ca0020f4a58292c5de0571b0",
      "ca0020f4a582f7f7f792c5de0571b0",
      "b2182bef8a62fddbc7d1e5f067a9cf2166ac",
      "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac",
      "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac",
      "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac",
      "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061",
      "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061"
    )
    .map(Zv);
  var yg = ug(gg);
  var _g = new Array(3)
    .concat(
      "ef8a62ffffff999999",
      "ca0020f4a582bababa404040",
      "ca0020f4a582ffffffbababa404040",
      "b2182bef8a62fddbc7e0e0e09999994d4d4d",
      "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d",
      "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d",
      "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d",
      "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a",
      "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a"
    )
    .map(Zv);
  var bg = ug(_g);
  var mg = new Array(3)
    .concat(
      "fc8d59ffffbf91bfdb",
      "d7191cfdae61abd9e92c7bb6",
      "d7191cfdae61ffffbfabd9e92c7bb6",
      "d73027fc8d59fee090e0f3f891bfdb4575b4",
      "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4",
      "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4",
      "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4",
      "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695",
      "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695"
    )
    .map(Zv);
  var xg = ug(mg);
  var wg = new Array(3)
    .concat(
      "fc8d59ffffbf91cf60",
      "d7191cfdae61a6d96a1a9641",
      "d7191cfdae61ffffbfa6d96a1a9641",
      "d73027fc8d59fee08bd9ef8b91cf601a9850",
      "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850",
      "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850",
      "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850",
      "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837",
      "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837"
    )
    .map(Zv);
  var Mg = ug(wg);
  var Ng = new Array(3)
    .concat(
      "fc8d59ffffbf99d594",
      "d7191cfdae61abdda42b83ba",
      "d7191cfdae61ffffbfabdda42b83ba",
      "d53e4ffc8d59fee08be6f59899d5943288bd",
      "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd",
      "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd",
      "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd",
      "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2",
      "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"
    )
    .map(Zv);
  var Tg = ug(Ng);
  var Ag = new Array(3)
    .concat(
      "e5f5f999d8c92ca25f",
      "edf8fbb2e2e266c2a4238b45",
      "edf8fbb2e2e266c2a42ca25f006d2c",
      "edf8fbccece699d8c966c2a42ca25f006d2c",
      "edf8fbccece699d8c966c2a441ae76238b45005824",
      "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824",
      "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b"
    )
    .map(Zv);
  var Sg = ug(Ag);
  var kg = new Array(3)
    .concat(
      "e0ecf49ebcda8856a7",
      "edf8fbb3cde38c96c688419d",
      "edf8fbb3cde38c96c68856a7810f7c",
      "edf8fbbfd3e69ebcda8c96c68856a7810f7c",
      "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b",
      "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b",
      "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b"
    )
    .map(Zv);
  var Eg = ug(kg);
  var Cg = new Array(3)
    .concat(
      "e0f3dba8ddb543a2ca",
      "f0f9e8bae4bc7bccc42b8cbe",
      "f0f9e8bae4bc7bccc443a2ca0868ac",
      "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac",
      "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e",
      "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e",
      "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081"
    )
    .map(Zv);
  var Pg = ug(Cg);
  var zg = new Array(3)
    .concat(
      "fee8c8fdbb84e34a33",
      "fef0d9fdcc8afc8d59d7301f",
      "fef0d9fdcc8afc8d59e34a33b30000",
      "fef0d9fdd49efdbb84fc8d59e34a33b30000",
      "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000",
      "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000",
      "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000"
    )
    .map(Zv);
  var Rg = ug(zg);
  var Dg = new Array(3)
    .concat(
      "ece2f0a6bddb1c9099",
      "f6eff7bdc9e167a9cf02818a",
      "f6eff7bdc9e167a9cf1c9099016c59",
      "f6eff7d0d1e6a6bddb67a9cf1c9099016c59",
      "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450",
      "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450",
      "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636"
    )
    .map(Zv);
  var qg = ug(Dg);
  var Lg = new Array(3)
    .concat(
      "ece7f2a6bddb2b8cbe",
      "f1eef6bdc9e174a9cf0570b0",
      "f1eef6bdc9e174a9cf2b8cbe045a8d",
      "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d",
      "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b",
      "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b",
      "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858"
    )
    .map(Zv);
  var Ug = ug(Lg);
  var Og = new Array(3)
    .concat(
      "e7e1efc994c7dd1c77",
      "f1eef6d7b5d8df65b0ce1256",
      "f1eef6d7b5d8df65b0dd1c77980043",
      "f1eef6d4b9dac994c7df65b0dd1c77980043",
      "f1eef6d4b9dac994c7df65b0e7298ace125691003f",
      "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f",
      "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f"
    )
    .map(Zv);
  var Bg = ug(Og);
  var Fg = new Array(3)
    .concat(
      "fde0ddfa9fb5c51b8a",
      "feebe2fbb4b9f768a1ae017e",
      "feebe2fbb4b9f768a1c51b8a7a0177",
      "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177",
      "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177",
      "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177",
      "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a"
    )
    .map(Zv);
  var Yg = ug(Fg);
  var Ig = new Array(3)
    .concat(
      "edf8b17fcdbb2c7fb8",
      "ffffcca1dab441b6c4225ea8",
      "ffffcca1dab441b6c42c7fb8253494",
      "ffffccc7e9b47fcdbb41b6c42c7fb8253494",
      "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84",
      "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84",
      "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58"
    )
    .map(Zv);
  var Hg = ug(Ig);
  var jg = new Array(3)
    .concat(
      "f7fcb9addd8e31a354",
      "ffffccc2e69978c679238443",
      "ffffccc2e69978c67931a354006837",
      "ffffccd9f0a3addd8e78c67931a354006837",
      "ffffccd9f0a3addd8e78c67941ab5d238443005a32",
      "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32",
      "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529"
    )
    .map(Zv);
  var Xg = ug(jg);
  var Vg = new Array(3)
    .concat(
      "fff7bcfec44fd95f0e",
      "ffffd4fed98efe9929cc4c02",
      "ffffd4fed98efe9929d95f0e993404",
      "ffffd4fee391fec44ffe9929d95f0e993404",
      "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04",
      "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04",
      "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506"
    )
    .map(Zv);
  var Gg = ug(Vg);
  var $g = new Array(3)
    .concat(
      "ffeda0feb24cf03b20",
      "ffffb2fecc5cfd8d3ce31a1c",
      "ffffb2fecc5cfd8d3cf03b20bd0026",
      "ffffb2fed976feb24cfd8d3cf03b20bd0026",
      "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026",
      "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026",
      "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026"
    )
    .map(Zv);
  var Wg = ug($g);
  var Zg = new Array(3)
    .concat(
      "deebf79ecae13182bd",
      "eff3ffbdd7e76baed62171b5",
      "eff3ffbdd7e76baed63182bd08519c",
      "eff3ffc6dbef9ecae16baed63182bd08519c",
      "eff3ffc6dbef9ecae16baed64292c62171b5084594",
      "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594",
      "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b"
    )
    .map(Zv);
  var Qg = ug(Zg);
  var Kg = new Array(3)
    .concat(
      "e5f5e0a1d99b31a354",
      "edf8e9bae4b374c476238b45",
      "edf8e9bae4b374c47631a354006d2c",
      "edf8e9c7e9c0a1d99b74c47631a354006d2c",
      "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32",
      "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32",
      "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b"
    )
    .map(Zv);
  var Jg = ug(Kg);
  var ty = new Array(3)
    .concat(
      "f0f0f0bdbdbd636363",
      "f7f7f7cccccc969696525252",
      "f7f7f7cccccc969696636363252525",
      "f7f7f7d9d9d9bdbdbd969696636363252525",
      "f7f7f7d9d9d9bdbdbd969696737373525252252525",
      "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525",
      "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000"
    )
    .map(Zv);
  var ny = ug(ty);
  var ey = new Array(3)
    .concat(
      "efedf5bcbddc756bb1",
      "f2f0f7cbc9e29e9ac86a51a3",
      "f2f0f7cbc9e29e9ac8756bb154278f",
      "f2f0f7dadaebbcbddc9e9ac8756bb154278f",
      "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486",
      "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486",
      "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d"
    )
    .map(Zv);
  var ry = ug(ey);
  var iy = new Array(3)
    .concat(
      "fee0d2fc9272de2d26",
      "fee5d9fcae91fb6a4acb181d",
      "fee5d9fcae91fb6a4ade2d26a50f15",
      "fee5d9fcbba1fc9272fb6a4ade2d26a50f15",
      "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d",
      "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d",
      "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d"
    )
    .map(Zv);
  var oy = ug(iy);
  var ay = new Array(3)
    .concat(
      "fee6cefdae6be6550d",
      "feeddefdbe85fd8d3cd94701",
      "feeddefdbe85fd8d3ce6550da63603",
      "feeddefdd0a2fdae6bfd8d3ce6550da63603",
      "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04",
      "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04",
      "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704"
    )
    .map(Zv);
  var uy = ug(ay);
  var cy = Qe(ee(300, 0.5, 0), ee(-240, 0.5, 1));
  var fy = Qe(ee(-100, 0.75, 0.35), ee(80, 1.5, 0.8));
  var sy = Qe(ee(260, 0.75, 0.35), ee(80, 1.5, 0.8));
  var ly = ee();
  var hy = _n();
  var dy = Math.PI / 3;
  var py = (2 * Math.PI) / 3;
  function vy(t) {
    var n = t.length;
    return function(e) {
      return t[Math.max(0, Math.min(n - 1, Math.floor(e * n)))];
    };
  }
  var gy = vy(
    Zv(
      "44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"
    )
  );
  var yy = vy(
    Zv(
      "00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"
    )
  );
  var _y = vy(
    Zv(
      "00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"
    )
  );
  var by = vy(
    Zv(
      "0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"
    )
  );
  function my(t) {
    return function() {
      return t;
    };
  }
  var xy = Math.abs;
  var wy = Math.atan2;
  var My = Math.cos;
  var Ny = Math.max;
  var Ty = Math.min;
  var Ay = Math.sin;
  var Sy = Math.sqrt;
  var ky = 1e-12;
  var Ey = Math.PI;
  var Cy = Ey / 2;
  var Py = 2 * Ey;
  function zy(t) {
    return t &gt;= 1 ? Cy : t &lt;= -1 ? -Cy : Math.asin(t);
  }
  function Ry(t) {
    return t.innerRadius;
  }
  function Dy(t) {
    return t.outerRadius;
  }
  function qy(t) {
    return t.startAngle;
  }
  function Ly(t) {
    return t.endAngle;
  }
  function Uy(t) {
    return t &amp;&amp; t.padAngle;
  }
  function Oy(t, n, e, r, i, o, a) {
    var u = t - e;
    var c = n - r;
    var f = (a ? o : -o) / Sy(u * u + c * c);
    var s = f * c;
    var l = -f * u;
    var h = t + s;
    var d = n + l;
    var p = e + s;
    var v = r + l;
    var g = (h + p) / 2;
    var y = (d + v) / 2;
    var _ = p - h;
    var b = v - d;
    var m = _ * _ + b * b;
    var x = i - o;
    var w = h * v - p * d;
    var M = (b &lt; 0 ? -1 : 1) * Sy(Ny(0, x * x * m - w * w));
    var N = (w * b - _ * M) / m;
    var T = (-w * _ - b * M) / m;
    var A = (w * b + _ * M) / m;
    var S = (-w * _ + b * M) / m;
    var k = N - g;
    var E = T - y;
    var C = A - g;
    var P = S - y;
    return (
      k * k + E * E &gt; C * C + P * P &amp;&amp; ((N = A), (T = S)),
      {
        cx: N,
        cy: T,
        x01: -s,
        y01: -l,
        x11: N * (i / x - 1),
        y11: T * (i / x - 1)
      }
    );
  }
  function By(t) {
    this._context = t;
  }
  function Fy(t) {
    return new By(t);
  }
  function Yy(t) {
    return t[0];
  }
  function Iy(t) {
    return t[1];
  }
  function Hy() {
    var t = Yy;
    var n = Iy;
    var e = my(!0);
    var r = null;
    var i = Fy;
    var o = null;
    function a(a) {
      var u;
      var c;
      var f;
      var s = a.length;
      var l = !1;
      for (r == null &amp;&amp; (o = i((f = no()))), u = 0; u &lt;= s; ++u)
        !(u &lt; s &amp;&amp; e((c = a[u]), u, a)) === l &amp;&amp;
          ((l = !l) ? o.lineStart() : o.lineEnd()),
          l &amp;&amp; o.point(+t(c, u, a), +n(c, u, a));
      if (f) return (o = null), f + "" || null;
    }
    return (
      (a.x = function(n) {
        return arguments.length
          ? ((t = typeof n === "function" ? n : my(+n)), a)
          : t;
      }),
      (a.y = function(t) {
        return arguments.length
          ? ((n = typeof t === "function" ? t : my(+t)), a)
          : n;
      }),
      (a.defined = function(t) {
        return arguments.length
          ? ((e = typeof t === "function" ? t : my(!!t)), a)
          : e;
      }),
      (a.curve = function(t) {
        return arguments.length ? ((i = t), r != null &amp;&amp; (o = i(r)), a) : i;
      }),
      (a.context = function(t) {
        return arguments.length
          ? (t == null ? (r = o = null) : (o = i((r = t))), a)
          : r;
      }),
      a
    );
  }
  function jy() {
    var t = Yy;
    var n = null;
    var e = my(0);
    var r = Iy;
    var i = my(!0);
    var o = null;
    var a = Fy;
    var u = null;
    function c(c) {
      var f;
      var s;
      var l;
      var h;
      var d;
      var p = c.length;
      var v = !1;
      var g = new Array(p);
      var y = new Array(p);
      for (o == null &amp;&amp; (u = a((d = no()))), f = 0; f &lt;= p; ++f) {
        if (!(f &lt; p &amp;&amp; i((h = c[f]), f, c)) === v)
          if ((v = !v)) (s = f), u.areaStart(), u.lineStart();
          else {
            for (u.lineEnd(), u.lineStart(), l = f - 1; l &gt;= s; --l)
              u.point(g[l], y[l]);
            u.lineEnd(), u.areaEnd();
          }
        v &amp;&amp;
          ((g[f] = +t(h, f, c)),
          (y[f] = +e(h, f, c)),
          u.point(n ? +n(h, f, c) : g[f], r ? +r(h, f, c) : y[f]));
      }
      if (d) return (u = null), d + "" || null;
    }
    function f() {
      return Hy()
        .defined(i)
        .curve(a)
        .context(o);
    }
    return (
      (c.x = function(e) {
        return arguments.length
          ? ((t = typeof e === "function" ? e : my(+e)), (n = null), c)
          : t;
      }),
      (c.x0 = function(n) {
        return arguments.length
          ? ((t = typeof n === "function" ? n : my(+n)), c)
          : t;
      }),
      (c.x1 = function(t) {
        return arguments.length
          ? ((n = t == null ? null : typeof t === "function" ? t : my(+t)), c)
          : n;
      }),
      (c.y = function(t) {
        return arguments.length
          ? ((e = typeof t === "function" ? t : my(+t)), (r = null), c)
          : e;
      }),
      (c.y0 = function(t) {
        return arguments.length
          ? ((e = typeof t === "function" ? t : my(+t)), c)
          : e;
      }),
      (c.y1 = function(t) {
        return arguments.length
          ? ((r = t == null ? null : typeof t === "function" ? t : my(+t)), c)
          : r;
      }),
      (c.lineX0 = c.lineY0 = function() {
        return f()
          .x(t)
          .y(e);
      }),
      (c.lineY1 = function() {
        return f()
          .x(t)
          .y(r);
      }),
      (c.lineX1 = function() {
        return f()
          .x(n)
          .y(e);
      }),
      (c.defined = function(t) {
        return arguments.length
          ? ((i = typeof t === "function" ? t : my(!!t)), c)
          : i;
      }),
      (c.curve = function(t) {
        return arguments.length ? ((a = t), o != null &amp;&amp; (u = a(o)), c) : a;
      }),
      (c.context = function(t) {
        return arguments.length
          ? (t == null ? (o = u = null) : (u = a((o = t))), c)
          : o;
      }),
      c
    );
  }
  function Xy(t, n) {
    return n &lt; t ? -1 : n &gt; t ? 1 : n &gt;= t ? 0 : NaN;
  }
  function Vy(t) {
    return t;
  }
  By.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      (this._line || (this._line !== 0 &amp;&amp; this._point === 1)) &amp;&amp;
        this._context.closePath(),
        (this._line = 1 - this._line);
    },
    point: function(t, n) {
      switch (((t = +t), (n = +n), this._point)) {
        case 0:
          (this._point = 1),
            this._line
              ? this._context.lineTo(t, n)
              : this._context.moveTo(t, n);
          break;
        case 1:
          this._point = 2;
        default:
          this._context.lineTo(t, n);
      }
    }
  };
  var Gy = Wy(Fy);
  function $y(t) {
    this._curve = t;
  }
  function Wy(t) {
    function n(n) {
      return new $y(t(n));
    }
    return (n._curve = t), n;
  }
  function Zy(t) {
    var n = t.curve;
    return (
      (t.angle = t.x),
      delete t.x,
      (t.radius = t.y),
      delete t.y,
      (t.curve = function(t) {
        return arguments.length ? n(Wy(t)) : n()._curve;
      }),
      t
    );
  }
  function Qy() {
    return Zy(Hy().curve(Gy));
  }
  function Ky() {
    var t = jy().curve(Gy);
    var n = t.curve;
    var e = t.lineX0;
    var r = t.lineX1;
    var i = t.lineY0;
    var o = t.lineY1;
    return (
      (t.angle = t.x),
      delete t.x,
      (t.startAngle = t.x0),
      delete t.x0,
      (t.endAngle = t.x1),
      delete t.x1,
      (t.radius = t.y),
      delete t.y,
      (t.innerRadius = t.y0),
      delete t.y0,
      (t.outerRadius = t.y1),
      delete t.y1,
      (t.lineStartAngle = function() {
        return Zy(e());
      }),
      delete t.lineX0,
      (t.lineEndAngle = function() {
        return Zy(r());
      }),
      delete t.lineX1,
      (t.lineInnerRadius = function() {
        return Zy(i());
      }),
      delete t.lineY0,
      (t.lineOuterRadius = function() {
        return Zy(o());
      }),
      delete t.lineY1,
      (t.curve = function(t) {
        return arguments.length ? n(Wy(t)) : n()._curve;
      }),
      t
    );
  }
  function Jy(t, n) {
    return [(n = +n) * Math.cos((t -= Math.PI / 2)), n * Math.sin(t)];
  }
  $y.prototype = {
    areaStart: function() {
      this._curve.areaStart();
    },
    areaEnd: function() {
      this._curve.areaEnd();
    },
    lineStart: function() {
      this._curve.lineStart();
    },
    lineEnd: function() {
      this._curve.lineEnd();
    },
    point: function(t, n) {
      this._curve.point(n * Math.sin(t), n * -Math.cos(t));
    }
  };
  var t_ = Array.prototype.slice;
  function n_(t) {
    return t.source;
  }
  function e_(t) {
    return t.target;
  }
  function r_(t) {
    var n = n_;
    var e = e_;
    var r = Yy;
    var i = Iy;
    var o = null;
    function a() {
      var a;
      var u = t_.call(arguments);
      var c = n.apply(this, u);
      var f = e.apply(this, u);
      if (
        (o || (o = a = no()),
        t(
          o,
          +r.apply(this, ((u[0] = c), u)),
          +i.apply(this, u),
          +r.apply(this, ((u[0] = f), u)),
          +i.apply(this, u)
        ),
        a)
      )
        return (o = null), a + "" || null;
    }
    return (
      (a.source = function(t) {
        return arguments.length ? ((n = t), a) : n;
      }),
      (a.target = function(t) {
        return arguments.length ? ((e = t), a) : e;
      }),
      (a.x = function(t) {
        return arguments.length
          ? ((r = typeof t === "function" ? t : my(+t)), a)
          : r;
      }),
      (a.y = function(t) {
        return arguments.length
          ? ((i = typeof t === "function" ? t : my(+t)), a)
          : i;
      }),
      (a.context = function(t) {
        return arguments.length ? ((o = t == null ? null : t), a) : o;
      }),
      a
    );
  }
  function i_(t, n, e, r, i) {
    t.moveTo(n, e), t.bezierCurveTo((n = (n + r) / 2), e, n, i, r, i);
  }
  function o_(t, n, e, r, i) {
    t.moveTo(n, e), t.bezierCurveTo(n, (e = (e + i) / 2), r, e, r, i);
  }
  function a_(t, n, e, r, i) {
    var o = Jy(n, e);
    var a = Jy(n, (e = (e + i) / 2));
    var u = Jy(r, e);
    var c = Jy(r, i);
    t.moveTo(o[0], o[1]), t.bezierCurveTo(a[0], a[1], u[0], u[1], c[0], c[1]);
  }
  var u_ = {
    draw: function(t, n) {
      var e = Math.sqrt(n / Ey);
      t.moveTo(e, 0), t.arc(0, 0, e, 0, Py);
    }
  };
  var c_ = {
    draw: function(t, n) {
      var e = Math.sqrt(n / 5) / 2;
      t.moveTo(-3 * e, -e),
        t.lineTo(-e, -e),
        t.lineTo(-e, -3 * e),
        t.lineTo(e, -3 * e),
        t.lineTo(e, -e),
        t.lineTo(3 * e, -e),
        t.lineTo(3 * e, e),
        t.lineTo(e, e),
        t.lineTo(e, 3 * e),
        t.lineTo(-e, 3 * e),
        t.lineTo(-e, e),
        t.lineTo(-3 * e, e),
        t.closePath();
    }
  };
  var f_ = Math.sqrt(1 / 3);
  var s_ = 2 * f_;
  var l_ = {
    draw: function(t, n) {
      var e = Math.sqrt(n / s_);
      var r = e * f_;
      t.moveTo(0, -e),
        t.lineTo(r, 0),
        t.lineTo(0, e),
        t.lineTo(-r, 0),
        t.closePath();
    }
  };
  var h_ = Math.sin(Ey / 10) / Math.sin((7 * Ey) / 10);
  var d_ = Math.sin(Py / 10) * h_;
  var p_ = -Math.cos(Py / 10) * h_;
  var v_ = {
    draw: function(t, n) {
      var e = Math.sqrt(0.8908130915292852 * n);
      var r = d_ * e;
      var i = p_ * e;
      t.moveTo(0, -e), t.lineTo(r, i);
      for (var o = 1; o &lt; 5; ++o) {
        var a = (Py * o) / 5;
        var u = Math.cos(a);
        var c = Math.sin(a);
        t.lineTo(c * e, -u * e), t.lineTo(u * r - c * i, c * r + u * i);
      }
      t.closePath();
    }
  };
  var g_ = {
    draw: function(t, n) {
      var e = Math.sqrt(n);
      var r = -e / 2;
      t.rect(r, r, e, e);
    }
  };
  var y_ = Math.sqrt(3);
  var __ = {
    draw: function(t, n) {
      var e = -Math.sqrt(n / (3 * y_));
      t.moveTo(0, 2 * e),
        t.lineTo(-y_ * e, -e),
        t.lineTo(y_ * e, -e),
        t.closePath();
    }
  };
  var b_ = Math.sqrt(3) / 2;
  var m_ = 1 / Math.sqrt(12);
  var x_ = 3 * (m_ / 2 + 1);
  var w_ = {
    draw: function(t, n) {
      var e = Math.sqrt(n / x_);
      var r = e / 2;
      var i = e * m_;
      var o = r;
      var a = e * m_ + e;
      var u = -o;
      var c = a;
      t.moveTo(r, i),
        t.lineTo(o, a),
        t.lineTo(u, c),
        t.lineTo(-0.5 * r - b_ * i, b_ * r + -0.5 * i),
        t.lineTo(-0.5 * o - b_ * a, b_ * o + -0.5 * a),
        t.lineTo(-0.5 * u - b_ * c, b_ * u + -0.5 * c),
        t.lineTo(-0.5 * r + b_ * i, -0.5 * i - b_ * r),
        t.lineTo(-0.5 * o + b_ * a, -0.5 * a - b_ * o),
        t.lineTo(-0.5 * u + b_ * c, -0.5 * c - b_ * u),
        t.closePath();
    }
  };
  var M_ = [u_, c_, l_, g_, v_, __, w_];
  function N_() {}
  function T_(t, n, e) {
    t._context.bezierCurveTo(
      (2 * t._x0 + t._x1) / 3,
      (2 * t._y0 + t._y1) / 3,
      (t._x0 + 2 * t._x1) / 3,
      (t._y0 + 2 * t._y1) / 3,
      (t._x0 + 4 * t._x1 + n) / 6,
      (t._y0 + 4 * t._y1 + e) / 6
    );
  }
  function A_(t) {
    this._context = t;
  }
  function S_(t) {
    this._context = t;
  }
  function k_(t) {
    this._context = t;
  }
  function E_(t, n) {
    (this._basis = new A_(t)), (this._beta = n);
  }
  (A_.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      (this._x0 = this._x1 = this._y0 = this._y1 = NaN), (this._point = 0);
    },
    lineEnd: function() {
      switch (this._point) {
        case 3:
          T_(this, this._x1, this._y1);
        case 2:
          this._context.lineTo(this._x1, this._y1);
      }
      (this._line || (this._line !== 0 &amp;&amp; this._point === 1)) &amp;&amp;
        this._context.closePath(),
        (this._line = 1 - this._line);
    },
    point: function(t, n) {
      switch (((t = +t), (n = +n), this._point)) {
        case 0:
          (this._point = 1),
            this._line
              ? this._context.lineTo(t, n)
              : this._context.moveTo(t, n);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          (this._point = 3),
            this._context.lineTo(
              (5 * this._x0 + this._x1) / 6,
              (5 * this._y0 + this._y1) / 6
            );
        default:
          T_(this, t, n);
      }
      (this._x0 = this._x1),
        (this._x1 = t),
        (this._y0 = this._y1),
        (this._y1 = n);
    }
  }),
    (S_.prototype = {
      areaStart: N_,
      areaEnd: N_,
      lineStart: function() {
        (this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN),
          (this._point = 0);
      },
      lineEnd: function() {
        switch (this._point) {
          case 1:
            this._context.moveTo(this._x2, this._y2), this._context.closePath();
            break;
          case 2:
            this._context.moveTo(
              (this._x2 + 2 * this._x3) / 3,
              (this._y2 + 2 * this._y3) / 3
            ),
              this._context.lineTo(
                (this._x3 + 2 * this._x2) / 3,
                (this._y3 + 2 * this._y2) / 3
              ),
              this._context.closePath();
            break;
          case 3:
            this.point(this._x2, this._y2),
              this.point(this._x3, this._y3),
              this.point(this._x4, this._y4);
        }
      },
      point: function(t, n) {
        switch (((t = +t), (n = +n), this._point)) {
          case 0:
            (this._point = 1), (this._x2 = t), (this._y2 = n);
            break;
          case 1:
            (this._point = 2), (this._x3 = t), (this._y3 = n);
            break;
          case 2:
            (this._point = 3),
              (this._x4 = t),
              (this._y4 = n),
              this._context.moveTo(
                (this._x0 + 4 * this._x1 + t) / 6,
                (this._y0 + 4 * this._y1 + n) / 6
              );
            break;
          default:
            T_(this, t, n);
        }
        (this._x0 = this._x1),
          (this._x1 = t),
          (this._y0 = this._y1),
          (this._y1 = n);
      }
    }),
    (k_.prototype = {
      areaStart: function() {
        this._line = 0;
      },
      areaEnd: function() {
        this._line = NaN;
      },
      lineStart: function() {
        (this._x0 = this._x1 = this._y0 = this._y1 = NaN), (this._point = 0);
      },
      lineEnd: function() {
        (this._line || (this._line !== 0 &amp;&amp; this._point === 3)) &amp;&amp;
          this._context.closePath(),
          (this._line = 1 - this._line);
      },
      point: function(t, n) {
        switch (((t = +t), (n = +n), this._point)) {
          case 0:
            this._point = 1;
            break;
          case 1:
            this._point = 2;
            break;
          case 2:
            this._point = 3;
            var e = (this._x0 + 4 * this._x1 + t) / 6;
            var r = (this._y0 + 4 * this._y1 + n) / 6;
            this._line
              ? this._context.lineTo(e, r)
              : this._context.moveTo(e, r);
            break;
          case 3:
            this._point = 4;
          default:
            T_(this, t, n);
        }
        (this._x0 = this._x1),
          (this._x1 = t),
          (this._y0 = this._y1),
          (this._y1 = n);
      }
    }),
    (E_.prototype = {
      lineStart: function() {
        (this._x = []), (this._y = []), this._basis.lineStart();
      },
      lineEnd: function() {
        var t = this._x;
        var n = this._y;
        var e = t.length - 1;
        if (e &gt; 0)
          for (
            var r, i = t[0], o = n[0], a = t[e] - i, u = n[e] - o, c = -1;
            ++c &lt;= e;

          )
            (r = c / e),
              this._basis.point(
                this._beta * t[c] + (1 - this._beta) * (i + r * a),
                this._beta * n[c] + (1 - this._beta) * (o + r * u)
              );
        (this._x = this._y = null), this._basis.lineEnd();
      },
      point: function(t, n) {
        this._x.push(+t), this._y.push(+n);
      }
    });
  var C_ = (function t(n) {
    function e(t) {
      return n === 1 ? new A_(t) : new E_(t, n);
    }
    return (
      (e.beta = function(n) {
        return t(+n);
      }),
      e
    );
  })(0.85);
  function P_(t, n, e) {
    t._context.bezierCurveTo(
      t._x1 + t._k * (t._x2 - t._x0),
      t._y1 + t._k * (t._y2 - t._y0),
      t._x2 + t._k * (t._x1 - n),
      t._y2 + t._k * (t._y1 - e),
      t._x2,
      t._y2
    );
  }
  function z_(t, n) {
    (this._context = t), (this._k = (1 - n) / 6);
  }
  z_.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN),
        (this._point = 0);
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x2, this._y2);
          break;
        case 3:
          P_(this, this._x1, this._y1);
      }
      (this._line || (this._line !== 0 &amp;&amp; this._point === 1)) &amp;&amp;
        this._context.closePath(),
        (this._line = 1 - this._line);
    },
    point: function(t, n) {
      switch (((t = +t), (n = +n), this._point)) {
        case 0:
          (this._point = 1),
            this._line
              ? this._context.lineTo(t, n)
              : this._context.moveTo(t, n);
          break;
        case 1:
          (this._point = 2), (this._x1 = t), (this._y1 = n);
          break;
        case 2:
          this._point = 3;
        default:
          P_(this, t, n);
      }
      (this._x0 = this._x1),
        (this._x1 = this._x2),
        (this._x2 = t),
        (this._y0 = this._y1),
        (this._y1 = this._y2),
        (this._y2 = n);
    }
  };
  var R_ = (function t(n) {
    function e(t) {
      return new z_(t, n);
    }
    return (
      (e.tension = function(n) {
        return t(+n);
      }),
      e
    );
  })(0);
  function D_(t, n) {
    (this._context = t), (this._k = (1 - n) / 6);
  }
  D_.prototype = {
    areaStart: N_,
    areaEnd: N_,
    lineStart: function() {
      (this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN),
        (this._point = 0);
    },
    lineEnd: function() {
      switch (this._point) {
        case 1:
          this._context.moveTo(this._x3, this._y3), this._context.closePath();
          break;
        case 2:
          this._context.lineTo(this._x3, this._y3), this._context.closePath();
          break;
        case 3:
          this.point(this._x3, this._y3),
            this.point(this._x4, this._y4),
            this.point(this._x5, this._y5);
      }
    },
    point: function(t, n) {
      switch (((t = +t), (n = +n), this._point)) {
        case 0:
          (this._point = 1), (this._x3 = t), (this._y3 = n);
          break;
        case 1:
          (this._point = 2),
            this._context.moveTo((this._x4 = t), (this._y4 = n));
          break;
        case 2:
          (this._point = 3), (this._x5 = t), (this._y5 = n);
          break;
        default:
          P_(this, t, n);
      }
      (this._x0 = this._x1),
        (this._x1 = this._x2),
        (this._x2 = t),
        (this._y0 = this._y1),
        (this._y1 = this._y2),
        (this._y2 = n);
    }
  };
  var q_ = (function t(n) {
    function e(t) {
      return new D_(t, n);
    }
    return (
      (e.tension = function(n) {
        return t(+n);
      }),
      e
    );
  })(0);
  function L_(t, n) {
    (this._context = t), (this._k = (1 - n) / 6);
  }
  L_.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN),
        (this._point = 0);
    },
    lineEnd: function() {
      (this._line || (this._line !== 0 &amp;&amp; this._point === 3)) &amp;&amp;
        this._context.closePath(),
        (this._line = 1 - this._line);
    },
    point: function(t, n) {
      switch (((t = +t), (n = +n), this._point)) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          (this._point = 3),
            this._line
              ? this._context.lineTo(this._x2, this._y2)
              : this._context.moveTo(this._x2, this._y2);
          break;
        case 3:
          this._point = 4;
        default:
          P_(this, t, n);
      }
      (this._x0 = this._x1),
        (this._x1 = this._x2),
        (this._x2 = t),
        (this._y0 = this._y1),
        (this._y1 = this._y2),
        (this._y2 = n);
    }
  };
  var U_ = (function t(n) {
    function e(t) {
      return new L_(t, n);
    }
    return (
      (e.tension = function(n) {
        return t(+n);
      }),
      e
    );
  })(0);
  function O_(t, n, e) {
    var r = t._x1;
    var i = t._y1;
    var o = t._x2;
    var a = t._y2;
    if (t._l01_a &gt; ky) {
      var u = 2 * t._l01_2a + 3 * t._l01_a * t._l12_a + t._l12_2a;
      var c = 3 * t._l01_a * (t._l01_a + t._l12_a);
      (r = (r * u - t._x0 * t._l12_2a + t._x2 * t._l01_2a) / c),
        (i = (i * u - t._y0 * t._l12_2a + t._y2 * t._l01_2a) / c);
    }
    if (t._l23_a &gt; ky) {
      var f = 2 * t._l23_2a + 3 * t._l23_a * t._l12_a + t._l12_2a;
      var s = 3 * t._l23_a * (t._l23_a + t._l12_a);
      (o = (o * f + t._x1 * t._l23_2a - n * t._l12_2a) / s),
        (a = (a * f + t._y1 * t._l23_2a - e * t._l12_2a) / s);
    }
    t._context.bezierCurveTo(r, i, o, a, t._x2, t._y2);
  }
  function B_(t, n) {
    (this._context = t), (this._alpha = n);
  }
  B_.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN),
        (this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0);
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x2, this._y2);
          break;
        case 3:
          this.point(this._x2, this._y2);
      }
      (this._line || (this._line !== 0 &amp;&amp; this._point === 1)) &amp;&amp;
        this._context.closePath(),
        (this._line = 1 - this._line);
    },
    point: function(t, n) {
      if (((t = +t), (n = +n), this._point)) {
        var e = this._x2 - t;
        var r = this._y2 - n;
        this._l23_a = Math.sqrt(
          (this._l23_2a = Math.pow(e * e + r * r, this._alpha))
        );
      }
      switch (this._point) {
        case 0:
          (this._point = 1),
            this._line
              ? this._context.lineTo(t, n)
              : this._context.moveTo(t, n);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
        default:
          O_(this, t, n);
      }
      (this._l01_a = this._l12_a),
        (this._l12_a = this._l23_a),
        (this._l01_2a = this._l12_2a),
        (this._l12_2a = this._l23_2a),
        (this._x0 = this._x1),
        (this._x1 = this._x2),
        (this._x2 = t),
        (this._y0 = this._y1),
        (this._y1 = this._y2),
        (this._y2 = n);
    }
  };
  var F_ = (function t(n) {
    function e(t) {
      return n ? new B_(t, n) : new z_(t, 0);
    }
    return (
      (e.alpha = function(n) {
        return t(+n);
      }),
      e
    );
  })(0.5);
  function Y_(t, n) {
    (this._context = t), (this._alpha = n);
  }
  Y_.prototype = {
    areaStart: N_,
    areaEnd: N_,
    lineStart: function() {
      (this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN),
        (this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0);
    },
    lineEnd: function() {
      switch (this._point) {
        case 1:
          this._context.moveTo(this._x3, this._y3), this._context.closePath();
          break;
        case 2:
          this._context.lineTo(this._x3, this._y3), this._context.closePath();
          break;
        case 3:
          this.point(this._x3, this._y3),
            this.point(this._x4, this._y4),
            this.point(this._x5, this._y5);
      }
    },
    point: function(t, n) {
      if (((t = +t), (n = +n), this._point)) {
        var e = this._x2 - t;
        var r = this._y2 - n;
        this._l23_a = Math.sqrt(
          (this._l23_2a = Math.pow(e * e + r * r, this._alpha))
        );
      }
      switch (this._point) {
        case 0:
          (this._point = 1), (this._x3 = t), (this._y3 = n);
          break;
        case 1:
          (this._point = 2),
            this._context.moveTo((this._x4 = t), (this._y4 = n));
          break;
        case 2:
          (this._point = 3), (this._x5 = t), (this._y5 = n);
          break;
        default:
          O_(this, t, n);
      }
      (this._l01_a = this._l12_a),
        (this._l12_a = this._l23_a),
        (this._l01_2a = this._l12_2a),
        (this._l12_2a = this._l23_2a),
        (this._x0 = this._x1),
        (this._x1 = this._x2),
        (this._x2 = t),
        (this._y0 = this._y1),
        (this._y1 = this._y2),
        (this._y2 = n);
    }
  };
  var I_ = (function t(n) {
    function e(t) {
      return n ? new Y_(t, n) : new D_(t, 0);
    }
    return (
      (e.alpha = function(n) {
        return t(+n);
      }),
      e
    );
  })(0.5);
  function H_(t, n) {
    (this._context = t), (this._alpha = n);
  }
  H_.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN),
        (this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0);
    },
    lineEnd: function() {
      (this._line || (this._line !== 0 &amp;&amp; this._point === 3)) &amp;&amp;
        this._context.closePath(),
        (this._line = 1 - this._line);
    },
    point: function(t, n) {
      if (((t = +t), (n = +n), this._point)) {
        var e = this._x2 - t;
        var r = this._y2 - n;
        this._l23_a = Math.sqrt(
          (this._l23_2a = Math.pow(e * e + r * r, this._alpha))
        );
      }
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          (this._point = 3),
            this._line
              ? this._context.lineTo(this._x2, this._y2)
              : this._context.moveTo(this._x2, this._y2);
          break;
        case 3:
          this._point = 4;
        default:
          O_(this, t, n);
      }
      (this._l01_a = this._l12_a),
        (this._l12_a = this._l23_a),
        (this._l01_2a = this._l12_2a),
        (this._l12_2a = this._l23_2a),
        (this._x0 = this._x1),
        (this._x1 = this._x2),
        (this._x2 = t),
        (this._y0 = this._y1),
        (this._y1 = this._y2),
        (this._y2 = n);
    }
  };
  var j_ = (function t(n) {
    function e(t) {
      return n ? new H_(t, n) : new L_(t, 0);
    }
    return (
      (e.alpha = function(n) {
        return t(+n);
      }),
      e
    );
  })(0.5);
  function X_(t) {
    this._context = t;
  }
  function V_(t) {
    return t &lt; 0 ? -1 : 1;
  }
  function G_(t, n, e) {
    var r = t._x1 - t._x0;
    var i = n - t._x1;
    var o = (t._y1 - t._y0) / (r || (i &lt; 0 &amp;&amp; -0));
    var a = (e - t._y1) / (i || (r &lt; 0 &amp;&amp; -0));
    var u = (o * i + a * r) / (r + i);
    return (
      (V_(o) + V_(a)) * Math.min(Math.abs(o), Math.abs(a), 0.5 * Math.abs(u)) ||
      0
    );
  }
  function $_(t, n) {
    var e = t._x1 - t._x0;
    return e ? ((3 * (t._y1 - t._y0)) / e - n) / 2 : n;
  }
  function W_(t, n, e) {
    var r = t._x0;
    var i = t._y0;
    var o = t._x1;
    var a = t._y1;
    var u = (o - r) / 3;
    t._context.bezierCurveTo(r + u, i + u * n, o - u, a - u * e, o, a);
  }
  function Z_(t) {
    this._context = t;
  }
  function Q_(t) {
    this._context = new K_(t);
  }
  function K_(t) {
    this._context = t;
  }
  function J_(t) {
    this._context = t;
  }
  function tb(t) {
    var n;
    var e;
    var r = t.length - 1;
    var i = new Array(r);
    var o = new Array(r);
    var a = new Array(r);
    for (i[0] = 0, o[0] = 2, a[0] = t[0] + 2 * t[1], n = 1; n &lt; r - 1; ++n)
      (i[n] = 1), (o[n] = 4), (a[n] = 4 * t[n] + 2 * t[n + 1]);
    for (
      i[r - 1] = 2, o[r - 1] = 7, a[r - 1] = 8 * t[r - 1] + t[r], n = 1;
      n &lt; r;
      ++n
    )
      (e = i[n] / o[n - 1]), (o[n] -= e), (a[n] -= e * a[n - 1]);
    for (i[r - 1] = a[r - 1] / o[r - 1], n = r - 2; n &gt;= 0; --n)
      i[n] = (a[n] - i[n + 1]) / o[n];
    for (o[r - 1] = (t[r] + i[r - 1]) / 2, n = 0; n &lt; r - 1; ++n)
      o[n] = 2 * t[n + 1] - i[n + 1];
    return [i, o];
  }
  function nb(t, n) {
    (this._context = t), (this._t = n);
  }
  function eb(t, n) {
    if ((i = t.length) &gt; 1)
      for (var e, r, i, o = 1, a = t[n[0]], u = a.length; o &lt; i; ++o)
        for (r = a, a = t[n[o]], e = 0; e &lt; u; ++e)
          a[e][1] += a[e][0] = isNaN(r[e][1]) ? r[e][0] : r[e][1];
  }
  function rb(t) {
    for (var n = t.length, e = new Array(n); --n &gt;= 0; ) e[n] = n;
    return e;
  }
  function ib(t, n) {
    return t[n];
  }
  function ob(t) {
    var n = t.map(ab);
    return rb(t).sort(function(t, e) {
      return n[t] - n[e];
    });
  }
  function ab(t) {
    for (var n, e = -1, r = 0, i = t.length, o = -1 / 0; ++e &lt; i; )
      (n = +t[e][1]) &gt; o &amp;&amp; ((o = n), (r = e));
    return r;
  }
  function ub(t) {
    var n = t.map(cb);
    return rb(t).sort(function(t, e) {
      return n[t] - n[e];
    });
  }
  function cb(t) {
    for (var n, e = 0, r = -1, i = t.length; ++r &lt; i; )
      (n = +t[r][1]) &amp;&amp; (e += n);
    return e;
  }
  function fb(t) {
    return function() {
      return t;
    };
  }
  function sb(t) {
    return t[0];
  }
  function lb(t) {
    return t[1];
  }
  function hb() {
    this._ = null;
  }
  function db(t) {
    t.U = t.C = t.L = t.R = t.P = t.N = null;
  }
  function pb(t, n) {
    var e = n;
    var r = n.R;
    var i = e.U;
    i ? (i.L === e ? (i.L = r) : (i.R = r)) : (t._ = r),
      (r.U = i),
      (e.U = r),
      (e.R = r.L),
      e.R &amp;&amp; (e.R.U = e),
      (r.L = e);
  }
  function vb(t, n) {
    var e = n;
    var r = n.L;
    var i = e.U;
    i ? (i.L === e ? (i.L = r) : (i.R = r)) : (t._ = r),
      (r.U = i),
      (e.U = r),
      (e.L = r.R),
      e.L &amp;&amp; (e.L.U = e),
      (r.R = e);
  }
  function gb(t) {
    for (; t.L; ) t = t.L;
    return t;
  }
  function yb(t, n, e, r) {
    var i = [null, null];
    var o = Yb.push(i) - 1;
    return (
      (i.left = t),
      (i.right = n),
      e &amp;&amp; bb(i, t, n, e),
      r &amp;&amp; bb(i, n, t, r),
      Bb[t.index].halfedges.push(o),
      Bb[n.index].halfedges.push(o),
      i
    );
  }
  function _b(t, n, e) {
    var r = [n, e];
    return (r.left = t), r;
  }
  function bb(t, n, e, r) {
    t[0] || t[1]
      ? t.left === e
        ? (t[1] = r)
        : (t[0] = r)
      : ((t[0] = r), (t.left = n), (t.right = e));
  }
  function mb(t, n, e, r, i) {
    var o;
    var a = t[0];
    var u = t[1];
    var c = a[0];
    var f = a[1];
    var s = 0;
    var l = 1;
    var h = u[0] - c;
    var d = u[1] - f;
    if (((o = n - c), h || !(o &gt; 0))) {
      if (((o /= h), h &lt; 0)) {
        if (o &lt; s) return;
        o &lt; l &amp;&amp; (l = o);
      } else if (h &gt; 0) {
        if (o &gt; l) return;
        o &gt; s &amp;&amp; (s = o);
      }
      if (((o = r - c), h || !(o &lt; 0))) {
        if (((o /= h), h &lt; 0)) {
          if (o &gt; l) return;
          o &gt; s &amp;&amp; (s = o);
        } else if (h &gt; 0) {
          if (o &lt; s) return;
          o &lt; l &amp;&amp; (l = o);
        }
        if (((o = e - f), d || !(o &gt; 0))) {
          if (((o /= d), d &lt; 0)) {
            if (o &lt; s) return;
            o &lt; l &amp;&amp; (l = o);
          } else if (d &gt; 0) {
            if (o &gt; l) return;
            o &gt; s &amp;&amp; (s = o);
          }
          if (((o = i - f), d || !(o &lt; 0))) {
            if (((o /= d), d &lt; 0)) {
              if (o &gt; l) return;
              o &gt; s &amp;&amp; (s = o);
            } else if (d &gt; 0) {
              if (o &lt; s) return;
              o &lt; l &amp;&amp; (l = o);
            }
            return (
              !(s &gt; 0 || l &lt; 1) ||
              (s &gt; 0 &amp;&amp; (t[0] = [c + s * h, f + s * d]),
              l &lt; 1 &amp;&amp; (t[1] = [c + l * h, f + l * d]),
              !0)
            );
          }
        }
      }
    }
  }
  function xb(t, n, e, r, i) {
    var o = t[1];
    if (o) return !0;
    var a;
    var u;
    var c = t[0];
    var f = t.left;
    var s = t.right;
    var l = f[0];
    var h = f[1];
    var d = s[0];
    var p = s[1];
    var v = (l + d) / 2;
    var g = (h + p) / 2;
    if (p === h) {
      if (v &lt; n || v &gt;= r) return;
      if (l &gt; d) {
        if (c) {
          if (c[1] &gt;= i) return;
        } else c = [v, e];
        o = [v, i];
      } else {
        if (c) {
          if (c[1] &lt; e) return;
        } else c = [v, i];
        o = [v, e];
      }
    } else if (((u = g - (a = (l - d) / (p - h)) * v), a &lt; -1 || a &gt; 1))
      if (l &gt; d) {
        if (c) {
          if (c[1] &gt;= i) return;
        } else c = [(e - u) / a, e];
        o = [(i - u) / a, i];
      } else {
        if (c) {
          if (c[1] &lt; e) return;
        } else c = [(i - u) / a, i];
        o = [(e - u) / a, e];
      }
    else if (h &lt; p) {
      if (c) {
        if (c[0] &gt;= r) return;
      } else c = [n, a * n + u];
      o = [r, a * r + u];
    } else {
      if (c) {
        if (c[0] &lt; n) return;
      } else c = [r, a * r + u];
      o = [n, a * n + u];
    }
    return (t[0] = c), (t[1] = o), !0;
  }
  function wb(t, n) {
    var e = t.site;
    var r = n.left;
    var i = n.right;
    return (
      e === i &amp;&amp; ((i = r), (r = e)),
      i
        ? Math.atan2(i[1] - r[1], i[0] - r[0])
        : (e === r ? ((r = n[1]), (i = n[0])) : ((r = n[0]), (i = n[1])),
          Math.atan2(r[0] - i[0], i[1] - r[1]))
    );
  }
  function Mb(t, n) {
    return n[+(n.left !== t.site)];
  }
  function Nb(t, n) {
    return n[+(n.left === t.site)];
  }
  (X_.prototype = {
    areaStart: N_,
    areaEnd: N_,
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      this._point &amp;&amp; this._context.closePath();
    },
    point: function(t, n) {
      (t = +t),
        (n = +n),
        this._point
          ? this._context.lineTo(t, n)
          : ((this._point = 1), this._context.moveTo(t, n));
    }
  }),
    (Z_.prototype = {
      areaStart: function() {
        this._line = 0;
      },
      areaEnd: function() {
        this._line = NaN;
      },
      lineStart: function() {
        (this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN),
          (this._point = 0);
      },
      lineEnd: function() {
        switch (this._point) {
          case 2:
            this._context.lineTo(this._x1, this._y1);
            break;
          case 3:
            W_(this, this._t0, $_(this, this._t0));
        }
        (this._line || (this._line !== 0 &amp;&amp; this._point === 1)) &amp;&amp;
          this._context.closePath(),
          (this._line = 1 - this._line);
      },
      point: function(t, n) {
        var e = NaN;
        if (((n = +n), (t = +t) !== this._x1 || n !== this._y1)) {
          switch (this._point) {
            case 0:
              (this._point = 1),
                this._line
                  ? this._context.lineTo(t, n)
                  : this._context.moveTo(t, n);
              break;
            case 1:
              this._point = 2;
              break;
            case 2:
              (this._point = 3), W_(this, $_(this, (e = G_(this, t, n))), e);
              break;
            default:
              W_(this, this._t0, (e = G_(this, t, n)));
          }
          (this._x0 = this._x1),
            (this._x1 = t),
            (this._y0 = this._y1),
            (this._y1 = n),
            (this._t0 = e);
        }
      }
    }),
    ((Q_.prototype = Object.create(Z_.prototype)).point = function(t, n) {
      Z_.prototype.point.call(this, n, t);
    }),
    (K_.prototype = {
      moveTo: function(t, n) {
        this._context.moveTo(n, t);
      },
      closePath: function() {
        this._context.closePath();
      },
      lineTo: function(t, n) {
        this._context.lineTo(n, t);
      },
      bezierCurveTo: function(t, n, e, r, i, o) {
        this._context.bezierCurveTo(n, t, r, e, o, i);
      }
    }),
    (J_.prototype = {
      areaStart: function() {
        this._line = 0;
      },
      areaEnd: function() {
        this._line = NaN;
      },
      lineStart: function() {
        (this._x = []), (this._y = []);
      },
      lineEnd: function() {
        var t = this._x;
        var n = this._y;
        var e = t.length;
        if (e)
          if (
            (this._line
              ? this._context.lineTo(t[0], n[0])
              : this._context.moveTo(t[0], n[0]),
            e === 2)
          )
            this._context.lineTo(t[1], n[1]);
          else
            for (var r = tb(t), i = tb(n), o = 0, a = 1; a &lt; e; ++o, ++a)
              this._context.bezierCurveTo(
                r[0][o],
                i[0][o],
                r[1][o],
                i[1][o],
                t[a],
                n[a]
              );
        (this._line || (this._line !== 0 &amp;&amp; e === 1)) &amp;&amp;
          this._context.closePath(),
          (this._line = 1 - this._line),
          (this._x = this._y = null);
      },
      point: function(t, n) {
        this._x.push(+t), this._y.push(+n);
      }
    }),
    (nb.prototype = {
      areaStart: function() {
        this._line = 0;
      },
      areaEnd: function() {
        this._line = NaN;
      },
      lineStart: function() {
        (this._x = this._y = NaN), (this._point = 0);
      },
      lineEnd: function() {
        this._t &gt; 0 &amp;&amp;
          this._t &lt; 1 &amp;&amp;
          this._point === 2 &amp;&amp;
          this._context.lineTo(this._x, this._y),
          (this._line || (this._line !== 0 &amp;&amp; this._point === 1)) &amp;&amp;
            this._context.closePath(),
          this._line &gt;= 0 &amp;&amp;
            ((this._t = 1 - this._t), (this._line = 1 - this._line));
      },
      point: function(t, n) {
        switch (((t = +t), (n = +n), this._point)) {
          case 0:
            (this._point = 1),
              this._line
                ? this._context.lineTo(t, n)
                : this._context.moveTo(t, n);
            break;
          case 1:
            this._point = 2;
          default:
            if (this._t &lt;= 0)
              this._context.lineTo(this._x, n), this._context.lineTo(t, n);
            else {
              var e = this._x * (1 - this._t) + t * this._t;
              this._context.lineTo(e, this._y), this._context.lineTo(e, n);
            }
        }
        (this._x = t), (this._y = n);
      }
    }),
    (hb.prototype = {
      constructor: hb,
      insert: function(t, n) {
        var e;
        var r;
        var i;
        if (t) {
          if (((n.P = t), (n.N = t.N), t.N &amp;&amp; (t.N.P = n), (t.N = n), t.R)) {
            for (t = t.R; t.L; ) t = t.L;
            t.L = n;
          } else t.R = n;
          e = t;
        } else
          this._
            ? ((t = gb(this._)),
              (n.P = null),
              (n.N = t),
              (t.P = t.L = n),
              (e = t))
            : ((n.P = n.N = null), (this._ = n), (e = null));
        for (n.L = n.R = null, n.U = e, n.C = !0, t = n; e &amp;&amp; e.C; )
          e === (r = e.U).L
            ? (i = r.R) &amp;&amp; i.C
              ? ((e.C = i.C = !1), (r.C = !0), (t = r))
              : (t === e.R &amp;&amp; (pb(this, e), (e = (t = e).U)),
                (e.C = !1),
                (r.C = !0),
                vb(this, r))
            : (i = r.L) &amp;&amp; i.C
            ? ((e.C = i.C = !1), (r.C = !0), (t = r))
            : (t === e.L &amp;&amp; (vb(this, e), (e = (t = e).U)),
              (e.C = !1),
              (r.C = !0),
              pb(this, r)),
            (e = t.U);
        this._.C = !1;
      },
      remove: function(t) {
        t.N &amp;&amp; (t.N.P = t.P), t.P &amp;&amp; (t.P.N = t.N), (t.N = t.P = null);
        var n;
        var e;
        var r;
        var i = t.U;
        var o = t.L;
        var a = t.R;
        if (
          ((e = o ? (a ? gb(a) : o) : a),
          i ? (i.L === t ? (i.L = e) : (i.R = e)) : (this._ = e),
          o &amp;&amp; a
            ? ((r = e.C),
              (e.C = t.C),
              (e.L = o),
              (o.U = e),
              e !== a
                ? ((i = e.U),
                  (e.U = t.U),
                  (t = e.R),
                  (i.L = t),
                  (e.R = a),
                  (a.U = e))
                : ((e.U = i), (i = e), (t = e.R)))
            : ((r = t.C), (t = e)),
          t &amp;&amp; (t.U = i),
          !r)
        )
          if (t &amp;&amp; t.C) t.C = !1;
          else {
            do {
              if (t === this._) break;
              if (t === i.L) {
                if (
                  ((n = i.R).C &amp;&amp;
                    ((n.C = !1), (i.C = !0), pb(this, i), (n = i.R)),
                  (n.L &amp;&amp; n.L.C) || (n.R &amp;&amp; n.R.C))
                ) {
                  (n.R &amp;&amp; n.R.C) ||
                    ((n.L.C = !1), (n.C = !0), vb(this, n), (n = i.R)),
                    (n.C = i.C),
                    (i.C = n.R.C = !1),
                    pb(this, i),
                    (t = this._);
                  break;
                }
              } else if (
                ((n = i.L).C &amp;&amp;
                  ((n.C = !1), (i.C = !0), vb(this, i), (n = i.L)),
                (n.L &amp;&amp; n.L.C) || (n.R &amp;&amp; n.R.C))
              ) {
                (n.L &amp;&amp; n.L.C) ||
                  ((n.R.C = !1), (n.C = !0), pb(this, n), (n = i.L)),
                  (n.C = i.C),
                  (i.C = n.L.C = !1),
                  vb(this, i),
                  (t = this._);
                break;
              }
              (n.C = !0), (t = i), (i = i.U);
            } while (!t.C);
            t &amp;&amp; (t.C = !1);
          }
      }
    });
  var Tb;
  var Ab = [];
  function Sb() {
    db(this), (this.x = this.y = this.arc = this.site = this.cy = null);
  }
  function kb(t) {
    var n = t.P;
    var e = t.N;
    if (n &amp;&amp; e) {
      var r = n.site;
      var i = t.site;
      var o = e.site;
      if (r !== o) {
        var a = i[0];
        var u = i[1];
        var c = r[0] - a;
        var f = r[1] - u;
        var s = o[0] - a;
        var l = o[1] - u;
        var h = 2 * (c * l - f * s);
        if (!(h &gt;= -Hb)) {
          var d = c * c + f * f;
          var p = s * s + l * l;
          var v = (l * d - f * p) / h;
          var g = (c * p - s * d) / h;
          var y = Ab.pop() || new Sb();
          (y.arc = t),
            (y.site = i),
            (y.x = v + a),
            (y.y = (y.cy = g + u) + Math.sqrt(v * v + g * g)),
            (t.circle = y);
          for (var _ = null, b = Fb._; b; )
            if (y.y &lt; b.y || (y.y === b.y &amp;&amp; y.x &lt;= b.x)) {
              if (!b.L) {
                _ = b.P;
                break;
              }
              b = b.L;
            } else {
              if (!b.R) {
                _ = b;
                break;
              }
              b = b.R;
            }
          Fb.insert(_, y), _ || (Tb = y);
        }
      }
    }
  }
  function Eb(t) {
    var n = t.circle;
    n &amp;&amp;
      (n.P || (Tb = n.N), Fb.remove(n), Ab.push(n), db(n), (t.circle = null));
  }
  var Cb = [];
  function Pb() {
    db(this), (this.edge = this.site = this.circle = null);
  }
  function zb(t) {
    var n = Cb.pop() || new Pb();
    return (n.site = t), n;
  }
  function Rb(t) {
    Eb(t), Ob.remove(t), Cb.push(t), db(t);
  }
  function Db(t) {
    var n = t.circle;
    var e = n.x;
    var r = n.cy;
    var i = [e, r];
    var o = t.P;
    var a = t.N;
    var u = [t];
    Rb(t);
    for (
      var c = o;
      c.circle &amp;&amp;
      Math.abs(e - c.circle.x) &lt; Ib &amp;&amp;
      Math.abs(r - c.circle.cy) &lt; Ib;

    )
      (o = c.P), u.unshift(c), Rb(c), (c = o);
    u.unshift(c), Eb(c);
    for (
      var f = a;
      f.circle &amp;&amp;
      Math.abs(e - f.circle.x) &lt; Ib &amp;&amp;
      Math.abs(r - f.circle.cy) &lt; Ib;

    )
      (a = f.N), u.push(f), Rb(f), (f = a);
    u.push(f), Eb(f);
    var s;
    var l = u.length;
    for (s = 1; s &lt; l; ++s)
      (f = u[s]), (c = u[s - 1]), bb(f.edge, c.site, f.site, i);
    (c = u[0]),
      ((f = u[l - 1]).edge = yb(c.site, f.site, null, i)),
      kb(c),
      kb(f);
  }
  function qb(t) {
    for (var n, e, r, i, o = t[0], a = t[1], u = Ob._; u; )
      if ((r = Lb(u, a) - o) &gt; Ib) u = u.L;
      else {
        if (!((i = o - Ub(u, a)) &gt; Ib)) {
          r &gt; -Ib
            ? ((n = u.P), (e = u))
            : i &gt; -Ib
            ? ((n = u), (e = u.N))
            : (n = e = u);
          break;
        }
        if (!u.R) {
          n = u;
          break;
        }
        u = u.R;
      }
    !(function(t) {
      Bb[t.index] = { site: t, halfedges: [] };
    })(t);
    var c = zb(t);
    if ((Ob.insert(n, c), n || e)) {
      if (n === e)
        return (
          Eb(n),
          (e = zb(n.site)),
          Ob.insert(c, e),
          (c.edge = e.edge = yb(n.site, c.site)),
          kb(n),
          void kb(e)
        );
      if (e) {
        Eb(n), Eb(e);
        var f = n.site;
        var s = f[0];
        var l = f[1];
        var h = t[0] - s;
        var d = t[1] - l;
        var p = e.site;
        var v = p[0] - s;
        var g = p[1] - l;
        var y = 2 * (h * g - d * v);
        var _ = h * h + d * d;
        var b = v * v + g * g;
        var m = [(g * _ - d * b) / y + s, (h * b - v * _) / y + l];
        bb(e.edge, f, p, m),
          (c.edge = yb(f, t, null, m)),
          (e.edge = yb(t, p, null, m)),
          kb(n),
          kb(e);
      } else c.edge = yb(n.site, c.site);
    }
  }
  function Lb(t, n) {
    var e = t.site;
    var r = e[0];
    var i = e[1];
    var o = i - n;
    if (!o) return r;
    var a = t.P;
    if (!a) return -1 / 0;
    var u = (e = a.site)[0];
    var c = e[1];
    var f = c - n;
    if (!f) return u;
    var s = u - r;
    var l = 1 / o - 1 / f;
    var h = s / f;
    return l
      ? (-h +
          Math.sqrt(
            h * h - 2 * l * ((s * s) / (-2 * f) - c + f / 2 + i - o / 2)
          )) /
          l +
          r
      : (r + u) / 2;
  }
  function Ub(t, n) {
    var e = t.N;
    if (e) return Lb(e, n);
    var r = t.site;
    return r[1] === n ? r[0] : 1 / 0;
  }
  var Ob;
  var Bb;
  var Fb;
  var Yb;
  var Ib = 1e-6;
  var Hb = 1e-12;
  function jb(t, n, e) {
    return (t[0] - e[0]) * (n[1] - t[1]) - (t[0] - n[0]) * (e[1] - t[1]);
  }
  function Xb(t, n) {
    return n[1] - t[1] || n[0] - t[0];
  }
  function Vb(t, n) {
    var e;
    var r;
    var i;
    var o = t.sort(Xb).pop();
    for (Yb = [], Bb = new Array(t.length), Ob = new hb(), Fb = new hb(); ; )
      if (((i = Tb), o &amp;&amp; (!i || o[1] &lt; i.y || (o[1] === i.y &amp;&amp; o[0] &lt; i.x))))
        (o[0] === e &amp;&amp; o[1] === r) || (qb(o), (e = o[0]), (r = o[1])),
          (o = t.pop());
      else {
        if (!i) break;
        Db(i.arc);
      }
    if (
      ((function() {
        for (var t, n, e, r, i = 0, o = Bb.length; i &lt; o; ++i)
          if ((t = Bb[i]) &amp;&amp; (r = (n = t.halfedges).length)) {
            var a = new Array(r);
            var u = new Array(r);
            for (e = 0; e &lt; r; ++e) (a[e] = e), (u[e] = wb(t, Yb[n[e]]));
            for (
              a.sort(function(t, n) {
                return u[n] - u[t];
              }),
                e = 0;
              e &lt; r;
              ++e
            )
              u[e] = n[a[e]];
            for (e = 0; e &lt; r; ++e) n[e] = u[e];
          }
      })(),
      n)
    ) {
      var a = +n[0][0];
      var u = +n[0][1];
      var c = +n[1][0];
      var f = +n[1][1];
      !(function(t, n, e, r) {
        for (var i, o = Yb.length; o--; )
          (xb((i = Yb[o]), t, n, e, r) &amp;&amp;
            mb(i, t, n, e, r) &amp;&amp;
            (Math.abs(i[0][0] - i[1][0]) &gt; Ib ||
              Math.abs(i[0][1] - i[1][1]) &gt; Ib)) ||
            delete Yb[o];
      })(a, u, c, f),
        (function(t, n, e, r) {
          var i;
          var o;
          var a;
          var u;
          var c;
          var f;
          var s;
          var l;
          var h;
          var d;
          var p;
          var v;
          var g = Bb.length;
          var y = !0;
          for (i = 0; i &lt; g; ++i)
            if ((o = Bb[i])) {
              for (a = o.site, u = (c = o.halfedges).length; u--; )
                Yb[c[u]] || c.splice(u, 1);
              for (u = 0, f = c.length; u &lt; f; )
                (p = (d = Nb(o, Yb[c[u]]))[0]),
                  (v = d[1]),
                  (l = (s = Mb(o, Yb[c[++u % f]]))[0]),
                  (h = s[1]),
                  (Math.abs(p - l) &gt; Ib || Math.abs(v - h) &gt; Ib) &amp;&amp;
                    (c.splice(
                      u,
                      0,
                      Yb.push(
                        _b(
                          a,
                          d,
                          Math.abs(p - t) &lt; Ib &amp;&amp; r - v &gt; Ib
                            ? [t, Math.abs(l - t) &lt; Ib ? h : r]
                            : Math.abs(v - r) &lt; Ib &amp;&amp; e - p &gt; Ib
                            ? [Math.abs(h - r) &lt; Ib ? l : e, r]
                            : Math.abs(p - e) &lt; Ib &amp;&amp; v - n &gt; Ib
                            ? [e, Math.abs(l - e) &lt; Ib ? h : n]
                            : Math.abs(v - n) &lt; Ib &amp;&amp; p - t &gt; Ib
                            ? [Math.abs(h - n) &lt; Ib ? l : t, n]
                            : null
                        )
                      ) - 1
                    ),
                    ++f);
              f &amp;&amp; (y = !1);
            }
          if (y) {
            var _;
            var b;
            var m;
            var x = 1 / 0;
            for (i = 0, y = null; i &lt; g; ++i)
              (o = Bb[i]) &amp;&amp;
                (m = (_ = (a = o.site)[0] - t) * _ + (b = a[1] - n) * b) &lt; x &amp;&amp;
                ((x = m), (y = o));
            if (y) {
              var w = [t, n];
              var M = [t, r];
              var N = [e, r];
              var T = [e, n];
              y.halfedges.push(
                Yb.push(_b((a = y.site), w, M)) - 1,
                Yb.push(_b(a, M, N)) - 1,
                Yb.push(_b(a, N, T)) - 1,
                Yb.push(_b(a, T, w)) - 1
              );
            }
          }
          for (i = 0; i &lt; g; ++i)
            (o = Bb[i]) &amp;&amp; (o.halfedges.length || delete Bb[i]);
        })(a, u, c, f);
    }
    (this.edges = Yb), (this.cells = Bb), (Ob = Fb = Yb = Bb = null);
  }
  function Gb(t) {
    return function() {
      return t;
    };
  }
  function $b(t, n, e) {
    (this.target = t), (this.type = n), (this.transform = e);
  }
  function Wb(t, n, e) {
    (this.k = t), (this.x = n), (this.y = e);
  }
  (Vb.prototype = {
    constructor: Vb,
    polygons: function() {
      var t = this.edges;
      return this.cells.map(function(n) {
        var e = n.halfedges.map(function(e) {
          return Mb(n, t[e]);
        });
        return (e.data = n.site.data), e;
      });
    },
    triangles: function() {
      var t = [];
      var n = this.edges;
      return (
        this.cells.forEach(function(e, r) {
          if ((o = (i = e.halfedges).length))
            for (
              var i,
                o,
                a,
                u = e.site,
                c = -1,
                f = n[i[o - 1]],
                s = f.left === u ? f.right : f.left;
              ++c &lt; o;

            )
              (a = s),
                (s = (f = n[i[c]]).left === u ? f.right : f.left),
                a &amp;&amp;
                  s &amp;&amp;
                  r &lt; a.index &amp;&amp;
                  r &lt; s.index &amp;&amp;
                  jb(u, a, s) &lt; 0 &amp;&amp;
                  t.push([u.data, a.data, s.data]);
        }),
        t
      );
    },
    links: function() {
      return this.edges
        .filter(function(t) {
          return t.right;
        })
        .map(function(t) {
          return { source: t.left.data, target: t.right.data };
        });
    },
    find: function(t, n, e) {
      for (
        var r, i, o = this, a = o._found || 0, u = o.cells.length;
        !(i = o.cells[a]);

      )
        if (++a &gt;= u) return null;
      var c = t - i.site[0];
      var f = n - i.site[1];
      var s = c * c + f * f;
      do {
        (i = o.cells[(r = a)]),
          (a = null),
          i.halfedges.forEach(function(e) {
            var r = o.edges[e];
            var u = r.left;
            if ((u !== i.site &amp;&amp; u) || (u = r.right)) {
              var c = t - u[0];
              var f = n - u[1];
              var l = c * c + f * f;
              l &lt; s &amp;&amp; ((s = l), (a = u.index));
            }
          });
      } while (a !== null);
      return (o._found = r), e == null || s &lt;= e * e ? i.site : null;
    }
  }),
    (Wb.prototype = {
      constructor: Wb,
      scale: function(t) {
        return t === 1 ? this : new Wb(this.k * t, this.x, this.y);
      },
      translate: function(t, n) {
        return (t === 0) &amp; (n === 0)
          ? this
          : new Wb(this.k, this.x + this.k * t, this.y + this.k * n);
      },
      apply: function(t) {
        return [t[0] * this.k + this.x, t[1] * this.k + this.y];
      },
      applyX: function(t) {
        return t * this.k + this.x;
      },
      applyY: function(t) {
        return t * this.k + this.y;
      },
      invert: function(t) {
        return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k];
      },
      invertX: function(t) {
        return (t - this.x) / this.k;
      },
      invertY: function(t) {
        return (t - this.y) / this.k;
      },
      rescaleX: function(t) {
        return t.copy().domain(
          t
            .range()
            .map(this.invertX, this)
            .map(t.invert, t)
        );
      },
      rescaleY: function(t) {
        return t.copy().domain(
          t
            .range()
            .map(this.invertY, this)
            .map(t.invert, t)
        );
      },
      toString: function() {
        return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
      }
    });
  var Zb = new Wb(1, 0, 0);
  function Qb(t) {
    for (; !t.__zoom; ) if (!(t = t.parentNode)) return Zb;
    return t.__zoom;
  }
  function Kb() {
    t.event.stopImmediatePropagation();
  }
  function Jb() {
    t.event.preventDefault(), t.event.stopImmediatePropagation();
  }
  function tm() {
    return !t.event.ctrlKey &amp;&amp; !t.event.button;
  }
  function nm() {
    var t = this;
    return t instanceof SVGElement
      ? (t = t.ownerSVGElement || t).hasAttribute("viewBox")
        ? [[(t = t.viewBox.baseVal).x, t.y], [t.x + t.width, t.y + t.height]]
        : [[0, 0], [t.width.baseVal.value, t.height.baseVal.value]]
      : [[0, 0], [t.clientWidth, t.clientHeight]];
  }
  function em() {
    return this.__zoom || Zb;
  }
  function rm() {
    return (
      -t.event.deltaY *
      (t.event.deltaMode === 1 ? 0.05 : t.event.deltaMode ? 1 : 0.002)
    );
  }
  function im() {
    return navigator.maxTouchPoints || "ontouchstart" in this;
  }
  function om(t, n, e) {
    var r = t.invertX(n[0][0]) - e[0][0];
    var i = t.invertX(n[1][0]) - e[1][0];
    var o = t.invertY(n[0][1]) - e[0][1];
    var a = t.invertY(n[1][1]) - e[1][1];
    return t.translate(
      i &gt; r ? (r + i) / 2 : Math.min(0, r) || Math.max(0, i),
      a &gt; o ? (o + a) / 2 : Math.min(0, o) || Math.max(0, a)
    );
  }
  (Qb.prototype = Wb.prototype),
    (t.FormatSpecifier = Ba),
    (t.active = function(t, n) {
      var e;
      var r;
      var i = t.__transition;
      if (i)
        for (r in ((n = n == null ? null : n + ""), i))
          if ((e = i[r]).state &gt; xr &amp;&amp; e.name === n)
            return new Ur([[t]], yi, n, +r);
      return null;
    }),
    (t.arc = function() {
      var t = Ry;
      var n = Dy;
      var e = my(0);
      var r = null;
      var i = qy;
      var o = Ly;
      var a = Uy;
      var u = null;
      function c() {
        var c;
        var f;
        var s = +t.apply(this, arguments);
        var l = +n.apply(this, arguments);
        var h = i.apply(this, arguments) - Cy;
        var d = o.apply(this, arguments) - Cy;
        var p = xy(d - h);
        var v = d &gt; h;
        if ((u || (u = c = no()), l &lt; s &amp;&amp; ((f = l), (l = s), (s = f)), l &gt; ky))
          if (p &gt; Py - ky)
            u.moveTo(l * My(h), l * Ay(h)),
              u.arc(0, 0, l, h, d, !v),
              s &gt; ky &amp;&amp;
                (u.moveTo(s * My(d), s * Ay(d)), u.arc(0, 0, s, d, h, v));
          else {
            var g;
            var y;
            var _ = h;
            var b = d;
            var m = h;
            var x = d;
            var w = p;
            var M = p;
            var N = a.apply(this, arguments) / 2;
            var T =
              N &gt; ky &amp;&amp; (r ? +r.apply(this, arguments) : Sy(s * s + l * l));
            var A = Ty(xy(l - s) / 2, +e.apply(this, arguments));
            var S = A;
            var k = A;
            if (T &gt; ky) {
              var E = zy((T / s) * Ay(N));
              var C = zy((T / l) * Ay(N));
              (w -= 2 * E) &gt; ky
                ? ((m += E *= v ? 1 : -1), (x -= E))
                : ((w = 0), (m = x = (h + d) / 2)),
                (M -= 2 * C) &gt; ky
                  ? ((_ += C *= v ? 1 : -1), (b -= C))
                  : ((M = 0), (_ = b = (h + d) / 2));
            }
            var P = l * My(_);
            var z = l * Ay(_);
            var R = s * My(x);
            var D = s * Ay(x);
            if (A &gt; ky) {
              var q;
              var L = l * My(b);
              var U = l * Ay(b);
              var O = s * My(m);
              var B = s * Ay(m);
              if (
                p &lt; Ey &amp;&amp;
                (q = (function(t, n, e, r, i, o, a, u) {
                  var c = e - t;
                  var f = r - n;
                  var s = a - i;
                  var l = u - o;
                  var h = l * c - s * f;
                  if (!(h * h &lt; ky))
                    return [
                      t + (h = (s * (n - o) - l * (t - i)) / h) * c,
                      n + h * f
                    ];
                })(P, z, O, B, L, U, R, D))
              ) {
                var F = P - q[0];
                var Y = z - q[1];
                var I = L - q[0];
                var H = U - q[1];
                var j =
                  1 /
                  Ay(
                    (function(t) {
                      return t &gt; 1 ? 0 : t &lt; -1 ? Ey : Math.acos(t);
                    })(
                      (F * I + Y * H) / (Sy(F * F + Y * Y) * Sy(I * I + H * H))
                    ) / 2
                  );
                var X = Sy(q[0] * q[0] + q[1] * q[1]);
                (S = Ty(A, (s - X) / (j - 1))), (k = Ty(A, (l - X) / (j + 1)));
              }
            }
            M &gt; ky
              ? k &gt; ky
                ? ((g = Oy(O, B, P, z, l, k, v)),
                  (y = Oy(L, U, R, D, l, k, v)),
                  u.moveTo(g.cx + g.x01, g.cy + g.y01),
                  k &lt; A
                    ? u.arc(
                        g.cx,
                        g.cy,
                        k,
                        wy(g.y01, g.x01),
                        wy(y.y01, y.x01),
                        !v
                      )
                    : (u.arc(
                        g.cx,
                        g.cy,
                        k,
                        wy(g.y01, g.x01),
                        wy(g.y11, g.x11),
                        !v
                      ),
                      u.arc(
                        0,
                        0,
                        l,
                        wy(g.cy + g.y11, g.cx + g.x11),
                        wy(y.cy + y.y11, y.cx + y.x11),
                        !v
                      ),
                      u.arc(
                        y.cx,
                        y.cy,
                        k,
                        wy(y.y11, y.x11),
                        wy(y.y01, y.x01),
                        !v
                      )))
                : (u.moveTo(P, z), u.arc(0, 0, l, _, b, !v))
              : u.moveTo(P, z),
              s &gt; ky &amp;&amp; w &gt; ky
                ? S &gt; ky
                  ? ((g = Oy(R, D, L, U, s, -S, v)),
                    (y = Oy(P, z, O, B, s, -S, v)),
                    u.lineTo(g.cx + g.x01, g.cy + g.y01),
                    S &lt; A
                      ? u.arc(
                          g.cx,
                          g.cy,
                          S,
                          wy(g.y01, g.x01),
                          wy(y.y01, y.x01),
                          !v
                        )
                      : (u.arc(
                          g.cx,
                          g.cy,
                          S,
                          wy(g.y01, g.x01),
                          wy(g.y11, g.x11),
                          !v
                        ),
                        u.arc(
                          0,
                          0,
                          s,
                          wy(g.cy + g.y11, g.cx + g.x11),
                          wy(y.cy + y.y11, y.cx + y.x11),
                          v
                        ),
                        u.arc(
                          y.cx,
                          y.cy,
                          S,
                          wy(y.y11, y.x11),
                          wy(y.y01, y.x01),
                          !v
                        )))
                  : u.arc(0, 0, s, x, m, v)
                : u.lineTo(R, D);
          }
        else u.moveTo(0, 0);
        if ((u.closePath(), c)) return (u = null), c + "" || null;
      }
      return (
        (c.centroid = function() {
          var e = (+t.apply(this, arguments) + +n.apply(this, arguments)) / 2;
          var r =
            (+i.apply(this, arguments) + +o.apply(this, arguments)) / 2 -
            Ey / 2;
          return [My(r) * e, Ay(r) * e];
        }),
        (c.innerRadius = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : my(+n)), c)
            : t;
        }),
        (c.outerRadius = function(t) {
          return arguments.length
            ? ((n = typeof t === "function" ? t : my(+t)), c)
            : n;
        }),
        (c.cornerRadius = function(t) {
          return arguments.length
            ? ((e = typeof t === "function" ? t : my(+t)), c)
            : e;
        }),
        (c.padRadius = function(t) {
          return arguments.length
            ? ((r = t == null ? null : typeof t === "function" ? t : my(+t)), c)
            : r;
        }),
        (c.startAngle = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : my(+t)), c)
            : i;
        }),
        (c.endAngle = function(t) {
          return arguments.length
            ? ((o = typeof t === "function" ? t : my(+t)), c)
            : o;
        }),
        (c.padAngle = function(t) {
          return arguments.length
            ? ((a = typeof t === "function" ? t : my(+t)), c)
            : a;
        }),
        (c.context = function(t) {
          return arguments.length ? ((u = t == null ? null : t), c) : u;
        }),
        c
      );
    }),
    (t.area = jy),
    (t.areaRadial = Ky),
    (t.ascending = n),
    (t.autoType = function(t) {
      for (var n in t) {
        var e;
        var r;
        var i = t[n].trim();
        if (i)
          if (i === "true") i = !0;
          else if (i === "false") i = !1;
          else if (i === "NaN") i = NaN;
          else if (isNaN((e = +i))) {
            if (
              !(r = i.match(
                /^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/
              ))
            )
              continue;
            ra &amp;&amp; r[4] &amp;&amp; !r[7] &amp;&amp; (i = i.replace(/-/g, "/").replace(/T/, " ")),
              (i = new Date(i));
          } else i = e;
        else i = null;
        t[n] = i;
      }
      return t;
    }),
    (t.axisBottom = function(t) {
      return F(D, t);
    }),
    (t.axisLeft = function(t) {
      return F(q, t);
    }),
    (t.axisRight = function(t) {
      return F(R, t);
    }),
    (t.axisTop = function(t) {
      return F(z, t);
    }),
    (t.bisect = i),
    (t.bisectLeft = o),
    (t.bisectRight = i),
    (t.bisector = e),
    (t.blob = function(t, n) {
      return fetch(t, n).then(ia);
    }),
    (t.brush = function() {
      return Yi(Ci);
    }),
    (t.brushSelection = function(t) {
      var n = t.__brush;
      return n ? n.dim.output(n.selection) : null;
    }),
    (t.brushX = function() {
      return Yi(ki);
    }),
    (t.brushY = function() {
      return Yi(Ei);
    }),
    (t.buffer = function(t, n) {
      return fetch(t, n).then(oa);
    }),
    (t.chord = function() {
      var t = 0;
      var n = null;
      var e = null;
      var r = null;
      function i(i) {
        var o;
        var a;
        var u;
        var c;
        var f;
        var s;
        var l = i.length;
        var h = [];
        var d = g(l);
        var p = [];
        var v = [];
        var y = (v.groups = new Array(l));
        var _ = new Array(l * l);
        for (o = 0, f = -1; ++f &lt; l; ) {
          for (a = 0, s = -1; ++s &lt; l; ) a += i[f][s];
          h.push(a), p.push(g(l)), (o += a);
        }
        for (
          n &amp;&amp;
            d.sort(function(t, e) {
              return n(h[t], h[e]);
            }),
            e &amp;&amp;
              p.forEach(function(t, n) {
                t.sort(function(t, r) {
                  return e(i[n][t], i[n][r]);
                });
              }),
            c = (o = Gi(0, Vi - t * l) / o) ? t : Vi / l,
            a = 0,
            f = -1;
          ++f &lt; l;

        ) {
          for (u = a, s = -1; ++s &lt; l; ) {
            var b = d[f];
            var m = p[b][s];
            var x = i[b][m];
            var w = a;
            var M = (a += x * o);
            _[m * l + b] = {
              index: b,
              subindex: m,
              startAngle: w,
              endAngle: M,
              value: x
            };
          }
          (y[b] = { index: b, startAngle: u, endAngle: a, value: h[b] }),
            (a += c);
        }
        for (f = -1; ++f &lt; l; )
          for (s = f - 1; ++s &lt; l; ) {
            var N = _[s * l + f];
            var T = _[f * l + s];
            (N.value || T.value) &amp;&amp;
              v.push(
                N.value &lt; T.value
                  ? { source: T, target: N }
                  : { source: N, target: T }
              );
          }
        return r ? v.sort(r) : v;
      }
      return (
        (i.padAngle = function(n) {
          return arguments.length ? ((t = Gi(0, n)), i) : t;
        }),
        (i.sortGroups = function(t) {
          return arguments.length ? ((n = t), i) : n;
        }),
        (i.sortSubgroups = function(t) {
          return arguments.length ? ((e = t), i) : e;
        }),
        (i.sortChords = function(t) {
          return arguments.length
            ? (t == null ? (r = null) : ((r = $i(t))._ = t), i)
            : r &amp;&amp; r._;
        }),
        i
      );
    }),
    (t.clientPoint = Ot),
    (t.cluster = function() {
      var t = Nl;
      var n = 1;
      var e = 1;
      var r = !1;
      function i(i) {
        var o;
        var a = 0;
        i.eachAfter(function(n) {
          var e = n.children;
          e
            ? ((n.x = (function(t) {
                return t.reduce(Tl, 0) / t.length;
              })(e)),
              (n.y = (function(t) {
                return 1 + t.reduce(Al, 0);
              })(e)))
            : ((n.x = o ? (a += t(n, o)) : 0), (n.y = 0), (o = n));
        });
        var u = (function(t) {
          for (var n; (n = t.children); ) t = n[0];
          return t;
        })(i);
        var c = (function(t) {
          for (var n; (n = t.children); ) t = n[n.length - 1];
          return t;
        })(i);
        var f = u.x - t(u, c) / 2;
        var s = c.x + t(c, u) / 2;
        return i.eachAfter(
          r
            ? function(t) {
                (t.x = (t.x - i.x) * n), (t.y = (i.y - t.y) * e);
              }
            : function(t) {
                (t.x = ((t.x - f) / (s - f)) * n),
                  (t.y = (1 - (i.y ? t.y / i.y : 1)) * e);
              }
        );
      }
      return (
        (i.separation = function(n) {
          return arguments.length ? ((t = n), i) : t;
        }),
        (i.size = function(t) {
          return arguments.length
            ? ((r = !1), (n = +t[0]), (e = +t[1]), i)
            : r
            ? null
            : [n, e];
        }),
        (i.nodeSize = function(t) {
          return arguments.length
            ? ((r = !0), (n = +t[0]), (e = +t[1]), i)
            : r
            ? [n, e]
            : null;
        }),
        i
      );
    }),
    (t.color = pn),
    (t.contourDensity = function() {
      var t = ko;
      var n = Eo;
      var e = Co;
      var r = 960;
      var i = 500;
      var o = 20;
      var a = 2;
      var u = 3 * o;
      var c = (r + 2 * u) &gt;&gt; a;
      var f = (i + 2 * u) &gt;&gt; a;
      var s = bo(20);
      function l(r) {
        var i = new Float32Array(c * f);
        var l = new Float32Array(c * f);
        r.forEach(function(r, o, s) {
          var l = (+t(r, o, s) + u) &gt;&gt; a;
          var h = (+n(r, o, s) + u) &gt;&gt; a;
          var d = +e(r, o, s);
          l &gt;= 0 &amp;&amp; l &lt; c &amp;&amp; h &gt;= 0 &amp;&amp; h &lt; f &amp;&amp; (i[l + h * c] += d);
        }),
          Ao(
            { width: c, height: f, data: i },
            { width: c, height: f, data: l },
            o &gt;&gt; a
          ),
          So(
            { width: c, height: f, data: l },
            { width: c, height: f, data: i },
            o &gt;&gt; a
          ),
          Ao(
            { width: c, height: f, data: i },
            { width: c, height: f, data: l },
            o &gt;&gt; a
          ),
          So(
            { width: c, height: f, data: l },
            { width: c, height: f, data: i },
            o &gt;&gt; a
          ),
          Ao(
            { width: c, height: f, data: i },
            { width: c, height: f, data: l },
            o &gt;&gt; a
          ),
          So(
            { width: c, height: f, data: l },
            { width: c, height: f, data: i },
            o &gt;&gt; a
          );
        var d = s(i);
        if (!Array.isArray(d)) {
          var p = T(i);
          (d = w(0, p, d)), (d = g(0, Math.floor(p / d) * d, d)).shift();
        }
        return To()
          .thresholds(d)
          .size([c, f])(i)
          .map(h);
      }
      function h(t) {
        return (t.value *= Math.pow(2, -2 * a)), t.coordinates.forEach(d), t;
      }
      function d(t) {
        t.forEach(p);
      }
      function p(t) {
        t.forEach(v);
      }
      function v(t) {
        (t[0] = t[0] * Math.pow(2, a) - u), (t[1] = t[1] * Math.pow(2, a) - u);
      }
      function y() {
        return (c = (r + 2 * (u = 3 * o)) &gt;&gt; a), (f = (i + 2 * u) &gt;&gt; a), l;
      }
      return (
        (l.x = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : bo(+n)), l)
            : t;
        }),
        (l.y = function(t) {
          return arguments.length
            ? ((n = typeof t === "function" ? t : bo(+t)), l)
            : n;
        }),
        (l.weight = function(t) {
          return arguments.length
            ? ((e = typeof t === "function" ? t : bo(+t)), l)
            : e;
        }),
        (l.size = function(t) {
          if (!arguments.length) return [r, i];
          var n = Math.ceil(t[0]);
          var e = Math.ceil(t[1]);
          if (!(n &gt;= 0 || n &gt;= 0)) throw new Error("invalid size");
          return (r = n), (i = e), y();
        }),
        (l.cellSize = function(t) {
          if (!arguments.length) return 1 &lt;&lt; a;
          if (!((t = +t) &gt;= 1)) throw new Error("invalid cell size");
          return (a = Math.floor(Math.log(t) / Math.LN2)), y();
        }),
        (l.thresholds = function(t) {
          return arguments.length
            ? ((s =
                typeof t === "function"
                  ? t
                  : Array.isArray(t)
                  ? bo(yo.call(t))
                  : bo(t)),
              l)
            : s;
        }),
        (l.bandwidth = function(t) {
          if (!arguments.length) return Math.sqrt(o * (o + 1));
          if (!((t = +t) &gt;= 0)) throw new Error("invalid bandwidth");
          return (o = Math.round((Math.sqrt(4 * t * t + 1) - 1) / 2)), y();
        }),
        l
      );
    }),
    (t.contours = To),
    (t.create = function(t) {
      return Rt(Z(t).call(document.documentElement));
    }),
    (t.creator = Z),
    (t.cross = function(t, n, e) {
      var r;
      var i;
      var o;
      var u;
      var c = t.length;
      var f = n.length;
      var s = new Array(c * f);
      for (e == null &amp;&amp; (e = a), r = o = 0; r &lt; c; ++r)
        for (u = t[r], i = 0; i &lt; f; ++i, ++o) s[o] = e(u, n[i]);
      return s;
    }),
    (t.csv = fa),
    (t.csvFormat = jo),
    (t.csvFormatBody = Xo),
    (t.csvFormatRow = Go),
    (t.csvFormatRows = Vo),
    (t.csvFormatValue = $o),
    (t.csvParse = Io),
    (t.csvParseRows = Ho),
    (t.cubehelix = ee),
    (t.curveBasis = function(t) {
      return new A_(t);
    }),
    (t.curveBasisClosed = function(t) {
      return new S_(t);
    }),
    (t.curveBasisOpen = function(t) {
      return new k_(t);
    }),
    (t.curveBundle = C_),
    (t.curveCardinal = R_),
    (t.curveCardinalClosed = q_),
    (t.curveCardinalOpen = U_),
    (t.curveCatmullRom = F_),
    (t.curveCatmullRomClosed = I_),
    (t.curveCatmullRomOpen = j_),
    (t.curveLinear = Fy),
    (t.curveLinearClosed = function(t) {
      return new X_(t);
    }),
    (t.curveMonotoneX = function(t) {
      return new Z_(t);
    }),
    (t.curveMonotoneY = function(t) {
      return new Q_(t);
    }),
    (t.curveNatural = function(t) {
      return new J_(t);
    }),
    (t.curveStep = function(t) {
      return new nb(t, 0.5);
    }),
    (t.curveStepAfter = function(t) {
      return new nb(t, 1);
    }),
    (t.curveStepBefore = function(t) {
      return new nb(t, 0);
    }),
    (t.customEvent = kt),
    (t.descending = function(t, n) {
      return n &lt; t ? -1 : n &gt; t ? 1 : n &gt;= t ? 0 : NaN;
    }),
    (t.deviation = f),
    (t.dispatch = I),
    (t.drag = function() {
      var n;
      var e;
      var r;
      var i;
      var o = Gt;
      var a = $t;
      var u = Wt;
      var c = Zt;
      var f = {};
      var s = I("start", "drag", "end");
      var l = 0;
      var h = 0;
      function d(t) {
        t.on("mousedown.drag", p)
          .filter(c)
          .on("touchstart.drag", y)
          .on("touchmove.drag", _)
          .on("touchend.drag touchcancel.drag", b)
          .style("touch-action", "none")
          .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
      }
      function p() {
        if (!i &amp;&amp; o.apply(this, arguments)) {
          var u = m("mouse", a.apply(this, arguments), Bt, this, arguments);
          u &amp;&amp;
            (Rt(t.event.view)
              .on("mousemove.drag", v, !0)
              .on("mouseup.drag", g, !0),
            Ht(t.event.view),
            Yt(),
            (r = !1),
            (n = t.event.clientX),
            (e = t.event.clientY),
            u("start"));
        }
      }
      function v() {
        if ((It(), !r)) {
          var i = t.event.clientX - n;
          var o = t.event.clientY - e;
          r = i * i + o * o &gt; h;
        }
        f.mouse("drag");
      }
      function g() {
        Rt(t.event.view).on("mousemove.drag mouseup.drag", null),
          jt(t.event.view, r),
          It(),
          f.mouse("end");
      }
      function y() {
        if (o.apply(this, arguments)) {
          var n;
          var e;
          var r = t.event.changedTouches;
          var i = a.apply(this, arguments);
          var u = r.length;
          for (n = 0; n &lt; u; ++n)
            (e = m(r[n].identifier, i, Ft, this, arguments)) &amp;&amp;
              (Yt(), e("start"));
        }
      }
      function _() {
        var n;
        var e;
        var r = t.event.changedTouches;
        var i = r.length;
        for (n = 0; n &lt; i; ++n) (e = f[r[n].identifier]) &amp;&amp; (It(), e("drag"));
      }
      function b() {
        var n;
        var e;
        var r = t.event.changedTouches;
        var o = r.length;
        for (
          i &amp;&amp; clearTimeout(i),
            i = setTimeout(function() {
              i = null;
            }, 500),
            n = 0;
          n &lt; o;
          ++n
        )
          (e = f[r[n].identifier]) &amp;&amp; (Yt(), e("end"));
      }
      function m(n, e, r, i, o) {
        var a;
        var c;
        var h;
        var p = r(e, n);
        var v = s.copy();
        if (
          kt(
            new Vt(d, "beforestart", a, n, l, p[0], p[1], 0, 0, v),
            function() {
              return (
                (t.event.subject = a = u.apply(i, o)) != null &amp;&amp;
                ((c = a.x - p[0] || 0), (h = a.y - p[1] || 0), !0)
              );
            }
          )
        )
          return function t(u) {
            var s;
            var g = p;
            switch (u) {
              case "start":
                (f[n] = t), (s = l++);
                break;
              case "end":
                delete f[n], --l;
              case "drag":
                (p = r(e, n)), (s = l);
            }
            kt(
              new Vt(
                d,
                u,
                a,
                n,
                s,
                p[0] + c,
                p[1] + h,
                p[0] - g[0],
                p[1] - g[1],
                v
              ),
              v.apply,
              v,
              [u, i, o]
            );
          };
      }
      return (
        (d.filter = function(t) {
          return arguments.length
            ? ((o = typeof t === "function" ? t : Xt(!!t)), d)
            : o;
        }),
        (d.container = function(t) {
          return arguments.length
            ? ((a = typeof t === "function" ? t : Xt(t)), d)
            : a;
        }),
        (d.subject = function(t) {
          return arguments.length
            ? ((u = typeof t === "function" ? t : Xt(t)), d)
            : u;
        }),
        (d.touchable = function(t) {
          return arguments.length
            ? ((c = typeof t === "function" ? t : Xt(!!t)), d)
            : c;
        }),
        (d.on = function() {
          var t = s.on.apply(s, arguments);
          return t === s ? d : t;
        }),
        (d.clickDistance = function(t) {
          return arguments.length ? ((h = (t = +t) * t), d) : Math.sqrt(h);
        }),
        d
      );
    }),
    (t.dragDisable = Ht),
    (t.dragEnable = jt),
    (t.dsv = function(t, n, e, r) {
      arguments.length === 3 &amp;&amp;
        typeof e === "function" &amp;&amp;
        ((r = e), (e = void 0));
      var i = Fo(t);
      return ua(n, e).then(function(t) {
        return i.parse(t, r);
      });
    }),
    (t.dsvFormat = Fo),
    (t.easeBack = si),
    (t.easeBackIn = ci),
    (t.easeBackInOut = si),
    (t.easeBackOut = fi),
    (t.easeBounce = ui),
    (t.easeBounceIn = function(t) {
      return 1 - ui(1 - t);
    }),
    (t.easeBounceInOut = function(t) {
      return ((t *= 2) &lt;= 1 ? 1 - ui(1 - t) : ui(t - 1) + 1) / 2;
    }),
    (t.easeBounceOut = ui),
    (t.easeCircle = Zr),
    (t.easeCircleIn = function(t) {
      return 1 - Math.sqrt(1 - t * t);
    }),
    (t.easeCircleInOut = Zr),
    (t.easeCircleOut = function(t) {
      return Math.sqrt(1 - --t * t);
    }),
    (t.easeCubic = Ir),
    (t.easeCubicIn = function(t) {
      return t * t * t;
    }),
    (t.easeCubicInOut = Ir),
    (t.easeCubicOut = function(t) {
      return --t * t * t + 1;
    }),
    (t.easeElastic = di),
    (t.easeElasticIn = hi),
    (t.easeElasticInOut = pi),
    (t.easeElasticOut = di),
    (t.easeExp = Wr),
    (t.easeExpIn = function(t) {
      return Math.pow(2, 10 * t - 10);
    }),
    (t.easeExpInOut = Wr),
    (t.easeExpOut = function(t) {
      return 1 - Math.pow(2, -10 * t);
    }),
    (t.easeLinear = function(t) {
      return +t;
    }),
    (t.easePoly = Xr),
    (t.easePolyIn = Hr),
    (t.easePolyInOut = Xr),
    (t.easePolyOut = jr),
    (t.easeQuad = Yr),
    (t.easeQuadIn = function(t) {
      return t * t;
    }),
    (t.easeQuadInOut = Yr),
    (t.easeQuadOut = function(t) {
      return t * (2 - t);
    }),
    (t.easeSin = $r),
    (t.easeSinIn = function(t) {
      return 1 - Math.cos(t * Gr);
    }),
    (t.easeSinInOut = $r),
    (t.easeSinOut = function(t) {
      return Math.sin(t * Gr);
    }),
    (t.entries = function(t) {
      var n = [];
      for (var e in t) n.push({ key: e, value: t[e] });
      return n;
    }),
    (t.extent = s),
    (t.forceCenter = function(t, n) {
      var e;
      function r() {
        var r;
        var i;
        var o = e.length;
        var a = 0;
        var u = 0;
        for (r = 0; r &lt; o; ++r) (a += (i = e[r]).x), (u += i.y);
        for (a = a / o - t, u = u / o - n, r = 0; r &lt; o; ++r)
          ((i = e[r]).x -= a), (i.y -= u);
      }
      return (
        t == null &amp;&amp; (t = 0),
        n == null &amp;&amp; (n = 0),
        (r.initialize = function(t) {
          e = t;
        }),
        (r.x = function(n) {
          return arguments.length ? ((t = +n), r) : t;
        }),
        (r.y = function(t) {
          return arguments.length ? ((n = +t), r) : n;
        }),
        r
      );
    }),
    (t.forceCollide = function(t) {
      var n;
      var e;
      var r = 1;
      var i = 1;
      function o() {
        for (var t, o, u, c, f, s, l, h = n.length, d = 0; d &lt; i; ++d)
          for (o = wa(n, Aa, Sa).visitAfter(a), t = 0; t &lt; h; ++t)
            (u = n[t]),
              (s = e[u.index]),
              (l = s * s),
              (c = u.x + u.vx),
              (f = u.y + u.vy),
              o.visit(p);
        function p(t, n, e, i, o) {
          var a = t.data;
          var h = t.r;
          var d = s + h;
          if (!a) return n &gt; c + d || i &lt; c - d || e &gt; f + d || o &lt; f - d;
          if (a.index &gt; u.index) {
            var p = c - a.x - a.vx;
            var v = f - a.y - a.vy;
            var g = p * p + v * v;
            g &lt; d * d &amp;&amp;
              (p === 0 &amp;&amp; (g += (p = ya()) * p),
              v === 0 &amp;&amp; (g += (v = ya()) * v),
              (g = ((d - (g = Math.sqrt(g))) / g) * r),
              (u.vx += (p *= g) * (d = (h *= h) / (l + h))),
              (u.vy += (v *= g) * d),
              (a.vx -= p * (d = 1 - d)),
              (a.vy -= v * d));
          }
        }
      }
      function a(t) {
        if (t.data) return (t.r = e[t.data.index]);
        for (var n = (t.r = 0); n &lt; 4; ++n)
          t[n] &amp;&amp; t[n].r &gt; t.r &amp;&amp; (t.r = t[n].r);
      }
      function u() {
        if (n) {
          var r;
          var i;
          var o = n.length;
          for (e = new Array(o), r = 0; r &lt; o; ++r)
            (i = n[r]), (e[i.index] = +t(i, r, n));
        }
      }
      return (
        typeof t !== "function" &amp;&amp; (t = ga(t == null ? 1 : +t)),
        (o.initialize = function(t) {
          (n = t), u();
        }),
        (o.iterations = function(t) {
          return arguments.length ? ((i = +t), o) : i;
        }),
        (o.strength = function(t) {
          return arguments.length ? ((r = +t), o) : r;
        }),
        (o.radius = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : ga(+n)), u(), o)
            : t;
        }),
        o
      );
    }),
    (t.forceLink = function(t) {
      var n;
      var e;
      var r;
      var i;
      var o;
      var a = ka;
      var u = function(t) {
        return 1 / Math.min(i[t.source.index], i[t.target.index]);
      };
      var c = ga(30);
      var f = 1;
      function s(r) {
        for (var i = 0, a = t.length; i &lt; f; ++i)
          for (var u, c, s, l, h, d, p, v = 0; v &lt; a; ++v)
            (c = (u = t[v]).source),
              (l = (s = u.target).x + s.vx - c.x - c.vx || ya()),
              (h = s.y + s.vy - c.y - c.vy || ya()),
              (l *= d =
                (((d = Math.sqrt(l * l + h * h)) - e[v]) / d) * r * n[v]),
              (h *= d),
              (s.vx -= l * (p = o[v])),
              (s.vy -= h * p),
              (c.vx += l * (p = 1 - p)),
              (c.vy += h * p);
      }
      function l() {
        if (r) {
          var u;
          var c;
          var f = r.length;
          var s = t.length;
          var l = co(r, a);
          for (u = 0, i = new Array(f); u &lt; s; ++u)
            ((c = t[u]).index = u),
              typeof c.source !== "object" &amp;&amp; (c.source = Ea(l, c.source)),
              typeof c.target !== "object" &amp;&amp; (c.target = Ea(l, c.target)),
              (i[c.source.index] = (i[c.source.index] || 0) + 1),
              (i[c.target.index] = (i[c.target.index] || 0) + 1);
          for (u = 0, o = new Array(s); u &lt; s; ++u)
            (c = t[u]),
              (o[u] =
                i[c.source.index] / (i[c.source.index] + i[c.target.index]));
          (n = new Array(s)), h(), (e = new Array(s)), d();
        }
      }
      function h() {
        if (r) for (var e = 0, i = t.length; e &lt; i; ++e) n[e] = +u(t[e], e, t);
      }
      function d() {
        if (r) for (var n = 0, i = t.length; n &lt; i; ++n) e[n] = +c(t[n], n, t);
      }
      return (
        t == null &amp;&amp; (t = []),
        (s.initialize = function(t) {
          (r = t), l();
        }),
        (s.links = function(n) {
          return arguments.length ? ((t = n), l(), s) : t;
        }),
        (s.id = function(t) {
          return arguments.length ? ((a = t), s) : a;
        }),
        (s.iterations = function(t) {
          return arguments.length ? ((f = +t), s) : f;
        }),
        (s.strength = function(t) {
          return arguments.length
            ? ((u = typeof t === "function" ? t : ga(+t)), h(), s)
            : u;
        }),
        (s.distance = function(t) {
          return arguments.length
            ? ((c = typeof t === "function" ? t : ga(+t)), d(), s)
            : c;
        }),
        s
      );
    }),
    (t.forceManyBody = function() {
      var t;
      var n;
      var e;
      var r;
      var i = ga(-30);
      var o = 1;
      var a = 1 / 0;
      var u = 0.81;
      function c(r) {
        var i;
        var o = t.length;
        var a = wa(t, Ca, Pa).visitAfter(s);
        for (e = r, i = 0; i &lt; o; ++i) (n = t[i]), a.visit(l);
      }
      function f() {
        if (t) {
          var n;
          var e;
          var o = t.length;
          for (r = new Array(o), n = 0; n &lt; o; ++n)
            (e = t[n]), (r[e.index] = +i(e, n, t));
        }
      }
      function s(t) {
        var n;
        var e;
        var i;
        var o;
        var a;
        var u = 0;
        var c = 0;
        if (t.length) {
          for (i = o = a = 0; a &lt; 4; ++a)
            (n = t[a]) &amp;&amp;
              (e = Math.abs(n.value)) &amp;&amp;
              ((u += n.value), (c += e), (i += e * n.x), (o += e * n.y));
          (t.x = i / c), (t.y = o / c);
        } else {
          ((n = t).x = n.data.x), (n.y = n.data.y);
          do {
            u += r[n.data.index];
          } while ((n = n.next));
        }
        t.value = u;
      }
      function l(t, i, c, f) {
        if (!t.value) return !0;
        var s = t.x - n.x;
        var l = t.y - n.y;
        var h = f - i;
        var d = s * s + l * l;
        if ((h * h) / u &lt; d)
          return (
            d &lt; a &amp;&amp;
              (s === 0 &amp;&amp; (d += (s = ya()) * s),
              l === 0 &amp;&amp; (d += (l = ya()) * l),
              d &lt; o &amp;&amp; (d = Math.sqrt(o * d)),
              (n.vx += (s * t.value * e) / d),
              (n.vy += (l * t.value * e) / d)),
            !0
          );
        if (!(t.length || d &gt;= a)) {
          (t.data !== n || t.next) &amp;&amp;
            (s === 0 &amp;&amp; (d += (s = ya()) * s),
            l === 0 &amp;&amp; (d += (l = ya()) * l),
            d &lt; o &amp;&amp; (d = Math.sqrt(o * d)));
          do {
            t.data !== n &amp;&amp;
              ((h = (r[t.data.index] * e) / d),
              (n.vx += s * h),
              (n.vy += l * h));
          } while ((t = t.next));
        }
      }
      return (
        (c.initialize = function(n) {
          (t = n), f();
        }),
        (c.strength = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : ga(+t)), f(), c)
            : i;
        }),
        (c.distanceMin = function(t) {
          return arguments.length ? ((o = t * t), c) : Math.sqrt(o);
        }),
        (c.distanceMax = function(t) {
          return arguments.length ? ((a = t * t), c) : Math.sqrt(a);
        }),
        (c.theta = function(t) {
          return arguments.length ? ((u = t * t), c) : Math.sqrt(u);
        }),
        c
      );
    }),
    (t.forceRadial = function(t, n, e) {
      var r;
      var i;
      var o;
      var a = ga(0.1);
      function u(t) {
        for (var a = 0, u = r.length; a &lt; u; ++a) {
          var c = r[a];
          var f = c.x - n || 1e-6;
          var s = c.y - e || 1e-6;
          var l = Math.sqrt(f * f + s * s);
          var h = ((o[a] - l) * i[a] * t) / l;
          (c.vx += f * h), (c.vy += s * h);
        }
      }
      function c() {
        if (r) {
          var n;
          var e = r.length;
          for (i = new Array(e), o = new Array(e), n = 0; n &lt; e; ++n)
            (o[n] = +t(r[n], n, r)), (i[n] = isNaN(o[n]) ? 0 : +a(r[n], n, r));
        }
      }
      return (
        typeof t !== "function" &amp;&amp; (t = ga(+t)),
        n == null &amp;&amp; (n = 0),
        e == null &amp;&amp; (e = 0),
        (u.initialize = function(t) {
          (r = t), c();
        }),
        (u.strength = function(t) {
          return arguments.length
            ? ((a = typeof t === "function" ? t : ga(+t)), c(), u)
            : a;
        }),
        (u.radius = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : ga(+n)), c(), u)
            : t;
        }),
        (u.x = function(t) {
          return arguments.length ? ((n = +t), u) : n;
        }),
        (u.y = function(t) {
          return arguments.length ? ((e = +t), u) : e;
        }),
        u
      );
    }),
    (t.forceSimulation = function(t) {
      var n;
      var e = 1;
      var r = 0.001;
      var i = 1 - Math.pow(r, 1 / 300);
      var o = 0;
      var a = 0.6;
      var u = co();
      var c = hr(s);
      var f = I("tick", "end");
      function s() {
        l(), f.call("tick", n), e &lt; r &amp;&amp; (c.stop(), f.call("end", n));
      }
      function l(r) {
        var c;
        var f;
        var s = t.length;
        void 0 === r &amp;&amp; (r = 1);
        for (var l = 0; l &lt; r; ++l)
          for (
            e += (o - e) * i,
              u.each(function(t) {
                t(e);
              }),
              c = 0;
            c &lt; s;
            ++c
          )
            (f = t[c]).fx == null
              ? (f.x += f.vx *= a)
              : ((f.x = f.fx), (f.vx = 0)),
              f.fy == null ? (f.y += f.vy *= a) : ((f.y = f.fy), (f.vy = 0));
        return n;
      }
      function h() {
        for (var n, e = 0, r = t.length; e &lt; r; ++e) {
          if (
            (((n = t[e]).index = e),
            n.fx != null &amp;&amp; (n.x = n.fx),
            n.fy != null &amp;&amp; (n.y = n.fy),
            isNaN(n.x) || isNaN(n.y))
          ) {
            var i = za * Math.sqrt(e);
            var o = e * Ra;
            (n.x = i * Math.cos(o)), (n.y = i * Math.sin(o));
          }
          (isNaN(n.vx) || isNaN(n.vy)) &amp;&amp; (n.vx = n.vy = 0);
        }
      }
      function d(n) {
        return n.initialize &amp;&amp; n.initialize(t), n;
      }
      return (
        t == null &amp;&amp; (t = []),
        h(),
        (n = {
          tick: l,
          restart: function() {
            return c.restart(s), n;
          },
          stop: function() {
            return c.stop(), n;
          },
          nodes: function(e) {
            return arguments.length ? ((t = e), h(), u.each(d), n) : t;
          },
          alpha: function(t) {
            return arguments.length ? ((e = +t), n) : e;
          },
          alphaMin: function(t) {
            return arguments.length ? ((r = +t), n) : r;
          },
          alphaDecay: function(t) {
            return arguments.length ? ((i = +t), n) : +i;
          },
          alphaTarget: function(t) {
            return arguments.length ? ((o = +t), n) : o;
          },
          velocityDecay: function(t) {
            return arguments.length ? ((a = 1 - t), n) : 1 - a;
          },
          force: function(t, e) {
            return arguments.length &gt; 1
              ? (e == null ? u.remove(t) : u.set(t, d(e)), n)
              : u.get(t);
          },
          find: function(n, e, r) {
            var i;
            var o;
            var a;
            var u;
            var c;
            var f = 0;
            var s = t.length;
            for (r == null ? (r = 1 / 0) : (r *= r), f = 0; f &lt; s; ++f)
              (a = (i = n - (u = t[f]).x) * i + (o = e - u.y) * o) &lt; r &amp;&amp;
                ((c = u), (r = a));
            return c;
          },
          on: function(t, e) {
            return arguments.length &gt; 1 ? (f.on(t, e), n) : f.on(t);
          }
        })
      );
    }),
    (t.forceX = function(t) {
      var n;
      var e;
      var r;
      var i = ga(0.1);
      function o(t) {
        for (var i, o = 0, a = n.length; o &lt; a; ++o)
          (i = n[o]).vx += (r[o] - i.x) * e[o] * t;
      }
      function a() {
        if (n) {
          var o;
          var a = n.length;
          for (e = new Array(a), r = new Array(a), o = 0; o &lt; a; ++o)
            e[o] = isNaN((r[o] = +t(n[o], o, n))) ? 0 : +i(n[o], o, n);
        }
      }
      return (
        typeof t !== "function" &amp;&amp; (t = ga(t == null ? 0 : +t)),
        (o.initialize = function(t) {
          (n = t), a();
        }),
        (o.strength = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : ga(+t)), a(), o)
            : i;
        }),
        (o.x = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : ga(+n)), a(), o)
            : t;
        }),
        o
      );
    }),
    (t.forceY = function(t) {
      var n;
      var e;
      var r;
      var i = ga(0.1);
      function o(t) {
        for (var i, o = 0, a = n.length; o &lt; a; ++o)
          (i = n[o]).vy += (r[o] - i.y) * e[o] * t;
      }
      function a() {
        if (n) {
          var o;
          var a = n.length;
          for (e = new Array(a), r = new Array(a), o = 0; o &lt; a; ++o)
            e[o] = isNaN((r[o] = +t(n[o], o, n))) ? 0 : +i(n[o], o, n);
        }
      }
      return (
        typeof t !== "function" &amp;&amp; (t = ga(t == null ? 0 : +t)),
        (o.initialize = function(t) {
          (n = t), a();
        }),
        (o.strength = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : ga(+t)), a(), o)
            : i;
        }),
        (o.y = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : ga(+n)), a(), o)
            : t;
        }),
        o
      );
    }),
    (t.formatDefaultLocale = Ga),
    (t.formatLocale = Va),
    (t.formatSpecifier = Oa),
    (t.geoAlbers = el),
    (t.geoAlbersUsa = function() {
      var t;
      var n;
      var e;
      var r;
      var i;
      var o;
      var a = el();
      var u = nl()
        .rotate([154, 0])
        .center([-2, 58.5])
        .parallels([55, 65]);
      var c = nl()
        .rotate([157, 0])
        .center([-3, 19.9])
        .parallels([8, 18]);
      var f = {
        point: function(t, n) {
          o = [t, n];
        }
      };
      function s(t) {
        var n = t[0];
        var a = t[1];
        return (
          (o = null),
          e.point(n, a),
          o || (r.point(n, a), o) || (i.point(n, a), o)
        );
      }
      function l() {
        return (t = n = null), s;
      }
      return (
        (s.invert = function(t) {
          var n = a.scale();
          var e = a.translate();
          var r = (t[0] - e[0]) / n;
          var i = (t[1] - e[1]) / n;
          return (i &gt;= 0.12 &amp;&amp; i &lt; 0.234 &amp;&amp; r &gt;= -0.425 &amp;&amp; r &lt; -0.214
            ? u
            : i &gt;= 0.166 &amp;&amp; i &lt; 0.234 &amp;&amp; r &gt;= -0.214 &amp;&amp; r &lt; -0.115
            ? c
            : a
          ).invert(t);
        }),
        (s.stream = function(e) {
          return t &amp;&amp; n === e
            ? t
            : ((r = [a.stream((n = e)), u.stream(e), c.stream(e)]),
              (i = r.length),
              (t = {
                point: function(t, n) {
                  for (var e = -1; ++e &lt; i; ) r[e].point(t, n);
                },
                sphere: function() {
                  for (var t = -1; ++t &lt; i; ) r[t].sphere();
                },
                lineStart: function() {
                  for (var t = -1; ++t &lt; i; ) r[t].lineStart();
                },
                lineEnd: function() {
                  for (var t = -1; ++t &lt; i; ) r[t].lineEnd();
                },
                polygonStart: function() {
                  for (var t = -1; ++t &lt; i; ) r[t].polygonStart();
                },
                polygonEnd: function() {
                  for (var t = -1; ++t &lt; i; ) r[t].polygonEnd();
                }
              }));
          var r;
          var i;
        }),
        (s.precision = function(t) {
          return arguments.length
            ? (a.precision(t), u.precision(t), c.precision(t), l())
            : a.precision();
        }),
        (s.scale = function(t) {
          return arguments.length
            ? (a.scale(t),
              u.scale(0.35 * t),
              c.scale(t),
              s.translate(a.translate()))
            : a.scale();
        }),
        (s.translate = function(t) {
          if (!arguments.length) return a.translate();
          var n = a.scale();
          var o = +t[0];
          var s = +t[1];
          return (
            (e = a
              .translate(t)
              .clipExtent([
                [o - 0.455 * n, s - 0.238 * n],
                [o + 0.455 * n, s + 0.238 * n]
              ])
              .stream(f)),
            (r = u
              .translate([o - 0.307 * n, s + 0.201 * n])
              .clipExtent([
                [o - 0.425 * n + nu, s + 0.12 * n + nu],
                [o - 0.214 * n - nu, s + 0.234 * n - nu]
              ])
              .stream(f)),
            (i = c
              .translate([o - 0.205 * n, s + 0.212 * n])
              .clipExtent([
                [o - 0.214 * n + nu, s + 0.166 * n + nu],
                [o - 0.115 * n - nu, s + 0.234 * n - nu]
              ])
              .stream(f)),
            l()
          );
        }),
        (s.fitExtent = function(t, n) {
          return Is(s, t, n);
        }),
        (s.fitSize = function(t, n) {
          return Hs(s, t, n);
        }),
        (s.fitWidth = function(t, n) {
          return js(s, t, n);
        }),
        (s.fitHeight = function(t, n) {
          return Xs(s, t, n);
        }),
        s.scale(1070)
      );
    }),
    (t.geoArea = function(t) {
      return Uu.reset(), Cu(t, Ou), 2 * Uu;
    }),
    (t.geoAzimuthalEqualArea = function() {
      return Qs(ol)
        .scale(124.75)
        .clipAngle(179.999);
    }),
    (t.geoAzimuthalEqualAreaRaw = ol),
    (t.geoAzimuthalEquidistant = function() {
      return Qs(al)
        .scale(79.4188)
        .clipAngle(179.999);
    }),
    (t.geoAzimuthalEquidistantRaw = al),
    (t.geoBounds = function(t) {
      var n;
      var e;
      var r;
      var i;
      var o;
      var a;
      var u;
      if (
        ((Ju = Ku = -(Zu = Qu = 1 / 0)), (ic = []), Cu(t, Mc), (e = ic.length))
      ) {
        for (ic.sort(zc), n = 1, o = [(r = ic[0])]; n &lt; e; ++n)
          Rc(r, (i = ic[n])[0]) || Rc(r, i[1])
            ? (Pc(r[0], i[1]) &gt; Pc(r[0], r[1]) &amp;&amp; (r[1] = i[1]),
              Pc(i[0], r[1]) &gt; Pc(r[0], r[1]) &amp;&amp; (r[0] = i[0]))
            : o.push((r = i));
        for (a = -1 / 0, n = 0, r = o[(e = o.length - 1)]; n &lt;= e; r = i, ++n)
          (i = o[n]),
            (u = Pc(r[1], i[0])) &gt; a &amp;&amp; ((a = u), (Zu = i[0]), (Ku = r[1]));
      }
      return (
        (ic = oc = null),
        Zu === 1 / 0 || Qu === 1 / 0
          ? [[NaN, NaN], [NaN, NaN]]
          : [[Zu, Qu], [Ku, Ju]]
      );
    }),
    (t.geoCentroid = function(t) {
      (ac = uc = cc = fc = sc = lc = hc = dc = pc = vc = gc = 0), Cu(t, Dc);
      var n = pc;
      var e = vc;
      var r = gc;
      var i = n * n + e * e + r * r;
      return i &lt; eu &amp;&amp;
        ((n = lc),
        (e = hc),
        (r = dc),
        uc &lt; nu &amp;&amp; ((n = cc), (e = fc), (r = sc)),
        (i = n * n + e * e + r * r) &lt; eu)
        ? [NaN, NaN]
        : [lu(e, n) * uu, wu(r / bu(i)) * uu];
    }),
    (t.geoCircle = function() {
      var t;
      var n;
      var e = Xc([0, 0]);
      var r = Xc(90);
      var i = Xc(6);
      var o = {
        point: function(e, r) {
          t.push((e = n(e, r))), (e[0] *= uu), (e[1] *= uu);
        }
      };
      function a() {
        var a = e.apply(this, arguments);
        var u = r.apply(this, arguments) * cu;
        var c = i.apply(this, arguments) * cu;
        return (
          (t = []),
          (n = $c(-a[0] * cu, -a[1] * cu, 0).invert),
          Jc(o, u, c, 1),
          (a = { type: "Polygon", coordinates: [t] }),
          (t = n = null),
          a
        );
      }
      return (
        (a.center = function(t) {
          return arguments.length
            ? ((e = typeof t === "function" ? t : Xc([+t[0], +t[1]])), a)
            : e;
        }),
        (a.radius = function(t) {
          return arguments.length
            ? ((r = typeof t === "function" ? t : Xc(+t)), a)
            : r;
        }),
        (a.precision = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : Xc(+t)), a)
            : i;
        }),
        a
      );
    }),
    (t.geoClipAntimeridian = df),
    (t.geoClipCircle = pf),
    (t.geoClipExtent = function() {
      var t;
      var n;
      var e;
      var r = 0;
      var i = 0;
      var o = 960;
      var a = 500;
      return (e = {
        stream: function(e) {
          return t &amp;&amp; n === e ? t : (t = yf(r, i, o, a)((n = e)));
        },
        extent: function(u) {
          return arguments.length
            ? ((r = +u[0][0]),
              (i = +u[0][1]),
              (o = +u[1][0]),
              (a = +u[1][1]),
              (t = n = null),
              e)
            : [[r, i], [o, a]];
        }
      });
    }),
    (t.geoClipRectangle = yf),
    (t.geoConicConformal = function() {
      return Js(sl)
        .scale(109.5)
        .parallels([30, 30]);
    }),
    (t.geoConicConformalRaw = sl),
    (t.geoConicEqualArea = nl),
    (t.geoConicEqualAreaRaw = tl),
    (t.geoConicEquidistant = function() {
      return Js(hl)
        .scale(131.154)
        .center([0, 13.9389]);
    }),
    (t.geoConicEquidistantRaw = hl),
    (t.geoContains = function(t, n) {
      return (t &amp;&amp; Cf.hasOwnProperty(t.type) ? Cf[t.type] : zf)(t, n);
    }),
    (t.geoDistance = Ef),
    (t.geoEqualEarth = function() {
      return Qs(_l).scale(177.158);
    }),
    (t.geoEqualEarthRaw = _l),
    (t.geoEquirectangular = function() {
      return Qs(ll).scale(152.63);
    }),
    (t.geoEquirectangularRaw = ll),
    (t.geoGnomonic = function() {
      return Qs(bl)
        .scale(144.049)
        .clipAngle(60);
    }),
    (t.geoGnomonicRaw = bl),
    (t.geoGraticule = Ff),
    (t.geoGraticule10 = function() {
      return Ff()();
    }),
    (t.geoIdentity = function() {
      var t;
      var n;
      var e;
      var r;
      var i;
      var o;
      var a;
      var u = 1;
      var c = 0;
      var f = 0;
      var s = 1;
      var l = 1;
      var h = 0;
      var d = null;
      var p = 1;
      var v = 1;
      var g = Bs({
        point: function(t, n) {
          var e = b([t, n]);
          this.stream.point(e[0], e[1]);
        }
      });
      var y = Yf;
      function _() {
        return (p = u * s), (v = u * l), (o = a = null), b;
      }
      function b(e) {
        var r = e[0] * p;
        var i = e[1] * v;
        if (h) {
          var o = i * t - r * n;
          (r = r * t + i * n), (i = o);
        }
        return [r + c, i + f];
      }
      return (
        (b.invert = function(e) {
          var r = e[0] - c;
          var i = e[1] - f;
          if (h) {
            var o = i * t + r * n;
            (r = r * t - i * n), (i = o);
          }
          return [r / p, i / v];
        }),
        (b.stream = function(t) {
          return o &amp;&amp; a === t ? o : (o = g(y((a = t))));
        }),
        (b.postclip = function(t) {
          return arguments.length ? ((y = t), (d = e = r = i = null), _()) : y;
        }),
        (b.clipExtent = function(t) {
          return arguments.length
            ? ((y =
                t == null
                  ? ((d = e = r = i = null), Yf)
                  : yf(
                      (d = +t[0][0]),
                      (e = +t[0][1]),
                      (r = +t[1][0]),
                      (i = +t[1][1])
                    )),
              _())
            : d == null
            ? null
            : [[d, e], [r, i]];
        }),
        (b.scale = function(t) {
          return arguments.length ? ((u = +t), _()) : u;
        }),
        (b.translate = function(t) {
          return arguments.length ? ((c = +t[0]), (f = +t[1]), _()) : [c, f];
        }),
        (b.angle = function(e) {
          return arguments.length
            ? ((n = yu((h = (e % 360) * cu))), (t = hu(h)), _())
            : h * uu;
        }),
        (b.reflectX = function(t) {
          return arguments.length ? ((s = t ? -1 : 1), _()) : s &lt; 0;
        }),
        (b.reflectY = function(t) {
          return arguments.length ? ((l = t ? -1 : 1), _()) : l &lt; 0;
        }),
        (b.fitExtent = function(t, n) {
          return Is(b, t, n);
        }),
        (b.fitSize = function(t, n) {
          return Hs(b, t, n);
        }),
        (b.fitWidth = function(t, n) {
          return js(b, t, n);
        }),
        (b.fitHeight = function(t, n) {
          return Xs(b, t, n);
        }),
        b
      );
    }),
    (t.geoInterpolate = function(t, n) {
      var e = t[0] * cu;
      var r = t[1] * cu;
      var i = n[0] * cu;
      var o = n[1] * cu;
      var a = hu(r);
      var u = yu(r);
      var c = hu(o);
      var f = yu(o);
      var s = a * hu(e);
      var l = a * yu(e);
      var h = c * hu(i);
      var d = c * yu(i);
      var p = 2 * wu(bu(Mu(o - r) + a * c * Mu(i - e)));
      var v = yu(p);
      var g = p
        ? function(t) {
            var n = yu((t *= p)) / v;
            var e = yu(p - t) / v;
            var r = e * s + n * h;
            var i = e * l + n * d;
            var o = e * u + n * f;
            return [lu(i, r) * uu, lu(o, bu(r * r + i * i)) * uu];
          }
        : function() {
            return [e * uu, r * uu];
          };
      return (g.distance = p), g;
    }),
    (t.geoLength = Af),
    (t.geoMercator = function() {
      return cl(ul).scale(961 / au);
    }),
    (t.geoMercatorRaw = ul),
    (t.geoNaturalEarth1 = function() {
      return Qs(ml).scale(175.295);
    }),
    (t.geoNaturalEarth1Raw = ml),
    (t.geoOrthographic = function() {
      return Qs(xl)
        .scale(249.5)
        .clipAngle(90 + nu);
    }),
    (t.geoOrthographicRaw = xl),
    (t.geoPath = function(t, n) {
      var e;
      var r;
      var i = 4.5;
      function o(t) {
        return (
          t &amp;&amp;
            (typeof i === "function" &amp;&amp;
              r.pointRadius(+i.apply(this, arguments)),
            Cu(t, e(r))),
          r.result()
        );
      }
      return (
        (o.area = function(t) {
          return Cu(t, e($f)), $f.result();
        }),
        (o.measure = function(t) {
          return Cu(t, e(Ds)), Ds.result();
        }),
        (o.bounds = function(t) {
          return Cu(t, e(rs)), rs.result();
        }),
        (o.centroid = function(t) {
          return Cu(t, e(ys)), ys.result();
        }),
        (o.projection = function(n) {
          return arguments.length
            ? ((e = n == null ? ((t = null), Yf) : (t = n).stream), o)
            : t;
        }),
        (o.context = function(t) {
          return arguments.length
            ? ((r = t == null ? ((n = null), new Us()) : new Ss((n = t))),
              typeof i !== "function" &amp;&amp; r.pointRadius(i),
              o)
            : n;
        }),
        (o.pointRadius = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : (r.pointRadius(+t), +t)), o)
            : i;
        }),
        o.projection(t).context(n)
      );
    }),
    (t.geoProjection = Qs),
    (t.geoProjectionMutator = Ks),
    (t.geoRotation = Kc),
    (t.geoStereographic = function() {
      return Qs(wl)
        .scale(250)
        .clipAngle(142);
    }),
    (t.geoStereographicRaw = wl),
    (t.geoStream = Cu),
    (t.geoTransform = function(t) {
      return { stream: Bs(t) };
    }),
    (t.geoTransverseMercator = function() {
      var t = cl(Ml);
      var n = t.center;
      var e = t.rotate;
      return (
        (t.center = function(t) {
          return arguments.length ? n([-t[1], t[0]]) : [(t = n())[1], -t[0]];
        }),
        (t.rotate = function(t) {
          return arguments.length
            ? e([t[0], t[1], t.length &gt; 2 ? t[2] + 90 : 90])
            : [(t = e())[0], t[1], t[2] - 90];
        }),
        e([0, 0, 90]).scale(159.155)
      );
    }),
    (t.geoTransverseMercatorRaw = Ml),
    (t.gray = function(t, n) {
      return new Bn(t, 0, 0, n == null ? 1 : n);
    }),
    (t.hcl = Xn),
    (t.hierarchy = kl),
    (t.histogram = function() {
      var t = v;
      var n = s;
      var e = M;
      function r(r) {
        var o;
        var a;
        var u = r.length;
        var c = new Array(u);
        for (o = 0; o &lt; u; ++o) c[o] = t(r[o], o, r);
        var f = n(c);
        var s = f[0];
        var l = f[1];
        var h = e(c, s, l);
        Array.isArray(h) ||
          ((h = w(s, l, h)), (h = g(Math.ceil(s / h) * h, l, h)));
        for (var d = h.length; h[0] &lt;= s; ) h.shift(), --d;
        for (; h[d - 1] &gt; l; ) h.pop(), --d;
        var p;
        var v = new Array(d + 1);
        for (o = 0; o &lt;= d; ++o)
          ((p = v[o] = []).x0 = o &gt; 0 ? h[o - 1] : s),
            (p.x1 = o &lt; d ? h[o] : l);
        for (o = 0; o &lt; u; ++o)
          s &lt;= (a = c[o]) &amp;&amp; a &lt;= l &amp;&amp; v[i(h, a, 0, d)].push(r[o]);
        return v;
      }
      return (
        (r.value = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : p(n)), r)
            : t;
        }),
        (r.domain = function(t) {
          return arguments.length
            ? ((n = typeof t === "function" ? t : p([t[0], t[1]])), r)
            : n;
        }),
        (r.thresholds = function(t) {
          return arguments.length
            ? ((e =
                typeof t === "function"
                  ? t
                  : Array.isArray(t)
                  ? p(h.call(t))
                  : p(t)),
              r)
            : e;
        }),
        r
      );
    }),
    (t.hsl = Tn),
    (t.html = pa),
    (t.image = function(t, n) {
      return new Promise(function(e, r) {
        var i = new Image();
        for (var o in n) i[o] = n[o];
        (i.onerror = r),
          (i.onload = function() {
            e(i);
          }),
          (i.src = t);
      });
    }),
    (t.interpolate = Te),
    (t.interpolateArray = function(t, n) {
      return (ye(n) ? ge : _e)(t, n);
    }),
    (t.interpolateBasis = oe),
    (t.interpolateBasisClosed = ae),
    (t.interpolateBlues = Qg),
    (t.interpolateBrBG = fg),
    (t.interpolateBuGn = Sg),
    (t.interpolateBuPu = Eg),
    (t.interpolateCividis = function(t) {
      return (
        (t = Math.max(0, Math.min(1, t))),
        "rgb(" +
          Math.max(
            0,
            Math.min(
              255,
              Math.round(
                -4.54 -
                  t *
                    (35.34 -
                      t *
                        (2381.73 - t * (6402.7 - t * (7024.72 - 2710.57 * t))))
              )
            )
          ) +
          ", " +
          Math.max(
            0,
            Math.min(
              255,
              Math.round(
                32.49 +
                  t *
                    (170.73 +
                      t * (52.82 - t * (131.46 - t * (176.58 - 67.37 * t))))
              )
            )
          ) +
          ", " +
          Math.max(
            0,
            Math.min(
              255,
              Math.round(
                81.24 +
                  t *
                    (442.36 -
                      t *
                        (2482.43 - t * (6167.24 - t * (6614.94 - 2475.67 * t))))
              )
            )
          ) +
          ")"
      );
    }),
    (t.interpolateCool = sy),
    (t.interpolateCubehelix = Ze),
    (t.interpolateCubehelixDefault = cy),
    (t.interpolateCubehelixLong = Qe),
    (t.interpolateDate = be),
    (t.interpolateDiscrete = function(t) {
      var n = t.length;
      return function(e) {
        return t[Math.max(0, Math.min(n - 1, Math.floor(e * n)))];
      };
    }),
    (t.interpolateGnBu = Pg),
    (t.interpolateGreens = Jg),
    (t.interpolateGreys = ny),
    (t.interpolateHcl = Ge),
    (t.interpolateHclLong = $e),
    (t.interpolateHsl = je),
    (t.interpolateHslLong = Xe),
    (t.interpolateHue = function(t, n) {
      var e = fe(+t, +n);
      return function(t) {
        var n = e(t);
        return n - 360 * Math.floor(n / 360);
      };
    }),
    (t.interpolateInferno = _y),
    (t.interpolateLab = function(t, n) {
      var e = le((t = On(t)).l, (n = On(n)).l);
      var r = le(t.a, n.a);
      var i = le(t.b, n.b);
      var o = le(t.opacity, n.opacity);
      return function(n) {
        return (
          (t.l = e(n)), (t.a = r(n)), (t.b = i(n)), (t.opacity = o(n)), t + ""
        );
      };
    }),
    (t.interpolateMagma = yy),
    (t.interpolateNumber = me),
    (t.interpolateNumberArray = ge),
    (t.interpolateObject = xe),
    (t.interpolateOrRd = Rg),
    (t.interpolateOranges = uy),
    (t.interpolatePRGn = lg),
    (t.interpolatePiYG = dg),
    (t.interpolatePlasma = by),
    (t.interpolatePuBu = Ug),
    (t.interpolatePuBuGn = qg),
    (t.interpolatePuOr = vg),
    (t.interpolatePuRd = Bg),
    (t.interpolatePurples = ry),
    (t.interpolateRainbow = function(t) {
      (t &lt; 0 || t &gt; 1) &amp;&amp; (t -= Math.floor(t));
      var n = Math.abs(t - 0.5);
      return (
        (ly.h = 360 * t - 100),
        (ly.s = 1.5 - 1.5 * n),
        (ly.l = 0.8 - 0.9 * n),
        ly + ""
      );
    }),
    (t.interpolateRdBu = yg),
    (t.interpolateRdGy = bg),
    (t.interpolateRdPu = Yg),
    (t.interpolateRdYlBu = xg),
    (t.interpolateRdYlGn = Mg),
    (t.interpolateReds = oy),
    (t.interpolateRgb = he),
    (t.interpolateRgbBasis = pe),
    (t.interpolateRgbBasisClosed = ve),
    (t.interpolateRound = Ae),
    (t.interpolateSinebow = function(t) {
      var n;
      return (
        (t = (0.5 - t) * Math.PI),
        (hy.r = 255 * (n = Math.sin(t)) * n),
        (hy.g = 255 * (n = Math.sin(t + dy)) * n),
        (hy.b = 255 * (n = Math.sin(t + py)) * n),
        hy + ""
      );
    }),
    (t.interpolateSpectral = Tg),
    (t.interpolateString = Ne),
    (t.interpolateTransformCss = qe),
    (t.interpolateTransformSvg = Le),
    (t.interpolateTurbo = function(t) {
      return (
        (t = Math.max(0, Math.min(1, t))),
        "rgb(" +
          Math.max(
            0,
            Math.min(
              255,
              Math.round(
                34.61 +
                  t *
                    (1172.33 -
                      t *
                        (10793.56 -
                          t * (33300.12 - t * (38394.49 - 14825.05 * t))))
              )
            )
          ) +
          ", " +
          Math.max(
            0,
            Math.min(
              255,
              Math.round(
                23.31 +
                  t *
                    (557.33 +
                      t *
                        (1225.33 - t * (3574.96 - t * (1073.77 + 707.56 * t))))
              )
            )
          ) +
          ", " +
          Math.max(
            0,
            Math.min(
              255,
              Math.round(
                27.2 +
                  t *
                    (3211.1 -
                      t *
                        (15327.97 - t * (27814 - t * (22569.18 - 6838.66 * t))))
              )
            )
          ) +
          ")"
      );
    }),
    (t.interpolateViridis = gy),
    (t.interpolateWarm = fy),
    (t.interpolateYlGn = Xg),
    (t.interpolateYlGnBu = Hg),
    (t.interpolateYlOrBr = Gg),
    (t.interpolateYlOrRd = Wg),
    (t.interpolateZoom = Ie),
    (t.interrupt = Pr),
    (t.interval = function(t, n, e) {
      var r = new lr();
      var i = n;
      return n == null
        ? (r.restart(t, n, e), r)
        : ((n = +n),
          (e = e == null ? fr() : +e),
          r.restart(
            function o(a) {
              (a += i), r.restart(o, (i += n), e), t(a);
            },
            n,
            e
          ),
          r);
    }),
    (t.isoFormat = Rv),
    (t.isoParse = Dv),
    (t.json = function(t, n) {
      return fetch(t, n).then(la);
    }),
    (t.keys = function(t) {
      var n = [];
      for (var e in t) n.push(e);
      return n;
    }),
    (t.lab = On),
    (t.lch = function(t, n, e, r) {
      return arguments.length === 1
        ? jn(t)
        : new Vn(e, n, t, r == null ? 1 : r);
    }),
    (t.line = Hy),
    (t.lineRadial = Qy),
    (t.linkHorizontal = function() {
      return r_(i_);
    }),
    (t.linkRadial = function() {
      var t = r_(a_);
      return (t.angle = t.x), delete t.x, (t.radius = t.y), delete t.y, t;
    }),
    (t.linkVertical = function() {
      return r_(o_);
    }),
    (t.local = qt),
    (t.map = co),
    (t.matcher = nt),
    (t.max = T),
    (t.mean = function(t, n) {
      var e;
      var r = t.length;
      var i = r;
      var o = -1;
      var a = 0;
      if (n == null) for (; ++o &lt; r; ) isNaN((e = u(t[o]))) ? --i : (a += e);
      else for (; ++o &lt; r; ) isNaN((e = u(n(t[o], o, t)))) ? --i : (a += e);
      if (i) return a / i;
    }),
    (t.median = function(t, e) {
      var r;
      var i = t.length;
      var o = -1;
      var a = [];
      if (e == null) for (; ++o &lt; i; ) isNaN((r = u(t[o]))) || a.push(r);
      else for (; ++o &lt; i; ) isNaN((r = u(e(t[o], o, t)))) || a.push(r);
      return N(a.sort(n), 0.5);
    }),
    (t.merge = A),
    (t.min = S),
    (t.mouse = Bt),
    (t.namespace = W),
    (t.namespaces = $),
    (t.nest = function() {
      var t;
      var n;
      var e;
      var r = [];
      var i = [];
      function o(e, i, a, u) {
        if (i &gt;= r.length) return t != null &amp;&amp; e.sort(t), n != null ? n(e) : e;
        for (
          var c, f, s, l = -1, h = e.length, d = r[i++], p = co(), v = a();
          ++l &lt; h;

        )
          (s = p.get((c = d((f = e[l])) + ""))) ? s.push(f) : p.set(c, [f]);
        return (
          p.each(function(t, n) {
            u(v, n, o(t, i, a, u));
          }),
          v
        );
      }
      return (e = {
        object: function(t) {
          return o(t, 0, fo, so);
        },
        map: function(t) {
          return o(t, 0, lo, ho);
        },
        entries: function(t) {
          return (function t(e, o) {
            if (++o &gt; r.length) return e;
            var a;
            var u = i[o - 1];
            return (
              n != null &amp;&amp; o &gt;= r.length
                ? (a = e.entries())
                : ((a = []),
                  e.each(function(n, e) {
                    a.push({ key: e, values: t(n, o) });
                  })),
              u != null
                ? a.sort(function(t, n) {
                    return u(t.key, n.key);
                  })
                : a
            );
          })(o(t, 0, lo, ho), 0);
        },
        key: function(t) {
          return r.push(t), e;
        },
        sortKeys: function(t) {
          return (i[r.length - 1] = t), e;
        },
        sortValues: function(n) {
          return (t = n), e;
        },
        rollup: function(t) {
          return (n = t), e;
        }
      });
    }),
    (t.now = fr),
    (t.pack = function() {
      var t = null;
      var n = 1;
      var e = 1;
      var r = Wl;
      function i(i) {
        return (
          (i.x = n / 2),
          (i.y = e / 2),
          t
            ? i
                .eachBefore(Kl(t))
                .eachAfter(Jl(r, 0.5))
                .eachBefore(th(1))
            : i
                .eachBefore(Kl(Ql))
                .eachAfter(Jl(Wl, 1))
                .eachAfter(Jl(r, i.r / Math.min(n, e)))
                .eachBefore(th(Math.min(n, e) / (2 * i.r))),
          i
        );
      }
      return (
        (i.radius = function(n) {
          return arguments.length ? ((t = Gl(n)), i) : t;
        }),
        (i.size = function(t) {
          return arguments.length ? ((n = +t[0]), (e = +t[1]), i) : [n, e];
        }),
        (i.padding = function(t) {
          return arguments.length
            ? ((r = typeof t === "function" ? t : Zl(+t)), i)
            : r;
        }),
        i
      );
    }),
    (t.packEnclose = Dl),
    (t.packSiblings = function(t) {
      return Vl(t), t;
    }),
    (t.pairs = function(t, n) {
      n == null &amp;&amp; (n = a);
      for (
        var e = 0, r = t.length - 1, i = t[0], o = new Array(r &lt; 0 ? 0 : r);
        e &lt; r;

      )
        o[e] = n(i, (i = t[++e]));
      return o;
    }),
    (t.partition = function() {
      var t = 1;
      var n = 1;
      var e = 0;
      var r = !1;
      function i(i) {
        var o = i.height + 1;
        return (
          (i.x0 = i.y0 = e),
          (i.x1 = t),
          (i.y1 = n / o),
          i.eachBefore(
            (function(t, n) {
              return function(r) {
                r.children &amp;&amp;
                  eh(
                    r,
                    r.x0,
                    (t * (r.depth + 1)) / n,
                    r.x1,
                    (t * (r.depth + 2)) / n
                  );
                var i = r.x0;
                var o = r.y0;
                var a = r.x1 - e;
                var u = r.y1 - e;
                a &lt; i &amp;&amp; (i = a = (i + a) / 2),
                  u &lt; o &amp;&amp; (o = u = (o + u) / 2),
                  (r.x0 = i),
                  (r.y0 = o),
                  (r.x1 = a),
                  (r.y1 = u);
              };
            })(n, o)
          ),
          r &amp;&amp; i.eachBefore(nh),
          i
        );
      }
      return (
        (i.round = function(t) {
          return arguments.length ? ((r = !!t), i) : r;
        }),
        (i.size = function(e) {
          return arguments.length ? ((t = +e[0]), (n = +e[1]), i) : [t, n];
        }),
        (i.padding = function(t) {
          return arguments.length ? ((e = +t), i) : e;
        }),
        i
      );
    }),
    (t.path = no),
    (t.permute = function(t, n) {
      for (var e = n.length, r = new Array(e); e--; ) r[e] = t[n[e]];
      return r;
    }),
    (t.pie = function() {
      var t = Vy;
      var n = Xy;
      var e = null;
      var r = my(0);
      var i = my(Py);
      var o = my(0);
      function a(a) {
        var u;
        var c;
        var f;
        var s;
        var l;
        var h = a.length;
        var d = 0;
        var p = new Array(h);
        var v = new Array(h);
        var g = +r.apply(this, arguments);
        var y = Math.min(Py, Math.max(-Py, i.apply(this, arguments) - g));
        var _ = Math.min(Math.abs(y) / h, o.apply(this, arguments));
        var b = _ * (y &lt; 0 ? -1 : 1);
        for (u = 0; u &lt; h; ++u)
          (l = v[(p[u] = u)] = +t(a[u], u, a)) &gt; 0 &amp;&amp; (d += l);
        for (
          n != null
            ? p.sort(function(t, e) {
                return n(v[t], v[e]);
              })
            : e != null &amp;&amp;
              p.sort(function(t, n) {
                return e(a[t], a[n]);
              }),
            u = 0,
            f = d ? (y - h * b) / d : 0;
          u &lt; h;
          ++u, g = s
        )
          (c = p[u]),
            (s = g + ((l = v[c]) &gt; 0 ? l * f : 0) + b),
            (v[c] = {
              data: a[c],
              index: u,
              value: l,
              startAngle: g,
              endAngle: s,
              padAngle: _
            });
        return v;
      }
      return (
        (a.value = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : my(+n)), a)
            : t;
        }),
        (a.sortValues = function(t) {
          return arguments.length ? ((n = t), (e = null), a) : n;
        }),
        (a.sort = function(t) {
          return arguments.length ? ((e = t), (n = null), a) : e;
        }),
        (a.startAngle = function(t) {
          return arguments.length
            ? ((r = typeof t === "function" ? t : my(+t)), a)
            : r;
        }),
        (a.endAngle = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : my(+t)), a)
            : i;
        }),
        (a.padAngle = function(t) {
          return arguments.length
            ? ((o = typeof t === "function" ? t : my(+t)), a)
            : o;
        }),
        a
      );
    }),
    (t.piecewise = function(t, n) {
      for (
        var e = 0, r = n.length - 1, i = n[0], o = new Array(r &lt; 0 ? 0 : r);
        e &lt; r;

      )
        o[e] = t(i, (i = n[++e]));
      return function(t) {
        var n = Math.max(0, Math.min(r - 1, Math.floor((t *= r))));
        return o[n](t - n);
      };
    }),
    (t.pointRadial = Jy),
    (t.polygonArea = function(t) {
      for (var n, e = -1, r = t.length, i = t[r - 1], o = 0; ++e &lt; r; )
        (n = i), (i = t[e]), (o += n[1] * i[0] - n[0] * i[1]);
      return o / 2;
    }),
    (t.polygonCentroid = function(t) {
      for (
        var n, e, r = -1, i = t.length, o = 0, a = 0, u = t[i - 1], c = 0;
        ++r &lt; i;

      )
        (n = u),
          (u = t[r]),
          (c += e = n[0] * u[1] - u[0] * n[1]),
          (o += (n[0] + u[0]) * e),
          (a += (n[1] + u[1]) * e);
      return [o / (c *= 3), a / c];
    }),
    (t.polygonContains = function(t, n) {
      for (
        var e,
          r,
          i = t.length,
          o = t[i - 1],
          a = n[0],
          u = n[1],
          c = o[0],
          f = o[1],
          s = !1,
          l = 0;
        l &lt; i;
        ++l
      )
        (e = (o = t[l])[0]),
          (r = o[1]) &gt; u != f &gt; u &amp;&amp;
            a &lt; ((c - e) * (u - r)) / (f - r) + e &amp;&amp;
            (s = !s),
          (c = e),
          (f = r);
      return s;
    }),
    (t.polygonHull = function(t) {
      if ((e = t.length) &lt; 3) return null;
      var n;
      var e;
      var r = new Array(e);
      var i = new Array(e);
      for (n = 0; n &lt; e; ++n) r[n] = [+t[n][0], +t[n][1], n];
      for (r.sort(mh), n = 0; n &lt; e; ++n) i[n] = [r[n][0], -r[n][1]];
      var o = xh(r);
      var a = xh(i);
      var u = a[0] === o[0];
      var c = a[a.length - 1] === o[o.length - 1];
      var f = [];
      for (n = o.length - 1; n &gt;= 0; --n) f.push(t[r[o[n]][2]]);
      for (n = +u; n &lt; a.length - c; ++n) f.push(t[r[a[n]][2]]);
      return f;
    }),
    (t.polygonLength = function(t) {
      for (
        var n, e, r = -1, i = t.length, o = t[i - 1], a = o[0], u = o[1], c = 0;
        ++r &lt; i;

      )
        (n = a),
          (e = u),
          (n -= a = (o = t[r])[0]),
          (e -= u = o[1]),
          (c += Math.sqrt(n * n + e * e));
      return c;
    }),
    (t.precisionFixed = $a),
    (t.precisionPrefix = Wa),
    (t.precisionRound = Za),
    (t.quadtree = wa),
    (t.quantile = N),
    (t.quantize = function(t, n) {
      for (var e = new Array(n), r = 0; r &lt; n; ++r) e[r] = t(r / (n - 1));
      return e;
    }),
    (t.radialArea = Ky),
    (t.radialLine = Qy),
    (t.randomBates = Sh),
    (t.randomExponential = kh),
    (t.randomIrwinHall = Ah),
    (t.randomLogNormal = Th),
    (t.randomNormal = Nh),
    (t.randomUniform = Mh),
    (t.range = g),
    (t.rgb = _n),
    (t.ribbon = function() {
      var t = eo;
      var n = ro;
      var e = io;
      var r = oo;
      var i = ao;
      var o = null;
      function a() {
        var a;
        var u = Wi.call(arguments);
        var c = t.apply(this, u);
        var f = n.apply(this, u);
        var s = +e.apply(this, ((u[0] = c), u));
        var l = r.apply(this, u) - Xi;
        var h = i.apply(this, u) - Xi;
        var d = s * Ii(l);
        var p = s * Hi(l);
        var v = +e.apply(this, ((u[0] = f), u));
        var g = r.apply(this, u) - Xi;
        var y = i.apply(this, u) - Xi;
        if (
          (o || (o = a = no()),
          o.moveTo(d, p),
          o.arc(0, 0, s, l, h),
          (l === g &amp;&amp; h === y) ||
            (o.quadraticCurveTo(0, 0, v * Ii(g), v * Hi(g)),
            o.arc(0, 0, v, g, y)),
          o.quadraticCurveTo(0, 0, d, p),
          o.closePath(),
          a)
        )
          return (o = null), a + "" || null;
      }
      return (
        (a.radius = function(t) {
          return arguments.length
            ? ((e = typeof t === "function" ? t : Zi(+t)), a)
            : e;
        }),
        (a.startAngle = function(t) {
          return arguments.length
            ? ((r = typeof t === "function" ? t : Zi(+t)), a)
            : r;
        }),
        (a.endAngle = function(t) {
          return arguments.length
            ? ((i = typeof t === "function" ? t : Zi(+t)), a)
            : i;
        }),
        (a.source = function(n) {
          return arguments.length ? ((t = n), a) : t;
        }),
        (a.target = function(t) {
          return arguments.length ? ((n = t), a) : n;
        }),
        (a.context = function(t) {
          return arguments.length ? ((o = t == null ? null : t), a) : o;
        }),
        a
      );
    }),
    (t.scaleBand = Lh),
    (t.scaleDiverging = function t() {
      var n = $h($v()(Bh));
      return (
        (n.copy = function() {
          return Vv(n, t());
        }),
        Ch.apply(n, arguments)
      );
    }),
    (t.scaleDivergingLog = function t() {
      var n = ed($v()).domain([0.1, 1, 10]);
      return (
        (n.copy = function() {
          return Vv(n, t()).base(n.base());
        }),
        Ch.apply(n, arguments)
      );
    }),
    (t.scaleDivergingPow = Wv),
    (t.scaleDivergingSqrt = function() {
      return Wv.apply(null, arguments).exponent(0.5);
    }),
    (t.scaleDivergingSymlog = function t() {
      var n = od($v());
      return (
        (n.copy = function() {
          return Vv(n, t()).constant(n.constant());
        }),
        Ch.apply(n, arguments)
      );
    }),
    (t.scaleIdentity = function t(n) {
      var e;
      function r(t) {
        return isNaN((t = +t)) ? e : t;
      }
      return (
        (r.invert = r),
        (r.domain = r.range = function(t) {
          return arguments.length ? ((n = zh.call(t, Uh)), r) : n.slice();
        }),
        (r.unknown = function(t) {
          return arguments.length ? ((e = t), r) : e;
        }),
        (r.copy = function() {
          return t(n).unknown(e);
        }),
        (n = arguments.length ? zh.call(n, Uh) : [0, 1]),
        $h(r)
      );
    }),
    (t.scaleImplicit = Dh),
    (t.scaleLinear = function t() {
      var n = Vh(Bh, Bh);
      return (
        (n.copy = function() {
          return jh(n, t());
        }),
        Eh.apply(n, arguments),
        $h(n)
      );
    }),
    (t.scaleLog = function t() {
      var n = ed(Xh()).domain([1, 10]);
      return (
        (n.copy = function() {
          return jh(n, t()).base(n.base());
        }),
        Eh.apply(n, arguments),
        n
      );
    }),
    (t.scaleOrdinal = qh),
    (t.scalePoint = function() {
      return (function t(n) {
        var e = n.copy;
        return (
          (n.padding = n.paddingOuter),
          delete n.paddingInner,
          delete n.paddingOuter,
          (n.copy = function() {
            return t(e());
          }),
          n
        );
      })(Lh.apply(null, arguments).paddingInner(1));
    }),
    (t.scalePow = sd),
    (t.scaleQuantile = function t() {
      var e;
      var r = [];
      var o = [];
      var a = [];
      function u() {
        var t = 0;
        var n = Math.max(1, o.length);
        for (a = new Array(n - 1); ++t &lt; n; ) a[t - 1] = N(r, t / n);
        return c;
      }
      function c(t) {
        return isNaN((t = +t)) ? e : o[i(a, t)];
      }
      return (
        (c.invertExtent = function(t) {
          var n = o.indexOf(t);
          return n &lt; 0
            ? [NaN, NaN]
            : [n &gt; 0 ? a[n - 1] : r[0], n &lt; a.length ? a[n] : r[r.length - 1]];
        }),
        (c.domain = function(t) {
          if (!arguments.length) return r.slice();
          r = [];
          for (var e, i = 0, o = t.length; i &lt; o; ++i)
            (e = t[i]) == null || isNaN((e = +e)) || r.push(e);
          return r.sort(n), u();
        }),
        (c.range = function(t) {
          return arguments.length ? ((o = Rh.call(t)), u()) : o.slice();
        }),
        (c.unknown = function(t) {
          return arguments.length ? ((e = t), c) : e;
        }),
        (c.quantiles = function() {
          return a.slice();
        }),
        (c.copy = function() {
          return t()
            .domain(r)
            .range(o)
            .unknown(e);
        }),
        Eh.apply(c, arguments)
      );
    }),
    (t.scaleQuantize = function t() {
      var n;
      var e = 0;
      var r = 1;
      var o = 1;
      var a = [0.5];
      var u = [0, 1];
      function c(t) {
        return t &lt;= t ? u[i(a, t, 0, o)] : n;
      }
      function f() {
        var t = -1;
        for (a = new Array(o); ++t &lt; o; )
          a[t] = ((t + 1) * r - (t - o) * e) / (o + 1);
        return c;
      }
      return (
        (c.domain = function(t) {
          return arguments.length ? ((e = +t[0]), (r = +t[1]), f()) : [e, r];
        }),
        (c.range = function(t) {
          return arguments.length
            ? ((o = (u = Rh.call(t)).length - 1), f())
            : u.slice();
        }),
        (c.invertExtent = function(t) {
          var n = u.indexOf(t);
          return n &lt; 0
            ? [NaN, NaN]
            : n &lt; 1
            ? [e, a[0]]
            : n &gt;= o
            ? [a[o - 1], r]
            : [a[n - 1], a[n]];
        }),
        (c.unknown = function(t) {
          return arguments.length ? ((n = t), c) : c;
        }),
        (c.thresholds = function() {
          return a.slice();
        }),
        (c.copy = function() {
          return t()
            .domain([e, r])
            .range(u)
            .unknown(n);
        }),
        Eh.apply($h(c), arguments)
      );
    }),
    (t.scaleSequential = function t() {
      var n = $h(Xv()(Bh));
      return (
        (n.copy = function() {
          return Vv(n, t());
        }),
        Ch.apply(n, arguments)
      );
    }),
    (t.scaleSequentialLog = function t() {
      var n = ed(Xv()).domain([1, 10]);
      return (
        (n.copy = function() {
          return Vv(n, t()).base(n.base());
        }),
        Ch.apply(n, arguments)
      );
    }),
    (t.scaleSequentialPow = Gv),
    (t.scaleSequentialQuantile = function t() {
      var e = [];
      var r = Bh;
      function o(t) {
        if (!isNaN((t = +t))) return r((i(e, t) - 1) / (e.length - 1));
      }
      return (
        (o.domain = function(t) {
          if (!arguments.length) return e.slice();
          e = [];
          for (var r, i = 0, a = t.length; i &lt; a; ++i)
            (r = t[i]) == null || isNaN((r = +r)) || e.push(r);
          return e.sort(n), o;
        }),
        (o.interpolator = function(t) {
          return arguments.length ? ((r = t), o) : r;
        }),
        (o.copy = function() {
          return t(r).domain(e);
        }),
        Ch.apply(o, arguments)
      );
    }),
    (t.scaleSequentialSqrt = function() {
      return Gv.apply(null, arguments).exponent(0.5);
    }),
    (t.scaleSequentialSymlog = function t() {
      var n = od(Xv());
      return (
        (n.copy = function() {
          return Vv(n, t()).constant(n.constant());
        }),
        Ch.apply(n, arguments)
      );
    }),
    (t.scaleSqrt = function() {
      return sd.apply(null, arguments).exponent(0.5);
    }),
    (t.scaleSymlog = function t() {
      var n = od(Xh());
      return (
        (n.copy = function() {
          return jh(n, t()).constant(n.constant());
        }),
        Eh.apply(n, arguments)
      );
    }),
    (t.scaleThreshold = function t() {
      var n;
      var e = [0.5];
      var r = [0, 1];
      var o = 1;
      function a(t) {
        return t &lt;= t ? r[i(e, t, 0, o)] : n;
      }
      return (
        (a.domain = function(t) {
          return arguments.length
            ? ((e = Rh.call(t)), (o = Math.min(e.length, r.length - 1)), a)
            : e.slice();
        }),
        (a.range = function(t) {
          return arguments.length
            ? ((r = Rh.call(t)), (o = Math.min(e.length, r.length - 1)), a)
            : r.slice();
        }),
        (a.invertExtent = function(t) {
          var n = r.indexOf(t);
          return [e[n - 1], e[n]];
        }),
        (a.unknown = function(t) {
          return arguments.length ? ((n = t), a) : n;
        }),
        (a.copy = function() {
          return t()
            .domain(e)
            .range(r)
            .unknown(n);
        }),
        Eh.apply(a, arguments)
      );
    }),
    (t.scaleTime = function() {
      return Eh.apply(
        jv(Hd, Yd, Sd, Nd, wd, md, _d, pd, t.timeFormat).domain([
          new Date(2e3, 0, 1),
          new Date(2e3, 0, 2)
        ]),
        arguments
      );
    }),
    (t.scaleUtc = function() {
      return Eh.apply(
        jv(pp, hp, Kd, Wd, Gd, Xd, _d, pd, t.utcFormat).domain([
          Date.UTC(2e3, 0, 1),
          Date.UTC(2e3, 0, 2)
        ]),
        arguments
      );
    }),
    (t.scan = function(t, e) {
      if ((r = t.length)) {
        var r;
        var i;
        var o = 0;
        var a = 0;
        var u = t[a];
        for (e == null &amp;&amp; (e = n); ++o &lt; r; )
          (e((i = t[o]), u) &lt; 0 || e(u, u) !== 0) &amp;&amp; ((u = i), (a = o));
        return e(u, u) === 0 ? a : void 0;
      }
    }),
    (t.schemeAccent = Kv),
    (t.schemeBlues = Zg),
    (t.schemeBrBG = cg),
    (t.schemeBuGn = Ag),
    (t.schemeBuPu = kg),
    (t.schemeCategory10 = Qv),
    (t.schemeDark2 = Jv),
    (t.schemeGnBu = Cg),
    (t.schemeGreens = Kg),
    (t.schemeGreys = ty),
    (t.schemeOrRd = zg),
    (t.schemeOranges = ay),
    (t.schemePRGn = sg),
    (t.schemePaired = tg),
    (t.schemePastel1 = ng),
    (t.schemePastel2 = eg),
    (t.schemePiYG = hg),
    (t.schemePuBu = Lg),
    (t.schemePuBuGn = Dg),
    (t.schemePuOr = pg),
    (t.schemePuRd = Og),
    (t.schemePurples = ey),
    (t.schemeRdBu = gg),
    (t.schemeRdGy = _g),
    (t.schemeRdPu = Fg),
    (t.schemeRdYlBu = mg),
    (t.schemeRdYlGn = wg),
    (t.schemeReds = iy),
    (t.schemeSet1 = rg),
    (t.schemeSet2 = ig),
    (t.schemeSet3 = og),
    (t.schemeSpectral = Ng),
    (t.schemeTableau10 = ag),
    (t.schemeYlGn = jg),
    (t.schemeYlGnBu = Ig),
    (t.schemeYlOrBr = Vg),
    (t.schemeYlOrRd = $g),
    (t.select = Rt),
    (t.selectAll = function(t) {
      return typeof t === "string"
        ? new Pt([document.querySelectorAll(t)], [document.documentElement])
        : new Pt([t == null ? [] : t], Ct);
    }),
    (t.selection = zt),
    (t.selector = K),
    (t.selectorAll = tt),
    (t.set = go),
    (t.shuffle = function(t, n, e) {
      for (
        var r, i, o = (e == null ? t.length : e) - (n = n == null ? 0 : +n);
        o;

      )
        (i = (Math.random() * o--) | 0),
          (r = t[o + n]),
          (t[o + n] = t[i + n]),
          (t[i + n] = r);
      return t;
    }),
    (t.stack = function() {
      var t = my([]);
      var n = rb;
      var e = eb;
      var r = ib;
      function i(i) {
        var o;
        var a;
        var u = t.apply(this, arguments);
        var c = i.length;
        var f = u.length;
        var s = new Array(f);
        for (o = 0; o &lt; f; ++o) {
          for (var l, h = u[o], d = (s[o] = new Array(c)), p = 0; p &lt; c; ++p)
            (d[p] = l = [0, +r(i[p], h, p, i)]), (l.data = i[p]);
          d.key = h;
        }
        for (o = 0, a = n(s); o &lt; f; ++o) s[a[o]].index = o;
        return e(s, a), s;
      }
      return (
        (i.keys = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : my(t_.call(n))), i)
            : t;
        }),
        (i.value = function(t) {
          return arguments.length
            ? ((r = typeof t === "function" ? t : my(+t)), i)
            : r;
        }),
        (i.order = function(t) {
          return arguments.length
            ? ((n =
                t == null ? rb : typeof t === "function" ? t : my(t_.call(t))),
              i)
            : n;
        }),
        (i.offset = function(t) {
          return arguments.length ? ((e = t == null ? eb : t), i) : e;
        }),
        i
      );
    }),
    (t.stackOffsetDiverging = function(t, n) {
      if ((u = t.length) &gt; 0)
        for (var e, r, i, o, a, u, c = 0, f = t[n[0]].length; c &lt; f; ++c)
          for (o = a = 0, e = 0; e &lt; u; ++e)
            (i = (r = t[n[e]][c])[1] - r[0]) &gt; 0
              ? ((r[0] = o), (r[1] = o += i))
              : i &lt; 0
              ? ((r[1] = a), (r[0] = a += i))
              : ((r[0] = 0), (r[1] = i));
    }),
    (t.stackOffsetExpand = function(t, n) {
      if ((r = t.length) &gt; 0) {
        for (var e, r, i, o = 0, a = t[0].length; o &lt; a; ++o) {
          for (i = e = 0; e &lt; r; ++e) i += t[e][o][1] || 0;
          if (i) for (e = 0; e &lt; r; ++e) t[e][o][1] /= i;
        }
        eb(t, n);
      }
    }),
    (t.stackOffsetNone = eb),
    (t.stackOffsetSilhouette = function(t, n) {
      if ((e = t.length) &gt; 0) {
        for (var e, r = 0, i = t[n[0]], o = i.length; r &lt; o; ++r) {
          for (var a = 0, u = 0; a &lt; e; ++a) u += t[a][r][1] || 0;
          i[r][1] += i[r][0] = -u / 2;
        }
        eb(t, n);
      }
    }),
    (t.stackOffsetWiggle = function(t, n) {
      if ((i = t.length) &gt; 0 &amp;&amp; (r = (e = t[n[0]]).length) &gt; 0) {
        for (var e, r, i, o = 0, a = 1; a &lt; r; ++a) {
          for (var u = 0, c = 0, f = 0; u &lt; i; ++u) {
            for (
              var s = t[n[u]],
                l = s[a][1] || 0,
                h = (l - (s[a - 1][1] || 0)) / 2,
                d = 0;
              d &lt; u;
              ++d
            ) {
              var p = t[n[d]];
              h += (p[a][1] || 0) - (p[a - 1][1] || 0);
            }
            (c += l), (f += h * l);
          }
          (e[a - 1][1] += e[a - 1][0] = o), c &amp;&amp; (o -= f / c);
        }
        (e[a - 1][1] += e[a - 1][0] = o), eb(t, n);
      }
    }),
    (t.stackOrderAppearance = ob),
    (t.stackOrderAscending = ub),
    (t.stackOrderDescending = function(t) {
      return ub(t).reverse();
    }),
    (t.stackOrderInsideOut = function(t) {
      var n;
      var e;
      var r = t.length;
      var i = t.map(cb);
      var o = ob(t);
      var a = 0;
      var u = 0;
      var c = [];
      var f = [];
      for (n = 0; n &lt; r; ++n)
        (e = o[n]), a &lt; u ? ((a += i[e]), c.push(e)) : ((u += i[e]), f.push(e));
      return f.reverse().concat(c);
    }),
    (t.stackOrderNone = rb),
    (t.stackOrderReverse = function(t) {
      return rb(t).reverse();
    }),
    (t.stratify = function() {
      var t = ah;
      var n = uh;
      function e(e) {
        var r;
        var i;
        var o;
        var a;
        var u;
        var c;
        var f;
        var s = e.length;
        var l = new Array(s);
        var h = {};
        for (i = 0; i &lt; s; ++i)
          (r = e[i]),
            (u = l[i] = new zl(r)),
            (c = t(r, i, e)) != null &amp;&amp;
              (c += "") &amp;&amp;
              (h[(f = rh + (u.id = c))] = f in h ? oh : u);
        for (i = 0; i &lt; s; ++i)
          if (((u = l[i]), (c = n(e[i], i, e)) != null &amp;&amp; (c += ""))) {
            if (!(a = h[rh + c])) throw new Error("missing: " + c);
            if (a === oh) throw new Error("ambiguous: " + c);
            a.children ? a.children.push(u) : (a.children = [u]),
              (u.parent = a);
          } else {
            if (o) throw new Error("multiple roots");
            o = u;
          }
        if (!o) throw new Error("no root");
        if (
          ((o.parent = ih),
          o
            .eachBefore(function(t) {
              (t.depth = t.parent.depth + 1), --s;
            })
            .eachBefore(Pl),
          (o.parent = null),
          s &gt; 0)
        )
          throw new Error("cycle");
        return o;
      }
      return (
        (e.id = function(n) {
          return arguments.length ? ((t = $l(n)), e) : t;
        }),
        (e.parentId = function(t) {
          return arguments.length ? ((n = $l(t)), e) : n;
        }),
        e
      );
    }),
    (t.style = ft),
    (t.sum = function(t, n) {
      var e;
      var r = t.length;
      var i = -1;
      var o = 0;
      if (n == null) for (; ++i &lt; r; ) (e = +t[i]) &amp;&amp; (o += e);
      else for (; ++i &lt; r; ) (e = +n(t[i], i, t)) &amp;&amp; (o += e);
      return o;
    }),
    (t.svg = va),
    (t.symbol = function() {
      var t = my(u_);
      var n = my(64);
      var e = null;
      function r() {
        var r;
        if (
          (e || (e = r = no()),
          t.apply(this, arguments).draw(e, +n.apply(this, arguments)),
          r)
        )
          return (e = null), r + "" || null;
      }
      return (
        (r.type = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : my(n)), r)
            : t;
        }),
        (r.size = function(t) {
          return arguments.length
            ? ((n = typeof t === "function" ? t : my(+t)), r)
            : n;
        }),
        (r.context = function(t) {
          return arguments.length ? ((e = t == null ? null : t), r) : e;
        }),
        r
      );
    }),
    (t.symbolCircle = u_),
    (t.symbolCross = c_),
    (t.symbolDiamond = l_),
    (t.symbolSquare = g_),
    (t.symbolStar = v_),
    (t.symbolTriangle = __),
    (t.symbolWye = w_),
    (t.symbols = M_),
    (t.text = ua),
    (t.thresholdFreedmanDiaconis = function(t, e, r) {
      return (
        (t = d.call(t, u).sort(n)),
        Math.ceil(
          (r - e) / (2 * (N(t, 0.75) - N(t, 0.25)) * Math.pow(t.length, -1 / 3))
        )
      );
    }),
    (t.thresholdScott = function(t, n, e) {
      return Math.ceil((e - n) / (3.5 * f(t) * Math.pow(t.length, -1 / 3)));
    }),
    (t.thresholdSturges = M),
    (t.tickFormat = Gh),
    (t.tickIncrement = x),
    (t.tickStep = w),
    (t.ticks = m),
    (t.timeDay = Nd),
    (t.timeDays = Td),
    (t.timeFormatDefaultLocale = zv),
    (t.timeFormatLocale = bp),
    (t.timeFriday = zd),
    (t.timeFridays = Bd),
    (t.timeHour = wd),
    (t.timeHours = Md),
    (t.timeInterval = dd),
    (t.timeMillisecond = pd),
    (t.timeMilliseconds = vd),
    (t.timeMinute = md),
    (t.timeMinutes = xd),
    (t.timeMonday = kd),
    (t.timeMondays = qd),
    (t.timeMonth = Yd),
    (t.timeMonths = Id),
    (t.timeSaturday = Rd),
    (t.timeSaturdays = Fd),
    (t.timeSecond = _d),
    (t.timeSeconds = bd),
    (t.timeSunday = Sd),
    (t.timeSundays = Dd),
    (t.timeThursday = Pd),
    (t.timeThursdays = Od),
    (t.timeTuesday = Ed),
    (t.timeTuesdays = Ld),
    (t.timeWednesday = Cd),
    (t.timeWednesdays = Ud),
    (t.timeWeek = Sd),
    (t.timeWeeks = Dd),
    (t.timeYear = Hd),
    (t.timeYears = jd),
    (t.timeout = yr),
    (t.timer = hr),
    (t.timerFlush = dr),
    (t.touch = Ft),
    (t.touches = function(t, n) {
      n == null &amp;&amp; (n = Ut().touches);
      for (var e = 0, r = n ? n.length : 0, i = new Array(r); e &lt; r; ++e)
        i[e] = Ot(t, n[e]);
      return i;
    }),
    (t.transition = Or),
    (t.transpose = k),
    (t.tree = function() {
      var t = ch;
      var n = 1;
      var e = 1;
      var r = null;
      function i(i) {
        var c = (function(t) {
          for (var n, e, r, i, o, a = new dh(t, 0), u = [a]; (n = u.pop()); )
            if ((r = n._.children))
              for (
                n.children = new Array((o = r.length)), i = o - 1;
                i &gt;= 0;
                --i
              )
                u.push((e = n.children[i] = new dh(r[i], i))), (e.parent = n);
          return ((a.parent = new dh(null, 0)).children = [a]), a;
        })(i);
        if ((c.eachAfter(o), (c.parent.m = -c.z), c.eachBefore(a), r))
          i.eachBefore(u);
        else {
          var f = i;
          var s = i;
          var l = i;
          i.eachBefore(function(t) {
            t.x &lt; f.x &amp;&amp; (f = t),
              t.x &gt; s.x &amp;&amp; (s = t),
              t.depth &gt; l.depth &amp;&amp; (l = t);
          });
          var h = f === s ? 1 : t(f, s) / 2;
          var d = h - f.x;
          var p = n / (s.x + h + d);
          var v = e / (l.depth || 1);
          i.eachBefore(function(t) {
            (t.x = (t.x + d) * p), (t.y = t.depth * v);
          });
        }
        return i;
      }
      function o(n) {
        var e = n.children;
        var r = n.parent.children;
        var i = n.i ? r[n.i - 1] : null;
        if (e) {
          !(function(t) {
            for (var n, e = 0, r = 0, i = t.children, o = i.length; --o &gt;= 0; )
              ((n = i[o]).z += e), (n.m += e), (e += n.s + (r += n.c));
          })(n);
          var o = (e[0].z + e[e.length - 1].z) / 2;
          i ? ((n.z = i.z + t(n._, i._)), (n.m = n.z - o)) : (n.z = o);
        } else i &amp;&amp; (n.z = i.z + t(n._, i._));
        n.parent.A = (function(n, e, r) {
          if (e) {
            for (
              var i,
                o = n,
                a = n,
                u = e,
                c = o.parent.children[0],
                f = o.m,
                s = a.m,
                l = u.m,
                h = c.m;
              (u = sh(u)), (o = fh(o)), u &amp;&amp; o;

            )
              (c = fh(c)),
                ((a = sh(a)).a = n),
                (i = u.z + l - o.z - f + t(u._, o._)) &gt; 0 &amp;&amp;
                  (lh(hh(u, n, r), n, i), (f += i), (s += i)),
                (l += u.m),
                (f += o.m),
                (h += c.m),
                (s += a.m);
            u &amp;&amp; !sh(a) &amp;&amp; ((a.t = u), (a.m += l - s)),
              o &amp;&amp; !fh(c) &amp;&amp; ((c.t = o), (c.m += f - h), (r = n));
          }
          return r;
        })(n, i, n.parent.A || r[0]);
      }
      function a(t) {
        (t._.x = t.z + t.parent.m), (t.m += t.parent.m);
      }
      function u(t) {
        (t.x *= n), (t.y = t.depth * e);
      }
      return (
        (i.separation = function(n) {
          return arguments.length ? ((t = n), i) : t;
        }),
        (i.size = function(t) {
          return arguments.length
            ? ((r = !1), (n = +t[0]), (e = +t[1]), i)
            : r
            ? null
            : [n, e];
        }),
        (i.nodeSize = function(t) {
          return arguments.length
            ? ((r = !0), (n = +t[0]), (e = +t[1]), i)
            : r
            ? [n, e]
            : null;
        }),
        i
      );
    }),
    (t.treemap = function() {
      var t = yh;
      var n = !1;
      var e = 1;
      var r = 1;
      var i = [0];
      var o = Wl;
      var a = Wl;
      var u = Wl;
      var c = Wl;
      var f = Wl;
      function s(t) {
        return (
          (t.x0 = t.y0 = 0),
          (t.x1 = e),
          (t.y1 = r),
          t.eachBefore(l),
          (i = [0]),
          n &amp;&amp; t.eachBefore(nh),
          t
        );
      }
      function l(n) {
        var e = i[n.depth];
        var r = n.x0 + e;
        var s = n.y0 + e;
        var l = n.x1 - e;
        var h = n.y1 - e;
        l &lt; r &amp;&amp; (r = l = (r + l) / 2),
          h &lt; s &amp;&amp; (s = h = (s + h) / 2),
          (n.x0 = r),
          (n.y0 = s),
          (n.x1 = l),
          (n.y1 = h),
          n.children &amp;&amp;
            ((e = i[n.depth + 1] = o(n) / 2),
            (r += f(n) - e),
            (s += a(n) - e),
            (l -= u(n) - e) &lt; r &amp;&amp; (r = l = (r + l) / 2),
            (h -= c(n) - e) &lt; s &amp;&amp; (s = h = (s + h) / 2),
            t(n, r, s, l, h));
      }
      return (
        (s.round = function(t) {
          return arguments.length ? ((n = !!t), s) : n;
        }),
        (s.size = function(t) {
          return arguments.length ? ((e = +t[0]), (r = +t[1]), s) : [e, r];
        }),
        (s.tile = function(n) {
          return arguments.length ? ((t = $l(n)), s) : t;
        }),
        (s.padding = function(t) {
          return arguments.length
            ? s.paddingInner(t).paddingOuter(t)
            : s.paddingInner();
        }),
        (s.paddingInner = function(t) {
          return arguments.length
            ? ((o = typeof t === "function" ? t : Zl(+t)), s)
            : o;
        }),
        (s.paddingOuter = function(t) {
          return arguments.length
            ? s
                .paddingTop(t)
                .paddingRight(t)
                .paddingBottom(t)
                .paddingLeft(t)
            : s.paddingTop();
        }),
        (s.paddingTop = function(t) {
          return arguments.length
            ? ((a = typeof t === "function" ? t : Zl(+t)), s)
            : a;
        }),
        (s.paddingRight = function(t) {
          return arguments.length
            ? ((u = typeof t === "function" ? t : Zl(+t)), s)
            : u;
        }),
        (s.paddingBottom = function(t) {
          return arguments.length
            ? ((c = typeof t === "function" ? t : Zl(+t)), s)
            : c;
        }),
        (s.paddingLeft = function(t) {
          return arguments.length
            ? ((f = typeof t === "function" ? t : Zl(+t)), s)
            : f;
        }),
        s
      );
    }),
    (t.treemapBinary = function(t, n, e, r, i) {
      var o;
      var a;
      var u = t.children;
      var c = u.length;
      var f = new Array(c + 1);
      for (f[0] = a = o = 0; o &lt; c; ++o) f[o + 1] = a += u[o].value;
      !(function t(n, e, r, i, o, a, c) {
        if (n &gt;= e - 1) {
          var s = u[n];
          return (s.x0 = i), (s.y0 = o), (s.x1 = a), void (s.y1 = c);
        }
        for (var l = f[n], h = r / 2 + l, d = n + 1, p = e - 1; d &lt; p; ) {
          var v = (d + p) &gt;&gt;&gt; 1;
          f[v] &lt; h ? (d = v + 1) : (p = v);
        }
        h - f[d - 1] &lt; f[d] - h &amp;&amp; n + 1 &lt; d &amp;&amp; --d;
        var g = f[d] - l;
        var y = r - g;
        if (a - i &gt; c - o) {
          var _ = (i * y + a * g) / r;
          t(n, d, g, i, o, _, c), t(d, e, y, _, o, a, c);
        } else {
          var b = (o * y + c * g) / r;
          t(n, d, g, i, o, a, b), t(d, e, y, i, b, a, c);
        }
      })(0, c, t.value, n, e, r, i);
    }),
    (t.treemapDice = eh),
    (t.treemapResquarify = _h),
    (t.treemapSlice = ph),
    (t.treemapSliceDice = function(t, n, e, r, i) {
      (1 &amp; t.depth ? ph : eh)(t, n, e, r, i);
    }),
    (t.treemapSquarify = yh),
    (t.tsv = sa),
    (t.tsvFormat = Ko),
    (t.tsvFormatBody = Jo),
    (t.tsvFormatRow = na),
    (t.tsvFormatRows = ta),
    (t.tsvFormatValue = ea),
    (t.tsvParse = Zo),
    (t.tsvParseRows = Qo),
    (t.utcDay = Wd),
    (t.utcDays = Zd),
    (t.utcFriday = rp),
    (t.utcFridays = sp),
    (t.utcHour = Gd),
    (t.utcHours = $d),
    (t.utcMillisecond = pd),
    (t.utcMilliseconds = vd),
    (t.utcMinute = Xd),
    (t.utcMinutes = Vd),
    (t.utcMonday = Jd),
    (t.utcMondays = ap),
    (t.utcMonth = hp),
    (t.utcMonths = dp),
    (t.utcSaturday = ip),
    (t.utcSaturdays = lp),
    (t.utcSecond = _d),
    (t.utcSeconds = bd),
    (t.utcSunday = Kd),
    (t.utcSundays = op),
    (t.utcThursday = ep),
    (t.utcThursdays = fp),
    (t.utcTuesday = tp),
    (t.utcTuesdays = up),
    (t.utcWednesday = np),
    (t.utcWednesdays = cp),
    (t.utcWeek = Kd),
    (t.utcWeeks = op),
    (t.utcYear = pp),
    (t.utcYears = vp),
    (t.values = function(t) {
      var n = [];
      for (var e in t) n.push(t[e]);
      return n;
    }),
    (t.variance = c),
    (t.version = "5.16.0"),
    (t.voronoi = function() {
      var t = sb;
      var n = lb;
      var e = null;
      function r(r) {
        return new Vb(
          r.map(function(e, i) {
            var o = [
              Math.round(t(e, i, r) / Ib) * Ib,
              Math.round(n(e, i, r) / Ib) * Ib
            ];
            return (o.index = i), (o.data = e), o;
          }),
          e
        );
      }
      return (
        (r.polygons = function(t) {
          return r(t).polygons();
        }),
        (r.links = function(t) {
          return r(t).links();
        }),
        (r.triangles = function(t) {
          return r(t).triangles();
        }),
        (r.x = function(n) {
          return arguments.length
            ? ((t = typeof n === "function" ? n : fb(+n)), r)
            : t;
        }),
        (r.y = function(t) {
          return arguments.length
            ? ((n = typeof t === "function" ? t : fb(+t)), r)
            : n;
        }),
        (r.extent = function(t) {
          return arguments.length
            ? ((e =
                t == null
                  ? null
                  : [[+t[0][0], +t[0][1]], [+t[1][0], +t[1][1]]]),
              r)
            : e &amp;&amp; [[e[0][0], e[0][1]], [e[1][0], e[1][1]]];
        }),
        (r.size = function(t) {
          return arguments.length
            ? ((e = t == null ? null : [[0, 0], [+t[0], +t[1]]]), r)
            : e &amp;&amp; [e[1][0] - e[0][0], e[1][1] - e[0][1]];
        }),
        r
      );
    }),
    (t.window = ct),
    (t.xml = da),
    (t.zip = function() {
      return k(arguments);
    }),
    (t.zoom = function() {
      var n;
      var e;
      var r = tm;
      var i = nm;
      var o = om;
      var a = rm;
      var u = im;
      var c = [0, 1 / 0];
      var f = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]];
      var s = 250;
      var l = Ie;
      var h = I("start", "zoom", "end");
      var d = 500;
      var p = 150;
      var v = 0;
      function g(t) {
        t.property("__zoom", em)
          .on("wheel.zoom", M)
          .on("mousedown.zoom", N)
          .on("dblclick.zoom", T)
          .filter(u)
          .on("touchstart.zoom", A)
          .on("touchmove.zoom", S)
          .on("touchend.zoom touchcancel.zoom", k)
          .style("touch-action", "none")
          .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
      }
      function y(t, n) {
        return (n = Math.max(c[0], Math.min(c[1], n))) === t.k
          ? t
          : new Wb(n, t.x, t.y);
      }
      function _(t, n, e) {
        var r = n[0] - e[0] * t.k;
        var i = n[1] - e[1] * t.k;
        return r === t.x &amp;&amp; i === t.y ? t : new Wb(t.k, r, i);
      }
      function b(t) {
        return [(+t[0][0] + +t[1][0]) / 2, (+t[0][1] + +t[1][1]) / 2];
      }
      function m(t, n, e) {
        t.on("start.zoom", function() {
          x(this, arguments).start();
        })
          .on("interrupt.zoom end.zoom", function() {
            x(this, arguments).end();
          })
          .tween("zoom", function() {
            var t = this;
            var r = arguments;
            var o = x(t, r);
            var a = i.apply(t, r);
            var u =
              e == null ? b(a) : typeof e === "function" ? e.apply(t, r) : e;
            var c = Math.max(a[1][0] - a[0][0], a[1][1] - a[0][1]);
            var f = t.__zoom;
            var s = typeof n === "function" ? n.apply(t, r) : n;
            var h = l(f.invert(u).concat(c / f.k), s.invert(u).concat(c / s.k));
            return function(t) {
              if (t === 1) t = s;
              else {
                var n = h(t);
                var e = c / n[2];
                t = new Wb(e, u[0] - n[0] * e, u[1] - n[1] * e);
              }
              o.zoom(null, t);
            };
          });
      }
      function x(t, n, e) {
        return (!e &amp;&amp; t.__zooming) || new w(t, n);
      }
      function w(t, n) {
        (this.that = t),
          (this.args = n),
          (this.active = 0),
          (this.extent = i.apply(t, n)),
          (this.taps = 0);
      }
      function M() {
        if (r.apply(this, arguments)) {
          var t = x(this, arguments);
          var n = this.__zoom;
          var e = Math.max(
            c[0],
            Math.min(c[1], n.k * Math.pow(2, a.apply(this, arguments)))
          );
          var i = Bt(this);
          if (t.wheel)
            (t.mouse[0][0] === i[0] &amp;&amp; t.mouse[0][1] === i[1]) ||
              (t.mouse[1] = n.invert((t.mouse[0] = i))),
              clearTimeout(t.wheel);
          else {
            if (n.k === e) return;
            (t.mouse = [i, n.invert(i)]), Pr(this), t.start();
          }
          Jb(),
            (t.wheel = setTimeout(function() {
              (t.wheel = null), t.end();
            }, p)),
            t.zoom("mouse", o(_(y(n, e), t.mouse[0], t.mouse[1]), t.extent, f));
        }
      }
      function N() {
        if (!e &amp;&amp; r.apply(this, arguments)) {
          var n = x(this, arguments, !0);
          var i = Rt(t.event.view)
            .on(
              "mousemove.zoom",
              function() {
                if ((Jb(), !n.moved)) {
                  var e = t.event.clientX - u;
                  var r = t.event.clientY - c;
                  n.moved = e * e + r * r &gt; v;
                }
                n.zoom(
                  "mouse",
                  o(
                    _(n.that.__zoom, (n.mouse[0] = Bt(n.that)), n.mouse[1]),
                    n.extent,
                    f
                  )
                );
              },
              !0
            )
            .on(
              "mouseup.zoom",
              function() {
                i.on("mousemove.zoom mouseup.zoom", null),
                  jt(t.event.view, n.moved),
                  Jb(),
                  n.end();
              },
              !0
            );
          var a = Bt(this);
          var u = t.event.clientX;
          var c = t.event.clientY;
          Ht(t.event.view),
            Kb(),
            (n.mouse = [a, this.__zoom.invert(a)]),
            Pr(this),
            n.start();
        }
      }
      function T() {
        if (r.apply(this, arguments)) {
          var n = this.__zoom;
          var e = Bt(this);
          var a = n.invert(e);
          var u = n.k * (t.event.shiftKey ? 0.5 : 2);
          var c = o(_(y(n, u), e, a), i.apply(this, arguments), f);
          Jb(),
            s &gt; 0
              ? Rt(this)
                  .transition()
                  .duration(s)
                  .call(m, c, e)
              : Rt(this).call(g.transform, c);
        }
      }
      function A() {
        if (r.apply(this, arguments)) {
          var e;
          var i;
          var o;
          var a;
          var u = t.event.touches;
          var c = u.length;
          var f = x(this, arguments, t.event.changedTouches.length === c);
          for (Kb(), i = 0; i &lt; c; ++i)
            (a = [
              (a = Ft(this, u, (o = u[i]).identifier)),
              this.__zoom.invert(a),
              o.identifier
            ]),
              f.touch0
                ? f.touch1 ||
                  f.touch0[2] === a[2] ||
                  ((f.touch1 = a), (f.taps = 0))
                : ((f.touch0 = a), (e = !0), (f.taps = 1 + !!n));
          n &amp;&amp; (n = clearTimeout(n)),
            e &amp;&amp;
              (f.taps &lt; 2 &amp;&amp;
                (n = setTimeout(function() {
                  n = null;
                }, d)),
              Pr(this),
              f.start());
        }
      }
      function S() {
        if (this.__zooming) {
          var e;
          var r;
          var i;
          var a;
          var u = x(this, arguments);
          var c = t.event.changedTouches;
          var s = c.length;
          for (Jb(), n &amp;&amp; (n = clearTimeout(n)), u.taps = 0, e = 0; e &lt; s; ++e)
            (i = Ft(this, c, (r = c[e]).identifier)),
              u.touch0 &amp;&amp; u.touch0[2] === r.identifier
                ? (u.touch0[0] = i)
                : u.touch1 &amp;&amp; u.touch1[2] === r.identifier &amp;&amp; (u.touch1[0] = i);
          if (((r = u.that.__zoom), u.touch1)) {
            var l = u.touch0[0];
            var h = u.touch0[1];
            var d = u.touch1[0];
            var p = u.touch1[1];
            var v = (v = d[0] - l[0]) * v + (v = d[1] - l[1]) * v;
            var g = (g = p[0] - h[0]) * g + (g = p[1] - h[1]) * g;
            (r = y(r, Math.sqrt(v / g))),
              (i = [(l[0] + d[0]) / 2, (l[1] + d[1]) / 2]),
              (a = [(h[0] + p[0]) / 2, (h[1] + p[1]) / 2]);
          } else {
            if (!u.touch0) return;
            (i = u.touch0[0]), (a = u.touch0[1]);
          }
          u.zoom("touch", o(_(r, i, a), u.extent, f));
        }
      }
      function k() {
        if (this.__zooming) {
          var n;
          var r;
          var i = x(this, arguments);
          var o = t.event.changedTouches;
          var a = o.length;
          for (
            Kb(),
              e &amp;&amp; clearTimeout(e),
              e = setTimeout(function() {
                e = null;
              }, d),
              n = 0;
            n &lt; a;
            ++n
          )
            (r = o[n]),
              i.touch0 &amp;&amp; i.touch0[2] === r.identifier
                ? delete i.touch0
                : i.touch1 &amp;&amp; i.touch1[2] === r.identifier &amp;&amp; delete i.touch1;
          if (
            (i.touch1 &amp;&amp; !i.touch0 &amp;&amp; ((i.touch0 = i.touch1), delete i.touch1),
            i.touch0)
          )
            i.touch0[1] = this.__zoom.invert(i.touch0[0]);
          else if ((i.end(), i.taps === 2)) {
            var u = Rt(this).on("dblclick.zoom");
            u &amp;&amp; u.apply(this, arguments);
          }
        }
      }
      return (
        (g.transform = function(t, n, e) {
          var r = t.selection ? t.selection() : t;
          r.property("__zoom", em),
            t !== r
              ? m(t, n, e)
              : r.interrupt().each(function() {
                  x(this, arguments)
                    .start()
                    .zoom(
                      null,
                      typeof n === "function" ? n.apply(this, arguments) : n
                    )
                    .end();
                });
        }),
        (g.scaleBy = function(t, n, e) {
          g.scaleTo(
            t,
            function() {
              var t = this.__zoom.k;
              var e = typeof n === "function" ? n.apply(this, arguments) : n;
              return t * e;
            },
            e
          );
        }),
        (g.scaleTo = function(t, n, e) {
          g.transform(
            t,
            function() {
              var t = i.apply(this, arguments);
              var r = this.__zoom;
              var a =
                e == null
                  ? b(t)
                  : typeof e === "function"
                  ? e.apply(this, arguments)
                  : e;
              var u = r.invert(a);
              var c = typeof n === "function" ? n.apply(this, arguments) : n;
              return o(_(y(r, c), a, u), t, f);
            },
            e
          );
        }),
        (g.translateBy = function(t, n, e) {
          g.transform(t, function() {
            return o(
              this.__zoom.translate(
                typeof n === "function" ? n.apply(this, arguments) : n,
                typeof e === "function" ? e.apply(this, arguments) : e
              ),
              i.apply(this, arguments),
              f
            );
          });
        }),
        (g.translateTo = function(t, n, e, r) {
          g.transform(
            t,
            function() {
              var t = i.apply(this, arguments);
              var a = this.__zoom;
              var u =
                r == null
                  ? b(t)
                  : typeof r === "function"
                  ? r.apply(this, arguments)
                  : r;
              return o(
                Zb.translate(u[0], u[1])
                  .scale(a.k)
                  .translate(
                    typeof n === "function" ? -n.apply(this, arguments) : -n,
                    typeof e === "function" ? -e.apply(this, arguments) : -e
                  ),
                t,
                f
              );
            },
            r
          );
        }),
        (w.prototype = {
          start: function() {
            return (
              ++this.active == 1 &amp;&amp;
                ((this.that.__zooming = this), this.emit("start")),
              this
            );
          },
          zoom: function(t, n) {
            return (
              this.mouse &amp;&amp;
                t !== "mouse" &amp;&amp;
                (this.mouse[1] = n.invert(this.mouse[0])),
              this.touch0 &amp;&amp;
                t !== "touch" &amp;&amp;
                (this.touch0[1] = n.invert(this.touch0[0])),
              this.touch1 &amp;&amp;
                t !== "touch" &amp;&amp;
                (this.touch1[1] = n.invert(this.touch1[0])),
              (this.that.__zoom = n),
              this.emit("zoom"),
              this
            );
          },
          end: function() {
            return (
              --this.active == 0 &amp;&amp;
                (delete this.that.__zooming, this.emit("end")),
              this
            );
          },
          emit: function(t) {
            kt(new $b(g, t, this.that.__zoom), h.apply, h, [
              t,
              this.that,
              this.args
            ]);
          }
        }),
        (g.wheelDelta = function(t) {
          return arguments.length
            ? ((a = typeof t === "function" ? t : Gb(+t)), g)
            : a;
        }),
        (g.filter = function(t) {
          return arguments.length
            ? ((r = typeof t === "function" ? t : Gb(!!t)), g)
            : r;
        }),
        (g.touchable = function(t) {
          return arguments.length
            ? ((u = typeof t === "function" ? t : Gb(!!t)), g)
            : u;
        }),
        (g.extent = function(t) {
          return arguments.length
            ? ((i =
                typeof t === "function"
                  ? t
                  : Gb([[+t[0][0], +t[0][1]], [+t[1][0], +t[1][1]]])),
              g)
            : i;
        }),
        (g.scaleExtent = function(t) {
          return arguments.length
            ? ((c[0] = +t[0]), (c[1] = +t[1]), g)
            : [c[0], c[1]];
        }),
        (g.translateExtent = function(t) {
          return arguments.length
            ? ((f[0][0] = +t[0][0]),
              (f[1][0] = +t[1][0]),
              (f[0][1] = +t[0][1]),
              (f[1][1] = +t[1][1]),
              g)
            : [[f[0][0], f[0][1]], [f[1][0], f[1][1]]];
        }),
        (g.constrain = function(t) {
          return arguments.length ? ((o = t), g) : o;
        }),
        (g.duration = function(t) {
          return arguments.length ? ((s = +t), g) : s;
        }),
        (g.interpolate = function(t) {
          return arguments.length ? ((l = t), g) : l;
        }),
        (g.on = function() {
          var t = h.on.apply(h, arguments);
          return t === h ? g : t;
        }),
        (g.clickDistance = function(t) {
          return arguments.length ? ((v = (t = +t) * t), g) : Math.sqrt(v);
        }),
        g
      );
    }),
    (t.zoomIdentity = Zb),
    (t.zoomTransform = Qb),
    Object.defineProperty(t, "__esModule", { value: !0 });
});

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @param setPoint - Path where digitalData object is created. Example:
 *    "page.calendarFilter" or "user[0].profile[0]"
 * @constructor
 */
FUSION.AnalyticsBuilder = function AnalyticsBuilder(setPoint) {
  this.props = new FUSION.Properties();
  this.afterTrackClearList = [];
  this.EVENT_PATH = 'digitalData.primaryEvent.eventInfo.eventName';
  this.dataObjectPath = 'digitalData.' + setPoint + '.';
  this.useAlloy = !!FUSION.useAlloy;
  this.alloyCustomEventData = {};

  if (this.useAlloy) {
    this.dataObjectPath = 'data._adobe_corpnew.digitalData.' + setPoint + '.';
  }
};

/**
 * _assignValueToObject(obj, 'data._adobe_corpnew.digitalData.testing', 'theValue')
 * &gt; obj
 * date {
 *     _adobe_corpnew: {
 *         digitalData: {
 *             testing: 'theValue'
 *         }
 *     }
 * }
 * @param obj
 * @param path
 * @param value
 * @private
 */
FUSION.AnalyticsBuilder.prototype._conventNameValueToObject = function (obj, path, value) {
  if (value === undefined || typeof value === 'undefined' || value === null || value === '') {
    value = 'Unavailable';
  }

  var pathSplit = path.split('.');
  var temp = obj;
  const pl = pathSplit.length - 1;
  var i = 0;
  for (i; i &lt; pl; i++) {
    const eachPath = pathSplit[i];
    temp[eachPath] = temp[eachPath] || {};
    temp = temp[eachPath];
  }
  temp[pathSplit[i]] = value;
};

FUSION.AnalyticsBuilder.prototype._setAlloyAll = function (path, value) {
  this._conventNameValueToObject(window.alloy_all, path, value);
};

FUSION.AnalyticsBuilder.prototype._setAlloyCustomEventData = function (path, value) {
  this._conventNameValueToObject(this.alloyCustomEventData, path, value);
};

FUSION.AnalyticsBuilder.prototype.putEventData = function (path, value) {
  if (this.useAlloy) {
    this._setAlloyCustomEventData(this.dataObjectPath + path, value);
  } else {
    this.put(path, value);
  }
  return this;
};

FUSION.AnalyticsBuilder.prototype.put = function (key, value, clearAfterTrack) {
  if (value === undefined || typeof value === 'undefined' || value === null || value === '') {
    value = 'Unavailable';
  }

  if (this.useAlloy) {
    this._setAlloyAll(this.dataObjectPath + key, value);
  } else {
    window.digitalData._set(this.dataObjectPath + key, value);
    if (this.props.checkNull(clearAfterTrack) &amp;&amp; clearAfterTrack) {
      this.afterTrackClearList.push(this.dataObjectPath + key);
    }
  }

  return this;
};

FUSION.AnalyticsBuilder.prototype.putArray = function (key, value, clearAfterTrack) {
  if (value !== undefined &amp;&amp; value !== null) {
    this.put(key, value.split(','), clearAfterTrack);
  } else {
    this.put(key, value, clearAfterTrack);
  }
  return this;
};

FUSION.AnalyticsBuilder.prototype.setTitleAndPath = function (el) {
  var formatUtil = new FUSION.Formatter();
  var propUtil = new FUSION.Properties();

  if (propUtil.checkNull(el.dataset.path)) {
    var path = formatUtil.setVal(el.dataset.path).decodeUnicodeSequence().getVal().trim();
    this.putEventData(FUSION.ANALYTICS.KEYS.DESTINATION_PAGE, path, true);
  }

  if (propUtil.checkNull(el.dataset.title)) {
    var title = formatUtil.setVal(el.dataset.title).decodeEscapeSequence().removeLineBreaks().getVal().trim();
    this.putEventData(FUSION.ANALYTICS.KEYS.TITLE, title, true);
  }
  return this;
};

FUSION.AnalyticsBuilder.prototype.setEvent = function (eventName) {
  if (this.useAlloy) {
    this._setAlloyCustomEventData('data.eventType', 'web.webinteraction.linkClicks');
    this._setAlloyCustomEventData('data.web.webInteraction.name', eventName);
    this._setAlloyCustomEventData('data._adobe_corpnew.digitalData.primaryEvent.eventInfo.eventName', eventName);
  } else {
    window.digitalData._set(this.EVENT_PATH, eventName);
    this.afterTrackClearList.push(this.EVENT_PATH);
  }
  return this;
};

FUSION.AnalyticsBuilder.prototype.track = function () {
  if (this.useAlloy) {
    _satellite.track('event', {
      data: this.alloyCustomEventData.data,
    });
  } else {
    _satellite.track('event', {
      digitalData: window.digitalData._snapshot(),
    });
    for (var item of this.afterTrackClearList) {
      window.digitalData._delete(item);
    }
  }
  return this;
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.ANALYTICS = {
  EV: {
    CLICK: {
      ASSET_LIST: 'AssetList:Click',
      CALENDAR_FILTER: 'CalendarFilter:Click',
      CAROUSEL_ITEM: 'CarouselItem:Click',
      EVENT_LIST: 'EventList:Click',
      MAIN_MENU: 'MainMenu:Click',
      NEWS_LIST: 'NewsList:Click',
      SEARCH: 'Search:Click',
      SUB_MENU: 'SubMenu:Click',
      DASHBOARD_EVENT_LIST: 'DashboardEventList:Click',
      DASHBOARD_EVENT_VIEW_ALL: 'DashboardEventViewAll:Click',
      EVENT_REGISTER: 'EventRegister:Click',
      EVENT_JOIN: 'EventJoin:Click',
      DASHBOARD_LEARNING_COURSE_LIST: 'DashboardLearningCourseList:Click',
      DASHBOARD_LEARNING_VIEW_ALL: 'DashboardLearningCourseViewAll:Click',
      DASHBOARD_LEARNING_PATH: 'DashboardLearningPath:Click',
      DASHBOARD_PROMOTION: 'DashboardPromotion:Click',
      TAB_NAVIGATION: 'TabNavigation:Click',
    },
  },
  KEYS: {
    ACCOUNT_TYPE: 'accountType',
    COMPANY_NAME: 'companyName',
    COUNTRY_CODE: 'countryCode',
    CUSTOM_PAGE_NAME: 'customPageName',
    CUSTOM_URL: 'customUrl',
    DEPARTMENT: 'department',
    DESTINATION_LINK: 'destinationLink',
    DESTINATION_PAGE: 'destinationPage',
    GEO_REGION: 'geoRegion',
    INTERNAL_USER_ID: 'internalUserId',
    IS_GATED: 'isGated',
    LANGUAGE: 'language',
    MENU_TREE: 'menuTree',
    PARTNER_LEVEL: 'partnerLevel',
    PARTNER_REGION: 'partnerRegion',
    PRINCIPAL_ASSET: 'principalAsset',
    PROGRAM_TYPE: 'programType',
    SITE_SECTION: 'siteSection',
    SOURCE_PAGE: 'sourcePage',
    TEMPLATE: 'template',
    TITLE: 'title',
    USER_TYPE: 'userType',
    VISITOR_TYPE: 'visitorType',
    ADOBE_CONNECT_ROOM_ID: 'adobeConnectRoomId',
    REGION_CONTENT: 'regionContent',
  },
  SET_PTS: {
    PAGE: {
      ASSET_LIST: 'page.assetList',
      CALENDAR_FILTER: 'page.calendarFilter',
      CAROUSEL_ITEM: 'page.carouselItem',
      EVENT_LIST: 'page.eventList',
      INFO: 'page.pageInfo',
      MAIN_MENU: 'page.mainMenu',
      NEWS_LIST: 'page.newsList',
      SEARCH_MENU: 'page.searchResult',
      SUB_MENU: 'page.subMenu',
      LEARNING_DASHBOARD: 'page.learningDashboard',
    },
    USER: {
      PROFILE: 'user[0].profile[0]',
      PROFILE_AEP: 'user.profile',
    },
  },
};

var Handlebars = window.Handlebars || {};

Handlebars.registerHelper('calEventDateFormatter', function (variable, isArchive, locale) {
  moment.locale(locale);
  if (typeof variable !== 'undefined') {
    var utcDate = moment.utc(variable, 'MM/DD/YYYY h:mm').toDate();
    var currentDate = moment.utc().toDate();
    var timeFormat;
    if (isArchive || moment(utcDate).isBefore(currentDate)) {
      timeFormat = moment(utcDate).local().format('MMMM DD, YYYY');
    } else {
      timeFormat = moment(utcDate).local().format('MMMM DD, YYYY HH:mm');
    }
    return timeFormat;
  }
  return '';
});

Handlebars.registerHelper('calEventDateFormatterGetMonth', function (variable, locale) {
  moment.locale(locale);
  if (typeof variable !== 'undefined') {
    var utcDate = moment.utc(variable, 'MM/DD/YYYY HH:mm').toDate();
    return moment(utcDate).local().format('MMM');
  }
  return '';
});

Handlebars.registerHelper('calEventDateFormatterGetDay', function (variable, locale) {
  moment.locale(locale);
  if (typeof variable !== 'undefined') {
    var utcDate = moment.utc(variable, 'MM/DD/YYYY HH:mm').toDate();
    return moment(utcDate).local().format('DD');
  }
  return '';
});

Handlebars.registerHelper('ifCalEventDateMultiDay', function (startDate, endDate, options) {
  var isMultiDay = false;
  var startDateLocal = moment.utc(startDate, 'MM/DD/YYYY HH:mm').local();
  var endDateLocal = moment.utc(endDate, 'MM/DD/YYYY HH:mm').local();

  if (startDateLocal.isValid() &amp;&amp; endDateLocal.isValid()) {
    isMultiDay = !startDateLocal.isSame(endDateLocal, 'day');
  }

  if (isMultiDay) {
    return options.fn(this);
  }
  return options.inverse(this);
});

Handlebars.registerHelper('calEventShowDescription', function (isUserLogin, closedUserGroup, options) {
  var hasClosedUserGroup = closedUserGroup &amp;&amp; closedUserGroup.length &gt; 0;
  return isUserLogin || !hasClosedUserGroup ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper('isActiveEvent', function (startDate, endDate) {
  var now = moment().local();

  if (!endDate) {
    return now.isBefore(startDate);
  }
  return !now.isAfter(startDate, 'day');
});

function checkIsActive(v1) {
  return Date.now() &lt; v1;
}

Handlebars.registerHelper('ifActive', function (v1, options) {
  return checkIsActive(v1) ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper('newsListDateFormatter', function (variable, locale) {
  moment.locale(locale);
  if (typeof variable !== 'undefined') {
    var utcDate = moment(variable, 'YYYYMMDD').toDate();
    return moment(utcDate).local().format('MMMM DD, YYYY');
  }
  return '';
});

Handlebars.registerHelper('ifArrayContains', function (array, targetString, options) {
  return array.includes(targetString) ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper('showSignInToRegister', function (isUserLogin, closedUserGroup, options) {
  var hasClosedUserGroup = closedUserGroup &amp;&amp; closedUserGroup.length &gt; 0;
  return !isUserLogin &amp;&amp; hasClosedUserGroup ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper('showSignUp', function (isUserLogin, closedUserGroup, options) {
  var hasClosedUserGroup = closedUserGroup &amp;&amp; closedUserGroup.length &gt; 0;
  return isUserLogin || !hasClosedUserGroup ? options.fn(this) : options.inverse(this);
});

var Handlebars = window.Handlebars || {};

Handlebars.registerHelper("ifFirst", function(index, options) {
  if (index === 0) {
    return options.fn(this);
  }
  return options.inverse(this);
});

var Handlebars = window.Handlebars || {};

Handlebars.registerHelper("link", function(object) {
  return new Handlebars.SafeString(object);
});

Handlebars.registerHelper("remove", function(object) {
  var div;
  var htmlDecoded;

  if (typeof object === "undefined") {
    return "";
  }

  div = document.createElement("div");
  div.innerHTML = object;
  htmlDecoded = div.firstChild.nodeValue;
  return encodeURIComponent(htmlDecoded);
});

Handlebars.registerHelper("ifSize", function(obj, options) {
  // prerequisite
  if (typeof obj !== "object") {
    return options.inverse(this);
  }
  var size = 0;
  var key;
  for (key in obj) {
    if (obj.hasOwnProperty(key)) {
      size++;
    }
  }
  return size &gt; 0 ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper("ifCond", function(v1, operator, v2, options) {
  switch (operator) {
    case "===":
      return v1 === v2 ? options.fn(this) : options.inverse(this);
    case "!==":
      return v1 !== v2 ? options.fn(this) : options.inverse(this);
    case "&lt;":
      return v1 &lt; v2 ? options.fn(this) : options.inverse(this);
    case "&lt;=":
      return v1 &lt;= v2 ? options.fn(this) : options.inverse(this);
    case "&gt;":
      return v1 &gt; v2 ? options.fn(this) : options.inverse(this);
    case "&gt;=":
      return v1 &gt;= v2 ? options.fn(this) : options.inverse(this);
    case "&amp;&amp;":
      return v1 &amp;&amp; v2 ? options.fn(this) : options.inverse(this);
    case "||":
      return v1 || v2 ? options.fn(this) : options.inverse(this);
    default:
      return options.inverse(this);
  }
});

Handlebars.registerHelper("toUpperCase", function(str) {
  return str.toUpperCase();
});

Handlebars.registerHelper("ifShow", function(v1, options) {
  return v1 === "true" ? options.inverse(this) : options.fn(this);
});

var Handlebars = window.Handlebars || {};

Handlebars.registerHelper("grade", function(grade) {
  var progress = parseInt(grade);
  var status = "zero";

  if (progress &lt; 100 &amp;&amp; progress &gt; 0) {
    status = "started";
  } else if (progress === 100) {
    status = "completed";
  }
  return status;
});

Handlebars.registerHelper("locked", function(isLocked) {
  var className = "";

  if (isLocked === true) {
    className = "locked";
  }
  return className;
});

var Handlebars = window.Handlebars || {};

Handlebars.registerHelper("hasIcon", function(icon) {
  if (icon !== null &amp;&amp; icon !== undefined &amp;&amp; icon.length &gt; 0) {
    return "hasIcon";
  }
  return "";
});
Handlebars.registerHelper("for", function(from, to, select, block) {
  var accum = "";
  var counter = 15;
  var i;
  var j;

  for (i = from, j = 0; i &lt;= to &amp;&amp; j &lt; counter; i++, j++) {
    if (i === select) {
      accum += block.fn('&lt;span id="pagination-selected"&gt;' + i + "&lt;/span&gt;");
    } else {
      accum += block.fn(
        '&lt;button class="pagination-button" name="start" id="page-' +
          i +
          '" value="' +
          i +
          '"&gt;' +
          i +
          "&lt;/button&gt;"
      );
    }
  }
  return accum;
});
Handlebars.registerHelper("each_first", function(array, options) {
  if (!array || array.length === 0) {
    return options.inverse(this);
  }

  var result = [];
  var start = 0;
  var max = array.length % 2 === 0 ? array.length / 2 : (array.length + 1) / 2;

  for (; start &lt; max; start++) {
    result.push(options.fn(array[start]));
  }

  return result.join("");
});

Handlebars.registerHelper("each_second", function(array, options) {
  if (!array || array.length === 0) {
    return options.inverse(this);
  }

  var result = [];
  var start =
    array.length % 2 === 0 ? array.length / 2 : (array.length + 1) / 2;
  var max = array.length;

  for (; start &lt; max; start++) {
    result.push(options.fn(array[start]));
  }

  return result.join("");
});

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.PubSub = function PubSub() {
  this._subscribers = {};
};

/**
 * Use this method to publish an event.
 *
 * @param event - String, event name which can be subscribed to.
 * @param action - String, action type to determine appropriate logic for
 *  subscription.
 * @param data - Object, information that can be used when subscriberCallback
 *  method is called by subscription.
 */
FUSION.PubSub.prototype.publish = function(event, action, data) {
  if (!this._subscribers[event]) return;
  this._subscribers[event].forEach(function(subscriberCallback) {
    data.action = action;
    subscriberCallback(data);
  });
}

/**
 * Use this method to subscribe to published events.
 *
 * @param event - String, name of the event being subscribed to.
 * @param callback - Fn, method called whenever an event occurs.
 * @returns {{unsubscribe: unsubscribe, method that unsubscribes from
 *  subscriberCallback }}
 */
FUSION.PubSub.prototype.subscribe = function(event, callback) {
  var index;

  if (!this._subscribers[event]) {
    this._subscribers[event] = [];
  }

  index = this._subscribers[event].push(callback) - 1;

  var pubSub = this;
  return {
    unsubscribe: function() {
      pubSub._subscribers[event].splice(index, 1);
    }
  }
}

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.SUB_EVTS = {
  VIDEO_RESIZE: {
    EVENT: "VIDEO RESIZE",
    ACTIONS: {
      ACCORDION_CLICK: "ACCORDION CLICK",
      TAB_CLICK: "TAB CLICK"
    }
  }
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.DomTraverser = function DomTraverser() {};

FUSION.DomTraverser.prototype.getParentByClassRecursive =
    function(el, className) {
      if (el !== null) {
        if (el.classList.contains(className)) {
          return el;
        }
        return this.getParentByClassRecursive(el.parentElement, className);
      }
      return null;
    };

FUSION.DomTraverser.prototype.getPreviousSiblingByClassRecursive =
    function(el, parent, className) {
      if (el !== null &amp;&amp; el.parentElement === parent) {
        if (el.classList.contains(className)) {
          return el;
        }
        return this.getPreviousSiblingByClassRecursive(
            el.previousElementSibling,
            parent, className);
      }
      return null;
    };

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.Formatter = function Formatter(string) {
  this.util = new FUSION.Properties();
  this.setVal(string);
};

FUSION.Formatter.prototype.decodeEscapeSequence = function() {
  this.val = this.val.replace(/\\x([0-9A-Fa-f]{2})/g, function() {
    return String.fromCharCode(parseInt(arguments[1], 16));
  });
  return this;
};

FUSION.Formatter.prototype.decodeUnicodeSequence = function() {
  this.val = this.val.replace(/\\u([0-9A-Fa-f]{4})/g, function() {
    return String.fromCharCode(parseInt(arguments[1], 16));
  }).replace(/\\\//g, "/");
  return this;
};

FUSION.Formatter.prototype.removeLineBreaks = function() {
  this.val = this.val.replace(/(?:\\[rn])+/g, "");
  return this;
};

FUSION.Formatter.prototype.setVal = function(val) {
  if (this.util.checkNull(val) &amp;&amp; typeof val === "string") {
    this.val = val;
  } else {
    this.val = "";
  }
  return this;
};

FUSION.Formatter.prototype.getVal = function() {
  return this.val;
};
/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.Properties = function () {};

FUSION.Properties.prototype.validateStringBool = function (stringBool) {
  var TRUE = 'true';
  var FALSE = 'false';
  if (stringBool != null &amp;&amp; typeof stringBool === 'string' &amp;&amp; stringBool.toLowerCase().trim() === TRUE) {
    return TRUE;
  }
  return FALSE;
};

FUSION.Properties.prototype.checkNull = function (value) {
  return value !== undefined &amp;&amp; value !== null;
};

FUSION.Properties.prototype.isObject = function (obj) {
  return !!obj &amp;&amp; obj.constructor === Object;
};

FUSION.Properties.prototype.isEmptyObject = function (myEmptyObj) {
  return Object.keys(myEmptyObj).length === 0 &amp;&amp; myEmptyObj.constructor === Object;
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.Ajax = function Ajax() {};

FUSION.Ajax.prototype.postData = function(query, url) {
  return $.ajax({
    data: query,
    type: "POST",
    url: url
  });
};

FUSION.Ajax.prototype.fetchData = function(query, url) {
  return $.ajax({
    data: query,
    dataType: "json",
    url: url
  });
};

FUSION.Ajax.prototype.fetchDataTxt = function(query, url) {
  return $.ajax({
    data: query,
    dataType: "text",
    url: url
  });
};

FUSION.Ajax.prototype.fetchDataNoCache = function(query, url) {
  return $.ajax({
    data: query,
    dataType: "json",
    url: url,
    cache: false
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Uint16Array */

FUSION.UserPreference = function (isAdmin) {
  var CONST = {
    updatePreferenceUrl: '/bin/fusion/userpreference',
  };
  var isAdministrator = isAdmin === 'true';
  var $regionChkGroup;
  var $productAndSolutionChkGroup;
  var $roleChkGroup;
  var $updatedMsg;
  var $submitBtn;

  var _getSelectedChkVal = function ($chkGroup) {
    var checkedList = [];
    $chkGroup.find('input[type=checkbox]').each(function () {
      var $thisChk = $(this);
      var thisChkVal = $thisChk.val();
      if ($thisChk.prop('checked') &amp;&amp; thisChkVal) {
        checkedList.push(thisChkVal);
      }
    });
    return checkedList;
  };

  var _submitBtnClick = function () {
    var selectedRegionVal = _getSelectedChkVal($regionChkGroup);
    var selectedProductAndSolutionVal = _getSelectedChkVal($productAndSolutionChkGroup);
    var selectedRoleVal = _getSelectedChkVal($roleChkGroup);
    var $firstDay = $('#first-day').val();

    return new FUSION.Ajax().postData(
      {
        region: selectedRegionVal,
        'product-and-solution': selectedProductAndSolutionVal,
        role: selectedRoleVal,
        'first-day': $firstDay,
      },
      CONST.updatePreferenceUrl
    );
  };

  var _showErrorMsg = function ($chkGroup, errorMsg) {
    var $errorSpan = $chkGroup.find('.error');

    if ($errorSpan.length === 1) {
      $errorSpan.text(errorMsg);
      $errorSpan.show();
      $errorSpan.fadeOut(2000);
    }
  };

  var _showUpdateMsg = function (msg, isError) {
    if (isError) {
      $updatedMsg.addClass('error');
    } else {
      $updatedMsg.removeClass('error');
    }
    $updatedMsg.text(msg);
    $updatedMsg.show();
    $updatedMsg.fadeOut(2000);

    if (!isError) {
      setTimeout(function () {
        history.back();
      }, 1500);
    }
  };

  var _countChkSelected = function ($chkGroup) {
    return $chkGroup.find('input:checked').length;
  };

  /**
   * Return FALSE, if administrator, and checked CheckBox reach the limit
   * @param $chkInput
   * @returns {boolean}
   * @private
   */
  var _validation = function ($chkInput) {
    if (!$chkInput.prop('checked') || isAdministrator) {
      return true;
    }

    if (_countChkSelected($roleChkGroup) &gt; 1) {
      $chkInput.prop('checked', false);
      _showErrorMsg($roleChkGroup, 'Please choose only one...');
    }

    if (_countChkSelected($regionChkGroup) &gt; 1) {
      $chkInput.prop('checked', false);
      _showErrorMsg($regionChkGroup, 'Please choose only one...');
    }
    return false;
  };

  var _bindValidationOnClick = function ($chkGroup) {
    $chkGroup.find('input').each(function () {
      var $thisChkBox = $(this);
      $thisChkBox.click(function () {
        _validation($thisChkBox);
      });
    });
  };

  var _bindSelectAllNoneChk = function () {
    $('.user-preference-checkbox-all-none').click(function () {
      var $allNoneChk = $(this);
      $allNoneChk
        .closest('.user-preference-checkbox-group')
        .find('input')
        .each(function () {
          $(this).prop('checked', $allNoneChk.prop('checked'));
        });
    });
  };

  var _init = function () {
    $regionChkGroup = $('#region');
    $productAndSolutionChkGroup = $('#product-and-solution');
    $roleChkGroup = $('#role');
    $updatedMsg = $('#updated-msg');
    $submitBtn = $('.user-preference-button');

    $submitBtn.click(function () {
      _submitBtnClick()
        .then(function (resp) {
          _showUpdateMsg('Updated');
        })
        .fail(function (error) {
          _showUpdateMsg(error, true);
        });
    });

    _bindValidationOnClick($regionChkGroup);
    _bindValidationOnClick($roleChkGroup);
    _bindSelectAllNoneChk();
  };
  _init();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global AdobeMessagingExperienceClient console */
FUSION.JarvisChat = function(currentPath) {
  var CONST = {
    jarvisUrl: "/bin/fusion/jarvis/setting?currentPage=" + currentPath
  };
  var _getImsToken = function() {
    var ca = document.cookie.split(";");
    var i;
    var res;

    for (i = 0; i &lt; ca.length; i++) {
      res = ca[i].split("=");
      if (typeof res[0] !== "undefined" &amp;&amp; typeof res[1] !== "undefined") {
        if (res[0].trim() === "ims_token") {
          return res[1];
        }
      }
    }
  };
  var _getJarvis = function() {
    return new FUSION.Ajax().fetchData({}, CONST.jarvisUrl);
  };
  var _init = function() {
    _getJarvis()
      .then(function(resp) {
        if (resp.success &amp;&amp; !resp.data.isDisabled) {
          var userAccessToken = "";
          var initObject;
          var ims_token = _getImsToken();
          var respData = resp.data;
          var url = currentPath + "./j_security_check?configid=ims";
          var signInProviderCallbackReference = function() {
            window.location.href = url;
          };

          if (ims_token &amp;&amp; ims_token !== '""') {
            userAccessToken = "Bearer " + ims_token;
          }

          initObject = {
            appid: respData.appId,
            appver: "1.0",
            language: respData.language,
            region: respData.region,
            accessToken: userAccessToken,
            env: respData.environment,
            clientId: respData.clientId,
            cookiesEnabled: true,
            callbacks: {
              signInProvider: signInProviderCallbackReference
            }
          };

          AdobeMessagingExperienceClient.initialize(initObject);
        }
      })
      .fail(function(error) {
        window.console.error("Error occurred when render JARVIS CHAT", error);
      });
  };

  _init();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.NavItem = function NavItem() {
  this.linkKeys = {
    externalLinkTitle: "externalLinkTitle",
    fileReference: "fileReference",
    isLocked: "isLocked",
    label: "label",
    labelIsClickable: "labelIsClickable",
    labelLevelStyle: "labelLevelStyle",
    labelPath: "labelPath",
    labelTarget: "labelTarget",
    listHides: "listHides",
    listPaths: "listPaths",
    listTitles: "listTitles",
    paddingBottom: "paddingBottom",
    titleIsClickable: "titleIsClickable"
  };
};

FUSION.NavItem.prototype.getMenuGroupTitle = function(menuGroup) {
  return {
    header: true,
    name: menuGroup[this.linkKeys.listTitles][0],
    path:
      menuGroup[this.linkKeys.titleIsClickable] === "true"
        ? menuGroup[this.linkKeys.listPaths][0]
        : "",
    target: "_self"
  };
};

FUSION.NavItem.prototype.getMenuGroupItem = function(menuGroup, index) {
  return {
    name: menuGroup[this.linkKeys.listTitles][index],
    path: menuGroup[this.linkKeys.listPaths][index],
    isHidden: menuGroup[this.linkKeys.listHides][index],
    target: "_self",
    paddingBottom: menuGroup[this.linkKeys.paddingBottom]
      ? menuGroup[this.linkKeys.paddingBottom]
      : "0x"
  };
};

FUSION.NavItem.prototype.getExtLinkTitle = function(extLink) {
  return {
    header: true,
    name: extLink[this.linkKeys.externalLinkTitle]
  };
};

FUSION.NavItem.prototype.getExtLinkItem = function(
  extLinkItems,
  extLink,
  index
) {
  var tempItem = extLinkItems[index].split("|");
  var tempLinkTitle = tempItem[0];
  var tempLinkPath = tempItem[1];
  var tempTarget = tempItem[2] === "true" ? "_blank" : "_self";
  return {
    name: tempLinkTitle,
    path: tempLinkPath,
    target: tempTarget,
    paddingBottom: extLink[this.linkKeys.paddingBottom]
      ? extLink[this.linkKeys.paddingBottom]
      : "0x"
  };
};

FUSION.NavItem.prototype.getIndividualLink = function(individualLink) {
  var labelLevelStyle = individualLink[this.linkKeys.labelLevelStyle];
  var name = individualLink[this.linkKeys.label];
  var path =
    individualLink[this.linkKeys.labelIsClickable] === "true"
      ? individualLink[this.linkKeys.labelPath]
      : "";
  var target = individualLink[this.linkKeys.labelTarget];
  var icon = individualLink[this.linkKeys.fileReference];
  var isLocked = individualLink[this.linkKeys.isLocked];
  if (labelLevelStyle === "1") {
    return {
      header: true,
      icon: icon,
      name: name,
      path: path,
      target: target,
      isLocked: isLocked
    };
  }
  if (labelLevelStyle === "2") {
    return {
      icon: icon,
      name: name,
      path: path,
      target: target,
      isLocked: isLocked,
      paddingBottom: individualLink[this.linkKeys.paddingBottom]
        ? individualLink[this.linkKeys.paddingBottom]
        : "0x"
    };
  }
  if (labelLevelStyle === "3") {
    return {
      icon: icon,
      description: name,
      path: path,
      target: target,
      isLocked: isLocked,
      paddingBottom: individualLink[this.linkKeys.paddingBottom]
        ? individualLink[this.linkKeys.paddingBottom]
        : "0x"
    };
  }
  return {};
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.Profile = function Profile(obj) {
  this.displayName = obj.displayName;
  this.familyName = obj.familyName;
  this.givenName = obj.givenName;
  this.email = obj.email;
};

FUSION.Profile.prototype.buildDisplayName = function() {
  if (!!this.givenName &amp;&amp; !!this.familyName) {
    return this.givenName + " " + this.familyName;
  }
  if (this.familyName) {
    return this.familyName;
  }
  if (this.givenName) {
    return this.givenName;
  }
  return "";
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars */
FUSION.SearchBar = function(searchUrl, currentPage) {
  // Get the input box
  var textInput = $(".Gnav-search-input");
  var _$parent = $(".page-header");
  var $search = _$parent.find(".searchBar-placeholder");
  var isMobile = window.matchMedia("only screen and (max-width: 599px)");
  var $menuWrapper = $(".Gnav-menu-wrapper");
  var $subNav = $(".subNav-container");
  var target;

  var _closeAndCleanSearchBar = function() {
    $(".Gnav-action-search").removeClass("is-open");
    $("#AdobePrimaryNav.Gnav-wrapper").removeClass("show-searchOverlay");
    $(".Gnav-search").removeClass("is-open");

    _removeSearchClass();
  }
  var _removeSearchClass = function() {
    $(".Gnav-search-results").removeClass("is-visible");
    $(".Gnav-search-form").removeClass("has-input");
    $(".Gnav-menu").removeClass("is-hidden");
    textInput.val("");
    $search.empty();
  };
  var _addSearchClass = function() {
    $(".Gnav-search-results").addClass("is-visible");
    $(".Gnav-search-form").addClass("has-input");
    $(".Gnav-menu").addClass("is-hidden");
  };

  // Listen for keystroke events
  textInput.keyup(function(e) {
    if (e.key === "Escape") {
      _closeAndCleanSearchBar();
      return;
    }
  });

  if (isMobile.matches) {
    $("html").on("touchend click", function(e) {
      target = $(e.target);

      if (
        target.parents(".Gnav-menu-content").length === 0 &amp;&amp;
        target.parents(".Gnav-hamburger").length === 0 &amp;&amp;
        !target.hasClass("Gnav-hamburger")
      ) {
        if ($menuWrapper.hasClass("is-open")) {
          $menuWrapper.removeClass("is-open");
        }
        $subNav.removeClass("hide");
        _removeSearchClass();
      } else if (!$subNav.hasClass("hide")) {
        $subNav.addClass("hide");
      }

      if (target.hasClass("Gnav-search-close")) {
        _removeSearchClass();
      }
    });
  }
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars */
FUSION.GlobalTopNav = function (currentPage, enableAdobePublicProfileService) {
  var ajax = new FUSION.Ajax();
  var INTERNAL_EMAIL_DOMAIN = '@adobe.com';
  var CONST = {
    contentAsServiceUrl: '/bin/adobe-fusion/mega-menu?currentPage=' + currentPage,
    profileEndpoint: '/bin/fusion/userinfo',
    profileInternalEndpoint: 'https://s7d2.scene7.com/is/image/IMGDIR/',
    behanceEndpoint: 'https://cc-api-behance.adobe.io/v2/users/',
    adobePublicProfileUrl: currentPage + '.adobe.public.profile.service.json',
  };

  var _getProfileData = function (userEndpoint) {
    return ajax.fetchDataNoCache({}, userEndpoint);
  };

  var _getMegaMenu = function () {
    return ajax.fetchData({}, CONST.contentAsServiceUrl);
  };

  var _toggleProfileView = function ($profile) {
    if ($profile.hasClass('Profile-expanded')) {
      $profile.toggleClass('Profile-expanded', false);
      $profile.toggleClass('Profile-collapsed', true);
    } else if ($profile.hasClass('Profile-collapsed')) {
      $profile.toggleClass('Profile-expanded', true);
      $profile.toggleClass('Profile-collapsed', false);
    }
    $profile.toggleClass('Profile-hidden');
  };

  var _getUserInfo = function () {
    var $profile = $('.Gnav-profile');
    var $fusion = $('.fusion');
    $profile.off().on('click', function () {
      _toggleProfileView($profile);
    });
    $fusion.on('click', function (evt) {
      var profileVisible = !$profile.hasClass('Profile-hidden');
      var hasNoProfileThumbnail = evt.target.className !== 'Profile-thumbnail';
      if (profileVisible &amp;&amp; hasNoProfileThumbnail) {
        _toggleProfileView($profile);
      }
    });
    return ajax.fetchDataNoCache({}, CONST.profileEndpoint);
  };

  var _configureAvatar = function (resp) {
    var imageObj = Object.values(resp.user.images);
    var $profilePic = $('a.Profile-thumbnail');
    var $profileAvatar = $('.Profile-avatar');
    if (imageObj.length &gt; 1) {
      $profilePic.css('background-image', 'url("' + imageObj[1] + '")');
      $profileAvatar.css('background-image', 'url("' + imageObj[1] + '")');
    } else {
      $profilePic.css('background-image', 'url("' + imageObj[0] + '")');
      $profileAvatar.css('background-image', 'url("' + imageObj[0] + '")');
    }
  };

  var _configureAvatarFromPPS = function (profileImageData) {
    var imageArry = Object.values(profileImageData);
    var $profilePic = $('a.Profile-thumbnail');
    var $profileAvatar = $('.Profile-avatar');
    if (imageArry.length &gt; 1) {
      $profilePic.css('background-image', 'url("' + imageArry[1] + '")');
      $profileAvatar.css('background-image', 'url("' + imageArry[1] + '")');
    } else {
      $profilePic.css('background-image', 'url("' + imageArry[0] + '")');
      $profileAvatar.css('background-image', 'url("' + imageArry[0] + '")');
    }
  };

  // logging in with ims appends "ims-" to adobeID. remove it if it exists
  var _formatAdobeId = function (adobeId) {
    var imsPrefix = adobeId.substr(0, 4);
    if (imsPrefix === 'ims-') {
      adobeId = adobeId.substr(4);
    }
    return adobeId;
  };

  var _configureInternalAvatar = function (endpoint) {
    var $profilePic = $('a.Profile-thumbnail');
    var $profileAvatar = $('.Profile-avatar');
    $profilePic.css('background-image', 'url("' + endpoint + '")');
    $profileAvatar.css('background-image', 'url("' + endpoint + '")');
  };

  var _getInternalPic = function (adobeId) {
    return new Promise(function (resolve, reject) {
      var id = adobeId.substring(0, adobeId.indexOf('@'));
      var endpoint = CONST.profileInternalEndpoint + id;
      ajax.fetchDataTxt({}, endpoint).then(
        function (resp) {
          if (resp) {
            _configureInternalAvatar(endpoint);
            resolve();
          } else {
            reject({
              responseText: 'Unknown issue retrieving Internal Image',
            });
          }
        },
        function (err) {
          reject(err);
        }
      );
    });
  };

  var _getDefaultPicFromBehance = function (adobeId) {
    var query = { api_key: 'cbconnection' };
    var newId = _formatAdobeId(adobeId);
    var url = CONST.behanceEndpoint + newId;
    ajax
      .fetchDataNoCache(query, url)
      .then(function (behanceResp) {
        _configureAvatar(behanceResp);
      })
      .fail(function (error) {
        window.console.error('Error occurred retrieving profile image', error);
      });
  };

  var _getProfilePicFromPPS = function () {
    ajax
      .fetchData({}, CONST.adobePublicProfileUrl)
      .done(function (resp) {
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
          if (resp.data.images) {
            _configureAvatarFromPPS(resp.data.images);
          } else {
            console.error('Error occurred retrieving profile image', resp.data);
          }
        }
      })
      .fail(function (jqXHR, textStatus, errorThrown) {
        console.error('Error occurred retrieving profile image', jqXHR);
      });
  };

  var _getDefaultPic = function (adobeId) {
    if (enableAdobePublicProfileService) {
      _getProfilePicFromPPS();
    } else {
      _getDefaultPicFromBehance(adobeId);
    }
  };

  /**
   * If internal user, get profile picture from internal, and if that doesn't
   * work, get pic from behance. Get the 100x100px image if it exist, otherwise
   * the 50x50px one
   */
  var _getProfilePic = function (adobeId) {
    if (adobeId.includes(INTERNAL_EMAIL_DOMAIN)) {
      _getInternalPic(adobeId).catch(function (err) {
        window.console.error('Internal Image not found: ' + err.responseText);
        _getDefaultPic(adobeId);
      });
    } else {
      _getDefaultPic(adobeId);
    }
  };

  var _setLoginModalEventHandlers = function () {
    // Get the modal
    var loginModal = $('#loginModal')[0];
    // Get the button that opens the modal
    var btn = $('#loginButton')[0];
    // Get the &lt;span&gt; element that closes the modal
    var span = $('.close')[0];
    btn.onclick = function () {
      loginModal.style.display = 'block';
    };
    span.onclick = function () {
      loginModal.style.display = 'none';
    };
    window.onclick = function (event) {
      if (event.target === loginModal) {
        loginModal.style.display = 'none';
      }
    };
    $(document).keyup(function (e) {
      if (e.key === 'Escape') {
        loginModal.style.display = 'none';
      }
    });
  };

  var _configureProfile = function (profileData, userInfo) {
    var profile = new FUSION.Profile(profileData);
    var $profileDisplayName = $('p.Profile-name');
    if (profile.displayName) {
      $profileDisplayName.text(profile.displayName);
    } else if (profile.buildDisplayName()) {
      $profileDisplayName.text(profile.buildDisplayName());
    }
    var $profileEmail = $('p.Profile-email');
    _getProfilePic(userInfo.userID);
    if (profile.email) {
      $profileEmail.text(profile.email);
      $profileEmail.attr('title', profile.email);
    } else {
      $profileEmail.text(userInfo.userID);
      $profileEmail.attr('title', userInfo.userID);
    }
  };

  var _handleLoginDisplay = function (resp) {
    var userInfo = resp.data;
    var ANONYMOUS = 'anonymous';
    if (userInfo.userID.toLowerCase().trim() === ANONYMOUS) {
      // not logged in yet
      $('.Gnav-action-login').show();
      $('.Gnav-profile').hide();
    } else {
      // logged in
      $('.Gnav-action-login').hide();
      $('.Gnav-profile').show();
      if (userInfo.home) {
        var endpoint = userInfo.home + '/profile.json';
        _getProfileData(endpoint)
          .then(function (profileData) {
            _configureProfile(profileData, userInfo);
          })
          .fail(function (error) {
            window.console.error('Error occurred retrieving profile data', error);
          });
      }
    }
  };

  var _processUser = function () {
    _getUserInfo()
      .then(function (resp) {
        _handleLoginDisplay(resp);
      })
      .fail(function (error) {
        window.console.error('Error occurred retrieving user info', error);
      });
  };

  var _processMegaMenu = function () {
    _getMegaMenu()
      .then(function (response) {
        if (response.success) {
          new FUSION.TopNavFactory(response.data).build();
        }
      })
      .fail(function (error) {
        window.console.error('Error occurred when render Global Nav Bar', error);
      });
  };

  var _init = function () {
    _processUser();
    _processMegaMenu();
    _setLoginModalEventHandlers();
  };

  _init();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.TopNavFactory = function TopNavFactory(data) {
  this.props = new FUSION.Properties();
  this.navItem = new FUSION.NavItem();
  this.data = data;
  this.items = [];
  this.menuKeys = {
    externalLinkTitle: "externalLinkTitle",
    listTitles: "listTitles",
    menuPar: "menu-par",
    multi: "multi",
    titleIsDisplayed: "titleIsDisplayed"
  };
};

FUSION.TopNavFactory.prototype.build = function() {
  this._compileHandlebars({ tab: this._buildTabs() });
  this._handleResize();
};

FUSION.TopNavFactory.prototype._buildTabs = function() {
  var tabs = [];
  var properties = new FUSION.Properties();
  for (var key in this.data) {
    if (this.data.hasOwnProperty(key) &amp;&amp; properties.isObject(this.data[key])) {
      tabs.push(this._buildTab(key));
    }
  }
  return tabs;
};

FUSION.TopNavFactory.prototype._buildTab = function(key) {
  var tabKeys = {
    colBreak: "col_break",
    colEnd: "col_end",
    externalLinkList: "externallinklist",
    individualLink: "individuallink",
    navList: "navlist"
  };
  var columns = [];
  var tab = this.data[key];
  var title = tab.title;
  var tabItems = tab[this.menuKeys.menuPar];

  for (var item in tabItems) {
    if (tabItems.hasOwnProperty(item)) {
      if (item.includes(tabKeys.navList)) {
        this._buildMenuGroup(tabItems[item]);
      } else if (item.includes(tabKeys.externalLinkList)) {
        this._buildExternalLinkList(tabItems[item]);
      } else if (item.includes(tabKeys.individualLink)) {
        this._buildIndividualLink(tabItems[item]);
      } else if (
        item.includes(tabKeys.colBreak) ||
        item.includes(tabKeys.colEnd)
      ) {
        columns.push({ item: this.items });
        this.items = [];
      }
    }
  }
  return { title: title, column: columns };
};

FUSION.TopNavFactory.prototype._buildMenuGroup = function(menuGroup) {
  if (this.props.checkNull(menuGroup)) {
    if (menuGroup[this.menuKeys.titleIsDisplayed] === "true") {
      this.items.push(this.navItem.getMenuGroupTitle(menuGroup));
    }
    var size = Object.keys(menuGroup[this.menuKeys.listTitles]).length;
    for (var i = 1; i &lt; size; i++) {
      this.items.push(this.navItem.getMenuGroupItem(menuGroup, i));
    }
  }
};

FUSION.TopNavFactory.prototype._buildExternalLinkList = function(extLinkGroup) {
  if (this.props.checkNull(extLinkGroup)) {
    if (extLinkGroup[this.menuKeys.externalLinkTitle]) {
      this.items.push(this.navItem.getExtLinkTitle(extLinkGroup));
    }
    if (extLinkGroup[this.menuKeys.multi]) {
      var externalLinkListItems = extLinkGroup[this.menuKeys.multi];
      if (externalLinkListItems.length &gt; 0) {
        for (var i = 0; i &lt; externalLinkListItems.length; i++) {
          this.items.push(
            this.navItem.getExtLinkItem(externalLinkListItems, extLinkGroup, i)
          );
        }
      }
    }
  }
};

FUSION.TopNavFactory.prototype._buildIndividualLink = function(individualLink) {
  if (this.props.checkNull(individualLink)) {
    this.items.push(this.navItem.getIndividualLink(individualLink));
  }
};

FUSION.TopNavFactory.prototype._compileHandlebars = function(context) {
  var $parent = $(".page-header");
  var $target = $parent.find(".globalnav-placeholder");
  var $tpl = $parent.find("#globalnav-template-tpl");
  var template = Handlebars.compile($tpl.html());
  $target.html(template(context));
  $target.contents().unwrap();
  $target.show();
};

FUSION.TopNavFactory.prototype._handleMoreTab = function(display) {
  var moreTab = $(".Gnav-menu-item.is-moreMenu");
  if (display) {
    if (moreTab.css("display", "none")) {
      moreTab.css("display", "flex");
    }
  } else if (moreTab.css("display", "flex")) {
    moreTab.css("display", "none");
  }
};

FUSION.TopNavFactory.prototype._resetMegaMenu = function(
  moreTabContents,
  megaMenuContent
) {
  var gNav = $(".Gnav-menu-wrapper");
  var primaryNav = $("#AdobePrimaryNav");
  var logo = $("a.Gnav-logo").outerWidth();
  var action = $("div.Gnav-actions").outerWidth();
  var content = gNav.outerWidth();
  var megaMenu = logo + action + content;
  var globalNav = primaryNav.outerWidth();

  for (var i = 1; megaMenu &gt; globalNav &amp;&amp; i &lt; moreTabContents.length; i++) {
    this._handleMoreTab(true);
    $(moreTabContents[moreTabContents.length - i]).show();
    $(megaMenuContent[megaMenuContent.length - (i + 1)]).hide();
    content = gNav.outerWidth();
    megaMenu = logo + action + content;
    globalNav = primaryNav.outerWidth();
  }
};

FUSION.TopNavFactory.prototype._handleResize = function() {
  var gNav = $(".Gnav-menu-wrapper");
  var moreTabContents = $(".Gnav-menu-item.is-moreMenu").find(
    ".Gnav-moreMenu-item.has-submenu"
  );
  var navBuilder = this;
  var megaMenuContent = gNav.find(".Gnav-menu-item.has-submenu");
  var timeout;

  // Dynamically change the megaMenu when its length is changed.
  $(window)
    .on("resize", function() {
      gNav.hide();
      clearTimeout(timeout);
      timeout = setTimeout(function() {
        var content = gNav.outerWidth();
        var logo = $("a.Gnav-logo").outerWidth();
        var action = $("div.Gnav-actions").outerWidth();
        var globalNav = $("#AdobePrimaryNav").outerWidth();
        var megaMenu = logo + action + content;

        if (megaMenu &gt; globalNav) {
          navBuilder._resetMegaMenu(moreTabContents, megaMenuContent);
        } else {
          navBuilder._handleMoreTab(false);
          for (var i = 0; i &lt; moreTabContents.length; i++) {
            var $tab = $(megaMenuContent[i]);
            if ($tab.css("display", "none")) {
              $tab.css("display", "flex");
            }
            $(moreTabContents[i]).hide();
          }
          navBuilder._resetMegaMenu(moreTabContents, megaMenuContent);
        }
      }, 100);
      gNav.show();
    })
    .resize();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.TopNavTracker = function () {
  var propUtil = new FUSION.Properties();
  var formatUtil = new FUSION.Formatter();
  var tabs, headers, items;
  var _DELIMITER = ' &gt; ';
  var _props = {
    titles: { tab: '', header: '', item: '' },
    destinationPage: '',
    isGated: '',
    menuTree: '',
  };

  var _tabClick = function (e) {
    e.stopPropagation();
    var tempTabTitle;
    if (this.classList.contains('is-moreMenu') &amp;&amp; e.target.innerHTML.trim() !== 'More') {
      tempTabTitle = e.target.dataset.title;
    } else if (!this.classList.contains('is-moreMenu')) {
      tempTabTitle = this.dataset.title;
    }
    _props.titles.tab = formatUtil.setVal(tempTabTitle).removeLineBreaks().getVal().trim();
  };

  var _sendEvent = function () {
    var A = FUSION.ANALYTICS;
    new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.MAIN_MENU)
      .putEventData(A.KEYS.DESTINATION_LINK, _props.destinationPage, true)
      .putEventData(A.KEYS.IS_GATED, _props.isGated, true)
      .putEventData(A.KEYS.MENU_TREE, _props.menuTree, true)
      .setEvent(A.EV.CLICK.MAIN_MENU)
      .track();
  };

  var _headerClick = function (e) {
    e.stopPropagation();
    _props.titles.header = formatUtil.setVal(this.dataset.header).removeLineBreaks().getVal().trim();
    _props.destinationPage = this.dataset.path;
    _props.isGated = propUtil.validateStringBool(this.dataset.locked);
    _props.menuTree = _props.titles.tab.trim() + _DELIMITER + _props.titles.header.trim();
    _sendEvent();
  };

  var _buildMenuTree = function () {
    var titles = _props.titles;
    return (
      titles.tab.trim() + (!!titles.header ? _DELIMITER + titles.header.trim() : '') + _DELIMITER + titles.item.trim()
    );
  };

  var _itemClick = function (e) {
    e.stopPropagation();
    var traverse = new FUSION.DomTraverser();
    var tempHeader = traverse.getPreviousSiblingByClassRecursive(this, this.parentElement, 'header');
    if (propUtil.checkNull(tempHeader) &amp;&amp; !!tempHeader.textContent) {
      _props.titles.header = formatUtil.setVal(tempHeader.textContent).removeLineBreaks().getVal().trim();
    }
    _props.titles.item = formatUtil.setVal(this.dataset.name).removeLineBreaks().getVal().trim();
    _props.destinationPage = this.dataset.path.trim();
    _props.isGated = propUtil.validateStringBool(this.dataset.locked);
    _props.menuTree = _buildMenuTree();
    _sendEvent();
  };

  var _navLogoClick = function () {
    _props.destinationPage = this.dataset.path.trim();
    _props.isGated = 'false';
    _props.menuTree = this.dataset.title;
    _sendEvent();
  };

  var _unload = function () {
    for (var tab of tabs) {
      tab.removeEventListener('click', _tabClick, false);
    }
    for (var header of headers) {
      header.removeEventListener('click', _headerClick, false);
    }
    for (var item of items) {
      item.removeEventListener('click', _itemClick, false);
    }
    $(window).off('unload', _unload);
  };

  var _init = function () {
    var navLogo = document.getElementById('Gnav-main-logo');
    navLogo.addEventListener('click', _navLogoClick.bind(navLogo), false);
    tabs = document.getElementsByClassName('Gnav-menu-item');
    for (var tab of tabs) {
      tab.addEventListener('click', _tabClick.bind(tab), false);
    }
    headers = document.getElementsByClassName('header-link');
    for (var header of headers) {
      header.addEventListener('click', _headerClick.bind(header), false);
    }
    items = document.getElementsByClassName('Gnav-submenu-item');
    for (var item of items) {
      item.addEventListener('click', _itemClick.bind(item), false);
    }
    $(window).on('unload', _unload);
  };

  $(_init);
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars */
FUSION.GlobalSubNav = function(currentPage) {
  var CONST = {
    subNavUrl: "/bin/fusion/subnav?currentPage=" + currentPage
  };
  var _$parent = $(".page-header");
  var _$subNavContent;
  var _$secondaryNav;
  var _$subNavWrapper;
  var _setGlobalNavConfig = function(sticky) {
    window.adobeGlobalnavConfig = {
      // Mandatory
      // The global navigation will replace the target with navigation markup
      target: document.getElementById("AdobePrimaryNav"),

      // Mandatory
      // Default: 'en'
      // The global navigation locale. See the list of supported locales
      locale: "en", // example value

      // Optional
      // Default: false
      // The global navigation is sticky by default (on scroll). Set to true to remove sticky behaviour
      disableSticky: sticky, // example value

      // Optional
      // Default: false
      // The global navigation can be configured to load the HTML server-side instead of injecting content into DOM. Check the progressive enhancement guide
      progressiveEnhancement: true, // example value

      // Optional
      // Default: none (white)
      // The global navigation theme can be customized. You can pass a theme object. See example below
      theme: {
        // menu background color
        mBackgroundColor: "#0a0a0a", // example value
        // menu link color
        mLinkColor: "#ffffff", // example value
        // menu link hover color
        mLinkHoverColor: "#ffffff", // example value
        // menu link dimmed (out of focus) color
        mLinkDimmedColor: "#bfbfbf", // example value
        // menu link hover background color
        mLinkHoverBackgroundColor: "#191616", // example value
        // dropdown background color
        dBackgroundColor: "#191616", // example value
        // dropdown link color
        dLinkColor: "#ffffff", // example value
        // dropdown link hover color
        dLinkHoverColor: "#35a5fc", // example value
        // dropdown link hover background color
        dLinkHoverBackgroundColor: "#0a0a0a", // example value
        // headline color
        headlineColor: "#9b9da0", // example value
        // description color
        descriptionColor: "#9b9da0", // example value
        // separator color
        separatorColor: "#0a0a0a", // example value
        // caret color
        caretColor: "#ffffff" // example value
      },

      // Optional
      // Default: true
      // Choose to show hide the profile and also set a custom theme. By default the profile is visible and has a white theme
      // profile: false - will hide the profile
      // profile: { theme: 'custom-theme' } - will show the profile with a custom theme
      profile: {
        theme: "dark" // default theme is white; you can set a 'dark' or 'grey' theme
      }
    };
  };
  // setting min-width of the sub nav wrapper
  var _setSubnavWidth = function() {
    var subNavDropdown = $(".Subnav .Subnav-menu-wrapper .Subnav-submenus");
    var dropdownContents;
    var $secondaryNav = $("#AdobeSecondaryNav");

    if (!$secondaryNav.hasClass("has-mobileLayout")) {
      $(subNavDropdown).each(function() {
        dropdownContents = $(this).find(".Subnav-submenu-wrapper");
        $(dropdownContents).each(function() {
          $(this).css(
            "min-width",
            $(this)
              .find(".Subnav-submenu")
              .width() + "px"
          );
        });
      });
    }
  };
  // registers the global nav search button
  var _registerSearchBtn = function() {
    $(".Gnav-action-search").click(function() {
      if (this.classList.contains("is-open")) {
        this.classList.remove("is-open");
        $("#AdobePrimaryNav.Gnav-wrapper").removeClass("show-searchOverlay");
        $(".Gnav-search").removeClass("is-open");
        $(".Gnav-menu").removeClass("is-hidden");
        $(".Gnav-search-results").removeClass("is-visible");
      } else {
        this.classList.add("is-open");
        $("#AdobePrimaryNav.Gnav-wrapper").addClass("show-searchOverlay");
        $(".Gnav-search").addClass("is-open");
        $(".Gnav-menu").addClass("is-hidden");
        $(".Gnav-search-input").focus();
        $(".Gnav-search-results").addClass("is-visible");
      }
    });
  };
  // sets up the Global Navigation
  var _registerGlovalNav = function() {
    // run Adobe's global navigation logic to register all the list elements as clickable items. This requires the completion of building the object model for handlebars.
    $.getScript(
      "/etc/clientlibs/adobe-fusion/clientlib-globalnav-js/js/adobe-globalnav.js"
    );

    // registers the search button
    _registerSearchBtn();
  };
  var _subNavMenuEvent = function() {
    var subNavMenu = $(".Subnav-menu-item.has-submenu");
    var is_open = "is-open";

    subNavMenu.on("click", function() {
      if ($(this).hasClass(is_open)) {
        subNavMenu.removeClass(is_open);
      } else {
        subNavMenu.removeClass(is_open);
        $(this).addClass(is_open);
        _setSubnavWidth();
      }
    });

    $(document).on("click.hideMenu", function(e) {
      if (subNavMenu.hasClass(is_open)) {
        if (
          !$(e.target)
            .parent()
            .hasClass(is_open)
        ) {
          subNavMenu.removeClass(is_open);
        }
      }
    });
  };
  // Function to call ajax with given url
  var _getSubNav = function() {
    return new FUSION.Ajax().fetchData({}, CONST.subNavUrl);
  };
  var _unbindMobileEvent = function(clickEvent) {
    $(document).unbind(clickEvent);
    _$secondaryNav.unbind(clickEvent);
    _$subNavWrapper.unbind(clickEvent);
  };
  var _applyMobileEvent = function(clickEvent) {
    $(document).bind(clickEvent, function() {
      if (_$subNavContent.hasClass("is-open")) {
        _$subNavContent.removeClass("is-open");
      }
    });
    _$secondaryNav.bind(clickEvent, function(e) {
      e.stopPropagation();
      if (_$subNavContent.hasClass("is-open")) {
        _$subNavContent.removeClass("is-open");
      } else {
        _$subNavContent.addClass("is-open");
      }
    });
    _$subNavWrapper.bind(clickEvent, function(e) {
      e.stopPropagation();
    });
    $(".Subnav-logo.has-path").removeAttr("href");
  };
  var _getMobileEvent = function() {
    _$secondaryNav = $("#AdobeSecondaryNav");
    _$subNavContent = $(".Subnav");
    _$subNavWrapper = $(".Subnav-menu-wrapper");

    var isMobile = window.matchMedia("only screen and (max-width: 599px)");
    var secondaryNavWidth = _$secondaryNav.width() + 6;
    var subNavWidth = _$subNavContent.width() + 6;
    var clickEvent;
    var timeout;
    if (window.hasOwnProperty("onpointerdown")) {
      clickEvent = "pointerdown";
    } else if (window.hasOwnProperty("ontouchstart")) {
      clickEvent = "touchstart";
    } else {
      clickEvent = "click";
    }
    if (isMobile.matches) {
      _unbindMobileEvent(clickEvent);
      _applyMobileEvent(clickEvent);
    }

    $(window)
      .on("resize", function() {
        clearTimeout(timeout);
        timeout = setTimeout(function() {
          secondaryNavWidth = _$secondaryNav.width() + 6;
          if (!isMobile.matches) {
            _$secondaryNav.removeClass("has-mobileLayout");
          }
          if (!_$secondaryNav.hasClass("has-mobileLayout")) {
            subNavWidth = _$subNavContent.width() + 6;
          }
          if (subNavWidth &gt;= secondaryNavWidth) {
            _$secondaryNav.addClass("has-mobileLayout");
            _$subNavContent
              .find(".Subnav-menu-item.mobile-view")
              .css("display", "block");
            _unbindMobileEvent(clickEvent);
            _applyMobileEvent(clickEvent);
          } else if (!isMobile.matches) {
            _$secondaryNav.removeClass("has-mobileLayout");
            _$subNavContent
              .find(".Subnav-menu-item.mobile-view")
              .css("display", "none");
            _unbindMobileEvent(clickEvent);
          }
        }, 100);
      })
      .resize();
  };
  var _renderSubNav = function(data) {
    var $subNav = _$parent.find(".subNav-placeholder");
    var $subNavTpl = _$parent.find("#subnav-content-tpl");
    var subNavTemplate = Handlebars.compile($subNavTpl.html());
    // sticky = data.subNav.length &lt;= 0,
    var sticky = false;
    var style;
    var sheet;

    $subNav.empty();
    $subNav.html(subNavTemplate(data));
    $subNav.show();

    _setGlobalNavConfig(sticky);
    _registerGlovalNav();
    _subNavMenuEvent();

    // Create a new style tag
    style = document.createElement("style");
    // Append the style tag to head
    document.head.appendChild(style);
    // Grab the stylesheet object
    sheet = style.sheet;

    // Use addRule or insertRule to inject styles
    if (data.color &amp;&amp; data.opacity) {
      sheet.insertRule(
        "#AdobeSecondaryNav.Subnav-wrapper.is-dark:before { background-color: " +
          data.color +
          "; opacity: " +
          data.opacity +
          "; }",
        0
      );
    } else {
      sheet.insertRule(
        "#AdobeSecondaryNav.Subnav-wrapper.is-dark:before { background-color: black; opacity: 0.7; }",
        0
      );
    }
    _getMobileEvent();
  };
  var _init = function() {
    _getSubNav()
      .then(function(response) {
        if (response.success) {
          _renderSubNav(response.data);
        }
      })
      .fail(function(error) {
        // TODO: Create error message feature
      });
  };

  _init();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.SubNavTracker = function () {
  var formatUtil = new FUSION.Formatter();
  var parents, tabs, items;
  var _DELIMITER = ' &gt; ';
  var _props = {
    titles: { parent: '', tab: '', item: '' },
    destinationPage: '',
    menuTree: '',
  };

  var _sendEvent = function () {
    var A = FUSION.ANALYTICS;
    new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.SUB_MENU)
      .putEventData(A.KEYS.DESTINATION_LINK, _props.destinationPage, true)
      .putEventData(A.KEYS.MENU_TREE, _props.menuTree, true)
      .setEvent(A.EV.CLICK.SUB_MENU)
      .track();
  };

  var _parentClick = function (e) {
    e.stopPropagation();
    _props.destinationPage = this.dataset.path;
    _props.menuTree = _props.titles.parent + _DELIMITER + 'Overview';
    _sendEvent();
  };

  var _tabClick = function () {
    _props.titles.tab = formatUtil.setVal(this.dataset.title).removeLineBreaks().getVal().trim();
    _props.destinationPage = this.dataset.path;
    _props.menuTree = _props.titles.parent + _DELIMITER + _props.titles.tab;
    if (this.classList.contains('send')) {
      _sendEvent();
    }
  };

  var _itemClick = function (e) {
    e.stopPropagation();
    _props.titles.item = formatUtil.setVal(this.dataset.title).removeLineBreaks().getVal().trim();
    _props.menuTree = _props.titles.parent + _DELIMITER + _props.titles.tab + _DELIMITER + _props.titles.item;
    _props.destinationPage = this.dataset.path;
    _sendEvent();
  };

  var _unload = function () {
    for (var parent of parents) {
      parent.removeEventListener('click', _parentClick, false);
    }
    for (var tab of tabs) {
      tab.removeEventListener('click', _tabClick, false);
    }
    for (var item of items) {
      item.removeEventListener('click', _itemClick, false);
    }
    $(window).off('unload', _unload);
  };

  var _init = function () {
    var subNavTitle = document.getElementById('Subnav-parent-title');
    if (!!subNavTitle) {
      _props.titles.parent = formatUtil.setVal(subNavTitle.dataset.title).removeLineBreaks().getVal().trim();
    }
    parents = document.getElementsByClassName('Subnav-logo has-path');
    for (var parent of parents) {
      parent.addEventListener('click', _parentClick.bind(parent), false);
    }
    tabs = document.getElementsByClassName('Subnav-menu-label');
    for (var tab of tabs) {
      tab.addEventListener('click', _tabClick.bind(tab), false);
    }
    items = document.getElementsByClassName('Subnav-submenu-link');
    for (var item of items) {
      item.addEventListener('click', _itemClick.bind(item), false);
    }
    $(window).on('unload', _unload);
  };

  $(_init);
};

var video = null, videoName = "";

function stringEndsWith(subjectString, searchString, ignoreCase, position) {
    if (ignoreCase) {
        subjectString = subjectString.toLowerCase();
        searchString = searchString.toLowerCase();
    }
    if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position &gt; subjectString.length) {
        position = subjectString.length;
    }
    position -= searchString.length;
    var lastIndex = subjectString.lastIndexOf(searchString, position);
    return lastIndex !== -1 &amp;&amp; lastIndex === position;
}

function cq_download_asset(path) {
    var isIE11 = !!window.MSInputMethodContext &amp;&amp; !!document.documentMode,
        fileName = ("." + path.split('/').pop()),
        link = document.createElement("a"), _window,
        event = document.createEvent("MouseEvents");
    event.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);

    if (isIE11) {
        _window = window.open(path, '_blank');
        _window.close();
    } else {
        link.download = fileName;
        link.href = path;
        link.dispatchEvent(event);
    }
}

function cq_preview_asset(path) {
    if (stringEndsWith(path, ".mp4", true)) {
        var videoPreview = $('#video-preview');
        videoPreview.css('display', 'block');
        video = videoPreview.find("video").get(0);
        document.getElementById('video-source').src = path;
        video.load();
        video.pause();
        videoName = decodeURI(path.substring(path.lastIndexOf('/') + 1));
        video.onloadedmetadata = function () {
            video.play();
        };
    }
    else if (stringEndsWith(path, ".url", true)) {
        $.ajax({
            type: "GET",
            url: path,
            success: function (data) {
                var url = data.substr(data.indexOf("URL=") + 4, data.length);
                url = url.substr(0, url.indexOf('\r'));
                window.open(url);
            },
            error: function (data) {
            }
        });
    }
    else {
        window.open(path);
    }
}

function uncheckAll() {
    $('input[type="checkbox"]:checked').prop('checked', false);
    document.getElementById("selected-tag-box").innerHTML = '';
}

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars Granite _initSearchResult Uint16Array _satellite */
/* jslint regexp: false */
/* jslint bitwise: false */
FUSION.GetSearchResult = function (pageLimit, currentPage, resultRendering) {
  // Get the input box
  var ajax = new FUSION.Ajax();
  var resultTextInput = $('#search-term');
  var timeout = null;
  var $searchFilter = $('#search-filters');
  var resizeReady = false;
  var useAlloy = !!FUSION.useAlloy;

  var _searchPageModal = new FUSION.SearchPageModal(pageLimit);
  var _searchPageRender = new FUSION.SearchPageRender(
    pageLimit,
    resultRendering,
    currentPage,
    _searchPageModal,
    function (offset) {
      _initSearchResult(offset);
    }
  );

  var CONST = {
    searchResultUrl: '/bin/fusion/search/result?currentPage=' + currentPage,
  };

  var _getSearchResult = function (searchObjectResult) {
    return ajax.fetchData(searchObjectResult, CONST.searchResultUrl);
  };

  var _getUrlVars = function () {
    var vars = {};
    window.location.href.replace(/[?&amp;]+([^=&amp;]+)=([^&amp;]*)/gi, function (m, key, value) {
      vars[key] = value;
    });
    return vars;
  };
  var _getUrlParam = function (parameter) {
    var urlparameter = '';
    if (window.location.href.indexOf(parameter) &gt; -1) {
      urlparameter = _getUrlVars()[parameter];
    }
    return urlparameter;
  };
  var _initSearchResult = function (offset, isReturned) {
    var searchParameter = _getUrlParam('uid');

    if (isReturned === 'undefined') {
      isReturned = false;
    }

    if (
      jQuery.isEmptyObject(_searchPageModal.getSearchObject()) ||
      _searchPageModal.getSearchObject().uid !== searchParameter ||
      !isReturned
    ) {
      _searchPageModal.parseSearchObject(offset);
      if (useAlloy) {
        var analyze = new FUSION.AnalyticsBuilder('search');
        analyze.putEventData('searchInfo.keyword', _searchPageModal.getSearchObject().fulltext, true);
        analyze.track();
      } else {
        // Search-term collected for Launch (analytics)
        window.digitalData._set('digitalData.search.searchInfo.keyword', _searchPageModal.getSearchObject().fulltext);
        _satellite.track('event', {
          digitalData: window.digitalData._snapshot(),
        });
        window.digitalData._delete('digitalData.search.searchInfo.keyword');
      }
    } else {
      _searchPageModal.reset();
    }

    if (history.pushState) {
      var newUrl =
        window.location.protocol +
        '//' +
        window.location.host +
        window.location.pathname +
        '?q=' +
        resultTextInput.val() +
        '&amp;uid=' +
        _searchPageModal.getSearchObject().uid;
      window.history.pushState({ path: newUrl }, '', newUrl);
    }

    _getSearchResult(_searchPageModal.getSearchObject()).then(function (resp) {
      if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
        _searchPageRender.renderSearchResult(resp);
        _searchPageModal.setNewSearch(false);

        resizeReady = true;
      }
    });
  };
  var _pageInitialize = function () {
    var searchParameter = _getUrlParam('q');

    if (searchParameter !== 'undefined' &amp;&amp; searchParameter !== '') {
      var searchText = decodeURI(searchParameter).replace(new RegExp('\\+', 'g'), ' ').replace(/^\s+/g, '');
      resultTextInput.val(searchText);
    }
    _initSearchResult('0', true);
  };

  $(document).on('click', '.tag-label-info', function () {
    var tagId = $(this).attr('id');
    $("#tag-select-table input[value='" + tagId + "']").prop('checked', false);
    $(this).remove();

    clearTimeout(timeout);
    // Function call after 1000 milliseconds
    timeout = setTimeout(function () {
      _initSearchResult('0');
    }, 1000);
  });

  $(window).on('click.Bst', function (event) {
    if ($searchFilter.has(event.target).length === 0 &amp;&amp; !$searchFilter.is(event.target)) {
      _searchPageRender.closeAllDropdown(0);
      _searchPageRender.setRefresh(false);
    }
  });

  $(window).resize(function () {
    if (resizeReady) {
      _searchPageRender.closeAllDropdown(0);
      _searchPageRender.resizeFilterColumn();
      _searchPageRender.renderTagButtons();
    }
  });

  // Safari uses back-forward cache. We need to force reload in order to save search term.
  $(window).bind('pageshow', function (event) {
    if (event.originalEvent.persisted) {
      window.location.reload();
    }
  });
  _pageInitialize();
};

var FUSION = window.FUSION || {};

FUSION.SearchPageModal = function(pageLimit) {
  this._pageLimit = pageLimit;
  this.init();
};

var _getTagList = function(searchTag) {
  return $(searchTag)
    .map(function() {
      return this.value.replace(/\s+/g, "");
    })
    .get();
};
var _create_UUID = function() {
  var getRandomSymbol = function() {
    var crypto = window.crypto || window.msCrypto;
    return crypto.getRandomValues(new Uint16Array(1))[0];
  };
  return "x-x-x-x".replace(/[x]/g, getRandomSymbol);
};
var _setCookie = function(object) {
  var d = new Date();
  var expires;
  d.setTime(d.getTime() + 86400000);
  expires = "expires=" + d.toUTCString();
  parent.document.cookie =
    "search=" + JSON.stringify(object) + "; expires=" + expires + "; path=/";
};
var _getCookie = function() {
  var result = document.cookie.match(new RegExp("search=([^;]+)"));
  if (result !== null &amp;&amp; result !== "undefined" &amp;&amp; typeof result === "object") {
    result = JSON.parse(result[1]);
  }
  return result;
};

FUSION.SearchPageModal.prototype.getSearchObject = function() {
  return this._searchObject;
};
FUSION.SearchPageModal.prototype.getPageLimit = function() {
  return this._pageLimit;
};
FUSION.SearchPageModal.prototype.isNewSearch = function() {
  return this._isNewSearch;
};
FUSION.SearchPageModal.prototype.setNewSearch = function(isNewSearch) {
  this._isNewSearch = isNewSearch;
};

FUSION.SearchPageModal.prototype.reset = function() {
  var searchPageModal = this;

  searchPageModal._searchObject.isNewSearch = true;
  searchPageModal._searchObject.isReturnSearch = true;
  searchPageModal._isNewSearch = true;
};

FUSION.SearchPageModal.prototype.parseSearchObject = function(offset) {
  var searchPageModal = this;

  searchPageModal._searchObject = {
    uid: _create_UUID(),
    page: Math.ceil((Number(offset) + 1) / searchPageModal._pageLimit),
    offset: offset,
    sort: "MOST_RECENT",
    select: "ALL_CONTENT",
    urlPathPrefix:
      window.location.protocol +
      "//" +
      window.location.hostname +
      (window.location.port ? ":" + window.location.port : ""),
    fulltext: searchPageModal._resultTextInput.val().replace(/^\s+/g, ""),
    limit: searchPageModal._pageLimit,
    tag: [],
    langTag: [],
    isNewSearch: searchPageModal._isNewSearch,
    isReturnSearch: false
  };

  if (searchPageModal._searchObject.fulltext) {
    searchPageModal._searchObject.fulltext = encodeURIComponent(
      searchPageModal._resultTextInput.val().replace(/^\s+/g, "")
    );
  }

  if (!searchPageModal._isNewSearch) {
    searchPageModal._searchObject.tag = _getTagList(
      "#tagDropbox input:checkbox:checked"
    );
    searchPageModal._searchObject.langTag = _getTagList(
      "#language-types input:checkbox:checked"
    );
    searchPageModal._searchObject.sort = this._$sortType
      .find(".active")
      .attr("value");
    searchPageModal._searchObject.select = this._$searchType
      .find(".active")
      .attr("value");
  }

  _setCookie(searchPageModal._searchObject);
};

FUSION.SearchPageModal.prototype.init = function() {
  this._searchObject = _getCookie();
  this._isNewSearch = true;

  this._resultTextInput = $("#search-term");
  this._$sortType = $("#sort-types");
  this._$searchType = $("#search-types");
};

var FUSION = window.FUSION || {};

FUSION.SearchPageRender = function (pageLimit, resultRendering, currentPage, searchPageModal, searchResultCallBack) {
  this._pageLimit = pageLimit;
  this._resultRendering = resultRendering;
  this._$parent = $('.page-content');
  this._searchPageModal = searchPageModal;
  this._searchResultCallBack = searchResultCallBack;

  this._resultTextInput = $('#search-term');
  this._$searchButton = $('#search-result-button');
  this._$langageType = $('#language-types');
  this._$filterTag = $('.filterTag');
  this._$tagDropBox = $('#tagDropbox');
  this._$searchFilter = $('#search-filters');
  this._$sortType = $('#sort-types');
  this._$searchType = $('#search-types');
  this._respTags = {};
  this._refresh = true;
  this._maxTagButton = 2;

  this._searchPagePaginationRender = new FUSION.SearchPagePaginationRender(pageLimit, function (offset) {
    searchResultCallBack(offset);
  });

  this._searchPageLazyLoadingRender = new FUSION.SearchPageLazyLoadingRender(pageLimit, function (offset) {
    searchResultCallBack(offset);
  });

  this.init();
};

var includeTag = function (tagList, tagVal) {
  var found = false;
  tagVal = tagVal.replace(/\s+/g, '');
  $.each(tagList, function (index, value) {
    value = value.replace(/\s+/g, '');
    if (value === tagVal) {
      found = true;
    }
  });
  return found;
};

var _sortByTagIdKey = function (filterMap) {
  var tupleArray = [];
  var key = '';
  var sortedFilterMap = {};
  for (key in filterMap) {
    if (filterMap.hasOwnProperty(key)) {
      tupleArray.push([key, filterMap[key]]);
    }
  }
  tupleArray.sort(function (a, b) {
    return a[0] - b[0];
  });

  tupleArray.forEach(function (item) {
    sortedFilterMap[item[0]] = item[1];
  });
  return sortedFilterMap;
};

var _addLanguageChkbox = function (value, checked) {
  var checkedVal = '';
  var content = '';
  if (value === null) {
    content += '&lt;label&gt;&lt;input type="checkbox" value="checked"&gt;' + Granite.I18n.get('All Languages') + '&lt;/label&gt;';
  } else {
    if (checked) {
      checkedVal = 'checked';
    }
    content +=
      '&lt;label&gt;&lt;input type="checkbox" value="' + value.path + ' "' + checkedVal + '&gt;' + value.displayTitle + '&lt;/label&gt;';
  }
  return content;
};

var _addLanguageRow = function (index, tagVal, checked) {
  var content = '';

  content += '&lt;tr&gt;';
  if (index &gt; 1) {
    content += "&lt;td colspan='2'&gt;";
  } else {
    content += '&lt;td&gt;';
  }
  content += _addLanguageChkbox(tagVal, checked);
  content += '&lt;/td&gt;';
  if (index === 1) {
    content += '&lt;td&gt;&lt;span class="apply-rbtn"&gt;';
    content += '&lt;button class="applyBtn" id="applyLang"&gt;' + Granite.I18n.get('Apply') + '&lt;/button&gt;';
    content += '&lt;/span&gt;&lt;/td&gt;';
  }
  content += '&lt;/tr&gt;';
  return content;
};

var _buildLanguageTable = function (languageTags, locale) {
  var content = '';
  var engTag = '';
  var k = 0;
  var checked = false;

  locale = locale.toLowerCase();
  content = '&lt;table&gt;';
  content += '&lt;tbody&gt;';
  if (languageTags === null) {
    content += '&lt;tr&gt;&lt;td&gt;';
    content += _addLanguageChkbox(null, false);
    content += '&lt;/td&gt;&lt;/tr&gt;';
  } else {
    engTag = languageTags.filter(function (item) {
      return item.path.includes('english');
    })[0];
    if (engTag) {
      ++k;
      if (locale === 'en') {
        checked = true;
      } else {
        checked = false;
      }
      content += _addLanguageRow(k, engTag, checked);
    }
    languageTags = $.grep(languageTags, function (tagDetail) {
      return tagDetail.path.indexOf('english') &lt; 0;
    });

    $.each(languageTags, function (key, value) {
      ++k;
      if (
        (locale === 'fr' &amp;&amp; value.path.includes('french')) ||
        (locale === 'de' &amp;&amp; value.path.includes('german')) ||
        (locale === 'it' &amp;&amp; value.path.includes('italian')) ||
        (locale === 'ja' &amp;&amp; value.path.includes('japanese')) ||
        (locale === 'ko' &amp;&amp; value.path.includes('korean')) ||
        (locale === 'pt' &amp;&amp; value.path.includes('portuguese')) ||
        (locale === 'es' &amp;&amp; value.path.includes('spanish')) ||
        ((locale === 'es_mx' || locale === 'es_la') &amp;&amp; value.path.includes('spanish')) ||
        (locale === 'zh_cn' &amp;&amp; value.path.includes('chinese'))
      ) {
        checked = true;
      } else {
        checked = false;
      }

      content += _addLanguageRow(k, value, checked);
    });
  }

  content += '&lt;/tbody&gt;';
  content += '&lt;/table&gt;';
  return content;
};

var _setSelectedTags = function (selector, orgTagList) {
  $(selector).each(function () {
    if (includeTag(orgTagList, $(this).val())) {
      $(this).prop('checked', true);
    } else {
      $(this).prop('checked', false);
    }
  });
};

FUSION.SearchPageRender.prototype._sortClickEvent = function (event) {
  var type = event.find('a');

  type.on('click', function () {
    if ($(this).hasClass('in-active')) {
      type.removeClass('active').addClass('in-active');
      $(this).removeClass('in-active').addClass('active');
    }
  });
};

FUSION.SearchPageRender.prototype._initDropBox = function (isBacked) {
  var searchPageRender = this;

  var htmltext = '&lt;a class="in-active" value="MOST_RELEVANT"&gt;' + Granite.I18n.get('Most Relevant') + '&lt;/a&gt;';
  htmltext += '&lt;a class="active" value="MOST_RECENT"&gt;' + Granite.I18n.get('Most Recent') + '&lt;/a&gt;';
  searchPageRender._$sortType.empty();
  searchPageRender._$sortType.html(htmltext);

  htmltext = '&lt;a class="active" value="ALL_CONTENT"&gt;' + Granite.I18n.get('All Content') + '&lt;/a&gt;';
  htmltext += '&lt;a class="in-active" value="ONLY_PAGES"&gt;' + Granite.I18n.get('Web Pages') + '&lt;/a&gt;';
  htmltext += '&lt;a class="in-active" value="ONLY_ASSETS"&gt;' + Granite.I18n.get('Assets') + '&lt;/a&gt;';
  searchPageRender._$searchType.empty();
  searchPageRender._$searchType.html(htmltext);

  if (isBacked &amp;&amp; !jQuery.isEmptyObject(searchPageRender._searchPageModal.getSearchObject())) {
    if (searchPageRender._searchPageModal.getSearchObject().sort !== 'MOST_RELEVANT') {
      $("a[value='MOST_RELEVANT']").removeClass('active').addClass('in-active');
      $("a[value='MOST_RECENT']").removeClass('in-active').addClass('active');
    }

    if (searchPageRender._searchPageModal.getSearchObject().select !== 'ALL_CONTENT') {
      $("a[value='ALL_CONTENT']").removeClass('active').addClass('in-active');
      $("a[value='" + searchPageRender._searchPageModal.getSearchObject().select + "']")
        .removeClass('in-active')
        .addClass('active');
    }
  }

  searchPageRender._sortClickEvent(searchPageRender._$sortType);
  searchPageRender._sortClickEvent(searchPageRender._$searchType);
};

FUSION.SearchPageRender.prototype._renderSortByFilterText = function () {
  var searchPageRender = this;

  var text = searchPageRender._$sortType.find('.active').text();
  var $filterText1 = $('#sortFilter-text');
  $filterText1.empty();
  $filterText1.html(text);
};

FUSION.SearchPageRender.prototype._renderContentFilterText = function () {
  var searchPageRender = this;

  var text = searchPageRender._$searchType.find('.active').text();
  var $filterText3 = $('#typeFilter-text');
  $filterText3.empty();
  $filterText3.html(text);
};

FUSION.SearchPageRender.prototype._renderLanguageFilterText = function () {
  var i = 0;
  var displayText = '';
  var $filterText = $('#languageFilter-text');

  $filterText.empty();
  $('#language-types input').each(function () {
    if ($(this).is(':checked')) {
      ++i;
      if (i === 1) {
        displayText = $(this).parent().text();
      }
    }
  });
  if (i &gt; 1) {
    i -= 1;
    displayText = displayText + ' + ' + i + ' ' + Granite.I18n.get('More');
  }
  if (displayText === '') {
    displayText = Granite.I18n.get('All Languages');
  }

  $filterText.html(displayText);
};

FUSION.SearchPageRender.prototype._getTagChkboxList = function () {
  var tagList = [];

  $('#tagDropbox input:checkbox:checked').each(function (index) {
    tagList.push({
      id: $(this).val(),
      label: $(this).parent().text(),
    });
  });

  if (tagList.length &gt; 0) {
    tagList.sort(function (a, b) {
      return a.label.localeCompare(b.label);
    });
  }
  return tagList;
};

FUSION.SearchPageRender.prototype._renderFilterByText = function (count) {
  var searchPageRender = this;

  var $filterText4 = $('#tagfilter-text');
  var $filterSelect = $('#tagFilter');
  var tagList = searchPageRender._getTagChkboxList();
  var displayText = '';
  var i = 0;

  // find num of checked items
  if (tagList.length &gt; count) {
    i = tagList.length - 1;
    displayText = tagList[0].label;
    if (tagList.length &gt; 1) {
      displayText += ' + ' + i + ' ' + Granite.I18n.get('More');
    }

    if (!jQuery.isEmptyObject(this._respTags)) {
      $filterSelect.css('pointer-events', 'auto');
    }
  } else {
    // add tag button
    if (jQuery.isEmptyObject(this._respTags)) {
      displayText = Granite.I18n.get('No filters available');
      $filterSelect.css('pointer-events', 'none');
    } else {
      displayText = Granite.I18n.get('Select Filters');
      $filterSelect.css('pointer-events', 'auto');
    }
  }
  $filterText4.empty();
  $filterText4.html(displayText);
};

FUSION.SearchPageRender.prototype.renderTagButtons = function () {
  var searchPageRender = this;

  var tagList = searchPageRender._getTagChkboxList();

  searchPageRender._$filterTag.empty();
  searchPageRender._$filterTag.css('display', 'none');

  if ($(window).width() &lt;= 768) {
    // text only
    searchPageRender._renderFilterByText(0);
  } else {
    // button + text
    if (tagList.length &lt;= searchPageRender._maxTagButton &amp;&amp; tagList.length &gt; 0) {
      $.each(tagList, function (key, value) {
        var text = value.label;
        var val = value.id;
        var tagContent = '&lt;span class="tag label tag-label-info" id="' + val + '"&gt;';

        tagContent += '&lt;span&gt;' + text + '&lt;/span&gt;';
        tagContent += '&lt;a&gt;&lt;i class="remove glyphicon glyphicon-remove-sign glyphicon-white"&gt;&lt;/i&gt;&lt;/a&gt;';
        tagContent += '&lt;/span&gt;';
        searchPageRender._$filterTag.append(tagContent);
      });
      searchPageRender._$filterTag.css('display', 'inline-table');
    }
    searchPageRender._renderFilterByText(searchPageRender._maxTagButton);
  }
};

FUSION.SearchPageRender.prototype._renderFilterText = function (selectId) {
  var searchPageRender = this;

  if (selectId === 1) {
    searchPageRender._renderSortByFilterText();
  } else if (selectId === 2) {
    searchPageRender._renderLanguageFilterText();
  } else if (selectId === 3) {
    searchPageRender._renderContentFilterText();
  } else if (selectId === 4) {
    searchPageRender.renderTagButtons();
  }
};

FUSION.SearchPageRender.prototype.closeAllDropdown = function (val) {
  var searchPageRender = this;

  // close all dropdown box
  if (val !== 1) {
    searchPageRender._$sortType.css('display', 'none');
  }
  if (val !== 2) {
    searchPageRender._$langageType.css('display', 'none');
  }
  if (val !== 3) {
    searchPageRender._$searchType.css('display', 'none');
  }
  if (val !== 4) {
    searchPageRender._$tagDropBox.modal('hide');
  }
};

FUSION.SearchPageRender.prototype._handleToggle = function ($elem, val, bShow, isRefresh) {
  var searchPageRender = this;

  if (val !== 4) {
    searchPageRender.closeAllDropdown(val);
    searchPageRender._renderFilterText(val);
    $elem.toggle();
  } else if (bShow) {
    searchPageRender.closeAllDropdown(val);
  } else {
    searchPageRender._renderFilterText(val);
  }
  if (isRefresh &amp;&amp; ((val !== 4 &amp;&amp; $elem.css('display') === 'none') || (val === 4 &amp;&amp; bShow === false))) {
    // Function call after 1000 milliseconds
    searchPageRender._timeout = setTimeout(function () {
      searchPageRender._searchResultCallBack('0');
    }, 1000);
  }
};

FUSION.SearchPageRender.prototype._selectButtonClickEvent = function () {
  var searchPageRender = this;

  // Sort By
  $('#sortFilter')
    .off('click')
    .on('click', function () {
      searchPageRender._handleToggle(searchPageRender._$sortType, 1, false, false);
    });

  // Language
  $('#languageFilter')
    .off('click')
    .on('click', function () {
      searchPageRender._handleToggle(searchPageRender._$langageType, 2, false, false);
    });

  $('#applyLang')
    .off('click')
    .on('click', function () {
      searchPageRender._handleToggle(searchPageRender._$langageType, 2, false, true);
    });

  // Content
  $('#typeFilter')
    .off('click')
    .on('click', function () {
      searchPageRender._handleToggle(searchPageRender._$searchType, 3, false, false);
    });

  // for Tag filter - model window
  searchPageRender._$tagDropBox.on('shown.bs.modal', function () {
    var twidth = searchPageRender._$searchFilter.width();

    searchPageRender._handleToggle(searchPageRender._$tagDropBox, 4, true, false);
    $(this)
      .find('.modal-dialog')
      .css({
        width: twidth + 'px',
        height: 'auto',
        'max-height': '100%',
      });
  });

  searchPageRender._$tagDropBox.on('hidden.bs.modal', function () {
    searchPageRender._handleToggle(searchPageRender._$tagDropBox, 4, false, searchPageRender._refresh);
  });

  $('#tagFilter')
    .off('click')
    .on('click', function () {
      searchPageRender._refresh = false;
      $('#tagDropbox').modal('toggle');
    });

  $('#applyTag')
    .off('click')
    .on('click', function () {
      searchPageRender._refresh = true;
      searchPageRender._$tagDropBox.modal('hide');
    });

  $('#clearFilter')
    .off('click')
    .on('click', function () {
      $('.filterTag').empty();
      $('#tagfilter-text').empty().html(Granite.I18n.get('Select Filters'));
      searchPageRender.closeAllDropdown(0);
      searchPageRender._searchPageModal.setNewSearch(true);
      searchPageRender._searchResultCallBack('0');
    });

  $('#sort-types a').click(function (e) {
    e.stopImmediatePropagation();
    searchPageRender.closeAllDropdown(0);
    searchPageRender._searchResultCallBack('0');
  });

  $('#search-types a').click(function (e) {
    e.stopImmediatePropagation();
    searchPageRender._searchResultCallBack('0');
    searchPageRender.closeAllDropdown(0);
  });
};

FUSION.SearchPageRender.prototype._translateLanguages = function (searchList) {
  for (var index = 0; index &lt; searchList.length; index++) {
    if (searchList[index].language !== undefined) {
      searchList[index].language = Granite.I18n.get(searchList[index].language);
    }
  }
  return searchList;
};

FUSION.SearchPageRender.prototype.resizeFilterColumn = function () {
  var searchPageRender = this;
  var cwidth =
    searchPageRender._$searchFilter.width() - $('.mcol-1').width() - $('.mcol-2').width() - $('.mcol-3').width() - 5;
  if ($(window).width() &lt; 769) {
    cwidth = searchPageRender._$searchFilter.width() - 5;
  } else if ($(window).width() &lt; 992) {
    cwidth = $('.mcol-2').width() - 5;
  }
  $('.mcol-4').css('width', cwidth + 'px');
};

FUSION.SearchPageRender.prototype.setRespTags = function (respTags) {
  this._respTags = respTags;
};

FUSION.SearchPageRender.prototype.setRefresh = function (refresh) {
  this._refresh = refresh;
};

FUSION.SearchPageRender.prototype.renderFilter = function (data, orgTagList, isBacked) {
  var searchPageRender = this;

  var lsize = 0; // num of row
  var tblheader = '';
  var content = '';
  var i = 0;
  var langTagExist = false;
  var numOfColn = 0;
  var sortTags = {};

  if (searchPageRender._searchPageModal.isNewSearch()) {
    searchPageRender._initDropBox(isBacked);
  }

  searchPageRender._renderSortByFilterText();
  searchPageRender._renderContentFilterText();

  $.each(data.tags, function (key, value) {
    var tagDetails = value;
    var keyList = key.split(',');
    if (keyList[0] === 'fusion:language') {
      langTagExist = true;
      if (searchPageRender._searchPageModal.isNewSearch()) {
        // build select table for language checkbox
        searchPageRender._$langageType.empty();
        content = _buildLanguageTable(tagDetails, data.locale);
        searchPageRender._$langageType.append(content);
      } else {
        _setSelectedTags('#language-types input', orgTagList);
      }

      if (isBacked) {
        _setSelectedTags('#language-types input', orgTagList);
      }
      searchPageRender._renderLanguageFilterText();
    } else {
      // find the max row
      if (value.length &gt; lsize) {
        lsize = value.length;
      }
    }
  });

  // no language tag found
  if (!langTagExist) {
    if (searchPageRender._searchPageModal.isNewSearch()) {
      searchPageRender._$langageType.empty();
      content = _buildLanguageTable(null, data.locale);
      searchPageRender._$langageType.append(content);
    } else {
      $('#language-types input').each(function () {
        $(this).checked = false;
      });
    }
    searchPageRender._renderLanguageFilterText();
  }

  // If there is a keyword search that returns no tags, hide the tag list from previous search
  if (jQuery.isEmptyObject(data.tags)) {
    $('#tagFilter').off('click');
  }

  if (lsize &gt; 0) {
    if (searchPageRender._searchPageModal.isNewSearch()) {
      // build select table for tag checkbox
      var tagFilterTable = $('#tag-select-table');
      tagFilterTable.empty();
      numOfColn = 0;
      sortTags = _sortByTagIdKey(data.tags);
      var widthPercent = 0;
      $.each(sortTags, function (key, value) {
        var keyList = key.split(',');
        var tableId = keyList[0].split(':')[1];
        widthPercent = (1 / (Object.keys(sortTags).length - 1)) * 100;
        if (keyList[0] === 'fusion:language') {
          return;
        }
        if (value.length &gt; 0) {
          // create header
          var checkedVal = '';
          tblheader +=
            '&lt;table id=' + tableId + " style='width:" + widthPercent + "%'" + "class ='table'" + '&gt;&lt;thead&gt;&lt;tr&gt;';
          tblheader += '&lt;th&gt;' + keyList[1] + '&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;';
          for (var j = 0; j &lt; value.length; j++) {
            tblheader += '&lt;tr&gt;&lt;td&gt;';
            if (includeTag(orgTagList, value[i].path)) {
              checkedVal = 'checked';
            }
            tblheader +=
              '&lt;label&gt;&lt;input type="checkbox" value="' +
              value[j].path +
              ' "' +
              checkedVal +
              '&gt;' +
              value[j].displayTitle +
              '&lt;/label&gt;';
            tblheader += '&lt;/td&gt;&lt;/tr&gt;';
          }
          tblheader += '&lt;/tbody&gt;&lt;/table&gt;';
          ++numOfColn;
        }
      });

      // apply button
      tblheader += '&lt;th&gt;';
      tblheader += '&lt;span class="apply-rbtn-filters"&gt;';
      tblheader += '&lt;button class="applyBtn" id="applyTag"&gt;' + Granite.I18n.get('Apply') + '&lt;/button&gt;';
      tblheader += '&lt;/span&gt;';
      tblheader += '&lt;/th&gt;';

      tagFilterTable.append(tblheader);
    } else {
      _setSelectedTags('#tagDropbox input', orgTagList);
    }
    // build tag buttons
    searchPageRender.renderTagButtons();
  }
  searchPageRender.resizeFilterColumn();
  searchPageRender._selectButtonClickEvent();
};

FUSION.SearchPageRender.prototype.emptyAndHideSearchSection = function () {
  this._searchPagePaginationRender.emptyAndHideSearchSection();
  this._searchPageLazyLoadingRender.emptyAndHideSearchSection();
};

FUSION.SearchPageRender.prototype.renderResultPage = function (data, startPage) {
  var searchPageRender = this;

  if (searchPageRender._resultRendering === 'lazyLoading') {
    searchPageRender._searchPageLazyLoadingRender.renderResultPage(data, startPage);
  } else {
    searchPageRender._searchPagePaginationRender.renderResultPage(data, startPage);
  }
};

FUSION.SearchPageRender.prototype.renderTagFilterText = function (resp) {
  var searchPageRender = this;
  var displayText;
  var $filterText4 = $('#tagfilter-text');
  var $filterSelect = $('#tagFilter');

  if (
    jQuery.isEmptyObject(resp.data.tags) ||
    (searchPageRender._searchPageModal.getSearchObject().isReturnSearch &amp;&amp; !resp.data.hasTags)
  ) {
    displayText = Granite.I18n.get('No filters available');
    $filterSelect.css('pointer-events', 'none');
    searchPageRender._$filterTag.empty();
  } else if (searchPageRender._searchPageModal.getSearchObject().tag.length &lt; 3 &amp;&amp; $(window).width() &gt;= 768) {
    // If there isn't enough tags to cause a collapse, we need to change display text, otherwise leave it.
    displayText = Granite.I18n.get('Select Filters');
    $filterSelect.css('pointer-events', 'auto');
  }
  $filterText4.html(displayText);
};

FUSION.SearchPageRender.prototype.renderSearchResult = function (resp) {
  var searchPageRender = this;

  searchPageRender.setRespTags(resp.data.tags);
  searchPageRender.renderResultPage(resp.data, searchPageRender._searchPageModal.getSearchObject().page);
  searchPageRender.renderFilter(
    resp.data,
    searchPageRender._searchPageModal
      .getSearchObject()
      .langTag.concat(searchPageRender._searchPageModal.getSearchObject().tag),
    searchPageRender._searchPageModal.getSearchObject().isReturnSearch
  );
  searchPageRender.renderTagFilterText(resp);
};

FUSION.SearchPageRender.prototype.init = function () {
  var searchPageRender = this;

  searchPageRender._resultTextInput.focusout(function () {
    var searchText;
    var suggestion = $('.tt-suggestion');

    suggestion.click(function () {
      searchText = $(this).text().replace(/^\s+/g, '');
      searchPageRender._resultTextInput.val(searchText);
      searchPageRender._searchResultCallBack('0');
    });

  });

  searchPageRender._resultTextInput.keyup(function () {
    if (event.keyCode === 13) {
      searchPageRender._$searchButton.click();
    }
  });

  searchPageRender._$searchButton.click(function () {
    // big search button was clicked
    searchPageRender._searchPageModal.setNewSearch(true);
    searchPageRender._searchResultCallBack('0');
  });
};

var FUSION = window.FUSION || {};

FUSION.SearchPagePaginationRender = function(pageLimit, searchResultCallBack) {
  this._pageLimit = pageLimit;
  this._searchResultCallBack = searchResultCallBack;

  this._$parent = $(".page-content");

  this._$loadingImage = $("#loadingSpinner");
  this._$searchSection = this._$parent.find(".resultSection-placeholder");
  this._$searchSectionTpl = this._$parent.find("#result-searchsection-tpl");

  this._searchSectionTemplate = Handlebars.compile(
    this._$searchSectionTpl.html()
  );
};

FUSION.SearchPagePaginationRender.prototype._translateLanguages = function(
  searchList
) {
  for (var index = 0; index &lt; searchList.length; index++) {
    if (searchList[index].language !== undefined) {
      searchList[index].language = Granite.I18n.get(searchList[index].language);
    }
  }
  return searchList;
};

FUSION.SearchPagePaginationRender.prototype.emptyAndHideSearchSection = function() {
  this._$searchSection.empty();
  this._$searchSection.hide();
};

FUSION.SearchPagePaginationRender.prototype.renderResultPage = function(
  data,
  start
) {
  var searchPagePaginationRender = this;

  var count = Math.ceil(
    Number(data.counter) / Number(searchPagePaginationRender._pageLimit)
  );
  var select = start;
  var result = Number(data.counter);
  var options = { year: "numeric", month: "numeric", day: "numeric" };

  if (count !== Number(select)) {
    result = Number(searchPagePaginationRender._pageLimit) * Number(select);
  }

  if (start &gt; 7) {
    start -= 7;
  } else {
    start = 1;
  }

  for (var i = 0; i &lt; data.searchList.length; i++) {
    var date = new Date(moment(data.searchList[i].date, "MM/DD/YYYY"));
    var browserLang =
      window.navigator.userLanguage || window.navigator.language;
    data.searchList[i].date = date.toLocaleDateString(browserLang, options);
  }

  data.pagination = {
    start: start,
    select: select,
    end: count,
    result: result
  };

  Granite.I18n.setLocale(data.locale);
  data.searchList = searchPagePaginationRender._translateLanguages(
    data.searchList
  );
  searchPagePaginationRender._$searchSection.html(
    searchPagePaginationRender._searchSectionTemplate(data)
  );

  searchPagePaginationRender._$loadingImage.hide();
  searchPagePaginationRender._$searchSection.show();
  searchPagePaginationRender._paginationClickEvent();
};

FUSION.SearchPagePaginationRender.prototype._initPagButton = function(numeric) {
  var searchPagePaginationRender = this;

  searchPagePaginationRender._$loadingImage.show();
  searchPagePaginationRender.emptyAndHideSearchSection();

  var value = Number(numeric) * Number(searchPagePaginationRender._pageLimit);
  searchPagePaginationRender._searchResultCallBack(value.toString());
};

FUSION.SearchPagePaginationRender.prototype._paginationClickEvent = function() {
  var searchPagePaginationRender = this;

  var pagButton = $(".pagination-button");
  var pagNextButton = $("#pagination-pButton");
  var pagPrevButton = $("#pagination-nButton");
  var pagSelected = $("#pagination-selected");

  pagButton.click(function(event) {
    searchPagePaginationRender._initPagButton($(this).text() - 1);
    event.stopPropagation();
  });

  pagNextButton.click(function(event) {
    searchPagePaginationRender._initPagButton(pagSelected.text() - 2);
    event.stopPropagation();
  });

  pagPrevButton.click(function(event) {
    searchPagePaginationRender._initPagButton(pagSelected.text());
    event.stopPropagation();
  });
};

var FUSION = window.FUSION || {};

FUSION.SearchPageLazyLoadingRender = function(pageLimit, searchResultCallBack) {
  this._pageLimit = pageLimit;
  this._searchResultCallBack = searchResultCallBack;

  this._$loadingImage = $("#loadingSpinner");
  this._$parent = $(".page-content");
  this._$searchSection = this._$parent.find(".resultSection-placeholder");
  this._$searchSectionTpl = this._$parent.find(
    "#lazyloading-result-searchsection-tpl"
  );
  this._$searchSectionItemTpl = this._$parent.find(
    "#lazyloading-result-searchsection-item-tpl"
  );

  this._searchSectionTemplate = Handlebars.compile(
    this._$searchSectionTpl.html()
  );

  this._searchSectionItemTemplate = Handlebars.compile(
    this._$searchSectionItemTpl.html()
  );
};

FUSION.SearchPageLazyLoadingRender.prototype._translateLanguages = function(
  searchList
) {
  for (var index = 0; index &lt; searchList.length; index++) {
    if (searchList[index].language !== undefined) {
      searchList[index].language = Granite.I18n.get(searchList[index].language);
    }
  }
  return searchList;
};

FUSION.SearchPageLazyLoadingRender.prototype.emptyAndHideSearchSection = function() {
  this._$searchSection.empty();
  this._$searchSection.hide();
};

FUSION.SearchPageLazyLoadingRender.prototype.renderResultPage = function(
  data,
  startPage
) {
  var searchPageLazyLoadingRender = this;

  if (startPage === 1) {
    searchPageLazyLoadingRender.renderResultPageFirstLoad(data, startPage);
  } else {
    searchPageLazyLoadingRender.renderResultPageLoadMore(data, startPage);
  }
};

FUSION.SearchPageLazyLoadingRender.prototype.renderResultPageFirstLoad = function(
  data,
  startPage
) {
  var searchPageLazyLoadingRender = this;

  searchPageLazyLoadingRender._processSearchDate(data, startPage);

  searchPageLazyLoadingRender._$searchSection.empty();
  searchPageLazyLoadingRender._$searchSection.html(
    searchPageLazyLoadingRender._searchSectionTemplate(data)
  );
  searchPageLazyLoadingRender._$loadMoreLink = searchPageLazyLoadingRender._$searchSection.find(
    "#loadMore"
  );
  searchPageLazyLoadingRender._$visibleCount = searchPageLazyLoadingRender._$searchSection.find(
    "#visible-count"
  );

  searchPageLazyLoadingRender._addSearchListIntoPlaceHolder(data.searchList);

  searchPageLazyLoadingRender._updateCountAndOffset(data.lazyLoadingData);

  searchPageLazyLoadingRender._bindLoadMoreClickEvent();

  searchPageLazyLoadingRender._$loadingImage.hide();

  searchPageLazyLoadingRender._$searchSection.show();
  searchPageLazyLoadingRender._displayHiddenItemsSlowly();

  if (!data.searchList || data.searchList.length &lt;= 0) {
    searchPageLazyLoadingRender._$loadMoreLink.fadeOut("slow");
  }
};

FUSION.SearchPageLazyLoadingRender.prototype.renderResultPageLoadMore = function(
  data,
  startPage
) {
  var searchPageLazyLoadingRender = this;

  searchPageLazyLoadingRender._processSearchDate(data, startPage);

  searchPageLazyLoadingRender._addSearchListIntoPlaceHolder(data.searchList);

  searchPageLazyLoadingRender._updateCountAndOffset(data.lazyLoadingData);

  searchPageLazyLoadingRender._displayHiddenItemsSlowly();
};

FUSION.SearchPageLazyLoadingRender.prototype._displayHiddenItemsSlowly = function() {
  this._$searchSection
    .find(".list-detail-item")
    .filter(":hidden")
    .slideDown();
};

FUSION.SearchPageLazyLoadingRender.prototype._addSearchListIntoPlaceHolder = function(
  searchList
) {
  var searchPageLazyLoadingRender = this;

  var $searchListResultPlaceHolder = searchPageLazyLoadingRender._$searchSection.find(
    ".search-list-result-placeholder"
  );
  $searchListResultPlaceHolder.append(
    searchPageLazyLoadingRender._getSearchResultHtml(searchList)
  );
};

FUSION.SearchPageLazyLoadingRender.prototype._updateCountAndOffset = function(
  lazyLoadingData
) {
  var searchPageLazyLoadingRender = this;

  searchPageLazyLoadingRender._$visibleCount.html(lazyLoadingData.count);
  if (lazyLoadingData.offset === 0) {
    searchPageLazyLoadingRender._$loadMoreLink.fadeOut("slow");
  } else {
    searchPageLazyLoadingRender._$loadMoreLink.show();
    searchPageLazyLoadingRender._$loadMoreLink.attr(
      "data-offset",
      lazyLoadingData.offset
    );
  }
};

FUSION.SearchPageLazyLoadingRender.prototype._processSearchDate = function(
  data,
  startPage
) {
  var searchPageLazyLoadingRender = this;

  var options = { year: "numeric", month: "numeric", day: "numeric" };
  for (var i = 0; i &lt; data.searchList.length; i++) {
    var date = new Date(moment(data.searchList[i].date, "MM/DD/YYYY"));
    var browserLang =
      window.navigator.userLanguage || window.navigator.language;
    data.searchList[i].date = date.toLocaleDateString(browserLang, options);
  }
  Granite.I18n.setLocale(data.locale);
  data.searchList = searchPageLazyLoadingRender._translateLanguages(
    data.searchList
  );
  data.lazyLoadingData = searchPageLazyLoadingRender._getLazyLoadingData(
    data,
    startPage
  );
};

FUSION.SearchPageLazyLoadingRender.prototype._getLazyLoadingData = function(
  data,
  startPage
) {
  var searchPageLazyLoadingRender = this;
  var visibleCount = data.searchList.length;
  var offset = 0;

  var startPageNumber = Number(startPage);

  if (startPageNumber &gt; 1) {
    visibleCount +=
      (startPageNumber - 1) * Number(searchPageLazyLoadingRender._pageLimit);
  }

  var totalPages = Math.ceil(
    Number(data.counter) / Number(searchPageLazyLoadingRender._pageLimit)
  );

  if (totalPages !== Number(startPage)) {
    offset = Number(searchPageLazyLoadingRender._pageLimit) * Number(startPage);
  }

  return {
    count: visibleCount,
    offset: offset
  };
};

FUSION.SearchPageLazyLoadingRender.prototype._getSearchResultHtml = function(
  searchList
) {
  var searchPageLazyLoadingRender = this;
  var resultHTML = "";

  searchList.forEach(function(searchListItem) {
    var searchListItemHtml = searchPageLazyLoadingRender._searchSectionItemTemplate(
      searchListItem
    );
    resultHTML += searchListItemHtml;
  });

  return resultHTML;
};

FUSION.SearchPageLazyLoadingRender.prototype._bindLoadMoreClickEvent = function() {
  var searchPageLazyLoadingRender = this;

  searchPageLazyLoadingRender._$loadMoreLink.click(function(event) {
    event.preventDefault();
    searchPageLazyLoadingRender._searchResultCallBack(
      this.dataset.offset.toString()
    );
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

var getParentByClassRecursive = function (el, className) {
  if (el !== null) {
    if (el.classList.contains(className)) {
      return el;
    }
    return getParentByClassRecursive(el.parentElement, className);
  }
  return null;
};

var track = function (el) {
  var analyze = getParentByClassRecursive(el, 'analyze');
  if (analyze != null) {
    var destination = el.dataset.destination ? el.dataset.destination : analyze.dataset.path;
    var A = FUSION.ANALYTICS;
    new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.SEARCH_MENU)
      .putEventData(A.KEYS.TITLE, analyze.dataset.title, true)
      .putEventData(A.KEYS.PRINCIPAL_ASSET, analyze.dataset.path, true)
      .putEventData(A.KEYS.IS_GATED, analyze.dataset.gated, true)
      .putEventData(A.KEYS.LANGUAGE, analyze.dataset.language, true)
      .putEventData(A.KEYS.DESTINATION_LINK, destination, true)
      .setEvent(A.EV.CLICK.SEARCH)
      .track();
  }
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars Granite _initSearchResult */
/* jslint regexp: false */
FUSION.SearchResult = function(pageLimit, currentPage) {
  // Get the input box
  var ajax = new FUSION.Ajax();
  var resultTextInput = $("#search-term");
  var _$parent = $(".page-content");
  var searchButton = $("#search-result-button");
  var $searchBar = _$parent.find(".resultBar-placeholder");
  var $searchBarTpl = _$parent.find("#result-searchbar-tpl");
  var searchTemplate = Handlebars.compile($searchBarTpl.html());
  var $searchSection = _$parent.find(".resultSection-placeholder");
  var $searchSectionTpl = _$parent.find("#result-searchsection-tpl");
  var searchSectionTemplate = Handlebars.compile($searchSectionTpl.html());
  var $loadingImage = $("#loadingSpinner");
  var timeout = null;
  var $resultCounter = $(".result-count");
  var $sortType = $("#sort-types");
  var $resultTag = _$parent.find(".resultTag-placeholder");
  var $searchType = $("#search-types");
  var $resultTagTpl = _$parent.find("#result-tag-tpl");
  var resultTagTemplate = Handlebars.compile($resultTagTpl.html());
  var _pageLimit = pageLimit;
  var regexFormat = /[!@#$%&amp;*()_+\-=\[\]{};':"\\|,.&lt;&gt;\/?]+/;
  var CONST = {
    searchBarUrl: "/bin/fusion/search/bar?currentPage=" + currentPage,
    searchResultUrl: "/bin/fusion/search/result?currentPage=" + currentPage
  };
  // Function to call ajax with given url
  var _getSearchBar = function(value) {
    return ajax.fetchData({ fulltext: value }, CONST.searchBarUrl);
  };
  var _getSearchResult = function(value, offset, sort, select, tagList) {
    $loadingImage.show();
    return ajax.fetchData(
      {
        fulltext: value,
        offset: offset,
        limit: _pageLimit,
        sort: sort,
        select: select,
        tag: tagList
      },
      CONST.searchResultUrl
    );
  };
  var _renderResultBar = function(data) {
    $searchBar.empty();
    $searchBar.html(searchTemplate(data));
    $searchBar.show();
  };
  var _initPagButton = function(numeric) {
    var value = Number(numeric) * Number(_pageLimit);
    _initSearchResult(value.toString());
  };
  var _paginationClickEvent = function() {
    var pagButton = $(".pagination-button");
    var pagNextButton = $("#pagination-pButton");
    var pagPrevButton = $("#pagination-nButton");
    var pagSelected = $("#pagination-selected");

    pagButton.click(function() {
      _initPagButton($(this).text() - 1);
    });

    pagNextButton.click(function() {
      _initPagButton(pagSelected.text() - 2);
    });

    pagPrevButton.click(function() {
      _initPagButton(pagSelected.text());
    });
  };
  var _renderResultPage = function(data, start) {
    var count = Math.ceil(Number(data.counter) / Number(_pageLimit));
    var select = start;

    $searchBar.empty();
    $searchSection.empty();

    if (start &gt; 7) {
      start -= 7;
    } else {
      start = 1;
    }

    data.pagination = {
      start: start,
      select: select,
      end: count
    };

    Granite.I18n.setLocale(data.locale);
    $searchSection.html(searchSectionTemplate(data));
    $resultCounter.html(data.counter + " " + Granite.I18n.get("Results"));
    resultTextInput.css("padding-right", $resultCounter.width() + 96);

    $loadingImage.hide();
    $searchSection.show();
    _paginationClickEvent();
  };
  var _searchClickEvent = function(event) {
    event.click(function() {
      var id = $(this).attr("data");
      $(this).remove();

      if (document.getElementById(id) !== null) {
        document.getElementById(id).checked = false;
      }

      clearTimeout(timeout);
      // Function call after 1000 milliseconds
      timeout = setTimeout(function() {
        _initSearchResult("0");
      }, 1000);
    });
  };
  var _selectedBoxEvent = function() {
    var searchFilter = $(".searchFilters");
    var searchTagTitle = $(".selectedTagTitle");
    var selectedTagBox = $("#selected-tag-box");

    searchFilter.change(function() {
      if (this.checked) {
        selectedTagBox.append(
          '&lt;button class="selectedTagTitle btn btn-filter-item selected-tag-' +
            $(this)
              .attr("name")
              .replace(/[^A-Z0-9]+/gi, "") +
            "\" data='" +
            $(this).val() +
            "'&gt;" +
            $(this).attr("name") +
            '&lt;i class="fa fa-times"&gt;&lt;/i&gt;&lt;/button&gt;'
        );
      } else {
        $(
          ".selected-tag-" +
            $(this)
              .attr("name")
              .replace(/[^A-Z0-9]+/gi, "")
        ).remove();
      }

      clearTimeout(timeout);
      // Function call after 1000 milliseconds
      timeout = setTimeout(function() {
        _initSearchResult("0");
      }, 1000);
    });

    _searchClickEvent(searchTagTitle);
  };
  var _renderResultTag = function(data) {
    $resultTag.empty();
    $resultTag.html(resultTagTemplate(data));
    $resultTag.show();
    _selectedBoxEvent();
  };
  var _isEmpty = function(str) {
    return (
      (!str ||
      str.length === 0 ||
      (regexFormat.test(str.charAt(0)) &amp;&amp; str.length === 1))
    );
  };
  var _hideSearchBar = function() {
    $searchBar.empty();
    $(".tt-menu").hide();
  };
  var _initSearchBar = function() {
    var searchText = resultTextInput.val().replace(/^\s+/g, "");

    if (_isEmpty(searchText)) {
      _hideSearchBar();
    } else {
      _getSearchBar(searchText).then(function(resp) {
        if (Object.keys(resp.data.SearchList).length === 0) {
          _hideSearchBar();
        } else if (
          resp &amp;&amp;
          resp.success &amp;&amp;
          resp.data &amp;&amp;
          Object.keys(resp.data.SearchList).length &gt; 0
        ) {
          $(".tt-menu").show();
          _renderResultBar(resp.data);
        }
      });
    }
  };
  var _accoridonEffect = function() {
    $(".accordion-title").map(function() {
      var contentSelector = $(this)
        .parent()
        .parent()
        .find("div.accordion-content");
      var iconSelector = $(this)
        .parent()
        .find(".accordion-icon-two");

      $(this).click(function() {
        if (contentSelector.hasClass("hideaccordiancontent")) {
          contentSelector
            .addClass("showaccordiancontent")
            .removeClass("hideaccordiancontent");
          iconSelector
            .addClass("glyphicon-chevron-down")
            .removeClass("glyphicon-chevron-right ");
        } else {
          contentSelector
            .removeClass("showaccordiancontent")
            .addClass("hideaccordiancontent");
          iconSelector
            .addClass("glyphicon-chevron-right")
            .removeClass("glyphicon-chevron-down ");
        }
      });
    });
  };
  var _removeTags = function() {
    $(".selectedTagTitle").remove();
    $(".selectedTextTitle").remove();
  };
  var _getTextList = function(selectedText) {
    var textList = [];

    selectedText.each(function() {
      textList.push($(this).attr("data"));
    });
    return textList;
  };
  var _initSearchResult = function(offset) {
    var page = Math.ceil((Number(offset) + 1) / _pageLimit);
    var tagList = _getTextList($(".selectedTagTitle"));
    var selectedText = $(".selectedTextTitle");
    var sort = $sortType.find(".active").attr("value");
    var select = $searchType.find(".active").attr("value");
    var fulltext = selectedText.attr("data");
    var encodedFullText = "";

    if (fulltext) {
      _searchClickEvent(selectedText);
      encodedFullText = encodeURIComponent(selectedText.attr("data"));
    }

    $searchSection.empty();
    $searchSection.hide();
    $resultTag.empty();
    $resultTag.hide();
    _getSearchResult(encodedFullText, offset, sort, select, tagList).then(
      function(resp) {
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
          _hideSearchBar();
          _renderResultPage(resp.data, page);
          _renderResultTag(resp.data);
          _accoridonEffect();
        }
      }
    );
  };
  var _sortClickEvent = function(event) {
    var type = event.find("a");

    type.on("click", function() {
      if ($(this).hasClass("in-active")) {
        type.removeClass("active").addClass("in-active");
        $(this)
          .removeClass("in-active")
          .addClass("active");
        _initSearchResult("0");
      }
    });
  };
  var _stripHTML = function(string) {
    return $("&lt;div&gt;")
      .html($.parseHTML(string))
      .text();
  };
  var _addSearchText = function(searchText) {
    var selectedTagBox = $("#selected-tag-box");
    if (searchText) {
      selectedTagBox.append(
        "&lt;button class='selectedTextTitle btn btn-filter-item selected-fulltext' data='" +
          _stripHTML(searchText) +
          "'&gt;" +
          _stripHTML(searchText) +
          "&lt;i class='fa fa-times'&gt;&lt;/i&gt;&lt;/button&gt;"
      );
    }
  };
  var _pageInitialize = function() {
    var hostURL = window.location.search.substring(1);
    var pair = hostURL.split("=");
    var searchText;

    _sortClickEvent($sortType);
    _sortClickEvent($searchType);

    if (
      typeof pair[0] !== "undefined" &amp;&amp;
      typeof pair[1] !== "undefined" &amp;&amp;
      pair[0] === "q" &amp;&amp;
      pair[1] !== ""
    ) {
      searchText = decodeURI(pair[1])
        .replace(new RegExp("\\+", "g"), " ")
        .replace(/^\s+/g, "");
      _removeTags();

      _addSearchText(searchText);
    }
    _initSearchResult("0");
  };

  resultTextInput.focusin(function() {
    _initSearchBar();
  });

  resultTextInput.focusout(function() {
    var searchText;
    var suggestion = $(".tt-suggestion");

    suggestion.click(function() {
      searchText = $(this)
        .val()
        .replace(/^\s+/g, "");
      resultTextInput.val("");
      _removeTags();
      _addSearchText(searchText);
      _initSearchResult("0");
    });

    clearTimeout(timeout);
    // Function call after 500 milliseconds
    timeout = setTimeout(function() {
      _hideSearchBar();
    }, 100);
  });

  resultTextInput.keyup(function() {
    if (event.keyCode === 13) {
      clearTimeout(timeout);
      searchButton.click();
    } else {
      clearTimeout(timeout);
      // Function call after 300 milliseconds
      timeout = setTimeout(function() {
        _initSearchBar();
      }, 300);
    }
  });

  searchButton.click(function() {
    var searchText = resultTextInput.val().replace(/^\s+/g, "");
    resultTextInput.val("");
    _removeTags();
    _addSearchText(searchText);
    _hideSearchBar();
    _initSearchResult("0");
  });

  $("#reset-filters").click(function() {
    _initSearchResult("0");
  });

  _pageInitialize();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.trackDashboardPromotion = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.DASHBOARD_PROMOTION).track();
};



;(function ($, window, document) {

    $.fn.clickTap = function (params) {

        this.each(function () {

            var clickItem = false;

            $(this).on('click', function (e) {
                var item = $(this);
                if (item[0] !== clickItem[0]) {
                    e.preventDefault();
                    clickItem = item;
                }
            });

            $(document).on('click touchstart MSPointerDown', function (e) {
                var reset = true,
                    parents = $(e.target).parents(),
                    i;

                for (i = 0; i &lt; parents.length; i++) {
                    if (parents[i] === clickItem[0]) {
                        reset = false;
                    }
                }


                if (reset) {
                    clickItem = false;
                }
            });
        });

        return this;

    };

}(jQuery, window, document));


(function ($) {

    $.fn.hoverIntent = function (timeInterval, handlerIn, handlerOut, selector) {

        // default configuration values
        var cfg = {
                interval: 80,
                sensitivity: 6,
                timeout: 0
            },
            // instantiate variables
            // cX, cY = current X and Y position of mouse, updated by mousemove event
            // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
            cX, cY, pX, pY;

        cfg.interval = timeInterval;

        if (typeof handlerIn === "object") {
            cfg = $.extend(cfg, handlerIn);
        } else if ($.isFunction(handlerOut)) {
            cfg = $.extend(cfg, {over: handlerIn, out: handlerOut, selector: selector});
        } else {
            cfg = $.extend(cfg, {over: handlerIn, out: handlerIn, selector: handlerOut});
        }

        // A private function for getting mouse position
        function track(ev) {
            cX = ev.pageX;
            cY = ev.pageY;
        }

        // A private function for comparing current and previous mouse position
        function compare(ev, ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            // compare mouse positions to see if they've crossed the threshold
            if (Math.sqrt((pX - cX) * (pX - cX) + (pY - cY) * (pY - cY)) &lt; cfg.sensitivity) {
                $(ob).off("mousemove.hoverIntent", track);
                // set hoverIntent state to true (so mouseOut can be called)
                ob.hoverIntent_s = true;
                return cfg.over.apply(ob, [ev]);
            } else {
                // set previous coordinates for next time
                pX = cX;
                pY = cY;
                // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
                ob.hoverIntent_t = setTimeout(function () {
                    compare(ev, ob);
                }, cfg.interval);
            }
        }

        // A private function for delaying the mouseOut function
        function delay(ev, ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            ob.hoverIntent_s = false;
            return cfg.out.apply(ob, [ev]);
        }

        // A private function for handling mouse 'hovering'
        function handleHover(e) {

            // copy objects to be passed into t (required for event object to be passed in IE)
            var ev = $.extend({}, e),
                ob = this;

            // cancel hoverIntent timer if it exists
            if (ob.hoverIntent_t) {
                ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            }

            // if e.type === "mouseenter"
            if (e.type === "mouseenter") {
                // set "previous" X and Y position based on initial entry point
                pX = ev.pageX;
                pY = ev.pageY;
                // update "current" X and Y position based on mousemove
                $(ob).on("mousemove.hoverIntent", track);
                // start polling interval (self-calling timeout) to compare mouse coordinates over time
                if (!ob.hoverIntent_s) {
                    ob.hoverIntent_t = setTimeout(function () {
                        compare(ev, ob);
                    }, cfg.interval);
                }

                // else e.type == "mouseleave"
            } else {
                // unbind expensive mousemove event
                $(ob).off("mousemove.hoverIntent", track);
                // if hoverIntent state is true, then call the mouseOut function after the specified delay
                if (ob.hoverIntent_s) {
                    ob.hoverIntent_t = setTimeout(function () {
                        delay(ev, ob);
                    }, cfg.timeout);
                }
            }
        }

        // listen for mouseenter and mouseleave
        return this.on({'mouseenter.hoverIntent': handleHover, 'mouseleave.hoverIntent': handleHover}, cfg.selector);

    };
}(jQuery));
/**
 * Created by nelson on 2016-03-31.
 */
var MegaMenuNavHelper = {
    init: function (param1, param2) {
        var delayValue = param1,
            timeValue = param2,
            ROW_MARGIN = 20;

        $('div.topnav &gt; nav &gt; section &gt; ul &gt; li').each(function () {

            var $this = $(this),
                position = $this.offset(),
                wid = $this.width(),
                $singlecol = $this.find('div.fusion-mm-1col'),
                $twocols = $this.find('div.fusion-mm-2col'),
                $threecols = $this.find('div.fusion-mm-3col'),
                $fourcols = $this.find('div.fusion-mm-4col'),
                $horizontalrules = $this.find('div.horizontalrule'),
                $divContainer = $('div#container'),
                $bottomRowContents = $('div#bottomRowContents'),
                menuWidth = 200;

            if ($fourcols.length &gt; 0) {
                menuWidth = 808;
            }
            else if ($threecols.length &gt; 0) {
                menuWidth = 606;
            }
            else if ($twocols.length &gt; 0) {
                menuWidth = 404;
            }

            function setWidths(thisObj, menuWidth) {
                var $thisObj = $(thisObj),
                    $cols = $thisObj.find('div.parsys_column');
                $thisObj.css('width', menuWidth);
                $cols.each(function () {
                    $(this).css('width', menuWidth / $cols.length);
                });
            }

            $singlecol.each(function () {
                var $scope = $(this);
                setWidths($scope, menuWidth);

                // check if menu can be set to left.
                if ((position.left - $bottomRowContents.offset().left + menuWidth) &lt; ($bottomRowContents.width() + ROW_MARGIN)) {
                    $scope.css('left', 0);
                }
                // check if menu can be set to the right.
                else if ((((position.left - $bottomRowContents.offset().left) + wid) - menuWidth) &gt; 0) {
                    $scope.css('right', menuWidth - wid);
                } else if ((position.left - $bottomRowContents.offset().left + menuWidth) &gt; ($bottomRowContents.width() + ROW_MARGIN)
                    || ((position.left - $divContainer.offset().left - menuWidth - wid - ROW_MARGIN) &gt; 0)) {
                    $scope.css('left', -(position.left - $bottomRowContents.offset().left));
                }
            });

            $twocols.each(function () {
                var $scope = $(this);
                setWidths($scope, menuWidth);

                // check if menu can be set to left.
                if ((position.left - $bottomRowContents.offset().left + menuWidth) &lt; ($bottomRowContents.width() + ROW_MARGIN)) {
                    $scope.css('left', 0);
                }
                // check if menu can be set to the right.
                else if ((((position.left - $bottomRowContents.offset().left) + wid) - menuWidth) &gt; 0) {
                    $scope.css('right', menuWidth - wid);
                } else if ((position.left - $bottomRowContents.offset().left + menuWidth) &gt; ($bottomRowContents.width() + ROW_MARGIN)
                    || ((position.left - $divContainer.offset().left - menuWidth - wid - ROW_MARGIN) &gt; 0)) {
                    $scope.css('left', -(position.left - $bottomRowContents.offset().left));
                }
            });

            $threecols.each(function () {
                var $scope = $(this);
                setWidths($scope, menuWidth);

                // check if menu can be set to left.
                if ((position.left - $bottomRowContents.offset().left + menuWidth) &lt; ($bottomRowContents.width() + ROW_MARGIN)) {
                    $scope.css('left', 0);
                }
                // check if menu can be set to the right.
                else if ((((position.left - $bottomRowContents.offset().left) + wid) - menuWidth) &gt; 0) {
                    $scope.css('right', menuWidth - wid);
                } else if ((position.left - $bottomRowContents.offset().left + menuWidth) &gt; ($bottomRowContents.width() + ROW_MARGIN)
                    || ((position.left - $divContainer.offset().left - menuWidth - wid - ROW_MARGIN) &gt; 0)) {
                    $scope.css('left', -(position.left - $bottomRowContents.offset().left));
                }
            });

            $fourcols.each(function () {
                var $scope = $(this);
                setWidths($scope, menuWidth);

                // check if menu can be set to left.
                if ((position.left - $bottomRowContents.offset().left + menuWidth) &lt; ($bottomRowContents.width() + ROW_MARGIN)) {
                    $scope.css('left', 0);
                }
                // check if menu can be set to the right.
                else if ((((position.left - $bottomRowContents.offset().left) + wid) - menuWidth) &gt; 0) {
                    $scope.css('right', menuWidth - wid);
                } else if ((position.left - $bottomRowContents.offset().left + menuWidth) &gt; ($bottomRowContents.width() + ROW_MARGIN)
                    || ((position.left - $divContainer.offset().left - menuWidth - wid - ROW_MARGIN) &gt; 0)) {
                    $scope.css('left', -(position.left - $bottomRowContents.offset().left));
                }
            });

            $horizontalrules.each(function () {
                var $scope = $(this);

                // check if horizontal rule can be set to left.
                if ((position.left - $bottomRowContents.offset().left + menuWidth) &lt; ($bottomRowContents.width() + ROW_MARGIN)) {
                    $scope.css('left', 0);
                }
                // check if horizontal rule can be set to the right.
                else if ((((position.left - $bottomRowContents.offset().left) + wid) - menuWidth) &gt; 0) {
                    $scope.css('right', menuWidth - wid);
                } else if ((position.left - $bottomRowContents.offset().left + menuWidth) &gt; ($bottomRowContents.width() + ROW_MARGIN)
                    || ((position.left - $divContainer.offset().left - menuWidth - wid - ROW_MARGIN) &gt; 0)) {
                    $scope.css('left', -(position.left - $bottomRowContents.offset().left));
                }
            });

            $this.hoverIntent(timeValue,
                function () {
                    if ($singlecol) {
                        $singlecol.show(0);
                    }
                    if ($twocols) {
                        $twocols.show(0);

                    }
                    if ($threecols) {
                        $threecols.show(0);
                    }
                    if ($fourcols) {
                        $fourcols.show(0);
                    }
                },
                function () {
                    if ($singlecol) {
                        $singlecol.delay(delayValue).hide(0);
                    }
                    if ($twocols) {
                        $twocols.delay(delayValue).hide(0);
                    }
                    if ($threecols) {
                        $threecols.delay(delayValue).hide(0);
                    }
                    if ($fourcols) {
                        $fourcols.delay(delayValue).hide(0);
                    }
                }
            );
        });

        $('div.MegaMenuNav div.colctrl.section').hide();
        $('div.MegaMenuNav div.new.section').hide();
    }
};
/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars */
FUSION.GlobalFooter = function(currentPage, isPub) {
  var CONST = {
    globalFooterTemplateID: "#global-footer-tpl",
    globalFooterRenderToID: "#global-footer-menu",
    globalFooterWsUrl:
      "/bin/adobe-fusion/globalfooter?currentPage=" + currentPage
  };
  var Handlebars = window.Handlebars || {};

  function _getGlobalFooterCAASURL() {
    return CONST.globalFooterWsUrl;
  }

  function stickyFooter() {
    var footer = $(".page-footer");
    var position = footer.position();
    var height = 0;

    if (isPub === "true") {
      height = $(window).height();
      height -= position.top;
      height -=
        ($("#global-footer-menu").height() +
        $("#footer-misc-wrapper").height());

      if (height &lt; 0) {
        height = 0;
      }
      footer.css({ "margin-top": height + "px" });
    }
  }

  function _loadCAASContents() {
    $.ajax({
      dataType: "json",
      url: _getGlobalFooterCAASURL()
    }).then(function(cassContents) {
      var theTemplateScript = $(CONST.globalFooterTemplateID).html();
      var theTemplate = Handlebars.compile(theTemplateScript);
      var theCompiledHtml = theTemplate(
        cassContents.data.footerNavListComponens
      );
      $(CONST.globalFooterRenderToID).html(theCompiledHtml);
      stickyFooter();
    });
  }

  function _initializeRegionModal() {
    var $regionModal = $("#regionModal");
    $("#region-link")
      .off()
      .on("click", function(e) {
        if (!$(e.target).is("i")) {
          $regionModal.modal("toggle");
        }
      });

    $(".modal-canvas")
      .off()
      .on("click", function(e) {
        $regionModal.modal("toggle");
      });
  }

  function init() {
    _initializeRegionModal();
    _loadCAASContents();
  }

  init();

  $(window).resize(function() {
    stickyFooter();
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Uint16Array */

FUSION.EventPage = function (props) {
  var $listItem = $('.eventItem-container');
  var formatDate = function (date) {
    var utcDate = moment.utc(date.trim(), 'MM/DD/YYYY HH:mm').toDate();
    return moment(utcDate).local().format('MMMM DD, YYYY HH:mm');
  };

  var _registerEventUtil = new RegisterEventUtil(props.currentPage);

  var getDateWithoutTime = function (formattedDate) {
    return formattedDate.substring(0, formattedDate.length - 5);
  };

  var isSameDay = function (dateList) {
    return getDateWithoutTime(dateList[0]) === getDateWithoutTime(dateList[1]);
  };

  var getTime = function (formattedDate) {
    return formattedDate.substring(formattedDate.length - 5);
  };

  var setLocalDate = function (dateList) {
    var startDate = dateList[0];

    if (dateList.length &gt; 1) {
      var endDate = dateList[1];
      if (isSameDay(dateList)) {
        var endDateTime = getTime(endDate);
        return `${startDate} - ${endDateTime} `;
      } else {
        return `${startDate} - ${endDate} `;
      }
    }
    return `${startDate} `;
  };

  var getLocalTime = function () {
    $listItem.each(function () {
      var dateObject = $(this).find('.page-on-time');
      var eventDate = dateObject.text();
      var dateList = eventDate.trim().split('|');
      dateList[0] = formatDate(dateList[0]);
      if (dateList[1] !== '') {
        dateList[1] = formatDate(dateList[1]);
      } else {
        dateList.pop();
      }
      dateObject.text(setLocalDate(dateList));
    });
  };

  var init = function () {
    getLocalTime();
    _registerEventUtil.init($listItem);
  };

  init();
};



// Global publisher/subscriber pattern
var PUB_SUB = new FUSION.PubSub();

$(function() {
  $(".modal-canvas, #close-video-preview").on("click", function() {
    var videoPreview = $("#video-preview");
    var video = videoPreview.find("video").get(0);
    video.pause();
    videoPreview.css("display", "none");
  });
  $("map area").on("click", function() {
    $(this).blur();
  });
});

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.UserAnalytics = function (props, isInternalUser, isPartnerUser, isVendorUser) {
  var TRUE = 'true';
  var VISITOR = { INTERNAL: 'Internal', VENDOR: 'Vendor', PARTNER: 'Partner', PUBLIC: 'Public' };

  var _getCleanURL = function () {
    return window.location.origin + window.location.pathname;
  };

  var _getCleanPageName = function () {
    return window.location.hostname + props.customPageName;
  };

  var _analyzePage = function () {
    // Internal and partner information being collected and sent on pageLoad.
    var A = FUSION.ANALYTICS;
    var userProfilePath = FUSION.useAlloy ? A.SET_PTS.USER.PROFILE_AEP : A.SET_PTS.USER.PROFILE;
    var analyzeUser = new FUSION.AnalyticsBuilder(userProfilePath);
    var utils = new FUSION.Properties();
    if (utils.validateStringBool(isInternalUser) === TRUE || utils.validateStringBool(isVendorUser) === TRUE) {
      analyzeUser
        .put(A.KEYS.COUNTRY_CODE, props.countryCode)
        .put(A.KEYS.ACCOUNT_TYPE, props.accountType)
        .put(A.KEYS.USER_TYPE, props.userType)
        .put(A.KEYS.DEPARTMENT, props.department)
        .put(A.KEYS.INTERNAL_USER_ID, props.internalUserId)
        .putArray(A.KEYS.REGION_CONTENT, props.regionContent);

      if (utils.validateStringBool(isInternalUser) === TRUE) {
        analyzeUser.put(A.KEYS.VISITOR_TYPE, VISITOR.INTERNAL);
      } else {
        analyzeUser.put(A.KEYS.VISITOR_TYPE, VISITOR.VENDOR);
      }
    } else if (utils.validateStringBool(isPartnerUser) === TRUE) {
      analyzeUser
        .put(A.KEYS.PARTNER_LEVEL, props.partnerLevel)
        .put(A.KEYS.PROGRAM_TYPE, props.programType)
        .put(A.KEYS.COMPANY_NAME, props.companyName)
        .put(A.KEYS.PARTNER_REGION, props.partnerRegion)
        .putArray(A.KEYS.REGION_CONTENT, props.regionContent)
        .put(A.KEYS.VISITOR_TYPE, VISITOR.PARTNER);
    } else {
      analyzeUser.put(A.KEYS.VISITOR_TYPE, VISITOR.PUBLIC);
    }

    new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.INFO)
      .put(A.KEYS.CUSTOM_PAGE_NAME, _getCleanPageName())
      .put(A.KEYS.CUSTOM_URL, _getCleanURL())
      .put(A.KEYS.GEO_REGION, props.geoRegion)
      .put(A.KEYS.LANGUAGE, props.language)
      .put(A.KEYS.SITE_SECTION, props.siteSection)
      .put(A.KEYS.TEMPLATE, props.template)
      .put(A.KEYS.TITLE, props.title);
  };

  var _init = function () {
    _analyzePage();
  };

  _init();
};

/**
 * Tabs
 * Simple tabs for your everyday needs. Requires jQuery History for hashing, otherwise this should fall back gracefully.
 * @author Remington Reed
 */
jQuery.fn.cpTabs = function(opts) {
  var conf = {
    activeClass: "active"
  };
  if (opts) {
    jQuery.extend(conf, opts);
  }

  return this.each(function() {
    var contentsSelector = "";
    var tabLinks = jQuery("a", this);
    var tabs = this;
    var contentContainer = jQuery(tabs).next();

    tabLinks.each(function() {
      var link =
        "." +
        jQuery(this)
          .attr("href")
          .replace(/^.*#/, "");
      contentsSelector += link + ", ";
    });
    if (contentsSelector.length &gt; 0) {
      contentsSelector = contentsSelector.substring(
        0,
        contentsSelector.length - 2
      );
    }

    tabLinks.click(function(e) {
      jQuery(contentsSelector, contentContainer).addClass("tab-hide");
      var url = jQuery(this)
        .attr("href")
        .replace(/^.*#/, "");
      jQuery("." + url, contentContainer).removeClass("tab-hide");
      jQuery(this)
        .parent()
        .parent()
        .find("a")
        .removeClass(conf.activeClass)
        .end()
        .end()
        .end()
        .addClass(conf.activeClass);
      if (jQuery.history != undefined) {
        jQuery.history.load(url);
      }
      jQuery(tabs).trigger("tabClicked", [e.currentTarget]);
      return false;
    });
    jQuery(contentsSelector, contentContainer).addClass("tab-hide");
    if (jQuery.history != undefined) {
      jQuery.history.init(function(hash) {
        if (hash != "") {
          jQuery('a[href="#' + hash + '"]', tabs).click();
        } else {
          jQuery("a", tabs)
            .first()
            .addClass(conf.activeClass);
          jQuery(contentsSelector, contentContainer)
            .first()
            .removeClass("tab-hide");
        }
      });
    } else {
      jQuery("a", tabs)
        .first()
        .addClass(conf.activeClass);
      jQuery(contentsSelector, contentContainer)
        .first()
        .removeClass("tab-hide");
    }
  });
};

(function($) {
  $(document).ready(function() {
    var learningTab = $(".learningPath .learning-tab");
    learningTab.cpTabs();

    // Set the widths of tabs whose widths are undefined or 0
    // This must be done before setting heights to prevent errors in the case where a
    // tab title line wraps (making the tab taller) and then removing the line wrapping.
    // With this code first, the line will return to normal when line wrap is removed

    // Sets the heights of all tabs to the size of the largest tab
    learningTab.each(function() {
      var height = 0;
      var outerHeight = 0;
      $(this)
        .find("a")
        .each(function() {
          if ($(this).height() &gt; height) {
            height = $(this).height();
            outerHeight = $(this).outerHeight() + 1;
          }
        });

      $(this).height(outerHeight);

      $(this)
        .find("a")
        .each(function() {
          $(this).height(height);
        });
    });
  });
})(jQuery);

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};
var TinyColor = window.tinycolor || {};

var conf = {
  6: {
    preAngle: 0,
    fontSize: 35,
    textCurve: "m7,72 c113,0 214,81 246,150",
    splitText: true,
    textSpanDy: "1em",
    arrowAngleMin: 100,
    arrowAngleMax: 220
  },
  7: {
    preAngle: 14,
    fontSize: 17,
    textCurve:
      "m37.66051,39.01198c37.61215,11.28474 55.73395,23.04473 85.65294,52.49983",
    splitText: false,
    textSpanDy: "0.8em",
    arrowAngleMin: 100,
    arrowAngleMax: 250
  }
};

var _getNumberOfArrow = function($circleSelector) {
  return $circleSelector.length !== 7 ? 6 : 7;
};
/**
 *
 * @type {{init}}
 */
FUSION.SalesOverview = function(arrowText, arrowTextColor, arrowAlignments) {
  var $touchpoints = $(".circle-selector");
  var arrowTitles = arrowText.split(",");
  var textAlignments = arrowAlignments.split(",");
  var _numberOfArrows = _getNumberOfArrow($touchpoints);

  var getArrowAngle = function(arrowIndex) {
    var totalArrows = $touchpoints.length;
    var angle = (2 * Math.PI) / (totalArrows);
    return (angle * arrowIndex * (180 / Math.PI) + conf[_numberOfArrows].preAngle);
  };

  var moveTouchPoint = function() {
    var degree = 0;
    var totalDeg = 360;
    var angle;
    var deg;
    var em = $(".circle-container").width() / 16 / 2;
    var arrowAngle = 0;

    angle = totalDeg / _numberOfArrows;
    deg = degree - angle;

    for (var i = _numberOfArrows - 1; i &gt;= 0; i--) {
      deg -= angle;
      var arrow = $touchpoints[i];
      arrowAngle = getArrowAngle(i);
      $(arrow).css(
        "transform",
        "rotate(" +
          (deg) +
          "deg) translate(" +
          em +
          "em) rotate(" +
          (-deg) +
          "deg) rotateZ(" +
          arrowAngle +
          "deg)"
      );
      $(arrow)
        .find(".arrow-svg")
        .attr("angle", arrowAngle);
    }
  };

  // Split the arrow titles into two parts
  var configureArrowText = function() {
    var textMap = new Map();
    for (var i = 0; i &lt; arrowTitles.length; i++) {

      var arrowTitle = arrowTitles[i];
      if (conf[_numberOfArrows].splitText) {
        var index = arrowTitle.indexOf(" ");
        var firstPart = arrowTitle.substr(0, index);
        var secondPart = arrowTitle.substr(index + 1);
        var splitWords = [firstPart, secondPart];
        if (firstPart.length === 0) {
          splitWords = [secondPart];
        }
        textMap.set(i, splitWords);
      } else {
        textMap.set(i, [arrowTitle]);
      }
    }
    return textMap;
  };

  var addTextOffset = function(offset) {
    var totalOffset = parseInt(offset) + 50;
    return totalOffset.toString() + "%";
  };

  var getDefaultOffset = function(offset) {
    return offset.length &gt; 0 ? addTextOffset(offset) : "50%";
  };

  var getTspanDy = function(index) {
    return (index === 0) ? "0" : conf[_numberOfArrows].textSpanDy;
  };

  var needArrowAngle = function(arrowAngle) {
    return (arrowAngle &gt; conf[_numberOfArrows].arrowAngleMin &amp;&amp;
      arrowAngle &lt; conf[_numberOfArrows].arrowAngleMax);
  };

  var rotateTextCurve = function() {
    var textMap = configureArrowText();
    d3.selectAll(".arrow-svg").each(function(d, i) {
      var arrowAngle = parseInt(d3.select(this).attr("angle"));
      var svgPath = conf[_numberOfArrows].textCurve;

      // For arrows on bottom half of circle, flip SVG coordinates
      if (needArrowAngle(arrowAngle)) {
        svgPath = svgPath.replace(/,/g, " ");
        var startLoc = /m(.*?)c/;
        var endLoc = /c(.*?)$/;
        var newStart = startLoc.exec(svgPath)[1].split(" ");
        var newEnd = endLoc.exec(svgPath)[1].split(" ");

        // All coordinates of SVG curve
        var x = parseInt(newStart[0]);
        var y = parseInt(newStart[1]);
        var x1 = parseInt(newEnd[0]);
        var y1 = parseInt(newEnd[1]);
        var x2 = parseInt(newEnd[2]);
        var y2 = parseInt(newEnd[3]);
        var dx = parseInt(newEnd[4]);
        var dy = parseInt(newEnd[5]);

        // All coordinates of flipped SVG curve
        var newX = x + dx;
        var newY = y + dy;
        var newDx = -dx;
        var newDy = -dy;
        var newX1 = x2 - dx;
        var newY1 = y2 - dy;
        var newX2 = newDx + x1;
        var newY2 = newDy + y1;

        svgPath =
          "m" +
          newX.toString() +
          " " +
          newY.toString() +
          "c" +
          newX1.toString() +
          " " +
          newY1.toString() +
          " " +
          newX2.toString() +
          " " +
          newY2.toString() +
          " " +
          newDx.toString() +
          " " +
          newDy.toString();
      }

      // Append invisible curve and text itself to the svg
      d3.select(this)
        .append("path")
        .attr("class", "c")
        .attr("id", "textcurve" + i)
        .attr("d", svgPath);
      if (textMap.get(i).length &gt; 1) {
        for (var j = 0; j &lt; textMap.get(i).length; j++) {
          d3.select(this)
            .append("text")
            .attr("id", "text" + i)
            .attr("dominant-baseline", "top")
            .attr("font-size", conf[_numberOfArrows].fontSize)
            .attr("fill", arrowTextColor)
            .append("textPath")
            .attr("xlink:href", "#textcurve" + i)
            .attr("id", "arrowText" + i)
            .attr("startOffset", getDefaultOffset(textAlignments[i]))
            .style("text-anchor", "middle")
            .append("tspan")
            .attr("id", "tspan" + i + j)
            .attr("x", "0")
            .attr("dy", getTspanDy(j))
            .text(textMap.get(i)[j]);
        }
      } else {
        d3.select(this)
          .append("text")
          .attr("dominant-baseline", "middle")
          .attr("font-size", conf[_numberOfArrows].fontSize)
          .attr("fill", arrowTextColor)
          .append("textPath")
          .attr("id", "textpath" + i)
          .style("text-anchor", "middle")
          .attr("startOffset", getDefaultOffset(textAlignments[i]))
          .attr("xlink:href", "#textcurve" + i)
          .append("tspan")
          .attr("id", "tspan" + i)
          .text(arrowTitles[i]);
      }
    });
  };

  // When windows resize by user
  $(window).on("resize", function() {
    moveTouchPoint();
  });

  // Initialize touch point location incase window size is small.
  moveTouchPoint();
  $touchpoints.show();
  rotateTextCurve();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.ClmPage = function () {
    var targetStep = $("span.step"),
        quadIdx = 0,
        parsePhaseNumFromSelector = function(pathName) {
            var selectorsArr = pathName.split(".");
            if (selectorsArr &amp;&amp; selectorsArr.length &gt; 1) {
                selectorsArr = selectorsArr.slice(1);
                if (selectorsArr &amp;&amp; selectorsArr.length &gt; 1) {
                    quadIdx = selectorsArr.indexOf("phase");
                    if (selectorsArr.length &gt; (quadIdx+1)) {
                        return (parseInt(selectorsArr[(quadIdx+1)], 10)); // 1-based
                    }
                }
            }
            return 0;
        },
        phaseNum = 0;

    targetStep.on('mouseenter', function () {
        var $this = $(this).parent().parent();

        if ($this.hasClass("q1")) {
            $('ul.nav-tabs li.tr').addClass('hovered');
        } else if ($this.hasClass("q2")) {
            $('ul.nav-tabs li.br').addClass('hovered');
        } else if ($this.hasClass("q3")) {
            $('ul.nav-tabs li.bl').addClass('hovered');
        } else if ($this.hasClass("q4")) {
            $('ul.nav-tabs li.tl').addClass('hovered');
        }
    });

    targetStep.on('mouseleave', function () {
        $('ul.nav-tabs li').removeClass('hovered');
    });


    // register click handler on clm component (reset to lading tab)
    $(".clmContainer").click(function () {
        var navTab = $('ul.nav-tabs li');

        navTab.removeClass('current');
        navTab.removeClass('actived');
        $('.tab-content &gt; div').removeClass('current in');
        $("#tab-0").addClass('current in');
    });

    // register click handler on each quadrant
    $('ul.nav-tabs li').click(function (e) {
        e.stopPropagation();

        var $this = $(this),
            tab_id = $this.attr('data-tab'),
            navTab = $('ul.nav-tabs li');

        navTab.removeClass('current');
        navTab.removeClass('actived');
        $('.tab-content &gt; div').removeClass('current in');

        $this.addClass('current');
        $this.addClass('actived');
        $("#" + tab_id).addClass('current in');

        return false;
    });

    // ADF-148/ADF-216, navigate to particular quadrant based on URL query param
    try {
        if (window.location.pathname.indexOf('.phase.') &gt; -1) {
            phaseNum = parsePhaseNumFromSelector(window.location.pathname); // 1-based
            if (!isNaN(phaseNum) &amp;&amp; phaseNum &gt; 0 &amp;&amp; phaseNum &lt; 5) {
                quadIdx = (phaseNum + 4) % 4;
                $('ul.nav-tabs li')[quadIdx].click();  // 0-based
            } else {
                throw "Phase number specified is invalid or out of range.";
            }
        }
    } catch (err) {
        // ignore, do nothing
        window.console.warn("Error occurred parsing \"phase\" number from sling selector.", err);
    }

    // register click handler on each touchpoints
    $(".circle-container a").click(function (e) {
        e.preventDefault();
        var $this = $(e.currentTarget),
            href = $this.attr("href"),
            $container = $this.closest(".circle-container"),
            $quadrants = $('ul.nav-tabs li');

        if ($container.hasClass("q1")) {
            $quadrants[1].click();
        } else if ($container.hasClass("q2")) {
            $quadrants[2].click();
        } else if ($container.hasClass("q3")) {
            $quadrants[3].click();
        } else if ($container.hasClass("q4")) {
            $quadrants[0].click();
        }

        if (href) {
            // $(document).scrollTop( $(href).offset().top );
            $('html,body').animate({scrollTop: $(href).offset().top}, 'slow');
        }
        return false;
    });
};
/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.ClmQuadrant = function () {
    var targetStep = $("span.step"),
        quadIdx = 0,
        phaseNum = 0,
        $quadrants = $('div.nav-tabs .quadrant-container a'),
        parsePhaseNumFromSelector = function (pathName) {
            var selectorsArr = pathName.split(".");
            if (selectorsArr &amp;&amp; selectorsArr.length &gt; 1) {
                selectorsArr = selectorsArr.slice(1);
                if (selectorsArr &amp;&amp; selectorsArr.length &gt; 1) {
                    quadIdx = selectorsArr.indexOf("phase");
                    if (selectorsArr.length &gt; (quadIdx + 1)) {
                        return (parseInt(selectorsArr[(quadIdx + 1)], 10)); // 1-based
                    }
                }
            }
            return 0;
        },

        selectQuadrant = function ($quadrants, href, num) {
            var qHref = $($quadrants[num]).attr("href");
            $($quadrants[num]).attr("href", qHref + href);
            $quadrants[num].click();
        },

        moveTouchPoint = function() {
            var i, j, degree = 0, totalDeg = 90, touchpoints, angle, deg,
                quadrant = document.querySelectorAll(".circle-container"),
                em = ($(quadrant).height() / 16 + 1) / 2;

            for (i = 0; i &lt; quadrant.length; i++) {
                touchpoints = quadrant[i].querySelectorAll("a");
                angle = totalDeg / touchpoints.length;
                deg = degree - angle;

                for (j = touchpoints.length - 2; j &gt;= 0; j--) {
                    $(touchpoints[j]).css("transform", "rotate(" + deg + "deg) translate(" + em + "em) rotate(" + (-deg) + "deg)");
                    deg -= angle;
                }
                degree += 90;
            }
        };

    targetStep.on('mouseenter', function () {
        var $this = $(this).parent().parent();

        if ($this.hasClass("q1")) {
            $('div.nav-tabs a.tr').addClass('hovered');
        } else if ($this.hasClass("q2")) {
            $('div.nav-tabs a.br').addClass('hovered');
        } else if ($this.hasClass("q3")) {
            $('div.nav-tabs a.bl').addClass('hovered');
        } else if ($this.hasClass("q4")) {
            $('div.nav-tabs a.tl').addClass('hovered');
        }
    });

    targetStep.on('mouseleave', function () {
        $('div.nav-tabs a').removeClass('hovered');
    });

    // register click handler on each quadrant
    $quadrants.click(function () {
        var $this = $(this),
            tab_id = $this.attr('data-tab');

        $quadrants.removeClass('current');
        $quadrants.removeClass('actived');
        $('.tab-content &gt; div').removeClass('current in');

        $this.addClass('current');
        $this.addClass('actived');
        $("#" + tab_id).addClass('current in');
    });

    // ADF-148/ADF-216, navigate to particular quadrant based on URL query param
    try {
        if (window.location.pathname.indexOf('.phase.') &gt; -1) {
            phaseNum = parsePhaseNumFromSelector(window.location.pathname); // 1-based
            if (!isNaN(phaseNum) &amp;&amp; phaseNum &gt; 0 &amp;&amp; phaseNum &lt; 5) {
                quadIdx = (phaseNum + 4) % 4;
                $quadrants[quadIdx].click();  // 0-based
            } else {
                throw "Phase number specified is invalid or out of range.";
            }
        }
    } catch (err) {
        // ignore, do nothing
        window.console.warn("Error occurred parsing \"phase\" number from sling selector.", err);
    }

    // register click handler on each touchpoints
    $(".circle-container a").click(function (e) {
        e.preventDefault();
        var $this = $(e.currentTarget),
            href = $this.attr("href"),
            $container = $this.closest(".circle-container");

        if ($container.hasClass("q1")) {
            if (!$($quadrants[0]).hasClass("actived")) {
                selectQuadrant($quadrants, href, 0);
                return;
            }
        } else if ($container.hasClass("q2")) {
            if (!$($quadrants[1]).hasClass("actived")) {
                selectQuadrant($quadrants, href, 1);
                return;
            }
        } else if ($container.hasClass("q3")) {
            if (!$($quadrants[2]).hasClass("actived")) {
                selectQuadrant($quadrants, href, 2);
                return;
            }
        } else if ($container.hasClass("q4")) {
            if (!$($quadrants[3]).hasClass("actived")) {
                selectQuadrant($quadrants, href, 3);
                return;
            }
        }

        if (href) {
            $('html,body').animate({scrollTop: $(href).offset().top}, 'slow');
        }
        return false;
    });

    // When windows resize by user
    $(window).on("resize", function () {
        moveTouchPoint();
    });

    // Initialize touch point location incase window size is small.
    moveTouchPoint();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.IframeVideoComponent = function(
    $component,
    inPlaceID,
    byModalID,
    videoConfig,
    src,
    height,
) {
  var CONFIG = {
    PLAY_IN_PLACE: "playInPlace",
    PLAY_IN_MODAL: "playInModal",
    PLAY_BY_BUTTON: "playByButton",
  };

  var KEY_CMDS = {
    EXIT: 27,
  };

  var $iframeThumbnail = $component.find("#iframe-thumbnail");
  var $byButton = $component.find("#iframe-by-button");
  var aspectRatio = new AspectRatio();
  var iframeByModal;
  var iframeInPlace;
  var subscription;

  var handleModalKeyboardCommands = function(event) {
    if (
        !document.webkitIsFullScreen &amp;&amp;
        videoConfig !== CONFIG.PLAY_IN_PLACE &amp;&amp;
        event.which === KEY_CMDS.EXIT
    ) {
      iframeByModal.close(handleModalKeyboardCommands);
    }
  };

  var openModal = function() {
    iframeByModal.open(handleModalKeyboardCommands);
  };

  var handleThumbnailClick = function() {
    switch (videoConfig) {
      case CONFIG.PLAY_IN_PLACE:
        iframeInPlace.play();
        break;
      case CONFIG.PLAY_IN_MODAL:
        iframeByModal.open(handleModalKeyboardCommands);
        break;
      default:
        // continue
    }
  };

  var handleThumbnailSize = function() {
    var variableHeight = aspectRatio.getHeightRatio(
        $iframeThumbnail.parent().width(),
    );
    var width;
    if (variableHeight &lt;= height) {
      width = aspectRatio.getWidthRatio(variableHeight);
      $iframeThumbnail.width(width);
      $iframeThumbnail.height(variableHeight);
    } else {
      width = aspectRatio.getWidthRatio(height);
      $iframeThumbnail.width(width);
      $iframeThumbnail.height(height);
    }
  };

  var resize = function() {
    if (videoConfig !== CONFIG.PLAY_BY_BUTTON) {
      handleThumbnailSize();
    }
    if (!!iframeByModal &amp;&amp; iframeByModal.isOpen()) {
      iframeByModal.handleSize();
    } else if (!!iframeInPlace &amp;&amp; iframeInPlace.isBuildComplete()) {
      iframeInPlace.handleSize();
    }
  };

  var handleSubscription = function() {
    var videoResize = FUSION.SUB_EVTS.VIDEO_RESIZE;
    subscription = PUB_SUB.subscribe(videoResize.EVENT, function(data) {
      if (data.action === videoResize.ACTIONS.ACCORDION_CLICK) {
        var accordionSection = document.getElementById(data.id).parentNode;
        if (accordionSection.contains($component[0])) {
          setTimeout(resize, 0);
        }
      }
      if (data.action === videoResize.ACTIONS.TAB_CLICK) {
        var tabSection = data.el.nextElementSibling;
        if (tabSection.contains($component[0])) {
          setTimeout(resize, 0);
        }
      }
    });
  }

  var unload = function() {
    subscription.unsubscribe();
    if (iframeByModal) {
      iframeByModal.dispose();
    }
    if (iframeInPlace) {
      iframeInPlace.dispose();
    }
    $iframeThumbnail.off("click", handleThumbnailClick);
    $byButton.off("click", openModal);
    $(window).off("resize", resize);
    $(window).off("unload", unload);
  };

  var _init = function() {
    switch (videoConfig) {
      case CONFIG.PLAY_IN_MODAL:
      case CONFIG.PLAY_BY_BUTTON:
        iframeByModal = new IFrameByModal($component, byModalID, src, height);
        break;
      case CONFIG.PLAY_IN_PLACE:
        iframeInPlace = new IFrameInPlace($component, inPlaceID, src, height);
        break;
      default:
        // continue
    }

    $iframeThumbnail.on("click", handleThumbnailClick);
    $byButton.on("click", openModal.bind(this));
    $(window).resize(resize);
    $(window).on("unload", unload);
    $component.css("visibility", "visible");
    handleSubscription();
  };

  $(_init);
};

function AspectRatio() {
  // Based on 16:9 standard aspect ratio
  this._ASPECT_RATIO = {
    _TO_HEIGHT: 0.5625,
    _TO_WIDTH: 1.77777778,
  };
}

AspectRatio.prototype.getHeightRatio = function(width) {
  return parseInt(width) * this._ASPECT_RATIO._TO_HEIGHT;
};

AspectRatio.prototype.getHeightRatioInPixels = function(width) {
  return parseInt(width) * this._ASPECT_RATIO._TO_HEIGHT + "px";
};

AspectRatio.prototype.getWidthRatio = function(height) {
  return parseInt(height) * this._ASPECT_RATIO._TO_WIDTH;
};

AspectRatio.prototype.getWidthRatioInPixels = function(height) {
  return parseInt(height) * this._ASPECT_RATIO._TO_WIDTH;
};


function IFrameByModal($component, id, src, height) {
  this._aspectRatio = new AspectRatio();
  this._iframe = new Iframe(id, src, height);
  this._$modal = $component.find("#iframe-modal");
  this._$modalContent = $component.find("#iframe-modal-content");
  this._$exitModal = $component.find("#exit-icon-container");
  this._body = document.getElementsByTagName("body")[0];

  this._MODAL_PROPS = {
    _DESKTOP_BUFFER: 250,
    _MOBILE_HORIZONTAL_BUFFER: 75,
    _MOBILE_BREAKPOINT: 768,
  };
  this._init();
}

IFrameByModal.prototype._enableFullBrowserModal = function() {
  this._body.classList.remove("close-modal");
  this._body.classList.add("open-modal");
};

IFrameByModal.prototype._disableFullBrowserModal = function() {
  this._body.classList.remove("open-modal");
  this._body.classList.add("close-modal");
};

IFrameByModal.prototype.isOpen = function() {
  return this._$modal.css("display") === "block";
};

IFrameByModal.prototype.open = function(callback) {
  this._iframe.build();
  this._$modal.css("display", "block");
  this._iframe.setResizedHeight("100", "%");
  this._enableFullBrowserModal();
  this.handleSize();
  $("#exit-icon-container");
  document.addEventListener("keyup", callback, false);
};

IFrameByModal.prototype.close = function(listenerFn) {
  this._iframe.dispose();
  this._$modal.css("display", "none");
  this._disableFullBrowserModal();
  document.removeEventListener("keyup", listenerFn);
};

IFrameByModal.prototype.handleSize = function() {
  this._$modalContent.css(
      "width",
      "calc(100% - " + this._MODAL_PROPS._DESKTOP_BUFFER + "px)",
  );
  var modalWidth = this._$modalContent.width();
  var heightEstimate = this._aspectRatio.getHeightRatio(modalWidth);
  if (window.innerWidth &lt; this._MODAL_PROPS._MOBILE_BREAKPOINT) {
    // mobile
    var heightForMobile;
    if (window.screen.orientation.type === "portrait-primary") {
      // portrait
      heightForMobile = this._aspectRatio.getHeightRatio(window.innerWidth);
      this._$modalContent.css({
        height: heightForMobile + "px",
        width: window.innerWidth + "px",
      });
    } else {
      // landscape
      var horizontalWidth =
          window.innerWidth - this._MODAL_PROPS._MOBILE_HORIZONTAL_BUFFER;
      heightForMobile = this._aspectRatio.getHeightRatio(horizontalWidth);
      this._$modalContent.css({
        height: heightForMobile + "px",
        width: horizontalWidth + "px",
      });
    }
  } else if (
      heightEstimate &gt;
      window.innerHeight - this._MODAL_PROPS._DESKTOP_BUFFER
  ) {
    // modal content hits maximum height
    var maxHeight = window.innerHeight - this._MODAL_PROPS._DESKTOP_BUFFER;
    modalWidth = this._aspectRatio.getWidthRatio(maxHeight);
    this._$modalContent.css({
      height: maxHeight + "px",
      width: modalWidth + "px",
    });
  } else {
    // modal dynamically resizes
    this._$modalContent.css("height", heightEstimate + "px");
  }
};

IFrameByModal.prototype.dispose = function() {
  var iFrameByModal = this;
  this._$exitModal.off("click", iFrameByModal.close);
  this._$modal.off("click", "**");
  this._iframe.dispose();
};

IFrameByModal.prototype._init = function() {
  var iFrameByModal = this;

  this._$modal.on("click", function(event) {
    if (event.target.getAttribute("id") === "iframe-modal") {
      iFrameByModal.close().bind(iFrameByModal);
    }
  });

  this._$exitModal.on("click", iFrameByModal.close.bind(iFrameByModal));
};

function IFrameInPlace($component, id, src, height) {
  this._aspectRatio = new AspectRatio();
  this._iframe = new Iframe(id, src, height);
  this._height = height;
  this._$container = $("#" + id);
  this._$iframeThumbnail = $component.find("#iframe-thumbnail");
}

IFrameInPlace.prototype._build = function() {
  this._iframe.build();
};

IFrameInPlace.prototype.play = function() {
  this._$iframeThumbnail.css("display", "none");
  this._build();
  this.handleSize();
};

IFrameInPlace.prototype.isBuildComplete = function() {
  return this._iframe.isBuildComplete;
};

IFrameInPlace.prototype.handleSize = function() {
  var variableHeight = this._aspectRatio.getHeightRatio(
      this._$container.width());
  var width;
  if (variableHeight &lt;= this._height) {
    width = this._aspectRatio.getWidthRatio(variableHeight);
    this._iframe.setResizedWidth(width);
    this._iframe.setResizedHeight(variableHeight);
  } else {
    // too wide, handle width;
    width = this._aspectRatio.getWidthRatio(this._height);
    this._iframe.setResizedWidth(width);
    this._iframe.setResizedHeight(this._height);
  }
};

IFrameInPlace.prototype.dispose = function() {
  this._iframe.dispose();
};

function Iframe(idToAppend, src, height) {
  this.id = idToAppend;
  this.src = src;
  this._setHeight(height);
  this.isBuildComplete = false;
  this.iframe = null;
}

Iframe.prototype.build = function() {
  this.iframe = document.createElement("iframe");
  this.iframe.style.background = "black";
  var autoplayEnabledSrc = this._buildAutoplay(this.src);
  this.iframe.setAttribute("src", autoplayEnabledSrc);
  this.iframe.setAttribute("allow", "autoplay");
  this.iframe.setAttribute("autoplay", "true");
  this.iframe.setAttribute("height", this.height);
  this.iframe.setAttribute("width", "100%");
  this.iframe.setAttribute("allowfullscreen", "true");
  this.iframe.setAttribute("frameborder", "0");
  document.getElementById(this.id).appendChild(this.iframe);
  this.isBuildComplete = true;
};

Iframe.prototype._buildAutoplay = function(src) {
  if (src.indexOf("?") &gt; -1) {
    return src + "&amp;autoplay=1";
  }
  return src + "?autoplay=1";
};

Iframe.prototype.dispose = function() {
  if (this.iframe !== null) {
    this.iframe.remove();
  }
  this.isBuildComplete = false;
};

Iframe.prototype.setResizedHeight = function(height, unit) {
  var unitSelected = !!unit ? unit : "px";
  if (!!this.iframe) {
    this.iframe.setAttribute("height", parseInt(height) + unitSelected);
  }
};

Iframe.prototype.setResizedWidth = function(width, unit) {
  var unitSelected = !!unit ? unit : "px";
  if (!!this.iframe) {
    this.iframe.setAttribute("width", parseInt(width) + unitSelected);
  }
};

Iframe.prototype._setHeight = function(height) {
  if (height !== null) {
    this.height = height.indexOf("px") !== -1 ? height + "px" : height;
  }
  this.height = "320px";
};

Iframe.prototype.isBuildComplete = function() {
  return this.isBuildComplete;
};

Iframe.prototype.getHeight = function() {
  return this.iframe.getBoundingClientRect().height;
};

Iframe.prototype.getWidth = function() {
  return this.iframe.getBoundingClientRect().width;
};

Iframe.prototype.getIframe = function() {
  return this.iframe;
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.VideoComponent = function ($videoPlayer, videoHeight) {

  var isMobile = window.matchMedia("only screen and (max-width: 767px)"),
      videoContent = $videoPlayer.find("video"),
      orginVWidth = videoContent.width(),
      orginVHeight = videoContent.height(),
      barWidth = orginVWidth,
      videoWidth = orginVWidth,
      isAndroid = /(android)/i.test(navigator.userAgent);

  if (isMobile.matches) {
    videoContent.css("height", videoContent.height() * 1.12);
    $videoPlayer.bind("touchend", function () {
      var video = $(this).find(".vjs-tech").get(0);
      if (video.paused) {
        video.play();
      } else {
        video.pause();
      }
    });

    if (isAndroid) {
      $("body.fusion").addClass("android");
    }
  } else {
    videoContent.css("height", videoHeight);

    videoContent.on("loadedmetadata", function () {
      orginVWidth = this.videoWidth;
      orginVHeight = this.videoHeight;
      videoWidth = orginVWidth / orginVHeight * videoContent.height();
      barWidth = videoWidth;
      _setControlBarWidth();
    });
  }

  $(window).on("resize", function() {
    videoContent.css("height", videoHeight);
    _setVideoPlayerHeight();

    barWidth = orginVWidth / orginVHeight * videoContent.height();
    _setControlBarWidth();
  });

  $(window).on("orientationchange", function() {

    if (isMobile.matches) {
      var vid = document.getElementsByTagName("video")[0],
          height = vid.clientWidth * orginVHeight / orginVWidth * 1.12;
      vid.style.height = height +'px';
    }
  });

  function exitHandler() {
    if (document.webkitIsFullScreen === false) {
      $videoPlayer.css("height", videoHeight);
      _setVideoPlayerHeight();

      barWidth = orginVWidth / orginVHeight * videoHeight;
      _setControlBarWidth();
    }
  }

  function _setControlBarWidth() {
    var $controlBar = $videoPlayer.find(".controlBar");
    if ($controlBar.length &gt; 0) {
      if ((videoContent.width() &gt; 0) &amp;&amp; (videoContent.width() &lt; barWidth)) {
        barWidth = videoContent.width();
      }
      $controlBar.css("width", barWidth);
    }
  }

  function _setVideoPlayerHeight() {
    $videoPlayer.css("height", videoHeight);
    if (videoContent.width() &lt; videoWidth) {
      var vheight = videoContent.width() * orginVHeight / orginVWidth * 1.12;
      if (vheight &lt; videoHeight) {
        $videoPlayer.css("height", vheight);
      }
    }
  }

  if (document.addEventListener) {
    // for iOS only
    document.addEventListener('webkitfullscreenchange', exitHandler, false);
  }
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.TabContainer = function ($parent) {
    $parent.find(".tabComponent").contents().unwrap();
};

$(function(){
    var tabs = document.querySelectorAll('.tabContainer section .tabs input'),
        i = 0,

        _updateSignInLink = function(id) {
            var activeTabList = document.querySelectorAll('.tabContainer section .tabs :checked'),
                tabIds = "",
                k = 0,
                $signIn = $(".Gnav-actions a[title ='Sign In']"),
                link = $signIn.attr("href"),
                currentPage = link,
                CONST = {
                    securityCheck: "./j_security_check"
                };

            if ((typeof link !==  'undefined') &amp;&amp; (link !== false)) {
                if (currentPage.indexOf(CONST.securityCheck) &gt; 0) {
                    currentPage = currentPage.substring(0, currentPage.indexOf(CONST.securityCheck));
                }
                if (currentPage.indexOf("#") &gt; 0) {
                    currentPage = currentPage.substring(0, currentPage.indexOf("#"));
                }
                // get all active tab id
                if (activeTabList.length &gt; 0) {
                    tabIds = "tabid=";
                    for (k = 0; k &lt; activeTabList.length; ++k) {
                        if (k &gt; 0) {
                            tabIds += ",";
                        }
                        tabIds += activeTabList[k].getAttribute("id");
                    }
                    link = currentPage + '#' + tabIds + link.substr(link.indexOf(CONST.securityCheck));
                    $signIn.attr("href", link);
                }
            }
        },

        stopPropagation = function(event) {
            event.stopImmediatePropagation();
            _updateSignInLink(event.target.id);
        },

        _getUrlParameter = function (name) {
            name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
            var regex = new RegExp(name + '=([^&amp;#]*)'),
                results = null, params = "",
                hostURL = window.location.href;

            if (hostURL.indexOf("?") &gt; 0) {
                hostURL = hostURL.substring(0, hostURL.indexOf("?") - 1);
            }

            if (hostURL.indexOf("#") &gt; 0) {
                params = hostURL.substr(hostURL.indexOf("#")+1);
                results = regex.exec(params);
            }
            return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
        },

        _tabInitialize = function () {
            var tabIdParam = _getUrlParameter('tabid'),
                tabIds = null;

            if (tabIdParam !== '') {
                tabIds = tabIdParam.split(',');
                $.each( tabIds, function(index, value) {
                    // trigger click
                    $("#" + value).trigger("click");
                });
            }
        };

    // disable auto scroll for non-clm page
    if ( ($('.clmPage').length === 0) &amp;&amp; ($('.clmOverviewPage').length === 0) ) {
        $('.tabContainer section .tabs input').off("click");
        
        for (i = 0; i &lt; tabs.length; ++i) {
            tabs[i].addEventListener('click', stopPropagation);
        }
    }
    for (let tab of tabs) {
      var label = document.querySelector('label[for="' + tab.id + '"]');
      if (label != null) {
        label.addEventListener('click', function() {
          var videoResize = FUSION.SUB_EVTS.VIDEO_RESIZE;
          PUB_SUB.publish(videoResize.EVENT, videoResize.ACTIONS.TAB_CLICK, {
            el: this
          });
        }, false);
      }
    }
    // show active tab from URL
    _tabInitialize();

});


/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @param item - container of the subscription group
 * @param button - CTA to subscribe/unsubscribe
 * @constructor
 */
FUSION.SubscriptionButton = function SubscriptionButton(item, button, locale) {
  this.$item = item;
  this.$button = button;
  Granite.I18n.setLocale(locale);
};

FUSION.SubscriptionButton.prototype.setButton = function(
  selectedButton,
  selectedItem,
  buttonType
) {
  var buttonTitle = "";

  if (buttonType === "addUsers" || buttonType === "error") {
    selectedButton.removeClass("unsubscribe");
    var subscribe = Granite.I18n.get("Subscribe");
    var error = Granite.I18n.get("Error");
    buttonTitle = buttonType === "addUsers" ? subscribe : error;
  } else if (buttonType === "removeUsers") {
    buttonTitle = Granite.I18n.get("Unsubscribe");
    if (!selectedButton.hasClass("unsubscribe")) {
      selectedButton.addClass("unsubscribe");
    }
  }
  selectedButton.empty();
  selectedButton.append(buttonTitle);
  selectedItem.attr("subscribe", buttonType);
};

FUSION.SubscriptionButton.prototype.setSubscribe = function(
  groupId,
  condition
) {
  return $.ajax({
    data: { groupId: groupId, condition: condition },
    url: "/bin/fusion/setSubscription",
    dataType: "json"
  });
};

FUSION.SubscriptionButton.prototype.buttonClicked = function(
  data,
  type,
  clickButton,
  clickItem
) {
  // result was OK
  if (data[type] === "OK") {
    this.setButton(
      clickButton,
      clickItem,
      type === "addUsers" ? "removeUsers" : "addUsers"
    );
  } else if (
    data[type] === '"OK. Access Already Requested"' ||
    data[type] === '"OK. Access Requested"'
  ) {
    // result was already requested
    this.setButton(clickButton, clickItem, type);
  }
};

FUSION.SubscriptionButton.prototype.handleSubscription = function() {
  this.$button.off("click");

  var groupId = this.$item.attr("group");
  var condition = this.$item.attr("subscribe");

  if (condition === "error") {
    return;
  }
  this.$button.empty();
  this.$button.append(
    "&lt;i class='fa fa-spinner fa-spin' aria-hidden='true'&gt;&lt;/i&gt;"
  );
  var subscriptionButton = this;
  this.setSubscribe(groupId, condition).then(function(resp) {
    if (resp &amp;&amp; resp.data &amp;&amp; resp.data.groupUpdate === "OK") {
      // When user click button
      subscriptionButton.buttonClicked(
        resp.data,
        resp.data.result,
        subscriptionButton.$button,
        subscriptionButton.$item
      );
    } else if (resp.data.groupUpdate === '"Not authorized to Update"') {
      // When it doesn't have permission to author the group
      // Let the button stays as it was before
      subscriptionButton.setButton(
        subscriptionButton.$button,
        subscriptionButton.$item,
        condition
      );
    } else {
      // Every other unfavorable condition
      subscriptionButton.setButton(
        subscriptionButton.$button,
        subscriptionButton.$item,
        "error"
      );
    }
    subscriptionButton.$button.on("click", function() {
      subscriptionButton.handleSubscription(
        subscriptionButton.$item,
        subscriptionButton.$button
      );
    });
  });
  return this;
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.SubscriptionManager = function($parent, locale) {
  Granite.I18n.setLocale(locale);
  var _fetchData = function(query, url) {
    return $.ajax({
      data: query,
      dataType: "json",
      url: url
    });
  };
  var _getUserInfo = function() {
    return _fetchData({}, "/bin/fusion/getUser");
  };
  var _errorMessage = function(errorMsg) {
    var container = $parent.find(".subscription-content");
    container.empty();
    container.append(
      "&lt;div class='subscription-prompt-container'&gt;" +
        "&lt;div class='promptItem'&gt;" +
        "&lt;span&gt;" +
        errorMsg +
        "&lt;/span&gt;" +
        "&lt;/div&gt;" +
        "&lt;/div&gt;"
    );
  };
  var _initSubscription = function() {
    var items = $parent.find(".subscription-item-container");

    items.each(function() {
      var $item = $($(this).find(".subscription-item"));
      $($item.find("button")).on("click", function() {
        new FUSION.SubscriptionButton(
          $item,
          $(this),
          locale
        ).handleSubscription();
      });
    });

    try {
      _getUserInfo().then(function(resp) {
        if (resp &amp;&amp; resp.data &amp;&amp; resp.data.result === "unknown") {
          var userIsInvalid = Granite.I18n.get("User is invalid!");
          _errorMessage(userIsInvalid);
        } else if (resp.data.groups) {
          var groups = resp.data.groups;
          var selectedItem;
          var button;

          for (var i = 0, size = groups.length; i &lt; size; i++) {
            selectedItem = $(items).find(
              "[group='" + groups[i].sAMAccountName + "']"
            );

            if (selectedItem.attr("subscribe") === "addUsers") {
              selectedItem.attr("subscribe", "removeUsers");
            }
            button = $(selectedItem).find("button");
            button.empty();
            var unsubscribe = Granite.I18n.get("Unsubscribe");
            button.append("&lt;span&gt;" + unsubscribe + "&lt;/span&gt;");
            $(button).addClass("unsubscribe");
          }

          selectedItem = $(items).find("[subscribe='addUsers']");
          button = $(selectedItem).find("button");
          button.empty();
          var subscribe = Granite.I18n.get("Subscribe");
          button.append("&lt;span&gt;" + subscribe + "&lt;/span&gt;");

          $(".subscription-prompt-container").hide();
          $(".subscription-item-container").show();
        } else {
          _errorMessage(resp.errorMessage);
        }
      });
    } catch (error) {
      console.log("error", error);
    }
  };

  _initSubscription();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.SfdcCheckComponent = function() {
  var $sfdcSubmit = $("#sfdc-submit");
  var $emailInput = $("#email");
  var $sfdcTpl = $(".sfdc-tpl");
  var SFDC_ENPOINT = "/bin/fusion/sfdcCheck?email=";

  var _renderResults = function(resp) {
    var $SFDC_TEMPLATE = $("#sfdc-resp-template");
    var compiledTpl = Handlebars.compile($SFDC_TEMPLATE.html());
    var html = compiledTpl(resp);
    var $html = $(html);
    $sfdcTpl.html($html);
  };

  var _doFetch = function() {
    var emailEndpoint = SFDC_ENPOINT + $emailInput.val();
    new FUSION.Ajax().fetchData({}, emailEndpoint).done(function(resp) {
      if (resp) {
        _renderResults(resp);
      } else {
        window.console.error("Failed to get SFDC Information");
      }
    });
  };

  var submitBtnListener = function() {
    $sfdcSubmit.click(function() {
      _doFetch();
    });
  };

  var enterBtnListener = function() {
    $emailInput.on("keyup", function(e) {
      if (e.keyCode === 13) {
        _doFetch();
      }
    });
  };

  var _init = function() {
    enterBtnListener();
    submitBtnListener();
  };

  var onReady = function(callback) {
    if (document.readyState === "complete") {
      window.setTimeout(callback, 0);
    } else {
      window.addEventListener("load", callback, false);
    }
  };

  onReady(function() {
    _init();
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.samlUserGroupComponent = function (currentPage) {
  var $internalInput = $('#internal');
  var $vendorInput = $('#vendor');
  var SAML_USER_GROUP_ENDPOINT = currentPage + '.ensemble.saml.usergroup.json';
  var ADOBE_INTERNAL_GROUP = 'adobe-internal';
  var ADOBE_VENDOR_GROUP = 'adobe-vendor';

  var _renderResults = function (emailUserGroupMap) {
    if (!emailUserGroupMap) {
      return;
    }
    var internalEmailList = [];
    var vendorEmailList = [];

    Object.keys(emailUserGroupMap).forEach(function (email) {
      var userGroup = emailUserGroupMap[email];

      if (userGroup === ADOBE_INTERNAL_GROUP) {
        internalEmailList.push(email);
      } else if (userGroup === ADOBE_VENDOR_GROUP) {
        vendorEmailList.push(email);
      }

      $internalInput.val(internalEmailList.join());
      $vendorInput.val(vendorEmailList.join());
    });
  };

  var getSAMLUserGroup = function () {
    new FUSION.Ajax().fetchData({}, SAML_USER_GROUP_ENDPOINT).done(function (resp) {
      if (resp) {
        _renderResults(resp.data);
      } else {
        window.console.error('Failed to get SAML User Group Information');
      }
    });
  };

  $('#samlsubmit').click(function () {
    var $samlSubmit = $(this);

    var emailUserGroupMap = {};
    $internalInput
      .val()
      .split(',')
      .forEach(function (email) {
        emailUserGroupMap[email] = ADOBE_INTERNAL_GROUP;
      });
    $vendorInput
      .val()
      .split(',')
      .forEach(function (email) {
        emailUserGroupMap[email] = ADOBE_VENDOR_GROUP;
      });

    new FUSION.Ajax()
      .postData({ emailUserGroupMap: JSON.stringify(emailUserGroupMap) }, SAML_USER_GROUP_ENDPOINT)
      .done(function (resp) {
        if (resp) {
          if (resp.success) {
            $samlSubmit.removeClass('btn-primary');
            $samlSubmit.addClass('btn-success');
            $samlSubmit.text('UPDATED');

            setTimeout(function () {
              $samlSubmit.removeClass('btn-success');
              $samlSubmit.addClass('btn-primary');
              $samlSubmit.text('Submit');
            }, 5000);
          }
        } else {
          window.console.error('Failed to POST SAML User Group Information');
        }
      });
  });

  var _init = function () {
    getSAMLUserGroup();
  };

  var onReady = function (callback) {
    if (document.readyState === 'complete') {
      window.setTimeout(callback, 0);
    } else {
      window.addEventListener('load', callback, false);
    }
  };

  onReady(function () {
    _init();
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.pisCheckerComponent = function (currentPage) {
  var LATEST_PARTNER_PROFILE_ENDPOINT = currentPage + '.pis.latestPartnerProfile.json';
  var LIVE_PARTNER_PROFILE_ENDPOINT = currentPage + '.pis.livePartnerProfile.json';

  var startSpinner = function ($submitBtn) {
    var btnWidth = $submitBtn.width();
    var $spinner = $('&lt;i class="fa fa-spinner fa-spin"&gt;&lt;/i&gt;');

    $spinner.width(btnWidth);
    $submitBtn.empty();
    $submitBtn.append($spinner);
  };

  var stopSpinner = function ($submitBtn) {
    $submitBtn.empty();
    $submitBtn.text(Granite.I18n.get('SUBMIT'));
  };

  function _renderResult($container, resp) {
    if (!resp || !resp.data) {
      return;
    }
    let html;
    const $PIS_TEMPLATE = $('#pis-resp-template');
    const compiledTemplate = Handlebars.compile($PIS_TEMPLATE.html());
    $container.empty();

    if (resp.data.json) {
      html = compiledTemplate(JSON.parse(resp.data.json));
    } else if (resp.data.hasError) {
      html = compiledTemplate(resp.data);
    }
    $container.html($(html));
  }

  $('#latestEmailAddressSubmit').click(function () {
    var $submitBtn = $(this);
    startSpinner($submitBtn);

    new FUSION.Ajax()
      .fetchData({ email: $('#latestEmailAddress').val().trim() }, LATEST_PARTNER_PROFILE_ENDPOINT)
      .done(function (resp) {
        stopSpinner($submitBtn);
        if (resp) {
          if (resp.data) {
            _renderResult($('.pis-latest-tpl'), resp);
          }
        } else {
          window.console.error('Failed to get Partner Identity Service');
        }
      })
      .fail(function (jqXHR, textStatus, errorThrown) {
        stopSpinner($submitBtn);
        window.console.error('Failed to get Partner Identity Service', jqXHR);
      });
  });

  $('#liveEmailAddressSubmit').click(function () {
    var $submitBtn = $(this);
    startSpinner($submitBtn);

    new FUSION.Ajax()
      .fetchData({ email: $('#liveEmailAddress').val().trim() }, LIVE_PARTNER_PROFILE_ENDPOINT)
      .done(function (resp) {
        stopSpinner($submitBtn);
        if (resp) {
          if (resp.data) {
            _renderResult($('.pis-live-tpl'), resp);
          }
        } else {
          window.console.error('Failed to get Partner Identity Service');
        }
      })
      .fail(function (jqXHR, textStatus, errorThrown) {
        stopSpinner($submitBtn);
        window.console.error('Failed to get Partner Identity Service', jqXHR);
      });
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/* global Granite */
FUSION.NewsList = function (randomId, list, locale, paginationValues) {
  Granite.I18n.setLocale(locale);
  var ajax = new FUSION.Ajax();
  var pagination = new FUSION.Pagination(paginationValues);

  var GET_PAGINATION = '/bin/fusion/getPagination';
  var DISPLAY_AS = {
    NEWS_FEED: 'newsFeed',
    LINKS: 'links',
  };
  var EVT_TYPES = {
    CLICK: 'click',
    RESIZE: 'resize',
    UNLOAD: 'unload',
  };
  var handlebarsData = { list: JSON.parse(list), locale: locale };

  var $analyticsLinks = [];
  var $newsList = $('#' + randomId);
  var $next = $newsList.find('.next');
  var $previous = $newsList.find('.previous');

  var _getPagination = function (query) {
    return ajax.fetchData(query, GET_PAGINATION);
  };

  var _getTextNode = function (el) {
    if (el != null) {
      for (var i = 0; i &lt; el.childNodes.length; i++) {
        var curNode = el.childNodes[i];
        if (curNode.nodeName === '#text') {
          return curNode;
        }
      }
    }
    return null;
  };

  var _hasTextContent = function (descriptionEl) {
    if (descriptionEl != null &amp;&amp; descriptionEl.dataset) {
      return 'true' === descriptionEl.dataset.hasTextContent;
    }
    return false;
  };

  var _getHeightOfTextNode = function (textNode) {
    var height = 0;
    if (document.createRange) {
      var range = document.createRange();
      range.selectNodeContents(textNode);
      if (range.getBoundingClientRect) {
        var rect = range.getBoundingClientRect();
        if (rect) {
          return rect.bottom - rect.top;
        }
      }
    }
    return height;
  };

  var _handlePreviousVisibility = function () {
    var nextPreviousPosition = pagination.position - pagination.pageMax;
    if (nextPreviousPosition &lt; 0) {
      $previous.hide();
    } else {
      $previous.show();
    }
  };

  var _handleNextVisibility = function () {
    var nextNextPosition = pagination.position + pagination.pageMax;
    if (nextNextPosition &gt;= pagination.size || nextNextPosition &gt;= pagination.limit) {
      $next.hide();
    } else {
      $next.show();
    }
  };

  var _handlePaginationVisibility = function () {
    _handlePreviousVisibility();
    _handleNextVisibility();
  };

  var _compileHandlebars = function (data) {
    if (pagination.displayAs === DISPLAY_AS.NEWS_FEED) {
      var $newsFeedPlaceholder = $newsList.find('.newsFeed-placeholder');
      var $newsFeelTpl = $newsList.find('#newsFeed-tpl');
      var newsFeedTemplate = Handlebars.compile($newsFeelTpl.html());
      $newsFeedPlaceholder.html(newsFeedTemplate(data));
    } else if (pagination.displayAs === DISPLAY_AS.LINKS) {
      var $linksPlaceholder = $newsList.find('.links-placeholder');
      var $linksTpl = $newsList.find('#links-tpl');
      var linksTemplate = Handlebars.compile($linksTpl.html());
      $linksPlaceholder.html(linksTemplate(data));
    }
  };

  var _dynamicReadMore = function () {
    if (pagination.displayAs === DISPLAY_AS.NEWS_FEED) {
      var DESCRIPTION_MAX_HEIGHT = 39.2;
      var CLASS_ANCHOR = 'news-item_read-more';
      var CLASS_READ_MORE_ENABLED = 'read-more';
      var newsList = $newsList.find('.newsFeed-placeholder')[0];
      for (var newsItem of newsList.children) {
        var description = newsItem.querySelector('.news-item_text &gt; .news-item_description');
        var textNode = _getTextNode(description);
        if (textNode != null) {
          var height = _getHeightOfTextNode(textNode);
          var hasEllipsis = height &gt; DESCRIPTION_MAX_HEIGHT;
          var hasReadMore = description.classList.contains(CLASS_READ_MORE_ENABLED);
          var hasTextContent = _hasTextContent(description);
          if ((hasEllipsis || hasTextContent) &amp;&amp; !hasReadMore) {
            var anchor = document.createElement('a');
            anchor.setAttribute('href', newsItem.dataset.path);
            anchor.classList.add(CLASS_ANCHOR);
            anchor.textContent = Granite.I18n.get('Read More') + ' &gt;';
            newsItem.querySelector('.news-item_text').appendChild(anchor);
            description.classList.add(CLASS_READ_MORE_ENABLED);
          } else if (!hasEllipsis &amp;&amp; hasReadMore) {
            var readMoreLink = newsItem.getElementsByClassName(CLASS_ANCHOR)[0];
            readMoreLink.remove();
            description.classList.remove(CLASS_READ_MORE_ENABLED);
          }
        }
      }
    }
  };

  var _handlePaginationClick = function () {
    _getPagination(pagination.getAjaxQuery()).then(
      function (resp) {
        _compileHandlebars({ list: resp, locale: locale });
        _handlePaginationVisibility();
        _dynamicReadMore();
      },
      function (err) {
        console.error('Failed to fetch pagination query', err);
      }
    );
  };

  var _movePrevious = function () {
    pagination.position -= pagination.pageMax;
    _handlePaginationClick();
  };

  var _moveNext = function () {
    pagination.position += pagination.pageMax;
    _handlePaginationClick();
  };

  var _handlePagination = function () {
    _handlePaginationVisibility();
    $previous.on(EVT_TYPES.CLICK, _movePrevious);
    $next.on(EVT_TYPES.CLICK, _moveNext);
  };

  var _handleLink = function () {
    var data = this.parentNode.dataset;
    var A = FUSION.ANALYTICS;
    new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.NEWS_LIST)
      .putEventData(A.KEYS.TITLE, data.title, true)
      .putEventData(A.KEYS.DESTINATION_LINK, data.path, true)
      .setEvent(A.EV.CLICK.NEWS_LIST)
      .track();
  };

  var _removeAnalytics = function () {
    for (var i = 0; i &lt; $analyticsLinks.length; ++i) {
      $analyticsLinks[i].removeEventListener(EVT_TYPES.CLICK, _handleLink, false);
    }
  };

  var _addAnalytics = function () {
    $analyticsLinks = $newsList.find('.news-item_link');
    for (var i = 0; i &lt; $analyticsLinks.length; ++i) {
      $analyticsLinks[i].addEventListener(EVT_TYPES.CLICK, _handleLink, false);
    }
  };

  var _resize = function () {
    _dynamicReadMore();
  };

  var _unload = function () {
    _removeAnalytics();
    $previous.off(EVT_TYPES.CLICK, _movePrevious);
    $next.off(EVT_TYPES.CLICK, _moveNext);
    $(window).off(EVT_TYPES.RESIZE, _resize);
    $(window).off(EVT_TYPES.UNLOAD, _unload);
  };

  var _init = function () {
    _compileHandlebars(handlebarsData);
    _dynamicReadMore();
    _handlePagination();
    _addAnalytics();
    $(window).resize(_resize);
    $(window).on(EVT_TYPES.UNLOAD, _unload);
  };

  $(_init);
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.Pagination = function Pagination(obj) {
  this.limit = parseInt(obj.limit);
  this.size = parseInt(obj.size);
  this.pageMax = parseInt(obj.pageMax);
  this.position = parseInt(obj.position);
  this.searchType = obj.searchType;
  this.parentPage = obj.parentPage;
  this.displayAs = obj.displayAs;
};

FUSION.Pagination.prototype.getAjaxQuery = function() {
  return {
    limit: this.limit,
    pageMax: this.pageMax,
    position: this.position,
    searchType: this.searchType,
    parentPage: this.parentPage,
    displayAs: this.displayAs
  };
}


$(function () {
    (function () {

        var showOrHideReradMore = function () {
            $(".news-description").each(function (idx) {
                var $this = $(this),
                    $readMore = $this.parent().find("a.news-item-more");
                if ($this.prop('scrollHeight') &gt; $this.prop('offsetHeight')) {
                    $readMore.show();
                } else {
                    $readMore.hide();
                }
            });
        };

        $(window).resize(function () {
            showOrHideReradMore();
        });

        showOrHideReradMore();

    }());
});
/**
 *
 * @type {{}}
 */
var CP = window.CP || {};

/**
 *
 * @type {{init}}
 */
CP.MyLearning = function($parent) {
  var _$parent = $parent;
  var _userId;
  var _accessCode = "";

  var _getData = function() {
    var ca = document.cookie.split(";");

    for (var i = 0; i &lt; ca.length; i++) {
      var res = ca[i].split("=");
      if (typeof res[0] !== "undefined" &amp;&amp; typeof res[1] !== "undefined") {
        if (res[0].trim() === "user") {
          _userId = res[1];
        } else if (res[0].trim() === "access") {
          _accessCode = res[1];
        }
      }
    }
  };

  var _renderFirst = function($parentRender, resp) {
    var $target = $parentRender.find("div.captivatePrime-week");
    var $tpl = $parentRender.find("#captivatePrime-detail-tpl");
    var template = Handlebars.compile($tpl.html());

    for (var i = 0, size = resp.list.length; i &lt; size; i++) {
      resp.list[i].boxNumber = size &lt;= 3 ? size : 3;
      resp.list[i].isLogged = true;
      resp.list[i].titleClass = "isLogged";
    }

    if (resp.itemCounter &gt; 3) {
      var $moreButton = $parentRender.find(".myLearning-footer");
      $moreButton.show();
      $moreButton.find(".footer-text").click(function() {
        window.open(resp.deepLink);
      });
    }

    $target.html(template(resp));
    $target.show();
  };

  var _initLoginFail = function($parentLoginFail) {
    var $target = $parentLoginFail.find("div.captivatePrime-week");
    var $tpl = $parentLoginFail.find("#captivatePrime-detail-tpl");
    var template = Handlebars.compile($tpl.html());
    var failed = { list: {} };
    var script =
      ('You don\'t have a Captivate Prime Account. Reach out to the &lt;a href=" mailto:enablement-support@adobe.com?cc=grp-adu-production@adobe.com"&gt;LMS team&lt;/a&gt; for assistance.');
    failed.list[0] = {
      boxNumber: 1,
      title: script,
      isLogged: false,
      titleClass: "isNotLogged"
    };
    $target.html(template(failed));
    $target.show();
  };

  var _getMyLearning = function(userId, accessCode) {
    return new FUSION.Ajax().fetchData(
      {
        userId: userId,
        accessCode: accessCode
      },
      "/bin/captivate/mylearning"
    );
  };

  var _renderError = function($parentError, errorMsg) {
    if (!errorMsg) {
      errorMsg = "Unknown error occurred, please contact system administrator.";
    }
    $parentError.find(".captivatePrime-prompt").text(errorMsg);
  };

  var _initFirst = function() {
    _getMyLearning(_userId, _accessCode)
      .then(function(resp) {
        _$parent.find(".myLearning-header").show();
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
          _$parent.find(".captivatePrime-prompt").hide();
          _renderFirst(_$parent, resp.data);
        } else if (resp.errorMessage === "Invalid token") {
          _$parent.find(".captivatePrime-prompt").show();
        } else if (resp.errorMessage === "400") {
          _renderError(_$parent);
        } else if (resp.errorMessage) {
          _renderError(_$parent, "Error: " + resp.errorMessage);
        } else {
          _renderError(_$parent);
        }
      })
      .fail(function() {});
  };

  $(document).bind(
    "authenticateFailed authenticateFailed_partners",
    function() {
      _$parent.find(".captivatePrime-prompt").hide();
      _$parent.find(".myLearning-header").show();
      _initLoginFail(_$parent);
      $(this).unbind("authenticateFailed");
    }
  );

  $(document).bind("captivate", function() {
    _getData();
    _initFirst();
    $(this).unbind("captivate");
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/*global Player*/
FUSION.MpcVideo = function (parent, videoId) {

    var MpcPlayer = new Player(
        'component',
        videoId,
        parent,
        {
            forceTech: 'html'
        }
        ),

        removeClass = function ($element) {
            if ($element.hasClass("hide")) {
                $element.removeClass("hide");
            }
        },

        addClass = function ($element) {
            if (!$element.hasClass("hide") &amp;&amp; !$element.hasClass("show")) {
                $element.addClass("hide");
            }
        },

        init = function () {
            var languageList = $(parent).find(".language-list"),
                settingList = $(parent).find(".settings-list-holder"),
                controlBar = $(parent).find(".controlbar-holder");

            controlBar.css({visibility: 'hidden'});
            removeClass(controlBar);
            removeClass(settingList);
            removeClass(languageList);

            languageList.css({
                top: -languageList.outerHeight() - 5,
                left: -languageList.outerWidth() / 3
            });

            settingList.css({
                top: -settingList.outerHeight() - 5,
                left: -settingList.outerWidth() / 4
            });

            controlBar.css({visibility: 'visible'});
            addClass(controlBar);
            addClass(settingList);
            addClass(languageList);
        },

        onReady = function (callback) {
            if (document.readyState === 'complete') {
                window.setTimeout(callback, 0);
            } else {
                window.addEventListener('load', callback, false);
            }
        };

    onReady(function () {
        init();
    });
};


/**
 *
 * @type {{}}
 */
var CP = window.CP || {};

/**
 *
 * @type {{init}}
 */
CP.LearningProgram = function($parent, learningId) {
  var ajax = new FUSION.Ajax();
  var _$parent = $parent;
  var _learningId = learningId;
  var _userId;
  var _accessCode = "";
  var _currentData;

  var _getData = function() {
    var ca = document.cookie.split(";");

    for (var i = 0; i &lt; ca.length; i++) {
      var res = ca[i].split("=");
      if (typeof res[0] !== "undefined" &amp;&amp; typeof res[1] !== "undefined") {
        if (res[0].trim() === "user") {
          _userId = res[1];
        } else if (res[0].trim() === "access") {
          _accessCode = res[1];
        }
      }
    }
  };

  var _getLearningEnroll = function(learningIdEnroll, userId, accessCode) {
    return ajax.fetchData(
      {
        learningId: learningIdEnroll,
        userId: userId,
        accessCode: accessCode
      },
      "/bin/captivate/checkLearningEnroll"
    );
  };

  var _addClientEventToModuleTitleBar = function($target) {
    $target
      .find(".captivatePrime-courses-title-bar")
      .off("click")
      .on("click", function() {
        $(this)
          .find(".captivatePrime-courses-arrow")
          .toggleClass("arrow-up");
        $target.find(".captivatePrime-courses-list").slideToggle();
      });
  };

  var _renderSecond = function($parentRenderSecond, data) {
    var $target = $parentRenderSecond.find("div.captivatePrime-week");
    var $tpl = $parentRenderSecond.find("#captivatePrime-detail-tpl");
    jQuery.extend(_currentData, data);

    if (!_currentData.isEnrolled) {
      // _currentData.buttonText = "Enroll"; //Disable Enrollment Support
      _currentData.buttonText = "Get Started";
      _currentData.buttonClass = "captivatePrime-no-progress";
    } else {
      /* //Disable Enrollment Support
            if (_currentData.progress === 0) {
                _currentData.buttonText = "Get Started";
                _currentData.buttonClass = "captivatePrime-no-progress";
            } else
            */
      if (_currentData.progress === 100) {
        _currentData.buttonText = "Review";
        _currentData.buttonClass = "captivatePrime-completed";
      } else {
        _currentData.buttonText = "Continue";
        _currentData.buttonClass = "captivatePrime-in-progress";
      }
    }

    var template = Handlebars.compile($tpl.html());
    $target.html(template(_currentData));
    $target.show();
    _addClientEventToModuleTitleBar($target);
    /* //Disable Enrollment Support
        $target.find(".captivatePrime-button").off("click").on("click", function() {
            if (!_currentData.isEnrolled &amp;&amp; _currentData.instances[0] != undefined) {
                _enrollInProgram(_currentData.id, _currentData.instanceId, _accessCode).then(
                    function (resp) {
                        if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.isSuccess) {
                            _currentData.buttonText = "Get Started";
                            _currentData.buttonClass = "captivatePrime-no-progress";
                            _currentData.isEnrolled = true;
                            $target.html(template(_currentData));
                            $target.show();
                            _addClientEventToModuleTitleBar($target);
                        } else {
                            _renderError(_$parent, "Cannot enroll into program: " + _currentData.names);
                        }
                    }
                ).fail(function (jqXHR) {
                    _renderError(_$parent, "HTTP Status " + jqXHR.status + " - " + jqXHR.responseText + ", please contact administrator. ")
                });
            }
        });
*/
  };

  var _renderError = function($parentError, errorMsg) {
    if (!errorMsg) {
      errorMsg = "Unknown error occurred, please contact system administrator.";
    }
    $parentError.find(".captivatePrime-prompt").text(errorMsg);
  };

  var _initSecond = function() {
    _getLearningEnroll(_learningId, _userId, _accessCode)
      .then(function(resp) {
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
          _renderSecond(_$parent, resp.data);
        } else if (resp.errorMessage === "Invalid token") {
          _$parent.find(".captivatePrime-prompt").show();
        } else if (resp.errorMessage === "400") {
          _renderError(_$parent);
        } else if (resp.errorMessage) {
          _renderError(_$parent, "Error: " + resp.errorMessage);
        } else {
          _renderError(_$parent);
        }
      })
      .fail(function(jqXHR) {
        _renderError(
          _$parent,
          "HTTP Status " +
            jqXHR.status +
            " - " +
            jqXHR.responseText +
            ", please contact administrator. "
        );
      });
  };

  var _renderFirst = function($parentRender, data) {
    var $target = $parentRender.find("div.captivatePrime-week");
    var $tpl = $parentRender.find("#captivatePrime-detail-tpl");

    _currentData = data;
    _currentData.buttonClass = "captivatePrime-no-progress";

    var template = Handlebars.compile($tpl.html());
    $target.html(template(_currentData));
    $target.show();

    $target
      .find(".captivatePrime-courses-title-bar")
      .off("click")
      .on("click", function() {
        $(this)
          .find(".captivatePrime-courses-arrow")
          .toggleClass("arrow-up");
        $target.find(".captivatePrime-courses-list").slideToggle();
      });

    $target
      .find(".captivatePrime-no-progress .captivatePrime-button")
      .addClass("busy-disabled")
      .html('&lt;i class="fa fa-circle-o-notch fa-spin" aria-hidden="true"&gt;&lt;/i&gt;');
    _initSecond();
  };

  var _enrollInProgram = function(
    learningIdEnroll,
    learningInstanceId,
    accessCode
  ) {
    return ajax.fetchData(
      {
        learningId: learningIdEnroll,
        learningInstanceId: learningInstanceId,
        accessCode: accessCode
      },
      "/bin/captivate/enrollLearning"
    );
  };

  var _getLearningProgram = function(learningIdProgram, accessCode) {
    return ajax.fetchData(
      {
        learningId: learningIdProgram,
        accessCode: accessCode
      },
      "/bin/captivate/learningProgram"
    );
  };

  var _initFirst = function() {
    _getLearningProgram(_learningId, _accessCode)
      .then(function(resp) {
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
          _$parent.find(".captivatePrime-prompt").hide();
          _renderFirst(_$parent, resp.data);
        } else if (resp.errorMessage === "Invalid token") {
          _$parent.find(".captivatePrime-prompt").show();
        } else if (resp.errorMessage === "400") {
          _renderError(_$parent);
        } else if (resp.errorMessage) {
          _renderError(_$parent, "Error: " + resp.errorMessage);
        } else {
          _renderError(_$parent);
        }
      })
      .fail(function(jqXHR) {
        _renderError(
          _$parent,
          "HTTP Status " +
            jqXHR.status +
            " - " +
            jqXHR.responseText +
            ", please contact administrator. "
        );
      });
  };

  $(document).bind("captivate", function() {
    _getData();
    _initFirst();
    $(this).unbind("captivate");
  });
};

function Translate(data, locale, localizedStrings) {
  this._data = data;
  this._locale = locale;
  this._LOCALIZED_STRINGS = localizedStrings;
  this._IDENTIFIERS = {
    _SUPPLEMENT_LABEL: "supplement-label-",
    _SUPPLEMENT_CONTAINER: "supplement-container-",
    _SUPPLEMENT_PATH: "supplement-path",
    _MANDATORY_LABEL: "mandatory-label-",
    _COURSE_PROCESS: "course-progress-",
    _PROGRAM_PROCESS: "program-progress-"
  };
  this._LEARNING_TYPES = {
    PROGRAM: "learningProgram",
    COURSE: "course"
  };
}

Translate.prototype._translateProgression = function(
  course,
  progressionIDPrefix
) {
  var progress = parseInt(course.progress);
  var progressEl = document.getElementById(progressionIDPrefix + course.id);
  if (!!progressEl) {
    var status;
    if (progress &lt; 100 &amp;&amp; progress &gt; 0) {
      status = Granite.I18n.get(this._LOCALIZED_STRINGS.IN_PROGRESS);
      progressEl.innerText = status;
    } else if (progress === 100) {
      status = Granite.I18n.get(this._LOCALIZED_STRINGS.COMPLETE);
      progressEl.innerText = status;
    } else {
      status = Granite.I18n.get(this._LOCALIZED_STRINGS.NOT_STARTED);
      progressEl.innerText = status;
    }
  }
};

Translate.prototype._translateMandatoryLabels = function(course) {
  if (!!course.modules) {
    for (var j = 0; j &lt; course.modules.length; ++j) {
      var module = course.modules[j];
      var mandatoryLabelID =
        this._IDENTIFIERS._MANDATORY_LABEL + module.moduleId;
      var mandatoryLabelEl = document.getElementById(mandatoryLabelID);
      if (!!mandatoryLabelEl) {
        var requiredTranslation = Granite.I18n.get(
          this._LOCALIZED_STRINGS.REQUIRED
        );
        mandatoryLabelEl.innerText = requiredTranslation;
      }
    }
  }
};

Translate.prototype._translateSupplementLabel = function(data) {
  var supplementLabelID = this._IDENTIFIERS._SUPPLEMENT_LABEL + data.id;
  var supplementLabelEl = document.getElementById(supplementLabelID);
  if (!!supplementLabelEl) {
    if (data.supplements.length &gt; 1) {
      supplementLabelEl.innerText = Granite.I18n.get(
        this._LOCALIZED_STRINGS.SUPPLEMENT_LABEL.COURSE_RESOURCES
      );
    } else {
      supplementLabelEl.innerText = Granite.I18n.get(
        this._LOCALIZED_STRINGS.SUPPLEMENT_LABEL.COURSE_RESOURCE
      );
    }
  }
};

Translate.prototype._translateSupplementPath = function(course) {
  var resourceTranslation = Granite.I18n.get(this._LOCALIZED_STRINGS.RESOURCE);
  var supplementContainerID =
    this._IDENTIFIERS._SUPPLEMENT_CONTAINER + course.id;
  var supplementContainerEl = document.getElementById(supplementContainerID);
  if (!!supplementContainerEl) {
    var supplementPaths = supplementContainerEl.getElementsByClassName(
      this._IDENTIFIERS._SUPPLEMENT_PATH
    );
    for (var supplementPathEl of supplementPaths) {
      if (!!supplementPathEl) {
        var title = supplementPathEl.dataset.title;
        var index = parseInt(supplementPathEl.dataset.index) + 1;
        if (!!title) {
          supplementPathEl.innerText = title;
        } else {
          supplementPathEl.innerText = resourceTranslation + " #" + index;
        }
      }
    }
  }
};

Translate.prototype._handleProgram = function() {
  this._translateProgression(this._data, this._IDENTIFIERS._PROGRAM_PROCESS);
  for (var course of this._data.courses) {
    this._translateProgression(course, this._IDENTIFIERS._COURSE_PROCESS);
    this._translateMandatoryLabels(course);
    this._translateSupplementLabel(course);
    this._translateSupplementPath(course);
  }
};

Translate.prototype._handleCourse = function() {
  this._translateProgression(this._data, this._IDENTIFIERS._COURSE_PROCESS);
  this._translateSupplementLabel(this._data);
  this._translateMandatoryLabels(this._data);
  this._translateSupplementPath(this._data);
  for (var module of this._data.modules) {
    this._translateProgression(module, this._IDENTIFIERS._COURSE_PROCESS);
  }
};

Translate.prototype._translate = function() {
  switch (this._data.learningPath) {
    case this._LEARNING_TYPES.COURSE:
      this._handleCourse();
      break;
    case this._LEARNING_TYPES.PROGRAM:
      this._handleProgram();
      break;
    default:
      // continue
      break;
  }
};

Translate.prototype.render = function() {
  Granite.I18n.setLocale(this._locale);
  this._translate();
};

/**
 *
 * @type {{}}
 */
var CP = window.CP || {};
var Handlebars = window.Handlebars || {};

// Function for checking if class was removed
function isClassRemoved(mutation, className) {
  return (
    mutation.oldValue.indexOf(className) &gt;= 0 &amp;&amp;
    !mutation.target.classList.contains(className)
  );
}

/**
 *
 * @type {{init}}
 */
/* global Handlebars Granite _initFirst _renderError */
CP.MiniFluidicPlayer = function(
  $parent,
  learningList,
  globalObject,
  pullingTimer,
  locale
) {
  var ajax = new FUSION.Ajax();
  var GLOBAL = {
    parent: $parent,
    learningList: learningList,
    hasProgress: false,
    hasCompleted: true,
    isEnrolled: true,
    notEnrolledLO: { type: [], id: [], instanceId: [] },
    accessCode: "",
    learningPosition: 0
  };
  var LOCALIZED_STRINGS = {
    NOT_STARTED: "NOT STARTED",
    IN_PROGRESS: "IN PROGRESS",
    COMPLETE: "COMPLETE",
    COMPLETE_PERCENTAGE: "{0}% Complete",
    REQUIRED: "REQUIRED",
    START: "START",
    CONTINUE: "CONTINUE",
    REVIEW: "REVIEW",
    RESOURCE: "Resource",
    SUPPLEMENT_LABEL: {
      COURSE_RESOURCE: "Course Resource",
      COURSE_RESOURCES: "Course Resources"
    }
  };
  const ERRORS = {
    UNABLE_TO_ENROLL:
      "We were not able to enroll you in {0} {1}  - try again. If the problem persists, " +
      '&lt;a href="mailto:cbchelp@adobe.com"&gt;contact us&lt;/a&gt; with this error message.',
    PLEASE_RELOAD_PAGE:
      "Please reload this web page. If you continue to see this message, " +
      '&lt;a href="mailto:cbchelp@adobe.com"&gt;contact us&lt;/a&gt;. [21]',
    E_LEARNING_LOGOUT:
      "It appears you have been logged out of Adobe’s eLearning platform. To access this eLearning " +
      'program, go to &lt;a href="https://captivateprime.adobe.com/acapindex.html" target="_blank"&gt;Captivate Prime&lt;/a&gt; ' +
      "and enter your Adobe login credentials. Then come back to this page and refresh.",
    E_LEARNING_LOGOUT_EXT:
      "It appears you have been logged out of Adobe’s eLearning platform. To access this " +
      'eLearning program, go to &lt;a href="https://captivateprime.adobe.com/acapindex.html" target="_blank"&gt;' +
      "Captivate Prime&lt;/a&gt; and enter your APC credentials. Then come back to this page and refresh. " +
      "If you continue to experience problems, contact the " +
      '&lt;a href="https://cbconnection.adobe.com/en/apc-helpdesk.html" target="_blank"&gt;APC Helpdesk.&lt;/a&gt;'
  };
  var _getTranslation = function(translationKey, variableArray) {
    Granite.I18n.setLocale(locale);
    if (variableArray != null) {
      return Granite.I18n.get(translationKey, variableArray);
    }
    return Granite.I18n.get(translationKey);
  };
  var _getData = function() {
    var ca = document.cookie.split(";");

    for (var i = 0; i &lt; ca.length; i++) {
      var res = ca[i].split("=");
      if (
        typeof res[0] !== "undefined" &amp;&amp;
        typeof res[1] !== "undefined" &amp;&amp;
        res[0].trim() === "access"
      ) {
        GLOBAL.accessCode = res[1];
      }
    }
  };
  var _checkCourseModule = function(courseId, moduleId) {
    return ajax.fetchData(
      {
        courseId: courseId,
        moduleId: moduleId,
        accessCode: GLOBAL.accessCode
      },
      "/bin/captivate/checkCourseModule"
    );
  };
  var _enrollInLearning = function(type, id, instanceId) {
    var query = {
      accessCode: GLOBAL.accessCode,
      version: "v2"
    };
    var url;

    if (type === "program") {
      query.learningId = id;
      query.learningInstanceId = instanceId;
      url = "/bin/captivate/enrollLearning";
    } else {
      query.courseId = id;
      query.courseInstanceId = instanceId;
      url = "/bin/captivate/enrollCourse";
    }
    return ajax.fetchData(query, url);
  };
  var _getLearningDetail = function(learningId, learningPath) {
    return ajax.fetchData(
      {
        learningId: learningId,
        learningPath: learningPath,
        accessCode: GLOBAL.accessCode
      },
      "/bin/captivate/fluidicPlayer"
    );
  };
  var _renderError = function(isCourse, msg, authentication) {
    var overviewText = GLOBAL.parent.find(".player-overview .player-status");
    var overviewButton = overviewText.find(".player-status-text");
    var courseTitles = GLOBAL.parent.find(
      ".captivatePrime-modules-item .learning-title"
    );
    var iFramePlayer = GLOBAL.parent.find(".player-iframe");

    if (authentication) {
      overviewText.empty();
    }
    if (isCourse) {
      GLOBAL.parent.find(".courseDetail-container").remove();
    }
    overviewButton.remove();
    overviewText.append('&lt;div class="error-message"&gt;' + msg + "&lt;/div&gt;");
    $(courseTitles).off("click");
    $(iFramePlayer).remove();
  };
  var _setProgramStatus = function() {
    var learningObjects = GLOBAL.parent.find(
      ".captivatePrime-program-container[grade='0']"
    );
    var learningCourses = GLOBAL.parent.find(
      ".captivatePrime-courses-container[grade='0']"
    );

    $(learningCourses).each(function(i) {
      var completedModules = $(this).find(
        ".captivatePrime-modules .completed.true"
      ).length;
      var totalModules = $(this).find(".captivatePrime-modules").length;
      var completedCheckMark = $(this).find(
        ".captivatePrime-courses-title .completed-check"
      );
      var grade = 0;

      if (completedModules &gt; 0) {
        grade = Math.round((completedModules / totalModules) * 100);
        $(this).attr("grade", grade);
        $(this).attr("manual-grade", true);

        if (grade &lt; 100) {
          var inProgressTranslation = _getTranslation(
            LOCALIZED_STRINGS.IN_PROGRESS
          );
          completedCheckMark
            .removeClass("zero")
            .addClass("started")
            .text(inProgressTranslation);
        } else if (grade === 100) {
          var completeTranslation = _getTranslation(LOCALIZED_STRINGS.COMPLETE);
          completedCheckMark
            .removeClass("zero")
            .addClass("completed")
            .text(completeTranslation);
        }
      }
    });

    $(learningObjects).each(function(i) {
      if ($(this).find(".captivatePrime-modules .completed.true").length &gt; 0) {
        var inProgressTranslation = _getTranslation(
          LOCALIZED_STRINGS.IN_PROGRESS
        );
        $(this)
          .find(".captivatePrime-program-title .completed-check")
          .removeClass("zero")
          .addClass("started")
          .text(inProgressTranslation);
      }
    });
    GLOBAL.parent.find(".checkmark").css("display", "table-cell");
    GLOBAL.parent.find(".completed-check").css("display", "block");
  };
  var _calculateProgress = function() {
    var learningObjects = GLOBAL.parent.find(".learning-object");
    var $learningObject;
    var progress = 0;
    var programProgress;
    var courses;

    $(learningObjects).each(function(i, learningObject) {
      $learningObject = $(learningObject);

      if ($learningObject.attr("data-type") === "program") {
        programProgress = 0;
        courses = $learningObject.find(".captivatePrime-courses-container");

        $(courses).each(function(index) {
          programProgress += parseInt($(this).attr("grade"));
        });
        progress += Math.round(programProgress / courses.length);
      } else {
        progress += parseInt(
          $learningObject
            .find(".captivatePrime-courses-container")
            .attr("grade")
        );
      }
    });
    return Math.round(progress / learningObjects.length);
  };
  var _setProgressBar = function() {
    var percentage = _calculateProgress();
    var currentProgress = GLOBAL.parent.find(".current-progress");
    GLOBAL.parent
      .find(".learningDetail-progress-green")
      .attr("style", "width:" + percentage + "%;");
    var completeTranslation = _getTranslation(
      LOCALIZED_STRINGS.COMPLETE_PERCENTAGE,
      [percentage]
    );
    if (percentage === 100) {
      currentProgress.empty().addClass("completed");
      GLOBAL.parent
        .find(".current-progress-text")
        .addClass("completed")
        .text(completeTranslation);
    } else {
      currentProgress.text(completeTranslation);
    }
    GLOBAL.parent.find(".learningDetail-progress-container").show();
  };
  var _removedLockIcon = function(index, totalModules, moduleList) {
    for (; index &lt; totalModules; index++) {
      $(moduleList[index])
        .attr("locked", false)
        .find(".learning-title")
        .removeClass("locked")
        .find(".learning-lock-icon")
        .remove();

      if (!$(moduleList[index]).hasClass("true")) {
        break;
      }
    }
  };

  var _addCompletedMark = function(_moduleId, _progress) {
    var learningTitle = GLOBAL.parent.find(
      ".learning-title[value='" + _moduleId + "']"
    );
    var courseContainer = learningTitle.closest(
      ".captivatePrime-courses-container"
    );
    var moduleList = learningTitle
      .parents(".captivatePrime-modules-list")
      .find(".captivatePrime-modules-item");
    var modulesContainer = learningTitle.closest(".captivatePrime-modules");
    var courseStatus = courseContainer.find(".completed-check");
    var totalModules = moduleList.length;
    var index = parseInt(learningTitle.attr("index")) + 1;
    modulesContainer.find(".completed").addClass("true");

    var completeTranslation = _getTranslation(LOCALIZED_STRINGS.COMPLETE);
    var inProgressTranslation = _getTranslation(LOCALIZED_STRINGS.IN_PROGRESS);
    // Add Progress label to Course Title level
    if (_progress === 100) {
      courseStatus.text(completeTranslation);
      if (!courseStatus.hasClass("completed")) {
        courseStatus.removeClass("zero started").addClass("completed");
      }
    } else {
      if (_progress === 0) {
        courseContainer.attr("manual-grade", true);
      }
      courseStatus.text(inProgressTranslation);

      if (!courseStatus.hasClass("started")) {
        courseStatus.removeClass("zero completed").addClass("started");
      }
    }

    // If progress is need to be done manually instead of relying on CP response
    if (courseContainer.attr("manual-grade") === "true") {
      var completedModules = courseContainer.find(
        ".captivatePrime-modules .completed.true"
      ).length;
      courseContainer.attr(
        "grade",
        Math.round((completedModules / totalModules) * 100)
      );
    } else {
      $(courseContainer).attr("grade", _progress);
    }

    // Remove lock on the next module if locked
    if (index &lt; totalModules) {
      _removedLockIcon(index, totalModules, moduleList);
    }

    // Add Progress label to Program title level
    if (courseContainer.attr("data-type") === "program") {
      var programContainer = courseContainer.closest(
        ".captivatePrime-program-container"
      );
      var courseList = programContainer.find(
        ".captivatePrime-courses-container"
      );
      var completedList = programContainer.find(
        ".captivatePrime-courses-title .completed-check.completed"
      );
      var programStatus = programContainer.find(
        ".captivatePrime-program-title .completed-check"
      );

      if (completedList.length === courseList.length) {
        programStatus.text(completeTranslation);
        if (!programStatus.hasClass("completed")) {
          programStatus.removeClass("zero started").addClass("completed");
        }
      } else {
        programStatus.text(inProgressTranslation);
        if (!programStatus.hasClass("started")) {
          programStatus.removeClass("zero completed").addClass("started");
        }
      }

      if (index === totalModules || _progress === 100) {
        var courseIndex = parseInt(courseContainer.attr("index")) + 1;
        var totalCourses = courseList.length;

        for (; courseIndex &lt; totalCourses; courseIndex++) {
          $(courseList[courseIndex])
            .attr("locked", false)
            .find(".table-cell .learning-lock-icon")
            .remove();
          moduleList = $(courseList[courseIndex]).find(
            ".captivatePrime-modules-list .captivatePrime-modules-item"
          );
          _removedLockIcon(0, moduleList.length, moduleList);

          if (!$(courseList[courseIndex]).hasClass("true")) {
            break;
          }
        }
      }
    }
    _setProgressBar();
  };
  var _applyCheckMark = function(previousCourse, previousModule) {
    for (var prop in globalObject) {
      if (globalObject.hasOwnProperty(prop)) {
        delete globalObject[prop];
      }
    }
    _checkCourseModule(previousCourse, previousModule).then(function(resp) {
      if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.hasPassed) {
        _addCompletedMark(previousModule, resp.data.parentProgress);
      }
    });
  };
  var _setTimeout = function(moduleId, courseId) {
    var timeout = setInterval(function() {
      var _moduleId = moduleId;
      var _courseId = courseId;

      _checkCourseModule(_courseId, _moduleId).then(function(resp) {
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.hasPassed) {
          clearInterval(timeout);

          for (var prop in globalObject) {
            if (globalObject.hasOwnProperty(prop)) {
              delete globalObject[prop];
            }
          }
          _addCompletedMark(_moduleId, resp.data.parentProgress);
        }
      });
    }, parseInt(pullingTimer) * 1000);
    globalObject.timeout = timeout;
    globalObject.activeCourse = courseId;
    globalObject.activeModule = moduleId;

    return timeout;
  };
  var _checkIfCompleted = function(courseId, moduleId) {
    if (!$.isEmptyObject(globalObject)) {
      var previousModule = globalObject.activeModule;
      var previousCourse = globalObject.activeCourse;

      if (previousModule !== moduleId) {
        clearInterval(globalObject.timeout);
        _applyCheckMark(previousCourse, previousModule);
        _setTimeout(moduleId, courseId);
      }
    } else {
      _setTimeout(moduleId, courseId);
    }
  };
  var _scrollToElement = function($element, speed) {
    speed = speed || 750;

    $("html, body").animate(
      {
        scrollTop: $element.offset().top - 20
      },
      speed
    );
    return $element;
  };
  var _addClientEventToModuleTitleBar = function() {
    var courseTitles = GLOBAL.parent.find(
      ".captivatePrime-modules-item .learning-title"
    );
    var iFramePlayer = GLOBAL.parent.find(".player-iframe");
    var $playerOverview = $(GLOBAL.parent.find(".player-overview"));

    $(courseTitles).on("click", function() {
      if (!$(this).hasClass("locked")) {
        if (!$(iFramePlayer).is(":visible")) {
          _scrollToElement(iFramePlayer, "200");
        }
        $(iFramePlayer).attr(
          "src",
          "https://captivateprime.adobe.com/app/player?course_id=" +
            $(this)
              .parent()
              .attr("name") +
            "&amp;access_token=" +
            GLOBAL.accessCode +
            "&amp;module_id=" +
            $(this).attr("value")
        );
        _checkIfCompleted(
          $(this)
            .parent()
            .attr("name"),
          $(this).attr("value")
        );

        if (!$playerOverview.hasClass("hide")) {
          $playerOverview.addClass("hide");
        }
      }
    });
  };
  var _updateCourseData = function(data) {
    var moduleList = GLOBAL.parent.find("[name='" + data.id + "']");

    $(moduleList).each(function(i, module) {
      $(module)
        .find(".learning-title")
        .attr("value", data.modules[i].moduleId);
    });
  };
  var _setArrowDirection = function(element) {
    var firstCourse = GLOBAL.parent.find(element).first();
    var courseArrow = firstCourse.find(".captivatePrime-arrow");

    if (firstCourse.attr("data-type") === "program") {
      var firstProgram = $(firstCourse).closest(".captivatePrime-courses-list");
      var programArrow = firstProgram
        .parent()
        .find(".captivatePrime-arrow")
        .first();
      firstProgram.slideDown();

      if (!$(programArrow).hasClass("down")) {
        $(programArrow).addClass("down");
      }
    }
    firstCourse.find(".captivatePrime-modules-list").slideDown();

    if (!$(courseArrow).hasClass("down")) {
      $(courseArrow).addClass("down");
    }
  };
  var _enrollUser = function(currentLearning) {
    var i = 0;
    var learningSize = GLOBAL.notEnrolledLO.id.length;
    var enrollCounter = 0;
    var _refreshLearningObject = function(learnResponse) {
      if (learnResponse &amp;&amp; learnResponse.success &amp;&amp; learnResponse.data) {
        _updateCourseData(learnResponse.data);
      }

      if (enrollCounter === learningSize) {
        _addClientEventToModuleTitleBar();

        if (typeof currentLearning !== "undefined") {
          currentLearning.click();
        } else {
          _setArrowDirection(".captivatePrime-courses-container:not('.true')");
          GLOBAL.parent
            .find(".captivatePrime-modules-item:not('.true') .learning-title")
            .first()
            .click();
        }
      }
    };
    var _afterEnrollment = function(enrollResponse) {
      if (
        enrollResponse &amp;&amp;
        enrollResponse.success &amp;&amp;
        enrollResponse.data.isSuccess
      ) {
        enrollCounter++;

        _getLearningDetail(
          enrollResponse.data.idV1,
          enrollResponse.data.type
        ).then(_refreshLearningObject);
      } else {
        var translatedMsg = _getTranslation(ERRORS.UNABLE_TO_ENROLL, [
          enrollResponse.data.type,
          enrollResponse.data.idV1
        ]);
        _renderError(false, translatedMsg, false);
      }
    };
    for (; i &lt; learningSize; i++) {
      _enrollInLearning(
        GLOBAL.notEnrolledLO.type[i],
        GLOBAL.notEnrolledLO.id[i],
        GLOBAL.notEnrolledLO.instanceId[i]
      ).then(_afterEnrollment);
    }
  };
  var _setLearningButton = function(
    overviewText,
    text,
    arrowDirection,
    courseModuleClass
  ) {
    overviewText.html(text);
    _setArrowDirection(arrowDirection);

    if (GLOBAL.isEnrolled) {
      _addClientEventToModuleTitleBar();

      $(overviewText).on("click", function() {
        $(overviewText).off();
        _setArrowDirection(arrowDirection);
        GLOBAL.parent
          .find(courseModuleClass)
          .first()
          .click();
      });
    } else {
      var courseTitles = GLOBAL.parent.find(
        ".captivatePrime-modules-item .learning-title"
      );

      $(overviewText).on("click", function() {
        $(overviewText).off();
        $(courseTitles).off();
        overviewText.html(
          '&lt;i class="fa fa-spinner fa-spin" aria-hidden="true"&gt;&lt;/i&gt;'
        );
        _enrollUser();
      });

      $(courseTitles).on("click", function() {
        $(overviewText).off();
        $(courseTitles).off();
        var currentCourse = $(this);
        overviewText.html(
          '&lt;i class="fa fa-spinner fa-spin" aria-hidden="true"&gt;&lt;/i&gt;'
        );
        _enrollUser(currentCourse);
      });
    }
  };
  var _setPlayerElement = function() {
    var overviewText = GLOBAL.parent.find(
      ".player-overview .player-status .player-status-text"
    );

    if (!GLOBAL.isEnrolled || !GLOBAL.hasProgress) {
      var startTranslation = _getTranslation(LOCALIZED_STRINGS.START);
      _setLearningButton(
        overviewText,
        startTranslation,
        ".captivatePrime-courses-container:not('.true')",
        ".captivatePrime-modules-item:not('.true') .learning-title"
      );
    } else if (GLOBAL.hasProgress &amp;&amp; !GLOBAL.hasCompleted) {
      var continueTranslation = _getTranslation(LOCALIZED_STRINGS.CONTINUE);
      _setLearningButton(
        overviewText,
        continueTranslation,
        ".captivatePrime-courses-container:not('.true')",
        ".captivatePrime-modules-item:not('.true') .learning-title"
      );
    } else if (GLOBAL.hasCompleted) {
      var reviewTranslation = _getTranslation(LOCALIZED_STRINGS.REVIEW);
      _setLearningButton(
        overviewText,
        reviewTranslation,
        ".captivatePrime-courses-container",
        ".captivatePrime-modules-item .learning-title"
      );
    }
    overviewText.show();
  };
  var _renderFirst = function(data, position) {
    var $target = GLOBAL.parent.find(
      "div.mini-fluidic-placeholder-" + position
    );
    var $tpl = GLOBAL.parent.find(
      "#mini-fluidic-" + GLOBAL.learningList[position].type + "-tpl"
    );
    var template;
    template = Handlebars.compile($tpl.html());
    $target.html(template(data));
    GLOBAL.parent.find(".courseDetail-prompt-" + position).hide();

    if (GLOBAL.learningList[position].type === "program" &amp;&amp; data.showAsCourse) {
      $($target)
        .find(".captivatePrime-courses-list")
        .contents()
        .unwrap();
      $($target)
        .find(".captivatePrime-courses-container")
        .not(":last")
        .append("&lt;hr&gt;");
    }
    $target.show();

    $target.find(".captivatePrime-courses-title").on("click", function() {
      $(this)
        .parent()
        .find(".captivatePrime-modules-list")
        .slideToggle();
      var arrow = $(this).find(".captivatePrime-arrow");

      if ($(arrow).hasClass("down")) {
        $(arrow).removeClass("down");
      } else {
        $(arrow).addClass("down");
      }
    });

    $target.find(".captivatePrime-program-title").on("click", function() {
      $(this)
        .parent()
        .find(".captivatePrime-courses-list")
        .slideToggle();
      var arrow = $(this).find(".captivatePrime-arrow");

      if ($(arrow).hasClass("down")) {
        $(arrow).removeClass("down");
      } else {
        $(arrow).addClass("down");
      }
    });

    if (GLOBAL.learningPosition === GLOBAL.learningList.length) {
      _setPlayerElement();
      _setProgramStatus();
      _setProgressBar();
    }
    new Translate(data, locale, LOCALIZED_STRINGS).render();
  };
  var _doLearningDetail = function(position) {
    _getLearningDetail(
      GLOBAL.learningList[position].id,
      GLOBAL.learningList[position].type === "program"
        ? "learningProgram"
        : "course"
    ).then(function(resp) {
      if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
        if (resp.data.errorMessage) {
          _renderError(true, resp.data.errorMessage, false);
        } else {
          var data = resp.data;
          GLOBAL.learningPosition++;
          data.showAsCourse = GLOBAL.learningList[position].showAsCourse;

          if (data.isEnrolled) {
            if (!data.hasPassed) {
              GLOBAL.hasCompleted = false;
            }
            if (data.progress &gt; 0) {
              GLOBAL.hasProgress = true;
            }
          } else {
            GLOBAL.notEnrolledLO.type.push(GLOBAL.learningList[position].type);
            GLOBAL.notEnrolledLO.id.push(data.id);
            GLOBAL.notEnrolledLO.instanceId.push(data.instanceId);
            GLOBAL.isEnrolled = false;
          }
          _renderFirst(data, position);
        }
      } else if (resp.errorMessage === "400") {
        _renderError(true, _getTranslation(ERRORS.PLEASE_RELOAD_PAGE), false);
      } else {
        _renderError(true, resp.errorMessage, false);
      }
    });
  };
  var _initFirst = function() {
    var position = 0;

    for (; position &lt; GLOBAL.learningList.length; position++) {
      _doLearningDetail(position);
    }
  };

  $(document).bind("authenticateFailed", function() {
    _renderError($parent, _getTranslation(ERRORS.E_LEARNING_LOGOUT));
    $(this).unbind("authenticateFailed");
  });

  $(document).bind("authenticateFailed_partners", function() {
    _renderError($parent, _getTranslation(ERRORS.E_LEARNING_LOGOUT_EXT));
    $(this).unbind("authenticateFailed_partners");
  });

  $(document).bind("captivate", function() {
    _getData();

    // Determine target.. closest tab or reveal box, or the parent
    var target = $parent.closest(".tab-box,.revealContent,.vertical-tab");
    target = (target.length === 0) ? GLOBAL.parent : target[0];

    if (
      target.classList &amp;&amp;
      ((target.classList.contains("tab-box") &amp;&amp;
        target.classList.contains("tab-hide")) ||
        (target.classList.contains("revealContent") &amp;&amp;
          target.classList.contains("wayLeft")) ||
        (target.classList.contains("vertical-tab") &amp;&amp;
          target.classList.contains("tab-hide")))
    ) {
      // Options for the observer (which mutations to observe)
      var config = { attributes: true, attributeOldValue: true };
      // Callback function to execute when mutations are observed
      var callback = function(mutationsList, observer) {
        for (var i = 0; i &lt; mutationsList.length; i++) {
          if (
            mutationsList[i].type === "attributes" &amp;&amp;
            (mutationsList[i].attributeName === "min-width" ||
              (mutationsList[i].attributeName === "class" &amp;&amp;
                (isClassRemoved(mutationsList[i], "tab-hide") ||
                  isClassRemoved(mutationsList[i], "wayLeft"))))
          ) {
            _initFirst();
            observer.disconnect();
          }
        }
      };

      // Create an observer instance linked to the callback function
      var observerInstance = new MutationObserver(callback);
      observerInstance.observe(target, config);
    } else {
      _initFirst();
    }
    $(this).unbind("captivate");
  });
};

/**
 *
 * @type {{}}
 */
var CP = window.CP || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars _initFirst _renderError */
CP.FluidicPlayer = function($parent, learningPaths, learningIds, pullingTimer) {
  var ajax = new FUSION.Ajax();
  var _$parent = $parent;
  var _learningId = learningIds.split(",");
  var _learningPath = learningPaths.split(",");
  var _accessCode = "";
  var timeout = null;
  var _activeCourse = "";
  var _activeModule = "";
  var enrollCounter;
  var idCounter;
  var enrollChecker;
  var idSize = _learningId.length;
  var _instanceId = [_learningId.length];
  var _enrollId = [_learningId.length];
  var _getData = function() {
    var ca = document.cookie.split(";");

    for (var i = 0; i &lt; ca.length; i++) {
      var res = ca[i].split("=");
      if (
        res.length &gt; 1 &amp;&amp;
        res[0] &amp;&amp;
        res[1] &amp;&amp;
        res[0].trim().toLowerCase() === "access"
      ) {
        _accessCode = res[1];
      }
    }
  };
  var _renderError = function(errorMsg, showAlert) {
    var error_container = _$parent.find(".error-container");
    var error_list = error_container.find(".error-list");
    var error_message = error_list.find(".error-message");
    var showAlertIcon = (showAlert === undefined) ? true : showAlert;

    if (error_container.find(".table-container .error-icon") &amp;&amp; showAlertIcon) {
      error_container.find(".table-container .error-icon").show();
    } else if (error_container.find(".table-container .error-icon")) {
      error_container.find(".table-container .error-icon").hide();
    }

    if (error_message.length !== 0 &amp;&amp; error_message.hasClass("enrollFont")) {
      error_message.removeClass("enrollFont");
    }

    if (!errorMsg) {
      errorMsg =
        'Something went wrong - try again. If the problem persists, &lt;a href="mailto:cbchelp@adobe.com"&gt;contact us&lt;/a&gt;.';
    }

    error_container.show();
    error_list.append(
      "&lt;div class='error-message'&gt;&lt;span&gt;" + errorMsg + "&lt;/span&gt;&lt;/div&gt;"
    );
  };
  var _addClientEventToModuleTitleBar = function($target) {
    $target
      .find(".captivatePrime-courses-title-bar")
      .off("click")
      .on("click", function() {
        $(this)
          .find(".captivatePrime-arrow")
          .toggleClass("arrow-up");
        $(this)
          .parent()
          .find(".captivatePrime-courses-list")
          .slideToggle();
      });

    $target
      .find(".captivatePrime-modules-title-bar")
      .off("click")
      .on("click", function() {
        $(this)
          .find(".captivatePrime-arrow")
          .toggleClass("arrow-up");
        $(this)
          .parent()
          .find(".captivatePrime-modules-list")
          .slideToggle();
      });
  };
  var _renderFirst = function(data, position, learningPath) {
    var $target = _$parent.find(
      "div.captivatePrime-fluidic-placeholder-" + position
    );
    var $tpl;

    switch (learningPath) {
      case "learningProgram":
        $tpl = _$parent.find("#learningProgram-fluidic-tpl");
        break;
      case "course":
        $tpl = _$parent.find("#learningCourse-fluidic-tpl");
        break;
      default:
        break;
    }

    if ($tpl) {
      var template = Handlebars.compile($tpl.html());
      $target.html(template(data));
      _$parent.find(".captivatePrime-prompt-" + position).hide();
      $target.show();
      _addClientEventToModuleTitleBar($target);
    }
  };
  var _checkLearningObject = function(courseId, moduleId, accessCode) {
    return ajax.fetchData(
      {
        courseId: courseId,
        moduleId: moduleId,
        accessCode: accessCode
      },
      "/bin/captivate/checkCourseModule"
    );
  };
  var _enrollInCourse = function(courseId, courseInstanceId, accessCode) {
    return ajax.fetchData(
      {
        courseId: courseId,
        courseInstanceId: courseInstanceId,
        accessCode: accessCode,
        version: "v2"
      },
      "/bin/captivate/enrollCourse"
    );
  };
  var _enrollInProgram = function(learningId, learningInstanceId, accessCode) {
    return ajax.fetchData(
      {
        learningId: learningId,
        learningInstanceId: learningInstanceId,
        accessCode: accessCode,
        version: "v2"
      },
      "/bin/captivate/enrollLearning"
    );
  };
  var _getLearningProgram = function(learningId, learningPath, accessCode) {
    return ajax.fetchData(
      {
        learningId: learningId,
        learningPath: learningPath,
        accessCode: accessCode
      },
      "/bin/captivate/fluidicPlayer"
    );
  };
  var _afterEnrollment = function(resp, size, program) {
    if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.isSuccess) {
      enrollCounter++;
      // TODO: Add a better learning Path refresh
      if (enrollCounter === size) {
        _initFirst();
      }
    } else if (program) {
      _renderError(
        "We were not able to enroll you in program " +
          resp.data.idV1 +
          " - try again. If the problem persists, &lt;a href='mailto:cbchelp@adobe.com'&gt;contact us&lt;/a&gt; with this error message."
      );
    } else {
      _renderError(
        "We were not able to enroll you in course " +
          resp.data.idV1 +
          " - try again. If the problem persists, &lt;a href='mailto:cbchelp@adobe.com'&gt;contact us&lt;/a&gt; with this error message."
      );
    }
  };
  var _doEnrollment = function(size, enrollId, instanceId, program) {
    if (program) {
      _enrollInProgram(enrollId, instanceId, _accessCode).then(function(resp) {
        _afterEnrollment(resp, size, program);
      });
    } else {
      _enrollInCourse(enrollId, instanceId, _accessCode).then(function(resp) {
        _afterEnrollment(resp, size, program);
      });
    }
  };
  var _enrollLearningPath = function() {
    var i = 0;
    var size = _enrollId.length;
    enrollCounter = 0;

    if (_enrollId[0]) {
      for (; i &lt; size; i++) {
        _doEnrollment(
          size,
          _enrollId[i],
          _instanceId[i],
          _learningPath[i] === "learningProgram"
        );
      }
    }
  };
  var _addEnrollClickEvent = function() {
    var enrollment_container = _$parent.find(".error-enroll-btn");
    var learning_button = enrollment_container.find(
      ".fluidic-btn.captivatePrime-no-progress"
    );

    learning_button.text("Enroll");
    enrollment_container.show();

    learning_button.on("click", function() {
      _enrollLearningPath();
      enrollment_container.hide();
      learning_button.off("click");
    });
  };
  var _getProgress = function(parent) {
    var paths = parent.find(".captivatePrime-courses");
    var percentage = parent.find("span.learning-progress");
    var percentGraph = parent.find(".captivatePrime-progress-green");
    var learning_button = parent.find(
      ".fluidic-btn.captivatePrime-no-progress"
    );
    var progress = 0;
    var pathGrade = 0;
    var i = 0;
    var pathSize = paths.length;

    for (; i &lt; pathSize; i++) {
      var grades = $(paths[i]).find("[grade]");
      var courseSize = grades.length;
      var j = 0;
      pathGrade = 0;

      for (; j &lt; courseSize; j++) {
        pathGrade += parseInt($(grades[j]).attr("grade"), 10);
      }

      progress += Math.round(pathGrade / courseSize);
    }

    progress = Math.round(progress / pathSize);
    _$parent.find(".captivatePrime-courses").removeClass("not-enrolled");
    percentage.text(progress);
    percentGraph.attr("style", "width:" + progress + "%;");
    _$parent.find(".captivatePrime-status-container").show();

    if (progress === 100) {
      learning_button.text("Review");
    }
  };
  var checkLearningProgram = function(_$module) {
    var parentModule = _$module.closest(".captivatePrime-courses");
    var courseList = parentModule.find(
      ".captivatePrime-courses-list .captivatePrime-modules"
    );
    var checker = true;

    for (var i = 0; i &lt; courseList.length; i++) {
      if (
        !$(courseList[i])
          .find(".captivatePrime-modules-title-bar .checkmark")
          .hasClass("true")
      ) {
        checker = false;
      }
    }

    if (checker) {
      parentModule
        .find(".captivatePrime-courses-title-bar .checkmark")
        .addClass("true");
    }
  };
  var addCourseCompletionMark = function(_$module, progress) {
    var module = _$module;
    var titleBar;

    if (module.is("[course]")) {
      titleBar = module
        .closest(".captivatePrime-courses")
        .find(".captivatePrime-courses-title-bar");
    } else {
      titleBar = module
        .parents(".captivatePrime-modules")
        .find(".captivatePrime-modules-title-bar");
    }
    titleBar.attr("grade", progress);

    if (progress === 100) {
      var completionMark = titleBar.find(".checkmark");

      if (!completionMark.hasClass("true")) {
        completionMark.addClass("true");
      }
      if (!module.is("[course]")) {
        checkLearningProgram(module);
      }
    }
  };
  var addCompletedMark = function(moduleId, progress, isTestOut) {
    var module;

    if (isTestOut) {
      module = _$parent.find(".testout[value*='" + moduleId + "']");
    } else {
      module = _$parent.find(
        ".captivatePrime-modules-item[value*='" + moduleId + "']"
      );
      module.find(".checkmark").addClass("true");
    }
    addCourseCompletionMark(module, progress);
    _getProgress(_$parent);
  };
  var checkIfCompleted = function(courseId, moduleId, testOut) {
    clearInterval(timeout);
    var isTestOut = (testOut === undefined) ? false : testOut;

    if (timeout !== null) {
      var previousCourse = _activeCourse;
      var previousModule = _activeModule;
      var previousPlayedModule = _$parent.find(
        ".captivatePrime-modules-item[value*='" + previousModule + "']"
      );

      if (previousModule !== moduleId) {
        previousPlayedModule.removeClass("play");
      }
      _checkLearningObject(previousCourse, previousModule, _accessCode).then(
        function(resp) {
          if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.hasPassed) {
            addCompletedMark(
              previousModule,
              resp.data.parentProgress,
              isTestOut
            );
          }
        }
      );
    }
    _activeCourse = courseId;
    _activeModule = moduleId;

    timeout = setInterval(function() {
      _checkLearningObject(_activeCourse, _activeModule, _accessCode).then(
        function(resp) {
          if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.hasPassed) {
            clearInterval(timeout);
            addCompletedMark(
              _activeModule,
              resp.data.parentProgress,
              isTestOut
            );
          }
        }
      );
    }, parseInt(pullingTimer) * 1000);
  };
  var _addModulesClickEvent = function() {
    var learning_button = _$parent.find(
      ".fluidic-btn.captivatePrime-no-progress"
    );
    var _iFrame = _$parent.find(".playerIframe");
    var iframeContainer = _iFrame.closest(".player-container");
    var percentage = _$parent.find("span.learning-progress");
    var enroll_button = _$parent.find(".error-enroll-btn");
    var isReviewButton = false;

    enroll_button.hide();
    if (percentage.text() !== "100") {
      learning_button
        .text("Continue")
        .parent()
        .show();
    } else {
      isReviewButton = true;
      learning_button
        .text("Review")
        .parent()
        .show();
    }

    _$parent.find(".captivatePrime-modules-item").on("click", function(e) {
      var courseId = $(this).attr("name");
      var moduleId = $(this).attr("value");

      if (!$(this).hasClass("play")) {
        $(this).addClass("play");
      }

      iframeContainer.attr("style", "background-color: #000000");
      _iFrame.attr("style", "display: block; background-image: none;");
      _iFrame.attr(
        "src",
        "https://captivateprime.adobe.com/app/player?course_id=" +
          courseId +
          "&amp;access_token=" +
          _accessCode +
          "&amp;module_id=" +
          moduleId
      );
      checkIfCompleted(courseId, moduleId);
    });

    _$parent.find(".captivatePrime-courses .testout").on("click", function(e) {
      var courseId = $(this).attr("name");
      var moduleId = $(this).attr("value");

      iframeContainer.attr("style", "background-color: #000000");
      _iFrame.attr("style", "display: block; background-image: none;");
      _iFrame.attr(
        "src",
        "https://captivateprime.adobe.com/app/player?course_id=" +
          courseId +
          "&amp;access_token=" +
          _accessCode +
          "&amp;module_id=" +
          moduleId
      );
      checkIfCompleted(courseId, moduleId, true);
      e.stopImmediatePropagation();
    });

    learning_button.on("click", function() {
      // issue for review button is that it  can't find the first module.
      var currentModule = isReviewButton
        ? _$parent.find(".captivatePrime-modules-item").first()
        : _$parent
            .find(".captivatePrime-modules-item .checkmark:not(.true)")
            .first();
      var module = currentModule.closest(".captivatePrime-modules-item");
      var courseId = module.attr("name");
      var moduleId = module.attr("value");

      if (!module.closest(".captivatePrime-courses-list").is(":visible")) {
        module
          .closest(".captivatePrime-courses")
          .find(".captivatePrime-courses-title-bar")
          .click();
      }

      if (
        !module.is("[course]") &amp;&amp;
        !module.closest(".captivatePrime-modules-list").is(":visible")
      ) {
        module
          .parents(".captivatePrime-modules")
          .find(".captivatePrime-modules-title-bar")
          .click();
      }

      if (!$(module).hasClass("play")) {
        $(module).addClass("play");
      }
      iframeContainer.attr("style", "background-color: #000000");
      _iFrame.attr("style", "display: block; background-image: none;");
      _iFrame.attr(
        "src",
        "https://captivateprime.adobe.com/app/player?course_id=" +
          courseId +
          "&amp;access_token=" +
          _accessCode +
          "&amp;module_id=" +
          moduleId
      );
      checkIfCompleted(courseId, moduleId);
    });
  };
  var _doLearningProgram = function(error_list, error_container, position) {
    _getLearningProgram(
      _learningId[position],
      _learningPath[position],
      _accessCode
    ).then(function(resp) {
      if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
        _enrollId[position] = resp.data.id;
        _instanceId[position] = resp.data.instanceId;
        _renderFirst(resp.data, position, resp.data.learningPath);
        idCounter++;

        if (!resp.data.isEnrolled) {
          enrollChecker = false;
        }

        if (resp.data.errorMessage) {
          _renderError(resp.data.errorMessage);
        }
      } else if (resp.errorMessage === "400") {
        _renderError(
          'Please reload this web page. If you continue to see this message, &lt;a href="mailto:cbchelp@adobe.com"&gt;contact us&lt;/a&gt;. [21]'
        );
      } else {
        _renderError(resp.errorMessage);
      }

      if (idCounter === idSize) {
        switch (enrollChecker) {
          case true:
            _getProgress(_$parent);
            _addModulesClickEvent();
            break;
          case false:
            if (!error_list.hasClass("hasButton")) {
              error_list.addClass("hasButton");
            }

            if (error_list.find(".error-message").length === 0) {
              _renderError("Enroll to begin learning.", false);
              error_list.find(".error-message").addClass("enrollFont");
            }

            _addEnrollClickEvent();
            break;
          default:
            break;
        }
      }
    });
  };
  var _initFirst = function() {
    var i = 0;
    var error_container = _$parent.find(".error-container");
    var error_list = error_container.find(".error-list");

    error_container.hide();
    error_list.empty();
    idCounter = 0;
    enrollChecker = true;

    if (_learningId[0]) {
      for (; i &lt; idSize; i++) {
        _doLearningProgram(error_list, error_container, i);
      }
    }
  };

  $(document).bind("authenticateFailed", function() {
    _renderError(
      _$parent,
      "It appears you have been logged out of Adobe’s eLearning platform. To access this eLearning program, go to " +
        '&lt;a href="https://captivateprime.adobe.com/acapindex.html" target="_blank"&gt;Captivate Prime&lt;/a&gt; and enter your Adobe login credentials. ' +
        "Then come back to this page and refresh."
    );
    $(this).unbind("authenticateFailed");
  });

  $(document).bind("authenticateFailed_partners", function() {
    _renderError(
      _$parent,
      "It appears you have been logged out of Adobe’s eLearning platform. " +
        'To access this eLearning program, go to &lt;a href="https://captivateprime.adobe.com/acapindex.html" target="_blank"&gt;Captivate Prime&lt;/a&gt; ' +
        "and enter your APC credentials. Then come back to this page and refresh. If you continue to experience problems, contact the " +
        '&lt;a href="https://cbconnection.adobe.com/en/apc-helpdesk.html" target="_blank"&gt;APC Helpdesk.&lt;/a&gt;'
    );
    $(this).unbind("authenticateFailed_partners");
  });

  $(document).bind("captivate", function() {
    _getData();
    _initFirst();
    $(this).unbind("captivate");
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/*global AdobeMessagingExperienceClient console*/
FUSION.JarvisButton = function () {

    var _init = function() {
            var sourceInfo = {
                sourceType: 'button'
            };

            // Another button for the user to click to open Jarvis Chat
            $(".jarvis-button").click(function() {
                AdobeMessagingExperienceClient.openMessagingWindow(sourceInfo);
            });
        },

        onReady = function(callback) {
            if (document.readyState === 'complete') {
                window.setTimeout(callback, 0);
            } else {
                window.addEventListener('load', callback, false);
            }
        };

    onReady(function() {
        _init();
    });
};
/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.trackEventList = function (el) {
  var formatUtil = new FUSION.Formatter();
  var propUtil = new FUSION.Properties();
  var A = FUSION.ANALYTICS;
  var analyze = new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.EVENT_LIST);
  if (propUtil.checkNull(el.dataset.path)) {
    var path = formatUtil.setVal(el.dataset.path).decodeUnicodeSequence().getVal().trim();
    analyze.putEventData(A.KEYS.DESTINATION_PAGE, path, true);
  }
  if (propUtil.checkNull(el.dataset.title)) {
    var title = formatUtil.setVal(el.dataset.title).decodeEscapeSequence().removeLineBreaks().getVal().trim();
    analyze.putEventData(A.KEYS.TITLE, title, true);
  }
  analyze.setEvent(A.EV.CLICK.EVENT_LIST).track();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.EventList = function (uniqueId, dateList, currentPage) {
  var $COMP = $('#' + uniqueId);
  var _registerEventUtil = new RegisterEventUtil(currentPage);

  var _dateFormatter = function () {
    var dates = dateList.split(',');
    if ($COMP.length) {
      $($COMP)
        .find('.item-container')
        .each(function (index) {
          var eventDate = $(this).find('.event-date');
          var utcDate = moment.utc(dates[index], 'MM/DD/YYYY h:mm').toDate();
          var browserLang = window.navigator.userLanguage || window.navigator.language;
          var localDate = moment(utcDate).local().toDate();
          var options = { year: 'numeric', month: 'long', day: 'numeric' };
          var formattedDate = localDate.toLocaleDateString(browserLang, options);
          eventDate.text(formattedDate);
        });
    }
  };
  var onReady = function (callback) {
    if (document.readyState === 'complete') {
      window.setTimeout(callback, 0);
    } else {
      window.addEventListener('load', callback, false);
    }
  };
  var dotdotdotOps = {
    height: 11 * 12.31,
  };
  $COMP.find('.event-description').show().dotdotdot(dotdotdotOps);

  onReady(function () {
    _dateFormatter();
    _registerEventUtil.init($COMP);
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.trackDashboardLearningPath = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.DASHBOARD_LEARNING_PATH).track();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

Handlebars.registerHelper('emptyEvent', function (emptyMsg) {
  return new Handlebars.SafeString(emptyMsg);
});

var _split = function (stringVal) {
  if (typeof stringVal !== 'undefined' &amp;&amp; stringVal) {
    return stringVal.split(',').filter(function (val) {
      return typeof val !== 'undefined' &amp;&amp; val;
    });
  }
  return [];
};

FUSION.DashboardEventList = function (props) {
  var $PARENT = $(props.id);
  var LIMIT_DEFAULT = 4;
  var _calendarEventPath = props.calPath;
  var _eventListLimit = props.limit ? parseInt(props.limit) : LIMIT_DEFAULT;
  var _viewAllUrl = props.viewAllUrl;
  var $VIEW_ALL_BTN = $PARENT.find('.event-tab-control');
  var _registerEventUtil = new RegisterEventUtil(props.currentPage);
  var _emptyMessage = props.emptyMessage;
  var _isLoginUser = 'true' === props.isLoginUser;

  var CONST = {
    cbcEventSearchResultUrl: '/bin/fusion/search/eventfilter?currentPage=' + props.currentPage,
    TAB_MY_EVENTS: 'myEvents',
    TAB_UPCOMING: 'upcoming',
    TAB_RECENT: 'recent',
    ATTEND_AHEAD_MIN: 60,
    FUSION_EVENT_REGION_TAG: 'fusion:event-region',
    MOMENT_JS_DEFAULT_DATE_FORMAT: 'MM/DD/YYYY HH:mm',
  };

  var _eventDataModel = {
    adobeConnectEvent: {
      tagName: CONST.TAB_MY_EVENTS,
      apiUrl: props.currentPage + '.adobeconnect.registeredEvents.json',
      eventData: [],
      sort: 'EVENT_DATE_ASC',
      isDirty: false,
      timeline: 'registered',
      hiddenRegistered: false,
      dateRange: {
        beforeUnit: 'day',
        beforeValue: 1,
        afterUnit: 'year',
        afterValue: 3,
      },
      filterDisqualifiedTag: false,
      hide: true,
    },
    cbcUpcomingEvent: {
      tagName: CONST.TAB_UPCOMING,
      apiUrl: props.currentPage + '.adobeconnect.upcomingEvents.json',
      eventData: [],
      sort: 'EVENT_DATE_ASC',
      isDirty: false,
      timeline: 'upcoming',
      hiddenRegistered: false,
      dateRange: {
        beforeUnit: 'day',
        beforeValue: -1,
        afterUnit: 'year',
        afterValue: 3,
      },
      filterDisqualifiedTag: true,
      hide: false,
    },
    cbcRecentEvent: {
      tagName: CONST.TAB_RECENT,
      apiUrl: props.currentPage + '.adobeconnect.recentEvents.json',
      eventData: [],
      sort: 'EVENT_DATE_DESC',
      isDirty: false,
      timeline: 'past',
      hiddenRegistered: true,
      dateRange: {
        beforeUnit: 'year',
        beforeValue: 3,
        afterUnit: '',
        afterValue: 0,
      },
      filterDisqualifiedTag: true,
      hide: false,
    },
  };

  var _loadingSpinner = function () {
    var $CONTAINER = $PARENT.find('.dashboard-event-contents-goes-here');
    $CONTAINER.empty();
    $CONTAINER.append('&lt;div id="loadingSpinner"&gt;&lt;div class="glyphicon glyphicon-refresh spinning"&gt;&lt;/div&gt;&lt;/div&gt;');
    $CONTAINER.find('#loadingSpinner').fadeIn(500);
  };

  var _determineDateRange = function (eventModel) {
    var startDate;
    var endDate;

    if (eventModel.dateRange.beforeValue) {
      startDate = moment().subtract(eventModel.dateRange.beforeValue, eventModel.dateRange.beforeUnit).format();
    } else {
      startDate = moment().format();
    }

    if (eventModel.dateRange.afterValue) {
      endDate = moment().add(eventModel.dateRange.afterValue, eventModel.dateRange.afterUnit).format();
    } else {
      endDate = moment().format();
    }

    return startDate + '_' + endDate;
  };

  var _formatCbcCalenderEvent = function (respond) {
    var searchList = respond.data.searchList;

    for (let thisEvent of searchList) {
      var thisEventDate = thisEvent.date;
      var thisEventStartMoment = moment.utc(thisEventDate, CONST.MOMENT_JS_DEFAULT_DATE_FORMAT).local();
      var thisEventEndMoment = moment.utc(thisEvent.endDate, CONST.MOMENT_JS_DEFAULT_DATE_FORMAT).local();

      var now = moment().local();

      if (thisEventEndMoment.isValid()) {
        thisEvent.activeEvent = !now.isAfter(thisEventEndMoment);
      } else {
        thisEvent.activeEvent = now.isSame(thisEventStartMoment, 'day') || now.isBefore(thisEventStartMoment);
      }

      thisEvent.month = thisEventStartMoment.format('MMM');
      thisEvent.day = thisEventStartMoment.format('DD');

      if (thisEventEndMoment.isValid() &amp;&amp; !thisEventStartMoment.isSame(thisEventEndMoment, 'day')) {
        thisEvent.hour = 'MULTI-DAY';
      } else {
        thisEvent.hour = thisEventStartMoment.format('LT');
      }
    }

    return searchList;
  };

  var _numberOfTag = function (mapOfTags, targetTagPath) {
    if (!mapOfTags || !targetTagPath) {
      return 0;
    }

    var listOfTagsStartsWithTagPath = Object.keys(mapOfTags).filter(function (tagPath) {
      return tagPath.startsWith(targetTagPath);
    });

    return listOfTagsStartsWithTagPath.length;
  };

  var compareNumberOfRegionTags = function () {
    return function (a, b) {
      const numberOfRegionTagA = a.tags ? _numberOfTag(a.tags, CONST.FUSION_EVENT_REGION_TAG).length : 0;
      const numberOfRegionTagB = b.tags ? _numberOfTag(b.tags, CONST.FUSION_EVENT_REGION_TAG).length : 0;

      return numberOfRegionTagB - numberOfRegionTagA;
    };
  };

  const _buildQueryForEvents = function (eventModel) {
    return {
      sort: eventModel.sort,
      urlPathPrefix:
        window.location.protocol +
        '//' +
        window.location.hostname +
        (window.location.port ? ':' + window.location.port : ''),
      eventParentPath: _calendarEventPath,
      dates: _determineDateRange(eventModel),
    };
  };

  var _setViewAllUrl = function (eventModel) {
    if (!$VIEW_ALL_BTN || $VIEW_ALL_BTN.length !== 1 || typeof _viewAllUrl === 'undefined' || _viewAllUrl === '') {
      return;
    }
    var url = _viewAllUrl + '.html?timeline=' + eventModel.timeline;
    $VIEW_ALL_BTN.attr('data-title', 'Calendar of events | View all');
    $VIEW_ALL_BTN.attr('data-path', url);
    $VIEW_ALL_BTN.attr('href', url);
  };

  var _renderEventList = function (eventData) {
    var $LIST_TEMPLATE = $PARENT.find('#dashboard-event-list-template');
    var tpl = Handlebars.compile($LIST_TEMPLATE.html());
    var html = tpl({
      events: eventData,
      emptyMessage: _emptyMessage,
      isLoginUser: _isLoginUser,
    });

    var $CONTAINER = $PARENT.find('.dashboard-event-contents-goes-here');
    $CONTAINER.empty();
    $CONTAINER.append($(html)).hide().fadeIn(1000);

    _registerEventUtil.init($CONTAINER);
  };

  var _filterRegisteredEvent = function (eventModel, cbcCalendarEventList) {
    if (!eventModel.hiddenRegistered) {
      return cbcCalendarEventList;
    } else {
      return cbcCalendarEventList.filter(function (event) {
        return !event.registeredEvent;
      });
    }
  };

  var _fetchAndRenderEventList = function (eventModel) {
    _loadingSpinner();

    if (eventModel.eventData.length !== 0 &amp;&amp; !eventModel.isDirty) {
      _renderEventList(eventModel.eventData);
    } else {
      new FUSION.Ajax()
        .fetchData(_buildQueryForEvents(eventModel), eventModel.apiUrl)
        .done(function (resp) {
          if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
            var formatCbcCalenderEvent = _formatCbcCalenderEvent(resp);

            formatCbcCalenderEvent = _filterRegisteredEvent(eventModel, formatCbcCalenderEvent);
            formatCbcCalenderEvent.sort(compareNumberOfRegionTags());

            formatCbcCalenderEvent.splice(_eventListLimit);
            eventModel.eventData = formatCbcCalenderEvent;

            return _renderEventList(eventModel.eventData);
          }
          return _renderEventList([]);
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
          console.error('_findCyberbiaEventsAndRender failed.');
        });
    }
  };

  var _loadSelectedEventTag = function ($eventSelector) {
    $PARENT.find('.events-selector').removeClass('selected');
    $eventSelector.addClass('selected');

    var eventModel = _eventDataModel[$eventSelector.attr('name')];
    if (eventModel) {
      _fetchAndRenderEventList(eventModel);
    }
    _setViewAllUrl(eventModel);
  };

  var _bindEventsSelector = function () {
    $PARENT.find('.events-selector').click(function () {
      _loadSelectedEventTag($(this));
    });
  };

  var _hideEventModel = function (modelName) {
    var theModel = $PARENT.find("[name='" + modelName + "']");
    theModel.hide();
    var divider = theModel.next();
    if (divider.hasClass('events-selector-divider')) {
      divider.hide();
    }
  };

  var _handleHideEventModel = function () {
    Object.keys(_eventDataModel).forEach((modelName) =&gt; {
      if (_eventDataModel[modelName].hide) {
        _hideEventModel(modelName);
      }
    });
  };

  var init = function () {
    _handleHideEventModel();
    _bindEventsSelector();
    _loadSelectedEventTag($PARENT.find("[name='cbcUpcomingEvent']"));
  };

  init();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION._trackDashboardEvent = function (el, clickEvent) {
  var formatUtil = new FUSION.Formatter();
  var propUtil = new FUSION.Properties();

  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  if (propUtil.checkNull(el.dataset.adobeConnectRoomId)) {
    var roomId = formatUtil.setVal(el.dataset.adobeConnectRoomId).getVal().trim();
    dashboardAnalyticsBuilder.putEventData(FUSION.ANALYTICS.KEYS.ADOBE_CONNECT_ROOM_ID, roomId, true);
  }
  dashboardAnalyticsBuilder.setEvent(clickEvent).track();
};

FUSION.trackDashboardEventList = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.DASHBOARD_EVENT_LIST).track();
};

FUSION.trackDashboardEventViewAll = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.DASHBOARD_EVENT_VIEW_ALL).track();
};

FUSION.trackDashboardEventRegister = function (el) {
  FUSION._trackDashboardEvent(el, FUSION.ANALYTICS.EV.CLICK.EVENT_REGISTER);
};

FUSION.trackDashboardEventJoin = function (el) {
  FUSION._trackDashboardEvent(el, FUSION.ANALYTICS.EV.CLICK.EVENT_JOIN);
};

FUSION.trackDashboardEventTabNavigation = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.TAB_NAVIGATION).track();
};

Handlebars.registerHelper('emptyLearning', function (emptyMsg) {
  return new Handlebars.SafeString(emptyMsg);
});

Handlebars.registerHelper('gradeClass', function (str) {
  var progress = parseInt(str);
  var className = 'p' + str;

  if (progress &gt; 50) {
    className += ' over50';
  }
  return className;
});

Handlebars.registerHelper('gradeStyle', function (str) {
  var progress = parseInt(str);

  return 'transform: rotate(' + (progress * 3.6 - 90) + 'deg) translate(27px);';
});

Handlebars.registerHelper('formatDueDate', function (str) {
  if (str === 'No Deadline') {
    return str;
  }
  moment.locale('en');

  return 'Due: ' + moment(str).local().format('MMM D, YYYY');
});

Handlebars.registerHelper('isDue', function (str) {
  var className = '';
  var now;
  moment.locale('en');
  now = moment(new Date());

  if (moment(str).isBefore(now)) {
    className = 'pastDue';
  } else {
    now = now.add(7, 'days');

    if (moment(str).isBefore(now)) {
      className = 'dueInWeek';
    }
  }
  return className;
});

Handlebars.registerHelper('position', function (index, selected) {
  return index === selected ? 'active' : '';
});

Handlebars.registerHelper('progressButton', function (str) {
  var progress = parseInt(str);
  var buttonName;

  if (progress === 0) {
    buttonName = 'START';
  } else if (progress &gt; 0 &amp;&amp; progress &lt; 100) {
    buttonName = 'CONTINUE';
  } else {
    buttonName = 'REVIEW';
  }
  return buttonName;
});

Handlebars.registerHelper('checkRowStart', function (index, block) {
  if (index % 3 === 0 || index === 0) {
    return block.fn(this);
  }
  return '';
});

Handlebars.registerHelper('checkRowEnd', function (index, length, block) {
  if ((index + 1) % 3 === 0 || index + 1 === length) {
    return block.fn(this);
  }
  return '';
});

Handlebars.registerHelper('emptyMessage', function (str) {
  var msg;
  if (str === true) {
    msg = 'No to-do items. Awesome!';
  } else {
    msg = 'No completed items yet.';
  }
  return msg;
});

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.DashboardELearning = function (props) {
  var $PARENT = $(props.id);
  var LIMIT_DEFAULT = 4;
  var _cpCourseIdPagePathPageTitleMap = {};
  var _cpProgramIdPagePathPageTitleMap = {};
  var _eLearningRootPath = props.eLearningUrl;
  var _limit = props.limit ? parseInt(props.limit) : LIMIT_DEFAULT;
  var _accessCode = '';
  var _type = props.type;
  var _emptyMessage = props.emptyMessage;

  var CONST = {
    TAB_IN_PROGRESS: 'in-progress',
    TAB_COMPLETED: 'completed',
    TAB_RECOMMENDED: 'recommended',
    TAB_ALL: 'all',
    CAPT_PROGRAM_URL:
      '/primeapi/v2/learningObjects/learningProgram:{0}?include=enrollment,instances.loResources,subLOs.enrollment.loResourceGrades,subLOs.instances.loResources.resources,subLOs.supplementaryResources',
    CAPT_COURSE_URL:
      '/primeapi/v2/learningObjects/course:{0}?include=enrollment.loResourceGrades,instances.loResources.resources,supplementaryResources',
    CAPT_HOST: 'https://captivateprime.adobe.com',
    CBC_LEARNING_URL: props.currentPage + '.adobeconnect.recommended.json',
    CAPT_LEARNING_OBJECT_COURSE_PREFIX: 'course:',
    CAPT_LEARNING_OBJECT_PROGRAM_PREFIX: 'learningProgram:',
  };

  var _eLearningModel = {
    in_progress: {
      tagName: CONST.TAB_IN_PROGRESS,
      learningData: [],
      isCaptivatePrime: true,
      initialized: false,
      displayType: ['component', 'page'],
    },
    completed: {
      tagName: CONST.TAB_COMPLETED,
      learningData: [],
      isCaptivatePrime: true,
      initialized: false,
      displayType: ['component', 'page'],
    },
    recommended: {
      tagName: CONST.TAB_RECOMMENDED,
      learningData: [],
      isCaptivatePrime: false,
      initialized: false,
      displayType: ['component', 'page'],
    },
    all: {
      tagName: CONST.TAB_ALL,
      learningData: [],
      isCaptivatePrime: false,
      initialized: false,
      displayType: ['page'],
    },
  };

  var compareProgress = function (ascending) {
    return function (a, b) {
      const progressA = a.progress;
      const progressB = b.progress;

      if (ascending) {
        return progressB - progressA;
      } else {
        return progressA - progressB;
      }
    };
  };

  var _compareTitle = function (a, b, ascending) {
    const titleA = a.cbcTitle;
    const titleB = b.cbcTitle;

    if (ascending) {
      if (titleA &lt; titleB) {
        return -1;
      }
      if (titleA &gt; titleB) {
        return 1;
      }
      return 0;
    } else {
      if (titleA &lt; titleB) {
        return 1;
      }
      if (titleA &gt; titleB) {
        return -1;
      }
      return 0;
    }
  };

  var compareTitle = function (ascending) {
    return function (a, b) {
      return _compareTitle(a, b, ascending);
    };
  };

  var compareTags = function (ascending) {
    return function (a, b) {
      const numberOfTagMatchedA = a.tags ? Object.keys(a.tags).length : 0;
      const numberOfTagMatchedB = b.tags ? Object.keys(b.tags).length : 0;

      if (numberOfTagMatchedA === numberOfTagMatchedB) {
        return _compareTitle(a, b, ascending);
      } else {
        if (ascending) {
          return numberOfTagMatchedB - numberOfTagMatchedA;
        } else {
          return numberOfTagMatchedA - numberOfTagMatchedB;
        }
      }
    };
  };

  var _loadingSpinner = function () {
    var $CONTAINER = $PARENT.find('.dashboard-learning-contents-goes-here');
    $CONTAINER.empty();
    $CONTAINER.append(
      '&lt;div id="learningLoadingSpinner"&gt;&lt;div class="glyphicon glyphicon-refresh spinning"&gt;&lt;/div&gt;&lt;/div&gt;'
    );
    $CONTAINER.find('#loadingSpinner').fadeIn(500);
  };

  var _getIdFromLearningObjectId = function (learningObjectId) {
    if (
      typeof learningObjectId !== 'undefined' &amp;&amp;
      (learningObjectId.startsWith(CONST.CAPT_LEARNING_OBJECT_COURSE_PREFIX) ||
        learningObjectId.startsWith(CONST.CAPT_LEARNING_OBJECT_PROGRAM_PREFIX))
    ) {
      return learningObjectId.substring(learningObjectId.indexOf(':') + 1);
    } else {
      return '';
    }
  };

  var _getAccessCodeFromCookie = function () {
    var ca = document.cookie.split(';');

    for (var i = 0; i &lt; ca.length; i++) {
      var res = ca[i].split('=');
      if (typeof res[0] !== 'undefined' &amp;&amp; typeof res[1] !== 'undefined' &amp;&amp; res[0].trim() === 'access') {
        return res[1];
      }
    }

    return '';
  };

  var _fetchCaptivateApi = function (url, accessToken) {
    return new Promise((resolve, reject) =&gt; {
      $.ajax({
        url: url,
        headers: {
          Accept: 'application/vnd.api+json',
          Authorization: 'oauth ' + accessToken,
        },
        success: function (response) {
          resolve(response);
        },
        error: function (xhr) {
          reject(xhr);
        },
      });
    });
  };

  var _renderEnrollmentList = function (eLearningDataList) {
    var $CONTAINER = $PARENT.find('.dashboard-learning-contents-goes-here');

    var $LIST_TEMPLATE = $PARENT.find('#dashboard-learning-list-template');
    var tpl = Handlebars.compile($LIST_TEMPLATE.html());
    var html = '';

    if (_type === 'component') {
      eLearningDataList.splice(_limit);
    }

    html = tpl({
      list: eLearningDataList,
      emptyMessage: _emptyMessage,
    });

    $CONTAINER.empty();
    $CONTAINER.append($(html)).hide().fadeIn(1000);
  };

  var _fetchCaptivateCourse = function (courseId, accessToken) {
    return _fetchCaptivateApi(CONST.CAPT_HOST + CONST.CAPT_COURSE_URL.replace('{0}', courseId), accessToken);
  };

  var _fetchCaptivateProgram = function (programId, accessToken) {
    return _fetchCaptivateApi(CONST.CAPT_HOST + CONST.CAPT_PROGRAM_URL.replace('{0}', programId), accessToken);
  };

  var sectionContainsInstanceEnrollment = function (learningObjectInstanceEnrollment, learningObjectSectionsIds) {
    var sectionMatched = false;
    learningObjectSectionsIds.forEach((learningObjectSectionsIds) =&gt; {
      if (learningObjectInstanceEnrollment.id.startsWith(learningObjectSectionsIds)) {
        sectionMatched = true;
      }
    });
    return sectionMatched;
  };

  var getProgressBySections = function (learningObjectInstanceEnrollment, learningObjectSectionsIds) {
    let progress = 0;

    learningObjectInstanceEnrollment.forEach((eachLearningObjectInstanceEnrollment) =&gt; {
      if (sectionContainsInstanceEnrollment(eachLearningObjectInstanceEnrollment, learningObjectSectionsIds)) {
        progress += eachLearningObjectInstanceEnrollment.attributes.progressPercent
          ? eachLearningObjectInstanceEnrollment.attributes.progressPercent
          : 0;
      }
    });

    return Math.round(progress / learningObjectSectionsIds.length);
  };

  var _parseCaptivatePrimeResponse = function (learningObject) {
    var enrollment = {};

    let learningObjectAttribute = learningObject.data.attributes;
    if (learningObjectAttribute) {
      if (learningObjectAttribute.localizedMetadata &amp;&amp; learningObjectAttribute.localizedMetadata.length &gt;= 1)
        enrollment.cpTitle = learningObjectAttribute.localizedMetadata[0].name;
      if (learningObjectAttribute.enrollmentType) enrollment.enrollment = learningObjectAttribute.enrollmentType;
    }

    enrollment.id = learningObject.data.id;
    let included = learningObject.included;

    if (included) {
      let learningObjectInstance = included.filter((include) =&gt; include.type === 'learningObjectInstance');
      if (learningObjectInstance &amp;&amp; learningObjectInstance.length &gt;= 1) {
        let deadline = learningObjectInstance[0].attributes.completionDeadline;
        enrollment.dueDate = deadline;
      }

      let learningObjectInstanceEnrollment = included.filter(
        (include) =&gt; include.type === 'learningObjectInstanceEnrollment'
      );
      if (learningObjectInstanceEnrollment &amp;&amp; learningObjectInstanceEnrollment.length &gt;= 1) {
        if (enrollment.id.includes('course')) {
          enrollment.progress = learningObjectInstanceEnrollment[0].attributes.progressPercent;
        } else {
          if (learningObject.data.attributes.sections &amp;&amp; learningObject.data.attributes.sections.length &gt;= 1) {
            enrollment.progress = getProgressBySections(
              learningObjectInstanceEnrollment,
              learningObject.data.attributes.sections[0].loIds
            );
          } else {
            let progress = 0;
            learningObjectInstanceEnrollment.forEach((lObj) =&gt; {
              progress += lObj.attributes.progressPercent ? lObj.attributes.progressPercent : 0;
            });
            enrollment.progress = Math.round(progress / learningObject.data.relationships.subLOs.data.length);
          }
        }
        enrollment.role = learningObjectInstanceEnrollment[0].attributes.enrollmentSource;

        enrollment.enrollDate = learningObjectInstanceEnrollment[0].attributes.dateEnrolled;
      }
      if (typeof enrollment.progress === 'undefined') {
        enrollment.progress = 0;
      }
    }

    return enrollment;
  };

  var _assignCbcTitlePath = function (learningObject) {
    var learningObjectId = learningObject.id;
    var id = _getIdFromLearningObjectId(learningObjectId);

    if (learningObjectId.startsWith(CONST.CAPT_LEARNING_OBJECT_COURSE_PREFIX) &amp;&amp; _cpCourseIdPagePathPageTitleMap[id]) {
      learningObject.cbcTitle = _cpCourseIdPagePathPageTitleMap[id].title;
      learningObject.cbcPath = _cpCourseIdPagePathPageTitleMap[id].path;
    } else if (
      learningObjectId.startsWith(CONST.CAPT_LEARNING_OBJECT_PROGRAM_PREFIX) &amp;&amp;
      _cpProgramIdPagePathPageTitleMap[id]
    ) {
      learningObject.cbcTitle = _cpProgramIdPagePathPageTitleMap[id].title;
      learningObject.cbcPath = _cpProgramIdPagePathPageTitleMap[id].path;
    }
    return learningObject;
  };

  var _parsePageTitlePagePath = function (searchListResponseData) {
    var learningObjectList = [];

    if (searchListResponseData &amp;&amp; searchListResponseData.counter &gt; 0 &amp;&amp; searchListResponseData.searchList) {
      searchListResponseData.searchList.forEach((searchDetail) =&gt; {
        var enrollment = {
          cbcTitle: searchDetail.title,
          cbcPath: searchDetail.path,
          progress: 0,
          tags: searchDetail.tags,
        };
        learningObjectList.push(enrollment);
      });
    }
    _eLearningModel.recommended.learningData = learningObjectList;
  };

  var _feedInProgressAndCompletedData = function (learningData) {
    if (learningData.progress === 100) {
      _eLearningModel.completed.learningData.push(learningData);
    } else if (learningData.progress &gt; 0) {
      _eLearningModel.in_progress.learningData.push(learningData);
    }

    _eLearningModel.all.learningData.push(learningData);
  };

  var _removeEnrolledCourses = function () {
    var inProgressPagePathList = _eLearningModel.in_progress.learningData.map((data) =&gt; data.cbcPath);
    var completedPagePathList = _eLearningModel.completed.learningData.map((data) =&gt; data.cbcPath);

    var allLearningPagePathList = inProgressPagePathList.concat(completedPagePathList);

    var cleanPagePath = _eLearningModel.recommended.learningData.filter(function (data) {
      return !allLearningPagePathList.includes(data.cbcPath);
    });

    _eLearningModel.recommended.learningData = cleanPagePath;
  };

  var _fetchCaptivatePrimeCourses = function (eLearningModel) {
    let courseDetailPromises = [];
    var courseIds = Object.keys(_cpCourseIdPagePathPageTitleMap);
    var programIds = Object.keys(_cpProgramIdPagePathPageTitleMap);

    courseIds.forEach((courseId) =&gt; courseDetailPromises.push(_fetchCaptivateCourse(courseId, _accessCode)));
    programIds.forEach((programId) =&gt; courseDetailPromises.push(_fetchCaptivateProgram(programId, _accessCode)));

    return new Promise((resolve) =&gt; {
      Promise.allSettled(courseDetailPromises).then((promisesResponses) =&gt; {
        promisesResponses.forEach((promisesResponse) =&gt; {
          if (promisesResponse &amp;&amp; promisesResponse.status === 'fulfilled' &amp;&amp; promisesResponse.value) {
            var eachCaptivatePrimeLearningData = _parseCaptivatePrimeResponse(promisesResponse.value);
            var eachLearningDate = _assignCbcTitlePath(eachCaptivatePrimeLearningData);

            _feedInProgressAndCompletedData(eachLearningDate);
          }
        });

        _eLearningModel.in_progress.learningData.sort(compareProgress(true));
        _eLearningModel.completed.learningData.sort(compareTitle(true));
        _eLearningModel.in_progress.initialized = true;
        _eLearningModel.completed.initialized = true;

        resolve(eLearningModel.learningData);
      });
    });
  };

  var _fetchUserPreferenceCourses = function (eLearningModel) {
    return new Promise((resolve) =&gt; {
      $.ajax({
        url: CONST.CBC_LEARNING_URL,
        data: { resourcePath: _eLearningRootPath },
        success: function (response) {
          if (response &amp;&amp; response.success &amp;&amp; response.data) {
            _parsePageTitlePagePath(response.data);
            _removeEnrolledCourses();

            eLearningModel.learningData.sort(compareTags(true));
            eLearningModel.initialized = true;
            resolve(eLearningModel.learningData);
          }
        },
      });
    });
  };

  var _renderSelectedELearning = function ($eLearningSelector) {
    $PARENT.find('.learning-selector').removeClass('selected');
    $eLearningSelector.addClass('selected');

    var eLearningModel = _eLearningModel[$eLearningSelector.attr('name')];

    if (eLearningModel &amp;&amp; eLearningModel.learningData &amp;&amp; eLearningModel.initialized) {
      _renderEnrollmentList(eLearningModel.learningData.slice());
    } else {
      if (eLearningModel.isCaptivatePrime) {
        _fetchCaptivatePrimeCourses(eLearningModel).then(function (learningData) {
          _renderEnrollmentList(learningData.slice());
        });
      } else {
        _fetchUserPreferenceCourses(eLearningModel).then(function (learningData) {
          _renderEnrollmentList(learningData.slice());
        });
      }
    }
  };

  var _bindLearningSelector = function () {
    $PARENT.find('.learning-selector').click(function () {
      _loadingSpinner();
      _renderSelectedELearning($(this));
    });
  };

  var _initLearningSelector = function () {
    var $allLearningSelector = $PARENT.find('.learning-selector');

    $allLearningSelector.each(function () {
      var $eLearningSelector = $(this);
      var eLearningModel = _eLearningModel[$eLearningSelector.attr('name')];

      if (eLearningModel &amp;&amp; eLearningModel.displayType.includes(_type)) {
        $eLearningSelector.removeClass('hidden');
        $eLearningSelector
          .siblings('.learning-selector-divider.show-if-' + eLearningModel.tagName)
          .removeClass('hidden');
      }
    });
  };

  $(document).bind('captivate', function () {
    _accessCode = _getAccessCodeFromCookie();

    _bindLearningSelector();
    _loadingSpinner();
    _renderSelectedELearning($PARENT.find("[name='in_progress']"));

    $(this).unbind('captivate');
  });

  var _parseCourseIdTitleUriIntoMap = function ($container) {
    var courseIdTitleUriMap = {};
    $container.find('li').each(function () {
      if (this.dataset &amp;&amp; this.dataset.courseId &amp;&amp; this.dataset.uri) {
        courseIdTitleUriMap[this.dataset.courseId] = {
          title: this.dataset.title,
          path: this.dataset.uri,
        };
      }
    });
    return courseIdTitleUriMap;
  };

  var _getAllExistingCaptivatePrimeCourseAndProgram = function () {
    _cpCourseIdPagePathPageTitleMap = _parseCourseIdTitleUriIntoMap($PARENT.find('#cp-cbc-course-uri'));
    _cpProgramIdPagePathPageTitleMap = _parseCourseIdTitleUriIntoMap($PARENT.find('#cp-cbc-program-uri'));
  };

  var init = function () {
    _initLearningSelector();
    _getAllExistingCaptivatePrimeCourseAndProgram();
  };

  init();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.trackDashboardELearningList = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.DASHBOARD_LEARNING_COURSE_LIST).track();
};

FUSION.trackDashboardELearningViewAll = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.DASHBOARD_LEARNING_VIEW_ALL).track();
};

FUSION.trackDashboardELearningTabNavigation = function (el) {
  var dashboardAnalyticsBuilder = FUSION.DashboardAnalyticsBuilder(el);
  dashboardAnalyticsBuilder.setEvent(FUSION.ANALYTICS.EV.CLICK.TAB_NAVIGATION).track();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.cyberbiaOneClickComponent = function (currentPage) {
  var CYBERBIA_ONECLICK_REGISTERED_EVENTS_ENDPOINT = currentPage + '.cyberbiaOneclick.registeredEvents.json';
  var CYBERBIA_ONECLICK_REGISTER_ENDPOINT = currentPage + '.cyberbiaOneclick.register.json';
  var CYBERBIA_ONECLICK_JOIN_URL_ENDPOINT = currentPage + '.cyberbiaOneclick.join.json';

  var startSpinner = function ($submitBtn) {
    var btnWidth = $submitBtn.width();
    var $spinner = $('&lt;i class="fa fa-spinner fa-spin"&gt;&lt;/i&gt;');

    $spinner.width(btnWidth);
    $submitBtn.empty();
    $submitBtn.append($spinner);
  };

  var stopSpinner = function ($submitBtn) {
    $submitBtn.empty();
    $submitBtn.text(Granite.I18n.get('SUBMIT'));
  };

  var displayJsonToTextArea = function ($textarea, resp) {
    if (resp.success) {
      $textarea.val(JSON.stringify(resp.data, undefined, 4));
    } else {
      $textarea.val(resp.errorMessage);
    }
  };

  $('#registeredEventEmailSubmit').click(function () {
    var $submitBtn = $(this);
    startSpinner($submitBtn);

    new FUSION.Ajax()
      .fetchData({ email: $('#registeredEvent').val() }, CYBERBIA_ONECLICK_REGISTERED_EVENTS_ENDPOINT)
      .done(function (resp) {
        stopSpinner($submitBtn);
        if (resp) {
          displayJsonToTextArea($('#registeredEventResult'), resp);
        } else {
          window.console.error('Failed to get registered event');
        }
      });
  });

  $('#toRegisterSubmit').click(function () {
    var $submitBtn = $(this);
    startSpinner($submitBtn);

    new FUSION.Ajax()
      .postData(
        {
          email: $('#toRegisterEmail').val(),
          firstName: $('#toRegisterFirstName').val(),
          lastName: $('#toRegisterLastName').val(),
          adobeConnectRoomId: $('#toRegisterRoomId').val(),
        },
        CYBERBIA_ONECLICK_REGISTER_ENDPOINT
      )
      .done(function (resp) {
        stopSpinner($submitBtn);

        if (resp) {
          displayJsonToTextArea($('#toRegisterResult'), resp);
        } else {
          window.console.error('Failed to get register event');
        }
      });
  });

  $('#joinUrlubmit').click(function () {
    var $submitBtn = $(this);
    startSpinner($submitBtn);

    new FUSION.Ajax()
      .fetchData(
        {
          email: $('#joinUrlEmail').val(),
          adobeConnectRoomId: $('#joinUrlRoomId').val(),
        },
        CYBERBIA_ONECLICK_JOIN_URL_ENDPOINT
      )
      .done(function (resp) {
        stopSpinner($submitBtn);
        if (resp) {
          displayJsonToTextArea($('#joinUrlResult'), resp);
        } else {
          window.console.error('Failed to get join url');
        }
      });
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.DashboardAnalyticsBuilder = function (el) {
  var analyze = new FUSION.AnalyticsBuilder(FUSION.ANALYTICS.SET_PTS.PAGE.LEARNING_DASHBOARD);
  analyze.setTitleAndPath(el);
  return analyze;
};

/**
 *
 * @type {{}}
 */
var CP = window.CP || {};

/**
 *
 * @type {{init}}
 */
CP.CourseDetails = function($parent, courseId) {
  var ajax = new FUSION.Ajax();
  var _$parent = $parent;
  var _courseId = courseId;
  var _userId;
  var _accessCode = "";
  var _currentData;

  var _getData = function() {
    var ca = document.cookie.split(";");

    for (var i = 0; i &lt; ca.length; i++) {
      var res = ca[i].split("=");
      if (typeof res[0] !== "undefined" &amp;&amp; typeof res[1] !== "undefined") {
        if (res[0].trim() === "user") {
          _userId = res[1];
        } else if (res[0].trim() === "access") {
          _accessCode = res[1];
        }
      }
    }
  };

  var _getCourseEnroll = function(courseIdEnroll, userId, accessCode) {
    return ajax.fetchData(
      {
        courseId: courseIdEnroll,
        userId: userId,
        accessCode: accessCode
      },
      "/bin/captivate/checkCourseEnroll"
    );
  };

  var _addClientEventToModuleTitleBar = function($target) {
    $target
      .find(".captivatePrime-courses-title-bar")
      .off("click")
      .on("click", function() {
        $(this)
          .find(".captivatePrime-courses-arrow")
          .toggleClass("arrow-up");
        $target.find(".captivatePrime-courses-list").slideToggle();
      });
  };

  var _renderSecond = function($parentRenderSecond, data) {
    var $target = $parentRenderSecond.find("div.captivatePrime-week");
    var $tpl = $parentRenderSecond.find("#captivatePrime-detail-tpl");
    jQuery.extend(_currentData, data);

    if (!_currentData.isEnrolled) {
      // _currentData.buttonText = "Enroll"; //Disable Enrollment Support
      _currentData.buttonText = "Get Started";
      _currentData.buttonClass = "captivatePrime-no-progress";
    } else {
      /* //Disable Enrollment Support
            if (_currentData.progress === 0) {
                _currentData.buttonText = "Get Started";
                _currentData.buttonClass = "captivatePrime-no-progress";
            } else
            */
      if (_currentData.progress === 100) {
        _currentData.buttonText = "Review";
        _currentData.buttonClass = "captivatePrime-completed";
      } else {
        _currentData.buttonText = "Continue";
        _currentData.buttonClass = "captivatePrime-in-progress";
      }
    }

    var template = Handlebars.compile($tpl.html());
    $target.html(template(_currentData));
    $target.show();
    _addClientEventToModuleTitleBar($target);
    /* //Disable Enrollment Support
        $target.find(".captivatePrime-button").off("click").on("click", function() {
            if (!_currentData.isEnrolled &amp;&amp; _currentData.instances[0] != undefined) {
                _enrollInCourse(_currentData.id, _currentData.instanceId, _accessCode).then(
                    function (resp) {
                        if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.isSuccess) {
                            _currentData.buttonText = "Get Started";
                            _currentData.buttonClass = "captivatePrime-no-progress";
                            _currentData.isEnrolled = true;
                            $target.html(template(_currentData));
                            $target.show();
                            _addClientEventToModuleTitleBar($target);
                        } else {
                            _renderError(_$parent, "Cannot enroll into course: " + _currentData.names);
                        }
                    }
                ).fail(function (jqXHR) {
                    _renderError(_$parent, "HTTP Status " + jqXHR.status + " - " + jqXHR.responseText + ", please contact administrator. ")
                });
            }
        });
*/
  };

  var _renderError = function($parentRenderError, errorMsg) {
    if (!errorMsg) {
      errorMsg = "Unknown error occurred, please contact system administrator.";
    }
    $parentRenderError.find(".captivatePrime-prompt").text(errorMsg);
  };

  var _initSecond = function() {
    _getCourseEnroll(_courseId, _userId, _accessCode)
      .then(function(resp) {
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
          _renderSecond(_$parent, resp.data);
        } else if (resp.errorMessage === "Invalid token") {
          _$parent.find(".captivatePrime-prompt").show();
        } else if (resp.errorMessage === "400") {
          _renderError(_$parent);
        } else if (resp.errorMessage) {
          _renderError(_$parent, "Error: " + resp.errorMessage);
        } else {
          _renderError(_$parent);
        }
      })
      .fail(function(jqXHR) {
        _renderError(
          _$parent,
          "HTTP Status " +
            jqXHR.status +
            " - " +
            jqXHR.responseText +
            ", please contact administrator. "
        );
      });
  };

  var _renderFirst = function($parentRenderFirst, data) {
    var $target = $parentRenderFirst.find("div.captivatePrime-week");
    var $tpl = $parentRenderFirst.find("#captivatePrime-detail-tpl");

    _currentData = data;
    _currentData.buttonClass = "captivatePrime-no-progress";

    var template = Handlebars.compile($tpl.html());
    $target.html(template(_currentData));
    $target.show();

    $target
      .find(".captivatePrime-courses-title-bar")
      .off("click")
      .on("click", function() {
        $(this)
          .find(".captivatePrime-courses-arrow")
          .toggleClass("arrow-up");
        $target.find(".captivatePrime-courses-list").slideToggle();
      });

    $target
      .find(".captivatePrime-no-progress .captivatePrime-button")
      .addClass("busy-disabled")
      .html('&lt;i class="fa fa-circle-o-notch fa-spin" aria-hidden="true"&gt;&lt;/i&gt;');
    _initSecond();
  };

  var _enrollInCourse = function(
    courseIdEnrollCourse,
    courseInstanceId,
    accessCode
  ) {
    return ajax.fetchData(
      {
        courseId: courseIdEnrollCourse,
        courseInstanceId: courseInstanceId,
        accessCode: accessCode
      },
      "/bin/captivate/enrollCourse"
    );
  };

  var _getCourseDetails = function(courseIdDetails, accessCode) {
    return ajax.fetchData(
      {
        courseId: courseIdDetails,
        accessCode: accessCode
      },
      "/bin/captivate/course"
    );
  };

  var _initFirst = function() {
    _getCourseDetails(_courseId, _accessCode)
      .then(function(resp) {
        if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
          _$parent.find(".captivatePrime-prompt").hide();
          _renderFirst(_$parent, resp.data);
        } else if (resp.errorMessage === "Invalid token") {
          _$parent.find(".captivatePrime-prompt").show();
        } else if (resp.errorMessage === "400") {
          _renderError(_$parent);
        } else if (resp.errorMessage) {
          _renderError(_$parent, "Error: " + resp.errorMessage);
        } else {
          _renderError(_$parent);
        }
      })
      .fail(function(jqXHR) {
        _renderError(
          _$parent,
          "HTTP Status " +
            jqXHR.status +
            " - " +
            jqXHR.responseText +
            ", please contact administrator. "
        );
      });
  };

  $(document).bind("captivate", function() {
    _getData();
    _initFirst();
    $(this).unbind("captivate");
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};
FUSION.CookieCleanComponent = function () {
  var deleteCpAccessCookie = function () {
    document.cookie = 'name=CAPT_LOGIN; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
    document.cookie = 'access=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
    document.cookie = 'user=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
  };
  deleteCpAccessCookie();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

var handleCheckBoxClick = function(el) {

  var updateChecklistProgress = function(map) {
    var CHECKLIST_UPDATE_ENDPOINT = "/bin/fusion/checklist/update";
    new FUSION.Ajax().postData(map, CHECKLIST_UPDATE_ENDPOINT)
        .done(function() {
          console.debug("Successfully updated the checklist");
        })
        .fail(function(err) {
          console.error("Error updating the checklist: " + err);
        });
  };

  var isComplete = function(checklistId) {
    var itemsSelector = "table[data-checklist=" + checklistId +
        "] input[name=check-item]";
    var checkedItemsSelector = itemsSelector + ":checked";
    return ($(itemsSelector).length === $(checkedItemsSelector).length);
  }

  var item = new FUSION.DomTraverser()
      .getParentByClassRecursive(el, "checklist-table");
  var $el = $(el);

  var checklistId = item.dataset.checklist;
  var userId = item.dataset.user;
  var itemId = $el.attr("data-id");
  var progress = $el.prop("checked");
  var xsid = $el.attr("data-xsid");
  var complete = isComplete(checklistId);
  var checklistPath = $el.closest("table").attr("data-path");

  var map = {
    "checklistID": checklistId,
    "userID": userId,
    "checklistPath": checklistPath,
    "itemID": itemId,
    "progress": progress,
    "checklistSID": xsid,
    "isComplete": complete,
  };
  updateChecklistProgress(map);
}

FUSION.Checklist = {
  handleClick: handleCheckBoxClick
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.SlideTracker = function () {
  var formatUtil = new FUSION.Formatter();
  var _props = {
    destinationPage: '',
    sourcePage: '',
  };
  var carouselLinks;

  var _sendEvent = function () {
    var A = FUSION.ANALYTICS;
    new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.CAROUSEL_ITEM)
      .putEventData(A.KEYS.DESTINATION_PAGE, _props.destinationPage)
      .putEventData(A.KEYS.SOURCE_PAGE, _props.sourcePage)
      .setEvent(A.EV.CLICK.CAROUSEL_ITEM)
      .track();
  };

  var _carouselClick = function () {
    _props.destinationPage = formatUtil.setVal(this.dataset.destinationPath).decodeUnicodeSequence().getVal();
    _props.sourcePage = formatUtil.setVal(this.dataset.sourcePath).decodeUnicodeSequence().getVal();
    _sendEvent();
  };

  var _bindAnalyticsListeners = function () {
    carouselLinks = document.getElementsByClassName('carousel-link');
    for (var carouselLink of carouselLinks) {
      carouselLink.addEventListener('click', _carouselClick.bind(carouselLink), false);
    }
  };

  var _removeAnalyticsListeners = function () {
    for (var carouselLink of carouselLinks) {
      carouselLink.removeEventListener('click', _carouselClick, false);
    }
  };

  var _unload = function () {
    _removeAnalyticsListeners();
    $(window).off('unload', _unload);
  };

  var _init = function () {
    _bindAnalyticsListeners();
    $(window).on('unload', _unload);
  };

  $(_init);
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.CarouselComponent = function(uniqueId) {
  var myTimer;
  var TIMEOUT = 4000;
  var START_CLONE = "carousel-start-clone";
  var END_CLONE = "carousel-end-clone";
  var SLIDE = "transform 0.4s ease-in-out";
  var $uniqueId = "#" + uniqueId;
  let counter = 0;
  var carouselItem, $carouselContainer, $prevBtn, $nextBtn, $dots,
      carouselSlides, slideWidth;

  // Increments the slide by 'n'
  var showSlides = function(item, n, width) {
    var dots = document.getElementById(uniqueId).getElementsByClassName("dot");
    counter += n;
    for (var i = 0; i &lt; dots.length; i++) {
      dots[i].className = dots[i].className.replace(" active", "");
    }
    if (counter &gt; 0 &amp;&amp; counter &lt;= dots.length) {
      dots[counter - 1].className += " active";
    }
    item.style.transform = "translateX(" + (-width * counter) + "px)";
  };

  var nextSlide = function(item, width, carouselSlides) {
    if (counter &gt;= carouselSlides.length - 1) return;
    item.style.transition = SLIDE;
    showSlides(item, 1, width);
  };

  var prevSlide = function(item, width) {
    if (counter &lt;= 0) return;
    item.style.transition = SLIDE;
    showSlides(item, -1, width);
  };

  var carouselPause = function() {
    clearInterval(myTimer);
  };

  var carouselResume = function(item, width, carouselSlides) {
    clearInterval(myTimer);
    myTimer = setInterval(function() {
      nextSlide(item, width, carouselSlides);
    }, TIMEOUT);
  };

  var currentSlide = function(item, n, width) {
    clearInterval(myTimer);
    n += 1; // Need to increment the index by 1 because we have a hidden slide at position 0
    n -= counter;
    showSlides(item, n, width);
  };

  var _unload = function() {
    $dots.off("click");
    $nextBtn.off("click");
    $prevBtn.off("click");
    $carouselContainer.off("mouseover");
    $carouselContainer.off("mouseleave");
    carouselItem.removeEventListener("transitionend", _handleStartEndClones);
    $(window).off("resize");
    $(window).off("unload", _unload);
  };

  var _handleStartEndClones = function() {
    // If the end is reached, go back to first slide
    if (carouselSlides[counter].id === START_CLONE) {
      carouselItem.style.transition = "none";
      counter = 0;
      showSlides(carouselItem, 1, slideWidth);
    }
    if (carouselSlides[counter].id === END_CLONE) {
      carouselItem.style.transition = "none";
      counter = carouselSlides.length - 3;
      showSlides(carouselItem, 1, slideWidth);
    }
  };

  var _init = function() {
    carouselItem = document.getElementById(uniqueId).
        querySelector(".carousel-slide");
    $carouselContainer = $($uniqueId + " .carousel-container");
    carouselSlides = document.getElementById(uniqueId).
        querySelectorAll(".mySlides");
    $prevBtn = $($uniqueId + " .prevBtn");
    $nextBtn = $($uniqueId + " .nextBtn");
    $dots = $($uniqueId + " .dot");
    slideWidth = carouselSlides[0].clientWidth;
    var carouselEndClone = document.getElementById(uniqueId).
        querySelector("#carousel-end-clone");

    showSlides(carouselItem, 1, slideWidth);

    $dots.on("click", function() {
      var dotId = $(this).attr("id");
      var dotIndex = parseInt(dotId.slice(dotId.length - 1));
      carouselItem.style.transition = SLIDE;
      currentSlide(carouselItem, dotIndex, slideWidth);
    });

    $nextBtn.on("click", function() {
      slideWidth = carouselSlides[0].clientWidth;
      nextSlide(carouselItem, slideWidth, carouselSlides);
    });

    $prevBtn.on("click", function() {
      slideWidth = carouselSlides[0].clientWidth;
      prevSlide(carouselItem, slideWidth);
    });

    $carouselContainer.on("mouseover", function() {
      carouselPause();
    });

    $carouselContainer.on("mouseleave", function() {
      slideWidth = carouselSlides[0].clientWidth;
      carouselResume(carouselItem, slideWidth, carouselSlides);
    });

    carouselItem.addEventListener("transitionend", _handleStartEndClones,
        false);

    $(window).on("resize", function() {
      slideWidth = carouselSlides[0].clientWidth;
      carouselItem.style.transform =
          "translateX(" + (-slideWidth * counter) + "px)";
    });

    myTimer = setInterval(function() {
      slideWidth = carouselSlides[0].clientWidth;
      nextSlide(carouselItem, slideWidth, carouselSlides);
    }, TIMEOUT);
    showSlides(carouselItem, 0, slideWidth);
    carouselEndClone.style.visibility = "visible";
    var elements = carouselEndClone.getElementsByTagName("*");
    for (var i = 0; i &lt; elements.length; ++i) {
      elements[i].style.visibility = "visible";
    }
    $(window).on("unload", _unload);
  };

  var onReady = function(callback) {
    $(function() {
      callback();
    });
  };

  onReady(function() {
    _init();
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.trackCalendarFilter = function (el) {
  var traverser = new FUSION.DomTraverser();
  var analyzeEl = traverser.getParentByClassRecursive(el, 'analyze');
  if (!!analyzeEl &amp;&amp; !!analyzeEl.dataset) {
    var data = analyzeEl.dataset;
    var A = FUSION.ANALYTICS;
    new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.CALENDAR_FILTER)
      .putEventData(A.KEYS.TITLE, new FUSION.Formatter(data.title).removeLineBreaks().getVal().trim(), true)
      .putEventData(A.KEYS.IS_GATED, data.isGated, true)
      .putEventData(A.KEYS.DESTINATION_LINK, data.path, true)
      .setEvent(A.EV.CLICK.CALENDAR_FILTER)
      .track();
  }
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
/* global Handlebars Granite _initSearchResult _renderResultPage */
/* jslint regexp: false */
FUSION.GetCalendarResult = function (
  pageLimit,
  currentPage,
  hideFilters,
  calPath,
  timeline,
  startDateDefault,
  endDateDefault,
  isDescending,
  id,
  pageLocale,
  tagMap,
  tagDefaults,
  resultRendering,
  isLoginUser
) {
  var _$parent = $('.page-content ' + '#' + id);
  var $searchSection = _$parent.find('.resultSection-placeholder');
  var $calendarMain = $('#' + id);
  var $searchFilter = $calendarMain.find('#search-filters');
  var resultTextInput = $calendarMain.find('#search-term');
  var searchButton = $calendarMain.find('#search-result-button');
  var $loadingImage = $calendarMain.find('#loadingSpinner');
  var timeout = null;
  var _pageLimit = pageLimit;
  var _resultRendering = resultRendering || 'pagination';
  var _isLoginUser = isLoginUser === 'true';

  var _calendarFilterModal = new CalendarFilterModal(
    $calendarMain,
    timeline,
    startDateDefault,
    endDateDefault,
    isDescending
  );
  var _calendarPaginationRender = new CalendarPaginationRender(
    $calendarMain,
    _$parent,
    pageLimit,
    hideFilters,
    _isLoginUser
  );

  var _calendarLazyLoadingRender = new CalendarLazyLoadingRender(
    $calendarMain,
    _$parent,
    pageLimit,
    hideFilters,
    _isLoginUser
  );

  var _calendarFilterRender = new CalendarFilterRender(
    $calendarMain,
    _calendarFilterModal,
    pageLocale,
    tagDefaults,
    tagMap,
    function () {
      _buildSearchQuery('0');
    }
  );

  var _registerEventUtil = new RegisterEventUtil(currentPage);

  var CONST = {
    searchResultUrl: '/bin/fusion/search/eventfilter?currentPage=' + currentPage,
    searchRegisteredEventUrl: currentPage + '.adobeconnect.registeredEvents.json',
    maxTagButton: 2,
  };

  var _getSearchResultForEventsSearch = function (calendarFilterModal, calendarFilterRender) {
    return new FUSION.Ajax().fetchData(
      {
        fulltext: calendarFilterModal.getEncodedFullText(),
        offset: calendarFilterModal.getOffSet(),
        limit: _pageLimit,
        sort: calendarFilterModal.getSortType(),
        select: calendarFilterModal.getSelect(),
        'event-type': calendarFilterRender.getSelectedEventTags(),
        'event-region': calendarFilterRender.getSelectedRegionTags(),
        'products-and-solutions': calendarFilterRender.getSelectedProductTags(),
        urlPathPrefix: calendarFilterModal.getUrlPathPrefix(),
        calendarPath: calPath,
        dates: calendarFilterModal.getDates(),
      },
      CONST.searchResultUrl
    );
  };

  var _getSearchResult = function (calendarFilterModal, calendarFilterRender) {
    $loadingImage.show();
    return _getSearchResultForEventsSearch(calendarFilterModal, calendarFilterRender);
  };

  var _hideFilters = function () {
    var searchFilters = $calendarMain.find('#search-filters');
    var searchResultCount = $calendarMain.find('#SearchResults .search-result-count');
    var rowDivider = $calendarMain.find('#SearchResults hr');
    if (hideFilters === 'true') {
      searchFilters.css('display', 'none');
      searchResultCount.css('display', 'none');
      rowDivider.css('display', 'none');
    } else {
      searchFilters.css('display', 'normal');
      searchResultCount.css('display', 'normal');
      rowDivider.css('display', 'normal');
    }
  };

  var _rewriteUrlWithSelectedDropbox = function () {
    var properties = new FUSION.Properties();

    var selectedFilterMap = _calendarFilterRender._getSelectedFilterMap();
    var selectedTimelineMap = _calendarFilterModal.getSelectedTimelineMap();
    var parameterMap = Object.assign(selectedFilterMap, selectedTimelineMap);

    var baseUrl = window.location.protocol + '//' + window.location.host + window.location.pathname;

    if (history.pushState &amp;&amp; !properties.isEmptyObject(parameterMap)) {
      var urlWithSelectedFilters = baseUrl + '?' + $.param(parameterMap);
      window.history.pushState({ path: urlWithSelectedFilters }, '', urlWithSelectedFilters);
    } else {
      window.history.pushState({ path: baseUrl }, '', baseUrl);
    }
  };

  var _buildSearchQuery = function (offset) {
    $searchSection.empty();
    $searchSection.hide();

    _calendarFilterRender.renderFilter();
    _calendarFilterModal.parse(offset);

    if (!_calendarFilterModal.isNewSearch()) {
      _rewriteUrlWithSelectedDropbox();
    }

    _getSearchResult(_calendarFilterModal, _calendarFilterRender).then(function (resp) {
      if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
        if (_resultRendering === 'lazyLoading') {
          _calendarLazyLoadingRender.renderResultPage(resp.data, offset);
        } else {
          _calendarPaginationRender.renderResultPage(resp.data, offset);
        }

        _registerEventUtil.init($searchSection);
      }
    });
  };

  var _pageInitialize = function () {
    _calendarFilterModal.init();
    resultTextInput.val(_calendarFilterModal.getSearchText());

    _buildSearchQuery('0');
    _hideFilters();
  };

  resultTextInput.keyup(function (event) {
    var $searchClose = $('.search-close');
    if (event.keyCode === 13) {
      clearTimeout(timeout);
      searchButton.click();
      _calendarFilterRender._collapseSearch($searchClose);
    }
  });

  searchButton.click(function () {
    // big search button was clicked
    _calendarFilterModal.setIsNewSearch(false);
    _buildSearchQuery('0');
  });

  $(window).on('click.Bst', function (event) {
    if ($searchFilter.has(event.target).length === 0 &amp;&amp; !$searchFilter.is(event.target)) {
      _calendarFilterRender._toggleDropDownClasses(_$parent.find('.clicked-select'));
      _calendarFilterRender._closeAllDropdown(0, false);
    }
  });
  $(window).on('resize', function () {
    _calendarFilterRender._closeAllDropdown(0, false);
    _calendarFilterRender._resizeFilterColumn();
  });

  _pageInitialize();
};

function CalendarFilterModal($calendarMain, timeline, startDateDefault, endDateDefault, isDescending) {
  this._$calendarMain = $calendarMain;
  this._timeline = this.getTimelineFromParameter(timeline);
  this._isNewSearch = true;
  this._timelineDefault = '';
  this._startDateDefault = this.getStartDate(startDateDefault);
  this._endDateDefault = this.getEndDate(endDateDefault);
  this._isDescending = this.getIsDescending(isDescending);
}

var dateAsc = 'EVENT_DATE_ASC';
var dateDesc = 'EVENT_DATE_DESC';
var dateAll = 'EVENT_DATE_ALL';
var dateRange = 'EVENT_DATE_RANGE';
var dateRangeDesc = 'EVENT_DATE_RANGE_DESC';
var TIMELINE_CONST = {
  EVENT_DATE_ASC: 'upcoming',
  EVENT_DATE_DESC: 'past',
  EVENT_DATE_ALL: 'alldates',
  EVENT_DATE_RANGE: '',
  EVENT_DATE_RANGE_DESC: '',
};

var _isEmpty = function (data) {
  var count = 0;
  if (typeof data === 'number' || typeof data === 'boolean' || typeof data === 'object') {
    return false;
  }
  if (typeof data === 'undefined') {
    return true;
  }
  if (typeof data.length !== 'undefined') {
    return data.length === 0;
  }
  for (var i in data) {
    if (data.hasOwnProperty(i)) {
      count++;
    }
  }
  return count === 0;
};

var _formatDates = function (dates) {
  var formattedDates = [];
  for (var i = 0; i &lt; dates.length; i++) {
    formattedDates[i] = moment(dates[i]).format('MMM DD');
  }
  return formattedDates;
};

var _formatDisplayDates = function (formattedDates) {
  var displayText;
  if (formattedDates.length === 2) {
    if (moment(formattedDates[1]).isAfter(formattedDates[0])) {
      displayText = formattedDates[0] + ' &gt; ' + formattedDates[1];
    } else {
      displayText = formattedDates[1] + ' &gt; ' + formattedDates[0];
    }
  } else if (formattedDates.length === 1) {
    displayText = formattedDates[0] + ' &gt; ';
  } else {
    displayText = Granite.I18n.get('All events');
  }
  return displayText;
};

CalendarFilterModal.prototype.getTimelineFromParameter = function (timelineFromComponent) {
  const searchParams = new URLSearchParams(window.location.search);

  if (searchParams.has('timeline')) {
    return searchParams.get('timeline');
  } else {
    return timelineFromComponent;
  }
};

CalendarFilterModal.prototype.getStartDate = function (startDate) {
  const searchParams = new URLSearchParams(window.location.search);

  if (searchParams.has('start')) {
    return searchParams.get('start');
  } else {
    return startDate;
  }
};

CalendarFilterModal.prototype.getEndDate = function (startDate) {
  const searchParams = new URLSearchParams(window.location.search);

  if (searchParams.has('end')) {
    return searchParams.get('end');
  } else {
    return startDate;
  }
};

CalendarFilterModal.prototype.getIsDescending = function (isDescending) {
  const searchParams = new URLSearchParams(window.location.search);

  if (searchParams.has('desc')) {
    return searchParams.get('desc');
  } else {
    return isDescending;
  }
};

CalendarFilterModal.prototype.renderDates = function (dates, defaultDates) {
  var formattedDates;
  var displayText;
  formattedDates = _formatDates(dates);
  if (!_isEmpty(dates[1])) {
    if (moment(dates[1]).isAfter(dates[0])) {
      displayText = formattedDates[0] + ' &gt; ' + formattedDates[1];
    } else {
      displayText = formattedDates[1] + ' &gt; ' + formattedDates[0];
    }
  } else if (dates.length === 1) {
    displayText = formattedDates[0] + ' &gt; ';
  } else {
    formattedDates = _formatDates(defaultDates);
    displayText = _formatDisplayDates(formattedDates);
  }
  return displayText;
};

CalendarFilterModal.prototype.getDefaultDates = function () {
  var calendarFilterModal = this;

  var defaultDates = [];
  if (calendarFilterModal._startDateDefault) {
    defaultDates.push(moment(calendarFilterModal._startDateDefault).format('YYYY-MM-DD'));
  }
  if (calendarFilterModal._endDateDefault) {
    defaultDates.push(moment(calendarFilterModal._startDateDefault).format('YYYY-MM-DD'));
  }
  return defaultDates;
};

CalendarFilterModal.prototype._getDefaultDates = function () {
  var calendarFilterModal = this;
  var defaultDates = [];

  if (calendarFilterModal._startDateDefault) {
    defaultDates.push(moment(calendarFilterModal._startDateDefault).format('YYYY-MM-DD'));
  }
  if (calendarFilterModal._endDateDefault) {
    defaultDates.push(moment(calendarFilterModal._endDateDefault).format('YYYY-MM-DD'));
  }
  return defaultDates;
};

CalendarFilterModal.prototype._getDatePickerSortType = function (sortType, selectedSort, isNewSearchSort) {
  if (_isEmpty(selectedSort) &amp;&amp; !isNewSearchSort) {
    if (document.getElementById('descending') &amp;&amp; document.getElementById('descending').checked) {
      return dateRangeDesc;
    }
    return dateRange;
  }
  return sortType;
};

CalendarFilterModal.prototype.getInputDateRangeMap = function (offset) {
  var calendarFilterModal = this;
  var inputDateRangeMap = {};

  var $rangePicker = calendarFilterModal._$calendarMain.find('#rangepicker');
  var rangeStart = $rangePicker.find('input').get(0);
  var rangeEnd = $rangePicker.find('input').get(1);
  var $descending = calendarFilterModal._$calendarMain.find('#descending');

  if (rangeStart.value) {
    var startMoment = moment(rangeStart.value, 'MM/DD/YYYY');
    inputDateRangeMap['start'] = startMoment.format('YYYY-MM-DD');
  }

  if (rangeEnd.value) {
    var endMoment = moment(rangeEnd.value, 'MM/DD/YYYY');
    inputDateRangeMap['end'] = endMoment.format('YYYY-MM-DD');
  }

  if ($descending &amp;&amp; $descending.prop('checked')) {
    inputDateRangeMap['desc'] = 'true';
  }

  return inputDateRangeMap;
};

CalendarFilterModal.prototype.getSelectedTimelineMap = function () {
  var calendarFilterModal = this;
  var selectedDateRangeMap = calendarFilterModal.getInputDateRangeMap();
  var timeline = TIMELINE_CONST[this.getSortType()];

  if (timeline) {
    selectedDateRangeMap['timeline'] = timeline;
  }

  return selectedDateRangeMap;
};

CalendarFilterModal.prototype._getSortType = function () {
  var calendarFilterModal = this;

  var selectedSort = calendarFilterModal._$sortType.find('.active').attr('value');
  var sortType = selectedSort;
  // Get sort type on page-load or reset
  if (_isEmpty(selectedSort) || (!_isEmpty(selectedSort) &amp;&amp; calendarFilterModal._isNewSearch)) {
    if (calendarFilterModal._timeline === 'past') {
      calendarFilterModal._timelineDefault = Granite.I18n.get('All past events');
      sortType = dateDesc;
    } else if (calendarFilterModal._timeline === 'upcoming') {
      calendarFilterModal._timelineDefault = Granite.I18n.get('All upcoming events');
      sortType = dateAsc;
    } else if (calendarFilterModal._timeline === 'alldates') {
      calendarFilterModal._timelineDefault = Granite.I18n.get('All events');
      sortType = dateAll;
    } else {
      calendarFilterModal._timelineDefault = calendarFilterModal.renderDates(
        [calendarFilterModal._startDateDefault, calendarFilterModal._endDateDefault],
        calendarFilterModal._getDefaultDates()
      );
      sortType = dateRange;
      if (calendarFilterModal._isDescending === 'true') {
        sortType = dateRangeDesc;
      }
    }
  }

  // Get sort type when date picker is used
  sortType = calendarFilterModal._getDatePickerSortType(sortType, selectedSort, calendarFilterModal._isNewSearch);
  return sortType;
};

CalendarFilterModal.prototype._dateFromDatePicker = function () {
  var calendarFilterModal = this;

  var startDate;
  var endDate;
  if (!_isEmpty(calendarFilterModal._startDateDefault)) {
    startDate = moment(calendarFilterModal._startDateDefault).startOf('day').format();
  } else {
    startDate = moment().startOf('day').format();
  }
  if (!_isEmpty(calendarFilterModal._endDateDefault)) {
    endDate = moment(calendarFilterModal._endDateDefault).endOf('day').format();
  } else {
    endDate = moment().add(3, 'year').format();
  }

  return startDate + '_' + endDate;
};

CalendarFilterModal.prototype._determineDateRange = function () {
  var calendarFilterModal = this;

  var startDate = moment().format();
  var endDate;
  var $filterText1 = calendarFilterModal._$calendarMain.find('#filterText-1').text();
  if ($filterText1 === Granite.I18n.get('All events')) {
    startDate = moment().subtract(3, 'year').format();
    endDate = moment().add(3, 'year').format();
  } else if ($filterText1 === Granite.I18n.get('All past events')) {
    startDate = moment().subtract(3, 'year').format();
    endDate = moment().format();
  } else if ($filterText1 === Granite.I18n.get('All upcoming events')) {
    endDate = moment().add(3, 'year').format();
  } else {
    return calendarFilterModal._dateFromDatePicker();
  }
  return startDate + '_' + endDate;
};

CalendarFilterModal.prototype._dateFromRangePicker = function ($rangePicker, rangeStart, rangeEnd) {
  var calendarFilterModal = this;
  var startDate;
  var endDate;

  if (!_isEmpty(rangeStart.value)) {
    startDate = moment(rangeStart.value).startOf('day').format();
  } else if (!_isEmpty(calendarFilterModal._startDateDefault)) {
    startDate = moment(calendarFilterModal._startDateDefault).startOf('day').format();
  } else {
    startDate = moment().startOf('day').format();
  }

  if (!_isEmpty(rangeEnd.value)) {
    endDate = moment(rangeEnd.value).endOf('day').format();
  } else if (!_isEmpty(calendarFilterModal._endDateDefault)) {
    endDate = moment(calendarFilterModal._endDateDefault).endOf('day').format();
  } else {
    endDate = moment().add(3, 'year').format();
  }

  return startDate + '_' + endDate;
};

CalendarFilterModal.prototype.parse = function (offset) {
  var calendarFilterModal = this;

  calendarFilterModal._sort = calendarFilterModal._getSortType();
  calendarFilterModal._offset = offset;
  calendarFilterModal._select = 'ONLY_PAGES';
  calendarFilterModal._encodedFullText = '';
  calendarFilterModal._dates = '';

  var fulltext = calendarFilterModal._$resultTextInput.val().replace(/^\s+/g, '');
  if (fulltext) {
    calendarFilterModal._encodedFullText = encodeURIComponent(
      calendarFilterModal._$resultTextInput.val().replace(/^\s+/g, '')
    );
  }

  calendarFilterModal._urlPathPrefix =
    window.location.protocol +
    '//' +
    window.location.hostname +
    (window.location.port ? ':' + window.location.port : '');

  var $rangePicker = calendarFilterModal._$calendarMain.find('#rangepicker');
  var rangeStart = $rangePicker.find('input').get(0);
  var rangeEnd = $rangePicker.find('input').get(1);

  if (!_isEmpty(rangeStart) &amp;&amp; !_isEmpty(rangeStart.value) &amp;&amp; !_isEmpty(rangeEnd)) {
    calendarFilterModal._dates = calendarFilterModal._dateFromRangePicker($rangePicker, rangeStart, rangeEnd);
  } else {
    calendarFilterModal._dates = calendarFilterModal._determineDateRange();
  }
};

CalendarFilterModal.prototype.getSortType = function () {
  return this._sort;
};

CalendarFilterModal.prototype.getOffSet = function () {
  return this._offset;
};

CalendarFilterModal.prototype.getEncodedFullText = function () {
  return this._encodedFullText;
};

CalendarFilterModal.prototype.getSelect = function () {
  return this._select;
};

CalendarFilterModal.prototype.getDates = function () {
  return this._dates;
};

CalendarFilterModal.prototype.getUrlPathPrefix = function () {
  return this._urlPathPrefix;
};

CalendarFilterModal.prototype.getSearchText = function () {
  return this._searchText;
};

CalendarFilterModal.prototype.isNewSearch = function () {
  return this._isNewSearch;
};

CalendarFilterModal.prototype.getTimeline = function () {
  return this._timeline;
};

CalendarFilterModal.prototype.getStartDateDefault = function () {
  return this._startDateDefault;
};

CalendarFilterModal.prototype.getEndDateDefault = function () {
  return this._endDateDefault;
};

CalendarFilterModal.prototype.getTimelineDefault = function () {
  return this._timelineDefault;
};

CalendarFilterModal.prototype.isDescending = function () {
  return this._isDescending;
};

CalendarFilterModal.prototype.setIsNewSearch = function (isNewSearch) {
  this._isNewSearch = isNewSearch;
};

CalendarFilterModal.prototype.init = function () {
  var calendarFilterModal = this;

  var hostURL = window.location.search.substring(1);
  var pair = hostURL.split('=');
  if (typeof pair[0] !== 'undefined' &amp;&amp; typeof pair[1] !== 'undefined' &amp;&amp; pair[0] === 'q' &amp;&amp; pair[1] !== '') {
    calendarFilterModal._searchText = decodeURI(pair[1]).replace(new RegExp('\\+', 'g'), ' ').replace(/^\s+/g, '');
  }

  if (!_isEmpty(calendarFilterModal._startDateDefault)) {
    calendarFilterModal._timeline = '';
  }

  calendarFilterModal._$sortType = calendarFilterModal._$calendarMain.find('#sort-types');
  calendarFilterModal._$searchType = calendarFilterModal._$calendarMain.find('#search-types');
  calendarFilterModal._$regionType = calendarFilterModal._$calendarMain.find('#region-types');
  calendarFilterModal._$productType = calendarFilterModal._$calendarMain.find('#product-types');
  calendarFilterModal._$resultTextInput = calendarFilterModal._$calendarMain.find('#search-term');
};

function CalendarPaginationRender($calendarMain, $pageContent, pageLimit, hideFilters, isLoginUser) {
  this._pageLimit = pageLimit;
  this._hideFilters = hideFilters;
  this._isLoginUser = isLoginUser;

  this._$calendarMain = $calendarMain;
  this._$searchBar = $pageContent.find('.resultBar-placeholder');
  this._$searchSection = $pageContent.find('.resultSection-placeholder');
  var $searchSectionTpl = $pageContent.find('#result-searchsection-tpl');
  this._searchSectionTemplate = Handlebars.compile($searchSectionTpl.html());

  this._$loadingImage = $calendarMain.find('#loadingSpinner');
}

CalendarPaginationRender.prototype._paginationClickEvent = function () {
  var calendarPaginationRender = this;

  var pagButton = this._$calendarMain.find('.pagination-button');
  var pagNextButton = this._$calendarMain.find('#pagination-pButton');
  var pagPrevButton = this._$calendarMain.find('#pagination-nButton');
  var pagSelected = this._$calendarMain.find('#pagination-selected');

  pagButton.click(function (event) {
    calendarPaginationRender.renderResultPage(calendarPaginationRender._respData, $(this).text() - 1);
    event.stopPropagation();
  });

  pagNextButton.click(function (event) {
    calendarPaginationRender.renderResultPage(calendarPaginationRender._respData, pagSelected.text() - 2);
    event.stopPropagation();
  });

  pagPrevButton.click(function (event) {
    calendarPaginationRender.renderResultPage(calendarPaginationRender._respData, pagSelected.text());
    event.stopPropagation();
  });
};

CalendarPaginationRender.prototype.setDotDotDot = function ($eventDescription) {
  var LINE_LIMIT = 11;
  var dotdotdotOps = {
    after: 'a.read-more',
    height: LINE_LIMIT * 12.31,
  };

  $eventDescription.dotdotdot(dotdotdotOps);
};

CalendarPaginationRender.prototype.handleSubscriptionTabClick = function () {
  var calendarPaginationRender = this;

  this._subscriptionTabClick = PUB_SUB.subscribe(FUSION.SUB_EVTS.VIDEO_RESIZE.EVENT, function (data) {
    if (data.action === FUSION.SUB_EVTS.VIDEO_RESIZE.ACTIONS.TAB_CLICK) {
      var tabSection = data.el.nextElementSibling;
      var $eventDescription = $(tabSection).find('.event-description');

      let intervalId = setInterval(eventDescriptionVisible, 100);
      function eventDescriptionVisible() {
        if ($eventDescription.is(':visible')) {
          calendarPaginationRender.setDotDotDot($eventDescription);
          clearInterval(intervalId);
        }
      }
    }
  });
};

CalendarPaginationRender.prototype.renderResultPage = function (data, start) {
  var calendarPaginationRender = this;

  this._respData = data;
  var select = start;
  var totalResults = data.searchList.length;
  var pageTotal = Math.ceil(Number(totalResults) / Number(calendarPaginationRender._pageLimit));
  var pageStart = 1;
  var sliceStart = Number(calendarPaginationRender._pageLimit) * Number(start);
  var sliceFinish = Number(sliceStart) + Number(calendarPaginationRender._pageLimit);

  calendarPaginationRender._$searchBar.empty();
  calendarPaginationRender._$searchSection.empty();

  if (sliceStart &gt;= 0) {
    var tempList = data.searchList.slice(sliceStart, sliceFinish);
    if (tempList.length) {
      data.paginatedList = tempList;
      select = Number(select) + 1;
      var pageResults = tempList.length * select;

      if (sliceFinish &gt;= totalResults) {
        pageResults = sliceStart + tempList.length;
      }

      data.pagination = {
        pageStart: pageStart,
        select: select,
        pageTotal: pageTotal,
        pageResults: pageResults,
        results: totalResults,
      };
    }
  }

  Granite.I18n.setLocale(data.locale);
  if (calendarPaginationRender._hideFilters === 'true') {
    data.hideFilters = true;
  } else {
    data.hideFilters = false;
  }
  data.isLoginUser = this._isLoginUser;

  calendarPaginationRender._$searchSection.html(calendarPaginationRender._searchSectionTemplate(data));
  calendarPaginationRender._$loadingImage.hide();
  calendarPaginationRender._$searchSection.show();
  calendarPaginationRender._paginationClickEvent();
  var $resultHtml = $(calendarPaginationRender._$searchSection);

  calendarPaginationRender.setDotDotDot($resultHtml.find('.event-description'));
  calendarPaginationRender.handleSubscriptionTabClick();
};

function CalendarLazyLoadingRender($calendarMain, $pageContent, pageLimit, hideFilters, isLoginUser) {
  this._pageLimit = pageLimit;
  this._hideFilters = hideFilters;
  this._isLoginUser = isLoginUser;

  this._$calendarMain = $calendarMain;
  this._$searchBar = $pageContent.find('.resultBar-placeholder');
  this._$searchSection = $pageContent.find('.resultSection-placeholder');
  this._LINE_LIMIT = 11;
  this._dotdotdotOps = {
    after: 'a.read-more',
    height: this._LINE_LIMIT * 12.31,
  };

  var $lazyLoadingSearchSectionTpl = $pageContent.find('#lazyloading-result-searchsection-tpl');
  this._lazyLoadingSearchSectionTemplate = Handlebars.compile($lazyLoadingSearchSectionTpl.html());

  this._$loadingImage = $calendarMain.find('#loadingSpinner');
}

CalendarLazyLoadingRender.prototype._getHiddenEventItems = function () {
  return this._$allEventitems.filter(':hidden');
};

CalendarLazyLoadingRender.prototype._getVisibleEventItemsCount = function () {
  return this._$allEventitems.filter(':visible').length;
};

CalendarLazyLoadingRender.prototype._updateVisibleItemsCount = function () {
  var calendarLazyLoadingRender = this;

  calendarLazyLoadingRender._$numberOfVisible.text(calendarLazyLoadingRender._getVisibleEventItemsCount());
};

CalendarLazyLoadingRender.prototype.toggleLoadMoreLink = function () {
  var calendarLazyLoadingRender = this;
  if (calendarLazyLoadingRender._getHiddenEventItems().length !== 0) {
    calendarLazyLoadingRender._$loadMoreLink.show();
  } else {
    calendarLazyLoadingRender._$loadMoreLink.hide();
  }
};

CalendarLazyLoadingRender.prototype.setDotDotDot = function ($eventDescription) {
  $eventDescription.dotdotdot(this._dotdotdotOps);
};

CalendarLazyLoadingRender.prototype.handleSubscriptionTabClick = function () {
  var calendarLazyLoadingRender = this;

  this._subscriptionTabClick = PUB_SUB.subscribe(FUSION.SUB_EVTS.VIDEO_RESIZE.EVENT, function (data) {
    if (data.action === FUSION.SUB_EVTS.VIDEO_RESIZE.ACTIONS.TAB_CLICK) {
      var tabSection = data.el.nextElementSibling;
      var $eventDescription = $(tabSection).find('.event-description');

      let intervalId = setInterval(eventDescriptionVisible, 100);
      function eventDescriptionVisible() {
        if ($eventDescription.is(':visible')) {
          calendarLazyLoadingRender.setDotDotDot($eventDescription);
          calendarLazyLoadingRender.toggleLoadMoreLink();

          clearInterval(intervalId);
        }
      }
    }
  });
};

CalendarLazyLoadingRender.prototype.renderResultPage = function (data) {
  var calendarLazyLoadingRender = this;

  this._respData = data;
  if (calendarLazyLoadingRender._hideFilters === 'true') {
    this._respData.hideFilters = true;
  } else {
    this._respData.hideFilters = false;
  }
  this._respData.isLoginUser = this._isLoginUser;

  calendarLazyLoadingRender._$searchBar.empty();
  calendarLazyLoadingRender._$searchSection.empty();

  calendarLazyLoadingRender._$searchSection.html(
    calendarLazyLoadingRender._lazyLoadingSearchSectionTemplate(this._respData)
  );

  calendarLazyLoadingRender._$loadMoreLink = calendarLazyLoadingRender._$calendarMain.find('#loadMore');
  calendarLazyLoadingRender.bindLoadMoreLink();

  calendarLazyLoadingRender._$allEventitems = calendarLazyLoadingRender._$calendarMain.find('.event-item');
  calendarLazyLoadingRender._$allEventitems.slice(0, this._pageLimit).show();

  calendarLazyLoadingRender._$loadingImage.hide();
  calendarLazyLoadingRender._$searchSection.show();

  calendarLazyLoadingRender.setDotDotDot($(calendarLazyLoadingRender._$searchSection).find('.event-description'));
  calendarLazyLoadingRender.handleSubscriptionTabClick();

  calendarLazyLoadingRender._$numberOfVisible = calendarLazyLoadingRender._$calendarMain.find('#visible-count');

  calendarLazyLoadingRender.toggleLoadMoreLink();
  calendarLazyLoadingRender._updateVisibleItemsCount();
};

CalendarLazyLoadingRender.prototype.bindLoadMoreLink = function () {
  var calendarLazyLoadingRender = this;

  calendarLazyLoadingRender._$loadMoreLink.on('click', function (e) {
    e.preventDefault();
    calendarLazyLoadingRender._getHiddenEventItems().slice(0, calendarLazyLoadingRender._pageLimit).slideDown();
    if (calendarLazyLoadingRender._getHiddenEventItems().length === 0) {
      calendarLazyLoadingRender._$loadMoreLink.fadeOut('slow');
    }
    calendarLazyLoadingRender._updateVisibleItemsCount();
    calendarLazyLoadingRender.setDotDotDot($(calendarLazyLoadingRender._$searchSection).find('.event-description'));
  });
};

function CalendarFilterRender(
  $calendarMain,
  calendarFilterModal,
  pageLocale,
  tagDefaults,
  allTagMap,
  buildSearchQueryCallBack
) {
  this._$calendarMain = $calendarMain;
  this._calendarFilterModal = calendarFilterModal;
  this._pageLocale = pageLocale;
  this._buildSearchQueryCallBack = buildSearchQueryCallBack;
  this.init(tagDefaults, allTagMap);
}

var CONST_FUSION_TAG_ROOTS = {
  EVENT_TYPE: 'event-type',
  EVENT_REGION: 'event-region',
  PRODUCTS_AND_SOLUTIONS: 'products-and-solutions',
};
var allRegions = 'All regions';
var allTypes = 'All types';
var allProducts = 'All products';

var _applyAllTags = function (tagList, tagType) {
  if (tagList.length === 0) {
    tagList[0] = tagType;
  }
  if (tagList[0] === tagType) {
    tagList = [];
  }
  return tagList;
};

var _sortClickEvent = function (event) {
  var type = event.find('a');
  type.on('click', function () {
    if ($(this).hasClass('in-active')) {
      type.removeClass('active').addClass('in-active');
      $(this).removeClass('in-active').addClass('active');
    }
  });
};

var _buildTagTable = function (tags, placeholder) {
  var tagTable = '&lt;table&gt;';
  tagTable += '&lt;tbody&gt;';
  tags.unshift(placeholder);
  for (var i = 0; i &lt; tags.length; i++) {
    tagTable += '&lt;tr&gt;';
    tagTable += '&lt;td&gt;';
    tagTable += "&lt;label&gt;&lt;input type='checkbox' value='" + tags[i] + " unchecked'&gt;" + tags[i] + '&lt;/label&gt;';
    if (i === 0) {
      tagTable += '&lt;hr&gt;';
    }
    tagTable += '&lt;/td&gt;';
    tagTable += '&lt;/tr&gt;';
  }
  tagTable += '&lt;/tbody&gt;';
  tagTable += '&lt;/table&gt;';
  return tagTable;
};

var _lowerCaseTags = function (str) {
  str = str.replace(/ /g, '-');
  return str.toLowerCase();
};

var _applyDefaultChecks = function (defaultList, table) {
  if (_isEmpty(defaultList[0])) {
    table.find('tr:first input').prop('checked', true);
  }
  table.find('tr').each(function () {
    var $checkbox = $(this).find('input');
    var $tds = $(this).find('td');
    for (var i = 0; i &lt; defaultList.length; i++) {
      var tempString = _lowerCaseTags($tds.text());
      if (tempString === defaultList[i]) {
        $checkbox.prop('checked', true);
      }
    }
  });
};

var _addHyphen = function (str) {
  return str.replace(/\s+/g, '-').toLowerCase();
};

var _isDefaultValues = function (defaultTags, checkedTags, tagSource, tagType) {
  if (checkedTags.length === 1 &amp;&amp; checkedTags[0] === tagType &amp;&amp; _isEmpty(defaultTags)) {
    return true;
  }
  if (defaultTags.length === 0) {
    defaultTags = [tagType];
  }
  if (tagSource.length &gt; 0) {
    if (defaultTags.length !== checkedTags.length) {
      return false;
    }
    for (var i = 0; i &lt; defaultTags.length; i++) {
      if (_addHyphen(defaultTags[i]) !== _addHyphen(checkedTags[i])) {
        return false;
      }
    }
  }
  return true;
};

var _renderTextFromCheckList = function (displayText, checkedValues, $select, defaultList, tagSource, tagType) {
  var i = checkedValues.length - 1;
  if (checkedValues.length &gt; 0 &amp;&amp; !_isEmpty(checkedValues[0])) {
    displayText = Granite.I18n.get(checkedValues[0]);
    if (checkedValues.length &gt; 1 &amp;&amp; displayText !== tagType) {
      displayText += ', + ' + i;
    }
  }
  if (!_isDefaultValues(defaultList, checkedValues, tagSource, tagType)) {
    $select.addClass('clicked-select');
  }
  return displayText;
};

var _getCheckedValues = function (table) {
  var checkedList = [];
  table.find('tr').each(function () {
    var $checkbox = $(this).find('input');
    var $tds = $(this).find('td');
    if ($checkbox.prop('checked')) {
      checkedList.push($tds.text());
    }
  });
  return checkedList;
};

var _closeDropdownClicked = function (select, isReset, isNotSelected) {
  var $icon = select.find('.glyphicon');
  $icon.addClass('glyphicon-chevron-down');
  $icon.removeClass('rotate-icon');
  if (isReset || isNotSelected) {
    select.removeClass('clicked-select');
  }
};

CalendarFilterRender.prototype.getSelectedRegionTags = function () {
  return _applyAllTags(this._selectedRegionTags, allRegions);
};

CalendarFilterRender.prototype.getSelectedEventTags = function () {
  return _applyAllTags(this._selectedEventTags, allTypes);
};

CalendarFilterRender.prototype.getSelectedProductTags = function () {
  return _applyAllTags(this._selectedProductTags, allProducts);
};

CalendarFilterRender.prototype.getAllRegions = function () {
  return this._allRegions;
};
CalendarFilterRender.prototype.getAllTypes = function () {
  return this._allTypes;
};
CalendarFilterRender.prototype.getAllProducts = function () {
  return this._allProducts;
};

CalendarFilterRender.prototype._toggleDropDownClasses = function (select) {
  var $icon = select.find('.glyphicon');
  $icon.toggleClass('rotate-icon');
  select.toggleClass('clicked-select');
};

CalendarFilterRender.prototype._calendarClickEvents = function () {
  var calendarFilterRender = this;

  var $rangepicker = calendarFilterRender._$calendarMain.find('#rangepicker');
  $rangepicker
    .datepicker()
    .off('changeDate')
    .on('changeDate', function (e) {
      if (e.dates.length !== 0) {
        calendarFilterRender._calendarFilterModal.setIsNewSearch(false);
        e.stopImmediatePropagation();
        calendarFilterRender._buildSearchQueryCallBack();
      }
    });
};

CalendarFilterRender.prototype._applyDefaultSortType = function () {
  var eventDateAllActive = false;
  var eventDateDescActive = false;
  var eventDateAscActive = false;

  if (
    !_isEmpty(this._calendarFilterModal.getStartDateDefault()) ||
    !_isEmpty(this._calendarFilterModal.getEndDateDefault())
  ) {
    // all inactive
  } else if (this._calendarFilterModal.getTimeline() === 'past') {
    eventDateDescActive = true;
  } else if (this._calendarFilterModal.getTimeline() === 'alldates') {
    eventDateAllActive = true;
  } else if (this._calendarFilterModal.getTimeline() === 'upcoming') {
    eventDateAscActive = true;
  }

  var htmltext =
    '&lt;div class="sort-order"&gt;&lt;a class="' +
    (eventDateAllActive ? 'active' : 'in-active') +
    '" value="EVENT_DATE_ALL"&gt;' +
    Granite.I18n.get('All events') +
    '&lt;/a&gt;';
  htmltext +=
    '&lt;a class="' +
    (eventDateAscActive ? 'active' : 'in-active') +
    '" value="EVENT_DATE_ASC"&gt;' +
    Granite.I18n.get('All upcoming events') +
    '&lt;/a&gt;';
  htmltext +=
    '&lt;a class="' +
    (eventDateDescActive ? 'active' : 'in-active') +
    '" value="EVENT_DATE_DESC"&gt;' +
    Granite.I18n.get('All past events') +
    '&lt;/a&gt;&lt;/div&gt;';

  return htmltext;
};

CalendarFilterRender.prototype._renderSearchTypeFilterText = function () {
  var table = this._$searchType.find('table tbody');
  var $filterText2 = this._$calendarMain.find('#filterText-2');
  var checkedValues = _getCheckedValues(table);

  var displayText = Granite.I18n.get(allTypes);
  this._selectedEventTags = checkedValues;
  $filterText2.empty();
  displayText = _renderTextFromCheckList(
    displayText,
    checkedValues,
    this._$calendarMain.find('#select-2'),
    this._eventTagDefaults,
    this._eventTags,
    allTypes
  );
  $filterText2.html(displayText);
};

CalendarFilterRender.prototype._renderRegionFilterText = function () {
  var table = this._$regionType.find('table tbody');
  var $filterText3 = this._$calendarMain.find('#filterText-3');
  var checkedValues = _getCheckedValues(table);

  var displayText = Granite.I18n.get(allRegions);
  this._selectedRegionTags = checkedValues;
  $filterText3.empty();
  displayText = _renderTextFromCheckList(
    displayText,
    checkedValues,
    this._$calendarMain.find('#select-3'),
    this._regionTagDefaults,
    this._regionTags,
    allRegions
  );
  $filterText3.html(displayText);
};

CalendarFilterRender.prototype._renderProductFilterText = function () {
  var table = this._$productType.find('table tbody');
  var $filterText4 = this._$calendarMain.find('#filterText-4');
  var checkedValues = _getCheckedValues(table);
  var displayText = Granite.I18n.get(allProducts);
  this._selectedProductTags = checkedValues;
  $filterText4.empty();
  displayText = _renderTextFromCheckList(
    displayText,
    checkedValues,
    this._$calendarMain.find('#select-4'),
    this._productTagDefaults,
    this._productTags,
    allProducts
  );
  $filterText4.html(displayText);
};

CalendarFilterRender.prototype._getDatesFromRange = function ($select, rangeStart, rangeEnd) {
  $select.addClass('clicked-select');
  var dates = [rangeStart.value];
  if (!_isEmpty(rangeEnd) &amp;&amp; !_isEmpty(rangeEnd.value)) {
    dates.push(rangeEnd.value);
  }
  return this._calendarFilterModal.renderDates(dates);
};

CalendarFilterRender.prototype._renderSortByFilterText = function () {
  var calendarFilterRender = this;

  var text = calendarFilterRender._$sortType.find('.sort-order .active').text();
  var $filterText1 = calendarFilterRender._$calendarMain.find('#filterText-1');
  var $select = calendarFilterRender._$calendarMain.find('#select-1');
  var $icon = $select.find('.glyphicon');
  var $rangePicker = calendarFilterRender._$calendarMain.find('#rangepicker');
  var rangeStartPicker;
  var rangeEndPicker;
  var rangeStart = $rangePicker.find('input').get(0);
  var rangeEnd = $rangePicker.find('input').get(1);
  $rangePicker.datepicker({
    language: calendarFilterRender._pageLocale,
    container: '#datepicker-container',
    orientation: 'auto',
    maxViewMode: 2,
    startDate: '-3y',
    endDate: '+3y',
    autoclose: true,
    keepEmptyValues: true,
    todayHighlight: true,
  });
  rangeStartPicker = $rangePicker.find("input[name='rangeStart']");
  rangeEndPicker = $rangePicker.find("input[name='rangeEnd']");
  if (text !== this._calendarFilterModal.getTimelineDefault()) {
    $select.addClass('clicked-select');
  }
  if (this._calendarFilterModal.isNewSearch() &amp;&amp; !_isEmpty(this._calendarFilterModal.getStartDateDefault())) {
    var defaultDates = this._calendarFilterModal.getDefaultDates();
    rangeStart.value = defaultDates[0];
    rangeStartPicker.datepicker('update', moment(this._calendarFilterModal.getStartDateDefault()).format('MM/DD/YYYY'));
    if (!_isEmpty(this._calendarFilterModal.getEndDateDefault())) {
      rangeEnd.value = defaultDates[1];
      rangeEndPicker.datepicker('update', moment(this._calendarFilterModal.getEndDateDefault()).format('MM/DD/YYYY'));
    }
  }
  if (!_isEmpty(rangeStart) &amp;&amp; !_isEmpty(rangeStart.value)) {
    text = calendarFilterRender._getDatesFromRange($select, rangeStart, rangeEnd);
  }
  if (_isEmpty(text)) {
    text = this._calendarFilterModal.getTimelineDefault();
  }
  $filterText1.empty();
  $filterText1.html(text);
  if ($filterText1.text() === this._calendarFilterModal.getTimelineDefault() &amp;&amp; !$icon.hasClass('rotate-icon')) {
    $select.removeClass('clicked-select');
  }
};

CalendarFilterRender.prototype._renderFilterText = function (selectId) {
  var calendarFilterRender = this;

  if (selectId === 1) {
    calendarFilterRender._renderSortByFilterText();
  } else if (selectId === 2) {
    calendarFilterRender._renderSearchTypeFilterText();
  } else if (selectId === 3) {
    calendarFilterRender._renderRegionFilterText();
  } else if (selectId === 4) {
    calendarFilterRender._renderProductFilterText();
  }
};

CalendarFilterRender.prototype._clearSearchText = function () {
  var calendarFilterRender = this;

  var $searchTerm = calendarFilterRender._$calendarMain.find('#search-term');
  $searchTerm.val('');
};

CalendarFilterRender.prototype._closeAllDropdown = function (val, isReset) {
  var calendarFilterRender = this;

  var $select1 = this._$calendarMain.find('#select-1');
  var $select2 = this._$calendarMain.find('#select-2');
  var $select3 = this._$calendarMain.find('#select-3');
  var $select4 = this._$calendarMain.find('#select-4');

  // close all dropdown box
  if (val !== 1) {
    calendarFilterRender._renderFilterText(1);
    calendarFilterRender._$sortType.slideUp();
    _closeDropdownClicked(
      $select1,
      isReset,
      calendarFilterRender._$sortType.find('.sort-order .active').text() ===
        this._calendarFilterModal.getTimelineDefault()
    );
  }
  if (val !== 2) {
    calendarFilterRender._renderFilterText(2);
    calendarFilterRender._$searchType.slideUp();
    _closeDropdownClicked(
      $select2,
      isReset,
      _isDefaultValues(
        calendarFilterRender._eventTagDefaults,
        _getCheckedValues(calendarFilterRender._$searchType.find('table tbody')),
        calendarFilterRender._eventTags,
        allTypes
      )
    );
  }
  if (val !== 3) {
    calendarFilterRender._renderFilterText(3);
    calendarFilterRender._$regionType.slideUp();
    _closeDropdownClicked(
      $select3,
      isReset,
      _isDefaultValues(
        calendarFilterRender._regionTagDefaults,
        _getCheckedValues(calendarFilterRender._$regionType.find('table tbody')),
        calendarFilterRender._regionTags,
        allRegions
      )
    );
  }

  if (val !== 4) {
    calendarFilterRender._renderFilterText(4);
    calendarFilterRender._$productType.slideUp();
    _closeDropdownClicked(
      $select4,
      isReset,
      _isDefaultValues(
        calendarFilterRender._productTagDefaults,
        _getCheckedValues(calendarFilterRender._$productType.find('table tbody')),
        calendarFilterRender._productTags,
        allProducts
      )
    );
  }
};

CalendarFilterRender.prototype._handleToggle = function ($elem, val, bShow, isRefresh, select) {
  var calendarFilterRender = this;

  calendarFilterRender._toggleDropDownClasses(select);
  calendarFilterRender._closeAllDropdown(val, false);
  calendarFilterRender._renderFilterText(val);
  $elem.slideToggle();
};

CalendarFilterRender.prototype._filterCheckBoxListener = function (identifier, tagType) {
  var calendarFilterRender = this;

  $(identifier).click(function (e) {
    var $this = $(this);
    var checkBoxText = $this.closest('label').text();
    var table = $this.closest('table');
    var firstCheckbox = table.find('tr:first input');
    var checkedValues;
    e.stopImmediatePropagation();
    calendarFilterRender._calendarFilterModal.setIsNewSearch(false);

    if (checkBoxText !== tagType) {
      firstCheckbox.prop('checked', false);
    } else {
      table.find('tr').each(function () {
        $this = $(this);
        if ($this.find('label').text() !== tagType) {
          $this.find('input').prop('checked', false);
        }
      });
    }
    checkedValues = _getCheckedValues(table);
    if (checkedValues.length === 0) {
      firstCheckbox.prop('checked', true);
    }
    calendarFilterRender._buildSearchQueryCallBack();
  });
};

CalendarFilterRender.prototype._clearCalendarDates = function () {
  var calendarFilterRender = this;

  var $rangePicker = calendarFilterRender._$calendarMain.find('#rangepicker');
  var $descending = calendarFilterRender._$calendarMain.find('#descending');
  var startPicker = $rangePicker.find("input[name='rangeStart']");
  var endPicker = $rangePicker.find("input[name='rangeEnd']");
  startPicker.datepicker('clearDates');
  endPicker.datepicker('clearDates');
  $descending.prop('checked', false);
};

CalendarFilterRender.prototype._collapseSearch = function ($searchClose) {
  var calendarFilterRender = this;
  $searchClose.fadeOut();
  calendarFilterRender._$resultTextInput.stop().animate(
    {
      width: '100%',
    },
    'normal'
  );
};

CalendarFilterRender.prototype._resetUrl = function () {
  var calendarFilterRender = this;

  if (history.pushState) {
    var baseUrl = window.location.protocol + '//' + window.location.host + window.location.pathname;
    window.history.pushState({ path: baseUrl }, '', baseUrl);

    calendarFilterRender._eventTagFromParameter = [];
    calendarFilterRender._regionTagFromParameter = [];
    calendarFilterRender._productTagFromParameter = [];
  }
};

CalendarFilterRender.prototype._selectButtonClickEvent = function () {
  var calendarFilterRender = this;

  var $select1 = this._$calendarMain.find('#select-1');
  var $select2 = this._$calendarMain.find('#select-2');
  var $select3 = this._$calendarMain.find('#select-3');
  var $select4 = this._$calendarMain.find('#select-4');
  var $searchClose = this._$calendarMain.find('.search-close');
  // Sort By
  $select1.off('click').on('click', function () {
    calendarFilterRender._handleToggle(calendarFilterRender._$sortType, 1, false, false, $select1);
  });

  // Event type
  if (this._eventTags !== '') {
    $select2.off('click').on('click', function () {
      calendarFilterRender._handleToggle(calendarFilterRender._$searchType, 2, false, false, $select2);
    });
  } else {
    $select2.css('color', 'grey');
  }

  // Region
  if (this._regionTags !== '') {
    $select3.off('click').on('click', function () {
      calendarFilterRender._handleToggle(calendarFilterRender._$regionType, 3, false, false, $select3);
    });
  } else {
    $select2.css('color', 'grey');
  }

  // Product
  if (this._productTags !== '') {
    $select4.off('click').on('click', function () {
      calendarFilterRender._handleToggle(calendarFilterRender._$productType, 4, false, false, $select4);
    });
  } else {
    $select4.css('color', 'grey');
  }

  calendarFilterRender._$resultTextInput.focusout(function () {
    calendarFilterRender._collapseSearch($searchClose);
  });

  calendarFilterRender._$calendarMain
    .find('#clearFilter')
    .off('click')
    .on('click', function () {
      calendarFilterRender._resetUrl();
      calendarFilterRender._clearCalendarDates();
      calendarFilterRender._toggleDropDownClasses(calendarFilterRender._$calendarMain.find('.clicked-select'));
      calendarFilterRender._clearSearchText();
      calendarFilterRender._closeAllDropdown(0, true);
      calendarFilterRender._collapseSearch($searchClose);
      calendarFilterRender._calendarFilterModal.setIsNewSearch(true);
      calendarFilterRender._buildSearchQueryCallBack();
    });

  calendarFilterRender._$calendarMain.find('#sort-types a').click(function (e) {
    var $descending = calendarFilterRender._$calendarMain.find('#descending');
    $descending.attr('disabled', true);
    calendarFilterRender._clearCalendarDates();
    calendarFilterRender._calendarFilterModal.setIsNewSearch(false);
    e.stopImmediatePropagation();
    calendarFilterRender._buildSearchQueryCallBack();
  });

  calendarFilterRender._$calendarMain.find('#sort-types input').on('change', function () {
    if ($(this).val()) {
      var sortSelected = calendarFilterRender._$sortType.find('a.active');
      var $descending = calendarFilterRender._$calendarMain.find('#descending');
      $descending.attr('disabled', false);
      sortSelected.removeClass('active').addClass('in-active');
    }
  });

  calendarFilterRender._$calendarMain.find('#sort-types input:checkbox').on('click', function (e) {
    calendarFilterRender._calendarFilterModal.setIsNewSearch(false);
    e.stopImmediatePropagation();
    calendarFilterRender._buildSearchQueryCallBack();
  });

  calendarFilterRender._$calendarMain.find('.search-close').on('click', function () {
    calendarFilterRender._clearSearchText();
  });

  var calendarMainId = calendarFilterRender._$calendarMain.attr('id');

  calendarFilterRender._filterCheckBoxListener('#' + calendarMainId + ' #search-types input', allTypes);

  calendarFilterRender._filterCheckBoxListener('#' + calendarMainId + ' #region-types input', allRegions);

  calendarFilterRender._filterCheckBoxListener('#' + calendarMainId + ' #product-types input', allProducts);

  calendarFilterRender._calendarClickEvents();
};

CalendarFilterRender.prototype._resizeFilterColumn = function () {
  var calendarFilterRender = this;

  var cwidth =
    calendarFilterRender._$searchFilter.width() -
    $('.mcol-1').width() -
    $('.mcol-2').width() -
    $('.mcol-3').width() -
    5;
  if ($(window).width() &lt; 769) {
    cwidth = calendarFilterRender._$searchFilter.width() - 5;
  } else if ($(window).width() &lt; 992) {
    cwidth = $('.mcol-2').width() - 5;
  }
  $('.mcol-4').css('width', cwidth + 'px');
};

CalendarFilterRender.prototype._getTagName = function (tagTitleAndTagNameMap, titleList) {
  const tagNameList = [];

  titleList.forEach((key) =&gt; {
    if (tagTitleAndTagNameMap[key]) {
      tagNameList.push(tagTitleAndTagNameMap[key]);
    }
  });

  return tagNameList;
};

CalendarFilterRender.prototype._getSelectedFilterMap = function () {
  var calendarFilterRender = this;
  var selectedFilterMap = {};

  var selectedEventTypeFilterVal = _getCheckedValues(this._$searchType.find('table tbody'));
  var selectedRegionFilterVal = _getCheckedValues(this._$regionType.find('table tbody'));
  var selectedProductTypeFilterVal = _getCheckedValues(this._$productType.find('table tbody'));

  selectedEventTypeFilterVal = selectedEventTypeFilterVal.filter(function (v) {
    return v !== calendarFilterRender._allTypes;
  });
  selectedRegionFilterVal = selectedRegionFilterVal.filter(function (v) {
    return v !== calendarFilterRender._allRegions;
  });
  selectedProductTypeFilterVal = selectedProductTypeFilterVal.filter(function (v) {
    return v !== calendarFilterRender._allProducts;
  });

  if (selectedEventTypeFilterVal &amp;&amp; selectedEventTypeFilterVal.length) {
    selectedFilterMap[CONST_FUSION_TAG_ROOTS.EVENT_TYPE] = calendarFilterRender._getTagName(
      calendarFilterRender._eventTagMap,
      selectedEventTypeFilterVal
    );
  }
  if (selectedRegionFilterVal &amp;&amp; selectedRegionFilterVal.length) {
    selectedFilterMap[CONST_FUSION_TAG_ROOTS.EVENT_REGION] = calendarFilterRender._getTagName(
      calendarFilterRender._regionTagMap,
      selectedRegionFilterVal
    );
  }

  if (selectedProductTypeFilterVal &amp;&amp; selectedProductTypeFilterVal.length) {
    selectedFilterMap[CONST_FUSION_TAG_ROOTS.PRODUCTS_AND_SOLUTIONS] = calendarFilterRender._getTagName(
      calendarFilterRender._productTagMap,
      selectedProductTypeFilterVal
    );
  }

  return selectedFilterMap;
};

CalendarFilterRender.prototype._getDefaultFilterVal = function (defaultTagsFromPage, defaultTagsFromParameter) {
  if (defaultTagsFromPage &amp;&amp; defaultTagsFromParameter) {
    return [].concat(defaultTagsFromPage, defaultTagsFromParameter);
  } else if (defaultTagsFromPage) {
    return defaultTagsFromPage;
  } else if (defaultTagsFromParameter) {
    return defaultTagsFromParameter;
  } else {
    return [];
  }
};

CalendarFilterRender.prototype.renderFilter = function () {
  var calendarFilterRender = this;

  if (this._calendarFilterModal.isNewSearch()) {
    calendarFilterRender.initDropBox();
  }

  calendarFilterRender._renderSortByFilterText();
  calendarFilterRender._renderRegionFilterText();
  calendarFilterRender._renderSearchTypeFilterText();

  calendarFilterRender._renderProductFilterText();
  calendarFilterRender._resizeFilterColumn();
  calendarFilterRender._selectButtonClickEvent();
};

CalendarFilterRender.prototype.initDropBox = function () {
  var calendarFilterRender = this;

  var htmltext = calendarFilterRender._applyDefaultSortType();
  htmltext += '&lt;hr&gt;';
  htmltext += '&lt;div class="date-range-label"&gt;' + Granite.I18n.get('Date Range') + ':&lt;/div&gt;';
  htmltext +=
    '&lt;div class="form-group"&gt;\n' +
    '&lt;div class="input-daterange input-group" id="rangepicker"&gt;\n' +
    '&lt;input type="text" autocomplete="off" class="input-sm form-control" name="rangeStart" id="rangeStart"/&gt;\n' +
    '&lt;span class="input-group-addon"&gt;-&lt;/span&gt;\n' +
    '&lt;input type="text" autocomplete="off" class="input-sm form-control" name="rangeEnd" id="rangeEnd"/&gt;\n' +
    '&lt;/div&gt;\n' +
    '&lt;/div&gt;';
  htmltext +=
    "&lt;label&gt;&lt;input type='checkbox' id='descending' value='EVENT_DATE_DESC unchecked'&gt;" +
    Granite.I18n.get('Descending order') +
    '&lt;/label&gt;';
  calendarFilterRender._$sortType.empty();
  calendarFilterRender._$sortType.html(htmltext);

  htmltext = _buildTagTable(calendarFilterRender._eventTags, allTypes);
  calendarFilterRender._$searchType.empty();
  calendarFilterRender._$searchType.html(htmltext);
  _applyDefaultChecks(
    calendarFilterRender._getDefaultFilterVal(
      calendarFilterRender._eventTagDefaults,
      calendarFilterRender._eventTagFromParameter
    ),
    calendarFilterRender._$searchType
  );

  htmltext = _buildTagTable(calendarFilterRender._regionTags, allRegions);
  calendarFilterRender._$regionType.empty();
  calendarFilterRender._$regionType.html(htmltext);
  _applyDefaultChecks(
    calendarFilterRender._getDefaultFilterVal(
      calendarFilterRender._regionTagDefaults,
      calendarFilterRender._regionTagFromParameter
    ),
    calendarFilterRender._$regionType
  );

  htmltext = _buildTagTable(calendarFilterRender._productTags, allProducts);
  calendarFilterRender._$productType.empty();
  calendarFilterRender._$productType.html(htmltext);
  _applyDefaultChecks(
    calendarFilterRender._getDefaultFilterVal(
      calendarFilterRender._productTagDefaults,
      calendarFilterRender._productTagFromParameter
    ),
    calendarFilterRender._$productType
  );

  if (this._calendarFilterModal.getDefaultDates().length === 0) {
    calendarFilterRender._$calendarMain.find('#descending').attr('disabled', true);
  }
  if (this._calendarFilterModal.isDescending() === 'true') {
    calendarFilterRender._$calendarMain.find('#descending').prop('checked', true);
  }

  _sortClickEvent(calendarFilterRender._$sortType);
};

CalendarFilterRender.prototype.getTagsFromParameter = function (parameterName) {
  const searchParams = new URLSearchParams(window.location.search);
  var parameterNameArray = parameterName + '[]';

  if (searchParams.has(parameterNameArray)) {
    return searchParams.getAll(parameterNameArray);
  } else {
    return [];
  }
};

CalendarFilterRender.prototype._getTagTitles = function (allTagMapJson, tagGroup) {
  if (allTagMapJson[tagGroup]) {
    return Object.keys(allTagMapJson[tagGroup]);
  } else {
    return [];
  }
};

CalendarFilterRender.prototype.init = function (tagDefaults, allTagMap) {
  var calendarFilterRender = this;

  calendarFilterRender._$sortType = calendarFilterRender._$calendarMain.find('#sort-types');
  calendarFilterRender._$searchType = calendarFilterRender._$calendarMain.find('#search-types');
  calendarFilterRender._$regionType = calendarFilterRender._$calendarMain.find('#region-types');
  calendarFilterRender._$productType = calendarFilterRender._$calendarMain.find('#product-types');
  calendarFilterRender._$resultTextInput = calendarFilterRender._$calendarMain.find('#search-term');
  calendarFilterRender._$searchFilter = calendarFilterRender._$calendarMain.find('#search-filters');

  calendarFilterRender._selectedRegionTags = [];
  calendarFilterRender._selectedEventTags = [];
  calendarFilterRender._selectedProductTags = [];

  calendarFilterRender._parsedMap = JSON.parse(tagDefaults);
  calendarFilterRender._tagMapJson = JSON.parse(allTagMap);

  calendarFilterRender._eventTagDefaults = calendarFilterRender._parsedMap[CONST_FUSION_TAG_ROOTS.EVENT_TYPE];
  calendarFilterRender._regionTagDefaults = calendarFilterRender._parsedMap[CONST_FUSION_TAG_ROOTS.EVENT_REGION];
  calendarFilterRender._productTagDefaults =
    calendarFilterRender._parsedMap[CONST_FUSION_TAG_ROOTS.PRODUCTS_AND_SOLUTIONS];

  calendarFilterRender._eventTagFromParameter = calendarFilterRender.getTagsFromParameter(
    CONST_FUSION_TAG_ROOTS.EVENT_TYPE
  );
  calendarFilterRender._regionTagFromParameter = calendarFilterRender.getTagsFromParameter(
    CONST_FUSION_TAG_ROOTS.EVENT_REGION
  );
  calendarFilterRender._productTagFromParameter = calendarFilterRender.getTagsFromParameter(
    CONST_FUSION_TAG_ROOTS.PRODUCTS_AND_SOLUTIONS
  );

  calendarFilterRender._eventTags = calendarFilterRender._getTagTitles(
    calendarFilterRender._tagMapJson,
    CONST_FUSION_TAG_ROOTS.EVENT_TYPE
  );
  calendarFilterRender._regionTags = calendarFilterRender._getTagTitles(
    calendarFilterRender._tagMapJson,
    CONST_FUSION_TAG_ROOTS.EVENT_REGION
  );
  calendarFilterRender._productTags = calendarFilterRender._getTagTitles(
    calendarFilterRender._tagMapJson,
    CONST_FUSION_TAG_ROOTS.PRODUCTS_AND_SOLUTIONS
  );

  calendarFilterRender._eventTagMap = calendarFilterRender._tagMapJson[CONST_FUSION_TAG_ROOTS.EVENT_TYPE];
  calendarFilterRender._regionTagMap = calendarFilterRender._tagMapJson[CONST_FUSION_TAG_ROOTS.EVENT_REGION];
  calendarFilterRender._productTagMap = calendarFilterRender._tagMapJson[CONST_FUSION_TAG_ROOTS.PRODUCTS_AND_SOLUTIONS];

  calendarFilterRender._allRegions = Granite.I18n.get(allRegions);
  calendarFilterRender._allTypes = Granite.I18n.get(allTypes);
  calendarFilterRender._allProducts = Granite.I18n.get(allProducts);
};

function RegisterEventUtil(currentPage) {
  this._currentPage = currentPage;
}

var CONST = {
  ATTEND_AHEAD_MIN: 60,
  MONITOR_REGISTERED_EVENT_INTERVAL_MILLI_SECONDS: 60000,
  ADOBE_CONNECT_REGISTRATION_PATH: '.adobeconnect.register.json',
  ADOBE_CONNECT_JOIN_PATH: '.adobeconnect.join.json',
};

RegisterEventUtil.prototype.getJoinUrl = function () {
  return this._currentPage + CONST.ADOBE_CONNECT_JOIN_PATH;
};

RegisterEventUtil.prototype.getRegisterUrl = function () {
  return this._currentPage + CONST.ADOBE_CONNECT_REGISTRATION_PATH;
};

RegisterEventUtil.prototype.isTimeToShowAttendLink = function (startDate, endDate) {
  var now = moment();
  var startDateLocal = moment.utc(startDate, 'MM/DD/YYYY HH:mm').local();
  var startDateBuffer = startDateLocal.subtract(CONST.ATTEND_AHEAD_MIN, 'minute');
  var endDateLocal = moment.utc(endDate, 'MM/DD/YYYY HH:mm').local();

  if (endDateLocal.isValid()) {
    return now.isAfter(startDateBuffer) &amp;&amp; now.isBefore(endDateLocal);
  }
  return now.isAfter(startDateBuffer);
};

RegisterEventUtil.prototype.isTimeToReplaceAttendLink = function (startDate, endDate) {
  var endDateLocal = moment.utc(endDate, 'MM/DD/YYYY HH:mm').local();
  var endDateBuffer = endDateLocal.add(CONST.ATTEND_AHEAD_MIN, 'minute');

  if (endDateBuffer.isValid()) {
    return moment().isAfter(moment(endDateBuffer).local());
  }
  return true;
};

RegisterEventUtil.prototype.isRegisteredBtn = function (registeredBtn) {
  return !!registeredBtn &amp;&amp; registeredBtn.classList.contains('registered-btn');
};

RegisterEventUtil.prototype.isAttendBtn = function (registeredBtn) {
  return !this.isRegisteredBtn(registeredBtn);
};

RegisterEventUtil.prototype.changeAttendBtnToRegisteredBtn = function (theRegisteredBtn) {
  theRegisteredBtn.setAttribute('href', '#');
  theRegisteredBtn.classList.add('registered-btn');
  theRegisteredBtn.text = 'Register';
};

RegisterEventUtil.prototype.changeRegisteredBtnToAttendBtn = function (registeredBtn, adobeConnectRoomId) {
  var thisRegisterEventUtil = this;

  new FUSION.Ajax()
    .fetchData({ adobeConnectRoomId: adobeConnectRoomId }, thisRegisterEventUtil.getJoinUrl())
    .done(function (resp) {
      if (resp &amp;&amp; resp.success &amp;&amp; resp.data &amp;&amp; resp.data.joinUrl) {
        registeredBtn.setAttribute('href', resp.data.joinUrl);
        registeredBtn.setAttribute('data-path', resp.data.joinUrl);
        registeredBtn.setAttribute('onclick', 'FUSION.trackDashboardEventJoin(this)');
        registeredBtn.classList.remove('registered-btn');
        registeredBtn.classList.add('events-attend');
        registeredBtn.text = Granite.I18n.get('Attend');
      }
    })
    .fail(function (jqXHR, textStatus, errorThrown) {
      console.error('_bindRegisterAdobeConnectEvent failed.', jqXHR);
    });
};

RegisterEventUtil.prototype.monitorRegisteredEvents = function ($container) {
  var thisRegisterEventUtil = this;

  $container.find('.events-registered').each(function () {
    var registeredBtn = this;
    var adobeConnectRoomId = registeredBtn.dataset.adobeConnectRoomId;
    var startDate = registeredBtn.dataset.startDate;
    var endDate = registeredBtn.dataset.endDate;

    if (
      thisRegisterEventUtil.isRegisteredBtn(registeredBtn) &amp;&amp;
      thisRegisterEventUtil.isTimeToShowAttendLink(startDate, endDate)
    ) {
      thisRegisterEventUtil.changeRegisteredBtnToAttendBtn(registeredBtn, adobeConnectRoomId);
    } else if (
      thisRegisterEventUtil.isAttendBtn(registeredBtn) &amp;&amp;
      thisRegisterEventUtil.isTimeToReplaceAttendLink(startDate, endDate)
    ) {
      thisRegisterEventUtil.changeAttendBtnToRegisteredBtn(registeredBtn);
    }
  });
};

RegisterEventUtil.prototype.handleRegisterSuccess = function (registerBtn) {
  var $registerBtn = $(registerBtn);
  $registerBtn.empty();
  $registerBtn.text(Granite.I18n.get('Registered'));
  $registerBtn.removeClass('events-register');
  $registerBtn.addClass('events-registered');
};

RegisterEventUtil.prototype.handleRegisterFailed = function (registerBtn) {
  var $registerBtn = $(registerBtn);
  $registerBtn.empty();
  $registerBtn.text(Granite.I18n.get('Register'));

  var $msgSpan = $(registerBtn.nextSibling);
  $msgSpan.text('Try again');
  $msgSpan.show();
  $msgSpan.fadeOut(2000);
};

RegisterEventUtil.prototype.startSpinner = function (registerBtn) {
  var $registerBtn = $(registerBtn);
  var btnWidth = $registerBtn.width();
  var $spinner = $('&lt;i class="fa fa-spinner fa-spin"&gt;&lt;/i&gt;');

  $spinner.width(btnWidth);
  $registerBtn.empty();
  $registerBtn.append($spinner);
};

RegisterEventUtil.prototype.bindSignInToRegisterEvent = function ($container) {
  var $loginModal = $container.find('#signUpToRegisterLoginModal');

  $container.on('click', '.sign-in-to-register', function (event) {
    event.preventDefault();

    var targetEventPath = this.dataset.eventPath;
    $loginModal.find('a.btn').each(function () {
      var $loginLink = $(this);
      $loginLink.attr('href', $loginLink.data().loginPath + '?resource=' + targetEventPath);
    });

    $loginModal.show().scrollTop(0);
  });

  var $closeDiv = $loginModal.find('.close');
  $closeDiv.click(function (e) {
    $loginModal.hide();
  });

  window.onclick = function (event) {
    if (event.target === $loginModal) {
      $loginModal.hide();
    }
  };

  $(document).keyup(function (e) {
    if (e.key === 'Escape') {
      $loginModal.hide();
    }
  });
};

RegisterEventUtil.prototype.bindRegisterAdobeConnectEvent = function ($container) {
  var thisRegisterEventUtil = this;

  $container.on('click', '.events-register', function (event) {
    event.preventDefault();
    FUSION.trackDashboardEventRegister(this);
    var thisEvent = $(this)[0];

    thisRegisterEventUtil.startSpinner(thisEvent);
    if (thisEvent &amp;&amp; thisEvent.dataset) {
      var adobeConnectRoomId = thisEvent.dataset.adobeConnectRoomId;

      new FUSION.Ajax()
        .postData({ adobeConnectRoomId: adobeConnectRoomId }, thisRegisterEventUtil.getRegisterUrl())
        .done(function (resp) {
          if (resp &amp;&amp; resp.success &amp;&amp; resp.data) {
            if (resp.data.success) {
              thisRegisterEventUtil.handleRegisterSuccess(thisEvent);
            } else {
              thisRegisterEventUtil.handleRegisterFailed(thisEvent);
            }
          }
        })
        .fail(function (jqXHR, textStatus, errorThrown) {
          console.error('_bindRegisterAdobeConnectEvent failed.', jqXHR);
        });
    }
  });
};

RegisterEventUtil.prototype.unbindClickEvents = function ($container) {
  $container.off('click', '.events-register');
};

RegisterEventUtil.prototype.bindRegisteredAdobeConnectEvent = function ($container) {
  var thisRegisterEventUtil = this;

  thisRegisterEventUtil.monitorRegisteredEvents($container);
  setInterval(function () {
    thisRegisterEventUtil.monitorRegisteredEvents($container);
  }, CONST.MONITOR_REGISTERED_EVENT_INTERVAL_MILLI_SECONDS);
};

RegisterEventUtil.prototype.showOrHideEventButton = function ($container) {
  $container.find('.events-label').each(function () {
    var thisContainer = this;
    var isActive;
    var startDate = thisContainer.dataset.startDate;
    var endDate = thisContainer.dataset.endDate;

    var startDateLocal = moment.utc(startDate, 'MM/DD/YYYY HH:mm').local();
    var endDateLocal = moment.utc(endDate, 'MM/DD/YYYY HH:mm').local();

    var now = moment().local();
    if (endDateLocal.isValid()) {
      isActive = !now.isAfter(endDateLocal);
    } else {
      isActive = now.isSame(startDateLocal, 'day') || now.isBefore(startDateLocal);
    }

    if (isActive) {
      $(thisContainer).show();
    } else {
      $(thisContainer).hide();
    }
  });
};

RegisterEventUtil.prototype.init = function ($container) {
  var thisRegisterEventUtil = this;

  thisRegisterEventUtil.unbindClickEvents($container);
  thisRegisterEventUtil.showOrHideEventButton($container);
  thisRegisterEventUtil.bindSignInToRegisterEvent($container);
  thisRegisterEventUtil.bindRegisterAdobeConnectEvent($container);
  thisRegisterEventUtil.bindRegisteredAdobeConnectEvent($container);
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.CalendarEventsList = function (resp, pageLimit) {

    var pageLimit = pageLimit,
        tempResp = resp,

        _paginationClickEvent = function () {
            var pagButton = $(".pagination-button"),
                pagNextButton = $("#pagination-nButton"),
                pagPrevButton = $("#pagination-pButton"),
                pagSelected = $("#pagination-selected");

            pagButton.click(function (event) {
                _render(resp, Number($(this).text()) - 1);
                event.stopPropagation();
            });

            pagNextButton.click(function (event) {
                _render(resp, Number(pagSelected.text()));
                event.stopPropagation();
            });

            pagPrevButton.click(function (event) {
                _render(resp, Number(pagSelected.text()) - 2);
                event.stopPropagation();
            });
        },

        _initHbsResp = function (eventResp, pageLimit, pageSelect) {
            var $ARCHIVE_TOGGLE = $("#archive-toggle"),
                totalResults = eventResp.data.searchList.length,
                pageTotal = Math.ceil(Number(totalResults) / Number(pageLimit)),
                pageStart = 1,
                tempList,
                sliceStart = Number(pageLimit) * Number(pageSelect),
                sliceFinish = Number(sliceStart) + Number(pageLimit);
            if ($ARCHIVE_TOGGLE.is(":checked")) {
                eventResp["isArchive"] = true;
            } else {
                eventResp["isArchive"] = false;
            }
            eventResp.pagination = {
                pageStart: pageStart,
                select: Number(pageSelect) + 1,
                pageTotal: pageTotal,
                results: totalResults
            };
            if (sliceStart &gt;= 0) {
                tempList = eventResp.data.searchList.slice(sliceStart, sliceFinish);
                if (tempList.length) {
                    eventResp.data.paginatedList = tempList;
                }
            }
            return eventResp;
        },

        /**
         * _render
         *
         * @param resp
         * @param bAppend
         * @private
         */
        _render = function (resp, pageSelect) {
            var $CONTAINER = $(".eventsList-contents-goes-here"),
                LINE_LIMIT = 11,
                attr,
                parsedInt,
                dotdotdotOps,
                $LIST_TEMPLATE,
                compiledTpl,
                html,
                $html,
                $NO_RESULTS;

            try {
                attr = $CONTAINER.attr('data-truncateAfterNoOfLines');
                if (typeof attr !== typeof undefined &amp;&amp; attr !== false) {
                    parsedInt = parseInt(attr, 10);
                    if (parsedInt !== 0) {
                        LINE_LIMIT = parsedInt + 1;
                    }
                }
            } catch (e) {
                // use default;
            }
            dotdotdotOps = {
                after: "a.read-more",
                height: LINE_LIMIT * 12.31
            };
            $LIST_TEMPLATE = $("#calendarEvents-list-template");
            compiledTpl = Handlebars.compile($LIST_TEMPLATE.html());
            html = compiledTpl(_initHbsResp(resp, pageLimit, pageSelect));

            // apply dotdotdot
            $html= $(html);
            $CONTAINER.html($html);
            $html.find(".event-description").dotdotdot(dotdotdotOps);

            $NO_RESULTS = $(".no-results");

            if (resp.data.searchList == 0) {
                $NO_RESULTS.show();
            }
            _paginationClickEvent();
        },

        onReady = function(callback) {
            if (document.readyState === 'complete') {
                window.setTimeout(callback, 0);
            } else {
                window.addEventListener('load', callback, false);
            }
        };

    onReady(function() {
        _render(resp, 0);
    });
};
/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/**
 *
 * @type {{init}}
 */
FUSION.CalendarWidget = function(props) {
  /**
   * global and contstants
   */
  var DATE_FORMAT_DEFAULT = "YYYY-MM-DD";
  var CALENDAR_ENDPOINT =
    "/bin/fusion/search/event?currentPage=" + props.currentPage;
  (LIMIT_DEFAULT = 5),
    (DATERANGE_DEFAULT = 912),
    $COMP,
    $KEYWORD_INPUT,
    $TAG_INPUT,
    CAL_PATH,
    $DATE_RANGE,
    $ARCHIVE_TOGGLE,
    $SEARCH_FORM,
    $RESET_BTN,
    $BUSY_SPINNER,
    $NO_RESULTS,
    $LOAD_MORE,
    locale,
    /**
     * _isEmpty utility function
     * @param data
     * @returns {boolean}
     */
    (_isEmpty = function(data) {
      var count = 0;
      var i;
      if (
        typeof data === "number" ||
        typeof data === "boolean" ||
        typeof data === "object"
      ) {
        return false;
      }
      if (typeof data === "undefined" || data === null) {
        return true;
      }
      if (typeof data.length !== "undefined") {
        return data.length === 0;
      }
      for (i in data) {
        if (data.hasOwnProperty(i)) {
          count++;
        }
      }
      return count === 0;
    }),
    /**
     * find firsts
     *
     * @param props
     * @param startDate
     * @param bMonthView
     * @private
     */
    (_findEvents = function(props, startDate, bMonthView) {
      $NO_RESULTS.hide();
      var findEventsListQuery = {
        fulltext: "",
        offset: "0",
        limit: "10",
        sort: "EVENT_DATE_ASC",
        select: "ONLY_PAGES",
        tags: null,
        calendarPath: props.calPath,
        dates: null,
        urlPathPrefix:
          window.location.protocol +
          "//" +
          window.location.hostname +
          (window.location.port ? ":" + window.location.port : "")
      };
      var fromDate = null;
      var toDate = null;
      var startRange;
      var endRange;
      var _fetchCalendarEvents;
      // set keywords
      var keywords = $KEYWORD_INPUT.val();

      keywords = keywords.trim();
      if (!_isEmpty(keywords)) {
        findEventsListQuery.fulltext = keywords;
      } else {
        findEventsListQuery.fulltext = "";
      }

      // set tags
      if (!_isEmpty($TAG_INPUT.val())) {
        findEventsListQuery.tags = $TAG_INPUT.val();
      } else {
        findEventsListQuery.tags = null;
      }

      if ($ARCHIVE_TOGGLE.is(":checked")) {
        findEventsListQuery.sort = "EVENT_DATE_DESC";
      }

      // first check date range, use this if both are specificed
      startRange = $DATE_RANGE.find("input").get(0);
      endRange = $DATE_RANGE.find("input").get(1);
      if (!_isEmpty(startRange.value) &amp;&amp; !_isEmpty(endRange.value)) {
        // startRange and endRange takes precedence
        fromDate = moment(startRange.value);
        toDate = moment(endRange.value);
      } else if (!_isEmpty(startRange.value) &amp;&amp; _isEmpty(endRange.value)) {
        fromDate = moment(startRange.value);
        toDate = moment(fromDate).add(3, "year");
      } else {
        if (_isEmpty(startDate)) {
          fromDate = moment().startOf("day");
        } else {
          fromDate = moment(startDate);
        }

        if (bMonthView) {
          fromDate = moment(startDate).startOf("month");
          toDate = moment(startDate).endOf("month");
        } else {
          // set defaultDateRangeFilter if empty
          if (
            _isEmpty(props.defaultDateRangeFilter) ||
            parseInt(props.defaultDateRangeFilter, 10) === 0
          ) {
            props.defaultDateRangeFilter = DATERANGE_DEFAULT;
          }
          toDate = moment(fromDate).add(
            parseInt(props.defaultDateRangeFilter, 10),
            "day"
          );
        }
      }

      // update request data
      findEventsListQuery.dates =
        fromDate.format(DATE_FORMAT_DEFAULT) +
        "_" +
        toDate.format(DATE_FORMAT_DEFAULT);

      _fetchCalendarEvents = function() {
        $BUSY_SPINNER.show();
        new FUSION.Ajax()
          .fetchData(findEventsListQuery, CALENDAR_ENDPOINT)
          .done(function(resp) {
            if (resp) {
              locale = resp.data.locale;
              FUSION.CalendarEventsList(resp, props.limit);
              // show/hide no results message
            } else {
              window.console.error(
                "Failed fetching data from Calendar at " + CAL_PATH
              );
            }
          })
          .fail(function(jqXHR, textStatus, errorThrown) {
            window.console.error(
              "findCalendarEventsPromise failed. " + errorThrown
            );
          })
          .always(function() {
            // console.debug("always");
            $BUSY_SPINNER.hide();
          });
      };

      // fetch data
      _fetchCalendarEvents();
    }),
    /**
     * _getDateString
     *
     * @param d
     * @private
     */
    (_getDateString = function(d) {
      if (_isEmpty(d)) {
        return moment().format(DATE_FORMAT_DEFAULT);
      }
      return moment(d).format(DATE_FORMAT_DEFAULT);
    }),
    (resetCalendar = function() {
      var rangeStart = $DATE_RANGE.find("input[name='rangeStart']");
      var rangeEnd = $DATE_RANGE.find("input[name='rangeEnd']");
      var $COMP = $("#" + props.id);
      $COMP.datepicker("setStartDate", null);
      $COMP.datepicker("setEndDate", null);
      $COMP.datepicker("setDate", moment().format("YYYY-MM-DD"));
      rangeStart.datepicker("setStartDate", null);
      rangeStart.datepicker("clearDates");
      rangeEnd.datepicker("setEndDate", null);
      rangeEnd.datepicker("clearDates");
    }),
    /**
     * init
     *
     * @param props
     * @private
     */
    (_init = function(props) {
      var archiveStageChanging = false;
      var ressetingState = false;
      var regionLang = props.language.split("_")[1];
      var rangeEnd = $("#rangeEnd");
      if (regionLang === "zh") {
        regionLang = "zh-CN";
      }
      /**
       * Set defaults if empty
       */
      if (_isEmpty(props.limit)) {
        props.limit = LIMIT_DEFAULT;
      }

      if (props.hasOwnProperty("id") &amp;&amp; props.id) {
        $COMP = $("#" + props.id);
        $KEYWORD_INPUT = $("#keywordInput");
        $TAG_INPUT = $("#tagInput");
        $DATE_RANGE = $(".input-daterange");
        $ARCHIVE_TOGGLE = $("#archive-toggle");
        $SEARCH_FORM = $("#searchForm");
        $RESET_BTN = $SEARCH_FORM.find(".reset-btn");
        $BUSY_SPINNER = $(".loading-icon-wrapper");
        $NO_RESULTS = $(".no-results");
        $LOAD_MORE = $(".load-more-btn");

        $SEARCH_FORM.submit(function(e) {
          e.preventDefault();
          _findEvents(props, _getDateString(), false);
          return false;
        });
        $RESET_BTN.off().on("click", function(e) {
          e.preventDefault();
          window.console.debug("Resetting...");
          resetCalendar();
          ressetingState = true;
          $SEARCH_FORM.trigger("reset");
          return false;
        });

        $SEARCH_FORM.on("reset", function(e) {
          setTimeout(function() {
            ressetingState = false;
            _findEvents(props, _getDateString(), false);
          }, 100);
        });
        $.getScript(
          "/etc/clientlibs/adobe-fusion/clientlib-datepicker-js/locales/bootstrap-datepicker." +
            regionLang +
            ".min.js",
          function() {
            if ($COMP) {
              $COMP
                .off("show")
                .on("show", function(e) {
                  window.console.debug("Fired show");
                  _findEvents(props, _getDateString(), false);
                })
                .datepicker({
                  format: "yyyy-mm-dd",
                  maxViewMode: 2,
                  startDate: "-3y",
                  endDate: "+3y",
                  todayHighlight: props.todayBtn,
                  toggleActive: props.toggleActive === "true",
                  clearBtn: props.clearBtn === "true",
                  todayBtn: props.todayBtn === "true" ? "linked" : false,
                  language: regionLang,
                  keepEmptyValues: true
                })
                .datepicker("clearDates")
                .off("changeDate")
                .on("changeDate", function(e) {
                  if (!archiveStageChanging) {
                    window.console.debug("Fired changeDate");

                    if (e.dates.length === 0) {
                      _findEvents(props, _getDateString(), true);
                    } else {
                      _findEvents(props, _getDateString(e.date), false);
                    }
                  }
                })
                .off("changeMonth")
                .on("changeMonth", function(e) {
                  window.console.debug("Fired changeMonth");
                  _findEvents(props, _getDateString(e.date), false);
                });
              $COMP.datepicker("setDate", moment().format("YYYY-MM-DD"));
            }
            // initialize date range inputs
            $DATE_RANGE
              .datepicker({
                language: regionLang,
                container: "#datepicker-container",
                orientation: "top",
                maxViewMode: 2,
                startDate: "-3y",
                endDate: "+3y",
                keepEmptyValues: true,
                autoclose: true
              })
              .on("hide", function() {
                if (!rangeEnd.is(":focus")) {
                  rangeEnd.focus();
                }
              });

            // Add change handler to archive toggle
            $ARCHIVE_TOGGLE.off("change").on("change", function(e) {
              archiveStageChanging = true;

              var rangeStart = $DATE_RANGE.find("input[name='rangeStart']");
              var rangeEnd = $DATE_RANGE.find("input[name='rangeEnd']");
              // first check date range, use this if both are specificed
              var startRange = $DATE_RANGE.find("input").get(0);
              var endRange = $DATE_RANGE.find("input").get(1);
              var fromDate;
              var toDate;
              var lastYear;
              var yesterday;
              var dateRangeDefined = false;

              if (!_isEmpty(startRange.value) &amp;&amp; !_isEmpty(endRange.value)) {
                fromDate = moment(startRange.value);
                toDate = moment(endRange.value);
                dateRangeDefined = true;
              }

              if ($(this).prop("checked")) {
                if (dateRangeDefined) {
                  // startRange and endRange takes precedence
                  $COMP.datepicker(
                    "setStartDate",
                    fromDate.format("YYYY-MM-DD")
                  );
                  $COMP.datepicker("setEndDate", toDate.format("YYYY-MM-DD"));
                } else {
                  lastYear = moment()
                    .subtract(13, "months")
                    .startOf("month");
                  yesterday = moment().subtract(1, "days");
                  $COMP.datepicker(
                    "setStartDate",
                    lastYear.format("YYYY-MM-DD")
                  );
                  $COMP.datepicker(
                    "setEndDate",
                    yesterday.format("YYYY-MM-DD")
                  );
                  rangeStart.datepicker(
                    "setStartDate",
                    lastYear.format("MM/DD/YYYY")
                  );
                  rangeStart.datepicker(
                    "setDate",
                    lastYear.format("MM/DD/YYYY")
                  );
                  rangeEnd.datepicker(
                    "setEndDate",
                    yesterday.format("MM/DD/YYYY")
                  );
                  rangeEnd.datepicker(
                    "setDate",
                    yesterday.format("MM/DD/YYYY")
                  );
                }
              } else {
                resetCalendar();
                $SEARCH_FORM.trigger("reset");
              }

              archiveStageChanging = false;
              if (!ressetingState) {
                $SEARCH_FORM.submit();
              }
            });
          }
        );
      }
    }),
    (onReady = function(callback) {
      if (document.readyState === "complete") {
        window.setTimeout(callback, 0);
      } else {
        window.addEventListener("load", callback, false);
      }
    });

  onReady(function() {
    _init(props);
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.trackAssetList = function (el) {
  var formatUtil = new FUSION.Formatter();
  var propUtil = new FUSION.Properties();
  var decodedValues = formatUtil.setVal(el.dataset.analytics).decodeEscapeSequence().getVal();
  var analytics = JSON.parse(decodedValues);
  var A = FUSION.ANALYTICS;
  var analyze = new FUSION.AnalyticsBuilder(A.SET_PTS.PAGE.ASSET_LIST);
  if (propUtil.checkNull(el.dataset.key)) {
    var key = formatUtil.setVal(el.dataset.key).decodeUnicodeSequence().getVal();
    analyze.putEventData(A.KEYS.DESTINATION_LINK, key, true);
  } else {
    analyze.putEventData(A.KEYS.DESTINATION_LINK, analytics.principalAsset, true);
  }
  analyze
    .putEventData(A.KEYS.IS_GATED, analytics.isGated, true)
    .putEventData(A.KEYS.LANGUAGE, analytics.language, true)
    .putEventData(A.KEYS.PRINCIPAL_ASSET, analytics.principalAsset, true)
    .setEvent(A.EV.CLICK.ASSET_LIST)
    .track();
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

/* global Granite */
FUSION.AssetList = function (randomId) {
  var _formatModifiedDate = function () {
    var date;
    var formattedDate;
    var browserLang;
    var options = { year: 'numeric', month: 'numeric', day: 'numeric' };
    var $this;
    $('#' + randomId)
      .find('.item-date-text')
      .each(function () {
        $this = $(this);
        date = new Date(moment($this.html(), 'MM/DD/YYYY'));
        browserLang = window.navigator.userLanguage || window.navigator.language;
        formattedDate = date.toLocaleDateString(browserLang, options);
        $this.text(Granite.I18n.get('Last updated') + ': ' + formattedDate);
        $this.css('display', 'block');
      });
  };

  var _bindEmailClick = function () {
    $('#' + randomId)
      .find('.result-email-container')
      .click(function () {
        const subject = this.dataset.subject;
        const body = this.dataset.body;
        const link = this.dataset.link;
        const path = this.dataset.path;
        let mailToUrl = 'mailto:?';

        if (subject) {
          mailToUrl += 'subject=' + subject;
        }

        mailToUrl += '&amp;body=';

        if (body) {
          mailToUrl += body + '%0D%0A%0D%0A';
        }
        if (link) {
          mailToUrl += link + '%0D%0A%0D%0A';
        }
        if (path) {
          mailToUrl += location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + path;
        }

        window.location.href = mailToUrl;
      });
  };

  var onReady = function (callback) {
    if (document.readyState === 'complete') {
      window.setTimeout(callback, 0);
    } else {
      window.addEventListener('load', callback, false);
    }
  };

  onReady(function () {
    _formatModifiedDate();
    _bindEmailClick();
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};

FUSION.adobePublicProfileServiceCheckerComponent = function () {
  var ajax = new FUSION.Ajax();

  var startSpinner = function ($submitBtn) {
    var btnWidth = $submitBtn.width();
    var $spinner = $('&lt;i class="fa fa-spinner fa-spin"&gt;&lt;/i&gt;');

    $spinner.width(btnWidth);
    $submitBtn.empty();
    $submitBtn.append($spinner);
  };

  var stopSpinner = function ($submitBtn) {
    $submitBtn.empty();
    $submitBtn.text(Granite.I18n.get('SUBMIT'));
  };

  var displayJsonToTextArea = function ($textarea, resp) {
    if (resp.success) {
      $textarea.val(JSON.stringify(resp.data, undefined, 4));
    } else {
      $textarea.val(resp.errorMessage);
    }
  };

  $('#submit').click(function () {
    var $submitBtn = $(this);
    startSpinner($submitBtn);

    var currentPath = window.location.pathname;
    var pathWithoutExtension = currentPath.replace(/\.[^/.]+$/, '');

    ajax
      .postData({ email: $('#email').val() }, pathWithoutExtension + '.adobe.public.profile.service.json')
      .then(function (adobePublicProfileResp) {
        stopSpinner($submitBtn);

        if (adobePublicProfileResp) {
          displayJsonToTextArea($('#result'), adobePublicProfileResp);
        } else {
          window.console.error('Failed to get registered event');
        }
      })
      .fail(function (error) {
        stopSpinner($submitBtn);
        window.console.error('Error occurred retrieving profile image', error);
      });
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};
var TinyColor = window.tinycolor || {};

// Accordion Documentation: http://app.aceui.corp.adobe.com/exchange/develop/#components-accordion-default
FUSION.AccordionSection = function(randomId, backgroundColor, opacity) {
  var applyStyles = function() {
    var color = TinyColor(backgroundColor)
      .setAlpha(opacity)
      .toRgbString();
    /** accordion-section div is being dynamically replaced. Have to grab the
     * title and it's sibling in this awkward way. **/
    var title = document.getElementById(randomId);
    var content = title.nextElementSibling;
    if (
      !!title &amp;&amp;
      !!title.classList.contains("accordion-title") &amp;&amp;
      !!content &amp;&amp;
      !!content.classList.contains("accordion-content")
    ) {
      for (var section of [title, content]) {
        section.style.background = color;
      }
    }
  };

  if (backgroundColor) {
    applyStyles();
  }
};

var publishClick = function(el) {
  var videoResize = FUSION.SUB_EVTS.VIDEO_RESIZE;
  PUB_SUB.publish(videoResize.EVENT, videoResize.ACTIONS.ACCORDION_CLICK, {
    id: el.id
  });
};

/**
 *
 * @type {{}}
 */
var FUSION = window.FUSION || {};
var TinyColor = window.tinycolor || {};

// Accordion Documentation: http://app.aceui.corp.adobe.com/exchange/develop/#components-accordion-default
FUSION.AccordionComponent = function(randomId, backgroundColor, opacity) {
  var options = {
    namespace: 'data-accordion-',
    activeClass: 'active'
  };

  var $accordion = $('#' + randomId);
  var iconClass = $accordion.attr(options.namespace + 'icon-class') || 'glyphicon';
  var activeIcon = $accordion.attr(options.namespace + 'icon-active') || 'glyphicon-chevron-down';
  var inactiveIcon = $accordion.attr(options.namespace + 'icon-inactive') || 'glyphicon-chevron-right';
  var $accordionSections = $accordion.find('&gt; .accordion-section');
  var accordionType = $accordion.attr(options.namespace + 'type');

  var applyStyle = function() {
    var color = TinyColor(backgroundColor)
    .setAlpha(opacity)
    .toRgbString();
    document.getElementById(randomId).style.backgroundColor = color;
  };

  var toggleOne = function (element) {
    // add active class to the section and slide the content
    var $accordionSection = $(element).closest('.accordion-section');

    $accordionSection.toggleClass(options.activeClass);
    $accordionSection.find('.accordion-content').first().slideToggle(350);
    // find the div with the icon class and change it for the active accordion
    $accordionSection.find('.' + iconClass).first()
    .toggleClass(activeIcon + ' ' + inactiveIcon);
  };

  // close all the accordions
  var collapseAll = function () {
    $.each($accordionSections, function (i, section) {
      if (typeof $(section).attr(options.namespace + 'expanded') !== 'undefined') {
        return;
      }
      // remove the active class and change the icon class for the closing accordions
      var $section = $(section);
      $section.removeClass(options.activeClass);
      $section.find('&gt; .accordion-content').slideUp(350);
      $section.find('.' + iconClass).first().removeClass(activeIcon).addClass(inactiveIcon);
    });
  };

  // open all the accordions
  var expandAll = function () {
    $.each($accordionSections, function (i, section) {
      // remove the active class and change the icon class for the closing accordions
      var $section = $(section);
      $section.addClass(options.activeClass);
      $section.find('&gt; .accordion-content').slideDown(100);
      $section.find('.' + iconClass).first().addClass(activeIcon).removeClass(inactiveIcon);
    });
  }

  // set icon classes from data attributes and open necessary accordions
  $.each($accordionSections, function (i, accordionSection) {
    var $accordionSection = $(accordionSection);
    // check if an accordion will always be opened or if an accordion should be opened on page load
    if (typeof $accordionSection.attr(options.namespace + 'expanded') !== 'undefined' || $accordionSection.hasClass('active')) {

      $accordionSection.find('&gt; .accordion-content').show();
      $accordionSection.find('.accordion-icon').first().addClass(iconClass + ' ' + activeIcon);

    } else {
      $accordionSection.find('.accordion-icon').first().addClass(iconClass + ' ' + inactiveIcon);
    }
  });

  $accordion.children().on('click', '&gt; .accordion-title', function (element) {
    element = $(element.target).closest('.accordion-title');

    // if the section has the expanded attribute do nothing
    if (typeof $(element).closest('.accordion-section').attr(options.namespace + 'expanded') !== 'undefined') {
      return;
    }

    if (accordionType === 'one-active') {
      if ($(element).closest('.accordion-section').hasClass(options.activeClass)) {
        toggleOne(element);
        return;
      }

      collapseAll();
      toggleOne(element);
    } else {
      toggleOne(element);
    }
  });

  $accordion.on('click', '.accordion-button', function (element) {
    if ($(element.target).attr(options.namespace + 'button') === 'expand-all') {
      expandAll();
    } else {
      collapseAll();
    }
  })

  if (backgroundColor) {
    applyStyle();
  }

};

</pre></body></html>